/* ============================================================
   高考备考平台 — 高考备考智能平台
   现代化UI设计系统 v3.0
   ============================================================ */

:root {
    /* 主色调 — 深邃学术蓝 */
    --primary: #4f6ef6;
    --primary-light: #7b93fa;
    --primary-lighter: #e8edff;
    --primary-dark: #3a54d4;
    --primary-glow: rgba(79, 110, 246, 0.25);

    /* 辅助色 */
    --secondary: #10b981;
    --secondary-light: #d1fae5;
    --secondary-dark: #059669;

    --accent: #f59e0b;
    --accent-light: #fef3c7;

    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-dark: #dc2626;

    /* 学科颜色 */
    --physics: #8b5cf6;
    --physics-light: #ede9fe;
    --physics-glow: rgba(139, 92, 246, 0.2);
    --chemistry: #3b82f6;
    --chemistry-light: #dbeafe;
    --chemistry-glow: rgba(59, 130, 246, 0.2);
    --biology: #10b981;
    --biology-light: #d1fae5;
    --biology-glow: rgba(16, 185, 129, 0.2);
    --exam: #f59e0b;
    --exam-light: #fef3c7;
    --platform: #6366f1;
    --platform-light: #e0e7ff;
    --chinese: #0ea5e9;
    --chinese-light: #e0f2fe;
    --chinese-glow: rgba(14, 165, 233, 0.2);
    --math: #3b82f6;
    --math-light: #dbeafe;
    --math-glow: rgba(59, 130, 246, 0.2);

    /* 中性色 */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-elevated: #ffffff;
    --border-default: #e2e8f0;
    --border-light: #f1f5f9;
    --border-focus: #4f6ef6;

    /* 阴影系统 */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.06), 0 4px 6px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.08), 0 8px 10px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-elevated: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-glow-primary: 0 2px 8px var(--rule);
    --shadow-glow-physics: 0 2px 8px var(--rule);
    --shadow-glow-chemistry: 0 2px 8px var(--rule);
    --shadow-glow-biology: 0 2px 8px var(--rule);

    /* 圆角 */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* 字体 - 优先使用微软雅黑提升可读性 */
    --font-sans: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
    --font-mono: "Microsoft YaHei", "SF Mono", "JetBrains Mono", "Fira Code", "Consolas", "Courier New", monospace;
    --font-serif: "Microsoft YaHei", "Songti SC", "Noto Serif SC", "STSong", "SimSun", "Times New Roman", serif;

    /* 字号 - 全面加大提升可读性 */
    --text-3xs: 0.8125rem;   /* 13px (原10px) */
    --text-2xs: 0.875rem;    /* 14px (原11px) */
    --text-xs: 0.9375rem;    /* 15px (原12px) */
    --text-sm: 1rem;         /* 16px (原13px) */
    --text-base: 1.0625rem;  /* 17px (原15px) */
    --text-lg: 1.1875rem;    /* 19px (原17px) */
    --text-xl: 1.375rem;     /* 22px (原20px) */
    --text-2xl: 1.625rem;    /* 26px (原24px) */
    --text-3xl: 2rem;        /* 32px (原30px) */
    --text-4xl: 2.5rem;      /* 40px (原36px) */

    /* 间距 */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* 过渡 */
    /* 过渡 — 优化响应速度 */
    --transition-fast: 100ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 160ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 240ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 200ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* GPU 加速提示 */
    --gpu-layer: transform 0.1ms, opacity 0.1ms;

    /* Z-index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 300;
    --z-toast: 400;
}

/* ============================================================
   DARK MODE
   ============================================================ */

[data-theme="dark"] {
    --primary: #7b93fa;
    --primary-light: #4f6ef6;
    --primary-lighter: #1e293b;
    --primary-dark: #9db3ff;
    --primary-glow: rgba(123, 147, 250, 0.15);

    --secondary: #34d399;
    --secondary-light: #064e3b;
    --secondary-dark: #6ee7b7;

    --accent: #fbbf24;
    --accent-light: #451a03;

    --danger: #f87171;
    --danger-light: #450a0a;
    --danger-dark: #fca5a5;

    --physics: #a78bfa;
    --physics-light: #1e1b4b;
    --chemistry: #60a5fa;
    --chemistry-light: #172554;
    --biology: #34d399;
    --biology-light: #022c22;
    --exam: #fbbf24;
    --exam-light: #451a03;
    --platform: #818cf8;
    --platform-light: #1e1b4b;
    --chinese: #38bdf8;
    --chinese-light: #0c2d48;
    --math: #60a5fa;
    --math-light: #172554;

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-inverse: #0f172a;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-elevated: #1e293b;
    --border-default: #334155;
    --border-light: #1e293b;
    --border-focus: #7b93fa;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.5);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-elevated: 0 10px 30px rgba(0,0,0,0.5);
}

/* Dark mode toggle button */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 80px;
    z-index: 200;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border-default);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .theme-toggle {
    background: var(--bg-tertiary);
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }
    .main-header, .subject-nav, .quick-access, .tools-section, .tools-access,
    .back-btn, .tool-header button, .module-tabs, footer, .theme-toggle,
    .tool-card, .tool-access-btn, .nav-btn, button[data-back], .tool-collapse-toggle {
        display: none !important;
    }
    .section { display: block !important; }
    .section.active { display: block !important; }
    .container { max-width: 100% !important; padding: 0 !important; }
    .knowledge-card, .info-box, .highlight-box-enhanced {
        border: 1px solid #ccc !important;
        break-inside: avoid;
        box-shadow: none !important;
    }
    h1, h2, h3, h4 { color: black !important; }
    a { color: black !important; text-decoration: underline; }
    table { border-collapse: collapse; }
    table th, table td { border: 1px solid #999; padding: 4px 8px; }
    canvas, svg, video { max-width: 100% !important; }
}

/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: #eef2ff;
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.7;
    font-size: var(--text-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.01em;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        transparent,
        transparent,
        transparent;
    pointer-events: none;
    z-index: 0;
}

::selection {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

/* ============================================================
   CONTAINER
   ============================================================ */

.container {
    position: relative;
    z-index: 1;
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--space-6);
}

/* ============================================================
   HEADER
   ============================================================ */

.main-header {
    text-align: center;
    padding: var(--space-10) var(--space-8);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--space-6);
    border: 1px solid rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
}

.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--rule-strong);
}

.main-header h1 {
    font-size: var(--text-4xl);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.subtitle {
    color: var(--text-secondary);
    font-size: var(--text-lg);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.subject-nav {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    flex-wrap: wrap;
    position: sticky;
    top: var(--space-4);
    z-index: var(--z-sticky);
    background: var(--bg-card);
    padding: var(--space-2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-6);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-5);
    background: transparent;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-base);
    min-width: 72px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.nav-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.nav-btn:active {
    transform: scale(0.96);
    transition: var(--transition-fast);
}

.nav-btn.active {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-glow-primary);
    border-color: transparent;
}

.nav-btn.active .label {
    color: var(--text-inverse);
}

.nav-btn .icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
    transition: var(--transition-fast);
    line-height: 1;
}

.nav-btn .label {
    font-weight: 600;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    white-space: nowrap;
    transition: var(--transition-fast);
}

.nav-btn-exam.active { background: var(--exam); box-shadow: 0 2px 8px var(--rule); }
.nav-btn-platform.active { background: var(--platform); box-shadow: 0 2px 8px var(--rule); }
.nav-btn-chinese.active { background: var(--chinese); box-shadow: 0 2px 8px var(--rule); }
.nav-btn-math.active { background: var(--math); box-shadow: 0 2px 8px var(--rule); }
.nav-btn-english.active { background: var(--english); box-shadow: 0 2px 8px var(--rule); }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */

main {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: var(--space-8);
    min-height: 600px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ============================================================
   SECTIONS & ANIMATIONS
   ============================================================ */

.section {
    display: none;
    animation: fadeSlideIn var(--transition-base) ease;
}

.section.active {
    display: block;
}

/* v1.9 性能（§4.2）：长章节里的知识卡片按需渲染 —— 只绘制视口附近的卡片，
   其余跳过布局/绘制但仍可用 Ctrl+F 与锚点跳转命中（浏览器会即时展开）。
   非激活 section 本就是 display:none，真正开销在激活章节的数百张卡片上。
   旧浏览器不认识 content-visibility 会整条忽略，行为回到改动前。 */
.knowledge-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 320px;
}

/* v1.10 T16：仪表盘掌握度曲线（SVG 表现属性绘制，不依赖内联样式） */
.hspcb-spark {
    width: 100%;
    height: 28px;
    display: block;
    margin: 2px 0 4px;
}

/* v1.10 T20：尊重系统「减少动效」偏好（前庭敏感用户） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 打印必须完整渲染：content-visibility 会让未展开的卡片印成空白 */
@media print {
    .knowledge-card { content-visibility: visible; }
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* v1.9：自 utility-tools-v2.js 内联注入迁入（CSP 禁止运行时 <style>） */
@keyframes etp-slide-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: var(--shadow-glow-primary); }
    50% { box-shadow: 0 2px 8px var(--rule); }
}

/* ============================================================
   WELCOME CARD
   ============================================================ */

.welcome-card {
    background: rgba(79, 110, 246, 0.04);
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-8);
    border: 1px solid var(--border-default);
    position: relative;
    overflow: hidden;
}

.welcome-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: transparent;
    border-radius: 50%;
    pointer-events: none;
}

.welcome-card h2 {
    color: var(--primary);
    margin-bottom: var(--space-4);
    font-size: var(--text-2xl);
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.welcome-card p {
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    position: relative;
    z-index: 1;
}

.feature-list {
    list-style: none;
    padding: 0;
    position: relative;
    z-index: 1;
}

.feature-list li {
    padding: var(--space-3) var(--space-4);
    border-left: 3px solid var(--primary-light);
    margin-bottom: var(--space-2);
    font-size: var(--text-base);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.7);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: var(--transition-fast);
}

.feature-list li:hover {
    border-left-color: var(--primary);
    background: rgba(255, 255, 255, 0.95);
    transform: translateX(4px);
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */

.tools-section h3, .quick-access h3 {
    color: var(--text-primary);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--primary-lighter);
    font-size: var(--text-xl);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    position: relative;
}

.tools-section h3::after, .quick-access h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--primary);
    border-radius: var(--radius-sm);
}

/* ============================================================
   TOOL GRID & CARDS
   ============================================================ */

.tools-section, .quick-access {
    margin-top: var(--space-8);
}

/* ---- 折叠区块 ---- */
.tools-section h3, .quick-access h3 {
    cursor: pointer;
    user-select: none;
}

.tools-section h3::before, .quick-access h3::before {
    content: '▾';
    font-size: 0.65em;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    display: inline-block;
    margin-right: var(--space-2);
}

.tools-section.collapsed h3::before,
.quick-access.collapsed h3::before {
    transform: rotate(-90deg);
}

.tools-section.collapsed .tools-access,
.quick-access.collapsed .tool-grid {
    display: none;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}

.tool-card {
    background: var(--bg-primary);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: var(--transition-base);
    border: 1px solid var(--border-default);
    border-left: 1px solid var(--primary);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    will-change: transform;
    z-index: 1;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
    z-index: 10;
}

.tool-card:active {
    transform: scale(0.97);
    transition: var(--transition-fast);
}

