/* ============================================================
   我不是考神 · 期末复习助手 —— 现代玻璃拟态设计系统
   ============================================================ */

:root {
    --bg: #08080f;
    --bg-elevated: rgba(255, 255, 255, 0.035);
    --bg-card: rgba(255, 255, 255, 0.045);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-glass: rgba(8, 8, 18, 0.6);
    --border: rgba(0, 240, 255, 0.1);
    --border-strong: rgba(0, 240, 255, 0.22);
    --text-primary: #e8e8f5;
    --text-secondary: #8888a8;
    --text-muted: #50506a;
    --accent: #00f0ff;
    --accent-secondary: #b026ff;
    --accent-tertiary: #f59e0b;
    --accent-gradient: linear-gradient(135deg, #00f0ff 0%, #b026ff 100%);
    --accent-gradient-soft: linear-gradient(135deg, rgba(0, 240, 255, 0.12) 0%, rgba(176, 38, 255, 0.12) 100%);
    --neon-cyan: #00f0ff;
    --neon-purple: #b026ff;
    --neon-glow: 0 0 24px rgba(0, 240, 255, 0.15), 0 0 48px rgba(176, 38, 255, 0.08);
    --neon-border: 1px solid rgba(0, 240, 255, 0.18);
    --success: #00ff88;
    --warning: #ffaa00;
    --danger: #ff3366;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 30px rgba(0, 240, 255, 0.12), 0 0 60px rgba(176, 38, 255, 0.06);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
}

[data-theme="light"] {
    --bg: #f0f2f8;
    --bg-elevated: rgba(255, 255, 255, 0.75);
    --bg-card: rgba(255, 255, 255, 0.68);
    --bg-card-hover: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.78);
    --border: rgba(0, 100, 130, 0.08);
    --border-strong: rgba(0, 100, 130, 0.15);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a5e;
    --text-muted: #7a7a92;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 30px rgba(0, 180, 200, 0.1);
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* 动态背景光晕 — 编织网络风格 */
body::before,
body::after {
    content: "";
    position: fixed;
    width: 70vmax;
    height: 70vmax;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.12;
    z-index: -1;
    pointer-events: none;
    animation: float 25s ease-in-out infinite;
}

body::before {
    background: radial-gradient(circle, rgba(0, 200, 255, 0.4), transparent 65%);
    top: -25vmax;
    left: -15vmax;
}

body::after {
    background: radial-gradient(circle, rgba(120, 80, 255, 0.35), transparent 65%);
    bottom: -25vmax;
    right: -15vmax;
    animation-delay: -12s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* 玻璃容器 */
#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    position: relative;
}

/* 霓虹边框微光（毛玻璃容器顶部高光线） */
.glass::before {
    content: "";
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.4), rgba(176, 38, 255, 0.4), transparent);
    pointer-events: none;
}

/* 顶部导航：默认文档流，不跟随滚动，可折叠 */
#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 26px;
    margin-bottom: 24px;
    position: relative;
    top: auto;
    z-index: 100;
    transition: var(--transition);
}

/* 品牌区 */
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--accent-gradient);
    display: grid;
    place-items: center;
    font-size: 22px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3), 0 0 40px rgba(176, 38, 255, 0.15);
}

.brand h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 按钮系统 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent-gradient);
    border: none;
    color: #08080f;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(0, 240, 255, 0.3), 0 0 24px rgba(176, 38, 255, 0.12);
}

.btn-primary:hover {
    box-shadow: 0 6px 28px rgba(0, 240, 255, 0.4), 0 0 40px rgba(176, 38, 255, 0.2);
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--accent-gradient-soft);
    border: 1px solid rgba(124, 58, 237, 0.25);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    border: 1px solid transparent;
}

.btn-ghost:hover {
    border-color: var(--border-strong);
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* 首页英雄区 */
.hero {
    text-align: center;
    padding: 50px 20px 40px;
    margin-bottom: 30px;
}

.hero h2 {
    font-size: 42px;
    font-weight: 800;
    margin: 0 0 14px;
    letter-spacing: -1px;
    line-height: 1.2;
}

.hero h2 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.3));
}

.hero p {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 28px;
}

/* 输入卡片网格 */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.input-card {
    padding: 22px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.input-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.1), 0 0 60px rgba(176, 38, 255, 0.06);
}

.input-card .card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 24px;
    margin-bottom: 14px;
}

.input-card.ppt .card-icon { background: rgba(245, 158, 11, 0.15); }
.input-card.audio .card-icon { background: rgba(6, 182, 212, 0.15); }
.input-card.notes .card-icon { background: rgba(124, 58, 237, 0.15); }

.input-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
}

.input-card p {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.file-drop {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-elevated);
}

.file-drop:hover, .file-drop.dragover {
    border-color: var(--accent);
    background: var(--accent-gradient-soft);
    color: var(--text-primary);
}

.file-drop input { display: none; }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 12px;
    background: var(--bg-elevated);
    color: var(--text-muted);
}

.status-pill.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

/* 录音控制 */
.audio-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.rec-visualizer {
    height: 60px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    padding: 10px;
    overflow: hidden;
}

.rec-bar {
    width: 5px;
    border-radius: 3px;
    background: var(--accent-gradient);
    transition: height 0.1s ease;
    height: 8px;
}

.timer {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 10px;
}

