/**
 * Modal Styles
 * 统一的模态框样式
 */

/* 模态框遮罩 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
}

/* 模态框内容 */
.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    min-width: 320px;
}

/* 模态框尺寸 */
.modal-content.small {
    max-width: 400px;
    width: 100%;
}

.modal-content.medium {
    max-width: 600px;
    width: 100%;
}

.modal-content.large {
    max-width: 800px;
    width: 100%;
}

/* 模态框头部 */
.modal-header {
    padding: 24px 28px;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #C1302E 0%, #8B0000 100%);
    position: relative;
}

.modal-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.modal-header h3 {
    font-size: 1.25rem;
}

.modal-header h2 i,
.modal-header h3 i {
    margin-right: 8px;
    color: #FFD700;
    font-size: 1.1em;
}

/* 关闭按钮 */
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #666;
}

/* 模态框主体 */
.modal-body {
    padding: 28px;
    flex: 1;
    overflow-y: auto;
}

/* 模态框底部 */
.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #fafafa;
}

/* 模态框按钮 */
.modal-footer button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

.modal-footer button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.modal-footer button:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* 主按钮 - 使用.btn-primary类 */
.modal-footer button.primary,
.modal-footer .btn-primary {
    background: linear-gradient(135deg, #D4605A 0%, #A8324A 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(212, 96, 90, 0.3);
}

.modal-footer button.primary:hover,
.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #B84A4A 0%, #8A2430 100%);
    box-shadow: 0 4px 12px rgba(212, 96, 90, 0.4);
}

/* 次要按钮 - 使用.btn-secondary类 */
.modal-footer button:not(.primary):not(.btn-primary):not(.btn-secondary):not(.btn-success) {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
}

.modal-footer button:not(.primary):not(.btn-primary):not(.btn-secondary):not(.btn-success):hover {
    background: #e8e8e8;
    border-color: #d0d0d0;
}

/* 成功按钮 - 使用.btn-success类 */
.modal-footer .btn-success {
    background: linear-gradient(135deg, #5AAC7F 0%, #3D8B6A 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(90, 172, 127, 0.3);
}

.modal-footer .btn-success:hover {
    background: linear-gradient(135deg, #4A9A6A 0%, #2D7A5A 100%);
    box-shadow: 0 4px 12px rgba(90, 172, 127, 0.4);
}

/* 次要按钮 - 使用.btn-secondary类 */
.modal-footer .btn-secondary {
    background: linear-gradient(135deg, #7A8A9A 0%, #5A6A7A 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(122, 138, 154, 0.3);
}

.modal-footer .btn-secondary:hover {
    background: linear-gradient(135deg, #6A7A8A 0%, #4A5A6A 100%);
    box-shadow: 0 4px 12px rgba(122, 138, 154, 0.4);
}

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

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

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

@keyframes slideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-30px);
        opacity: 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .modal-header {
        padding: 20px 24px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 24px;
    }
    
    .modal-footer {
        padding: 16px 24px;
    }
    
    .modal-footer button {
        padding: 10px 20px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .modal-content.small,
    .modal-content.medium,
    .modal-content.large {
        max-width: 100%;
        margin: 20px;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-header h2 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 12px 20px;
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-footer button {
        width: 100%;
        padding: 12px;
    }
}

/* 防止页面滚动 */
body.modal-open {
    overflow: hidden;
}