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

:root {
    --train-bg: #f4f6f7;
    --train-surface: #ffffff;
    --train-surface-soft: #f8fafb;
    --train-line: #dfe5e8;
    --train-line-strong: #cbd5da;
    --train-text: #1f2933;
    --train-muted: #66737c;
    --train-faint: #87939b;
    --train-primary: #1f5f78;
    --train-primary-hover: #17485d;
    --train-primary-soft: #e8f1f4;
    --train-danger: #9f3a3a;
    --train-warning: #8a6a2b;
    --train-radius: 6px;
}

body {
    font-family: "Segoe UI", "Noto Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--train-bg);
    color: var(--train-text);
    line-height: 1.55;
}

.container {
    max-width: 1240px;
    margin: 16px auto;
    padding: 18px 22px;
    background: var(--train-surface);
    border: 1px solid var(--train-line);
    border-radius: var(--train-radius);
    box-shadow: none;
}

/* 双栏布局 */
.main-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0;
    max-width: 800px;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

@media (max-width: 900px) {
    .main-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        position: static;
    }
}

/* KaTeX 数学公式样式 */
.katex {
    font-size: 1.1em;
}
.katex-display {
    margin: 10px 0;
    overflow-x: auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--train-line);
}

h1 {
    font-size: 21px;
    color: var(--train-text);
    letter-spacing: 0;
}

.stats {
    font-size: 14px;
    color: #7f8c8d;
}

.filters {
    display: flex;
    gap: 10px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 7px 13px;
    border: 1px solid var(--train-line);
    border-radius: var(--train-radius);
    background: var(--train-surface);
    color: var(--train-muted);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.filter-btn:hover {
    background: var(--train-primary-soft);
    color: var(--train-primary);
    border-color: #b8ccd3;
}

.filter-btn.active {
    background: #eef4f6;
    color: var(--train-primary);
    border-color: var(--train-primary);
}

/* ===== 练习控制台 ===== */
.practice-console {
    border-bottom: 1px solid #eee;
}

.practice-console-summary {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    cursor: pointer;
    list-style: none;
}

.practice-console-summary::-webkit-details-marker {
    display: none;
}

.console-title {
    font-weight: 700;
    color: #2c3e50;
}

.console-state {
    min-width: 0;
    color: #7f8c8d;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.practice-console[open] .practice-console-summary {
    border-bottom: 1px solid #eef1f4;
}

.practice-console[open] .collapse-arrow {
    transform: rotate(180deg);
}

.control-bar {
    display: grid;
    grid-template-columns: minmax(190px, auto) minmax(280px, 1fr) minmax(220px, auto);
    gap: 16px;
    padding: 14px 0;
    border-bottom: none;
}

.control-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.control-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #95a5a6;
}

.control-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-center {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.control-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 控制栏内的年份/试卷选择：去掉底部边框和多余padding */
.control-bar .year-paper-select {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 0;
    border-bottom: none;
}

/* 控制栏内的筛选按钮：去掉底部边框 */
.control-bar .filters {
    display: flex;
    gap: 8px;
    padding: 0;
    border-bottom: none;
    flex-wrap: wrap;
}

/* 小号按钮用于控制栏 */
.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* 控制栏响应式 */
@media (max-width: 900px) {
    .control-bar {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .control-left,
    .control-center,
    .control-right {
        width: 100%;
        justify-content: flex-start;
    }

    .control-right {
        justify-content: flex-start;
    }
}

body.dark-mode .control-bar {
    border-bottom-color: #2a3a5e;
}

body.dark-mode .practice-console {
    border-bottom-color: #2a3a5e;
}

body.dark-mode .practice-console[open] .practice-console-summary {
    border-bottom-color: #2a3a5e;
}

body.dark-mode .console-title {
    color: #e8edf7;
}

/* 年份和试卷选择器样式 */
.year-paper-select {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.year-paper-select label {
    font-size: 14px;
    color: #7f8c8d;
}

.year-paper-select select {
    padding: 8px 12px;
    border: 1px solid var(--train-line-strong);
    border-radius: var(--train-radius);
    background: var(--train-surface);
    cursor: pointer;
}

.year-paper-select select:focus {
    border-color: var(--train-primary);
}

.mode-status {
    font-size: 14px;
    color: #7f8c8d;
}

.mock-timer {
    font-weight: bold;
    color: var(--train-warning);
    background: #f8f3e9;
    padding: 6px 10px;
    border: 1px solid #e4d8c2;
    border-radius: var(--train-radius);
}

.question-container {
    padding: 18px 0;
}

.question-meta {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 24px;
    white-space: pre-wrap;
}

/* 题目表格样式 */
.question-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 14px;
    border-radius: var(--train-radius);
    overflow: hidden;
    box-shadow: none;
}

.question-text thead th {
    background: #eef3f5;
    color: var(--train-text);
    padding: 10px 14px;
    text-align: center;
    font-weight: 600;
    border: 1px solid var(--train-line);
}

.question-text tbody td {
    padding: 9px 14px;
    border: 1px solid #e0e0e0;
    text-align: center;
    background: white;
}

.question-text tbody tr:nth-child(even) td {
    background: #f8f9fa;
}

.question-text tbody tr:hover td {
    background: #f1f5f6;
}

.question-text tbody tr td:first-child {
    font-weight: 700;
    color: #2c3e50;
    background: #ecf0f1;
    width: 50px;
}

.question-text tbody tr:nth-child(even) td:first-child {
    background: #e8ecef;
}

.question-text tbody tr:hover td:first-child {
    background: #e4ecef;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    border: 1px solid var(--train-line);
    border-radius: var(--train-radius);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.option:hover {
    border-color: #aebdc4;
    background: var(--train-surface-soft);
}

.option.selected {
    border-color: var(--train-primary);
    background: var(--train-primary-soft);
    box-shadow: inset 3px 0 0 var(--train-primary);
    font-weight: 600;
}

.option.correct {
    border-color: #6a9b7d;
    background: #edf5ef;
}

.option.wrong {
    border-color: #b98484;
    background: #f6eeee;
}

.option-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--train-line-strong);
    background: var(--train-surface-soft);
    color: var(--train-muted);
    font-weight: 700;
    font-size: 14px;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.option:hover .option-label {
    border-color: #3498db;
    color: #3498db;
}

.option.selected .option-label {
    border-color: var(--train-primary);
    background: var(--train-primary);
    color: white;
}

.option.correct .option-label {
    border-color: #27ae60;
    background: #27ae60;
    color: white;
}

.option.wrong .option-label {
    border-color: #e74c3c;
    background: #e74c3c;
    color: white;
}

/* 选项反馈图标 */
.option-feedback {
    margin-left: auto;
    font-size: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    flex-shrink: 0;
}

.option.correct .option-feedback {
    opacity: 1;
}

.option.wrong .option-feedback {
    opacity: 1;
}

.option-content {
    flex: 1;
    min-width: 0;
}

/* 正确选项弹跳动画 */
@keyframes bounceCorrect {
    0% { transform: scale(1); }
    30% { transform: scale(1.05); }
    60% { transform: scale(0.97); }
    100% { transform: scale(1); }
}

.option.correct.animate {
    animation: bounceCorrect 0.4s ease;
}

/* 错误选项抖动动画 */
@keyframes shakeWrong {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-6px); }
    30% { transform: translateX(6px); }
    45% { transform: translateX(-4px); }
    60% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
    90% { transform: translateX(2px); }
}