/* 转写文本展示框 */
.transcript-box {
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-elevated);
}
.transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    background: var(--bg-card);
    transition: background 0.15s;
}
.transcript-header:hover { background: var(--bg-elevated); }
.transcript-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
.transcript-arrow {
    font-size: 11px;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.transcript-box.collapsed .transcript-arrow { transform: rotate(-90deg); }
.transcript-content {
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
.transcript-box.collapsed .transcript-content { display: none; }

/* 文本域 */
textarea, input[type="text"], select {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

textarea:focus, input[type="text"]:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1), 0 0 16px rgba(0, 240, 255, 0.08);
}

textarea::placeholder, input::placeholder {
    color: var(--text-muted);
}

/* 功能网格 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.feature-card {
    padding: 18px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
    color: inherit;
}
.feature-grid > a.feature-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    background: var(--bg-card-hover);
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.12), inset 0 0 20px rgba(176, 38, 255, 0.04);
}

.feature-card .icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 20px;
    margin: 0 auto 12px;
    background: var(--accent-gradient-soft);
}

.feature-card h4 {
    margin: 0 0 6px;
    font-size: 15px;
}

.feature-card p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

/* 进度步骤 */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 28px;
    position: relative;
}

.progress-steps::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    flex: 1;
}

.step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--border-strong);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    transition: var(--transition);
}

.step.active .step-dot {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #08080f;
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.4), 0 0 32px rgba(176, 38, 255, 0.2);
}

.step.done .step-dot {
    background: var(--success);
    border-color: transparent;
    color: #fff;
}

.step-label {
    font-size: 12px;
    color: var(--text-muted);
}

.step.active .step-label {
    color: var(--text-primary);
    font-weight: 600;
}

