/* ==========================================================================
   CentOS 7 在线刷题与智能改卷系统 — 现代极客/运维风格样式表
   100% 本地系统字体栈，零 Google Fonts、零海外 CDN 依赖，支持浅色/深色无缝切换
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "JetBrains Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* 浅色主题（默认） */
  --bg-page: #f3f6fa;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-muted: #eef2f6;
  --bg-code: #f1f5f9;
  --bg-header: rgba(255, 255, 255, 0.9);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-code: #0f766e;

  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;

  --brand: #0d9488;
  --brand-hover: #0f766e;
  --brand-soft: #ccfbf1;
  --brand-soft-bg: #f0fdfa;
  --brand-text: #115e59;

  --accent-blue: #2563eb;
  --accent-blue-bg: #eff6ff;

  --ok: #10b981;
  --ok-bg: #ecfdf5;
  --ok-border: #a7f3d0;
  --ok-text: #065f46;

  --warn: #f59e0b;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --warn-text: #92400e;

  --err: #ef4444;
  --err-bg: #fef2f2;
  --err-border: #fecaca;
  --err-text: #991b1b;

  --ai: #7c3aed;
  --ai-bg: #f5f3ff;
  --ai-border: #ddd6fe;
  --ai-text: #5b21b6;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

[data-theme="dark"] {
  --bg-page: #0b1120;
  --bg-surface: #111827;
  --bg-subtle: #172033;
  --bg-muted: #1e293b;
  --bg-code: #090e1a;
  --bg-header: rgba(17, 24, 39, 0.9);

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-code: #34d399;

  --border-color: #1f2937;
  --border-strong: #334155;

  --brand: #14b8a6;
  --brand-hover: #2dd4bf;
  --brand-soft: rgba(20, 184, 166, 0.22);
  --brand-soft-bg: rgba(20, 184, 166, 0.1);
  --brand-text: #5eead4;

  --accent-blue: #3b82f6;
  --accent-blue-bg: rgba(59, 130, 246, 0.14);

  --ok: #10b981;
  --ok-bg: rgba(16, 185, 129, 0.13);
  --ok-border: rgba(16, 185, 129, 0.35);
  --ok-text: #6ee7b7;

  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.14);
  --warn-border: rgba(245, 158, 11, 0.35);
  --warn-text: #fcd34d;

  --err: #ef4444;
  --err-bg: rgba(239, 68, 68, 0.14);
  --err-border: rgba(239, 68, 68, 0.35);
  --err-text: #fca5a5;

  --ai: #8b5cf6;
  --ai-bg: rgba(139, 92, 246, 0.14);
  --ai-border: rgba(139, 92, 246, 0.35);
  --ai-text: #c4b5fd;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.55);
}

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

html, body {
  min-height: 100%;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* 顶部导航栏 */
.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.terminal-prompt {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: #34d399;
  border: 1px solid #334155;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

[data-theme="dark"] .terminal-prompt {
  background: #020617;
  border-color: #1e293b;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-muted);
  padding: 4px;
  border-radius: var(--radius-md);
}

.nav-tab {
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-primary);
}

.nav-tab.active {
  background: var(--bg-surface);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.badge-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-text);
}

.badge-pill.danger {
  background: var(--err-bg);
  color: var(--err-text);
  border: 1px solid var(--err-border);
}

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

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft-bg);
}

/* 主体容器 */
.main-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 20px 64px;
}

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--brand-hover);
}

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

.btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-ai {
  background: var(--ai);
  color: #ffffff;
}

.btn-ai:hover {
  opacity: 0.92;
}

.btn-danger {
  background: var(--err-bg);
  color: var(--err-text);
  border: 1px solid var(--err-border);
}

.btn-danger:hover {
  background: var(--err);
  color: #ffffff;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12.5px;
}

/* 顶部统计横幅 */
.hero-banner {
  background: linear-gradient(135deg, #0f172a 0%, #134e4a 100%);
  color: #f8fafc;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}

.hero-left h1 {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-left p {
  color: #cbd5e1;
  font-size: 13.5px;
  max-width: 680px;
}

.hero-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-stat-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  min-width: 112px;
}

.hero-stat-box .num {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: #5eead4;
}

.hero-stat-box .lbl {
  font-size: 12px;
  color: #cbd5e1;
}

/* 试卷卡片网格 */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
}

.exam-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.exam-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand);
}

.exam-stage-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-text);
  background: var(--brand-soft-bg);
  border: 1px solid var(--brand-soft);
  padding: 3px 9px;
  border-radius: 999px;
}

.exam-card h2 {
  font-size: 18px;
  font-weight: 700;
  margin-top: 8px;
  line-height: 1.35;
}