.option.wrong.animate {
    animation: shakeWrong 0.5s ease;
}

.actions {
    display: flex;
    gap: 10px;
    padding-top: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 9px 16px;
    border: 1px solid var(--train-line-strong);
    border-radius: var(--train-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    background: var(--train-surface);
    color: var(--train-text);
}

.btn-primary {
    background: var(--train-primary);
    border-color: var(--train-primary);
    color: white;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: none;
}

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

.btn-secondary {
    background: var(--train-surface-soft);
    color: var(--train-text);
    border-color: var(--train-line-strong);
}

.btn-secondary:hover {
    background: #eef2f4;
    border-color: #b9c5ca;
}

.btn-outline {
    background: transparent;
    color: var(--train-muted);
    border-color: var(--train-line-strong);
}

.btn-outline:hover {
    background: var(--train-surface-soft);
    color: var(--train-text);
}

.btn-nav {
    background: var(--train-surface-soft);
    color: var(--train-text);
    border: 1px solid var(--train-line-strong);
}

.btn-nav:hover {
    background: #eef2f4;
}

.btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.progress-bar {
    background: #e6ecef;
    height: 6px;
    border-radius: 3px;
    margin-top: 20px;
}

.progress-fill {
    background: var(--train-primary);
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.analysis {
    margin-top: 20px;
    padding: 0;
    background: transparent;
    display: block;
}

.analysis.collapsible-panel[open] > .collapsible-summary + * {
    display: block;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    margin-top: 0;
}

.insights-panel {
    padding: 0;
    border-bottom: 1px solid #eee;
}

.insights-panel-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 15px 0 5px;
}

.insight-box {
    padding: 14px;
    background: #f8f9fa;
    border-radius: 8px;
}

.insight-box h3 {
    margin-bottom: 10px;
    font-size: 16px;
    color: #2c3e50;
}

/* ===== 可折叠面板 ===== */
.collapsible-panel {
    margin-bottom: 16px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.collapsible-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f1f3f5;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    color: #495057;
    list-style: none;
}

.collapsible-summary::-webkit-details-marker {
    display: none;
}

.collapsible-summary .collapse-arrow {
    font-size: 12px;
    transition: transform 0.2s;
    color: #868e96;
}

details[open] .collapse-arrow {
    transform: rotate(180deg);
}

.answer-card.collapsible-panel {
    border: none;
    background: transparent;
}

.answer-card.collapsible-panel > .collapsible-summary {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
}

.answer-card.collapsible-panel[open] .answer-card-header,
.answer-card.collapsible-panel[open] .answer-card-grid {
    padding: 0 4px 4px;
}

.analysis.collapsible-panel {
    border: none;
    background: transparent;
}

.analysis.collapsible-panel > .collapsible-summary {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
}

.insights-panel > .collapsible-summary {
    background: transparent;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 0;
}

.insights-panel[open] > .collapsible-summary {
    border-radius: 0;
}

.insight-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}

.insight-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    background: white;
    border-radius: 6px;
}

.insight-empty {
    font-size: 14px;
    color: #7f8c8d;
}

.topic-select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

.tag-select,
.jump-select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    max-width: 190px;
}

.generator-panel {
    border-bottom: 1px solid #eee;
    padding: 14px 0;
}

.generator-select-container {
    max-width: 760px;
}

.generator-select-title {
    color: #1f6f8b;
}

#generatorSelectView .generator-panel {
    border: 1px solid #e6edf2;
    border-radius: 12px;
    padding: 22px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(31, 111, 139, 0.08);
    text-align: left;
}

#generatorSelectView .generator-header {
    border-bottom: 1px solid #eef3f6;
    padding-bottom: 14px;
}

#generatorSelectView .generator-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 14px;
    align-items: end;
}

#generatorSelectView .generator-grid input,
#generatorSelectView .generator-grid select {
    width: 100%;
}

#generatorSelectView .generator-grid button {
    min-height: 38px;
}

#generatorSelectView .export-options {
    border-top: 1px solid #eef3f6;
    margin-top: 18px;
    padding-top: 16px;
}

.generator-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.generator-header h2 {
    font-size: 18px;
    color: #2c3e50;
    margin: 0 0 2px;
}

.generator-header p {
    margin: 0;
    color: #7f8c8d;
    font-size: 13px;
}

.generator-grid {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.generator-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #7f8c8d;
}

.generator-grid input,
.generator-grid select {
    width: 90px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

.generator-grid select {
    width: 130px;
}

.generator-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.generator-filter-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #7f8c8d;
}

.generator-filter-grid select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

.export-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    color: #7f8c8d;
    font-size: 12px;
}

.export-options label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

#downloadWorksheetBtn {
    margin-left: auto;
}

.question-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 8px 0 10px;
}

.btn-favorite {
    border: 1px solid #f1c40f;
    background: #fff9db;
    color: #8a6d00;
}

.btn-favorite.active {
    background: #f1c40f;
    color: #2c2500;
}

.question-count-label {
    font-size: 12px;
    color: #7f8c8d;
}

.question-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 8px;
}

.question-taxonomy {
    margin: 2px 0 18px;
    color: #7f8c8d;
}

.question-taxonomy summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #7f8c8d;
    list-style: none;
}

.question-taxonomy summary::-webkit-details-marker {
    display: none;
}