.tool-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
    z-index: 0;
}

.tool-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.3s;
    pointer-events: none;
    z-index: 0;
}

.tool-card:hover::after {
    left: 100%;
}

.tool-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-3);
    line-height: 1;
}

.tool-card h4 {
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    font-size: var(--text-base);
    font-weight: 700;
    line-height: 1.4;
}

.tool-card p {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    line-height: 1.5;
    margin-bottom: var(--space-2);
}

.tool-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-2xs);
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.tool-tag.physics { background: var(--physics-light); color: var(--physics); }
.tool-tag.chemistry { background: var(--chemistry-light); color: var(--chemistry); }
.tool-tag.biology { background: var(--biology-light); color: var(--biology); }
.tool-tag.math { background: var(--tag-math-bg); color: var(--tag-math-fg); }
.tool-tag.chinese { background: var(--tag-chinese-bg); color: var(--tag-chinese-fg); }
.tool-tag.english { background: var(--tag-english-bg); color: var(--tag-english-fg); }

/* ============================================================
   D 类类化修饰（T3-4f）——原 index.html 静态 style 属性
   现值优先：徽标/面板取 --tag-* 与 --panel-* 令牌（tokens.css，主题无关），
   间距取 --space-4/5/6（16/20/24px，与原写死值一致）；
   不跟随 --math/--english 的 T3-1 新色相（外观零变化优先，改色须用户确认）。
   ============================================================ */

/* 工具区分隔：原 .tools-section 上 11 处静态 margin-top（16×5 / 20×1 / 24×5）。
   特异性 (0,2,0) 高于 .tools-section 默认的 --space-8（32px）。 */
.tools-section.mt-16 { margin-top: var(--space-4); }
.tools-section.mt-20 { margin-top: var(--space-5); }
.tools-section.mt-24 { margin-top: var(--space-6); }

/* 知识体系 tab 面板：原 #math-m1/#math-m2/#english-eng-* 上 6 处静态
   display + margin-top（display:block×2 / display:none×4，margin-top 均 16px）。 */
.tab-pane { display: block; margin-top: var(--space-4); }
.tab-pane.is-hidden { display: none; }

/* 数学/英语知识体系面板：原 2 处静态 padding/font-family/background/border-radius
   与 2 处 h2 标题色（#3b82f6 / #8b5cf6）。 */
.knowledge-panel { padding: var(--space-5); font-family: MiSans, "Microsoft YaHei", sans-serif; border-radius: var(--radius-lg); }
.knowledge-panel--math { background: var(--panel-math-bg); }
.knowledge-panel--math h2 { color: var(--panel-math-title); }
.knowledge-panel--english { background: var(--panel-english-bg); }
.knowledge-panel--english h2 { color: var(--panel-english-title); }


/* ============================================================
   SUBJECT CARDS (HOME PAGE)
   ============================================================ */

.subject-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-5);
}

.subject-card {
    padding: var(--space-6);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-default);
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.subject-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.subject-card.physics {
    background: rgba(59, 130, 246, 0.04);
    border-left: 4px solid var(--physics);
}
.subject-card.chemistry {
    background: rgba(16, 185, 129, 0.04);
    border-left: 4px solid var(--chemistry);
}
.subject-card.biology {
    background: rgba(245, 158, 11, 0.04);
    border-left: 4px solid var(--biology);
}
.subject-card.chinese {
    background: rgba(14, 165, 233, 0.04);
    border-left: 4px solid var(--chinese);
}
.subject-card.math {
    background: rgba(236, 72, 153, 0.04);
    border-left: 4px solid var(--math);
}
.subject-card.english {
    background: rgba(139, 92, 246, 0.04);
    border-left: 4px solid var(--english);
}

.subject-card h4 {
    margin-bottom: var(--space-4);
    font-size: var(--text-lg);
    font-weight: 700;
}
.subject-card.physics h4 { color: var(--physics); }
.subject-card.chemistry h4 { color: var(--chemistry); }
.subject-card.biology h4 { color: var(--biology); }
.subject-card.chinese h4 { color: var(--chinese); }
.subject-card.math h4 { color: var(--math); }
.subject-card.english h4 { color: var(--english); }

.subject-card ul { list-style: none; }
.subject-card ul li { padding: var(--space-2) 0; }
.subject-card ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: var(--text-sm);
    font-weight: 500;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-xs);
    display: inline-block;
}
.subject-card ul li a:hover {
    color: var(--primary);
    background: var(--primary-lighter);
}

/* ============================================================
   MODULE TABS
   ============================================================ */

.module-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    padding: var(--space-1);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.module-tab {
    padding: var(--space-2) var(--space-4);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    will-change: transform, background;
}

.module-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.7);
}

.module-tab.active {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-glow-primary);
}

/* ============================================================
   MODULE CONTENT
   ============================================================ */

.module-content {
    padding: var(--space-6);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    min-height: 400px;
    animation: fadeIn var(--transition-base) ease;
    border: 1px solid var(--border-light);
}

/* ============================================================
   EXPERIMENT CARDS (改进实验展示)
   ============================================================ */

.experiments-section { padding: 0; }
.experiments-section h3 { font-size: var(--text-xl); font-weight: 700; margin-bottom: var(--space-5); color: var(--text-primary); }

.exp-cards { display: flex; flex-direction: column; gap: var(--space-3); }

.exp-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-fast);
    will-change: box-shadow;
}
.exp-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-hover); }
.exp-card.exp-open { border-left: 1px solid var(--primary); }

.exp-card-header {
    display: flex; align-items: center; gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    cursor: pointer; user-select: none;
    transition: background var(--transition-fast);
    background: var(--bg-secondary);
}
.exp-card-header:hover { background: var(--bg-tertiary); }

.exp-card-icon { font-size: 1.3rem; flex-shrink: 0; }
.exp-card-header h4 { flex: 1; margin: 0; font-size: var(--text-base); font-weight: 600; color: var(--text-primary); }

.exp-card-arrow {
    font-size: 1rem; color: var(--text-tertiary);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}
.exp-card.exp-open .exp-card-arrow { transform: rotate(180deg); }

.exp-card-body {
    max-height: 0; overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 var(--space-4);
}
.exp-card.exp-open .exp-card-body { max-height: 3000px; padding: var(--space-3) var(--space-4) var(--space-4); }

.exp-card-body > p { margin-bottom: var(--space-2); line-height: 1.7; }
.exp-card-body strong { color: var(--primary-dark); }

.exp-steps { margin-bottom: var(--space-3); }
.exp-steps h5 { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-1); }
.exp-steps ol { margin-left: var(--space-5); color: var(--text-secondary); line-height: 1.8; }
.exp-steps ol li { margin-bottom: 2px; }

.exp-caution {
    background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius-sm);
    padding: var(--space-3); margin-bottom: var(--space-2);
}
.exp-caution h5 { font-size: var(--text-sm); font-weight: 600; color: #dc2626; margin-bottom: var(--space-1); }
.exp-caution ul { margin-left: var(--space-5); color: #991b1b; line-height: 1.7; }
.exp-caution ul li { margin-bottom: 2px; }

.exp-tip {
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius-sm);
    padding: var(--space-3); margin-bottom: var(--space-2);
}
.exp-tip h5 { font-size: var(--text-sm); font-weight: 600; color: #2563eb; margin-bottom: var(--space-1); }

.exp-formula {
    display: inline-block; background: #eff6ff;
    border: 1px solid #c7d2fe; border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-4); margin: var(--space-2) 0;
    font-family: 'SF Mono', 'Courier New', monospace; font-size: var(--text-lg);
    font-weight: 700; color: var(--primary-dark); letter-spacing: 0.5px;
}

.exp-arrow-r {
    display: inline-block; margin: 0 6px;
    color: var(--secondary); font-weight: 700; font-size: 1.1em;
}
.exp-formula sup { font-size: 0.65em; color: #6d28d9; font-weight: 500; }

.exp-indicator-demo {
    background: var(--bg-secondary); border-radius: var(--radius-sm);
    padding: var(--space-3); margin-bottom: var(--space-2);
}
.exp-indicator-demo h5 { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-2); }

.indicator-cards { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.ind-card {
    flex: 1; min-width: 200px; padding: var(--space-3);
    background: var(--bg-primary); border-radius: var(--radius-sm);
    border: 1px solid var(--border-default); font-size: var(--text-sm);
    line-height: 1.7; color: var(--text-secondary);
}
.ind-color { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

.exp-smell {
    background: #fefce8; border: 1px solid #fde68a; border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3); margin-top: var(--space-2);
}
.exp-smell h5 { font-size: var(--text-sm); font-weight: 600; color: #a16207; margin-bottom: 2px; }
.exp-smell p { color: #854d0e; font-size: var(--text-sm); }

.equipment-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-3); margin-bottom: var(--space-3);
}
.eq-card {
    padding: var(--space-3); background: var(--bg-secondary);
    border-radius: var(--radius-sm); border: 1px solid var(--border-default);
    line-height: 1.6; font-size: var(--text-sm);
}
.eq-card h5 { font-size: var(--text-sm); font-weight: 700; color: var(--primary); margin-bottom: var(--space-1); }
.eq-card p { margin-bottom: 3px; color: var(--text-secondary); }
.eq-card p strong { color: var(--text-primary); }

.mitosis-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-2); margin-bottom: var(--space-2);
}
.mitosis-card {
    padding: var(--space-2); background: #f0fdf4;
    border: 1px solid #bbf7d0; border-radius: var(--radius-sm);
    font-size: var(--text-xs); line-height: 1.6;
}
.mitosis-card strong { color: var(--primary-dark); }

.exp-chromato { margin-bottom: var(--space-2); }
.exp-chromato h5 { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-2); }

.chromato-strip {
    border: 1px solid var(--border-default); border-radius: var(--radius-sm);
    overflow: hidden;
}
.chromato-band { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); line-height: 1.6; }

.common-mistake {
    background: #fef2f2; border-left: 1px solid #ef4444;
    padding: var(--space-2) var(--space-3); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: var(--text-sm); color: #991b1b; line-height: 1.6;
}

/* ============================================================
   TOOLS ACCESS BUTTONS
   ============================================================ */

.tools-access {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}

.tool-access-btn {
    padding: var(--space-4) var(--space-5);
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
    box-shadow: var(--shadow-sm);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    will-change: transform;
    position: relative;
    z-index: 10;
}

.tool-access-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-primary);
    transition: var(--transition-spring);
    z-index: 20;
}

.tool-access-btn:active {
    transform: scale(0.98);
}

/* ============================================================
   TOOL HEADER & BACK BUTTON
   ============================================================ */

.tool-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 2px solid var(--border-default);
}

