/* ============================================================
   启航训练 · 初一考试训练系统   样式表（浅色主题 / 移动端友好）
   ============================================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #dbeafe;
  --accent: #06b6d4;
  --easy: #10b981;
  --easy-soft: #d1fae5;
  --hard: #f59e0b;
  --hard-soft: #fef3c7;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --bg: #f4f7fc;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e5eaf2;
  --shadow: 0 6px 24px rgba(30, 64, 175, .07);
  --shadow-lg: 0 18px 48px rgba(30, 64, 175, .13);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

a { color: var(--primary); text-decoration: none; }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .3);
}

.brand-title { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: -3px; }

.nav { display: flex; gap: 4px; margin-left: auto; }

.nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  transition: .18s;
}

.nav-item:hover { background: #f1f5fb; color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }

.subject-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- 页面容器 ---------- */
.page { max-width: 1080px; margin: 0 auto; padding: 26px 20px 60px; }
.page-narrow { max-width: 820px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: 25px; font-weight: 800; letter-spacing: -.6px; margin: 0; }
.page-desc { color: var(--muted); font-size: 13px; margin: 4px 0 0; }

/* ---------- 卡片通用 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-pad { padding: 20px 22px; }

.section-title { font-size: 16px; font-weight: 800; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.section-title .bar { width: 4px; height: 16px; border-radius: 4px; background: var(--primary); }

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 30px 32px;
  color: #fff;
  background: linear-gradient(120deg, #1e40af 0%, #2563eb 52%, #0891b2 100%);
  box-shadow: var(--shadow-lg);
  margin-bottom: 20px;
}

.hero::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -90px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .09);
}

.hero::before {
  content: '';
  position: absolute;
  right: 90px;
  bottom: -130px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}

.hero h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.5px; }
.hero p { margin: 0; opacity: .88; font-size: 14px; max-width: 560px; }
.hero-tags { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.hero-tag { background: rgba(255, 255, 255, .17); border: 1px solid rgba(255,255,255,.22); padding: 4px 11px; border-radius: 999px; font-size: 12px; }

/* ---------- 数据概览 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }

.stat-box { padding: 18px 20px; position: relative; overflow: hidden; }
.stat-box .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-box .value { font-size: 29px; font-weight: 800; line-height: 1.2; letter-spacing: -1px; margin-top: 3px; }
.stat-box .foot { font-size: 11px; color: var(--muted); }
.stat-box .dot { position: absolute; right: 16px; top: 16px; width: 10px; height: 10px; border-radius: 50%; }

/* ---------- 模式卡片 ---------- */
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }

.mode-card {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  transition: .2s;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.mode-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #bfdbfe; }
.mode-card .icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; margin-bottom: 12px; }
.mode-card .name { font-weight: 800; font-size: 16px; }
.mode-card .desc { color: var(--muted); font-size: 12px; margin-top: 4px; min-height: 38px; }
.mode-card .go { color: var(--primary); font-size: 12px; font-weight: 700; margin-top: 10px; }
.mode-card .badge-new { position: absolute; right: 14px; top: 14px; font-size: 10px; background: var(--danger-soft); color: var(--danger); padding: 2px 8px; border-radius: 99px; font-weight: 700; }

