/* ============================================================
   统一设计层 v2 · 蓝白 / 专业 / 克制
   在 style.css 之后加载：统一字体、颜色、按钮、卡片、间距，
   并补齐加载中 / 空数据 / 错误态与手机端答题体验。
   ============================================================ */
:root {
  /* 品牌色板 · 金融蓝白 */
  --brand: #164A9F;
  --brand-2: #2563EB;
  --brand-dark: #0F3A7E;
  --brand-soft: #EAF1FE;
  --brand-softer: #F4F8FF;
  --ink: #172B4D;
  --ink-2: #33445F;
  --muted: #64748B;
  --line: #E4EAF2;
  --line-2: #EEF3F9;
  --bg: #F5F7FB;
  --card: #FFFFFF;
  --ok: #0F7A55;
  --ok-soft: #E7F6EE;
  --warn: #A96508;
  --warn-soft: #FFF4E2;
  --danger: #C93B38;
  --danger-soft: #FDECEB;
  /* 形状 / 层次 */
  --radius: 14px;
  --radius-lg: 16px;
  --radius-btn: 9px;
  --shadow: 0 1px 2px rgba(18, 46, 88, .04), 0 6px 20px rgba(18, 46, 88, .05);
  --shadow-lg: 0 14px 36px rgba(18, 46, 88, .11);
  --maxw: 1320px;
  /* 8px 倍数间距系统 */
  --sp-1: 8px; --sp-2: 16px; --sp-3: 24px; --sp-4: 32px; --sp-5: 40px; --sp-6: 48px;
  --t: 180ms cubic-bezier(.4, 0, .2, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.68;
  letter-spacing: .1px;
  color: var(--ink);
  background: var(--bg);
}
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.2px; }
a { font-weight: 500; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
::selection { background: #D3E3FF; color: var(--ink); }
.container { max-width: var(--maxw); padding: 0 var(--sp-3); }
#view { padding: var(--sp-3) 0 var(--sp-5); }

/* ---------- 按钮统一 ---------- */
.btn {
  font-family: var(--font); font-weight: 550; font-size: 14px;
  border-radius: 9px; padding: 9px 18px; letter-spacing: .1px;
  box-shadow: 0 1px 2px rgba(18, 46, 88, .06);
}
.btn:hover:not(:disabled) { transform: none; box-shadow: 0 3px 10px rgba(21, 82, 179, .16); }
.btn-primary { background: var(--brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-outline { border-color: #c7d8f2; }
.btn-ghost { border-color: var(--line); }
.btn-sm { font-size: 13px; padding: 6px 13px; border-radius: 8px; }
.btn-lg { padding: 12px 26px; font-size: 15px; }
.input, .select, .textarea {
  border-radius: 9px; border-color: #d8e1ef; font-family: var(--font);
  font-size: 14.5px; padding: 11px 13px;
}
.input:focus, .select:focus, .textarea:focus { box-shadow: 0 0 0 3px rgba(21, 82, 179, .12); }
.card { border-radius: var(--radius); box-shadow: var(--shadow); border-color: var(--line); }

/* ---------- 顶栏 ---------- */
.topbar {
  height: 68px; background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(23, 43, 77, .03);
}
.topbar-inner { max-width: var(--maxw); gap: var(--sp-4); padding: 0 var(--sp-3); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); flex: none; }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(140deg, #164A9F, #2563EB); color: #fff;
  box-shadow: 0 3px 10px rgba(22, 74, 159, .22); flex: none;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text {
  display: flex; flex-direction: column; font-size: 16.5px; font-weight: 700;
  letter-spacing: -.3px; line-height: 1.15; color: var(--ink);
}
.brand-text small {
  display: block; font-size: 9.5px; font-weight: 600; color: var(--muted);
  letter-spacing: 1.8px; margin-top: 3px;
}
.nav { display: flex; align-items: center; gap: 2px; flex: 1; height: 100%; }
.nav-link {
  position: relative; display: inline-flex; align-items: center; height: 100%;
  padding: 0 17px; font-size: 14px; font-weight: 500; color: var(--ink-2);
  border-radius: 0; white-space: nowrap; transition: color var(--t);
}
.nav-link:hover { color: var(--brand); background: transparent; }
.nav-link::after {
  content: ""; position: absolute; left: 17px; right: 17px; bottom: 0; height: 2px;
  background: var(--brand); border-radius: 2px 2px 0 0;
  opacity: 0; transform: scaleX(.55); transition: opacity var(--t), transform var(--t);
}
.nav-link.active { color: var(--brand); font-weight: 600; }
.nav-link.active::after { opacity: 1; transform: none; }
.top-right { display: flex; align-items: center; gap: 10px; flex: none; }
.user-chip {
  display: inline-flex; align-items: center; gap: 9px; padding: 4px 11px 4px 4px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
.user-chip .avatar {
  width: 30px; height: 30px; font-size: 13px; flex: none;
  background: var(--brand); color: #fff;
}
.user-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.role-badge {
  font-size: 10.5px; font-weight: 600; color: var(--brand);
  background: var(--brand-soft); border-radius: 5px; padding: 2px 7px; white-space: nowrap;
}
.admin-shortcut {
  font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap;
  padding: 6px 4px; transition: color var(--t);
}
.admin-shortcut:hover { color: var(--brand); }
.logout-btn { gap: 6px; }
.logout-btn svg { flex: none; }
/* 移动端折叠菜单 */
.nav-toggle {
  display: none; align-items: center; justify-content: center; margin-left: auto;
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-btn);
  background: #fff; color: var(--ink-2); cursor: pointer; transition: background var(--t);
}
.nav-toggle:hover { background: var(--brand-softer); }
.mobile-nav {
  display: none; position: absolute; top: 68px; left: 0; right: 0; z-index: 59;
  background: #fff; border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(23, 43, 77, .10); padding: 8px 16px 14px;
}
.topbar.nav-open .mobile-nav { display: block; }
.mobile-nav a, .mobile-nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px;
  padding: 10px 12px; border: none; border-radius: var(--radius-btn);
  background: transparent; color: var(--ink-2); font-family: var(--font);
  font-size: 14.5px; font-weight: 500; text-align: left; cursor: pointer;
  transition: background var(--t), color var(--t);
}
.mobile-nav a:hover, .mobile-nav a.on, .mobile-nav button:hover { background: var(--brand-soft); color: var(--brand); }
.mobile-nav svg { flex: none; opacity: .7; }
.mobile-nav .mn-sep { height: 1px; background: var(--line-2); margin: 8px 0; }
.mobile-nav .mn-user { font-size: 12.5px; color: var(--muted); padding: 6px 12px; }
.section-title { font-size: 22px; }
.section-sub { font-size: 14px; margin-bottom: 22px; }

/* ---------- 首页 Banner ---------- */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--sp-4); align-items: center;
  padding: var(--sp-4) var(--sp-5); border-radius: var(--radius-lg);
  background: linear-gradient(108deg, #0E3378 0%, #164A9F 52%, #1D58BE 100%);
  box-shadow: 0 12px 32px rgba(15, 58, 126, .15);
}
.hero::after {
  content: ""; position: absolute; right: -130px; top: -170px;
  width: 420px; height: 420px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 0 0 60px rgba(255, 255, 255, .022), 0 0 0 130px rgba(255, 255, 255, .016);
  pointer-events: none;
}
.hero-main { position: relative; z-index: 1; min-width: 0; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; letter-spacing: 1.4px; font-weight: 600;
  padding: 5px 12px; border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px; color: rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .08); margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(26px, 2.5vw, 34px); line-height: 1.3;
  letter-spacing: -.6px; margin-bottom: 12px; color: #fff;
}
.hero-sub {
  max-width: 580px; font-size: 14.5px; line-height: 1.8;
  color: rgba(255, 255, 255, .82); margin-bottom: 26px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 11px 22px; border-radius: var(--radius-btn);
  font-family: var(--font); font-size: 14.5px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: background var(--t), color var(--t), transform var(--t), box-shadow var(--t);
}
.hero-btn svg { flex: none; }
.hero-btn-primary { background: #fff; color: var(--brand); box-shadow: 0 4px 14px rgba(6, 26, 63, .12); }
.hero-btn-primary:hover { background: #EFF5FF; color: var(--brand); transform: translateY(-1px); }
.hero-btn-primary:active { transform: none; }
.hero-btn-secondary { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .42); }
.hero-btn-secondary:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.hero-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* Banner 右侧：真实题库统计 + 抽象装饰（装饰不承载数据含义） */
.hero-visual {
  position: relative; z-index: 1; min-width: 0;
  background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .20);
  border-radius: var(--radius); padding: 20px 22px 16px;
}
.hv-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.hv-head span { font-size: 10.5px; font-weight: 600; letter-spacing: 1.2px; color: rgba(255, 255, 255, .76); }
.hv-head svg { opacity: .55; }
.hv-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hv-stat {
  text-align: center; padding: 12px 4px; border-radius: 10px;
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .10);
}
.hv-stat b {
  display: block; font-size: 25px; font-weight: 650; color: #fff;
  line-height: 1.2; font-variant-numeric: tabular-nums;
}
.hv-stat span { display: block; font-size: 11.5px; color: rgba(255, 255, 255, .76); margin-top: 4px; white-space: nowrap; }
.hv-deco { margin-top: 16px; height: 32px; opacity: .6; }
.hv-deco svg { display: block; width: 100%; height: 100%; }
.hv-note { font-size: 10.5px; color: rgba(255, 255, 255, .6); margin-top: 8px; text-align: center; }

/* ---------- 学习概览 ---------- */
.overview { margin-top: var(--sp-3); }
.ov-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ov-head h2 { font-size: 17px; }
.ov-head .ov-hint { font-size: 12.5px; color: var(--muted); }
.ov-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); }
.ov-card {
  display: flex; align-items: center; gap: 14px; min-width: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
}
.ov-ico {
  flex: none; width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand);
}
.ov-ico.warn { background: var(--warn-soft); color: var(--warn); }
.ov-ico.ok { background: var(--ok-soft); color: var(--ok); }
.ov-ico.danger { background: var(--danger-soft); color: var(--danger); }
.ov-body { min-width: 0; }
.ov-num {
  font-size: 22px; font-weight: 650; line-height: 1.25; color: var(--ink);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ov-num.is-text {
  font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis;
}
.ov-label { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-guest {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 12px; padding: 13px 18px; border-radius: var(--radius);
  background: var(--brand-softer); border: 1px dashed #CFDDF5;
  font-size: 13px; color: var(--ink-2);
}
.resume-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 12px; padding: 14px 18px; border-radius: var(--radius);
  background: linear-gradient(100deg, #EAF1FE, #F7FAFF); border: 1px solid #D6E4FA;
}
.rb-ico {
  flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: #fff; color: var(--brand); border: 1px solid #DCE8FA;
}
.rb-txt { flex: 1; min-width: 0; }
.rb-txt b { display: block; font-size: 14px; color: var(--ink); }
.rb-txt span {
  display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 加载骨架：与真实卡片等高，避免布局抖动 */
.ov-card.sk { border-color: var(--line-2); box-shadow: none; }
.sk-ico { flex: none; width: 40px; height: 40px; border-radius: 11px; background: var(--line-2); }
.sk-line { height: 13px; width: 62%; border-radius: 6px; background: var(--line-2); margin: 3px 0; }
.sk-line.short { height: 10px; width: 42%; margin-top: 8px; }

/* ---------- 考试分类卡片 ---------- */
.home-section { margin-top: var(--sp-4); }
#catSection { scroll-margin-top: 88px; }
.home-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: var(--sp-2); }
.home-head h2 { font-size: 20px; }
.home-head p { color: var(--muted); font-size: 13.5px; margin-top: 5px; }
.home-head .hh-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); align-items: stretch; }
/* 首页一屏：四卡一行 + 紧凑间距，宽屏无需下拉 */
.home-onepage .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-onepage .home-section { margin-top: 8px; }
.home-onepage .home-head { margin-bottom: 12px; align-items: center; }
.home-onepage .home-head h2 { font-size: 21px; }
.home-onepage .home-head p { font-size: 14px; margin-top: 5px; }
.home-onepage .cat-card { min-height: 0; padding: 22px 18px 18px; }
.home-onepage .cat-icon { width: 46px; height: 46px; border-radius: 12px; margin-bottom: 14px; }
.home-onepage .cat-icon svg { width: 23px; height: 23px; }
.home-onepage .cat-card h3 { font-size: 19px; margin-bottom: 8px; }
.home-onepage .cat-card p { font-size: 14px; line-height: 1.65; min-height: 0; margin-bottom: 20px; }
.home-onepage .cat-cta { min-height: 42px; padding: 10px 14px; font-size: 14.5px; }
.cat-card {
  display: flex; flex-direction: column; min-width: 0; min-height: 240px;
  padding: 22px 22px 20px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #f8fbff 0%, #eef5ff 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.cat-card:hover { color: var(--ink); transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #AFC9F1; }
.cat-card:active { transform: translateY(-1px); }
.cat-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--brand-2); opacity: 0; transition: opacity var(--t);
}
.cat-card:hover::before { opacity: 1; }
.cat-icon {
  flex: none; width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand);
  margin-bottom: 16px;
}
.cat-card h3 {
  font-size: 17px; margin-bottom: 6px; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cat-card p {
  color: var(--muted); font-size: 13px; line-height: 1.65; margin-bottom: 16px;
  min-height: 42px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.cat-metrics {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  padding-top: 14px; border-top: 1px solid var(--line-2); margin-bottom: 16px;
}
.cat-metric { display: flex; align-items: baseline; gap: 5px; min-width: 0; font-size: 12px; color: var(--muted); }
.cat-metric b { font-size: 17px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; flex: none; }
.cat-metric span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-cta {
  margin-top: auto; display: inline-flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 40px; padding: 9px 14px; border-radius: var(--radius-btn);
  background: var(--brand-soft); color: var(--brand); border: 1px solid #D8E6FC;
  font-size: 13.5px; font-weight: 600;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.cat-cta svg { flex: none; }
.cat-card:hover .cat-cta { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat-card:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 3px; }
.cat-grid > .state-block, .subject-grid > .state-block, .paper-grid > .state-block { grid-column: 1 / -1; }

/* ---------- 科目页 ---------- */
.subject-grid { gap: var(--sp-3); }
.subject-card { padding: 20px 22px; display: flex; align-items: center;
  justify-content: space-between; gap: 18px; transition: .18s; }
.subject-card:hover { border-color: #cbdcf5; box-shadow: var(--shadow-lg); }
.subject-card h3 { font-size: 16px; }
.subject-card p { font-size: 13.5px; color: var(--muted); margin: 4px 0 10px; }
.sc-badge { display: inline-block; font-size: 12px; color: var(--brand);
  background: var(--brand-soft); border-radius: 6px; padding: 3px 9px; font-weight: 500; }

/* ---------- 试卷列表：突出题量 / 满分 / 时长 ---------- */
.paper-grid { gap: var(--sp-3); }
.paper-card { padding: 22px 22px 20px; position: relative; transition: .18s; }
.paper-card:hover { border-color: #cbdcf5; box-shadow: var(--shadow-lg); }
.paper-top { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.paper-top h3 { font-size: 16.5px; flex: 1; min-width: 0; }
.paper-no { font-size: 12px; font-weight: 600; color: var(--brand);
  background: var(--brand-soft); border-radius: 6px; padding: 3px 8px; letter-spacing: .5px; }
.status-badge { font-size: 11.5px; font-weight: 600; border-radius: 20px; padding: 3px 10px; white-space: nowrap; }
.st-not { background: var(--line-2); color: var(--muted); }
.st-ing { background: var(--warn-soft); color: var(--warn); }
.st-done { background: var(--ok-soft); color: var(--ok); }
.paper-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line-2); border: 1px solid var(--line-2);
  border-radius: 10px; overflow: hidden; margin-bottom: 14px;
}
.paper-meta > div { background: #fbfdff; padding: 13px 8px; text-align: center;
  font-size: 11.5px; color: var(--muted); }
.paper-meta b { display: block; color: var(--ink); font-size: 21px; font-weight: 600;
  line-height: 1.35; letter-spacing: -.3px; }
.paper-best { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.paper-best b { color: var(--brand); font-size: 15px; }
.paper-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.paper-actions .btn { flex: 1; min-width: 120px; }

/* ---------- 答题页：题干与选项优先 ---------- */
.exam-wrap { max-width: 1240px; }
.exam-head { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 18px; margin-bottom: 16px; }
.exam-head h2 { font-size: 19px; }
.exam-head .sub { font-size: 13px; color: var(--muted); margin-top: 5px; }
.exam-tools { display: flex; align-items: center; gap: 10px; }
.timer {
  display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums;
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 13px; font-size: 15px; font-weight: 600; color: var(--brand);
  box-shadow: var(--shadow); white-space: nowrap;
}
.timer .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.progress-line { height: 4px; background: var(--line); border-radius: 4px;
  overflow: hidden; margin-bottom: 18px; }
.progress-line i { display: block; height: 100%; background: var(--brand);
  border-radius: 4px; transition: width .22s; }
.exam-grid { gap: var(--sp-3); align-items: start; }
.q-card { padding: 28px 30px 24px; min-height: 420px; }
.q-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 16px; border-bottom: 1px solid var(--line-2); margin-bottom: 22px; }
.q-no { font-size: 14.5px; font-weight: 600; }
.q-type, .q-score { font-size: 12px; font-weight: 500; border-radius: 6px; padding: 3px 10px; }
.q-type { background: var(--brand-soft); color: var(--brand); }
.q-score { background: var(--line-2); color: var(--ink-2); }
.q-stem {
  font-size: 18.5px; line-height: 1.85; font-weight: 500; color: var(--ink);
  margin-bottom: 24px; white-space: pre-wrap; word-break: break-word;
}
.q-options { display: grid; gap: 11px; }
.opt {
  display: flex; align-items: flex-start; gap: 13px; width: 100%; text-align: left;
  background: #fff; border: 1.5px solid var(--line); border-radius: 11px;
  padding: 14px 16px; font-size: 15px; line-height: 1.65; color: var(--ink-2);
  cursor: pointer; transition: .14s; font-family: var(--font);
}
.opt:hover { border-color: #a9c5ee; background: var(--brand-softer); }
.opt .opt-key {
  flex: none; width: 27px; height: 27px; border-radius: 7px; display: grid; place-items: center;
  background: var(--line-2); color: var(--ink-2); font-size: 13px; font-weight: 600;
  transition: .14s;
}
.opt.selected { border-color: var(--brand); background: var(--brand-softer); color: var(--ink); }
.opt.selected .opt-key { background: var(--brand); color: #fff; }
.opt.multi .opt-key { border-radius: 7px; }
.q-nav { display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.q-nav .tip { font-size: 12.5px; color: var(--muted); }
.q-nav-right { display: flex; gap: 9px; }

.side-card { padding: 20px; position: sticky; top: 82px; }
.side-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.side-title h3 { font-size: 15px; }
.card-stat { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted);
  padding: 10px 0 14px; border-bottom: 1px solid var(--line-2); margin-bottom: 14px; }
.card-stat b { font-size: 15px; font-weight: 600; }
.s-done b { color: var(--ok); } .s-left b { color: var(--warn); }
.card-grid { gap: 8px; }
.card-cell {
  aspect-ratio: 1 / 1; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink-2); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: .12s; font-family: var(--font);
}
.card-cell:hover { border-color: var(--brand); }
.card-cell.done { background: var(--brand-soft); border-color: #c3d9f7; color: var(--brand); font-weight: 600; }
.card-cell.current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.card-legend { gap: 14px; font-size: 12px; color: var(--muted); margin: 14px 0; }
.card-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; }
.lg-done { background: var(--brand-soft); border: 1px solid #c3d9f7; }
.lg-todo { background: #fff; border: 1px solid var(--line); }
.lg-cur { background: var(--brand); }
.btn-submit { padding: 11px; font-size: 15px; }

/* ---------- 交卷 / 成绩 ---------- */
.submit-stats { gap: 10px; }
.submit-stats > div { background: #f7faff; border: 1px solid var(--line-2);
  border-radius: 10px; padding: 14px 8px; text-align: center; }
.submit-stats b { display: block; font-size: 24px; font-weight: 600; line-height: 1.3; }
.submit-stats span { font-size: 12px; color: var(--muted); }
.submit-alert { border-radius: 9px; font-size: 13px; line-height: 1.7; }
.result-hero { padding: 34px; text-align: center; }
.rh-label { font-size: 14px; color: var(--muted); }
.result-score { font-size: 52px; font-weight: 600; letter-spacing: -1.5px;
  color: var(--brand); line-height: 1.25; margin: 10px 0; }
.result-score small { font-size: 18px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.result-verdict { display: inline-block; font-size: 12.5px; font-weight: 600;
  border-radius: 20px; padding: 4px 14px; }
.v-pass { background: var(--ok-soft); color: var(--ok); }
.v-fail { background: var(--danger-soft); color: var(--danger); }
.result-meta { font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.stat-grid { gap: var(--sp-3); margin: var(--sp-4) 0; }
.stat-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 10px; text-align: center; box-shadow: var(--shadow); }
.stat-box b { display: block; font-size: 24px; font-weight: 600; line-height: 1.35; }
.stat-box span { font-size: 12.5px; color: var(--muted); }
.stat-box.ok b { color: var(--ok); } .stat-box.bad b { color: var(--danger); }
.stat-box.blue b { color: var(--brand); }
.result-actions { padding: 18px; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- 错题本：按科目筛选 ---------- */
.wrong-filter {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.wf-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 11px; }
.wf-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.wf-chip {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: #f8faff; color: var(--ink-2); font-size: 13px; font-weight: 500;
  transition: background var(--t), border-color var(--t), color var(--t);
}
.wf-chip:hover { background: var(--brand-soft); border-color: #cfe0ff; color: var(--brand); }
.wf-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.wf-chip span {
  display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: rgba(27, 71, 145, .09); color: var(--muted);
  font-size: 11px; font-variant-numeric: tabular-nums;
}
.wf-chip.on span { background: rgba(255, 255, 255, .22); color: #fff; }

/* ---------- 解析 ---------- */
.filter-bar { gap: 8px; margin-bottom: 18px; }
.filter-btn { font-family: var(--font); font-size: 13px; font-weight: 500;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 8px; padding: 8px 15px; cursor: pointer; }
.filter-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.review-item { padding: 22px 24px; margin-bottom: 14px; }
.rev-stem { font-size: 16px; line-height: 1.8; font-weight: 500; margin: 14px 0; white-space: pre-wrap; }
.rev-opt { border-radius: 9px; padding: 10px 13px; }
.rev-analysis { border-radius: 9px; line-height: 1.8; }

/* ---------- 统一状态：加载中 / 空 / 错误 ---------- */
.state-block {
  min-height: 240px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; text-align: center; padding: 36px 20px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--muted); font-size: 14px;
}
.state-block p { margin: 0; }
.state-block h3 { font-size: 17px; color: var(--ink); margin: 0; }
.state-block .btn-row { justify-content: center; margin-top: 6px; }
.state-block .spinner { width: 26px; height: 26px; }
.empty-icon {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 20px; font-weight: 600;
}
.error-state .empty-icon { background: var(--danger-soft); color: var(--danger); }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1fr) 300px; padding: var(--sp-4); }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: var(--sp-3); }
  .hv-deco { display: none; }
  .hero-visual { padding: 16px 18px 14px; }
}
@media (max-width: 760px) {
  .container { padding: 0 var(--sp-2); }
  #view { padding: var(--sp-2) 0 90px; }
  /* 顶栏折叠菜单 */
  .topbar { height: 60px; }
  .topbar-inner { padding: 0 var(--sp-2); gap: 12px; }
  .brand-text { display: flex; font-size: 15px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-mark svg { width: 20px; height: 20px; }
  .nav, .top-right { display: none; }
  .nav-toggle { display: inline-flex; }
  .mobile-nav { top: 60px; }
  /* Banner */
  .hero { padding: 26px 20px; border-radius: 14px; gap: 20px; }
  .hero h1 { font-size: 24px; }
  .hero .hero-sub { font-size: 13.5px; margin-bottom: 20px; }
  .hero-tag { margin-bottom: 14px; font-size: 10px; }
  .hero-actions { gap: 10px; }
  .hero-btn { flex: 1 1 auto; min-width: 145px; padding: 11px 16px; }
  .hero-visual { padding: 13px 14px 12px; }
  .hv-head { margin-bottom: 10px; }
  .hv-stat { padding: 9px 3px; }
  .hv-stat b { font-size: 21px; }
  .hv-stat span { font-size: 10.5px; }
  .hv-note { display: none; }
  /* 概览 / 分类 / 流程 */
  .overview { margin-top: var(--sp-2); }
  .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ov-card { padding: 13px 14px; gap: 10px; }
  .ov-ico, .sk-ico { width: 36px; height: 36px; }
  .ov-num { font-size: 19px; }
  .ov-num.is-text { font-size: 12.5px; }
  .ov-guest, .resume-bar { padding: 12px 14px; }
  .cat-grid, .subject-grid, .paper-grid { grid-template-columns: 1fr; gap: 12px; }
  .home-onepage .cat-grid { grid-template-columns: 1fr; }
  .cat-card { min-height: 0; }
  .cat-card p { min-height: 0; }
  .home-section { margin-top: var(--sp-3); }
  /* 其余页面原有手机端规则 */
  .subject-card { flex-direction: column; align-items: stretch; gap: 14px; }
  .subject-card .btn { width: 100%; }
  .exam-head { flex-direction: column; gap: 10px; }
  .exam-tools { width: 100%; justify-content: space-between; }
  .q-card { padding: 20px 17px; min-height: 0; border-radius: 12px; }
  .q-stem { font-size: 17px; line-height: 1.75; margin-bottom: 18px; }
  .opt { padding: 12px 13px; font-size: 14.5px; gap: 10px; }
  .q-nav { flex-direction: column; align-items: stretch; }
  .q-nav .tip { text-align: center; }
  .q-nav-right .btn { flex: 1; }
  .side-card { display: none; }
  .exam-grid { grid-template-columns: 1fr; }
  .mobile-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .98); border-top: 1px solid var(--line);
    box-shadow: 0 -4px 18px rgba(18, 46, 88, .08);
  }
  .mobile-bar .btn { flex: 1; padding: 11px 6px; font-size: 13.5px; }
  .drawer-mask.show { display: block; }
  .drawer { max-height: 82vh; overflow-y: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .result-hero { padding: 26px 16px; }
  .result-score { font-size: 42px; }
  .result-actions .btn { flex: 1 1 44%; }
  .review-item { padding: 18px 15px; }
  .filter-bar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .filter-btn { white-space: nowrap; }
  .paper-meta b { font-size: 19px; }
}
@media (max-width: 400px) {
  .cat-grid { grid-template-columns: 1fr; }
  .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hv-stat b { font-size: 20px; }
  .hero-btn { min-width: 0; flex: 1 1 calc(50% - 5px); padding: 11px 10px; font-size: 13.5px; }
  .card-grid, .drawer .card-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 360px) {
  .hero-btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ===== 整改新增：账号安全 / 密码规则 / 保存状态 ===== */
.account-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: linear-gradient(105deg, #eef4ff, #f8fbff); border: 1px solid #dbe7fb;
  border-radius: 14px; padding: 16px 20px; margin: 4px 0 26px; flex-wrap: wrap;
}
.account-bar-left { display: flex; align-items: center; gap: 13px; }
.account-bar-left b { display: block; font-size: 15.5px; color: var(--ink); }
.account-bar-left .lr-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px;
}
.avatar-lg { width: 44px; height: 44px; font-size: 18px; }

.pwd-rule {
  margin-top: 8px; font-size: 12.5px; line-height: 1.7; color: var(--muted);
  background: #f5f8fe; border-left: 3px solid var(--brand); border-radius: 0 7px 7px 0;
  padding: 8px 12px;
}
.auth-msg { margin-top: 14px; border-radius: 9px; font-size: 13.5px; line-height: 1.7; }
.auth-msg.err-msg { padding: 11px 14px; }

/* 答题页自动保存状态指示 */
.save-state {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px;
  color: var(--muted); white-space: nowrap;
}
.save-state::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: #b9c6da; flex: none;
}
.save-state.saving { color: var(--brand); }
.save-state.saving::before { background: var(--brand); animation: savePulse 1s infinite; }
.save-state.saved { color: var(--ok); }
.save-state.saved::before { background: var(--ok); }
.save-state.err { color: var(--danger); }
.save-state.err::before { background: var(--danger); }
@keyframes savePulse { 50% { opacity: .35; } }

.err-msg, .ok-msg {
  border-radius: 9px; font-size: 14px; line-height: 1.7; font-weight: 600;
}
.err-msg { background: var(--danger-soft); color: #a62e2c; padding: 12px 14px; }
.ok-msg { background: var(--ok-soft); color: var(--ok); padding: 12px 14px; }
.state-block .empty-icon { font-size: 34px; color: #b9c8de; margin-bottom: 8px; }
.state-block h3 { font-size: 16px; margin: 6px 0; }
.state-block p { color: var(--muted); font-size: 13.5px; }

@media (max-width: 640px) {
  .account-bar { padding: 14px 15px; margin-bottom: 20px; }
  .account-bar .btn { width: 100%; }
  .save-state { font-size: 12px; }
}

/* ===== 首页 UI 升级：图标尺寸 / 键盘焦点 / 触屏反馈 ===== */
.state-block .empty-icon svg { width: 24px; height: 24px; }
.btn:focus-visible, .nav-link:focus-visible, .nav-toggle:focus-visible,
.mobile-nav a:focus-visible, .mobile-nav button:focus-visible,
.filter-btn:focus-visible, .card-cell:focus-visible {
  outline: 2px solid var(--brand-2); outline-offset: 2px;
}
.btn:active:not(:disabled) { transform: translateY(0); box-shadow: 0 1px 2px rgba(18, 46, 88, .06); }
.hero-btn:active { transform: translateY(1px); }
.cat-card:active .cat-cta { background: var(--brand-dark); color: #fff; }

/* ===== 科目授权 / 激活码（前台） ===== */
.tag { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 5px; font-weight: 600; white-space: nowrap; }
.tag-blue { background: var(--brand-soft); color: var(--brand); }
.tag-green { background: var(--ok-soft); color: var(--ok); }
.tag-orange { background: var(--warn-soft); color: var(--warn); }
.tag-red { background: var(--danger-soft); color: var(--danger); }
.btn-block { display: block; width: 100%; text-align: center; }

.access-notice {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border: 1px solid #F0DCAE; background: #FFFAF0; border-radius: 12px;
  padding: 14px 18px; margin-bottom: 18px;
}
.access-notice .an-ico {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; background: #FFF3D6; color: var(--warn);
}
.access-notice .an-text { flex: 1 1 260px; min-width: 0; }
.access-notice .an-text b { display: block; font-size: 14.5px; color: #8A5406; }
.access-notice .an-text span { display: block; font-size: 12.8px; color: #8C7346; margin-top: 2px; line-height: 1.6; }
.access-notice .btn { flex: none; }
.access-notice.is-ok { border-color: #CFE8DC; background: #F4FBF7; }
.access-notice.is-ok .an-ico { background: var(--ok-soft); color: var(--ok); }
.access-notice.is-ok .an-text b { color: #0F6B4C; }
.access-notice.is-ok .an-text span { color: #5B7D70; }

.account-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.act-grid { display: grid; grid-template-columns: minmax(0, 420px); justify-content: center; gap: 18px; align-items: start; }
.act-redeem, .act-summary { padding: 20px; }
.act-head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.act-ico {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand);
}
.act-head h3 { font-size: 16px; margin: 0 0 3px; }
.act-head p { font-size: 12.5px; color: var(--muted); margin: 0; }
.act-hint {
  display: flex; align-items: center; gap: 8px; font-size: 12.8px; color: var(--brand);
  background: var(--brand-softer); border: 1px solid #DCE8FA;
  border-radius: 9px; padding: 9px 12px; margin-bottom: 16px;
}
.code-input {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  letter-spacing: 1.2px; text-transform: uppercase;
}
.redeem-msg {
  display: flex; align-items: center; gap: 9px; font-size: 13.5px;
  border-radius: 9px; padding: 11px 14px; margin-top: 14px; line-height: 1.6;
}
.redeem-msg[hidden] { display: none; }
.redeem-msg.ok-msg { background: var(--ok-soft); color: var(--ok); }
.redeem-msg.err-msg { background: var(--danger-soft); color: var(--danger); }
.redeem-msg svg { flex: none; }
.act-summary h3 { font-size: 16px; margin: 0 0 16px; }
.act-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.act-stats > div { background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 14px 8px; text-align: center; }
.act-stats b { display: block; font-size: 24px; color: var(--brand); line-height: 1.3; font-variant-numeric: tabular-nums; }
.act-stats span { font-size: 11.8px; color: var(--muted); }
.act-note {
  font-size: 12.8px; color: var(--muted); line-height: 1.8; background: var(--bg);
  border-radius: 9px; padding: 12px 14px; margin-bottom: 16px;
}
.act-list-title { font-size: 17px; margin: 30px 0 14px; }
.act-list { padding: 6px 20px; }
.act-row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.act-row:last-child { border-bottom: 0; }
.act-row-ico { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }
.act-row-ico.is-ok { background: var(--ok-soft); color: var(--ok); }
.act-row-ico.is-off { background: var(--warn-soft); color: var(--warn); }
.act-row-main { flex: 1 1 220px; min-width: 0; }
.act-row-main b { display: block; font-size: 14.5px; }
.act-row-main span { display: block; font-size: 12.3px; color: var(--muted); margin-top: 3px; }
.act-row-exp { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 120px; }
.act-row-exp .lr-sub { font-size: 11.5px; }
.act-row .btn { flex: none; }

@media (max-width: 760px) {
  .act-grid { grid-template-columns: 1fr; }
  .act-redeem, .act-summary { padding: 18px 16px; }
  .access-notice { padding: 13px 14px; }
  .access-notice .btn { width: 100%; }
  .account-bar-actions { width: 100%; }
  .account-bar-actions .btn { flex: 1 1 auto; }
  .act-row-exp { min-width: 0; }
  .act-list { padding: 4px 15px; }
}

/* ==================== 答题页：显示答案与解析 ==================== */
.reveal-box {
  margin-top: 16px; background: #F5F8FC; border: 1px solid var(--line);
  border-radius: var(--radius-btn); padding: 13px 16px;
  font-size: 13.5px; line-height: 1.7;
}
@keyframes rvIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.reveal-box { animation: rvIn .18s ease; }
.reveal-box .rv-row { display: flex; gap: 10px; }
.reveal-box .rv-row + .rv-row { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line-2); }
.reveal-box .rv-label { flex: none; color: var(--muted); font-size: 12.5px; padding-top: 2px; }
.reveal-box .rv-ans { color: var(--brand); font-size: 15.5px; letter-spacing: 2px; }
.reveal-box .rv-ana { flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-word; }
.reveal-box .rv-none { color: var(--muted); }

/* ==================== 答题页：试卷式布局（顶栏 + 题目列表 + 大题说明） ==================== */
.view-exam { padding: 0 0 30px !important; }
.exam-page { max-width: 1560px; margin: 0 auto; }

/* 顶部试卷条 */
.ex-top {
  position: sticky; top: 64px; z-index: 55;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin: 0 0 16px; padding: 11px 24px;
  background: linear-gradient(96deg, #164A9F 0%, #2563EB 100%);
  color: #fff; box-shadow: 0 3px 14px rgba(16, 42, 96, .18);
}
.ex-top-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ex-subject { font-size: 15px; font-weight: 700; white-space: nowrap; }
.ex-subject::after {
  content: ''; display: inline-block; width: 1px; height: 14px; margin-left: 12px;
  background: rgba(255, 255, 255, .45); vertical-align: -2px;
}
.ex-ver { font-size: 13.5px; color: rgba(255, 255, 255, .9); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.ex-top-r { display: flex; align-items: center; gap: 14px; flex: none; }
.ex-count { font-size: 12.5px; color: rgba(255, 255, 255, .86); font-variant-numeric: tabular-nums; }
.ex-count b { font-size: 15px; color: #fff; }
.ex-clock {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  color: rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .14);
  border-radius: 20px; padding: 4px 12px; font-variant-numeric: tabular-nums;
}
.ex-clock i { width: 6px; height: 6px; border-radius: 50%; background: #7CF3B4; }
.ex-clock b { color: #fff; font-size: 14px; letter-spacing: .5px; }
.ex-clock.is-soon { background: rgba(255, 196, 87, .22); }
.ex-clock.is-soon i { background: #FFC457; }
.ex-clock.is-over i { background: #FF8F8F; }
.ex-top .save-state { color: rgba(255, 255, 255, .78); font-size: 11.5px; }
.ex-top .save-state.saving, .ex-top .save-state.ok, .ex-top .save-state.err { color: #fff; }
.ex-submit {
  border: 0; cursor: pointer; border-radius: 6px; padding: 7px 17px;
  background: #fff; color: var(--brand); font-weight: 700; font-size: 13.5px;
  font-family: inherit; transition: .15s;
}
.ex-submit:hover { background: #EDF3FF; }
.ex-back { color: rgba(255, 255, 255, .85); font-size: 12.5px; }
.ex-back:hover { color: #fff; }
.ex-progress {
  position: absolute; left: 0; bottom: 0; height: 3px; background: #FFC457;
  transition: width .25s; display: block;
}

/* 主体两栏 */
.ex-body { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 18px; align-items: start; padding: 0 20px; }

/* 左：题目列表 */
.ex-side {
  position: sticky; top: 132px; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  height: calc(100vh - 152px); overflow: hidden;
  box-shadow: 0 1px 3px rgba(20, 40, 80, .04);
}
.ex-side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line-2); flex: none;
}
.ex-side-head h3 { font-size: 14.5px; display: flex; align-items: center; gap: 7px; }
.ex-side-head h3::before {
  content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--brand);
}
.ex-side-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ex-side-scroll {
  flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 14px;
  scrollbar-width: thin; scrollbar-color: #c8d6ea transparent;
}
.ex-side-scroll::-webkit-scrollbar { width: 6px; }
.ex-side-scroll::-webkit-scrollbar-thumb { background: #cfdaeb; border-radius: 3px; }
.ex-side-scroll::-webkit-scrollbar-track { background: transparent; }
.ex-groups { display: flex; flex-direction: column; gap: 15px; }
.cl-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-size: 12.3px; font-weight: 650; color: var(--ink-2); margin-bottom: 7px;
}
.cl-title em { font-style: normal; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.cl-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.ex-side .card-cell, .drawer .card-cell { border-radius: 5px; font-size: 12.5px; }
.ex-side-foot {
  flex: none; margin-top: auto; padding: 11px 16px 14px; border-top: 1px solid var(--line-2); background: #FCFDFF;
}
.ex-side-foot .card-stat { margin-bottom: 10px; }
.ex-side-tip { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 8px; line-height: 1.6; }

/* 右：题目主体 */
.ex-main { min-width: 0; }
.q-card { padding: 0; overflow: hidden; min-height: 0; }

.sec-bar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  padding: 14px 24px 15px; background: #F6F9FF;
  border-bottom: 1px solid var(--line-2);
}
.sec-text { min-width: 0; }
.sec-title { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.sec-range { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 9px; }
.sec-intro { font-size: 12.5px; color: var(--muted); line-height: 1.75; margin-top: 5px; }
.sec-ans { flex: none; }

.q-body { padding: 22px 26px 26px; }
.q-stem { font-size: 16.5px; line-height: 1.95; color: var(--ink); margin-bottom: 20px; white-space: pre-wrap; word-break: break-word; }
.q-num { color: var(--brand); font-weight: 700; margin-right: 7px; }
.q-score-inline { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.q-body .reveal-box { margin-top: 18px; }

.ex-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 14px; padding: 11px 16px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px;
  position: sticky; bottom: 10px; box-shadow: 0 3px 14px rgba(20, 40, 80, .06);
}
.ex-tip { font-size: 12.5px; color: var(--muted); }
.ex-foot-r { display: flex; gap: 10px; }

@media (max-width: 1180px) {
  .ex-body { grid-template-columns: 236px minmax(0, 1fr); gap: 14px; }
  .ex-side .cl-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 900px) {
  .view-exam { padding-bottom: 92px !important; }
  .ex-top { top: 56px; margin: 0 0 12px; padding: 9px 14px; flex-wrap: wrap; gap: 8px; }
  .ex-body { display: block; padding: 0 14px; }
  .ex-top-l { flex: 1 1 100%; }
  .ex-ver { font-size: 12.5px; }
  .ex-top-r { width: 100%; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
  .ex-top .save-state { display: none; }
  .ex-side { display: none; }
  .ex-foot { display: none; }
  .q-body { padding: 17px 16px 20px; }
  .sec-bar { padding: 12px 16px; flex-direction: column; gap: 9px; }
  .sec-ans { align-self: flex-end; }
  .q-stem { font-size: 16px; }
  .drawer .ex-groups { max-height: 44vh; overflow-y: auto; }
  .drawer .cl-grid { grid-template-columns: repeat(6, 1fr); }
}

/* 手机版：站点顶栏 + 试卷条双层固定，滚动题目时始终停在顶部 */
@media (max-width: 760px) {
  body.in-exam-page #view.view-exam { padding-top: 60px !important; }
  body.in-exam-page .topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  }
  .view-exam .ex-top {
    position: fixed; top: 60px; left: 0; right: 0; z-index: 85;
    margin: 0; padding: 9px 14px;
    box-shadow: 0 4px 16px rgba(16, 42, 96, .22);
  }
  .view-exam .exam-page { padding-top: var(--ex-top-h, 128px); }
}

/* ==================== 答题页：练习模式判题 + 保存状态 ==================== */
.ex-top .save-state.saving { color: #FFD666; }
.ex-top .save-state.ok { color: #7CF3B4; }
.ex-top .save-state.err { color: #FFA1A1; font-weight: 600; }

.opt.locked { cursor: default; }
.opt.locked:not(.selected) { opacity: .66; }
.opt.locked:hover { border-color: var(--line); background: #fff; }
.opt.locked.selected:hover { border-color: var(--brand); background: var(--brand-soft); }

.chk-zone { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.chk-tip { font-size: 12.5px; color: var(--muted); }
.chk-zone .btn.is-on { opacity: 1; cursor: default; background: var(--ok-soft); border-color: #b6ddc9; color: var(--ok); }

.chk-box { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.chk-box.ok { border-color: #b7e3cd; background: #F4FBF7; }
.chk-box.bad { border-color: #f5c2c0; background: #FFFAFA; }
.chk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 11px 16px; font-size: 13.5px; }
.chk-head b { font-size: 14px; }
.chk-box.ok .chk-head b { color: var(--ok); }
.chk-box.bad .chk-head b { color: var(--danger); }
.chk-head span { color: var(--ink-2); font-size: 12.5px; }
.chk-head em { font-style: normal; font-weight: 700; color: var(--brand); letter-spacing: .6px; }
.chk-part { margin-left: auto; background: #FFF3D6; color: #AD6800; border-radius: 4px; padding: 2px 9px; font-size: 12px; }
.chk-body { padding: 0 16px 13px; }
.chk-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.chk-text { font-size: 13.5px; line-height: 1.85; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.chk-foot { padding: 7px 16px; background: rgba(20, 40, 80, .025); font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); }

.card-cell.is-right { background: #E8F8EE; border-color: #9FD8B6; color: #15803D; }
.card-cell.is-right.current { box-shadow: 0 0 0 2px #34A853 inset; }
.card-cell.is-wrong { background: #FDECEC; border-color: #F2B8B5; color: #B42318; }
.card-cell.is-wrong.current { box-shadow: 0 0 0 2px #E05353 inset; }

.practice-btn { padding: 6px 11px; font-size: 12.5px; color: var(--brand); border-color: #cfe0ff; }
.practice-btn:hover { background: var(--brand-soft); }
.recite-btn { padding: 6px 11px; font-size: 12.5px; color: var(--ok); border-color: #bfe0cf; }
.recite-btn:hover { background: var(--ok-soft); }

@media (max-width: 900px) {
  .chk-head { padding: 10px 14px; }
  .chk-body { padding: 0 14px 12px; }
  .chk-part { margin-left: 0; }
}