/* 加载骨架屏 */
.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card-hover) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 结果页标签 */
.tabs {
    display: flex;
    gap: 8px;
    padding: 6px;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.tab:hover:not(.active) {
    color: var(--text-secondary);
}

.tabs .run-all-btn {
    margin-left: auto;
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-panel {
    display: none !important;
    width: 100%;
    animation: fadeInUp 0.3s ease;
    margin-top: 18px;
}

.tab-panel.active {
    display: block !important;
}

.tab-panel > .glass {
    margin-bottom: 0;
}

/* Markdown 内容区 */
.md-content {
    font-size: 14px;
    line-height: 1.75;
    color: var(--text-primary);
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* 强制 renderer 注入的内联 style 不覆盖 .md-content 的字号 */
.md-content p,
.md-content h1, .md-content h2, .md-content h3, .md-content h4, .md-content h5, .md-content h6,
.md-content li, .md-content td, .md-content th, .md-content blockquote {
    font-size: inherit;
    line-height: inherit;
}

/* 所有标题统一为 14px（与正文一致），仅靠 weight / border / 装饰条区分层级 */
.md-content h1,
.md-content h2,
.md-content h3,
.md-content h4,
.md-content h5,
.md-content h6 {
    font-size: 14px !important;
    font-weight: 700;
    line-height: 1.5;
    margin: 14px 0 8px;
    padding: 0;
    border: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 一级标题（一、二、...）用左侧色条 + 加粗，视觉最突出 */
.md-content h1 {
    font-weight: 800;
    color: var(--accent);
    margin-top: 22px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.md-content h1::before {
    content: "";
    width: 4px;
    height: 16px;
    border-radius: 3px;
    background: var(--accent-gradient);
}

/* 二级标题（重点、难点、子节）用左侧短色条 */
.md-content h2::before,
.md-content h3::before,
.md-content h4::before {
    content: "";
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--accent);
    flex-shrink: 0;
}

.md-content p {
    margin: 8px 0;
}

.md-content ul, .md-content ol {
    padding-left: 22px;
    margin: 8px 0;
}

.md-content li {
    margin: 4px 0;
}

.md-content strong {
    color: var(--accent, #6366f1);
    font-weight: 700;
}

.md-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px !important;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.md-content th, .md-content td {
    border: 1px solid var(--border);
    padding: 6px 10px;
    text-align: left;
    font-size: 13px !important;
}

.md-content th {
    background: var(--bg-elevated);
    font-weight: 700;
}

.md-content tr:nth-child(even) {
    background: rgba(255,255,255,0.02);
}

.md-content blockquote {
    margin: 12px 0;
    padding: 10px 14px;
    border-left: 3px solid var(--accent);
    background: var(--bg-elevated);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-size: 13px;
}

/* 复习资料内容紧凑布局：表格不换行、列表内不换行 */
#review-content.md-content table {
    table-layout: auto;
    width: 100%;
    font-size: 13px;
}
#review-content.md-content table th,
#review-content.md-content table td {
    white-space: nowrap;
    padding: 8px 14px;
}
#review-content.md-content table td:nth-child(2) {
    white-space: normal;  /* 第二列（内容描述）允许换行 */
    max-width: 480px;
}
#review-content.md-content li {
    line-height: 1.6;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
#review-content.md-content p {
    line-height: 1.7;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.md-content pre {
    background: #0d0d15;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13px;
}

.md-content code {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--bg-elevated);
    padding: 2px 7px;
    border-radius: 5px;
    color: var(--accent-secondary);
}

.md-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* 闪卡 */
/* 闪卡 */
.flashcard {
    perspective: 1000px;
    height: 240px;
    cursor: pointer;
    margin-bottom: 16px;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow-y: auto;
}

.flashcard-back {
    transform: rotateY(180deg);
    background: var(--accent-gradient-soft);
}

.flashcard-hint {
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.flashcard-front p, .flashcard-back p {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    word-break: break-word;
}

.flashcard-tags {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.flashcard-tags .tag {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

/* 自测题 */
.quiz-panel {
    padding: 22px;
}

.quiz-setup {
    margin-bottom: 18px;
}

.quiz-setup-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
}

.quiz-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.quiz-field input, .quiz-field select {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    min-width: 160px;
}

.quiz-field input { min-width: 240px; }

.quiz-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.quiz-state-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px dashed rgba(239, 68, 68, 0.35);
    border-radius: var(--radius-sm);
}

.quiz-state-error h4 { margin: 12px 0 6px; color: var(--danger); }

.quiz-error-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
}

.quiz-raw {
    text-align: left;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-top: 14px;
    max-height: 260px;
    overflow: auto;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
}

.quiz-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin: 18px 0;
    padding: 14px 18px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.quiz-progress {
    flex: 1;
    min-width: 220px;
}

.quiz-progress span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.quiz-score-bar {
    height: 6px;
    background: var(--bg-card);
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.quiz-score-fill {
    height: 100%;
    width: 0%;
    transition: width .4s ease;
    border-radius: 4px;
    background: var(--text-muted);
}

.quiz-score-fill.high { background: var(--success); }
.quiz-score-fill.mid { background: var(--warning); }
.quiz-score-fill.low { background: var(--danger); }

.quiz-card {
    padding: 18px 20px;
    margin-bottom: 14px;
    border-left: 4px solid var(--accent);
    transition: var(--transition);
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    font-size: 13px;
    line-height: 1.6;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    position: relative;
    clear: both;
}

.quiz-card * {
    font-size: inherit;
    line-height: inherit;
    box-sizing: border-box;
    float: none !important;
    clear: both;
}
.quiz-card-table {
    display: table !important;
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}
.quiz-card-table > tbody,
.quiz-card-table > thead {
    display: table-row-group !important;
}
.quiz-card-table tr {
    display: table-row !important;
}
.quiz-card-table td {
    display: table-cell !important;
    vertical-align: top !important;
}

/* 简化版 quiz 卡片（quiz-card-block div 链） */
.quiz-card-block {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    float: none !important;
}
.quiz-card .quiz-options,
.quiz-card .quiz-options * {
    flex-direction: column !important;
}
.quiz-card .quiz-opt-text,
.quiz-card .quiz-opt-label {
    display: inline-flex !important;
    width: auto !important;
}
.quiz-card .quiz-opt-text { flex: 1 1 auto !important; }
.quiz-card.graded { border-left-color: var(--success); }

.quiz-head {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.quiz-type {
    background: var(--accent-gradient-soft);
    color: var(--text-primary);
    padding: 3px 10px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 11px;
}

.quiz-num { font-weight: 600; font-size: 12px; }

.quiz-question {
    font-size: 14px !important;
    font-weight: 500;
    margin-bottom: 10px;
    word-break: keep-all;
    overflow-wrap: anywhere;
    white-space: normal;
    line-height: 1.7;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border-radius: 8px;
    border-left: 3px solid var(--accent, #7c3aed);
    display: block !important;
    visibility: visible !important;
}
.quiz-question p { margin: 0 !important; line-height: 1.7 !important; font-size: 14px !important; }
.quiz-stem-text {
    display: block;
    width: 100%;
    white-space: pre-wrap;
    word-break: keep-all;
    overflow-wrap: anywhere;
    line-height: 1.7;
    font-size: 14px !important;
    color: var(--text-primary);
}

.quiz-options {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 6px;
    margin: 0 0 12px;
    width: 100% !important;
}

.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--bg-elevated);
    border: 1px solid transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    line-height: 1.5;
    min-height: 36px;
}

.quiz-option:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.quiz-option.selected { border-color: var(--accent); background: var(--accent-gradient-soft); }

.quiz-opt-label {
    flex: 0 0 24px;
    height: 24px;
    min-width: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: 11px;
    font-weight: 700;
    margin-top: 1px;
}

.quiz-opt-text { flex: 1; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; font-size: 13px; }

.quiz-answer-box { margin-bottom: 10px; }

.quiz-answer-text {
    width: 100%;
    min-height: 70px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
}

.quiz-actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quiz-reveal {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--bg-elevated);
    border: 1px dashed var(--border-strong);
    display: block !important;
    width: 100% !important;
    font-size: 13px;
    line-height: 1.6;
}

.quiz-reveal-inner {
    display: block !important;
    width: 100% !important;
    font-size: 13px;
    flex-direction: column !important;
}
.quiz-reveal-inner > * {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 8px;
    flex: 0 0 auto !important;
}
.quiz-answer-block, .quiz-analysis-block {
    display: block !important;
    width: 100% !important;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 6px;
    border-left: 3px solid var(--accent);
}
.quiz-answer-block strong, .quiz-analysis-block strong {
    display: block !important;
    margin-bottom: 4px;
    color: var(--accent) !important;
    font-size: 13px !important;
}

/* quiz 列表强制单列 */
#quiz-list, .quiz-list {
    display: block !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    column-count: 1 !important;
    column-gap: 0 !important;
}
#quiz-list > *, .quiz-list > * {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    break-inside: avoid;
}
.quiz-reveal-inner > * {
    display: block !important;
    width: 100% !important;
    margin-bottom: 8px;
}
.quiz-reveal-inner strong { color: var(--text-secondary); }
.quiz-analysis { padding: 8px 0; border-top: 1px dashed var(--border); }