.question-taxonomy summary::after {
    content: '展开';
    padding: 1px 6px;
    border: 1px solid #d8e1ea;
    border-radius: 999px;
    font-size: 11px;
    color: #607d8b;
}

.question-taxonomy[open] summary::after {
    content: '收起';
}

.tag-chip {
    border: 1px solid #d7e0e4;
    border-radius: 999px;
    padding: 4px 9px;
    background: #f7f9fa;
    color: #4f626c;
    font-size: 12px;
    cursor: pointer;
}

.tag-chip:hover {
    border-color: #9db4bd;
    color: var(--train-primary);
}

.tag-module {
    background: #eef4f6;
}

.tag-section {
    background: #f4f7f4;
}

.tag-skill {
    background: #f8f5ee;
}

.tag-difficulty {
    background: #f5f5f7;
    cursor: default;
}

/* ===== 欢迎页样式 ===== */
#welcomeView {
    max-width: 860px;
    margin: 28px auto;
    text-align: left;
}

.welcome-hero {
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--train-line);
}

.welcome-title {
    font-size: 30px;
    color: var(--train-text);
    margin-bottom: 8px;
    letter-spacing: 0;
}

.welcome-subtitle {
    font-size: 15px;
    color: var(--train-muted);
}

.welcome-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}

.welcome-card {
    min-height: 128px;
    padding: 16px;
    border-radius: var(--train-radius);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    border: 1px solid var(--train-line);
    text-align: left;
    background: var(--train-surface-soft);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.welcome-card:hover {
    background: #f2f6f7;
    border-color: var(--train-primary);
}

.welcome-card .card-icon {
    width: max-content;
    min-width: 34px;
    padding: 2px 7px;
    border: 1px solid var(--train-line-strong);
    border-radius: 999px;
    color: var(--train-primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 16px;
    line-height: 1.5;
}

.welcome-card h2 {
    font-size: 17px;
    margin-bottom: 5px;
    color: var(--train-text);
}

.welcome-card p {
    font-size: 13px;
    color: var(--train-muted);
    margin: 0;
}

/* 卡片配色 */
.card-practice,
.card-mock,
.card-wrong,
.card-favorite,
.card-shuffle,
.card-builder {
    background: var(--train-surface-soft);
}

/* 进度概览 */
.welcome-progress {
    margin-bottom: 24px;
}

.welcome-progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--train-muted);
}

/* 底部 */
.welcome-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--train-line);
}

#welcomeContinueLink {
    color: #3498db;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

#welcomeContinueLink:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* 练习界面头部 */
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-link {
    font-size: 14px;
    color: #3498db;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.back-link:hover {
    background: #e8f4fc;
    text-decoration: none;
}

/* ===== 模拟考试选卷视图 ===== */
.mock-select-container {
    max-width: 720px;
    margin: 30px auto;
    text-align: center;
}

.mock-select-nav {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
}

.mock-select-nav .back-link {
    position: absolute;
    left: 0;
}

.mock-select-title {
    font-size: 22px;
    font-weight: 700;
    color: #e67e22;
    width: 100%;
    text-align: center;
}

/* 步骤指示器 */
.mock-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.mock-step {
    font-size: 15px;
    font-weight: 600;
    color: #bbb;
    padding: 6px 16px;
    border-radius: 20px;
    background: #f0f0f0;
    transition: all 0.3s;
}

.mock-step.active {
    color: white;
    background: #e67e22;
}

.mock-step.done {
    color: #27ae60;
    background: #d4edda;
}

.mock-step-arrow {
    font-size: 20px;
    color: #ccc;
}

/* 选年份区 */
.mock-section {
    margin-bottom: 24px;
}

.year-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.year-card {
    width: 88px;
    padding: 16px 8px 12px;
    border-radius: var(--train-radius);
    border: 1px solid var(--train-line);
    background: var(--train-surface-soft);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-align: center;
    user-select: none;
}

.year-card:hover {
    background: #f2f6f7;
    border-color: var(--train-primary);
}

.year-card:active {
    transform: scale(0.96);
}

.year-card.selected {
    border-color: var(--train-primary);
    background: var(--train-primary-soft);
    box-shadow: none;
}

.year-card .year-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--train-text);
    display: block;
}

.year-card.selected .year-num {
    color: var(--train-primary);
}

.year-card .year-progress {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    display: block;
}

.year-card .year-status {
    font-size: 10px;
    color: var(--train-muted);
    margin-top: 3px;
    display: block;
}

/* 选试卷区 */
.paper-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.paper-card {
    padding: 22px 18px;
    border-radius: var(--train-radius);
    border: 1px solid var(--train-line);
    background: var(--train-surface-soft);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-align: center;
    user-select: none;
}

.paper-card:hover {
    background: #f2f6f7;
    border-color: var(--train-primary);
}

.paper-card:active {
    transform: scale(0.97);
}

.paper-card.selected {
    border-color: var(--train-primary);
    background: var(--train-primary-soft);
    box-shadow: none;
}

.paper-card .paper-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--train-text);
    margin-bottom: 6px;
}

.paper-card.selected .paper-name {
    color: var(--train-primary);
}

.paper-card .paper-count {
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
}

.paper-card .paper-progress-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.paper-card .paper-progress-fill {
    height: 100%;
    background: #4f7d65;
    border-radius: 3px;
    transition: width 0.4s;
}

.paper-card .paper-accuracy {
    font-size: 12px;
    color: #888;
}

/* 底部操作区 */
.mock-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: 12px;
}

.mock-selection-hint {
    font-size: 14px;
    color: #888;
}

.mock-start-btn {
    padding: 14px 48px;
    font-size: 16px;
    font-weight: 700;
    border: 1px solid var(--train-line-strong);
    border-radius: var(--train-radius);
    background: #e7ecef;
    color: var(--train-faint);
    cursor: not-allowed;
    transition: background 0.15s, border-color 0.15s;
}

.mock-start-btn:not(:disabled) {
    background: var(--train-primary);
    border-color: var(--train-primary);
    color: white;
    cursor: pointer;
    box-shadow: none;
}

.mock-start-btn:not(:disabled):hover {
    background: var(--train-primary-hover);
    border-color: var(--train-primary-hover);
}

/* 选卷视图暗黑模式 */
body.dark-mode .mock-select-title {
    color: #9fc5d2;
}

body.dark-mode .mock-step {
    background: #1a2a4e;
    color: #6a7a9a;
}