.exam-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.exam-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.metric-cell .v {
  font-family: var(--font-mono);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-cell .k {
  font-size: 11.5px;
  color: var(--text-muted);
}

.volume-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vol-chip {
  font-size: 12px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  color: var(--text-secondary);
}

.progress-strip {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-bar-track {
  height: 7px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.exam-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* Linux 命令与路径代码胶囊高亮 */
code.linux-code {
  font-family: var(--font-mono);
  font-size: 0.91em;
  background: var(--bg-code);
  color: var(--text-code);
  border: 1px solid var(--border-color);
  padding: 1px 6px;
  border-radius: 5px;
  word-break: break-all;
}

mark.kw-hit {
  background: var(--ok-bg);
  color: var(--ok-text);
  border-bottom: 2px solid var(--ok);
  padding: 0 3px;
  border-radius: 3px;
  font-weight: 600;
}

/* 做题工作台布局 */
.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 20px;
  align-items: start;
}

.workspace-layout.sheet-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-toolbar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.timer-badge {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft-bg);
  color: var(--brand-text);
  border: 1px solid var(--brand-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.timer-badge.urgent {
  background: var(--err-bg);
  color: var(--err-text);
  border-color: var(--err-border);
}

/* 题目卡片 */
.question-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

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

.q-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.q-num-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: #5eead4;
}

.q-type-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
}

.q-score-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.q-book-tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.star-btn {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.star-btn.starred {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-color: var(--warn-border);
}

.q-stem {
  font-size: 16px;
  line-height: 1.72;
  color: var(--text-primary);
  margin-bottom: 18px;
  white-space: pre-line;
}

.stem-note-box {
  font-size: 13px;
  padding: 9px 12px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  color: var(--warn-text);
  border: 1px solid var(--warn-border);
}

/* 单选与判断题选项 */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 15px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: var(--bg-subtle);
  text-align: left;
  transition: all 0.14s ease;
  width: 100%;
}

.option-item:hover {
  border-color: var(--brand);
  background: var(--brand-soft-bg);
}

.option-item.selected {
  border-color: var(--brand);
  background: var(--brand-soft-bg);
}

.option-item.correct-opt {
  border-color: var(--ok);
  background: var(--ok-bg);
}

.option-item.wrong-opt {
  border-color: var(--err);
  background: var(--err-bg);
}

.opt-key {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  background: var(--bg-surface);
}

.option-item.selected .opt-key {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.option-item.correct-opt .opt-key {
  background: var(--ok);
  border-color: var(--ok);
  color: #ffffff;
}

.option-item.wrong-opt .opt-key {
  background: var(--err);
  border-color: var(--err);
  color: #ffffff;
}

.judge-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 12px;
}

/* 填空题多空输入组 */
.blanks-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.blank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.blank-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 78px;
}

.blank-input {
  flex: 1;
  min-width: 200px;
  max-width: 480px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-subtle);
  font-family: var(--font-mono);
  font-size: 14px;
  transition: border-color 0.15s ease;
}

.blank-input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--bg-surface);
}

/* 主观题输入域 */
.subjective-textarea {
  width: 100%;
  min-height: 132px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-subtle);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.65;
  resize: vertical;
}

.subjective-textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--bg-surface);
}

/* 右侧答题卡抽屉 */
.answer-sheet-card {
  position: sticky;
  top: 70px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

.sheet-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 10px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: -1px;
}

.sheet-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 10px 0 6px;
}

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.sheet-cell {
  position: relative;
  height: 30px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.sheet-cell:hover {
  border-color: var(--brand);
}

.sheet-cell.current {
  outline: 2px solid var(--accent-blue);
  outline-offset: 1px;
}

.sheet-cell.answered {
  background: var(--brand-soft);
  color: var(--brand-text);
  border-color: var(--brand);
}

.sheet-cell.res-full {
  background: var(--ok-bg);
  color: var(--ok-text);
  border-color: var(--ok-border);
}

.sheet-cell.res-partial {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-color: var(--warn-border);
}

.sheet-cell.res-zero {
  background: var(--err-bg);
  color: var(--err-text);
  border-color: var(--err-border);
}

.sheet-cell.res-pending {
  background: var(--ai-bg);
  color: var(--ai-text);
  border-color: var(--ai-border);
}

.sheet-star-dot {
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 8px;
  color: #eab308;
  line-height: 1;
}

/* 解析与双层改卷对比面板 */
.analysis-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--brand);
}

.compare-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.compare-pane {
  padding: 13px 15px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
}

.compare-pane h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rubric-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
}

.rubric-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  font-size: 13.5px;
  cursor: pointer;
}

.rubric-item.hit {
  background: var(--ok-bg);
  border-color: var(--ok-border);
}

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

.score-pill {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
}

.score-pill.active-full {
  background: var(--ok);
  border-color: var(--ok);
  color: #ffffff;
}

.score-pill.active-partial {
  background: var(--warn);
  border-color: var(--warn);
  color: #ffffff;
}

.score-pill.active-zero {
  background: var(--err);
  border-color: var(--err);
  color: #ffffff;
}

/* AI 批改卡片 */
.ai-feedback-card {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--ai-bg);
  border: 1px solid var(--ai-border);
  color: var(--text-primary);
  font-size: 13.5px;
}

/* 成绩单报告顶部面板与图表 */
.report-summary-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.charts-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.surface-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* 考前速查 16 条高频易错卡片 */
.pitfalls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.pitfall-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  border-top: 3px solid var(--brand);
}

.pitfall-card.mastered {
  opacity: 0.76;
  border-top-color: var(--ok);
}

/* 筛选栏与表单输入 */
.filter-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.input-control, .select-control {
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  font-size: 13.5px;
}

.input-control:focus, .select-control:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--bg-surface);
}

/* 模态框与 Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.modal-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px 24px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.toast-stack {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-msg {
  background: #0f172a;
  color: #f8fafc;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid #14b8a6;
  pointer-events: auto;
}

/* 响应式适配（平板与手机端） */
@media (max-width: 960px) {
  .workspace-layout {
    grid-template-columns: 1fr;
  }
  .answer-sheet-card {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 80;
    max-height: 68vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg);
  }
  .workspace-layout.sheet-collapsed .answer-sheet-card {
    display: none;
  }
  .report-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .exam-grid {
    grid-template-columns: 1fr;
  }
  .exam-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .exam-actions-grid {
    grid-template-columns: 1fr;
  }
  .judge-row {
    grid-template-columns: 1fr 1fr;
  }
  .header-inner {
    padding: 10px 12px;
  }
  .main-container {
    padding: 14px 12px 60px;
  }
  .question-card {
    padding: 16px;
  }
}