.quiz-analysis { margin-top: 8px; color: var(--text-secondary); }

/* panel-quiz 强制单列布局（不影响 tab-panel 的显示/隐藏） */
#panel-quiz, .quiz-panel {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
}

.grade-result { margin-top: 14px; }

.grade-pending {
    padding: 14px;
    text-align: center;
    color: var(--text-muted);
}

.grade-result-box {
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border-left: 4px solid var(--accent);
}

.grade-result-box.high { border-left-color: var(--success); background: rgba(34, 197, 94, 0.08); }
.grade-result-box.mid { border-left-color: var(--warning); background: rgba(245, 158, 11, 0.08); }
.grade-result-box.low { border-left-color: var(--danger); background: rgba(239, 68, 68, 0.08); }

.grade-score {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    padding: 6px 12px;
    border-radius: 16px;
    font-weight: 800;
    color: #fff;
    font-size: 14px;
}

.score-badge.high { background: var(--success); }
.score-badge.mid { background: var(--warning); }
.score-badge.low { background: var(--danger); }

.grade-label { font-weight: 700; color: var(--text-primary); }

.grade-feedback { color: var(--text-secondary); margin-top: 6px; }

.grade-suggestion {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
}

/* 关键词卡片 */
.keyword-cloud {
    padding: 6px;
}

.keyword-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.keyword-card {
    padding: 18px 18px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.keyword-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    background: var(--bg-card-hover);
}

.keyword-title {
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.keyword-def {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 复习计划重点高亮 */
.plan-emphasis {
    font-weight: 800;
    color: var(--accent);
    background: var(--accent-gradient-soft);
    padding: 0 4px;
    border-radius: 4px;
}

/* 复习计划 - 概览卡片 */
.plan-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    padding: 18px 16px;
    border-radius: 14px;
    background: var(--glass-2, rgba(255,255,255,0.04));
    border: 1px solid var(--border, rgba(255,255,255,0.08));
}
.plan-summary-item {
    text-align: center;
    padding: 8px 4px;
    border-radius: 10px;
    transition: transform 0.2s, background 0.2s;
}
.plan-summary-item:hover {
    transform: translateY(-2px);
    background: var(--accent-gradient-soft, rgba(99,102,241,0.08));
}
.plan-summary-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent, #6366f1);
    line-height: 1.1;
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1, #ec4899));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.plan-summary-label {
    font-size: 12px;
    color: var(--text-muted, #888);
    margin-top: 4px;
    letter-spacing: 0.5px;
}

/* 复习计划 - 日期网格 */
.plan-days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 8px;
}
.plan-day-card {
    background: var(--card-bg, rgba(255,255,255,0.04));
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 14px;
    padding: 16px 18px;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}
.plan-day-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-gradient, linear-gradient(180deg, #6366f1, #ec4899));
    border-radius: 3px 0 0 3px;
    opacity: 0.6;
    transition: opacity 0.25s;
}
.plan-day-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent, #6366f1);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}
.plan-day-card:hover::before {
    opacity: 1;
}
.plan-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.plan-day-num {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted, #888);
    background: var(--accent-gradient-soft, rgba(99,102,241,0.08));
    padding: 3px 8px;
    border-radius: 6px;
}
.plan-day-date {
    font-size: 13px;
    color: var(--text-muted, #888);
    font-weight: 500;
}
.plan-day-theme {
    font-size: 17px;
    font-weight: 700;
    color: var(--text, #fff);
    margin-bottom: 12px;
    line-height: 1.4;
}
.plan-task-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}
.plan-task-list li {
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-soft, #ccc);
    padding: 4px 0 4px 18px;
    position: relative;
}
.plan-task-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent, #6366f1);
    font-weight: bold;
}
.plan-task-list-empty {
    font-size: 13px;
    color: var(--text-muted, #888);
    font-style: italic;
    padding: 4px 0;
}
.plan-day-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--border, rgba(255,255,255,0.06));
}
.plan-day-time, .plan-day-test {
    font-size: 12px;
    color: var(--text-soft, #ccc);
    background: var(--glass-2, rgba(255,255,255,0.04));
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}

/* 复习计划 - 备用 Markdown 表格样式 */
.plan-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 8px;
    background: var(--card-bg, rgba(255,255,255,0.03));
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border, rgba(255,255,255,0.08));
}
.plan-table thead th {
    background: var(--accent-gradient-soft, rgba(99,102,241,0.1));
    color: var(--accent, #6366f1);
    font-weight: 700;
    padding: 12px 14px;
    text-align: left;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
}
.plan-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.05));
    color: var(--text, #fff);
    font-size: 13.5px;
    line-height: 1.6;
    vertical-align: top;
}
.plan-table tbody tr:hover {
    background: var(--accent-gradient-soft, rgba(99,102,241,0.05));
}
.plan-table tbody tr:last-child td {
    border-bottom: none;
}
.plan-cell-empty {
    color: var(--text-muted, #888) !important;
    font-style: italic;
}


/* 聊天 */
#chat-box {
    max-height: 360px;
    overflow-y: auto;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    margin-bottom: 12px;
}

.message {
    display: flex;
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease;
}

.message.user {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 78%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
}