body.dark-mode .mock-step.active {
    background: #2b6f87;
    color: white;
}

body.dark-mode .mock-step.done {
    background: #1a4a2e;
    color: #6fcf97;
}

body.dark-mode .mock-step-arrow {
    color: #3a4a6a;
}

body.dark-mode .year-card {
    background: #1a2a4e;
    border-color: #2a3a5e;
}

body.dark-mode .year-card:hover {
    border-color: #7ab8f5;
}

body.dark-mode .year-card.selected {
    background: #1d2c4c;
    border-color: #7ab8f5;
}

body.dark-mode .year-card .year-num {
    color: #e0e0e0;
}

body.dark-mode .year-card.selected .year-num {
    color: #9fc5d2;
}

body.dark-mode .year-card .year-progress {
    color: #6a8ab0;
}

body.dark-mode .paper-card {
    background: #1a2a4e;
    border-color: #2a3a5e;
}

body.dark-mode .paper-card:hover {
    border-color: #7ab8f5;
}

body.dark-mode .paper-card.selected {
    background: #1d2c4c;
    border-color: #7ab8f5;
}

body.dark-mode .paper-card .paper-name {
    color: #e0e0e0;
}

body.dark-mode .paper-card.selected .paper-name {
    color: #9fc5d2;
}

body.dark-mode .paper-card .paper-count {
    color: #6a8ab0;
}

body.dark-mode .paper-card .paper-progress-bar {
    background: #2a3a5e;
}

body.dark-mode .paper-card .paper-accuracy {
    color: #6a8ab0;
}

body.dark-mode .mock-bottom {
    border-top-color: #2a3a5e;
}

body.dark-mode .mock-selection-hint {
    color: #6a8ab0;
}

body.dark-mode .mock-start-btn:disabled {
    background: #2a3a5e;
    color: #4a5a7a;
}

body.dark-mode .mock-start-btn:not(:disabled) {
    background: #e67e22;
    color: white;
}

/* 选卷视图响应式 */
@media (max-width: 600px) {
    .mock-select-container {
        margin: 16px auto;
    }

    .year-card {
        width: 76px;
        padding: 12px 6px 10px;
    }

    .year-card .year-num {
        font-size: 17px;
    }

    .paper-cards {
        grid-template-columns: 1fr;
    }

    .mock-start-btn {
        width: 100%;
        padding: 14px 24px;
    }

    #generatorSelectView .generator-panel {
        padding: 16px;
    }

    #generatorSelectView .generator-grid {
        grid-template-columns: 1fr;
    }

    .generator-filter-grid {
        grid-template-columns: 1fr;
    }

    #generatorSelectView .export-options {
        align-items: flex-start;
        flex-direction: column;
    }

    #downloadWorksheetBtn {
        margin-left: 0;
        width: 100%;
    }
}

/* ===== 模拟考试结果页 ===== */
#mockResultView {
    max-width: 780px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.mock-result-container {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* 顶部标题 */
.mock-result-header {
    text-align: center;
}

.mock-result-header h2 {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 4px;
}

.mock-result-subtitle {
    color: #888;
    font-size: 15px;
    margin: 0;
}

body.dark-mode .mock-result-subtitle {
    color: #aaa;
}

/* 成绩环形图 */
.mock-score-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.mock-score-ring {
    position: relative;
    width: 160px;
    height: 160px;
}

.mock-ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.mock-ring-bg {
    fill: none;
    stroke: #e8e8e8;
    stroke-width: 12;
}

.mock-ring-fill {
    fill: none;
    stroke: #4caf50;
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 452.39;
    stroke-dashoffset: 452.39;
    transition: stroke-dashoffset 1s ease, stroke 0.3s;
}

.mock-ring-fill.medium {
    stroke: #ff9800;
}

.mock-ring-fill.low {
    stroke: #f44336;
}

body.dark-mode .mock-ring-bg {
    stroke: #3a3a4a;
}

.mock-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mock-ring-pct {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
}

.mock-ring-frac {
    font-size: 14px;
    color: #888;
    margin-top: 4px;
}

body.dark-mode .mock-ring-frac {
    color: #aaa;
}

.mock-score-msg {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

/* 统计卡片行 */
.mock-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.mock-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px;
    background: var(--train-surface-soft);
    border-radius: var(--train-radius);
    border: 1px solid var(--train-line);
}

body.dark-mode .mock-stat-card {
    background: #2a2a3a;
    border-color: #3a3a4a;
}

.mock-stat-icon {
    min-width: 28px;
    padding: 1px 6px;
    border: 1px solid var(--train-line-strong);
    border-radius: 999px;
    color: var(--train-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}

.mock-stat-num {
    font-size: 24px;
    font-weight: 700;
    color: var(--train-text);
}

.mock-stat-num.correct {
    color: #2f6f4e;
}

.mock-stat-num.wrong {
    color: var(--train-danger);
}

.mock-stat-num.unanswered {
    color: #888;
}

.mock-stat-label {
    font-size: 12px;
    color: #888;
}

body.dark-mode .mock-stat-label {
    color: #aaa;
}

/* 通用区块 */
.mock-section {
    background: var(--train-surface-soft);
    border-radius: var(--train-radius);
    padding: 18px;
    border: 1px solid var(--train-line);
}

body.dark-mode .mock-section {
    background: #2a2a3a;
    border-color: #3a3a4a;
}

.mock-section h3 {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 600;
    color: var(--train-text);
}

/* 提交成绩区域 */
.mock-submit-section {
    background: var(--train-surface-soft);
    border-color: var(--train-line);
}

body.dark-mode .mock-submit-section {
    background: linear-gradient(135deg, #1a237e 0%, #2a2a3a 100%);
    border-color: #3949ab;
}

.submit-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.student-name-input {
    padding: 10px 14px;
    border: 1px solid var(--train-line-strong);
    border-radius: var(--train-radius);
    font-size: 14px;
    width: 180px;
    transition: border-color 0.2s;
}

.student-name-input:focus {
    border-color: var(--train-primary);
    outline: none;
}

body.dark-mode .student-name-input {
    background: #1e1e2e;
    border-color: #555;
    color: #fff;
}

.btn-submit-score {
    background: var(--train-primary);
    color: white;
    padding: 10px 18px;
    border-radius: var(--train-radius);
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--train-primary);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit-score:hover {
    background: var(--train-primary-hover);
}

.btn-submit-score:disabled {
    background: #ccc;
    cursor: not-allowed;
}

body.dark-mode .btn-submit-score {
    background: #1565c0;
}

body.dark-mode .btn-submit-score:hover {
    background: #0d47a1;
}

.submit-status {
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    animation: fadeIn 0.3s;
}

.submit-status.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.submit-status.error {
    background: #ffebee;
    color: #c62828;
}

body.dark-mode .submit-status.success {
    background: #1b5e20;
    color: #a5d6a7;
}

body.dark-mode .submit-status.error {
    background: #b71c1c;
    color: #ffcdd2;
}

/* 题目网格 */
.mock-question-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 8px;
}

.mock-q-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 2px solid transparent;
}

.mock-q-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.mock-q-item.correct {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #a5d6a7;
}

.mock-q-item.wrong {
    background: #ffebee;
    color: #c62828;
    border-color: #ef9a9a;
}

.mock-q-item.unanswered {
    background: #f5f5f5;
    color: #999;
    border-color: #ddd;
}

body.dark-mode .mock-q-item.correct {
    background: #1b3a1b;
    color: #81c784;
    border-color: #2e7d32;
}

body.dark-mode .mock-q-item.wrong {
    background: #3a1a1a;
    color: #ef5350;
    border-color: #c62828;
}

body.dark-mode .mock-q-item.unanswered {
    background: #2a2a3a;
    color: #666;
    border-color: #444;
}

/* 讲义/技能诊断列表 */
.mock-dimension-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mock-dimension-group + .mock-dimension-group {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e8e8e8;
}

.mock-dimension-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
}

