/* ================= 全局变量与重置 ================= */
:root {
    /* 品牌色系 - 保持 index.html 的鲜亮风格 */
    --primary-color: #4facfe;
    --primary-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --brand-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --secondary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* 文字颜色 */
    --text-main: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    
    /* 背景 */
    --bg-body: #f8fafc;
    --bg-glass: rgba(255, 255, 255, 0.85); /* 磨砂玻璃背景 */
    --bg-glass-strong: rgba(255, 255, 255, 0.95);
    
    /* 布局 */
    --nav-height: 80px;
    --sidebar-width: 280px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    /* 阴影 */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; outline: none; }

body {
    font-family: 'Poppins', 'Noto Sans SC', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ================= 华丽的背景光斑 (核心视觉) ================= */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(79, 172, 254, 0.15) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    animation: breathe 10s ease-in-out infinite alternate;
}

body::after {
    content: '';
    position: fixed;
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.15) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    animation: breathe 8s ease-in-out infinite alternate-reverse;
}

@keyframes breathe {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.1); opacity: 1; }
}

/* ================= 通用组件 ================= */
a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
ul { list-style: none; }

/* 玻璃拟态卡片 */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* 按钮 */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    font-size: 0.95rem;
    justify-content: center;
}

.btn-primary {
    background: var(--brand-gradient);
    color: white;
    box-shadow: 0 10px 20px rgba(79, 172, 254, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(79, 172, 254, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* 输入框 */
input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s;
}

input:focus, select:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.15);
}

/* 徽章 */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-blue { background: rgba(79, 172, 254, 0.15); color: #0284c7; }
.badge-gray { background: #f1f5f9; color: #64748b; }
.badge-green { background: rgba(16, 185, 129, 0.15); color: #059669; }

/* 表格 */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
}
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th {
    background: rgba(241, 245, 249, 0.8);
    padding: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    font-size: 0.9rem;
}
td {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-main);
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.4);
}
tr:hover td { background: rgba(255, 255, 255, 0.9); }

/* ================= 布局：管理端 & 考试端共用 ================= */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.6);
    display: flex;
    flex-direction: column;
    padding: 20px;
    z-index: 100;
    transition: transform 0.3s ease;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 10px 10px 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links { flex: 1; overflow-y: auto; }
.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.3s;
}

.nav-item i { width: 24px; margin-right: 10px; font-size: 1.1rem; }

.nav-item:hover { background: rgba(79, 172, 254, 0.1); color: var(--primary-color); }
.nav-item.active {
    background: var(--brand-gradient);
    color: white;
    box-shadow: 0 8px 16px rgba(79, 172, 254, 0.25);
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.top-bar {
    height: var(--nav-height);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.0);
}

.page-title { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-glass);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: var(--shadow-sm);
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 40px 40px;
}

/* ================= 仪表板统计卡片 ================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 25px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0; width: 80px; height: 80px;
    background: var(--brand-gradient);
    filter: blur(40px);
    opacity: 0.2;
    border-radius: 50%;
}

.stat-val { font-size: 2.5rem; font-weight: 800; color: var(--text-main); margin-top: 10px; }
.stat-title { color: var(--text-secondary); font-size: 0.9rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

/* 消息提示框 */
.message {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
    animation: fadeIn 0.3s;
}
.message.error { background: #fee2e2; color: #ef4444; border: 1px solid #fecaca; }
.message.success { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }
.message.info { background: #e0f2fe; color: #0284c7; border: 1px solid #bae6fd; }

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

/* 响应式 */
@media (max-width: 768px) {
    .sidebar { position: fixed; transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .top-bar, .content-scroll { padding-left: 20px; padding-right: 20px; }
}