.message.user .message-bubble {
    background: var(--accent-gradient);
    color: #08080f;
    font-weight: 500;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 16px rgba(0, 240, 255, 0.2);
}

.message.assistant .message-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 聊天中的题目卡片 */
.chat-quiz-box {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.chat-quiz-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.chat-quiz-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.chat-quiz-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}
.chat-quiz-type {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 2px 8px;
    border-radius: 999px;
}
.chat-quiz-stem {
    font-weight: 500;
    margin-bottom: 10px;
    line-height: 1.6;
}
.chat-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}
.chat-quiz-opt {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--bg-elevated);
    font-size: 13px;
}
.chat-quiz-opt-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
}
.chat-quiz-answer,
.chat-quiz-analysis {
    font-size: 13px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    color: var(--text-secondary);
    line-height: 1.6;
}
.chat-quiz-answer strong,
.chat-quiz-analysis strong {
    color: var(--text-primary);
}
.message-bubble .chat-quiz-item p {
    margin: 0 0 6px;
}

/* 快捷建议按钮 */
.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.chat-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.chat-chip:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent-soft);
    transform: translateY(-1px);
}

.chat-chip:active {
    transform: translateY(0);
}

/* 聊天区材料来源选择芯片 */
.source-chip {
    user-select: none;
}
.source-chip.active {
    background: var(--accent-gradient-soft);
    border-color: rgba(0, 240, 255, 0.35);
    color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
}
.source-chip:disabled,
.source-chip.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.6);
}

/* 思考/流式动画 */
.message.thinking .message-bubble {
    background: var(--bg-elevated);
    border: 1px dashed var(--border);
    color: var(--text-muted);
}

.thinking-dots::after {
    content: '';
    display: inline-block;
    width: 3px;
    height: 3px;
    margin-left: 2px;
    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: 6px 0 0 var(--text-muted), 12px 0 0 var(--text-muted);
    animation: thinkingBlink 1.2s infinite both;
}

@keyframes thinkingBlink {
    0%, 20% { opacity: 0.2; }
    50% { opacity: 1; }
    80%, 100% { opacity: 0.2; }
}

.chat-rendering .message-bubble {
    position: relative;
}

/* 流式光标由 JS 在文本末尾追加 ▌，并通过 chat-rendering 类控制颜色 */
.chat-rendering .message-bubble {
    color: var(--text-primary);
}

.chat-stream-cursor {
    display: inline;
    color: var(--accent);
    animation: cursorBlink 1s step-end infinite;
    margin-left: 1px;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 消息入场动画增强 */
.message {
    animation: messageSlideIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 工具栏 */
.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 0;
}

/* Toast */
#toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    box-shadow: var(--shadow);
    display: none;
    align-items: center;
    gap: 10px;
    max-width: 420px;
    animation: slideIn 0.3s ease;
}

