/* ============================================
   湖北电工电子技能高考刷题平台 - 主样式
   简约大气高端风格
   ============================================ */

/* ===== CSS 变量 ===== */
:root {
    /* 主色 - 沉稳的深蓝灰 */
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --primary-bg: #eff6ff;

    /* 功能色 */
    --success: #15803d;
    --success-bg: #f0fdf4;
    --warning: #b45309;
    --warning-bg: #fffbeb;
    --danger: #b91c1c;
    --danger-bg: #fef2f2;
    --info: #0e7490;
    --info-bg: #ecfeff;

    /* 中性色 - 高级灰阶 */
    --bg: #f9fafb;
    --surface: #ffffff;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --text: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;

    /* 布局 */
    --sidebar-w: 240px;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;

    /* 阴影 - 柔和 */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
    --shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);

    /* 动画 */
    --transition: all 0.15s ease;
    --transition-slow: all 0.25s ease;
}

/* 深色模式 */
[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-light: #93c5fd;
    --primary-dark: #3b82f6;
    --primary-bg: #1e3a8a;

    --success: #4ade80;
    --success-bg: #14532d;
    --warning: #fbbf24;
    --warning-bg: #78350f;
    --danger: #f87171;
    --danger-bg: #7f1d1d;
    --info: #22d3ee;
    --info-bg: #155e75;

    --bg: #0f172a;
    --surface: #1e293b;
    --border: #334155;
    --border-light: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
}

/* ===== Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== 布局 ===== */
.app-layout { display: block; min-height: 100vh; }

/* ===== 侧边栏 ===== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.25s ease;
}
.sidebar-header {
    padding: 18px 16px;
    border-bottom: 1px solid var(--border);
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-icon {
    width: 32px; height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 700;
}
.sidebar-title { font-size: 14px; font-weight: 700; color: var(--text); }
.sidebar-subtitle { font-size: 11px; color: var(--text-muted); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.nav-section { margin-bottom: 20px; }
.nav-section-title {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0 12px 8px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }

/* ===== 主内容 ===== */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 28px 32px;
    max-width: 100%;
}

/* ===== 移动端 ===== */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    z-index: 50;
    align-items: center;
    gap: 12px;
}
.mobile-title { font-size: 15px; font-weight: 700; flex: 1; }
.hamburger {
    width: 36px; height: 36px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}
.hamburger svg { width: 20px; height: 20px; }
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 99;
}
.overlay.show { display: block; }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 16px; padding-top: 64px; }
    .mobile-header { display: flex; }
}

/* ===== 页面标题 ===== */
.page-header { margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ===== 卡片 ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
}
.card-body { padding: 20px; }

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}
.stat-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    font-size: 18px;
}
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== 快捷入口 ===== */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}
.quick-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}
.quick-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}
.quick-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    font-size: 20px;
}
.quick-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.quick-desc { font-size: 12px; color: var(--text-muted); }

/* ===== 进度条 ===== */
.progress {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ===== 题目卡片 ===== */
.question-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.question-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}
.question-stem {
    padding: 20px;
    font-size: 15px;
    line-height: 1.7;
}
.question-options { padding: 0 20px 20px; }
.option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}
.option:hover:not(.disabled) {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}
.option.selected { border-color: var(--primary); background: var(--primary-bg); }
.option.correct { border-color: var(--success); background: var(--success-bg); }
.option.wrong { border-color: var(--danger); background: var(--danger-bg); }
.option.disabled { cursor: not-allowed; }
.option-letter {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.option.selected .option-letter { background: var(--primary); color: white; }
.option.correct .option-letter { background: var(--success); color: white; }
.option.wrong .option-letter { background: var(--danger); color: white; }
.option-text { flex: 1; padding-top: 3px; line-height: 1.5; }
.option-icon { margin-left: auto; font-size: 18px; }

/* ===== 解析 ===== */
.explanation-box {
    margin: 0 20px 20px;
    padding: 14px 16px;
    background: var(--info-bg);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--info);
}
.explanation-title { font-weight: 600; color: var(--info); margin-bottom: 4px; font-size: 13px; }
.explanation-answer {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 1px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    margin-right: 6px;
}
.explanation-text { color: var(--text-secondary); font-size: 13px; line-height: 1.6; }