.mock-topic-empty {
    padding: 8px 0;
    font-size: 13px;
    color: #7f8c8d;
}

.mock-topic-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #e8e8e8;
}

.mock-topic-item:last-child {
    border-bottom: none;
}

body.dark-mode .mock-topic-item {
    border-bottom-color: #3a3a4a;
}

body.dark-mode .mock-dimension-group + .mock-dimension-group {
    border-top-color: #3a3a4a;
}

body.dark-mode .mock-dimension-title {
    color: #e0e0e0;
}

body.dark-mode .mock-topic-empty {
    color: #9098aa;
}

.mock-topic-name {
    width: 180px;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.mock-topic-bar-wrap {
    flex: 1;
    height: 10px;
    background: #e8e8e8;
    border-radius: 5px;
    overflow: hidden;
}

body.dark-mode .mock-topic-bar-wrap {
    background: #3a3a4a;
}

.mock-topic-bar {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
}

.mock-topic-bar.high {
    background: #4caf50;
}

.mock-topic-bar.medium {
    background: #ff9800;
}

.mock-topic-bar.low {
    background: #f44336;
}

.mock-topic-count {
    width: 86px;
    text-align: right;
    font-size: 13px;
    color: #888;
    flex-shrink: 0;
}

body.dark-mode .mock-topic-count {
    color: #aaa;
}

/* 操作按钮区 */
.mock-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 结果页响应式 */
@media (max-width: 600px) {
    .mock-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .mock-result-header h2 {
        font-size: 22px;
    }

    .mock-score-ring {
        width: 130px;
        height: 130px;
    }

    .mock-ring-pct {
        font-size: 28px;
    }

    .mock-q-item {
        width: 44px;
        height: 44px;
        font-size: 13px;
    }

    .mock-result-actions {
        flex-direction: column;
    }

    .mock-result-actions .btn {
        width: 100%;
    }
}

/* 响应式 - 移动端欢迎页卡片单列 */
@media (max-width: 600px) {
    .welcome-cards {
        grid-template-columns: 1fr;
    }

    .welcome-title {
        font-size: 24px;
    }

    #welcomeView {
        margin: 20px auto;
    }
}

.hidden {
    display: none !important;
}

.result {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

.result h3 {
    margin-bottom: 10px;
}

.question-image, .options-image {
    margin: 15px 0;
    text-align: center;
}

.question-image img, .options-image img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.has-image-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #e8f4fc;
    color: #3498db;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
}

/* 导航按钮区域 */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    margin-bottom: 10px;
}

.question-counter {
    font-size: 14px;
    color: #7f8c8d;
    padding: 8px 0;
}

.answer-card {
    margin-bottom: 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.sidebar .answer-card-header {
    margin-bottom: 8px;
}

.answer-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
    flex-wrap: wrap;
}

.answer-card-progress {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 13px;
    color: #555;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 8px;
}

.answer-card-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 0 10px 10px;
    color: #7f8c8d;
    font-size: 11px;
}

.answer-card-legend span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid #d0d7de;
    background: #fff3cd;
}

.legend-dot.correct {
    background: #d4edda;
    border-color: #27ae60;
}

.legend-dot.wrong {
    background: #f8d7da;
    border-color: #e74c3c;
}

.legend-star {
    color: #d4a800;
    font-style: normal;
    line-height: 1;
}

.answer-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 8px;
}

/* 按Paper分组 */
#answerCardContainer {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 年份层 */
.answer-card-year {
    display: flex;
    flex-direction: column;
}

.answer-card-year-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    padding: 5px 8px 3px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.answer-card-year-title:hover {
    background: #eaeaea;
}

.answer-card-year-title::before {
    content: '▼';
    font-size: 10px;
    transition: transform 0.2s;
}

.answer-card-year-title.collapsed::before {
    transform: rotate(-90deg);
}

.answer-card-year-title .year-label {
    font-weight: 700;
}

.answer-card-year-title .year-count {
    font-size: 11px;
    color: #888;
    font-weight: 400;
}

.answer-card-year-body {
    display: flex;
    flex-direction: column;
    padding-left: 10px;
    gap: 4px;
}

/* Paper子层 */
.answer-card-paper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.answer-card-paper-title {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    padding: 3px 6px 2px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.answer-card-paper-title:hover {
    background: #e8e8e8;
}

.answer-card-paper-title::before {
    content: '▼';
    font-size: 9px;
    color: #aaa;
    transition: transform 0.2s;
}

.answer-card-paper-title.collapsed::before {
    transform: rotate(-90deg);
}

.answer-card-paper-title .paper-badge {
    background: #e0e8f0;
    color: #3a6ea8;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.answer-card-paper-title .paper-count {
    font-size: 11px;
    color: #888;
}

.answer-card-paper-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding-left: 14px;
}