#toast.show { display: flex; }
#toast.error { border-left: 4px solid var(--danger); }
#toast.success { border-left: 4px solid var(--success); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 响应式 */
@media (max-width: 768px) {
    #app { padding: 14px; }
    .hero h2 { font-size: 28px; }
    .input-grid { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    #header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .progress-steps { display: none; }
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 打印 */
@media print {
    body { background: #fff !important; color: #000 !important; }
    body::before, body::after { display: none !important; }
    .glass { box-shadow: none !important; border-color: #ddd !important; }
    .tabs, .toolbar, #header, #toast { display: none !important; }
}

/* ============================================================
   多标签并发任务状态组件
   ============================================================ */

.tab-status {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin-bottom: 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
}

.tab-status.running { display: flex; }
.tab-status.done { display: flex; border-color: rgba(34, 197, 94, 0.3); background: rgba(34, 197, 94, 0.08); color: var(--success); }
.tab-status.error { display: flex; border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.08); color: var(--danger); }

.status-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--accent-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-step {
    flex: 1;
}

.status-model {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 20px;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 42px;
    margin-bottom: 12px;
    opacity: 0.7;
}

/* 已完成结果的轻量提示条 */
.result-done-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 14px;
    border-radius: var(--radius-sm);
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    font-size: 13px;
    color: var(--success);
}

.result-done-bar .model {
    color: var(--text-muted);
    font-size: 12px;
}

/* 标签页小圆点状态 */
.tab .tab-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    margin-left: 6px;
    display: inline-block;
    opacity: 0.5;
    transition: var(--transition);
}

.tab.active .tab-dot.running { background: var(--accent-secondary); opacity: 1; box-shadow: 0 0 8px var(--accent-secondary); }
.tab.active .tab-dot.done { background: var(--success); opacity: 1; }
.tab.active .tab-dot.error { background: var(--danger); opacity: 1; }
.tab .tab-dot.done { background: var(--success); opacity: 1; }
.tab .tab-dot.error { background: var(--danger); opacity: 1; }

/* 修复按钮组 */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.toolbar input, .toolbar select {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 14px;
    outline: none;
}

.toolbar input:focus, .toolbar select:focus {
    border-color: var(--accent-secondary);
}

/* 多文件列表 */
.file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.file-chip {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-chip.ok { border-color: rgba(46, 204, 113, .5); color: var(--text-primary); }
.file-chip.err { border-color: rgba(231, 76, 60, .5); color: #e74c3c; }
.file-chip { display: inline-flex; align-items: center; gap: 4px; }
.chip-remove {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    border: none; background: rgba(255,255,255,.12);
    color: inherit; font-size: 14px; line-height: 1;
    cursor: pointer; padding: 0; margin-left: 2px;
    transition: background .2s, transform .2s;
    flex-shrink: 0;
}
.chip-remove:hover { background: rgba(231,76,60,.7); color: #fff; transform: scale(1.15); }

/* 资料提问框 */
.material-qa { margin-top: 20px; }
.qa-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 4px;
}
.qa-message { display: flex; }
.qa-message.user { justify-content: flex-end; }
.qa-message.assistant { justify-content: flex-start; }
.qa-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}
.qa-message.user .qa-bubble {
    background: var(--accent-secondary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.qa-message.assistant .qa-bubble {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}
.qa-bubble p { margin: 0 0 8px; }
.qa-bubble p:last-child { margin-bottom: 0; }
.qa-bubble pre { white-space: pre-wrap; }

/* ============ 备案信息 footer（公安备案告知书第五条） ============ */
.site-footer {
    margin-top: 40px;
    padding: 18px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
    text-align: center;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 18px;
    max-width: 1100px;
    margin: 0 auto;
    font-size: 12.5px;
    color: var(--text-secondary);
}
.footer-inner a {
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px dashed var(--text-secondary);
    padding-bottom: 1px;
}
.footer-inner a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ============ 全局字体缩小 & 紧凑排版（2026-07-14 优化） ============ */
body { font-size: 14px; }
.brand h1 { font-size: 18px; }
.brand p { font-size: 11px; }
.hero { padding: 38px 18px 28px; }
.hero h2 { font-size: 32px; }
.hero p { font-size: 15px; margin-bottom: 20px; }
.input-card { padding: 18px; }
.input-card .card-icon { width: 42px; height: 42px; font-size: 21px; margin-bottom: 10px; }
.input-card h3 { font-size: 15px; }
.input-card p { font-size: 12px; margin-bottom: 12px; }
.feature-card { padding: 15px; }
.feature-card .icon { width: 40px; height: 40px; font-size: 18px; }
.feature-card h4 { font-size: 14px; }
.feature-card p { font-size: 11px; }
.md-content { font-size: 14px; line-height: 1.7; }
.md-content h1 { font-size: 22px; margin: 22px 0 12px; }
.md-content h2 { font-size: 17px; margin: 20px 0 10px; }
.md-content h2::before { height: 18px; }
.md-content h3 { font-size: 15px; margin: 16px 0 8px; }
.md-content p { margin: 8px 0; }
.md-content table { font-size: 13px; }
.md-content pre { font-size: 12px; padding: 12px; }
.quiz-question { font-size: 15px; }
.quiz-option { font-size: 13px; padding: 10px 12px; }
.flashcard-front p, .flashcard-back p { font-size: 16px; }
.timer { font-size: 16px; }

/* ============ 结果页双栏布局：右侧索引框 ============ */
#result-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 20px;
    align-items: start;
}
#result-main { min-width: 0; }
#right-index {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 50px);
    overflow-y: auto;
    padding: 18px;
    border-radius: var(--radius);
}
#right-index h4 { margin: 0 0 12px; font-size: 14px; color: var(--text-secondary); }
#right-index .idx-tabs {
    display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap;
}
#right-index .idx-tab {
    padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg-elevated); color: var(--text-secondary); cursor: pointer;
    font-size: 12px; transition: var(--transition);
}
#right-index .idx-tab:hover { border-color: var(--accent); }
#right-index .idx-tab.active { background: var(--accent-gradient-soft); color: var(--text-primary); border-color: var(--accent); }
#right-index .idx-stats {
    display: flex; gap: 8px; margin-bottom: 14px; padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
#right-index .idx-stat-item {
    flex: 1; text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--bg-elevated);
}
#right-index .idx-stat-num { display: block; font-size: 18px; font-weight: 700; color: var(--accent); }
#right-index .idx-stat-label { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
#right-index ul { list-style: none; padding: 0; margin: 0; }
#right-index li { margin: 0; }
#right-index a,
#right-index .idx-item {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}
#right-index a:hover, #right-index a.active,
#right-index .idx-item:hover, #right-index .idx-item.active {
    background: var(--accent-gradient-soft);
    color: var(--text-primary);
}
#right-index .idx-stat { font-size: 11px; color: var(--text-muted); margin-left: 6px; }
@media (max-width: 900px) {
    #result-layout { grid-template-columns: 1fr; }
    #right-index { display: none; }
}

/* ============ 浮动材料提问框 ============ */
#material-qa-floating {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    width: min(960px, calc(100vw - 28px));
    max-width: 960px;
    z-index: 150;
    padding: 14px 16px;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.18);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
