/* ============ 基础变量 ============ */
:root {
  --primary: #0e7c8a;          /* 主色：医学青 */
  --primary-dark: #0a5e6a;
  --primary-light: #e6f5f7;
  --accent: #ff8a5b;           /* 强调色：橙 */
  --success: #2bb673;
  --danger: #e95757;
  --warning: #f5a623;

  --text-1: #1a2533;
  --text-2: #4a5568;
  --text-3: #8492a6;
  --bg: #ffffff;
  --bg-alt: #f7fafc;
  --bg-soft: #eef3f6;
  --border: #e2e8f0;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06);
  --shadow: 0 4px 12px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .10);

  --container: 1240px;
}

/* ============ Reset ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color: var(--text-1);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

/* ============ 矢量图标 ============ */
/* <i data-icon="xxx"> 包裹 SVG，自动随上下文字号缩放 */
[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -0.18em;
  line-height: 1;
}
[data-icon] svg {
  display: block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

/* 按钮里的图标稍微大一点 */
.btn [data-icon] { font-size: 1.15em; }
.btn-lg [data-icon] { font-size: 1.1em; }

/* 答案解析标题的图标颜色 */
.q-analysis h5 [data-icon] { color: var(--primary); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all .2s ease;
  white-space: nowrap;
}
.btn-lg { padding: 12px 28px; font-size: 16px; border-radius: 8px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline { border: 1px solid var(--primary); color: var(--primary); background: #fff; }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--primary); }

/* ============ 导航 ============ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 68px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  font-size: 28px;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text strong { font-size: 17px; color: var(--text-1); }
.logo-text small { font-size: 11px; color: var(--text-3); letter-spacing: 1px; }

.nav-menu { display: flex; gap: 4px; margin-left: 8px; }
.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-2);
  transition: all .2s;
}
.nav-link:hover { color: var(--primary); background: var(--primary-light); }
.nav-link.active { color: var(--primary); background: var(--primary-light); font-weight: 500; }

.nav-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 4px 4px 4px 14px;
  width: 220px;
}
.search-box input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 13px; color: var(--text-1);
}
.search-box button {
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-2);
}
.search-box button:hover { color: var(--primary); }

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: 72px 0 96px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5fbfc 0%, #e9f4f5 100%);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 80% 20%, rgba(14, 124, 138, .12), transparent 50%),
    radial-gradient(circle at 10% 80%, rgba(255, 138, 91, .10), transparent 50%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 60px;
  align-items: center;
}
.badge {
  display: inline-block;
  padding: 5px 14px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: 44px;
  line-height: 1.2;
  letter-spacing: -.5px;
  margin-bottom: 18px;
}
.hero-sub { font-size: 17px; color: var(--text-2); margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; }

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(14, 124, 138, .08);
}
.stat-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.stat-label {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-3);
}

/* ============ Section 通用 ============ */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-head {
  text-align: center;
  margin-bottom: 48px;
}
.section-head h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.5px;
}
.section-head p {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 15px;
}

/* ============ 练习模式卡片 ============ */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.mode-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 28px;
  border: 1px solid var(--border);
  transition: all .25s ease;
  cursor: pointer;
}
.mode-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.mode-icon {
  font-size: 40px;
  color: var(--primary);
  margin-bottom: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mode-card h3 { font-size: 18px; margin-bottom: 10px; }
.mode-card p { color: var(--text-2); font-size: 14px; margin-bottom: 16px; }
.mode-link {
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
}
.mode-link::after { content: ' →'; transition: margin .2s; }
.mode-card:hover .mode-link::after { margin-left: 4px; }

/* ============ 章节卡片 ============ */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.chapter-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  border: 1px solid var(--border);
  transition: all .25s ease;
  cursor: pointer;
}
.chapter-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}
.chapter-cover {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 18px;
}
.chapter-card h3 { font-size: 18px; margin-bottom: 6px; }
.chapter-card > p { color: var(--text-3); font-size: 13px; margin-bottom: 16px; }
.chapter-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.chapter-meta .dot { color: var(--text-3); }
.progress {
  height: 6px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #4fb8c5);
  border-radius: 999px;
}