.sidebar .answer-card-item {
    padding: 6px 0;
    font-size: 12px;
}

.answer-card-item {
    padding: 8px 0;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    transition: all 0.2s;
}

.answer-card-item.current {
    border-color: #3498db;
    background: #e8f4fc;
    color: #3498db;
    font-weight: bold;
}

.answer-card-item.correct {
    border-color: #27ae60;
    background: #d4edda;
    color: #1e7e34;
}

.answer-card-item.wrong {
    border-color: #e74c3c;
    background: #f8d7da;
    color: #a71d2a;
}

.answer-card-item.answered {
    border-color: #3498db;
    background: #e8f4fc;
    color: #2980b9;
}

.answer-card-item.pending {
    border-color: #f39c12;
    background: #fff3cd;
    color: #a06a00;
}

.answer-card-item.favorite {
    position: relative;
}

.answer-card-item.favorite::after {
    content: '★';
    position: absolute;
    top: -7px;
    right: -5px;
    color: #d4a800;
    font-size: 11px;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(255,255,255,0.9);
}

.session-summary {
    margin: 14px 0;
    padding: 14px 16px;
    border: 1px solid #d8e1ea;
    border-radius: 8px;
    background: #f8fafc;
    text-align: left;
}

.session-summary strong {
    display: block;
    margin-bottom: 6px;
    color: #2c3e50;
}

.session-summary p {
    margin: 4px 0;
    color: #566573;
    font-size: 14px;
}

.btn-small {
    padding: 8px 12px;
    font-size: 13px;
}

.btn-danger {
    background: #f7eeee;
    border-color: #d5b5b5;
    color: var(--train-danger);
}

.btn-danger:hover {
    background: #efdede;
}

@media (max-width: 768px) {
    .insights-panel {
        grid-template-columns: 1fr;
    }
}

/* ===== Mock 沉浸式考试界面 ===== */
#mockHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--train-primary);
    color: white;
    border-radius: var(--train-radius);
    margin-bottom: 16px;
}

.mock-paper-label {
    font-size: 16px;
    font-weight: 700;
}

.mock-timer-large {
    font-size: 32px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
}

.mock-timer-large.warning {
    color: #ffe0b2;
    animation: mock-timer-pulse 1s infinite;
}

@keyframes mock-timer-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.btn-mock-submit {
    padding: 8px 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-mock-submit:hover {
    background: rgba(255,255,255,0.35);
    border-color: white;
}

/* Mock 模式激活时的全局样式 */
#practiceView.mock-active header {
    display: none;
}

#practiceView.mock-active .practice-console,
#practiceView.mock-active .control-bar {
    display: none;
}

#practiceView.generated-active header,
#practiceView.generated-active .practice-console,
#practiceView.generated-active .generator-panel,
#practiceView.generated-active .insights-panel {
    display: none;
}

#practiceView.generated-active #mockHeader {
    display: flex;
    background: var(--train-primary);
}

#practiceView.mock-active .insights-panel {
    display: none;
}

#practiceView.mock-active .question-meta {
    display: none;
}

#practiceView.mock-active .analysis {
    display: none;
}

#practiceView.mock-active .progress-bar {
    display: none;
}

#practiceView.mock-active #mockHeader {
    display: flex;
}

/* 单栏布局：题目在上，答题卡在下 */
#practiceView.mock-active .main-layout {
    flex-direction: column;
}

#practiceView.mock-active .main-content {
    max-width: 100%;
}

#practiceView.mock-active .sidebar {
    width: 100%;
    position: static;
}

/* 答题卡在 mock 模式下改为扁平样式 */
#practiceView.mock-active .answer-card.collapsible-panel {
    border: none;
    background: transparent;
}

#practiceView.mock-active .answer-card.collapsible-panel > .collapsible-summary {
    display: none;
}

#practiceView.mock-active .answer-card-header {
    display: none;
}

#practiceView.mock-active #answerCardContainer {
    display: flex;
    justify-content: center;
}

#practiceView.mock-active .answer-card-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

#practiceView.mock-active .answer-card-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 13px;
}

/* Mock 底部导航区 */
.mock-bottom-nav {
    display: none;
}

#practiceView.mock-active .mock-bottom-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-top: 8px;
    border-top: 1px solid #eee;
}

.mock-bottom-nav .btn-nav {
    min-width: 120px;
}

.mock-bottom-nav .mock-question-counter {
    font-size: 15px;
    font-weight: 600;
    color: #555;
}

/* Mock 暗黑模式 */
body.dark-mode #mockHeader {
    background: #1d2c4c;
    border-color: #2a3a5e;
}

body.dark-mode .mock-timer-large.warning {
    color: #ffd699;
}

body.dark-mode .btn-mock-submit {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
}

body.dark-mode .btn-mock-submit:hover {
    background: rgba(255,255,255,0.3);
}

#practiceView.mock-active .mock-bottom-nav {
    border-top-color: #2a3a5e;
}

#practiceView.mock-active .mock-bottom-nav .mock-question-counter {
    color: #a0a0b0;
}

/* Mock 响应式 */
@media (max-width: 600px) {
    #mockHeader {
        padding: 10px 12px;
        border-radius: 6px;
    }

    .mock-paper-label {
        font-size: 13px;
    }

    .mock-timer-large {
        font-size: 24px;
    }

    .btn-mock-submit {
        padding: 6px 14px;
        font-size: 13px;
    }
}

/* ===== 暗黑模式 ===== */
body.dark-mode {
    background: #1a1a2e;
    color: #e0e0e0;
}

body.dark-mode .container {
    background: #16213e;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark-mode h1 {
    color: #e0e0e0;
}

body.dark-mode header {
    border-bottom-color: #2a3a5e;
}

body.dark-mode .stats {
    color: #a0a0b0;
}

body.dark-mode .mode-status {
    color: #a0a0b0;
}

body.dark-mode .mock-timer {
    background: #2a2a4a;
    color: #e67e22;
}

body.dark-mode .question-meta,
body.dark-mode .question-counter {
    color: #a0a0b0;
}

body.dark-mode .question-text {
    color: #e0e0e0;
}

body.dark-mode .question-text table {
    border-color: #2a3a5e;
}

body.dark-mode .question-text thead th {
    background: #1e5080;
    border-color: #1a4060;
}

body.dark-mode .question-text tbody td {
    border-color: #2a3a5e;
    background: #1a2a4e;
    color: #e0e0e0;
}