.tool-header h2 {
    color: var(--text-primary, #1c2733);
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* 标题行 emoji → SVG 图标占位（ui-icons.js 注入；移动端 responsive.css 隐藏 .label） */
.tool-header h2 .hspcb-i {
    width: 1.2em;
    height: 1.2em;
    color: var(--primary, #2d5a63);
    flex: none;
}

.back-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: var(--space-2) var(--space-4);
    background: var(--bg-secondary, #f9f9f9);
    color: var(--text-primary, #333);
    border: 1px solid var(--border-medium, #d9d9d9);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: var(--text-sm);
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.back-btn .hspcb-i { width: 16px; height: 16px; flex: none; }

.back-btn:hover {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
}

/* ============================================================
   KNOWLEDGE SECTION (CONTENT CARDS)
   ============================================================ */

.knowledge-section {
    animation: fadeSlideIn var(--transition-base) ease;
}

.knowledge-section h3 {
    color: var(--text-primary);
    font-size: var(--text-xl);
    font-weight: 700;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--primary-lighter);
    position: relative;
}

.knowledge-section h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--primary);
    border-radius: var(--radius-sm);
}

.knowledge-card {
    background: var(--bg-primary);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    margin-bottom: var(--space-4);
    border: 1px solid var(--border-default);
    transition: var(--transition-base);
}

.knowledge-card:hover {
    box-shadow: var(--shadow-md);
}

.knowledge-card h4 {
    color: var(--text-primary);
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.key-point {
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--text-secondary);
    border-left: 3px solid var(--primary-light);
}

.key-point strong {
    color: var(--text-primary);
    font-weight: 700;
}

.common-mistake {
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--danger-light);
    font-size: var(--text-sm);
    color: var(--danger-dark);
    border-left: 3px solid var(--danger);
}

/* ============================================================
   PHYSICS FORMULA CALCULATOR  —  统一到 knowledge-card 设计规范
   ============================================================ */
.physics-calculator {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.physics-calculator > h3,
.physics-calculator > .calc-section > h3 {
    color: var(--text-primary);
    font-size: var(--text-xl);
    font-weight: 700;
    margin: 0 0 var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--primary-lighter);
    position: relative;
}

.physics-calculator > .calc-section > h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--primary);
    border-radius: var(--radius-sm);
}

.physics-calculator h4 {
    color: var(--text-primary);
    font-size: var(--text-lg);
    font-weight: 700;
    margin: 0 0 var(--space-3);
}

/* 顶部输入区：卡片风格 —— 用 nth-child(1) 替代 first-of-type（first-of-type 只看标签名） */
.physics-calculator > .calc-section {
    background: var(--bg-primary);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-default);
    transition: var(--transition-base);
}

.physics-calculator > .calc-section:hover {
    box-shadow: var(--shadow-md);
}

/* 但第二个 .calc-section（历史）也要同样卡片 */
.physics-calculator > .calc-section:nth-of-type(2) {
    /* 让它跟 first 保持一致的样式即可 */
}

.voice-input-wrapper {
    display: flex;
    gap: var(--space-3);
    align-items: stretch;
    margin-bottom: var(--space-3);
}

.formula-input-field {
    flex: 1;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: var(--text-base);
    font-family: inherit;
    outline: none;
    transition: var(--transition-fast);
}

.formula-input-field::placeholder {
    color: var(--text-tertiary);
}

.formula-input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.voice-btn {
    flex: none;
    min-width: 44px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.voice-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-lighter);
}

.physics-calculator .btn.btn-primary {
    border-radius: var(--radius-sm);
}

/* 公式分类卡片：跟 knowledge-card 同级 */
.formula-list-container {
    background: var(--bg-primary);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-default);
    transition: var(--transition-base);
}

.formula-list-container:hover {
    box-shadow: var(--shadow-md);
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.cat-tab {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.cat-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cat-tab.active {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
}

/* 公式项列表 */
.formula-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-3);
}

.formula-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
    cursor: pointer;
    transition: var(--transition-fast);
}

.formula-item:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
    box-shadow: var(--shadow-card);
}

.formula-item.selected {
    border-left-color: var(--success);
    background: var(--success-light, rgba(16,185,129,0.08));
}

.formula-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: var(--text-base);
    margin-bottom: 4px;
}

.formula-expr {
    font-family: "Cambria Math", "Consolas", "Times New Roman", serif;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-style: italic;
    letter-spacing: 0.02em;
}

/* 变量输入区 */
.vars-container, .result-container {
    background: var(--bg-primary);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-default);
}

.vars-row {
    display: grid;
    grid-template-columns: 120px 1fr 140px;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-2) 0;
    border-bottom: 1px dashed var(--border-default);
}

.vars-row:last-child { border-bottom: none; }

.vars-row label {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
}

.vars-row input {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--text-sm);
    outline: none;
}

.vars-row input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.vars-row .unit {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    font-family: Consolas, monospace;
}

.result-value {
    font-size: var(--text-2xl);
    font-weight: 900;
    color: var(--primary);
    font-family: Consolas, "Cambria Math", serif;
    letter-spacing: 0.04em;
    padding: var(--space-3) 0;
}

/* 历史区的 calc-section 也已由上面统一覆盖，此规则保留做强调 */
.physics-calculator > .calc-section:last-of-type {
    background: var(--bg-primary);
}

.history-container, .no-history {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    padding: var(--space-3);
    text-align: center;
}

.info-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-5);
}

.info-box h4 {
    color: var(--text-primary);
    font-weight: 700;
    font-size: var(--text-lg);
    margin-bottom: var(--space-3);
}

.info-box ul {
    list-style: disc;
    padding-left: var(--space-5);
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.7;
}

.info-box li { margin-bottom: 4px; }

/* ============================================================
   FOOTER
   ============================================================ */

/* ============================================================
   FOOTER — 重构版（分区块 + 移动端适配）
   ============================================================ */

.main-footer {
    margin-top: var(--space-10);
    padding: var(--space-8) var(--space-6);
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.mf-grid {
    display: grid;
    grid-template-columns: 1.2fr 2.6fr;
    gap: var(--space-8);
    max-width: 1100px;
    margin: 0 auto;
}

/* ---- 品牌区 ---- */
.mf-brand {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.mf-logo {
    font-size: 2rem;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary, #2563eb), var(--primary-light, #3b82f6));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25);
    flex-shrink: 0;
}

.mf-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.mf-subtitle {
    font-size: var(--text-xs);
    color: var(--text-tertiary, var(--text-secondary));
    margin-top: var(--space-1);
}

/* ---- 链接区 ---- */
.mf-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

.mf-col-title {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary, var(--text-secondary));
    margin-bottom: var(--space-3);
}

.mf-col a {
    display: block;
    padding: var(--space-1) 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color var(--transition-fast);
}

.mf-col a:hover {
    color: var(--primary, #2563eb);
}

/* ---- 底栏 ---- */
.mf-bottom {
    max-width: 1100px;
    margin: var(--space-8) auto 0;
    padding-top: var(--space-5);
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.mf-bottom p {
    margin: var(--space-1) 0;
    font-size: var(--text-xs);
    color: var(--text-tertiary, var(--text-secondary));
    opacity: 0.8;
}

.mf-copy {
    font-weight: 500;
    opacity: 0.6 !important;
}

/* ============================================================
   FOOTER — 移动端适配
   ============================================================ */

@media (max-width: 768px) {
    .main-footer {
        margin-top: var(--space-6);
        padding: var(--space-6) var(--space-4);
    }
    .mf-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    .mf-brand {
        justify-content: flex-start;
    }
    .mf-links {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }
    .mf-col:last-child {
        grid-column: 1 / -1;
    }
    .mf-bottom {
        margin-top: var(--space-6);
    }
}

@media (max-width: 480px) {
    .mf-logo {
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
    }
    .mf-title {
        font-size: var(--text-base);
    }
    .mf-links {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    .mf-col {
        border-top: 1px solid var(--border-light);
        padding-top: var(--space-3);
    }
    .mf-col:first-child {
        border-top: none;
        padding-top: 0;
    }
}

/* ============================================================
   BUTTON SYSTEM
   ============================================================ */

.btn {
    padding: var(--space-2) var(--space-5);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 700;
    transition: var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.btn:active { transform: scale(0.95); }

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
    will-change: transform;
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-glow-primary);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}
.btn-secondary:hover {
    background: var(--border-default);
    color: var(--text-primary);
}

.btn-success {
    background: var(--secondary);
    color: var(--text-inverse);
}
.btn-success:hover {
    background: var(--secondary-dark);
    box-shadow: 0 2px 8px var(--rule);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
}
.btn-danger:hover { background: var(--danger-dark); }

.btn-block { display: block; width: 100%; }
.btn-lg { padding: var(--space-3) var(--space-8); font-size: var(--text-base); }
.btn-sm { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */

.balance-input, input[type="text"], input[type="number"], textarea, select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition-fast);
    font-family: var(--font-mono);
}

.balance-input:focus, input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-lighter);
}

.balance-input {
    font-size: 1.2rem;
    padding: var(--space-4);
}

/* ============================================================
   APP SECTIONS (TOOLS)
   ============================================================ */

.chemistry-app, .biology-app, .physics-app {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: var(--space-6);
    border: 1px solid var(--border-default);
}

.app-section {
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-default);
}
.app-section:last-child { border-bottom: none; }
.app-section h3 {
    color: var(--primary);
    margin-bottom: var(--space-4);
    font-size: var(--text-lg);
    font-weight: 700;
}

/* ============================================================
   BALANCER & MOLECULE
   ============================================================ */

.balance-result {
    background: var(--bg-secondary);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    margin-top: var(--space-5);
}

.balanced-equation {
    font-size: 1.5rem;
    font-family: var(--font-mono);
    text-align: center;
    padding: var(--space-5);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    margin: var(--space-4) 0;
    border: 2px solid var(--secondary);
    color: var(--secondary-dark);
    font-weight: 700;
    letter-spacing: 0.03em;
}

.atom-counts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.atom-count {
    padding: var(--space-3);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    text-align: center;
    font-family: var(--font-mono);
    font-weight: 600;
}
.atom-count.balanced { border: 2px solid var(--secondary); color: var(--secondary-dark); }
.atom-count.unbalanced { border: 2px solid var(--danger); color: var(--danger-dark); }

.molecule-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-5);
    flex-wrap: wrap;
    padding: var(--space-5);
}

.molecule {
    text-align: center;
    padding: var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    min-width: 120px;
}
.molecule .formula { font-size: 1.3rem; font-weight: 700; font-family: var(--font-mono); }
.molecule .coefficient { font-size: 2rem; color: var(--primary); font-weight: 700; }

.reactant, .product { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-3) 0; }
.plus-sign { font-size: 2rem; color: var(--text-tertiary); }
.arrow { font-size: 2rem; color: var(--primary); margin: 0 var(--space-3); }

/* ============================================================
   QUIZ SYSTEM
   ============================================================ */

.quiz-type-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.quiz-type-btn {
    padding: var(--space-4);
    background: var(--bg-secondary);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
}
.quiz-type-btn:hover { border-color: var(--primary-light); background: var(--primary-lighter); }
.quiz-type-btn.selected {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow-primary);
}
.quiz-type-btn .icon { font-size: 2rem; margin-bottom: var(--space-2); display: block; }
.quiz-type-btn .label { font-weight: 600; }

.quiz-question {
    background: var(--bg-primary);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-default);
}
.question-number { font-weight: 700; color: var(--primary); margin-bottom: var(--space-3); }
.question-text { font-size: var(--text-lg); margin-bottom: var(--space-4); line-height: 1.7; }

.quiz-options { display: flex; flex-direction: column; gap: var(--space-2); }
.quiz-option {
    padding: var(--space-3) var(--space-4);
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}
.quiz-option:hover { background: var(--primary-lighter); border-color: var(--primary-light); }
.quiz-option.correct { background: var(--secondary-light); border-color: var(--secondary); }
.quiz-option.incorrect { background: var(--danger-light); border-color: var(--danger); }