#material-qa-floating.minimized {
    width: 52px;
    height: 52px;
    transform: none;
    left: auto;
    right: 24px;
    bottom: 24px;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.3);
    transition: var(--transition);
}
#material-qa-floating.minimized:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.4);
}
#material-qa-floating.minimized .qa-minimized-only { display: grid; place-items: center; width: 100%; height: 100%; font-size: 22px; }
#material-qa-floating.minimized .qa-expanded { display: none !important; }
.qa-minimized-only { display: none; }
.qa-expanded { display: block; }
.qa-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.qa-head h4 { margin: 0; font-size: 14px; }
.qa-head .qa-actions { display: flex; gap: 6px; }
.qa-head .qa-actions button {
    background: transparent; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.qa-head .qa-actions button:hover { background: var(--bg-elevated); color: var(--text-primary); }
.qa-source-row {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    margin-bottom: 12px; padding: 8px 10px;
    background: var(--bg-elevated); border-radius: 10px;
    border: 1px dashed var(--border);
}
.qa-source-row::before {
    content: '📂 来源';
    font-size: 11px; color: var(--text-muted); font-weight: 600;
    white-space: nowrap; margin-right: 4px;
}
.qa-source-chip {
    padding: 5px 12px; border-radius: 20px; background: var(--bg-card); border: 1px solid var(--border);
    cursor: pointer; color: var(--text-secondary); transition: var(--transition); font-size: 12px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px;
}
.qa-source-chip:hover, .qa-source-chip.active { border-color: var(--accent); background: var(--accent-gradient-soft); color: var(--text-primary); }
.qa-source-chip.all { font-weight: 700; }
.qa-input-row { display: flex; gap: 8px; }
.qa-input-row input { flex: 1; padding: 10px 12px; font-size: 14px; }

/* ============ 回答气泡绿色（助手回答） ============ */
.qa-message.assistant .qa-bubble {
    background: rgba(34, 197, 94, 0.12) !important;
    border: 1px solid rgba(34, 197, 94, 0.25) !important;
    color: var(--text-primary) !important;
}

/* ============ 选择题去掉输入框 ============ */
.quiz-card[data-type="选择题"] .quiz-answer-box,
.quiz-card[data-type="选择"] .quiz-answer-box,
.quiz-card[data-type="单选题"] .quiz-answer-box,
.quiz-card[data-type="多选题"] .quiz-answer-box { display: none; }
.quiz-card[data-type="选择题"] .quiz-grade-btn,
.quiz-card[data-type="选择"] .quiz-grade-btn,
.quiz-card[data-type="单选题"] .quiz-grade-btn,
.quiz-card[data-type="多选题"] .quiz-grade-btn { display: none; }
.quiz-card[data-type="选择题"] .quiz-option.selected { background: rgba(34, 197, 94, 0.15); border-color: var(--success); }

/* ============ 词云图容器 ============ */
#wordcloud-canvas { width: 100%; height: 520px; display: block; margin: 0 auto; }
#keywords-cloud { position: relative; min-height: 520px; }
.wordcloud-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

/* ============ 导出下拉 ============ */
.export-dropdown { position: relative; display: inline-block; }
.export-menu {
    display: none; position: absolute; right: 0; top: 100%; margin-top: 6px;
    background: var(--bg-glass); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: var(--shadow); min-width: 150px; z-index: 50; overflow: hidden;
}
.export-menu.show { display: block; }
.export-menu button {
    width: 100%; text-align: left; padding: 10px 14px; border: none; background: transparent;
    color: var(--text-primary); font-size: 14px; cursor: pointer; transition: var(--transition);
}
.export-menu button:hover { background: var(--bg-elevated); }
.save-all-btn {
    font-weight: 600 !important;
    color: #fff !important;
    background: var(--accent-gradient) !important;
    border-radius: 8px !important;
    margin: 4px 6px !important;
    width: calc(100% - 12px) !important;
}
.save-all-btn:hover { filter: brightness(1.08); }

/* ============ 录音列表 / 文件列表 ============ */
.upload-list {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.upload-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; padding: 5px 10px; border-radius: 999px;
    background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-secondary);
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.upload-chip.ok { border-color: rgba(34, 197, 94, 0.5); }
.upload-chip .del { cursor: pointer; color: var(--text-muted); font-weight: 700; }
.upload-chip .del:hover { color: var(--danger); }

/* ============ 录音暂停按钮 ============ */
#pause-btn { display: none; }
#pause-btn.visible { display: inline-flex; }

/* ============ 职业规划自测页 ============ */
.career-section { max-width: 860px; margin: 0 auto; }
.career-question { padding: 18px; margin-bottom: 14px; border-left: 4px solid var(--accent-secondary); }
.career-option {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; margin: 6px 0;
    border-radius: 10px; background: var(--bg-elevated); border: 1px solid transparent;
    color: var(--text-primary); cursor: pointer; font-size: 14px; transition: var(--transition);
}
.career-option:hover, .career-option.selected { border-color: var(--accent); background: var(--accent-gradient-soft); }
.career-progress { margin: 18px 0; }
.career-progress-bar { height: 6px; background: var(--bg-card); border-radius: 4px; overflow: hidden; }
.career-progress-fill { height: 100%; background: var(--accent-gradient); width: 0%; transition: width .3s; }
.career-result { padding: 22px; margin-top: 18px; }
.career-result h3 { margin: 0 0 10px; font-size: 18px; }
.service-card { padding: 14px; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--border); margin-bottom: 10px; }
.service-card strong { color: var(--accent-secondary); }

