/**
 * 通用弹窗组件样式
 * 适配深色主题，与项目整体风格保持一致
 */

/* 弹窗遮罩层 */
.custom-modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.3s ease;
}

/* 显示状态 */
.custom-modal-overlay.show {
    display: block !important;
}

/* 弹窗内容容器 */
.custom-modal-content {
    position: relative;
    background-color: #1d232a;
    margin: 15% auto;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    border: 1px solid #30363d;
}

/* 弹窗头部 */
.custom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #30363d;
    background-color: #161b22;
    border-radius: 8px 8px 0 0;
}

.custom-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #c9d1d9;
    margin: 0;
}

.custom-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #8b949e;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.custom-modal-close:hover {
    background-color: #21262d;
    color: #c9d1d9;
}

/* 弹窗主体 */
.custom-modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.custom-modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
}

/* 不同类型的图标样式 */
.custom-modal-icon.alert {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.custom-modal-icon.confirm {
    background-color: rgba(241, 196, 15, 0.1);
    color: #f1c40f;
}

.custom-modal-icon.prompt {
    background-color: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.custom-modal-message {
    color: #c9d1d9;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 16px;
    word-wrap: break-word;
    max-width: 100%;
}

/* 输入框组 */
.custom-modal-input-group {
    width: 100%;
    margin-top: 16px;
}

.custom-modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #30363d;
    border-radius: 6px;
    background-color: #0d1117;
    color: #c9d1d9;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.custom-modal-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.custom-modal-input::placeholder {
    color: #8b949e;
}

/* 弹窗底部 */
.custom-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #30363d;
    background-color: #161b22;
    border-radius: 0 0 8px 8px;
}

/* 按钮样式 */
.custom-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.custom-modal-btn-primary {
    background-color: #3498db;
    color: white;
}

.custom-modal-btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.custom-modal-btn-secondary {
    background-color: #6c757d;
    color: white;
}

.custom-modal-btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .custom-modal-content {
        margin: 10% auto;
        width: 95%;
        max-width: none;
    }
    
    .custom-modal-header,
    .custom-modal-body,
    .custom-modal-footer {
        padding: 16px 20px;
    }
    
    .custom-modal-icon {
        font-size: 40px;
        width: 60px;
        height: 60px;
    }
    
    .custom-modal-message {
        font-size: 14px;
    }
    
    .custom-modal-footer {
        flex-direction: column-reverse;
    }
    
    .custom-modal-btn {
        width: 100%;
        margin-bottom: 8px;
    }
}

/* 深色主题适配 */
@media (prefers-color-scheme: dark) {
    .custom-modal-content {
        background-color: #1d232a;
        border-color: #30363d;
    }
    
    .custom-modal-header,
    .custom-modal-footer {
        background-color: #161b22;
        border-color: #30363d;
    }
    
    .custom-modal-title,
    .custom-modal-message {
        color: #c9d1d9;
    }
    
    .custom-modal-input {
        background-color: #0d1117;
        border-color: #30363d;
        color: #c9d1d9;
    }
}