/* ============================================================
   GENETICS SIMULATOR
   ============================================================ */

.genetics-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

.control-group {
    background: var(--bg-primary);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-default);
}
.control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--text-primary);
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1); }

.control-value {
    text-align: right;
    font-weight: 700;
    color: var(--primary);
    margin-top: var(--space-2);
}

.chart-container {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-default);
}
.chart-title { font-weight: 700; margin-bottom: var(--space-4); color: var(--text-primary); }

.bar-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 250px;
    padding: var(--space-5) 0;
    border-bottom: 2px solid var(--border-default);
}
.bar-group { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.bar {
    width: 60px;
    background: var(--primary);
    border-radius: var(--radius-xs) var(--radius-xs) 0 0;
    transition: height 0.25s ease;
}

.bar.aa {
    background: var(--danger);
}
.bar.Aa {
    background: var(--accent);
}
.bar.AA {
    background: var(--secondary);
}
.bar-label {
    font-weight: 600;
    font-size: var(--text-sm);
}
.bar-value {
    font-weight: 700;
    color: var(--primary);
    will-change: transform;
}

.generation-timeline {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    overflow-x: auto;
    padding: var(--space-4) 0;
    margin-top: var(--space-5);
}
.gen-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 700;
    flex-shrink: 0;
    transition: var(--transition-fast);
}
.gen-dot.active { background: var(--danger); transform: scale(1.15); }

/* ============================================================
   EXAM SYSTEM
   ============================================================ */

.exam-dashboard {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-8);
}

.exam-header {
    text-align: center;
    margin-bottom: var(--space-8);
}
.exam-header h2 {
    font-size: var(--text-2xl);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
}
.year-badge {
    font-size: var(--text-sm);
    background: var(--primary);
    color: var(--text-inverse);
    padding: 4px 14px;
    border-radius: var(--radius-full);
}
.exam-subtitle { color: var(--text-tertiary); margin-top: var(--space-2); font-size: var(--text-base); }

.dashboard-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.stats-panel {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: var(--space-6);
    box-shadow: var(--shadow-card);
    height: fit-content;
    border: 1px solid var(--border-default);
}

.overall-score {
    text-align: center;
    padding: var(--space-5);
    background: rgba(79,110,246,0.06);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-5);
}
.overall-score h3 { font-size: var(--text-lg); color: var(--text-primary); margin-bottom: var(--space-4); }

.score-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-3);
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--primary) calc(var(--score) * 1%), var(--bg-tertiary) 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.score-circle::before {
    content: '';
    position: absolute;
    width: 94px;
    height: 94px;
    background: var(--bg-primary);
    border-radius: 50%;
}
.score-number { font-size: 2.5rem; font-weight: 800; color: var(--primary); position: relative; z-index: 1; }
.score-unit { font-size: var(--text-sm); color: var(--text-tertiary); position: relative; z-index: 1; }
.level-badge {
    display: inline-block;
    font-size: var(--text-lg);
    font-weight: 700;
    padding: 4px 18px;
    border-radius: var(--radius-full);
    margin-top: var(--space-2);
}
.level-desc { font-size: var(--text-sm); color: var(--text-tertiary); margin-top: var(--space-2); }

.subject-scores h4 { font-size: var(--text-base); margin-bottom: var(--space-3); color: var(--text-primary); }
.subject-score-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition-fast);
}
.subject-score-item:hover { background: rgba(79,110,246,0.04); border-radius: var(--radius-sm); }
.subj-icon { font-size: 1.3rem; }
.subj-name { flex: 1; font-size: var(--text-sm); font-weight: 600; }

.score-bar-container {
    width: 100px;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.score-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    min-width: 60px;
}
.score-bar > div {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}
.score-text { font-size: var(--text-xs); font-weight: 700; color: var(--primary); min-width: 36px; }

.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
    margin: var(--space-5) 0;
}
.qs-item {
    text-align: center;
    padding: var(--space-3) var(--space-2);
    background: rgba(79,110,246,0.04);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}
.qs-num { display: block; font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.qs-label { font-size: var(--text-2xs); color: var(--text-tertiary); }

.btn-reset-stats {
    width: 100%;
    padding: var(--space-3);
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-tertiary);
    transition: var(--transition-fast);
    font-size: var(--text-sm);
    font-weight: 500;
}
.btn-reset-stats:hover { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }

.practice-area {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: var(--space-6);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-default);
}
.filter-bar {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
}
.filter-bar select {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    background: var(--bg-primary);
    cursor: pointer;
    color: var(--text-primary);
}

.btn-random-exam {
    padding: var(--space-2) var(--space-5);
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 600;
    transition: var(--transition-base);
}
.btn-random-exam:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow-primary); }

.exam-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-height: 450px;
    overflow-y: auto;
}
.exam-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    border-left: 4px solid transparent;
}
.exam-item:hover { background: var(--primary-lighter); box-shadow: var(--shadow-sm); }
/* v1.9 键盘导航（§4.3）：J/K 移动光标时的焦点态 */
.exam-item.kb-focus { outline: 2px solid var(--primary); outline-offset: 2px; background: var(--primary-lighter); }
.exam-item.easy { border-left-color: var(--secondary); }
.exam-item.medium { border-left-color: var(--accent); }
.exam-item.hard { border-left-color: var(--danger); }

.exam-info { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.exam-subject-tag {
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-2xs);
    font-weight: 700;
}
.exam-subject-tag.physics { background: var(--physics-light); color: var(--physics); }
.exam-subject-tag.chemistry { background: var(--chemistry-light); color: var(--chemistry); }
.exam-subject-tag.biology { background: var(--biology-light); color: var(--biology); }

.exam-year, .exam-type, .exam-points {
    font-size: var(--text-2xs);
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}
.exam-question-preview { flex: 1; font-size: var(--text-sm); color: var(--text-primary); line-height: 1.5; }

.btn-start-exam {
    padding: var(--space-2) var(--space-4);
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-sm);
    white-space: nowrap;
    transition: var(--transition-fast);
    font-weight: 600;
}
.btn-start-exam:hover { background: var(--primary-dark); }

.exam-detail-content { animation: fadeIn var(--transition-base) ease; }
.detail-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 2px solid var(--border-default);
}
.btn-back-list {
    padding: var(--space-2) var(--space-4);
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-sm);
    transition: var(--transition-fast);
}
.btn-back-list:hover { background: var(--bg-tertiary); }
.detail-meta { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm); color: var(--text-tertiary); }

.question-box {
    background: rgba(79,110,246,0.03);
    border: 1px solid rgba(79,110,246,0.12);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
}
.question-box h4 { font-size: var(--text-base); margin-bottom: var(--space-3); color: var(--text-primary); }

.option-label {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-primary);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    margin-bottom: var(--space-3);
}
.option-label:hover { border-color: var(--primary-light); background: var(--primary-lighter); }
.option-label.selected { border-color: var(--primary); background: rgba(79,110,246,0.06); }
.option-label.correct-option { border-color: var(--secondary); background: var(--secondary-light); }
.option-label.wrong-option { border-color: var(--danger); background: var(--danger-light); }
.option-label.show-correct { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }

.option-letter {
    width: 30px;
    height: 30px;
    background: var(--primary);
    color: var(--text-inverse);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-sm);
    flex-shrink: 0;
}
.option-text { flex: 1; font-size: var(--text-sm); }

.action-buttons { text-align: center; margin-bottom: var(--space-5); }
.btn-submit-answer {
    padding: var(--space-3) var(--space-10);
    background: var(--secondary);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-lg);
    font-weight: 700;
    transition: var(--transition-base);
}
.btn-submit-answer:hover { transform: translateY(-2px); box-shadow: 0 2px 8px var(--rule); }

.result-box {
    padding: var(--space-5);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-5);
    text-align: center;
}
.result-box.correct { background: var(--secondary-light); border: 2px solid var(--secondary); }
.result-box.wrong { background: var(--danger-light); border: 2px solid var(--danger); }
.result-icon { font-size: 1.3rem; font-weight: 700; margin-bottom: var(--space-3); }
.result-details p { font-size: var(--text-sm); margin: var(--space-1) 0; color: var(--text-primary); }

.analysis-box {
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    padding: var(--space-5);
}
.analysis-box h4 { font-size: var(--text-base); margin-bottom: var(--space-3); color: #b45309; }
.analysis-content { font-size: var(--text-sm); line-height: 1.8; color: var(--text-primary); margin-bottom: var(--space-4); }
.knowledge-points h5 { font-size: var(--text-sm); margin-bottom: var(--space-3); color: var(--text-primary); }
.kp-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.kp-tag {
    padding: var(--space-1) var(--space-3);
    background: rgba(79,110,246,0.1);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

.weakness-panel {
    margin-top: var(--space-6);
    padding: var(--space-5);
    background: var(--danger-light);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
}
.weakness-panel h4 { font-size: var(--text-base); margin-bottom: var(--space-4); color: var(--text-primary); }
.weak-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-2);
}
.weak-score { font-size: var(--text-lg); font-weight: 700; min-width: 48px; }
.weak-name { flex: 1; font-weight: 600; }
.weak-desc { font-size: var(--text-xs); color: var(--text-tertiary); }
.no-weakness { text-align: center; padding: var(--space-5); color: var(--secondary); font-weight: 600; }

.rec-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: rgba(79,110,246,0.04);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-2);
}
.rec-tool { font-weight: 700; color: var(--primary); min-width: 200px; }
.rec-reason { font-size: var(--text-sm); color: var(--text-tertiary); }

.progress-chart-section {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: var(--space-6);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-default);
}
.progress-chart-section h4 { font-size: var(--text-base); margin-bottom: var(--space-4); color: var(--text-primary); }

.bar-chart-vertical {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    height: 200px;
    padding: var(--space-5) 0;
}
.bar-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between; /* 顶 year / 中 track / 底 stats，三端撑开 */
    gap: var(--space-2);
    height: 100%;                    /* 撑满父容器，让 track 能 100% 定位 */
}
.bar-year { font-size: var(--text-sm); font-weight: 700; color: var(--text-primary); flex-shrink: 0; }
.bar-track-v {
    width: 40px;
    flex: 1 1 auto;                  /* 吃掉中间全部高度，bottom 严格对齐父底部 */
    background: var(--bg-tertiary);
    border-radius: var(--radius-xs);
    position: relative;              /* 子柱绝对定位参照 */
    min-height: 8px;                 /* 没数据时也不塌 */
}
.bar-fill-v {
    position: absolute;
    left: 0; right: 0; bottom: 0;    /* ★ 关键：柱子从底边往上涨，上沿不超顶 */
    border-radius: var(--radius-xs) var(--radius-xs) 0 0;
    transition: height 0.3s ease;
}
.bar-fill-v.total   { background: rgba(79,110,246,0.25); z-index: 1; }  /* 底层（总题数） */
.bar-fill-v.correct { background: var(--primary);         z-index: 2; }  /* 顶层（答对）  */
.bar-stats-v { display: flex; flex-direction: column; align-items: center; gap: 2px; flex-shrink: 0; }
.stat-correct { font-size: var(--text-xs); font-weight: 700; color: var(--primary); }
.stat-rate { font-size: var(--text-3xs); color: var(--text-tertiary); }
.no-data { text-align: center; padding: var(--space-10); color: var(--text-tertiary); }