/* ============ 字体适度缩小 & 文字排布优化（用户反馈文字挤在一起） ============ */
.md-content { font-size: 14.5px; line-height: 1.85; }
.md-content h1 { font-size: 22px; margin: 28px 0 14px; line-height: 1.4; }
.md-content h2 { font-size: 19px; margin: 24px 0 12px; line-height: 1.4; }
.md-content h3 { font-size: 16.5px; margin: 20px 0 10px; line-height: 1.45; }
.md-content p { margin: 10px 0; line-height: 1.85; }
.md-content ul, .md-content ol { margin: 10px 0; padding-left: 22px; }
.md-content li { margin: 6px 0; line-height: 1.8; }
.md-content table { font-size: 13px; margin: 12px 0; }
.md-content pre { font-size: 12px; padding: 14px; margin: 12px 0; }
.md-content blockquote { margin: 12px 0; padding: 10px 16px; }
.quiz-question { font-size: 15px; line-height: 1.75; }
.quiz-option { font-size: 14px; }
.quiz-reveal { font-size: 14px; line-height: 1.75; }
.qa-bubble { font-size: 14px; line-height: 1.7; }
.keyword-title { font-size: 18px !important; }
.summary-content, #summary-content, #plan-content { font-size: 14.5px; line-height: 1.85; }
.summary-content p, #summary-content p, #plan-content p { margin: 10px 0; line-height: 1.85; }
.summary-content li, #summary-content li, #plan-content li { margin: 6px 0; line-height: 1.8; }

/* ============ 摘要卡片布局 ============ */
.summary-intro { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}
.summary-card {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 16px 18px; border-radius: 14px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    transition: var(--transition);
}
.summary-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.1);
    transform: translateY(-2px);
}
.summary-card-icon {
    flex: 0 0 36px; height: 36px; border-radius: 10px;
    display: grid; place-items: center; font-size: 18px;
    background: var(--accent-gradient-soft);
}
.summary-card-body {
    flex: 1; font-size: 14px; line-height: 1.75; color: var(--text-primary);
    word-break: break-word; overflow-wrap: break-word;
}
.summary-card-body p { margin: 0; }
.summary-fallback { padding: 8px 4px; }
.summary-fallback p { margin: 12px 0; line-height: 1.9; }
.summary-fallback h1, .summary-fallback h2, .summary-fallback h3 { margin-top: 24px; }
.card-front p, .card-back p { font-size: 14.5px; }
.service-card { font-size: 14px; }

/* ============================================================
   赛博朋克辐射尘粒子背景 + 底部状态栏
   ============================================================ */

/* 粒子画布 */
#particle-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -2;
    pointer-events: none;
}

/* 辐射呼吸光：从屏幕中心向外的脉冲光晕 */
.radiation-pulse {
    position: fixed;
    top: 50%; left: 50%;
    width: 80vmax; height: 80vmax;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 200, 255, 0.04) 0%, rgba(120, 80, 255, 0.02) 30%, transparent 60%);
    z-index: -1;
    pointer-events: none;
    animation: radiationBreath 8s ease-in-out infinite;
}

@keyframes radiationBreath {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(0.95); }
    50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.05); }
}

/* 底部状态栏 */
.status-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 20px;
    background: rgba(8, 8, 18, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    z-index: 90;
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.status-bar-left, .status-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-bar-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 脉冲指示灯 */
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon-cyan);
    box-shadow: 0 0 8px var(--neon-cyan);
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--neon-cyan), 0 0 16px var(--neon-cyan); }
    50% { opacity: 0.5; box-shadow: 0 0 4px var(--neon-cyan); }
}

.pulse-dot.online { background: var(--success); box-shadow: 0 0 8px var(--success); }
.pulse-dot.online { animation: pulseDot 2s ease-in-out infinite; }

/* 霓虹文字微光 */
.neon-text {
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

/* hero 区增强：辐射环装饰 */
.hero {
    position: relative;
}
.hero::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 500px; height: 500px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(0, 240, 255, 0.06);
    box-shadow: 0 0 0 1px rgba(176, 38, 255, 0.04), inset 0 0 0 1px rgba(0, 240, 255, 0.03);
    pointer-events: none;
    z-index: -1;
    animation: heroRing 8s ease-in-out infinite;
}
@keyframes heroRing {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.8; }
}

/* 聊天建议按钮霓虹 */
.chat-chip:hover {
    background: var(--accent-gradient-soft);
    color: var(--neon-cyan);
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
    transform: translateY(-1px);
}

/* 流式光标霓虹色 */
.chat-stream-cursor {
    display: inline;
    color: var(--neon-cyan);
    text-shadow: 0 0 8px var(--neon-cyan);
    animation: cursorBlink 1s step-end infinite;
    margin-left: 1px;
}

/* 滚动条霓虹 */
::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.3);
}

/* body 底部留出状态栏空间 */
body { padding-bottom: 32px; }

/* 移动端隐藏状态栏右侧 */
@media (max-width: 768px) {
    .status-bar-right { display: none; }
    .status-bar { font-size: 10px; padding: 4px 12px; }
    .radiation-pulse { display: none; }
    .hero::after { display: none; }
}

/* ============ 成就面板 + 聊天气泡（游戏化 UI） ============ */
.achievement-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    flex: 1 1 180px;
    min-width: 150px;
    transition: var(--transition);
}
.achievement-stat:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.1);
}
.achievement-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.achievement-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.2;
}
.achievement-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* 聊天气泡 */
.chat-bubble {
    margin-bottom: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border-left: 3px solid var(--accent);
    position: relative;
    animation: fadeInUp 0.3s ease;
}
.chat-bubble.user { border-left-color: #22c55e; background: var(--bg-card); }
.chat-bubble .bubble-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.chat-bubble .bubble-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}
.chat-bubble:hover .bubble-actions { opacity: 1; }
.bubble-actions button {
    background: none;
    border: 1px solid var(--border);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}
.bubble-actions button:hover {
    background: var(--accent-gradient-soft);
    color: var(--text-primary);
    border-color: var(--accent);
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