/* ===== 题目操作栏 ===== */
.question-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg);
}
.question-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.q-nav-btn {
    width: 30px; height: 30px;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}
.q-nav-btn:hover { background: var(--primary-bg); }
.q-nav-btn.current { background: var(--primary); color: white; border-color: var(--primary); }
.q-nav-btn.answered { background: var(--success-bg); color: var(--success); }

/* ===== 徽章 ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.badge-easy { background: var(--success-bg); color: var(--success); }
.badge-medium { background: var(--warning-bg); color: var(--warning); }
.badge-hard { background: var(--danger-bg); color: var(--danger); }
.badge-judge { background: var(--info-bg); color: var(--info); }
.badge-single { background: var(--primary-bg); color: var(--primary); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-success { background: var(--success-bg); color: var(--success); }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { opacity: 0.9; }
.btn-warning { background: var(--warning); color: white; border-color: var(--warning); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 章节网格 ===== */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.chapter-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    cursor: pointer;
    transition: var(--transition);
}
.chapter-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}
.chapter-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.chapter-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.chapter-name { font-size: 13px; font-weight: 600; line-height: 1.4; margin-bottom: 6px; }
.chapter-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== 考试 ===== */
.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.exam-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 18px;
    font-family: "SF Mono", Monaco, monospace;
}
.flagged { background: var(--warning-bg) !important; }

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-icon { font-size: 56px; margin-bottom: 12px; opacity: 0.4; }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; color: var(--text-secondary); }

/* ===== 加载 ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}
.spinner {
    width: 28px; height: 28px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 加载屏 ===== */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 16px;
}
.loading-logo { font-size: 48px; }
.loading-screen p { color: var(--text-muted); font-size: 14px; }

/* ===== 练习统计 ===== */
.practice-stats { display: flex; gap: 20px; margin-bottom: 12px; }
.practice-stat { display: flex; flex-direction: column; }
.practice-stat-label { font-size: 11px; color: var(--text-muted); }
.practice-stat-value { font-size: 16px; font-weight: 700; }

/* ===== 收藏按钮 ===== */
.fav-btn {
    margin-left: auto;
    width: 30px; height: 30px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition);
}
.fav-btn:hover { background: var(--warning-bg); color: var(--warning); }
.fav-btn.active { color: var(--warning); }
.fav-btn svg { width: 16px; height: 16px; }

/* ===== 完成屏 ===== */
.finish-screen { text-align: center; padding: 40px 20px; }
.finish-icon { font-size: 64px; margin-bottom: 12px; }
.finish-icon.success { color: var(--success); }
.finish-icon.warning { color: var(--warning); }
.finish-icon.danger { color: var(--danger); }
.finish-stats { display: flex; justify-content: center; gap: 36px; margin: 20px 0; }
.finish-stat { text-align: center; }
.finish-stat-value { font-size: 28px; font-weight: 700; }
.finish-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== 章节组 ===== */
.chapter-group { margin-bottom: 28px; }
.chapter-group-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* ===== 考试信息 ===== */
.exam-info-grid { display: flex; justify-content: center; gap: 36px; }
.exam-info-item { text-align: center; }
.exam-info-value { font-size: 32px; font-weight: 700; color: var(--primary); }
.exam-info-label { font-size: 13px; color: var(--text-muted); }
.exam-rules { max-width: 480px; margin: 0 auto; }
.exam-rules ul { list-style: disc; padding-left: 20px; color: var(--text-secondary); }
.exam-rules li { margin-bottom: 6px; line-height: 1.6; }

/* ===== 考试导航 ===== */
.exam-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}
.exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    gap: 5px;
    margin-top: 16px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.exam-grid-btn {
    height: 34px;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}
.exam-grid-btn:hover { background: var(--primary-bg); }
.exam-grid-btn.current { background: var(--primary); color: white; border-color: var(--primary); }
.exam-grid-btn.answered { background: var(--success-bg); color: var(--success); }
.exam-grid-btn.flagged { background: var(--warning-bg); color: var(--warning); }