/* ============================================================
   PLATFORM PAGE
   ============================================================ */

.platform-arch-diagram {
    text-align: center;
    padding: var(--space-8);
}

.arch-core {
    display: inline-block;
    background: var(--danger);
    color: var(--text-inverse);
    padding: var(--space-3) var(--space-8);
    border-radius: var(--radius-full);
    font-size: var(--text-lg);
    font-weight: 700;
    box-shadow: 0 2px 8px var(--rule);
}

.arch-arrow { display: block; margin: var(--space-3) 0; font-size: var(--text-2xl); color: var(--text-tertiary); }

.arch-brain {
    display: inline-block;
    background: var(--primary);
    color: var(--text-inverse);
    padding: var(--space-2) var(--space-6);
    border-radius: var(--radius-full);
    font-weight: 700;
    box-shadow: var(--shadow-glow-primary);
}

.arch-wings {
    display: flex;
    justify-content: center;
    gap: var(--space-5);
    flex-wrap: wrap;
    margin-top: var(--space-3);
}

.arch-wing-left, .arch-wing-right {
    min-width: 220px;
    padding: var(--space-4);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--text-inverse);
    font-weight: 700;
    box-shadow: var(--shadow-lg);
}

.arch-wing-left {
    background: var(--secondary);
}
.arch-wing-right {
    background: #3b82f6;
}

.arch-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.arch-stat-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
    text-align: center;
    border: 1px solid var(--border-default);
}
.arch-stat-value { font-size: var(--text-xl); font-weight: 800; color: var(--primary); }
.arch-stat-label { font-size: var(--text-2xs); color: var(--text-tertiary); margin-top: var(--space-1); }

/* ============================================================
   SIMULATION COMPONENTS (PCR & Electrophoresis)
   ============================================================ */

.sim-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-default);
    will-change: transform;
    transition: var(--transition-fast);
}
.sim-canvas-wrap {
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    background: #0f172a;
}
.sim-canvas-wrap canvas {
    display: block;
    width: 100%;
}
.sim-controls {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.sim-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: space-around;
}
.sim-stat {
    text-align: center;
    padding: var(--space-2) var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    min-width: 100px;
    flex: 1;
}
.sim-stat-label {
    display: block;
    font-size: var(--text-2xs);
    color: var(--text-tertiary);
    margin-bottom: 2px;
}
.sim-stat-value {
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--primary);
}
.sim-stat-unit {
    font-size: var(--text-2xs);
    color: var(--text-tertiary);
}
.sim-progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.sim-progress-bar {
    height: 100%;
    background: var(--biology);
    border-radius: var(--radius-full);
    transition: width 100ms linear;
}
.ep-progress-fill {
    background: #3b82f6;
}
.sim-param-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}
.sim-param {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sim-param label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 600;
}
.sim-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}
.sim-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    border: 2px solid var(--text-inverse);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}
.sim-slider::-webkit-slider-thumb:hover { transform: scale(1.15); background: var(--primary-dark); }
.sim-select {
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    font-family: var(--font-sans);
}
.sim-btn-row {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    flex-wrap: wrap;
}
.sim-play-btn {
    padding: var(--space-2) var(--space-6);
    font-size: var(--text-base);
    font-weight: 700;
    min-width: 120px;
    transition: var(--transition-fast);
}
.sim-play-btn:hover { transform: translateY(-1px); }

/* ============================================================
   TOOL APP PAGES (通用工具页面样式)
   ============================================================ */

.tool-app-container { padding: 0; }
.tool-app-header { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); }
.tool-app-header h3 { flex: 1; color: var(--text-primary); font-size: var(--text-xl); font-weight: 700; margin: 0; padding: 0; border: none; }
.tool-app-header h3::after { display: none; }
.tool-back-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: var(--space-2) var(--space-4);
    background: var(--bg-secondary); color: var(--text-primary);
    border: 1px solid var(--border-default); border-radius: var(--radius-full);
    font-size: var(--text-sm); font-weight: 600; cursor: pointer;
    transition: var(--transition-fast); white-space: nowrap; text-decoration: none;
    -webkit-tap-highlight-color: transparent; user-select: none;
}
.tool-back-btn .hspcb-i { width: 16px; height: 16px; flex: none; }
.tool-back-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateX(-2px); box-shadow: var(--shadow-md); }
.tool-back-btn:active { transform: scale(0.96); }
.tool-app-body { background: var(--bg-secondary); border-radius: var(--radius-md); padding: var(--space-5); min-height: 300px; border: 1px solid var(--border-light); }

.quiz-option { transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast), box-shadow var(--transition-fast); will-change: transform; }
.quiz-option:hover { background: rgba(79,110,246,0.06); border-color: var(--primary); transform: translateX(4px); }
.quiz-option.correct { background: #e8f5e9 !important; border-color: #4caf50 !important; color: #2e7d32 !important; pointer-events: none; }
.quiz-option.wrong { background: #fff3e0 !important; border-color: #ff9800 !important; color: #e65100 !important; pointer-events: none; }
.quiz-filter-btn {
    padding: 6px 14px; border-radius: var(--radius-lg); border: 1px solid var(--border-default);
    cursor: pointer; font-size: 1rem; background: var(--bg-primary); color: var(--text-primary);
    transition: var(--transition-fast); -webkit-tap-highlight-color: transparent; user-select: none;
}
.quiz-filter-btn:hover { border-color: var(--primary); background: rgba(79,110,246,0.06); }
.quiz-filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.tests-section { padding: 0; }
.tests-section h3 { font-size: var(--text-xl); font-weight: 700; margin-bottom: var(--space-5); color: var(--text-primary); }

.var-input-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--space-2); }
.var-input-group label { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); }
.var-input-group input {
    padding: var(--space-2) var(--space-3); border: 1px solid var(--border-default);
    border-radius: var(--radius-sm); font-size: var(--text-base); font-family: var(--font-sans);
    background: var(--bg-primary); color: var(--text-primary); transition: var(--transition-fast);
}
.var-input-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,110,246,0.15); outline: none; }
.var-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-3); padding: 0; }
.vars-input-grid { padding: 0; }
.vars-input-grid h4 { font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: var(--space-3); }

.result-card {
    background: #eff6ff; border: 2px solid #c7d2fe;
    border-radius: var(--radius-md); padding: var(--space-4); margin-top: var(--space-4);
}
.result-card h4 { font-size: var(--text-lg); font-weight: 700; color: var(--primary); margin-bottom: var(--space-2); }
.formula-display {
    display: inline-block; background: #fff; border: 1px solid #c7d2fe;
    padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm);
    font-family: 'SF Mono', 'Courier New', monospace; font-weight: 700;
    font-size: var(--text-base); margin-bottom: var(--space-3); color: var(--primary-dark);
}
.result-values { display: flex; flex-direction: column; gap: 6px; }
.result-item { display: flex; align-items: center; gap: 8px; }
.result-label { font-weight: 600; color: var(--text-primary); font-size: var(--text-sm); }
.result-value { font-size: var(--text-2xl); font-weight: 800; color: var(--primary); }

.knowledge-section .no-exam { text-align: center; padding: var(--space-8); color: var(--text-tertiary); }

.module-tabs-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 2px; }
.module-tabs-wrapper::-webkit-scrollbar { display: none; }

/* ============================================================
   ORGANIC CHEMISTRY CONVERTER - 全新设计
   ============================================================ */

.oc-container {
    max-width: 1400px;
    margin: 0 auto;
    background: #f8f9ff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.oc-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    background: #667eea;
    color: white;
}

.oc-header-bar h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.gd-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-oc {
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}

.btn-oc.btn-primary {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
}
.btn-oc.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.btn-oc.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.btn-oc.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.35);
}

.preset-nav {
    display: flex;
    gap: 8px;
    padding: 14px 28px;
    background: white;
    border-bottom: 1px solid #e8ecf1;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.preset-nav::-webkit-scrollbar { display: none; }

.preset-tab {
    padding: 8px 18px;
    border: 2px solid transparent;
    border-radius: 22px;
    background: #f5f7fa;
    color: #555;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}
.preset-tab:hover {
    background: #e8edff;
    border-color: #c7d2fe;
}
.preset-tab.active {
    background: #667eea;
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.35);
}

.oc-main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 600px;
}