/* ============ 答题区 ============ */
.practice-layout {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 24px;
  align-items: start;
}
.filter-panel,
.card-side {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 88px;
}
.filter-block { margin-bottom: 22px; }
.filter-block:last-child { margin-bottom: 0; }
.filter-block h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 12px;
}
.check, .radio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.check input, .radio input { accent-color: var(--primary); }
.check span { margin-left: auto; color: var(--text-3); font-size: 12px; }

.question-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  min-height: 540px;
}
.q-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 24px;
}
.q-tag {
  display: inline-flex;
  gap: 8px;
}
.q-tag span {
  padding: 3px 10px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  border-radius: 4px;
}
.q-tag span.diff-hard { background: #fde8e8; color: var(--danger); }
.q-tag span.diff-easy { background: #e6f7ee; color: var(--success); }
.q-progress-text { font-size: 13px; color: var(--text-3); }

.q-title {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 24px;
  color: var(--text-1);
}
.q-image {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 32px;
  text-align: center;
  color: var(--text-3);
  margin-bottom: 24px;
  font-size: 14px;
  border: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.q-image-icon {
  font-size: 36px;
  color: var(--text-3);
  display: inline-flex;
}
.q-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.option {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s ease;
  font-size: 15px;
}
.option:hover { border-color: var(--primary); background: var(--primary-light); }
.option.selected { border-color: var(--primary); background: var(--primary-light); font-weight: 500; }
.option.correct { border-color: var(--success); background: #e6f7ee; }
.option.wrong { border-color: var(--danger); background: #fde8e8; }
.option .letter {
  width: 26px; height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--text-2);
}
.option.selected .letter { background: var(--primary); color: #fff; }
.option.correct .letter { background: var(--success); color: #fff; }
.option.wrong .letter { background: var(--danger); color: #fff; }

.q-actions { display: flex; gap: 12px; align-items: center; }
.q-actions .spacer { flex: 1; }

.q-analysis {
  margin-top: 28px;
  padding: 20px 22px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
}
.q-analysis h5 {
  color: var(--primary);
  font-size: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.q-analysis p { color: var(--text-2); font-size: 14px; line-height: 1.7; }
.q-analysis .correct-ans { font-weight: 600; color: var(--success); }

/* 答题卡 */
.card-side h4 {
  font-size: 15px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-side h4 [data-icon] { color: var(--primary); font-size: 1.2em; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.card-cell {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-2);
  background: #fff;
  cursor: pointer;
  transition: all .15s;
}
.card-cell.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.card-cell.done { background: #e6f7ee; color: var(--success); border-color: var(--success); }
.card-cell.wrong-mark { background: #fde8e8; color: var(--danger); border-color: var(--danger); }
.card-legend { font-size: 12px; color: var(--text-3); display: flex; flex-direction: column; gap: 6px; }
.card-legend > div { display: flex; align-items: center; gap: 8px; }
.card-legend .swatch { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--border); }

/* ============ 统计 ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 56px;
}
.big-stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
}
.big-num {
  font-size: 40px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -1px;
}
.big-label { margin-top: 10px; font-size: 14px; color: var(--text-2); }
.big-delta { margin-top: 8px; font-size: 12px; color: var(--text-3); }
.big-delta.up { color: var(--success); }

.mastery-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.mastery-block h3 { font-size: 18px; margin-bottom: 24px; }
.mastery-chart { display: flex; flex-direction: column; gap: 14px; }
.mastery-row { display: grid; grid-template-columns: 120px 1fr 60px; align-items: center; gap: 16px; }
.mastery-name { font-size: 14px; color: var(--text-2); }
.mastery-bar { height: 10px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.mastery-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #4fb8c5); border-radius: 999px; }
.mastery-pct { text-align: right; font-size: 14px; font-weight: 600; color: var(--primary); }

/* ============ 页脚 ============ */
.footer {
  background: #11212a;
  color: #b8c5cf;
  padding: 60px 0 0;
  margin-top: 80px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 60px;
  padding-bottom: 40px;
}
.footer-logo {
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.footer-logo [data-icon] { font-size: 1.2em; color: #4fb8c5; }
.footer > .footer-inner > div > p { font-size: 13px; max-width: 280px; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.footer-cols h5 { color: #fff; font-size: 14px; margin-bottom: 14px; }
.footer-cols a {
  display: block;
  font-size: 13px;
  padding: 4px 0;
  color: #b8c5cf;
  cursor: pointer;
}
.footer-cols a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #1f3441;
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6e7e8a;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .mode-grid, .chapter-grid { grid-template-columns: repeat(2, 1fr); }
  .practice-layout { grid-template-columns: 1fr; }
  .filter-panel, .card-side { position: static; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .nav-menu { display: none; }
  .search-box { display: none; }
  .hero h1 { font-size: 32px; }
  .mode-grid, .chapter-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 56px 0; }
}

/* ============================================================
   SPA 移植新增组件（2026-10 小程序题库全功能移植）
   ============================================================ */

/* ---------- 视图壳 ---------- */
.view { display: none; }
.view.active { display: block; }

/* ---------- 通用 ---------- */
.container-narrow { max-width: 860px; margin-left: auto; margin-right: auto; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #d64545; }
.btn-danger-text { color: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.starred { color: var(--warning); border-color: var(--warning); }
.btn .i { display: inline-flex; }

/* ---------- 知识点卡 ---------- */
.know-card {
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-light) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
  text-align: center;
}
.know-title {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; color: var(--primary);
  background: #fff; border: 1px solid var(--border);
  padding: 8px 20px; border-radius: 999px; margin-bottom: 24px;
}
.know-sub-title { font-size: 24px; margin-bottom: 16px; color: var(--text-1); }
.know-content {
  white-space: pre-line; text-align: left;
  font-size: 15px; line-height: 1.9; color: var(--text-2);
  background: rgba(255,255,255,.75);
  border-radius: var(--radius); padding: 24px 28px;
  margin-bottom: 24px;
}

/* ---------- 模块列表卡（练习选题 / 考试多选） ---------- */
.module-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 24px; }
.module-grid.compact { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.q-mod-card {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.q-mod-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--mod, var(--primary)); }
.q-mod-card.selected { border-color: var(--mod, var(--primary)); background: color-mix(in srgb, var(--mod, var(--primary)) 6%, #fff); box-shadow: var(--shadow-sm); }
.q-mod-icon {
  flex: none; width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--mod, var(--primary)) 12%, #fff);
  color: var(--mod, var(--primary));
}
.q-mod-icon svg { width: 22px; height: 22px; }
.q-mod-info { flex: 1; min-width: 0; }
.q-mod-name { font-weight: 600; color: var(--text-1); font-size: 15px; }
.q-mod-count { font-size: 12px; color: var(--text-3); margin: 4px 0 6px; }
.q-mod-pb { height: 4px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.q-mod-pb span { display: block; height: 100%; border-radius: 999px; background: var(--mod, var(--primary)); transition: width .3s; }
.q-mod-arrow { color: var(--text-3); flex: none; }
.q-mod-check { flex: none; color: var(--mod, var(--primary)); opacity: 0; }
.q-mod-card.selected .q-mod-check { opacity: 1; }

/* ---------- Pills（考试题数） ---------- */
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  padding: 9px 22px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: #fff;
  font-size: 14px; color: var(--text-2); transition: all .15s;
}
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ---------- 练习答题 ---------- */
.q-progress-wrap { margin-bottom: 20px; }
.q-progress-wrap .progress { margin-bottom: 8px; }
.q-progress-meta { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-3); }
.q-id { color: var(--text-3); font-size: 12px; letter-spacing: .5px; }
.kp-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-light); color: var(--primary-dark);
  border-radius: 999px; padding: 4px 12px; font-size: 12px; margin-bottom: 10px;
}
.analysis-text { white-space: pre-line; }
.q-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- 考试 ---------- */
.setup-block { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.setup-block h4 { margin-bottom: 14px; color: var(--text-1); }
.exam-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 20px; margin-bottom: 16px;
}
.exam-timer {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 22px; font-weight: 700; color: var(--primary-dark);
}
.exam-timer.warn { color: var(--danger); animation: timerPulse 1s infinite; }
@keyframes timerPulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.exam-count { color: var(--text-3); font-size: 14px; flex: 1; text-align: center; }

.answer-sheet {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 6px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 20px;
  max-height: 220px; overflow-y: auto;
}
.as-dot {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-2); border-radius: 50%;
  background: var(--bg-soft); cursor: pointer; transition: all .12s;
}
.as-dot:hover { transform: scale(1.1); }
.as-dot.done { background: var(--success); color: #fff; }
.as-dot.current { background: var(--primary); color: #fff; font-weight: 700; outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- 总结 / 成绩 ---------- */
.summary { text-align: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow); }
.summary h3 { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 24px; color: var(--text-1); }
.result-ring { width: 150px; margin: 0 auto 16px; }
.result-ring svg { width: 100%; height: auto; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg-soft); stroke-width: 10; }
.ring-val { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .4s; }
.result-ring.pass .ring-val { stroke: var(--primary); }
.result-ring.fail .ring-val { stroke: var(--danger); }
.ring-num { transform: rotate(90deg); transform-origin: 60px 60px; font-size: 34px; font-weight: 700; fill: var(--text-1); text-anchor: middle; }
.ring-unit { transform: rotate(90deg); transform-origin: 60px 60px; font-size: 13px; fill: var(--text-3); text-anchor: middle; }
.summary-line { font-size: 15px; color: var(--text-2); margin-bottom: 8px; }
.verdict { font-weight: 700; margin-bottom: 20px; font-size: 16px; }
.verdict.pass { color: var(--primary); }
.verdict.fail { color: var(--danger); }
.q-sum-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }

/* ---------- 答题回顾 ---------- */
.review-list { text-align: left; border-top: 1px solid var(--border); padding-top: 24px; }
.review-list h4 { margin-bottom: 16px; color: var(--text-1); }
.review-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.review-mark {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.review-mark svg { width: 16px; height: 16px; }
.review-mark.ok { background: #e6f7ee; color: var(--success); }
.review-mark.fail { background: #fde8e8; color: var(--danger); }
.review-body { min-width: 0; }
.review-title { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.review-question { font-size: 14px; color: var(--text-1); margin-bottom: 6px; }
.review-ans { font-size: 13px; color: var(--text-2); }

/* ---------- 分组列表（错题 / 收藏） ---------- */
.list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 14px; color: var(--text-2); }
.group { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--bg-soft);
  font-weight: 600; color: var(--text-1); font-size: 14px;
}
.group-count { color: var(--text-3); font-weight: 400; font-size: 13px; }
.list-item { padding: 16px 20px; border-top: 1px solid var(--border); }
.list-item:first-of-type { border-top: none; }
.list-kp { font-size: 12px; color: var(--primary); margin-bottom: 6px; }
.list-question {
  font-size: 14px; color: var(--text-1); margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.list-actions { display: flex; gap: 10px; }

/* ---------- 空态 ---------- */
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-3); }
.empty-state-icon { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; }
.empty-state-icon svg { width: 32px; height: 32px; }

/* ---------- Modal ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, .5);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn .15s ease;
}
.modal {
  background: #fff; border-radius: var(--radius-lg); padding: 28px;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
  animation: popIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.modal-title { font-size: 17px; color: var(--text-1); margin-bottom: 10px; }
.modal-content { font-size: 14px; color: var(--text-2); line-height: 1.7; margin-bottom: 22px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* ---------- Toast ---------- */
#toastRoot { position: fixed; left: 0; right: 0; bottom: 48px; z-index: 1100; display: flex; justify-content: center; pointer-events: none; }
.toast {
  background: rgba(26, 37, 51, .92); color: #fff;
  padding: 10px 22px; border-radius: 999px; font-size: 14px;
  opacity: 0; transform: translateY(8px); transition: all .3s;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- 热力日历 ---------- */
.cal-wrap { margin: 28px 0; }
.cal-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-head h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--text-1); }
.cal-sum { font-size: 13px; color: var(--text-3); }
.cal-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.cal-months { display: grid; grid-template-columns: repeat(26, 13px); gap: 3px; margin-bottom: 4px; min-width: 413px; }
.cal-months span { font-size: 10px; color: var(--text-3); }
.cal-grid { display: grid; grid-template-columns: repeat(26, 13px); grid-auto-flow: column; grid-template-rows: repeat(7, 13px); gap: 3px; min-width: 413px; }
.cal-cell { width: 13px; height: 13px; border-radius: 3px; background: var(--bg-soft); cursor: pointer; transition: transform .1s; }
.cal-cell:hover { transform: scale(1.25); }
.cal-cell.level-1 { background: #cfe7ea; }
.cal-cell.level-2 { background: #8fc9cf; }
.cal-cell.level-3 { background: #43a3ad; }
.cal-cell.level-4 { background: var(--primary); }
.cal-cell.today { outline: 2px solid var(--primary); outline-offset: 1px; }
.cal-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 12px; font-size: 11px; color: var(--text-3); }

/* ---------- 统计 ---------- */
.mastery-block { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.mastery-block h3 { margin-bottom: 16px; color: var(--text-1); }
.mastery-chart { display: flex; flex-direction: column; gap: 14px; }
.stats-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.privacy-note { font-size: 12px; color: var(--text-3); }

/* ---------- 词库 ---------- */
.term-search {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 18px; margin-bottom: 20px;
}
.term-search i { color: var(--text-3); flex: none; }
.term-search input { flex: 1; border: none; outline: none; font-size: 14px; background: transparent; }
.term-list { display: flex; flex-direction: column; }
.term-item {
  display: flex; align-items: baseline; gap: 28px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  background: #fff; font-size: 14px;
}
.term-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.term-item:last-child { border-radius: 0 0 var(--radius) var(--radius); border-bottom: none; }
.term-abbr {
  flex: 0 0 160px; min-width: 0;
  color: var(--primary-dark); font-family: 'SF Mono', Menlo, monospace;
  line-height: 1.5; overflow-wrap: anywhere;
}
.term-desc { flex: 1; color: var(--text-1); line-height: 1.5; }
.term-en { color: var(--text-3); font-size: 12px; font-style: normal; text-align: right; }

/* ---------- Loading ---------- */
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--text-3); font-size: 14px; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--bg-soft); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 页脚（深色底，浅色字） ---------- */
.footer-main {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; padding-bottom: 40px;
}
.footer-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.footer-brand strong { display: block; font-size: 18px; margin-bottom: 6px; color: #fff; }
.footer-brand p { font-size: 13px; color: #9fb3bf; line-height: 1.7; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.footer-links a { color: #b8c5cf; font-size: 13px; text-decoration: none; transition: color .15s; }
.footer-links a:hover { color: #fff; }
.footer-links .sep { color: #5d7380; font-size: 12px; user-select: none; }
.footer-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.footer-home {
  color: #b8c5cf; font-size: 14px; text-decoration: none;
  white-space: nowrap; transition: color .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.footer-home::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); flex: none;
}
.footer-home:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); padding: 16px 0; margin-top: 0; font-size: 12px; color: #8fa2ad; }

/* ---------- 语言切换 ---------- */
.lang-switch {
  display: flex; align-items: center;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 2px; background: var(--bg-soft);
}
.lang-btn {
  border: none; background: transparent; cursor: pointer;
  padding: 5px 12px; border-radius: 999px;
  font-size: 13px; color: var(--text-3); transition: all .15s;
}
.lang-btn.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---------- 账号（注册 / 登录） ---------- */
.auth-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; background: var(--primary-light);
  border-radius: 999px; font-size: 13px; color: var(--primary-dark);
  max-width: 200px;
}
.auth-chip .auth-name { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-chip .auth-id { font-size: 11px; color: var(--text-3); font-family: 'SF Mono', Menlo, monospace; }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.auth-field input {
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; outline: none; background: #fff;
}
.auth-field input:focus { border-color: var(--primary); }
.auth-field input.invalid { border-color: var(--danger); }
.error-msg { color: var(--danger); font-size: 12px; min-height: 16px; }
.auth-switch { text-align: center; font-size: 12px; color: var(--text-3); margin: 0; }
.auth-switch a { color: var(--primary); cursor: pointer; }

/* ---------- 管理面板 ---------- */
.admin-gate { text-align: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 60px 24px; box-shadow: var(--shadow); }
.admin-gate h2 { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 12px; color: var(--text-1); }
.admin-gate p { color: var(--text-3); margin-bottom: 20px; font-size: 14px; }
.admin-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.admin-table-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; margin-bottom: 12px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.admin-table th { text-align: left; padding: 12px 14px; background: var(--bg-soft); color: var(--text-2); font-weight: 600; white-space: nowrap; }
.admin-table td { padding: 10px 14px; border-top: 1px solid var(--border); color: var(--text-1); white-space: nowrap; }
.admin-table td.dim { color: var(--text-3); font-size: 12px; }
.admin-table .mono, .admin-detail .mono { font-family: 'SF Mono', Menlo, monospace; font-size: 12px; }
.admin-row { cursor: pointer; transition: background .12s; }
.admin-row:hover { background: var(--primary-light); }
.admin-badge { display: inline-block; background: var(--primary); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 11px; margin-left: 6px; }
.admin-detail { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-top: 20px; }
.admin-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-detail-head h3 { display: flex; align-items: center; gap: 10px; color: var(--text-1); }
.admin-detail-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.admin-progress { font-size: 13px; color: var(--text-2); margin-bottom: 16px; line-height: 1.8; }
.admin-detail h4 { margin-bottom: 10px; color: var(--text-1); font-size: 14px; }
.admin-wrong-list { max-height: 360px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.admin-wrong-list .list-item { border-top: 1px solid var(--border); }
.admin-wrong-list .list-item:first-child { border-top: none; }

/* ---------- 移动端适配 ---------- */
@media (max-width: 720px) {
  .nav-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 8px 12px; }
  .nav-menu {
    display: flex; flex-basis: 100%; order: 3; min-width: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    white-space: nowrap; gap: 4px; padding-bottom: 4px;
  }
  .nav-menu .nav-link { flex: none; }
  .nav-actions { flex: none; gap: 8px; }
  .module-grid.compact { grid-template-columns: 1fr; }
  .answer-sheet { max-height: 160px; }
  .know-card { padding: 24px 18px; }
  .term-en { display: none; }
  .term-item { gap: 16px; }
  .term-abbr { flex-basis: 120px; }
  .auth-chip .auth-id { display: none; }
  .nav-actions { gap: 8px; }
  .admin-detail-stats { grid-template-columns: repeat(2, 1fr); }
  .footer-right { align-items: flex-start; }
  .exam-timer { font-size: 18px; }
  .summary { padding: 28px 16px; }
  .container { padding-left: 16px; padding-right: 16px; }
}