body.dark-mode .question-text tbody tr:nth-child(even) td {
    background: #162040;
}

body.dark-mode .question-text tbody tr:hover td {
    background: #1e3058;
}

body.dark-mode .question-text tbody tr td:first-child {
    background: #1a3050;
    color: #e0e0e0;
}

body.dark-mode .question-text tbody tr:nth-child(even) td:first-child {
    background: #162040;
}

body.dark-mode .answer-card {
    background: #1a2a4e;
    border-color: #2a3a5e;
}

body.dark-mode .sidebar {
    background: transparent;
}

body.dark-mode .answer-card-progress {
    color: #a0a0b0;
    border-bottom-color: #2a3a5e;
}

body.dark-mode .answer-card-header strong {
    color: #e0e0e0;
}

body.dark-mode .answer-card-item {
    background: #1e3058;
    border-color: #2a3a5e;
    color: #e0e0e0;
}

body.dark-mode .answer-card-item.current {
    background: #1e5080;
    border-color: #3498db;
    color: #7ab8f5;
}

body.dark-mode .answer-card-item.correct {
    background: #1a4a2e;
    border-color: #27ae60;
    color: #6fcf97;
}

body.dark-mode .answer-card-item.wrong {
    background: #4a1e1e;
    border-color: #e74c3c;
    color: #ff6b6b;
}

body.dark-mode .answer-card-item.answered {
    background: #1e3058;
    border-color: #3498db;
    color: #7ab8f5;
}

body.dark-mode .answer-card-item.pending {
    background: #3a3020;
    border-color: #f39c12;
    color: #f5c842;
}

body.dark-mode .option {
    border-color: #2a3a5e;
    color: #e0e0e0;
    background: #1a2a4e;
}

body.dark-mode .option:hover {
    border-color: #3498db;
    background: #1e3058;
}

body.dark-mode .option.selected {
    border-color: #3498db;
    background: #1e4070;
    box-shadow: inset 4px 0 0 #3498db;
    font-weight: 600;
}

body.dark-mode .option.correct {
    border-color: #27ae60;
    background: #1a4a2e;
    color: #6fcf97;
}

body.dark-mode .option.wrong {
    border-color: #e74c3c;
    background: #4a1e1e;
    color: #ff6b6b;
}

body.dark-mode .option-label {
    border-color: #3a4a6e;
    background: #2a3a5e;
    color: #8a9aba;
}

body.dark-mode .option:hover .option-label {
    border-color: #3498db;
    color: #7ab8f5;
}

body.dark-mode .option.selected .option-label {
    border-color: #3498db;
    background: #3498db;
    color: white;
}

body.dark-mode .option.correct .option-label {
    border-color: #27ae60;
    background: #27ae60;
    color: white;
}

body.dark-mode .option.wrong .option-label {
    border-color: #e74c3c;
    background: #e74c3c;
    color: white;
}

body.dark-mode .analysis {
    background: transparent;
}

body.dark-mode .analysis.collapsible-panel[open] > .collapsible-summary + * {
    background: #1a2a4e;
}

body.dark-mode .insights-panel {
    border-bottom-color: #2a3a5e;
}

body.dark-mode .insights-panel > .collapsible-summary {
    background: transparent;
    border-bottom-color: #2a3a5e;
    color: #c0c8d8;
}

body.dark-mode .insights-panel > .collapsible-summary .collapse-arrow {
    color: #7a8ab0;
}

body.dark-mode .insight-box {
    background: #1a2a4e;
}

body.dark-mode .insight-box h3 {
    color: #e0e0e0;
}

body.dark-mode .collapsible-panel {
    border-color: #2a3a5e;
}

body.dark-mode .collapsible-summary {
    background: #1e3058;
    color: #c0c8d8;
}

body.dark-mode .collapsible-summary .collapse-arrow {
    color: #7a8ab0;
}

body.dark-mode .answer-card.collapsible-panel > .collapsible-summary {
    background: #1a2a4e;
    border-color: #2a3a5e;
}

body.dark-mode .answer-card-year-title {
    color: #c8d8ec;
}

body.dark-mode .answer-card-year-title:hover {
    background: #243555;
}

body.dark-mode .answer-card-year-title .year-count {
    color: #6a8ab0;
}

body.dark-mode .answer-card-paper-title {
    color: #aabbd4;
}

body.dark-mode .answer-card-paper-title:hover {
    background: #1e3058;
}

body.dark-mode .answer-card-paper-title .paper-badge {
    background: #1e3058;
    color: #7ab8f5;
}

body.dark-mode .answer-card-paper-title::before {
    color: #4a6a8a;
}

body.dark-mode .analysis.collapsible-panel > .collapsible-summary {
    background: #1a2a4e;
    border-color: #2a3a5e;
}

body.dark-mode .insight-item {
    background: #162040;
}

body.dark-mode .insight-item span:first-child {
    color: #e0e0e0;
}

body.dark-mode .insight-item span:last-child {
    color: #a0a0b0;
}

body.dark-mode .insight-empty {
    color: #707080;
}

body.dark-mode .progress-bar {
    background: #2a3a5e;
}

body.dark-mode .filters {
    border-bottom-color: #2a3a5e;
}

body.dark-mode .filter-btn {
    border-color: #2a3a5e;
    background: #1a2a4e;
    color: #e0e0e0;
}

body.dark-mode .filter-btn:hover,
body.dark-mode .filter-btn.active {
    background: #1e5080;
    border-color: #3498db;
    color: #7ab8f5;
}

body.dark-mode .year-paper-select {
    border-bottom-color: #2a3a5e;
}

body.dark-mode .year-paper-select label {
    color: #a0a0b0;
}

body.dark-mode .year-paper-select select {
    border-color: #2a3a5e;
    background: #1a2a4e;
    color: #e0e0e0;
}

body.dark-mode .topic-select,
body.dark-mode .tag-select,
body.dark-mode .jump-select,
body.dark-mode .generator-grid input,
body.dark-mode .generator-grid select,
body.dark-mode .generator-filter-grid select {
    border-color: #2a3a5e;
    background: #1a2a4e;
    color: #e0e0e0;
}

body.dark-mode .generator-panel {
    border-bottom-color: #2a3a5e;
}

body.dark-mode #generatorSelectView .generator-panel {
    background: #14223f;
    border-color: #2a3a5e;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