/* ===== 考试结果 ===== */
.exam-result { max-width: 760px; margin: 0 auto; }
.exam-result-header {
    text-align: center;
    padding: 36px 20px;
    color: white;
    border-radius: var(--radius);
}
.exam-result-header.pass { background: var(--success); }
.exam-result-header.fail { background: var(--danger); }
.exam-result-icon { font-size: 56px; margin-bottom: 8px; }
.exam-result-score { font-size: 48px; font-weight: 700; }
.exam-result-label { font-size: 18px; margin-top: 4px; }
.exam-result-detail { font-size: 13px; opacity: 0.9; margin-top: 6px; }

/* ===== 错题列表 ===== */
.wrong-list { display: flex; flex-direction: column; gap: 10px; }
.wrong-item {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
}
.wrong-stem { font-size: 13px; margin-bottom: 8px; line-height: 1.6; }
.wrong-answers { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.wrong-explanation {
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* ===== 考试历史 ===== */
.exam-history-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
}
.exam-history-item:last-child { border-bottom: none; }
.exam-score {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}
.exam-score.pass { background: var(--success-bg); color: var(--success); }
.exam-score.warn { background: var(--warning-bg); color: var(--warning); }
.exam-score.fail { background: var(--danger-bg); color: var(--danger); }
.exam-info { flex: 1; }
.exam-title { font-size: 13px; font-weight: 600; }
.exam-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===== 每周打卡 ===== */
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-day {
    text-align: center;
    padding: 10px 6px;
    border-radius: var(--radius-sm);
    background: var(--bg);
}
.week-day.today { background: var(--primary); color: white; }
.week-day.completed { background: var(--success-bg); color: var(--success); }
.week-day.future { background: var(--bg); color: var(--text-muted); }
.week-day-label { font-size: 10px; opacity: 0.8; }
.week-day-num { font-size: 16px; font-weight: 700; margin-top: 2px; }

/* ===== 用户框 ===== */
.user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-top: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
.user-box:hover { background: var(--bg); }
.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 10px; color: var(--text-muted); }

/* ===== 模态框 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal {
    background: var(--surface);
    border-radius: var(--radius);
    max-width: 460px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
    width: 28px; height: 28px;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 6px;
}
.modal-close:hover { background: var(--bg); }
.modal-body { padding: 20px; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ===== 表单 ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.form-input, .form-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--surface);
    color: var(--text);
    transition: var(--transition);
}
.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

/* ===== 开关 ===== */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 22px;
    transition: 0.2s;
}
.switch-slider:before {
    content: "";
    position: absolute;
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider:before { transform: translateX(18px); }

/* ===== 设置 ===== */
.settings { max-width: 680px; }
.settings-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
}
.settings-section h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    gap: 16px;
}
.settings-row:not(:last-child) { border-bottom: 1px solid var(--border-light); }
.settings-label { font-size: 13px; font-weight: 500; }
.settings-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===== 搜索 ===== */
.search-bar { display: flex; gap: 10px; margin-bottom: 14px; }
.search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--surface);
    color: var(--text);
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-btn {
    padding: 5px 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}
.filter-btn:hover { border-color: var(--primary); }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== 图表条 ===== */
.bar-chart-item { margin-bottom: 10px; }
.bar-chart-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 3px;
}
.bar-chart-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.bar-chart-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* ===== 分类色 ===== */
.cat-电工基础 { color: var(--warning); background: var(--warning-bg); }
.cat-电子技术 { color: var(--info); background: var(--info-bg); }
.cat-技能操作知识 { color: #be185d; background: #fdf4ff; }
[data-theme="dark"] .cat-技能操作知识 { background: #831843; }

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    color: white;
    font-size: 13px;
    min-width: 180px;
    animation: slideIn 0.25s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }
@keyframes slideIn { from { transform: translateX(80px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== 工具类 ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.font-bold { font-weight: 700; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.w-full { width: 100%; }
.cursor-pointer { cursor: pointer; }

canvas { max-width: 100%; }
