/* ==================== 统一现代化样式 ==================== */
/* 基于 admin_database_backup.html 的样式提取 */
/* 适用于所有管理后台和前台页面 */

/* ==================== 导航样式 ==================== */
.admin-nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.nav-actions {
    display: flex;
    gap: 10px;
}

.nav-btn {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    color: white;
    text-decoration: none;
}

.nav-btn.primary {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border-color: transparent;
}

.nav-btn.primary:hover {
    background: white;
    color: #667eea;
}

/* ==================== 页面容器 ==================== */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== 页面标题 ==================== */
.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.page-desc {
    color: #666;
    font-size: 14px;
}

/* ==================== 统计卡片 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
}

/* ==================== 按钮样式 ==================== */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* ==================== 内容卡片 ==================== */
.content-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.card-body {
    padding: 20px;
}

/* ==================== 表格样式 ==================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* ==================== 警告提示 ==================== */
.warning-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: start;
    gap: 10px;
}

.warning-icon {
    color: #ffc107;
    font-size: 20px;
}

.warning-content {
    flex: 1;
}

.warning-title {
    font-weight: bold;
    color: #856404;
    margin-bottom: 5px;
}

.warning-text {
    color: #856404;
    font-size: 14px;
}

/* ==================== 成功提示 ==================== */
.success-box {
    background: #d4edda;
    border: 1px solid #28a745;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: start;
    gap: 10px;
}

.success-icon {
    color: #28a745;
    font-size: 20px;
}

.success-content {
    flex: 1;
}

.success-title {
    font-weight: bold;
    color: #155724;
    margin-bottom: 5px;
}

.success-text {
    color: #155724;
    font-size: 14px;
}

/* ==================== 错误提示 ==================== */
.error-box {
    background: #f8d7da;
    border: 1px solid #dc3545;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: start;
    gap: 10px;
}

.error-icon {
    color: #dc3545;
    font-size: 20px;
}

.error-content {
    flex: 1;
}

.error-title {
    font-weight: bold;
    color: #721c24;
    margin-bottom: 5px;
}

.error-text {
    color: #721c24;
    font-size: 14px;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* ==================== 加载中 ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #666;
    font-size: 14px;
}

/* ==================== 深色模式适配 ==================== */
@media (prefers-color-scheme: dark) {
    /* 页面整体 */
    :root {
        color-scheme: dark;
    }

    body {
        background: #0f1419;
        color: #e8e8e8;
    }

    /* 页面标题 */
    .page-title {
        color: #ffffff;
    }

    .page-desc {
        color: #a0a0a0;
    }

    /* 统计卡片 - 保持渐变色，调整透明度 */
    .stat-card {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
    }

    /* 按钮 */
    .btn-primary {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    }

    .btn-secondary {
        background: #2a3f52;
        color: #e8e8e8;
    }

    .btn-secondary:hover {
        background: #3a5a7a;
    }

    /* 内容卡片 */
    .content-card {
        background: #1e2d3d;
        border: 1px solid #3a5a7a;
    }

    .card-header {
        border-bottom: 1px solid #3a5a7a;
    }

    .card-title {
        color: #ffffff;
    }

    /* 表格 */
    .data-table th {
        background: #2a3f52;
        color: #e8e8e8;
    }

    .data-table td {
        border-bottom: 1px solid #3a5a7a;
        color: #e8e8e8;
    }

    .data-table tr:hover {
        background: #2a3f52;
    }

    /* 表单 */
    .form-label {
        color: #e8e8e8;
    }

    .form-input,
    .form-select,
    .form-textarea {
        background: #2a3f52;
        border-color: #3a5a7a;
        color: #e8e8e8;
    }

    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        border-color: #6a9aca;
        box-shadow: 0 0 0 3px rgba(106, 154, 202, 0.2);
    }

    /* 空状态 */
    .empty-state {
        color: #666;
    }

    /* 加载中遮罩 */
    .loading-content {
        background: #1e2d3d;
        border: 1px solid #3a5a7a;
    }

    .loading-text {
        color: #a0a0a0;
    }

    /* 警告提示 - 深色模式下使用深色背景 */
    .warning-box {
        background: rgba(255, 193, 7, 0.15);
        border: 1px solid rgba(255, 193, 7, 0.3);
    }

    .warning-icon {
        color: #ffc107;
    }

    .warning-title {
        color: #ffc107;
    }

    .warning-text {
        color: #e8c365;
    }

    /* 成功提示 */
    .success-box {
        background: rgba(40, 167, 69, 0.15);
        border: 1px solid rgba(40, 167, 69, 0.3);
    }

    .success-icon {
        color: #28a745;
    }

    .success-title {
        color: #28a745;
    }

    .success-text {
        color: #6bc97d;
    }

    /* 错误提示 */
    .error-box {
        background: rgba(220, 53, 69, 0.15);
        border: 1px solid rgba(220, 53, 69, 0.3);
    }

    .error-icon {
        color: #dc3545;
    }

    .error-title {
        color: #dc3545;
    }

    .error-text {
        color: #e87d87;
    }
}

/* ==================== 响应式布局 ==================== */
@media (max-width: 768px) {
    /* 导航 */
    .nav-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .nav-title {
        font-size: 1.2rem;
    }

    .nav-actions {
        width: 100%;
        justify-content: center;
    }

    /* 页面容器 */
    .page-container {
        padding: 15px;
    }

    /* 页面标题 */
    .page-title {
        font-size: 22px;
    }

    /* 统计卡片 */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* 按钮 */
    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    /* 表格 */
    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 10px;
    }

    /* 表单 */
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
}