body.dark-mode #generatorSelectView .generator-header,
body.dark-mode #generatorSelectView .export-options {
    border-color: #2a3a5e;
}

body.dark-mode .generator-grid label,
body.dark-mode .generator-filter-grid label,
body.dark-mode .question-count-label {
    color: #a0a0b0;
}

body.dark-mode .generator-header h2,
body.dark-mode .session-summary strong {
    color: #e8edf7;
}

body.dark-mode .generator-header p,
body.dark-mode .export-options,
body.dark-mode .session-summary p {
    color: #a0a0b0;
}

body.dark-mode .session-summary {
    border-color: #2a3a5e;
    background: #111d35;
}

body.dark-mode .question-taxonomy,
body.dark-mode .question-taxonomy summary,
body.dark-mode .answer-card-legend,
body.dark-mode .console-state {
    color: #a0a0b0;
}

body.dark-mode .question-taxonomy summary::after {
    border-color: #2a3a5e;
    color: #c6d2ea;
}

body.dark-mode .btn-favorite {
    background: #3a3020;
    border-color: #8a6d00;
    color: #f6d76a;
}

body.dark-mode .btn-favorite.active {
    background: #f1c40f;
    color: #2c2500;
}

body.dark-mode .tag-chip {
    background: #1a2a4e;
    border-color: #2a3a5e;
    color: #d4e0f0;
}

body.dark-mode .tag-chip:hover {
    border-color: #7ab8f5;
    color: #7ab8f5;
}

body.dark-mode .btn-nav {
    background: #1a2a4e;
    border-color: #2a3a5e;
    color: #e0e0e0;
}

body.dark-mode .btn-nav:hover {
    background: #2a3a5e;
}

body.dark-mode .btn-secondary {
    background: #2a3a5e;
    color: #e0e0e0;
}

body.dark-mode .btn-secondary:hover {
    background: #3a4a7e;
}

body.dark-mode .result {
    background: #1a2a4e;
}

body.dark-mode .result h3 {
    color: #e0e0e0;
}

body.dark-mode .has-image-badge {
    background: #1e3058;
    color: #7ab8f5;
}

body.dark-mode .btn-danger {
    background: #8b1e1e;
}

body.dark-mode .btn-danger:hover {
    background: #a52020;
}

/* ===== 欢迎页暗黑模式 ===== */
body.dark-mode .welcome-title {
    color: #e0e0e0;
}

body.dark-mode .welcome-subtitle {
    color: #a0a0b0;
}

body.dark-mode .card-practice,
body.dark-mode .card-mock,
body.dark-mode .card-wrong,
body.dark-mode .card-favorite,
body.dark-mode .card-shuffle,
body.dark-mode .card-builder {
    background: #17233d;
    border-color: #2a3a5e;
}

body.dark-mode .card-practice:hover,
body.dark-mode .card-mock:hover,
body.dark-mode .card-wrong:hover,
body.dark-mode .card-favorite:hover,
body.dark-mode .card-shuffle:hover,
body.dark-mode .card-builder:hover {
    background: #1d2c4c;
    border-color: #7ab8f5;
}

body.dark-mode .welcome-card .card-icon {
    border-color: #3b4b6e;
    color: #9fc5d2;
}

body.dark-mode .welcome-card h2 {
    color: #e0e0e0;
}

body.dark-mode .welcome-card p {
    color: #a0a0b0;
}

body.dark-mode .welcome-progress-info {
    color: #a0a0b0;
}

body.dark-mode .welcome-footer {
    border-top-color: #2a3a5e;
}

body.dark-mode #welcomeContinueLink {
    color: #7ab8f5;
}

body.dark-mode #welcomeContinueLink:hover {
    color: #5aa0e0;
}

body.dark-mode .back-link {
    color: #7ab8f5;
}

body.dark-mode .back-link:hover {
    background: #1e3058;
}

body.dark-mode header h1 {
    color: #e0e0e0;
}


/* ===== 教师反馈 QuickForm ===== */
.btn-feedback {
    border: 1px solid #2d7c5f;
    background: #eaf6f1;
    color: #1f6048;
}

.btn-feedback:hover {
    background: #d8eee5;
    color: #174936;
}

.feedback-modal.hidden {
    display: none;
}

.feedback-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
}

.feedback-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 28, 34, 0.52);
}

.feedback-dialog {
    position: relative;
    width: min(680px, 100%);
    max-height: min(860px, calc(100vh - 40px));
    overflow: auto;
    background: var(--train-surface);
    border: 1px solid var(--train-line-strong);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(31, 41, 51, 0.25);
    padding: 22px;
}

.feedback-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.feedback-header h2 {
    margin: 0 0 4px;
    font-size: 20px;
}

.feedback-header p {
    margin: 0;
    color: var(--train-muted);
    font-size: 13px;
}

.feedback-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--train-line);
    border-radius: 6px;
    background: var(--train-surface-soft);
    color: var(--train-text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.feedback-dialog label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 14px;
    color: var(--train-text);
    font-weight: 600;
}

.feedback-dialog input,
.feedback-dialog select,
.feedback-dialog textarea {
    width: 100%;
    border: 1px solid var(--train-line-strong);
    border-radius: 6px;
    padding: 10px 12px;
    background: var(--train-surface);
    color: var(--train-text);
    font: inherit;
    font-weight: 400;
}

.feedback-dialog textarea {
    resize: vertical;
    min-height: 118px;
}

.feedback-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.feedback-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.feedback-status {
    color: var(--train-muted);
    font-size: 13px;
}

.feedback-status.success {
    color: #1d6f50;
}

.feedback-status.error {
    color: var(--train-danger);
}

body.dark-mode .btn-feedback {
    background: #18392e;
    border-color: #2d7c5f;
    color: #bce7d5;
}

body.dark-mode .feedback-dialog,
body.dark-mode .feedback-dialog input,
body.dark-mode .feedback-dialog select,
body.dark-mode .feedback-dialog textarea {
    background: #172033;
    color: #eef3f8;
    border-color: #31415f;
}

body.dark-mode .feedback-header p,
body.dark-mode .feedback-status {
    color: #aab7c7;
}

body.dark-mode .feedback-close {
    background: #22304a;
    color: #eef3f8;
    border-color: #31415f;
}

@media (max-width: 720px) {
    .feedback-grid {
        grid-template-columns: 1fr;
    }
}