.substance-sidebar {
    background: white;
    border-right: 1px solid #e8ecf1;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.sidebar-header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 16px;
    background: white;
    border-bottom: 1px solid #e8ecf1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e8ecf1;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    outline: none;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}
.search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.sub-count {
    font-size: 0.85rem;
    color: #888;
    font-weight: 600;
    white-space: nowrap;
}

.category-list {
    padding: 12px;
}

.cat-group {
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid #e8ecf1;
}

.cat-title {
    padding: 12px 14px;
    background: #f8fafc;
    font-weight: 700;
    font-size: 0.95rem;
    color: #334155;
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}
.cat-title:hover {
    background: #f1f5f9;
}
.cat-title::-webkit-details-marker { display: none; }

.cat-count {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

.cat-items {
    padding: 8px;
}

.sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    background: white;
    cursor: pointer;
    text-align: left;
    font-size: 0.88rem;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 4px;
    -webkit-tap-highlight-color: transparent;
}
.sub-item:hover {
    background: #f8faff;
    border-color: var(--sub-color, #667eea);
    transform: translateX(3px);
}
.sub-item.selected {
    background: rgba(102, 126, 234, 0.08);
    border-color: var(--sub-color, #667eea);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.sub-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sub-name {
    flex: 1;
    font-weight: 600;
    color: #334155;
}

.sub-formula {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: var(--radius-md);
}

.diagram-area {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.area-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e8ecf1;
}

.area-toolbar h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #1e293b;
    font-weight: 700;
}

.view-switch {
    display: flex;
    background: #f1f5f9;
    border-radius: var(--radius-md);
    padding: 3px;
}

.view-switch button {
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}
.view-switch button.active {
    background: white;
    color: #334155;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.type-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.type-filter-bar > span {
    font-weight: 600;
    color: #475569;
    font-size: 0.9rem;
}

.type-chip {
    padding: 6px 14px;
    border: 2px solid var(--chip-color, #667eea);
    border-radius: var(--radius-lg);
    background: white;
    color: var(--chip-color, #667eea);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}
.type-chip:hover {
    background: var(--chip-color, #667eea);
    color: white;
}
.type-chip.active {
    background: var(--chip-color, #667eea);
    color: white;
}

.more-types, .clear-filter {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border: none;
    background: transparent;
}
.clear-filter:hover {
    color: #ef4444;
}

.diagram-view {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid #e8ecf1;
    overflow: hidden;
}

.svg-wrapper {
    padding: 20px;
    overflow: auto;
    max-height: 550px;
}

.svg-wrapper svg {
    display: block;
    margin: 0 auto;
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #334155;
    margin: 0 0 8px;
}

.empty-desc {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0 0 24px;
}

.quick-presets {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.quick-presets button {
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    background: white;
    color: #475569;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}
.quick-presets button:hover {
    border-color: #667eea;
    background: #f8faff;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.diagram-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 14px;
    background: #f8fafc;
    border-top: 1px solid #e8ecf1;
}
.stat-item {
    font-size: 0.9rem;
    color: #64748b;
}
.stat-item strong {
    color: #334155;
    font-weight: 700;
}

.list-view {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
    max-height: 550px;
    overflow-y: auto;
}

.connection-card {
    background: white;
    border: 1px solid #e8ecf1;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}
.connection-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.cc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e8ecf1;
}

.cc-type {
    padding: 4px 12px;
    border-radius: var(--radius-lg);
    color: white;
    font-size: 0.78rem;
    font-weight: 600;
}

.cc-gd {
    font-size: 0.8rem;
    color: #f59e0b;
    font-weight: 600;
}

.cc-body {
    padding: 14px;
}

.cc-equation {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: #1e293b;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.5;
}

.cc-path {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 8px;
}
.cc-arrow {
    color: #94a3b8;
    font-weight: 400;
}

.cc-condition {
    font-size: 0.85rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 6px 10px;
    border-radius: var(--radius-md);
}

.cc-tip {
    padding: 10px 14px;
    background: #fffbeb;
    border-top: 1px solid #fef3c7;
    font-size: 0.85rem;
    color: #92400e;
}

.all-reactions-panel {
    margin-top: 20px;
    padding: 20px 28px;
    background: white;
    border-top: 1px solid #e8ecf1;
}
.all-reactions-panel h4 {
    margin: 0 0 16px;
    color: #334155;
    font-size: 1.1rem;
}

.reactions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    max-height: 350px;
    overflow-y: auto;
    padding: 4px;
}

.reaction-card {
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e8ecf1;
    border-radius: var(--radius-md);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    opacity: 0.6;
}
.reaction-card.available {
    opacity: 1;
    background: white;
    border-color: #c7d2fe;
}
.reaction-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.rc-from, .rc-to {
    font-weight: 700;
    font-size: 0.95rem;
}

.rc-arrow {
    font-size: 0.8rem;
    color: #64748b;
    margin: 6px 0;
}

.rc-eq {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #475569;
    margin: 6px 0;
}

.rc-cond {
    font-size: 0.8rem;
    color: #94a3b8;
}

.rc-gd {
    font-size: 0.8rem;
    color: #f59e0b;
    font-weight: 600;
    margin-top: 6px;
}

@media (max-width: 1200px) {
    .oc-main-content {
        grid-template-columns: 260px 1fr;
    }
}

@media (max-width: 900px) {
    .oc-container {
        border-radius: var(--radius-lg);
        margin: 0 8px;
    }
    
    .oc-header-bar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 16px 20px;
    }
    
    .preset-nav {
        padding: 10px 16px;
    }
    
    .preset-tab {
        padding: 6px 14px;
        font-size: 0.82rem;
    }
    
    .oc-main-content {
        grid-template-columns: 1fr;
    }
    
    .substance-sidebar {
        max-height: 250px;
        border-right: none;
        border-bottom: 1px solid #e8ecf1;
    }
    
    .diagram-area {
        max-height: none;
        padding: 14px;
    }
    
    .svg-wrapper {
        max-height: 400px;
    }
    
    .list-view {
        grid-template-columns: 1fr;
    }
    
    .reactions-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   ECOSYSTEM SIMULATOR - 全新设计
   ============================================================ */

.eco-sim-container {
    background: var(--bg-primary, #f0fdf4);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* 顶部工具栏 */
.eco-sim-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: var(--success, #10b981);
    color: var(--text-inverse, #fff);
    flex-wrap: wrap;
    gap: 12px;
}

/* 工具栏内按钮（pause / reset）：半透明白底 + 白字，在绿底上保持可读 */
.eco-btn-pause,
.eco-btn-reset {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-inverse, #fff);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.eco-btn-pause:hover {
    background: rgba(255, 255, 255, 0.35);
}
.eco-btn-reset:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* start 按钮：白底绿字，强调主操作 */
.eco-btn-start {
    background: var(--text-inverse, #fff);
    color: var(--success-dark, #059669);
    box-shadow: var(--shadow-sm);
}
.eco-btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.eco-sim-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.eco-sim-icon {
    font-size: 1.8rem;
    line-height: 1;
}

/* 工具栏图标（emoji → SVG）：跟随文字大小，颜色继承白色 */
.eco-sim-icon .hspcb-i,
.eco-sim-title .hspcb-i,
.eco-sim-toolbar .hspcb-i {
    width: 1.6em;
    height: 1.6em;
    color: var(--text-inverse, #fff);
}

.eco-sim-title h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.eco-sim-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.eco-btn {
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, opacity 0.25s ease, box-shadow 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.eco-btn-start {
    background: var(--text-inverse, #fff);
    color: var(--success-dark, #059669);
    box-shadow: var(--shadow-sm);
}
.eco-btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.eco-btn-pause {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-inverse, #fff);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.eco-btn-pause:hover {
    background: rgba(255, 255, 255, 0.35);
}

.eco-btn-reset {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-inverse, #fff);
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.eco-btn-reset:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 主内容区 */
.eco-sim-main {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 0;
    min-height: 500px;
}

/* 左侧物种面板 */
.eco-species-panel {
    padding: 20px;
    overflow-y: auto;
}

.eco-year-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--success, #10b981);
    border-radius: var(--radius-lg);
    color: var(--text-inverse, #fff);
    margin-bottom: 16px;
}

.eco-year-label {
    font-size: 0.88rem;
    font-weight: 600;
    opacity: 0.9;
}

.eco-year-value {
    font-size: 1.2rem;
    font-weight: 800;
}

/* 物种卡片 */
.eco-species-card {
    background: var(--bg-primary, #fff);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border-light, #e8f5e9);
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}
.eco-species-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--sp-color, #10b981);
}

.eco-sp-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.eco-sp-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-lg);
    background: var(--sp-color, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.eco-sp-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.eco-sp-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
}

.eco-sp-type {
    font-size: 0.78rem;
    color: var(--text-tertiary, #64748b);
    font-weight: 500;
}

.eco-sp-count {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--sp-color, #10b981);
    text-align: right;
    line-height: 1;
}
.eco-sp-count small {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary, #94a3b8);
}

/* 进度条 */
.eco-sp-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.eco-sp-bar {
    flex: 1;
    height: 8px;
    background: var(--border-light, #f1f5f9);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.eco-sp-bar-fill {
    height: 100%;
    border-radius: var(--radius-md);
    transition: width 0.5s ease;
    min-width: 2px;
}

.eco-sp-percent {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary, #475569);
    min-width: 42px;
    text-align: right;
}

/* 适应度 */
.eco-sp-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.eco-sp-modifier {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary, #f8fafc);
}
.eco-sp-modifier.good {
    color: var(--success, #059669);
    background: var(--success-light, #ecfdf5);
}
.eco-sp-modifier.medium {
    color: var(--warning, #d97706);
    background: var(--warning-light, #fffbeb);
}
.eco-sp-modifier.bad {
    color: var(--danger, #dc2626);
    background: var(--danger-light, #fef2f2);
}

/* 右侧控制面板 */
.eco-control-panel {
    padding: 20px;
    background: var(--bg-primary, #fff);
    border-left: 1px solid var(--border-light, #e8f5e9);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.eco-panel-section {
    /* Section container */
}

.eco-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-light, #e8f5e9);
}

/* 滑块 */
.eco-slider-group {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.eco-slider-item {
    /* Individual slider */
}

.eco-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.eco-slider-header label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary, #334155);
}

.eco-slider-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--success, #10b981);
    background: var(--success-light, #ecfdf5);
    padding: 3px 10px;
    border-radius: var(--radius-md);
}

.eco-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: var(--radius-md);
    background: var(--border-light, #f1f5f9);
    outline: none;
    cursor: pointer;
}

.eco-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--success, #10b981);
    border: 3px solid var(--bg-primary, #fff);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
    cursor: pointer;
    transition: transform 0.2s;
}
.eco-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.eco-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--success, #10b981);
    border: 3px solid var(--bg-primary, #fff);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
    cursor: pointer;
}

.eco-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
}

.eco-slider-labels span {
    font-size: 0.72rem;
    color: var(--text-tertiary, #94a3b8);
    font-weight: 500;
}

/* 季节按钮网格 */
.eco-season-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.eco-season-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border: 2px solid var(--border-light, #e8f5e9);
    border-radius: var(--radius-lg);
    background: var(--bg-primary, #fff);
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, opacity 0.25s ease, box-shadow 0.25s ease;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}
.eco-season-btn:hover {
    border-color: var(--success, #10b981);
    background: var(--success-light, #ecfdf5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.eco-season-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.eco-season-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-secondary, #334155);
}

.eco-season-desc {
    font-size: 0.72rem;
    color: var(--text-tertiary, #94a3b8);
}

/* 操作提示 */
.eco-tips {
    background: var(--bg-secondary, #f8fafc);
    border-radius: var(--radius-md);
    padding: 14px;
}

.eco-tips p {
    font-size: 0.82rem;
    color: var(--text-secondary, #475569);
    line-height: 1.6;
    margin: 0 0 6px;
}
.eco-tips p:last-child {
    margin-bottom: 0;
}

/* 底部图表区 */
.eco-chart-section {
    padding: 20px 24px;
    background: var(--bg-primary, #fff);
    border-top: 1px solid var(--border-light, #e8f5e9);
}

.eco-chart-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin: 0 0 14px;
}

.eco-chart-container {
    background: var(--bg-secondary, #f8fafc);
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--border-light, #e8f5e9);
    overflow-x: auto;
}

.eco-chart-container svg {
    display: block;
    margin: 0 auto;
}

/* 图表轴线 / 物种曲线：全部走 CSS 变量，亮暗主题自动切换 */
.eco-chart-container .axis-line { stroke: var(--border-medium, #94a3b8); stroke-width: 1.5; }
.eco-chart-container .axis-label { fill: var(--text-tertiary, #94a3b8); font-size: 12px; font-family: var(--font-sans); }
.eco-chart-container .eco-line-grass  { stroke: #4CAF50; }
.eco-chart-container .eco-line-rabbit { stroke: #8B4513; }
.eco-chart-container .eco-line-fox    { stroke: #FF6B00; }

.no-data {
    text-align: center;
    color: var(--text-tertiary, #94a3b8);
    font-size: 0.9rem;
    padding: 40px;
}

/* 响应式 */
@media (max-width: 1000px) {
    .eco-sim-main {
        grid-template-columns: 1fr;
    }

    .eco-control-panel {
        border-left: none;
        border-top: 1px solid var(--border-light, #e8f5e9);
    }

    .eco-sim-toolbar {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .eco-sim-actions {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .eco-sim-container {
        border-radius: var(--radius-lg);
        margin: 0 8px;
    }

    .eco-sim-toolbar {
        padding: 14px 16px;
    }

    .eco-sim-title h2 {
        font-size: 1.1rem;
    }

    .eco-btn {
        padding: 7px 14px;
        font-size: 0.82rem;
    }

    .eco-species-panel {
        padding: 14px;
    }

    .eco-control-panel {
        padding: 14px;
    }

    .eco-season-grid {
        grid-template-columns: 1fr 1fr;
    }

    .eco-sp-count {
        font-size: 1.3rem;
    }
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .stats-panel { order: -1; }
    .tool-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .subject-cards { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
}

@media (max-width: 768px) {
    .container { padding: var(--space-3); }
    .main-header { padding: var(--space-6) var(--space-4); }
    .main-header h1 { font-size: var(--text-2xl); }
    main { padding: var(--space-4); }
    .subject-nav { gap: var(--space-1); padding: var(--space-1); }
    .nav-btn { padding: var(--space-2) var(--space-3); }
    .nav-btn .icon { font-size: 1.2rem; }
    .tool-grid { grid-template-columns: 1fr; }
    .tools-access { grid-template-columns: 1fr; }
    .tool-card { padding: var(--space-4); }
    .module-tabs { gap: var(--space-1); }
    .module-tab { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
    .quiz-type-selector { grid-template-columns: 1fr 1fr; }
    .ec-main, .pf-main, .oc-main { grid-template-columns: 1fr; }
    .subject-cards { grid-template-columns: 1fr; }
    .quick-stats { grid-template-columns: repeat(3, 1fr); }
    .sim-status-row { gap: var(--space-1); }
    .sim-stat { padding: var(--space-1) var(--space-2); min-width: 80px; }
    .sim-stat-value { font-size: var(--text-lg); }
    .sim-param-row { flex-direction: column; gap: var(--space-2); }
    .sim-param { min-width: 0; }
    .sim-btn-row { justify-content: center; }
    .indicator-cards { flex-direction: column; }
    .ind-card { min-width: 0; }
    .equipment-grid { grid-template-columns: 1fr; }
    .mitosis-cards { grid-template-columns: 1fr; }
    .exp-card-header { padding: var(--space-2) var(--space-3); }
    .exp-card-header h4 { font-size: var(--text-sm); }
    .exp-formula { font-size: var(--text-base); padding: var(--space-1) var(--space-2); }
    .tool-app-header { flex-wrap: wrap; }
    .tool-app-body { padding: var(--space-3); }
    .module-content { padding: var(--space-3); }
    .knowledge-card { padding: var(--space-4); }
}
.quick-tools-grid { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3); }
.quick-tool-btn {
    flex: 1; min-width: 180px; padding: var(--space-3) var(--space-4);
    background: rgba(79,110,246,0.06);
    border: 1px solid var(--border-default); border-radius: var(--radius-md);
    font-size: var(--text-sm); font-weight: 600; cursor: pointer;
    color: var(--text-primary); transition: var(--transition-fast);
    will-change: transform; -webkit-tap-highlight-color: transparent; user-select: none;
}
.quick-tool-btn:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); background: rgba(79,110,246,0.1); }
.quick-tool-btn:active { transform: scale(0.97); }

@media (max-width: 480px) {
    .main-header h1 { font-size: var(--text-xl); }
    .subtitle { font-size: var(--text-sm); }
    .nav-btn { padding: var(--space-2) var(--space-2); min-width: 56px; }
    .nav-btn .icon { font-size: 1rem; }
    .nav-btn .label { font-size: var(--text-3xs); }
    .tool-grid, .tools-access { grid-template-columns: 1fr; }
    .subject-cards { grid-template-columns: 1fr; }
    .quiz-type-selector { grid-template-columns: 1fr; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    body { background: white; }
    .subject-nav, .main-footer { display: none; }
    main { box-shadow: none; border: none; padding: 0; }
    .container { max-width: 100%; padding: 0; }
}
/* ===== T0-8 / P0-12：主观题作答区 + 阅读材料 + 自评按钮 ===== */
.question-passage-box {
    margin: 16px 0; padding: 18px 20px;
    background: var(--bg-subtle, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-left: 4px solid var(--primary, #4f6ef6);
    border-radius: var(--radius-md);
}
.question-passage-box h4 { margin: 0 0 10px; font-size: 15px; color: var(--text-primary, #1e293b); }
.passage-content { font-size: 15px; line-height: 1.9; color: var(--text-primary, #1e293b); }

.subjective-box {
    margin: 16px 0; padding: 18px 20px;
    background: var(--bg-subtle, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md);
}
.subjective-box h4 { margin: 0 0 6px; font-size: 15px; }
.subjective-hint { margin: 0 0 12px; font-size: 13px; color: var(--text-secondary, #64748b); }
.subjective-input {
    width: 100%; box-sizing: border-box; padding: 12px 14px;
    font: inherit; font-size: 15px; line-height: 1.7;
    color: var(--text-primary, #1e293b);
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md); resize: vertical;
}
.subjective-input:focus { outline: 2px solid var(--primary-light, #93a5fb); outline-offset: 1px; }
.essay-counter { margin-top: 6px; font-size: 12px; color: var(--text-secondary, #64748b); text-align: right; }
.subjective-reference {
    margin-top: 14px; padding: 10px 12px; font-size: 14px; line-height: 1.7;
    background: var(--secondary-light, #e8f5e9);
    border-radius: var(--radius-md);
}
.subjective-reference .ref-label { font-weight: 600; margin-right: 8px; color: var(--secondary, #2e7d32); }

.self-judge {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 10px; padding: 10px 12px;
    background: var(--bg-subtle, #f8fafc); border-radius: var(--radius-md);
}
.self-judge-label { font-size: 13px; color: var(--text-secondary, #64748b); }
.self-judge button {
    padding: 7px 16px; font: inherit; font-size: 14px; cursor: pointer;
    border: 1px solid var(--border-color, #e2e8f0); border-radius: var(--radius-md);
    background: var(--bg-primary, #fff); color: var(--text-primary, #1e293b);
}
.self-judge button:disabled { opacity: 0.45; cursor: not-allowed; }
.self-judge .btn-self-correct:not(:disabled):hover { background: var(--secondary-light, #e8f5e9); border-color: var(--secondary, #2e7d32); }
.self-judge .btn-self-wrong:not(:disabled):hover { background: var(--danger-light, #ffebee); border-color: var(--danger, #c62828); }

/* D3：加载指示器旋转动画原为 study-tools-enhanced.js 内联 <style> 注入，
   CSP style-src 收紧为 'self' 后内联样式块被拦截，移至此处。 */
@keyframes ll-spin {
    to { transform: rotate(360deg); }
}

/* ============ 生物知识图谱（SVG 图谱视图） ============ */
.kg-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
.kg-toolbar h3 { margin:0; }
.kg-meta { font-size:12px; color:var(--text-light); }
.kg-reset { padding:5px 12px; font-size:12px; border:1px solid var(--border-light); border-radius: var(--radius-md); background:var(--bg-card); color:var(--text-secondary); cursor:pointer; }
.kg-reset:hover { background:var(--bg-secondary); }
.kg-wrap { display:flex; gap:12px; flex-wrap:wrap; align-items:flex-start; }
.kg-canvas-box { flex:1; min-width:320px; position:relative; border:1px solid var(--border-light); border-radius: var(--radius-md); background:var(--bg-card); overflow:hidden; }
.kg-svg { display:block; width:100%; height:auto; touch-action:none; cursor:grab; }
.kg-svg.is-panning { cursor:grabbing; }
.kg-node { cursor:pointer; }
.kg-label { font-size:11px; fill:var(--text-secondary); pointer-events:none; -webkit-user-select:none; user-select:none; }
.kg-node-name { font-size:11px; fill:var(--text-light); pointer-events:none; -webkit-user-select:none; user-select:none; }
.kg-hint { position:absolute; left:8px; bottom:6px; font-size:11px; color:var(--text-light); pointer-events:none; }
.kg-detail { width:320px; flex-shrink:0; max-height:640px; overflow-y:auto; }
.kg-empty { padding:16px; border:1px dashed var(--border-medium); border-radius: var(--radius-md); color:var(--text-light); font-size:13px; text-align:center; }
.kg-card { border:1px solid var(--border-light); border-radius: var(--radius-md); padding:14px; background:var(--bg-card); }
.kg-card-id { font-size:11px; color:var(--text-light); margin-bottom:2px; }
.kg-card-name { font-size:16px; font-weight:600; color:var(--text-primary); line-height:1.35; margin-bottom:6px; }
.kg-card-stat { font-size:12px; color:var(--text-secondary); margin-bottom:12px; }
.kg-block { padding:9px 10px; margin-bottom:8px; border-radius: var(--radius-md); background:var(--bg-secondary); font-size:13px; line-height:1.65; color:var(--text-secondary); }
.kg-block strong { color:var(--text-primary); }
.kg-block-danger { background:var(--danger-light,#fee2e2); border-left:3px solid var(--danger,#ef4444); }
.kg-rels { margin-top:10px; padding-top:10px; border-top:1px dashed var(--border-light); }
.kg-rels-title { font-size:12px; font-weight:600; color:var(--text-secondary); margin-bottom:6px; }
.kg-rel-jump { cursor:pointer; padding:5px 7px; margin-bottom:4px; border-radius: var(--radius-sm); background:var(--bg-secondary); font-size:12px; color:var(--text-secondary); }
.kg-rel-jump:hover { filter:brightness(0.96); }
.kg-legend { margin-top:10px; display:flex; gap:12px; flex-wrap:wrap; font-size:12px; color:var(--text-secondary); }
.kg-legend-item { display:inline-flex; align-items:center; gap:4px; }
.kg-legend-dot { width:10px; height:10px; border-radius:50%; display:inline-block; }

/* 工具加载失败提示（替代原来的 alert，避免空白无提示） */
.tool-error { padding:16px 18px; border:1px solid var(--danger,#ef4444); border-left:4px solid var(--danger,#ef4444); border-radius: var(--radius-md); background:var(--bg-card); color:var(--text-primary); font-size:14px; }
.tool-error-detail { margin-top:6px; font-size:12px; color:var(--text-secondary); font-family:ui-monospace,Consolas,monospace; word-break:break-all; }

/* ============================================================
   全真模拟考试（mock-exam）—— 与全局设计系统对齐，颜色全部走主题变量
   ============================================================ */

/* --- 选题页 --- */
.mock-exam-select { max-width:920px; margin:0 auto; padding:8px 4px 32px; }
.mock-exam-header { text-align:center; margin-bottom:24px; }
.mock-exam-header h2 { margin:0 0 8px; font-size:24px; color:var(--text-primary); }
.mock-exam-subtitle { margin:0; color:var(--text-secondary); font-size:14px; line-height:1.6; }

.mock-exam-subject-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:16px; }
.mock-exam-subject-card {
    position:relative; cursor:pointer; text-align:center;
    background:var(--bg-card,var(--bg-primary)); border:1px solid var(--border-light);
    border-radius:var(--radius-lg,14px); padding:20px; box-shadow:var(--shadow-sm);
    transition:transform .2s ease, box-shadow .2s ease;
}
.mock-exam-subject-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-md,var(--shadow-sm)); }
.mock-exam-card-icon { font-size:34px; line-height:1; margin-bottom:10px; }
.mock-exam-subject-card h3 { margin:0 0 8px; font-size:18px; color:var(--text-primary); }
.mock-exam-badge { display:inline-block; padding:2px 10px; border-radius:10px; font-size:12px; color:#fff; margin-bottom:10px; }
.mock-exam-card-desc { margin:0 0 16px; font-size:12.5px; color:var(--text-secondary); line-height:1.6; min-height:40px; }
.mock-exam-start-btn {
    width:100%; padding:10px 0; border:none; border-radius:var(--radius-md,8px);
    color:#fff; font-size:14px; font-weight:600; cursor:pointer; transition:filter .2s ease;
}
.mock-exam-start-btn:hover { filter:brightness(1.08); }

.mock-exam-history { margin-top:28px; }
.mock-exam-history h3 { display:flex; align-items:center; justify-content:space-between; font-size:16px; color:var(--text-primary); margin:0 0 12px; }
.mock-exam-clear-btn { background:transparent; border:1px solid var(--border-medium); color:var(--text-secondary); font-size:12px; padding:4px 12px; border-radius:var(--radius-sm,6px); cursor:pointer; }
.mock-exam-clear-btn:hover { border-color:var(--danger,#ef4444); color:var(--danger,#ef4444); }
.mock-exam-history-list { display:flex; flex-direction:column; gap:8px; }
.mock-exam-history-item {
    display:flex; align-items:center; gap:12px; flex-wrap:wrap;
    padding:10px 14px; background:var(--bg-secondary,#f9f9f9);
    border:1px solid var(--border-light); border-radius:var(--radius-md,8px);
    font-size:13px; color:var(--text-primary);
}
.mock-exam-history-subject { font-weight:600; }
.mock-exam-history-score { color:var(--primary); font-weight:600; }
.mock-exam-history-date { color:var(--text-tertiary,#999); margin-left:auto; }
.mock-exam-review-btn { padding:4px 12px; border:1px solid var(--primary); background:transparent; color:var(--primary); border-radius:var(--radius-sm,6px); cursor:pointer; font-size:12px; }
.mock-exam-review-btn:hover { background:var(--primary); color:#fff; }

/* --- 考试页 --- */
.mock-exam-exam { max-width:920px; margin:0 auto; padding-bottom:40px; }
.mock-exam-topbar {
    position:sticky; top:0; z-index:20;
    display:flex; align-items:center; gap:12px; flex-wrap:wrap;
    padding:12px 16px; margin-bottom:12px;
    background:var(--bg-card,var(--bg-primary)); border:1px solid var(--border-light);
    border-radius:var(--radius-md,8px); box-shadow:var(--shadow-sm);
}
.mock-exam-topbar h2 { flex:1; margin:0; font-size:16px; color:var(--text-primary); }
.mock-exam-back-btn {
    display:inline-flex; align-items:center; gap:6px;
    padding:6px 14px; background:transparent; color:var(--text-secondary);
    border:1px solid var(--border-medium); border-radius:var(--radius-sm,6px);
    cursor:pointer; font-size:13px;
}
.mock-exam-back-btn .hspcb-i { width:16px; height:16px; }
.mock-exam-back-btn:hover { color:var(--primary); border-color:var(--primary); }
.mock-exam-timer {
    padding:6px 14px; border-radius:var(--radius-sm,6px);
    background:var(--bg-secondary,#f0f0f0); color:var(--text-primary);
    font-weight:700; font-variant-numeric:tabular-nums; font-size:15px;
}
.mock-exam-timer-warning { background:var(--warning-light,#fff7e6); color:var(--warning,#faad14); }
.mock-exam-timer-danger { background:var(--danger-light,#fff1f0); color:var(--danger,#ef4444); animation:mock-exam-pulse 1s infinite; }
@keyframes mock-exam-pulse { 0%,100% { opacity:1; } 50% { opacity:.55; } }

.mock-exam-progress { height:26px; background:var(--bg-secondary,#f0f0f0); border-radius:13px; overflow:hidden; margin-bottom:18px; }
.mock-exam-progress-bar {
    height:100%; width:0; min-width:2px;
    background:linear-gradient(90deg,var(--primary,#4a90e2),var(--primary-light,#6aa9ea));
    color:#fff; font-size:11px; font-weight:600;
    display:flex; align-items:center; justify-content:flex-end; padding-right:8px;
    transition:width .3s ease;
}

.mock-exam-questions { display:flex; flex-direction:column; gap:16px; }
.mock-exam-question-card {
    background:var(--bg-card,var(--bg-primary)); border:1px solid var(--border-light);
    border-radius:var(--radius-lg,12px); padding:18px 20px; box-shadow:var(--shadow-sm);
}
.mock-exam-qheader { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.mock-exam-qnum { font-weight:700; color:var(--primary); font-size:14px; }
.mock-exam-qtype, .mock-exam-qcat {
    font-size:11px; padding:2px 8px; border-radius:10px;
    background:var(--bg-secondary,#f0f0f0); color:var(--text-secondary);
}
.mock-exam-qpoints { font-size:12px; color:var(--text-tertiary,#999); margin-left:auto; }
.mock-exam-qbody { font-size:14.5px; line-height:1.75; color:var(--text-primary); }

.mock-exam-options { display:flex; flex-direction:column; gap:8px; margin-top:14px; }
.mock-exam-option {
    display:flex; align-items:flex-start; gap:10px;
    padding:10px 14px; border:1px solid var(--border-light);
    border-radius:var(--radius-md,8px); cursor:pointer;
    transition:border-color .15s, background .15s;
}
.mock-exam-option:hover { border-color:var(--primary); background:var(--bg-secondary,#f9f9f9); }
.mock-exam-option-input { margin-top:3px; accent-color:var(--primary,#4a90e2); }
.mock-exam-option-letter { font-weight:700; color:var(--primary); }
.mock-exam-option-text { flex:1; font-size:14px; color:var(--text-primary); line-height:1.6; }

.mock-exam-answer-essay, .mock-exam-answer-blank { margin-top:14px; }
.mock-exam-essay-input, .mock-exam-blank-input {
    width:100%; box-sizing:border-box; padding:10px 12px;
    border:1px solid var(--border-medium); border-radius:var(--radius-md,8px);
    background:var(--bg-primary); color:var(--text-primary);
    font-size:14px; font-family:inherit; line-height:1.6; resize:vertical;
}
.mock-exam-essay-input:focus, .mock-exam-blank-input:focus {
    outline:none; border-color:var(--primary);
    box-shadow:0 0 0 3px var(--primary-glow,rgba(74,144,226,.15));
}

.mock-exam-submit-area { margin-top:24px; text-align:center; }
.mock-exam-submit-btn {
    padding:12px 48px; border:none; border-radius:var(--radius-md,8px);
    background:linear-gradient(135deg,var(--primary,#4a90e2),var(--primary-dark,#3a7bc8));
    color:#fff; font-size:15px; font-weight:600; cursor:pointer;
    box-shadow:var(--shadow-sm); transition:filter .2s;
}
.mock-exam-submit-btn:hover { filter:brightness(1.08); }
.mock-exam-submit-hint { margin:8px 0 0; font-size:12px; color:var(--text-tertiary,#999); }

/* --- 成绩页 --- */
.mock-exam-results { max-width:920px; margin:0 auto; padding-bottom:40px; }
.mock-exam-result-summary {
    text-align:center; padding:28px 20px; margin-bottom:20px;
    background:var(--bg-card,var(--bg-primary)); border:1px solid var(--border-light);
    border-radius:var(--radius-lg,14px); box-shadow:var(--shadow-sm);
}
.mock-exam-result-summary h2 { margin:0 0 12px; font-size:18px; color:var(--text-primary); }
.mock-exam-result-grade { display:inline-block; padding:4px 18px; border-radius:20px; font-size:14px; font-weight:700; margin-bottom:10px; }
.mock-exam-grade-a { background:var(--success-light,#f6ffed); color:var(--success,#52c41a); }
.mock-exam-grade-b { background:var(--primary-lighter,#e6f7ff); color:var(--primary,#4a90e2); }
.mock-exam-grade-c, .mock-exam-grade-d { background:var(--warning-light,#fff7e6); color:var(--warning,#faad14); }
.mock-exam-grade-f { background:var(--danger-light,#fff1f0); color:var(--danger,#ef4444); }
.mock-exam-result-score { display:flex; align-items:baseline; justify-content:center; gap:4px; margin:6px 0; }
.mock-exam-score-big { font-size:44px; font-weight:800; color:var(--text-primary); line-height:1; }
.mock-exam-score-divider { font-size:24px; color:var(--text-tertiary,#bbb); }
.mock-exam-score-total { font-size:22px; color:var(--text-secondary); }
.mock-exam-result-pct { font-size:14px; color:var(--text-secondary); margin-bottom:10px; }
.mock-exam-result-meta { display:flex; gap:18px; justify-content:center; flex-wrap:wrap; font-size:13px; color:var(--text-secondary); }

.mock-exam-result-actions { display:flex; gap:12px; justify-content:center; margin-bottom:20px; flex-wrap:wrap; }
.mock-exam-retake-btn { padding:10px 28px; border:none; border-radius:var(--radius-md,8px); background:var(--primary); color:#fff; font-size:14px; font-weight:600; cursor:pointer; }
.mock-exam-retake-btn:hover { filter:brightness(1.08); }
.mock-exam-results .mock-exam-back-btn { padding:10px 28px; font-size:14px; }

.mock-exam-analysis, .mock-exam-perquestion {
    background:var(--bg-card,var(--bg-primary)); border:1px solid var(--border-light);
    border-radius:var(--radius-lg,12px); padding:18px 20px; margin-bottom:18px; box-shadow:var(--shadow-sm);
}
.mock-exam-analysis h3, .mock-exam-perquestion h3 { margin:0 0 12px; font-size:16px; color:var(--text-primary); }
.mock-exam-analysis-table { width:100%; border-collapse:collapse; font-size:13px; }
.mock-exam-analysis-table th {
    padding:8px 10px; text-align:left; font-weight:600; white-space:nowrap;
    color:var(--text-secondary); border-bottom:1px solid var(--border-medium);
}
.mock-exam-analysis-table td { padding:8px 10px; border-bottom:1px solid var(--border-light); color:var(--text-primary); }

.mock-exam-result-row {
    border-left:3px solid var(--border-medium); padding:10px 14px; margin-bottom:10px;
    background:var(--bg-secondary,#fafafa); border-radius:var(--radius-md,8px);
}
.mock-exam-row-correct { border-left-color:var(--success,#52c41a); }
.mock-exam-row-wrong { border-left-color:var(--danger,#ef4444); }
.mock-exam-row-essay { border-left-color:var(--warning,#faad14); }
.mock-exam-result-row-header { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:6px; }
.mock-exam-result-icon { font-size:15px; }
.mock-exam-result-num { font-weight:600; font-size:13px; color:var(--text-primary); }
.mock-exam-result-cat { font-size:11px; padding:1px 8px; border-radius:10px; background:var(--bg-primary); border:1px solid var(--border-light); color:var(--text-secondary); }
.mock-exam-result-question { font-size:13.5px; color:var(--text-primary); line-height:1.7; margin-bottom:8px; }
.mock-exam-result-answers { display:flex; flex-direction:column; gap:4px; font-size:13px; }
.mock-exam-user-answer { color:var(--text-secondary); }
.mock-exam-correct-answer { color:var(--success,#52c41a); }
.mock-exam-result-analysis { margin-top:8px; padding:8px 12px; background:var(--bg-primary); border-radius:var(--radius-sm,6px); font-size:12.5px; color:var(--text-secondary); line-height:1.65; }

@media (max-width:640px) {
    .mock-exam-subject-grid { grid-template-columns:1fr; }
    .mock-exam-topbar h2 { flex-basis:100%; order:3; }
    .mock-exam-history-date { margin-left:0; }
    .mock-exam-score-big { font-size:36px; }
}