/* ---------- 筛选栏 ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filter-label { font-size: 12px; color: var(--muted); font-weight: 600; }

.seg { display: inline-flex; background: #eef2f8; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; transition: .15s; }
.seg button.active { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(15,23,42,.1); }

select, input[type="text"], input[type="number"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: #fff;
  color: var(--text);
  outline: none;
  font-size: 13px;
}
select:focus, input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* ---------- 按钮 ---------- */
.btn {
  border: 0;
  border-radius: 11px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
  transition: .18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.25); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-ghost { background: #f1f5fb; color: var(--text); }
.btn-ghost:hover { background: #e6edf8; }
.btn-outline { background: #fff; border: 1px solid var(--line); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: 12px; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ---------- 徽章 ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge-easy { background: var(--easy-soft); color: #047857; }
.badge-hard { background: var(--hard-soft); color: #b45309; }
.badge-choice { background: #ede9fe; color: #6d28d9; }
.badge-blank { background: #e0f2fe; color: #0369a1; }
.badge-comp { background: #fce7f3; color: #be185d; }
.badge-muted { background: #f1f5f9; color: var(--muted); }

/* ---------- 综合题（多小问） ---------- */
.subs { display: grid; gap: 18px; margin-top: 8px; }
.sub-item { border-left: 3px solid #e9d5ff; padding-left: 14px; }
.sub-q { font-size: 14px; font-weight: 600; line-height: 1.7; margin-bottom: 8px; display: flex; gap: 9px; align-items: flex-start; }
.sub-no { flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px; background: #f3e8ff; color: #7e22ce; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.sub-input { max-width: 100%; font-size: 14px; }
.sub-input.sub-ok { border-color: var(--easy); background: #f0fdf6; }
.sub-input.sub-no-ok { border-color: var(--danger); background: #fef4f4; }
.sub-answer { margin-top: 6px; font-size: 12px; color: #475569; line-height: 1.7; }
.sub-answer b { color: var(--easy); }
.sub-review { padding: 7px 11px; border-radius: 8px; margin-bottom: 5px; font-size: 12px; line-height: 1.6; }
.sub-review span { display: block; color: var(--muted); margin-top: 2px; }
.sub-review.sr-ok { background: #f0fdf6; }
.sub-review.sr-no { background: #fef4f4; }

/* ---------- 配图（历史文物 / 场景示意） ---------- */
.q-figure { margin: 0 0 20px; padding: 12px; background: #fafbfc; border: 1px solid var(--border); border-radius: 12px; text-align: center; }
.q-figure img { max-width: 100%; max-height: 300px; border-radius: 8px; cursor: zoom-in; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.q-figure figcaption { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* ---------- 主观题（材料分析）长文本作答 ---------- */
.sub-textarea { width: 100%; max-width: 100%; min-height: 64px; font-size: 14px; line-height: 1.6; padding: 11px 13px; resize: vertical; font-family: inherit; border: 1px solid var(--border); border-radius: 9px; }
.sub-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.sub-score { font-size: 12px; font-weight: 700; color: #be185d; background: #fce7f3; padding: 1px 8px; border-radius: 999px; }
.badge-essay { background: #fce7f3; color: #be185d; }
.sub-review.sr-ok b { color: var(--easy); }
.sub-review.sr-no b { color: var(--danger); }
.badge-ok { background: var(--easy-soft); color: #047857; }
.badge-bad { background: var(--danger-soft); color: #b91c1c; }

/* ---------- 练习页 ---------- */
.practice-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.progress-wrap { flex: 1; min-width: 180px; }
.progress-text { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 5px; }
.progress-track { height: 7px; background: #e8eef7; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 99px; transition: width .3s; }

.combo-box {
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 8px 14px;
  text-align: center;
  min-width: 88px;
}
.combo-box .n { font-size: 22px; font-weight: 900; color: #d97706; line-height: 1.1; }
.combo-box .t { font-size: 10px; color: #b45309; font-weight: 700; }

.question-card { padding: 26px 28px; }
.q-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.q-index { font-size: 12px; color: var(--muted); font-weight: 700; margin-right: 4px; }
.q-stem { font-size: 19px; font-weight: 700; line-height: 1.75; margin: 0 0 22px; white-space: pre-wrap; }
.q-stem .blank { display: inline-block; min-width: 76px; border-bottom: 2px solid var(--primary); color: var(--primary); text-align: center; font-weight: 800; }

.options { display: grid; gap: 10px; }

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 13px 16px;
  transition: .15s;
  font-size: 15px;
  line-height: 1.5;
}
.option:hover:not(.locked) { border-color: #93c5fd; background: #f8fbff; }
.option .key {
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 8px; background: #f1f5f9; color: var(--muted);
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
}
.option.selected { border-color: var(--primary); background: var(--primary-soft); }
.option.selected .key { background: var(--primary); color: #fff; }
.option.correct { border-color: var(--easy); background: var(--easy-soft); }
.option.correct .key { background: var(--easy); color: #fff; }
.option.wrong { border-color: var(--danger); background: var(--danger-soft); }
.option.wrong .key { background: var(--danger); color: #fff; }
.option.locked { cursor: default; }

/* ---------- 一材多题组 ---------- */
.grp-subs { display: grid; gap: 18px; }
.grp-sub { border-left: 3px solid #bfdbfe; padding-left: 14px; }
.grp-q { font-size: 14px; font-weight: 600; line-height: 1.7; margin-bottom: 9px; display: flex; gap: 9px; align-items: flex-start; }
.grp-opts { display: grid; gap: 8px; }
.grp-opt {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  border: 1.5px solid var(--line); background: #fff; border-radius: 10px;
  padding: 9px 13px; transition: .15s; font-size: 14px; line-height: 1.45;
}
.grp-opt:hover:not(.locked) { border-color: #93c5fd; background: #f8fbff; }
.grp-opt .key {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 7px;
  background: #f1f5f9; color: var(--muted); display: grid; place-items: center;
  font-weight: 800; font-size: 12px;
}
.grp-opt.selected { border-color: var(--primary); background: var(--primary-soft); }
.grp-opt.selected .key { background: var(--primary); color: #fff; }
.grp-opt.correct { border-color: var(--easy); background: var(--easy-soft); }
.grp-opt.correct .key { background: var(--easy); color: #fff; }
.grp-opt.wrong { border-color: var(--danger); background: var(--danger-soft); }
.grp-opt.wrong .key { background: var(--danger); color: #fff; }
.grp-opt.locked { cursor: default; }

.blank-input { width: 100%; max-width: 420px; font-size: 17px; padding: 12px 15px; }
.blank-hint { font-size: 12px; color: var(--muted); margin-top: 8px; }

.q-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

.feedback { margin-top: 18px; border-radius: 13px; padding: 16px 18px; border: 1px solid; animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.feedback.ok { background: #f0fdf6; border-color: #a7f3d0; }
.feedback.no { background: #fef4f4; border-color: #fecaca; }
.feedback-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.feedback.ok .feedback-head { color: #047857; }
.feedback.no .feedback-head { color: #b91c1c; }
.feedback-answer { font-size: 13px; margin-bottom: 6px; }
.feedback-answer b { color: var(--text); }
.feedback-exp { font-size: 13px; color: #475569; border-top: 1px dashed rgba(100,116,139,.3); padding-top: 8px; margin-top: 8px; }

/* ---------- 考试 ---------- */
.exam-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 18px; color: var(--primary); display: flex; align-items: center; gap: 7px; }
.timer.urgent { color: var(--danger); }

.answer-sheet { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; margin-top: 18px; }
.sheet-cell {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  height: 38px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  transition: .15s;
}
.sheet-cell:hover { border-color: var(--primary); }
.sheet-cell.answered { background: var(--primary); border-color: var(--primary); color: #fff; }
.sheet-cell.current { outline: 3px solid rgba(37,99,235,.25); }
.sheet-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 12px; align-items: center; }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }

.score-hero { text-align: center; padding: 30px 20px 22px; }
.score-circle {
  width: 150px; height: 150px; margin: 0 auto 14px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--primary) calc(var(--pct) * 1%), #e8eef7 0);
  position: relative;
}
.score-circle::before { content: ''; position: absolute; inset: 13px; background: #fff; border-radius: 50%; }
.score-inner { position: relative; }
.score-num { font-size: 42px; font-weight: 900; line-height: 1; letter-spacing: -2px; }
.score-unit { font-size: 12px; color: var(--muted); }
.score-hero h2 { margin: 6px 0 4px; font-size: 20px; }
.score-hero p { color: var(--muted); margin: 0; font-size: 13px; }

.review-item { border: 1px solid var(--line); border-radius: 12px; padding: 15px 17px; margin-bottom: 10px; background: #fff; }
.review-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 7px; }
.review-stem { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.review-ans { font-size: 12px; }

/* ---------- 错题本 / 列表 ---------- */
.wrong-item { display: flex; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.wrong-item:last-child { border-bottom: 0; }
.wrong-main { flex: 1; min-width: 0; }
.wrong-stem { font-weight: 600; font-size: 14px; margin: 6px 0; line-height: 1.6; }
.wrong-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.wrong-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex-shrink: 0; }
.wrong-count { font-size: 11px; color: var(--danger); font-weight: 700; }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .ico { font-size: 46px; margin-bottom: 10px; opacity: .75; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 17px; }
.empty p { margin: 0 0 18px; font-size: 13px; }

/* ---------- 统计 ---------- */
.chart-row { display: grid; grid-template-columns: 190px 1fr 48px; gap: 12px; align-items: center; margin-bottom: 11px; font-size: 13px; }
.chart-name { color: #475569; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-track { height: 10px; background: #eef2f8; border-radius: 99px; overflow: hidden; }
.chart-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.chart-fill.low { background: linear-gradient(90deg, #f97316, #ef4444); }
.chart-val { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.knowledge-item { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.knowledge-item:last-child { border: 0; }
.knowledge-item .cnt { color: var(--danger); font-weight: 800; white-space: nowrap; }

/* ---------- 套卷中心 ---------- */
.paper-card { transition: .2s; }
.paper-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #bfdbfe; }
.paper-card .blueprint-tag { background: #f4f7fc; border-radius: 6px; padding: 3px 5px; text-align: center; font-size: 10px; color: var(--muted); }

/* ---------- 弹窗 & 提示 ---------- */
.mask { position: fixed; inset: 0; background: rgba(15,23,42,.42); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 18px; padding: 26px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); }
.modal h3 { margin: 0 0 8px; font-size: 19px; }
.modal p { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: #1e293b; color: #fff; padding: 10px 20px; border-radius: 999px;
  font-size: 13px; z-index: 200; box-shadow: var(--shadow-lg);
  animation: pop .2s ease;
}

/* ---------- 底部导航（移动端） ---------- */
.bottom-nav { display: none; }

@media (max-width: 860px) {
  .nav { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .answer-sheet { grid-template-columns: repeat(5, 1fr); }
  .bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .bottom-nav button { border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 10px; }
  .bottom-nav button.active { color: var(--primary); }
  .bottom-nav .ic { font-size: 19px; }
  .page { padding-bottom: 90px; }
}

@media (max-width: 560px) {
  .topbar-inner { padding: 10px 14px; }
  .brand-title { font-size: 15px; }
  .subject-chip { display: none; }
  .page { padding: 18px 14px 90px; }
  .hero { padding: 24px 20px; }
  .hero h1 { font-size: 21px; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card .desc { min-height: 0; }
  .question-card { padding: 20px 18px; }
  .q-stem { font-size: 17px; }
  .chart-row { grid-template-columns: 120px 1fr 42px; font-size: 12px; }
  .wrong-side { flex-direction: row; }
}

/* ---------------- 科目切换菜单（三科合并入口） ---------------- */
.subj-menu {
  display: flex;
  gap: 4px;
  background: #f1f5fb;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  flex: none;
}
.subj-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  padding: 7px 11px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: .18s;
  font-family: inherit;
}
.subj-btn:hover { background: #fff; color: var(--text); }
.subj-btn.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(15, 23, 42, .14); }
.subj-btn .sb-ic { font-size: 15px; line-height: 1; }

@media (max-width: 860px) {
  .subj-btn { padding: 6px 8px; font-size: 12px; }
  .subj-btn .sb-tx { display: none; }
  .subj-btn .sb-ic { font-size: 16px; }
}

@media (max-width: 720px) {
  .subj-menu { margin-left: auto; }
}

/* ==================== 答题游戏化层 ==================== */
.game-lv{display:flex;align-items:center;gap:9px;margin-left:auto;margin-right:14px;padding:5px 10px;background:rgba(255,255,255,.16);border-radius:10px;min-width:186px}
.game-lv .gl-ic{font-size:21px;line-height:1}
.game-lv .gl-main{flex:1;min-width:0}
.game-lv .gl-top{display:flex;justify-content:space-between;gap:8px;font-size:12px;color:#fff;white-space:nowrap}
.game-lv .gl-top b{font-weight:600}
.game-lv .gl-bar{height:5px;border-radius:4px;background:rgba(255,255,255,.28);margin:4px 0 2px;overflow:hidden}
.game-lv .gl-bar i{display:block;height:100%;background:#fbbf24;border-radius:4px;transition:width .4s}
.game-lv .gl-foot{font-size:10px;color:rgba(255,255,255,.82);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.game-lv .gl-sfx{border:0;background:rgba(255,255,255,.18);color:#fff;border-radius:7px;width:26px;height:26px;cursor:pointer;font-size:13px;flex:none}
.game-lv .gl-sfx:hover{background:rgba(255,255,255,.32)}
@media(max-width:860px){.game-lv{min-width:0;padding:4px 7px}.game-lv .gl-foot{display:none}.game-lv .gl-top{font-size:11px}}

.game-fx{position:fixed;left:50%;top:22%;transform:translateX(-50%);z-index:9999;font-size:26px;font-weight:700;color:#f59e0b;text-shadow:0 2px 8px rgba(0,0,0,.18);pointer-events:none;animation:gfx 1.25s ease-out forwards;white-space:nowrap}
@keyframes gfx{0%{opacity:0;transform:translate(-50%,14px) scale(.7)}20%{opacity:1;transform:translate(-50%,0) scale(1.08)}70%{opacity:1;transform:translate(-50%,-12px) scale(1)}100%{opacity:0;transform:translate(-50%,-38px) scale(.95)}}
@media(prefers-reduced-motion:reduce){.game-fx{animation-duration:.4s}}

.game-section{margin-top:26px}
.game-entry-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.game-entry{display:flex;align-items:center;gap:12px;padding:16px;border:1px solid var(--border);border-radius:14px;background:var(--card);cursor:pointer;text-align:left;transition:.18s;font-family:inherit}
.game-entry:hover{transform:translateY(-2px);box-shadow:0 6px 18px rgba(15,23,42,.09)}
.game-entry .ge-ic{font-size:30px;line-height:1}
.game-entry .ge-tx{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
.game-entry .ge-tx b{font-size:15px;color:var(--text)}
.game-entry .ge-tx span{font-size:12px;color:var(--muted);line-height:1.4}
.game-entry .ge-go{font-size:20px;color:var(--muted)}
.ge-map{background:linear-gradient(0deg,var(--card),var(--card))}
@media(max-width:640px){.game-entry-grid{grid-template-columns:1fr}}

.game-daily{margin-top:14px;padding:16px;border:1px solid var(--border);border-radius:14px;background:var(--card)}
.gd-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:10px}
.gd-head b{font-size:14px}.gd-head span{font-size:11px;color:var(--muted)}
.gd-row{display:flex;align-items:center;gap:10px;padding:6px 0;font-size:12px;color:var(--text)}
.gd-row.done{color:var(--muted)}
.gd-nm{flex:none;min-width:150px}
.gd-bar{flex:1;height:6px;background:var(--bg-soft,#eef2f7);border-radius:4px;overflow:hidden}
.gd-bar i{display:block;height:100%;background:#10b981;border-radius:4px}
.gd-row.done .gd-bar i{background:#94a3b8}
.gd-v{flex:none;font-size:11px;color:var(--muted);min-width:88px;text-align:right}

.game-report{margin-top:14px;padding:16px;border:1px solid var(--border);border-radius:14px;background:var(--card)}
.gr-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:12px}
.gr-head b{font-size:14px}.gr-head span{font-size:11px;color:var(--muted)}
.gr-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;text-align:center}
.gr-grid div{padding:8px 4px;background:var(--bg-soft,#f5f8fc);border-radius:9px}
.gr-grid b{display:block;font-size:18px;color:var(--primary)}
.gr-grid span{font-size:11px;color:var(--muted)}
.game-report p{margin:12px 0 0;font-size:12px;color:var(--muted);line-height:1.6}
@media(max-width:640px){.gr-grid{grid-template-columns:repeat(3,1fr)}.gd-nm{min-width:0;flex:1}}

.game-page{padding-bottom:24px}
.game-hero{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:20px;border-radius:16px;background:var(--card);border:1px solid var(--border);margin-bottom:18px}
.game-hero h1{font-size:21px;margin:0 0 8px}
.game-hero p{margin:0;font-size:12.5px;color:var(--muted);line-height:1.7;max-width:560px}
.gh-r{text-align:right;flex:none}
.gh-lv{font-size:16px;font-weight:600;color:var(--primary);white-space:nowrap}
.gh-st{font-size:12px;color:var(--muted);margin-top:6px;white-space:nowrap}
@media(max-width:640px){.game-hero{flex-direction:column;align-items:flex-start}.gh-r{text-align:left}}

.game-chaps{display:flex;flex-direction:column;gap:12px}
.game-chap{padding:14px 16px;border:1px solid var(--border);border-radius:14px;background:var(--card)}
.gc-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.gc-no{font-size:11px;padding:3px 8px;border-radius:20px;background:#dbeafe;color:#1d4ed8;white-space:nowrap}
.gc-head b{flex:1;font-size:14px}
.gc-star{color:#f59e0b;font-size:15px;letter-spacing:2px}
.gc-nodes{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.game-node{display:flex;flex-direction:column;align-items:center;gap:4px;padding:12px 8px;border:1px solid var(--border);border-radius:12px;background:var(--bg-soft,#f8fafc);cursor:pointer;font-family:inherit;transition:.18s}
.game-node:hover:not(:disabled){transform:translateY(-2px);border-color:var(--primary);background:#fff}
.game-node.cleared{border-color:#fbbf24;background:#fffbeb}
.game-node.locked{opacity:.5;cursor:not-allowed}
.gn-ic{font-size:26px;line-height:1}
.game-node b{font-size:13px;color:var(--text)}
.gn-need{font-size:11px;color:var(--muted)}
.gn-star{font-size:12px;color:#f59e0b;letter-spacing:1px}
@media(max-width:480px){.gc-nodes{gap:6px}.game-node{padding:10px 4px}.gn-ic{font-size:21px}}

.game-mobs{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.game-mob{display:flex;align-items:center;gap:11px;padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--card)}
.gm-ic{font-size:26px;flex:none}
.gm-tx{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.gm-tx b{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gm-tx span{font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gm-hp{color:#ef4444!important;letter-spacing:2px}
.gm-tag{flex:none;font-size:10.5px;color:var(--muted);background:var(--bg-soft,#f1f5f9);padding:4px 7px;border-radius:6px}
@media(max-width:640px){.game-mobs{grid-template-columns:1fr}}
.game-foot{display:flex;gap:10px;margin-top:20px;flex-wrap:wrap}

.game-hud{margin-top:20px;padding:14px 16px;border:1px dashed var(--primary);border-radius:14px;background:var(--bg-soft,#f8fafc)}
.gh-title{font-size:13px;font-weight:600;margin-bottom:8px}
.gh-hearts{margin-left:8px;letter-spacing:2px}
.gh-combo{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:var(--muted);margin-bottom:10px}
.gh-combo b{color:#f59e0b;font-size:15px}
.gh-items{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.ghi-label{font-size:12px;color:var(--muted)}
.gh-items button{padding:6px 10px;border:1px solid var(--border);border-radius:8px;background:#fff;cursor:pointer;font-size:12px;font-family:inherit;color:var(--text)}
.gh-items button:hover:not(:disabled){border-color:var(--primary)}
.gh-items button:disabled{opacity:.42;cursor:not-allowed}
.gh-items i{font-style:normal;color:#b45309;font-size:11px;margin-left:3px}
.gh-tip{margin:9px 0 0;font-size:11px;color:var(--muted)}
.game-fifty-hidden{opacity:.18;pointer-events:none;text-decoration:line-through}

.game-rating{display:flex;align-items:center;gap:16px;margin-top:18px;padding:18px;border-radius:16px;background:var(--card);border:1px solid var(--border)}
.gr-badge{flex:none;width:64px;height:64px;border-radius:16px;display:flex;align-items:center;justify-content:center;font-size:34px;font-weight:700;color:#fff}
.gr-s{background:#f59e0b}.gr-a{background:#10b981}.gr-b{background:#3b82f6}.gr-c{background:#8b5cf6}.gr-d{background:#94a3b8}
.gr-tx{flex:1;min-width:0}
.gr-stars{color:#f59e0b;font-size:19px;letter-spacing:3px}
.gr-tx b{display:block;font-size:15px;margin:3px 0}
.gr-tx p{margin:0;font-size:12px;color:var(--muted);line-height:1.6}
.gr-lv{flex:none;text-align:right;font-size:12px;color:var(--primary);white-space:nowrap}
.gr-lv span{display:block;color:#b45309;margin-top:4px}
@media(max-width:640px){.game-rating{flex-wrap:wrap}.gr-lv{text-align:left;width:100%}}

/* ==================== 兑换中心 / 乐园 ==================== */
body[data-theme="ocean"]{--primary:#0891b2;--primary-dark:#0e7490;--primary-soft:#cffafe;--accent:#06b6d4;--bg:#eff9fc}
body[data-theme="dusk"]{--primary:#7c3aed;--primary-dark:#6d28d9;--primary-soft:#ede9fe;--accent:#a78bfa;--bg:#f7f5fd}
body[data-theme="ocean"] .topbar,body[data-theme="dusk"] .topbar{background:var(--primary)}
body.shop-fx-rainbow .game-fx{background:linear-gradient(90deg,#f43f5e,#f59e0b,#10b981,#3b82f6,#8b5cf6);-webkit-background-clip:text;background-clip:text;color:transparent;text-shadow:none}
.gl-title{font-style:normal;font-size:11px;padding:1px 6px;border-radius:20px;background:rgba(255,255,255,.24);margin-left:4px;font-weight:500}
.gl-ic.shop-frame-gold{border:2px solid #fbbf24;border-radius:50%;padding:2px;background:#fffbeb}
.gl-ic.shop-frame-star{border:2px solid #a78bfa;border-radius:50%;padding:2px;background:#f5f3ff;box-shadow:0 0 0 3px rgba(167,139,250,.25)}

.game-shop-strip{display:flex;align-items:center;gap:12px;margin-top:14px;padding:14px 16px;border-radius:14px;border:1px solid var(--line);background:linear-gradient(90deg,#fffbeb,#fff);text-decoration:none;cursor:pointer;transition:.18s}
.game-shop-strip:hover{transform:translateY(-2px);box-shadow:var(--shadow)}
.gss-ic{font-size:26px;flex:none}
.game-shop-strip div{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.game-shop-strip b{font-size:14px;color:var(--text)}
.game-shop-strip div span{font-size:12px;color:var(--muted)}
.gss-go{font-size:13px;color:var(--primary);white-space:nowrap}

.park-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.park-card{display:flex;flex-direction:column;gap:6px;padding:18px 16px;border:1px solid var(--line);border-radius:16px;background:var(--card);cursor:pointer;text-align:left;font-family:inherit;transition:.18s}
.park-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-lg)}
.pk-ic{font-size:34px;line-height:1}
.park-card b{font-size:15px;color:var(--text)}
.park-card span{font-size:12px;color:var(--muted);line-height:1.6;min-height:38px}
.pk-go{font-size:13px;color:var(--primary);font-weight:600;margin-top:4px}
.pc-map{background:linear-gradient(180deg,#ecfdf5,#fff)}
.pc-raid{background:linear-gradient(180deg,#fef2f2,#fff)}
.pc-shop{background:linear-gradient(180deg,#fffbeb,#fff)}
@media(max-width:720px){.park-grid{grid-template-columns:1fr}.park-card span{min-height:0}}

.park-wear{margin-top:16px;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--card)}
.pw-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:10px}
.pw-head b{font-size:14px}.pw-head span{font-size:11px;color:var(--muted)}
.pw-chip{display:inline-block;margin:0 6px 6px 0;padding:5px 10px;border-radius:20px;background:var(--primary-soft);color:var(--primary-dark);font-size:12px}
.pw-chip.pw-hot{background:#fef3c7;color:#b45309}
.pw-empty{font-size:12px;color:var(--muted)}

.shop-flash{margin:0 0 14px;padding:12px 16px;border-radius:12px;background:#d1fae5;color:#065f46;font-size:13px;font-weight:500}
.shop-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.shop-tabs button{padding:8px 14px;border:1px solid var(--line);border-radius:20px;background:var(--card);color:var(--muted);font-size:13px;font-family:inherit;cursor:pointer;transition:.18s}
.shop-tabs button:hover{border-color:var(--primary)}
.shop-tabs button.active{background:var(--primary);border-color:var(--primary);color:#fff;font-weight:500}
.shop-tier{margin-bottom:20px}
.st-head{display:flex;align-items:baseline;gap:8px;margin-bottom:10px;flex-wrap:wrap}
.st-dot{width:10px;height:10px;border-radius:50%;flex:none}
.st-head b{font-size:15px}.st-head span{font-size:12px;color:var(--muted)}
.shop-note{margin:0 0 10px;font-size:12px;color:var(--muted);line-height:1.6}
.shop-items{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media(max-width:720px){.shop-items{grid-template-columns:1fr}}

.shop-item,.shop-coupon{display:flex;align-items:center;gap:11px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--card)}
.shop-item.owned{border-color:var(--primary);background:var(--primary-soft)}
.si-ic,.sc-ic{font-size:26px;flex:none;width:34px;text-align:center}
.si-tx,.sc-tx,.tk-tx{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.si-tx b,.sc-tx b,.tk-tx b{font-size:13px;color:var(--text)}
.si-tx span,.sc-tx span,.tk-tx span{font-size:11px;color:var(--muted);line-height:1.4}
.si-buy,.sc-buy{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:5px}
.si-price{font-size:12px;color:#b45309;font-weight:600;white-space:nowrap}
.si-btn{padding:5px 12px;border:1px solid var(--primary);border-radius:8px;background:var(--primary);color:#fff;font-size:12px;font-family:inherit;cursor:pointer;white-space:nowrap}
.si-btn:hover:not(:disabled){background:var(--primary-dark)}
.si-btn:disabled{opacity:.4;cursor:not-allowed;background:var(--muted);border-color:var(--muted)}
.si-btn.on{background:#fff;color:var(--primary)}
.si-on{font-size:11px;color:#065f46;background:#d1fae5;padding:3px 7px;border-radius:6px}
.shop-empty{padding:14px;text-align:center;color:var(--muted);font-size:12px;grid-column:1/-1}

.shop-ticket{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px dashed #f59e0b;border-radius:12px;background:#fffbeb}
.shop-ticket.st-used{border-color:#10b981;background:#ecfdf5}
.shop-ticket.st-expired{border-color:#cbd5e1;background:#f8fafc;opacity:.7}
.tk-code{flex:none;min-width:62px;text-align:center;font-size:21px;font-weight:700;letter-spacing:2px;color:#b45309;font-family:var(--font-mono,monospace)}
.shop-ticket.st-used .tk-code{color:#10b981}
.tk-st{flex:none;font-size:12px;color:var(--muted);white-space:nowrap}
.shop-log{display:flex;align-items:center;gap:10px;padding:9px 12px;border-bottom:1px solid var(--line);font-size:12px;color:var(--muted)}
.shop-log b{flex:1;color:var(--text);font-weight:400}
.shop-log span:last-child{color:#b45309;white-space:nowrap}

.shop-parent{margin-top:18px;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--card)}
.shop-parent.locked{background:#f8fafc}
.sp-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.sp-head b{font-size:14px}.sp-head span{font-size:11px;color:var(--muted)}
.sp-exit{margin-left:auto;padding:4px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--muted);font-size:11px;cursor:pointer;font-family:inherit}
.sp-block{padding:12px 0;border-top:1px dashed var(--line)}
.sp-block>b{display:block;font-size:13px;margin-bottom:8px}
.sp-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.sp-input{flex:1;min-width:150px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;font-size:13px;font-family:inherit;color:var(--text);background:#fff}
.sp-input.sp-sm{max-width:110px;min-width:80px}
.sp-err{margin:8px 0 0;font-size:12px;color:var(--danger)}
.sp-tip{margin:8px 0 0;font-size:11px;color:var(--muted);line-height:1.6}
.sp-coupons{display:flex;gap:7px;flex-wrap:wrap}
.sp-cp{display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:8px;background:var(--primary-soft);color:var(--primary-dark);font-size:12px}
.sp-cp button{border:0;background:transparent;color:var(--danger);cursor:pointer;font-size:15px;line-height:1;padding:0 2px}

/* ============================================================
   响应式补丁 · 手机 / Pad 自适应（追加层）
   不改上方任何既有规则，不改 JS / 题库 / 判分逻辑。
   断点口径：
     <=380    超窄手机      单列、隐藏次要信息
     <=560    手机          顶栏两行、字号收敛
     <=860    大屏手机横屏  底部导航、两列网格
     768-1024 Pad          恢复顶部导航、关闭底部导航、三/四列网格
     <=1024   顶栏两行     六科菜单独占第二行（手机与 Pad 共用）
     >=1500   大屏         容器适度放宽
   ============================================================ */

/* ---------- 1. 全局兜底：杜绝横向滚动 + 长串自动换行 ---------- */
html, body { overflow-x: hidden; }
#app { max-width: 100%; }

.q-stem, .q-meta, .option, .grp-q, .grp-opt, .sub-q, .sub-answer,
.sub-review, .review-stem, .review-ans, .wrong-stem, .wrong-meta,
.feedback-exp, .feedback-answer, .page-desc, .page-title, .hero p,
.exam-bar, .chart-name, .knowledge-item, .q-figure figcaption {
  overflow-wrap: anywhere;
}

/* 桌面/Pad：底部提示避开系统指示条 */
.toast { bottom: calc(30px + env(safe-area-inset-bottom)); }

/* ---------- 2. <=1024：顶栏两行，六科菜单独占第二行 ----------
   6 个科目按钮 + 等级条 + 顶部导航挤在一行会溢出；让科目菜单
   换到第二行并均分宽度，手机与 Pad 都稳。 */
@media (max-width: 1024px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px 10px; }
  .game-lv { margin-left: auto; margin-right: 0; }
  .subj-menu { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  .subj-btn { flex: 1 1 0; justify-content: center; padding: 7px 4px; min-height: 38px; }
}

/* ---------- 3. Pad（768-1024）：撤销 860 断点的"手机化"误判 ----------
   iPad 竖屏 768 / Air 820 / Pro 11" 834 原本会被 860 断点
   强制隐藏顶部导航、启用底部导航、把网格压成 2 列。这里恢复。 */
@media (min-width: 768px) and (max-width: 1024px) {
  .nav { display: flex; margin-left: 0; }
  .nav-item { padding: 7px 10px; font-size: 13px; }
  .bottom-nav { display: none; }
  .page { padding: 24px 28px 48px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .mode-grid { grid-template-columns: repeat(3, 1fr); }
  .two-col { grid-template-columns: 1fr 1fr; }
  .answer-sheet { grid-template-columns: repeat(10, 1fr); }
  .subj-menu { justify-content: flex-start; }
  .subj-btn { flex: 0 0 auto; padding: 7px 11px; }
  .subj-btn .sb-tx { display: inline; }
  .game-lv { min-width: 0; }
}

/* ---------- 4. 手机 <=860：输入框 16px 防 iOS 自动缩放 + 触屏点击目标 ---------- */
@media (max-width: 860px) {
  /* iOS Safari 在 input/select/textarea 字号 < 16px 时聚焦会放大整页 */
  input, select, textarea,
  .sp-input, .blank-input, .sub-input, .sub-textarea, .grp-blank {
    font-size: 16px !important;
  }
  .bottom-nav button { min-height: 46px; min-width: 54px; padding: 6px 8px; }
  .bottom-nav .ic { font-size: 20px; }
  .btn { min-height: 42px; }
  .sheet-cell { height: 42px; }
  .option, .grp-opt { padding: 11px 13px; }
  /* 有底部导航时，toast 要抬到它上面，否则被遮住 */
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* 触屏无 hover，去掉卡片位移避免"粘滞"高亮 */
@media (hover: none) {
  .mode-card:hover, .paper-card:hover, .game-entry:hover,
  .park-card:hover, .game-shop-strip:hover,
  .game-node:hover:not(:disabled) { transform: none; }
}

/* ---------- 5. 手机 <=560：字号与间距收敛 ---------- */
@media (max-width: 560px) {
  .topbar-inner { padding: 8px 12px; gap: 6px 8px; }
  .brand-mark { width: 32px; height: 32px; font-size: 17px; border-radius: 9px; }
  .brand-sub { display: none; }
  .game-lv { padding: 3px 7px; gap: 6px; }
  .game-lv .gl-sfx { width: 26px; height: 26px; }
  .subj-btn { padding: 6px 2px; min-height: 36px; }
  .hero { padding: 20px 16px; border-radius: 18px; }
  .hero h1 { font-size: 20px; }
  .hero p { font-size: 13px; }
  .page { padding: 14px 12px 96px; }
  .card-pad { padding: 16px 14px; }
  .question-card { padding: 18px 14px; }
  .q-stem { font-size: 16px; margin-bottom: 18px; }
  .option { font-size: 14px; gap: 9px; }
  .option .key { width: 24px; height: 24px; }
  .grp-sub, .sub-item { padding-left: 10px; }
  .q-actions .btn { flex: 1 1 auto; }
  .exam-bar { font-size: 12px; }
  .answer-sheet { gap: 6px; }
  .sheet-cell { height: 40px; font-size: 12px; }
  .score-circle { width: 120px; height: 120px; }
  .score-circle::before { inset: 10px; }
  .score-num { font-size: 34px; }
  .score-hero { padding: 22px 14px 18px; }
  .filters { gap: 8px; }
  .seg { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .two-col { grid-template-columns: 1fr; }
  .chart-row { grid-template-columns: 100px 1fr 38px; font-size: 11px; }
  .modal { padding: 20px 16px; }
  .modal-actions { flex-wrap: wrap; }
  .q-figure img { max-height: 220px; }
  .wrong-item { padding: 14px 12px; gap: 10px; }
}

/* ---------- 6. 超窄手机 <=380 ---------- */
@media (max-width: 380px) {
  .brand-title { font-size: 14px; }
  .game-lv .gl-ic { display: none; }
  .hero h1 { font-size: 18px; }
  .q-stem { font-size: 15px; }
  .gr-grid { grid-template-columns: repeat(2, 1fr); }
  .gc-nodes { gap: 5px; }
  .game-node { padding: 9px 2px; }
  .page-title { font-size: 21px; }
}

/* ---------- 7. 大屏 >=1500：容器适度放宽 ---------- */
@media (min-width: 1500px) {
  .page, .topbar-inner { max-width: 1240px; }
}

/* ============================================================
   账号密码登录 / 云同步（cloud.js 专用样式）
   ============================================================ */

/* ---------- 顶栏账号小胶囊 ---------- */
.cloud-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform .15s, box-shadow .15s;
}
.cloud-chip:hover { box-shadow: 0 3px 10px rgba(37, 99, 235, .16); }
.cloud-chip:active { transform: scale(.96); }
.cloud-chip.cc-on span { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
.cloud-chip.cc-off { color: var(--hard); border-color: #fde3b0; background: var(--hard-soft); }

.cc-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--easy); flex-shrink: 0;
}
.cc-dot[data-sync="syncing"] { background: var(--primary); animation: ccPulse 1s ease-in-out infinite; }
.cc-dot[data-sync="error"] { background: var(--danger); }

body[data-theme="ocean"] .cloud-chip,
body[data-theme="dusk"] .cloud-chip {
  background: rgba(255, 255, 255, .2);
  border-color: rgba(255, 255, 255, .4);
  color: #fff;
}
body[data-theme="ocean"] .cloud-chip.cc-off,
body[data-theme="dusk"] .cloud-chip.cc-off { background: rgba(255, 255, 255, .9); color: var(--hard); }

/* ---------- 登录遮罩 ---------- */
.cloud-gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: linear-gradient(160deg, rgba(37, 99, 235, .14), rgba(6, 182, 212, .1) 45%, rgba(244, 247, 252, .96));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: cgFade .22s ease-out;
}
body.cg-locked { overflow: hidden; }

.cg-card {
  width: 100%;
  max-width: 388px;
  background: var(--card);
  border-radius: 22px;
  padding: 26px 24px 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, .7);
  animation: cgRise .26s cubic-bezier(.2, .9, .3, 1.2);
}

.cg-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.cg-logo {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  font-size: 24px; background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
}
.cg-brand b { display: block; font-size: 19px; letter-spacing: -.3px; }
.cg-brand small { color: var(--muted); font-size: 12px; }

.cg-tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 16px;
  background: var(--bg); border-radius: 12px;
}
.cg-tabs button {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  padding: 8px 4px; border-radius: 9px; font-size: 13.5px; font-weight: 700;
}
.cg-tabs button.on { background: var(--card); color: var(--primary); box-shadow: 0 2px 8px rgba(30, 64, 175, .1); }

.cg-field { display: block; margin-bottom: 13px; }
.cg-field > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.cg-field input {
  width: 100%; height: 44px; padding: 0 13px;
  border: 1.5px solid var(--line); border-radius: 11px;
  background: #fff; color: var(--text); font-size: 14.5px;
  transition: border-color .15s, box-shadow .15s;
}
.cg-field input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}
.cg-row { display: flex; gap: 8px; }
.cg-row input { flex: 1; min-width: 0; }
.cg-code {
  flex-shrink: 0; height: 44px; padding: 0 12px; border-radius: 11px;
  border: 1.5px solid var(--primary); background: var(--primary-soft);
  color: var(--primary-dark); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.cg-code:disabled { opacity: .6; }

.cg-btn {
  width: 100%; height: 46px; border: 0; border-radius: 12px;
  font-size: 15.5px; font-weight: 800; letter-spacing: .5px;
}
.cg-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; box-shadow: 0 8px 20px rgba(37, 99, 235, .28);
}
.cg-btn-primary:disabled { opacity: .65; box-shadow: none; }
.cg-btn-primary:active { transform: translateY(1px); }

.cg-hint { margin-top: 11px; font-size: 12.5px; color: var(--muted); text-align: center; }

.cg-msg { margin-top: 12px; font-size: 13px; line-height: 1.5; display: none; }
.cg-msg.err, .cg-msg.ok, .cg-msg.warn { display: block; padding: 9px 12px; border-radius: 10px; }
.cg-msg.err { color: #b91c1c; background: var(--danger-soft); }
.cg-msg.ok { color: #047857; background: var(--easy-soft); }
.cg-msg.warn { color: #92400e; background: var(--hard-soft); }

.cg-foot { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); text-align: center; }
.cg-foot p { margin: 0 0 8px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.cg-link {
  border: 0; background: transparent; color: var(--muted);
  font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px;
}
.cg-link:hover { color: var(--primary); }

.cg-unavailable { text-align: center; padding: 6px 0 2px; }
.cg-unavailable b { display: block; font-size: 15px; margin-bottom: 6px; }
.cg-unavailable p { margin: 0 0 8px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.cg-unavailable .cg-dim { font-size: 12px; opacity: .85; }

/* ---------- 账号面板 ---------- */
.cu-panel {
  position: fixed; top: 64px; right: 16px; z-index: 320;
  width: 250px; padding: 14px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow-lg);
  animation: cgRise .18s ease-out;
}
.cu-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cu-head b { font-size: 14px; }
.cu-head button { border: 0; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; padding: 4px; }
.cu-mail {
  font-size: 13px; word-break: break-all; padding: 7px 9px;
  background: var(--bg); border-radius: 9px; color: var(--text);
}
.cu-sync { font-size: 12px; color: var(--muted); margin: 8px 2px 10px; }
.cu-btns { display: flex; gap: 8px; }
.cu-btns button {
  flex: 1; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 12.5px; font-weight: 700;
}
.cu-btns .cu-out { color: var(--danger); border-color: #f7cfcf; background: var(--danger-soft); }

@keyframes cgFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cgRise { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes ccPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

@media (max-width: 1024px) {
  .cloud-chip { order: 2; margin-left: 2px; }
  .cu-panel { top: 60px; right: 12px; }
}
@media (max-width: 480px) {
  .cg-card { padding: 22px 18px 16px; border-radius: 18px; }
  .cg-brand { margin-bottom: 14px; }
  .cg-logo { width: 42px; height: 42px; font-size: 22px; }
  .cg-brand b { font-size: 17px; }
  .cloud-chip { height: 28px; padding: 0 9px; font-size: 12px; }
  .cloud-chip.cc-on span { max-width: 58px; }
  .cu-panel { left: 12px; right: 12px; width: auto; }
}
