/* ===== 设计令牌 ===== */
:root {
  --ink:         #16212e;
  --ink-2:       #4a5b6e;
  --ink-3:       #7c8b9c;
  --line:        #e3e9f0;
  --line-2:      #eef2f7;
  --bg:          #f4f7fa;
  --card:        #ffffff;
  --brand:       #0f4c81;
  --brand-2:     #1668ad;
  --brand-soft:  #e8f1f9;
  --ok:          #1f7a5c;
  --ok-soft:     #e6f4ee;
  --warn:        #a8620d;
  --warn-soft:   #fdf1e0;
  --bad:         #b5322f;
  --bad-soft:    #fbeceb;

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --r-xl: 24px;

  --sh-1: 0 1px 2px rgba(19, 40, 62, .05), 0 1px 3px rgba(19, 40, 62, .04);
  --sh-2: 0 2px 6px rgba(19, 40, 62, .06), 0 8px 22px rgba(19, 40, 62, .06);
  --sh-3: 0 12px 34px rgba(19, 40, 62, .12);

  --ff: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --ff-num: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;

  --topbar-h: 62px;
  --dock-h: calc(58px + env(safe-area-inset-bottom));
  --wrap: 1080px;
}

html[data-theme="dark"] {
  --ink:        #e8eef5;
  --ink-2:      #a7b6c6;
  --ink-3:      #77899b;
  --line:       #263443;
  --line-2:     #1e2a37;
  --bg:         #0e151d;
  --card:       #16202b;
  --brand:      #63a9e0;
  --brand-2:    #8cc3ee;
  --brand-soft: #17293a;
  --ok:         #59c39c;
  --ok-soft:    #142c25;
  --warn:       #dda45a;
  --warn-soft:  #2d2418;
  --bad:        #e58079;
  --bad-soft:   #2f1d1d;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .3);
  --sh-2: 0 2px 8px rgba(0, 0, 0, .32), 0 10px 26px rgba(0, 0, 0, .26);
  --sh-3: 0 14px 38px rgba(0, 0, 0, .46);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--ff);
  font-size: 15px;
  line-height: 1.62;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
}

html[data-theme="light"] body {
  background:
    radial-gradient(900px 480px at 12% -8%, #e9f1f8 0%, transparent 62%),
    radial-gradient(760px 420px at 92% 4%, #eef0f7 0%, transparent 58%),
    var(--bg);
  background-attachment: fixed;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(900px 480px at 12% -8%, #142433 0%, transparent 62%),
    radial-gradient(760px 420px at 92% 4%, #151f2c 0%, transparent 58%),
    var(--bg);
  background-attachment: fixed;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== 顶栏 ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 84%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
}

.topbar__in {
  max-width: var(--wrap);
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 11px; margin-right: auto; }

.brand__mark {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(150deg, var(--brand-2), var(--brand) 78%);
  box-shadow: var(--sh-1);
}

.brand__mark svg { width: 21px; height: 21px; }

.brand__txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand__txt b { font-size: 15px; letter-spacing: -.015em; }
.brand__txt i {
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: .04em;
}

.tabs { display: flex; gap: 4px; }

.tabs a {
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  transition: background .16s, color .16s;
}

.tabs a:hover { background: var(--line-2); color: var(--ink); }

.tabs a.on {
  color: #fff;
  background: linear-gradient(160deg, var(--brand-2), var(--brand));
  box-shadow: var(--sh-1);
}

html[data-theme="dark"] .tabs a.on { color: #0c1620; }

.icon-btn {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  cursor: pointer;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}

.icon-btn:hover { border-color: var(--brand); box-shadow: var(--sh-1); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 19px; height: 19px; }

html[data-theme="light"] .i-moon,
html[data-theme="dark"]  .i-sun { display: none; }

/* ===== 主区 ===== */
.main {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 26px 20px 60px;
}

.dock { display: none; }

/* ===== 载入态 ===== */
.boot {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: var(--bg);
  color: var(--ink-3);
  font-size: 13.5px;
  transition: opacity .3s;
}

.boot.hide { opacity: 0; pointer-events: none; }

.boot__spin {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 通用块 ===== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--sh-1);
}

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 14px;
}

.sec-head h2 { font-size: 17px; }
.sec-head span { font-size: 12.5px; color: var(--ink-3); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .14s, border-color .16s, box-shadow .16s, background .16s;
}

.btn:hover { border-color: var(--brand); box-shadow: var(--sh-1); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(160deg, var(--brand-2), var(--brand) 82%);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 30%, transparent);
}

html[data-theme="dark"] .btn--primary { color: #0c1620; }
.btn--primary:hover { filter: brightness(1.06); }

.btn--ghost { background: transparent; }
.btn--sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 17px; height: 17px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 25px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .01em;
  background: var(--line-2);
  color: var(--ink-2);
  white-space: nowrap;
}

.chip--single { background: var(--brand-soft); color: var(--brand); }
.chip--multi  { background: var(--warn-soft);  color: var(--warn); }
.chip--judge  { background: var(--ok-soft);    color: var(--ok); }

/* ===== 首页 ===== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 34px 32px 32px;
  margin-bottom: 22px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--sh-2);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2) 42%, var(--ok) 100%);
}

.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 34%,
              color-mix(in srgb, var(--brand) 13%, transparent), transparent 66%);
  pointer-events: none;
}

.hero__kick {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 13px;
  padding: 4px 12px 4px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
}

.hero__kick b {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--card);
  font-size: 10px;
}

.hero h1 {
  font-size: clamp(23px, 4.4vw, 31px);
  line-height: 1.28;
  margin-bottom: 10px;
}

.hero p {
  max-width: 48ch;
  color: var(--ink-2);
  font-size: 14.5px;
}

.hero__acts { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 22px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 26px;
}

.stat {
  padding: 15px 17px;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--sh-1);
}

.stat b {
  display: block;
  font-family: var(--ff-num);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.stat span { font-size: 12.5px; color: var(--ink-3); }
.stat:nth-child(1) b { color: var(--brand); }
.stat:nth-child(2) b { color: var(--ok); }
.stat:nth-child(3) b { color: var(--warn); }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.mode {
  position: relative;
  display: block;
  padding: 24px 24px 22px;
  border-radius: var(--r-l);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--sh-1);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}

.mode:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  box-shadow: var(--sh-2);
}

.mode__ico {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}

.mode--exam .mode__ico { background: var(--warn-soft); color: var(--warn); }
.mode--bank .mode__ico { background: var(--ok-soft);   color: var(--ok); }
.mode__ico svg { width: 21px; height: 21px; }
.mode h3 { font-size: 16px; margin-bottom: 6px; }
.mode p { font-size: 13.5px; color: var(--ink-2); }

.mode__meta {
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== 答题界面 ===== */
.quiz { display: grid; gap: 16px; }

.quiz__bar {
  position: sticky;
  top: calc(var(--topbar-h) + 8px);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(12px) saturate(1.5);
  box-shadow: var(--sh-1);
}

.quiz__idx {
  font-family: var(--ff-num);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.quiz__idx i { font-style: normal; color: var(--ink-3); font-weight: 400; }

.quiz__track {
  flex: 1;
  height: 6px;
  min-width: 40px;
  border-radius: 999px;
  background: var(--line-2);
  overflow: hidden;
}

.quiz__fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width .3s cubic-bezier(.4, 0, .2, 1);
}

.quiz__timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ff-num);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}

.quiz__timer svg { width: 15px; height: 15px; }
.quiz__timer.urgent { color: var(--bad); }

.qcard { padding: 26px 28px 24px; }

.qcard__top {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.qcard__no {
  font-family: var(--ff-num);
  font-size: 12.5px;
  color: var(--ink-3);
}

.qcard__stem {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.66;
  letter-spacing: -.005em;
  margin-bottom: 20px;
}

.opts { display: grid; gap: 10px; }

.opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--card);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s, transform .12s;
}

.opt:hover { border-color: color-mix(in srgb, var(--brand) 46%, var(--line)); }
.opt:active { transform: scale(.995); }

.opt__key {
  flex: none;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line-2);
  font-family: var(--ff-num);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background .15s, color .15s, border-color .15s;
}

.opt__txt { font-size: 14.5px; line-height: 1.6; padding-top: 2px; }

.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.sel .opt__key {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--card);
}

.opt.ok { border-color: var(--ok); background: var(--ok-soft); }
.opt.ok .opt__key { background: var(--ok); border-color: var(--ok); color: var(--card); }

.opt.bad { border-color: var(--bad); background: var(--bad-soft); }
.opt.bad .opt__key { background: var(--bad); border-color: var(--bad); color: var(--card); }

.opt.locked { cursor: default; }
.opt.locked:hover { border-color: var(--line); }
.opt.ok.locked:hover  { border-color: var(--ok); }
.opt.bad.locked:hover { border-color: var(--bad); }

.opt__mark {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 600;
}

.opt.ok  .opt__mark { color: var(--ok); }
.opt.bad .opt__mark { color: var(--bad); }

.feedback {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: var(--line-2);
  font-size: 14px;
  animation: rise .22s ease-out;
}

.feedback.is-ok  { border-color: color-mix(in srgb, var(--ok) 34%, var(--line)); background: var(--ok-soft); }
.feedback.is-bad { border-color: color-mix(in srgb, var(--bad) 34%, var(--line)); background: var(--bad-soft); }

.feedback b { display: block; margin-bottom: 3px; font-size: 14px; }
.feedback.is-ok b  { color: var(--ok); }
.feedback.is-bad b { color: var(--bad); }
.feedback span { color: var(--ink-2); font-family: var(--ff-num); }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.quiz__acts {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
}

.quiz__acts .grow { margin-left: auto; }

/* 多选题判分确认 */
.quiz__acts--confirm {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  gap: 14px;
}

.quiz__acts--confirm .grow {
  margin-left: 0;
  flex: 0 0 auto;
  min-width: 168px;
}

.qcard__tip {
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ===== 答题卡 ===== */
.sheet { padding: 18px 20px 20px; }

.sheet h3 {
  font-size: 14px;
  margin-bottom: 4px;
}

.sheet__hint { font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; }

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

.sheet__grid button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  font-family: var(--ff-num);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: transform .12s, border-color .14s, background .14s;
}

.sheet__grid button:hover { border-color: var(--brand); }
.sheet__grid button:active { transform: scale(.93); }

.sheet__grid button.done {
  border-color: transparent;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.sheet__grid button.ok  { border-color: transparent; background: var(--ok-soft);  color: var(--ok); }
.sheet__grid button.bad { border-color: transparent; background: var(--bad-soft); color: var(--bad); }

.sheet__grid button.now {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
  font-weight: 700;
  color: var(--brand);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--ink-3);
}

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

/* ===== 成绩页 ===== */
.result { display: grid; gap: 18px; }

.score {
  position: relative;
  overflow: hidden;
  padding: 32px 30px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--sh-2);
  text-align: center;
}

.score::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--bad);
}

.score.pass::before { background: linear-gradient(90deg, var(--ok), #4fb08c); }

.dial {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 4px auto 18px;
}

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

.dial__bg { fill: none; stroke: var(--line-2); stroke-width: 11; }

.dial__fg {
  fill: none;
  stroke: var(--bad);
  stroke-width: 11;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(.3, 0, .2, 1);
}

.score.pass .dial__fg { stroke: var(--ok); }

.dial__mid {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 1px;
}

.dial__num {
  font-family: var(--ff-num);
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.03em;
}

.dial__num i {
  font-style: normal;
  font-size: .5em;
  font-weight: 500;
  margin-left: 1px;
  color: var(--ink-3);
}

.dial__pct { font-size: 13px; color: var(--ink-3); }

.score__verdict {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: var(--bad-soft);
  color: var(--bad);
}

.score.pass .score__verdict { background: var(--ok-soft); color: var(--ok); }
.score__sub { margin-top: 12px; font-size: 13.5px; color: var(--ink-2); }

.score__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 24px;
  border-radius: var(--r-m);
  overflow: hidden;
  background: var(--line);
}

.score__cell { padding: 14px 8px; background: var(--card); }

.score__cell b {
  display: block;
  font-family: var(--ff-num);
  font-size: 19px;
  font-weight: 600;
}

.score__cell span { font-size: 12px; color: var(--ink-3); }
.score__cell:nth-child(1) b { color: var(--ok); }
.score__cell:nth-child(2) b { color: var(--bad); }

.review { display: grid; gap: 12px; }

.rev {
  padding: 18px 20px;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  border-left: 3px solid var(--bad);
  background: var(--card);
  box-shadow: var(--sh-1);
}

.rev.ok { border-left-color: var(--ok); }

.rev__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  flex-wrap: wrap;
}

.rev__stem { font-size: 14.5px; font-weight: 600; line-height: 1.6; margin-bottom: 11px; }

.rev__opts { display: grid; gap: 5px; margin-bottom: 11px; }

.rev__opt {
  display: flex;
  gap: 9px;
  font-size: 13.5px;
  color: var(--ink-2);
  padding: 5px 9px;
  border-radius: 7px;
}

.rev__opt b { font-family: var(--ff-num); flex: none; }
.rev__opt.ok  { background: var(--ok-soft);  color: var(--ok); }
.rev__opt.bad { background: var(--bad-soft); color: var(--bad); }

.rev__ans {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink-3);
}

.rev__ans b { font-family: var(--ff-num); color: var(--ink-2); }
.rev__ans .g { color: var(--ok); }
.rev__ans .r { color: var(--bad); }

/* ===== 配置面板 ===== */
.setup { display: grid; gap: 16px; }

.field { padding: 20px 22px; }

.field__lab {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 13px;
  font-size: 14px;
  font-weight: 600;
}

.field__lab span { font-size: 12.5px; font-weight: 400; color: var(--ink-3); }

.segs { display: flex; flex-wrap: wrap; gap: 8px; }

.seg {
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}

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

.seg.on {
  border-color: transparent;
  background: var(--brand);
  color: #fff;
  font-weight: 500;
}

html[data-theme="dark"] .seg.on { color: #0c1620; }

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 22px;
  cursor: pointer;
}

.switch p { font-size: 14px; font-weight: 500; }
.switch small { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink-3); }

.switch__box {
  flex: none;
  width: 46px;
  height: 27px;
  padding: 3px;
  border-radius: 999px;
  background: var(--line);
  transition: background .2s;
}

.switch__box i {
  display: block;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--sh-1);
  transition: transform .2s cubic-bezier(.4, 0, .2, 1);
}

.switch.on .switch__box { background: var(--brand); }
.switch.on .switch__box i { transform: translateX(19px); }

/* ===== 题库查看 ===== */
.filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 15px 18px;
  margin-bottom: 16px;
}

.search {
  position: relative;
  flex: 1;
  min-width: 190px;
}

.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--ink-3);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 37px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  transition: border-color .15s, background .15s;
}

.search input::placeholder { color: var(--ink-3); }

.search input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--card);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 13%, transparent);
}

.count {
  font-size: 13px;
  color: var(--ink-3);
  font-family: var(--ff-num);
  white-space: nowrap;
}

.bank { display: grid; gap: 11px; }

.bq {
  padding: 17px 19px;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--sh-1);
  transition: border-color .15s, box-shadow .15s;
}

.bq:hover { border-color: color-mix(in srgb, var(--brand) 34%, var(--line)); }

.bq__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  flex-wrap: wrap;
}

.bq__stem {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.62;
  margin-bottom: 11px;
}

.bq__opts { display: grid; gap: 4px; }

.bq__opt {
  display: flex;
  gap: 9px;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.bq__opt b { flex: none; font-family: var(--ff-num); }

.bq__opt.key {
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 500;
}

.bq__ans {
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink-3);
}

.bq__ans b { font-family: var(--ff-num); color: var(--ok); font-size: 13.5px; }

.bq__flag {
  margin-top: 9px;
  padding: 8px 11px;
  border-radius: var(--r-s);
  border-left: 3px solid var(--warn);
  background: var(--warn-soft);
  font-size: 12.5px;
  line-height: 1.62;
  color: var(--ink-2);
}

.bq__flag b {
  display: inline-block;
  margin-right: 7px;
  color: var(--warn);
  letter-spacing: .02em;
}

.bq__flag--bad { border-left-color: var(--bad); background: var(--bad-soft); }
.bq__flag--bad b { color: var(--bad); }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.pager__now {
  font-size: 13.5px;
  font-family: var(--ff-num);
  color: var(--ink-2);
  padding: 0 6px;
}

.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--ink-3);
}

.empty svg {
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  opacity: .5;
}

.empty p { font-size: 14px; }

/* ===== 弹层 ===== */
.mask {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(12, 22, 32, .48);
  backdrop-filter: blur(3px);
  animation: fade .18s;
}

@keyframes fade { from { opacity: 0; } }

.modal {
  width: 100%;
  max-width: 400px;
  padding: 26px 26px 22px;
  border-radius: var(--r-l);
  background: var(--card);
  box-shadow: var(--sh-3);
  animation: pop .22s cubic-bezier(.3, 1.2, .5, 1);
}

@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
}

.modal h3 { font-size: 16.5px; margin-bottom: 8px; }
.modal p { font-size: 14px; color: var(--ink-2); }
.modal__acts { display: flex; gap: 10px; margin-top: 22px; }
.modal__acts .btn { flex: 1; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 80;
  transform: translateX(-50%);
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--sh-3);
  animation: toastIn .24s cubic-bezier(.3, 1.2, .5, 1);
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
}

.toast.out { opacity: 0; transition: opacity .25s; }

/* ===== 平板 ===== */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .modes { grid-template-columns: 1fr; }
  .hero { padding: 28px 24px 26px; }
}

/* ===== 手机 ===== */
@media (max-width: 640px) {
  body { font-size: 14.5px; }

  :root { --topbar-h: 56px; }

  .topbar__in { padding: 0 15px; gap: 10px; }
  .tabs { display: none; }
  .brand__txt i { display: none; }
  .brand__mark { width: 33px; height: 33px; border-radius: 10px; }

  .main { padding: 16px 14px calc(var(--dock-h) + 22px); }

  /* 底部导航 */
  .dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: var(--dock-h);
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(14px) saturate(1.6);
  }

  .dock a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10.5px;
    color: var(--ink-3);
    transition: color .15s;
  }

  .dock a svg { width: 21px; height: 21px; }

  .dock a.on { color: var(--brand); font-weight: 600; }
  .dock a.on svg { stroke-width: 2.1; }

  .hero {
    padding: 24px 19px 22px;
    border-radius: var(--r-l);
    margin-bottom: 16px;
  }

  .hero h1 { font-size: 22px; }
  .hero p { font-size: 13.5px; }
  .hero__acts { margin-top: 18px; }
  .hero__acts .btn { flex: 1; min-width: 130px; }

  .stats { gap: 9px; margin-bottom: 18px; }
  .stat { padding: 12px 13px; }
  .stat b { font-size: 21px; }
  .stat span { font-size: 11.5px; }

  .mode { padding: 19px 18px; }

  .quiz__bar {
    top: calc(var(--topbar-h) + 4px);
    padding: 11px 14px;
    gap: 10px;
  }

  .quiz__idx, .quiz__timer { font-size: 13px; }

  .qcard { padding: 19px 17px 18px; }
  .qcard__stem { font-size: 15.5px; margin-bottom: 16px; }

  .opt { padding: 12px 13px; gap: 11px; }
  .opt__txt { font-size: 14px; }
  .opt__key { width: 25px; height: 25px; font-size: 12px; }
  .opt__mark { right: 10px; font-size: 11px; }

  .quiz__acts { gap: 9px; }
  .quiz__acts .btn { flex: 1; min-width: 96px; }
  .quiz__acts .grow { margin-left: 0; }

  .quiz__acts--confirm { margin-top: 14px; padding-top: 14px; gap: 8px; }
  .quiz__acts--confirm .grow { flex: 1 1 100%; min-width: 0; }
  .qcard__tip { flex: 1 1 100%; }

  .sheet { padding: 15px 15px 17px; }
  .sheet__grid { grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 6px; }
  .sheet__grid button { height: 34px; font-size: 12px; }

  .score { padding: 26px 18px; border-radius: var(--r-l); }
  .dial { width: 142px; height: 142px; }
  .dial__num { font-size: 34px; }

  .score__grid { grid-template-columns: repeat(2, 1fr); }
  .score__cell b { font-size: 17px; }

  .rev { padding: 15px 16px; }
  .field { padding: 17px 17px; }
  .switch { padding: 14px 17px; }
  .filter { padding: 13px 14px; }
  .bq { padding: 15px 16px; }

  .modal { padding: 22px 20px 19px; }
  .toast { bottom: calc(var(--dock-h) + 16px); }
}

@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 20px; }
}

/* ===== 大屏答题双栏 ===== */
@media (min-width: 1000px) {
  .quiz--wide {
    grid-template-columns: minmax(0, 1fr) 292px;
    align-items: start;
  }

  .quiz--wide .quiz__bar { grid-column: 1 / -1; }

  .quiz--wide .sheet {
    position: sticky;
    top: calc(var(--topbar-h) + 78px);
  }
}

/* ===== 可访问性与打印 ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .topbar, .dock, .quiz__acts, .filter, .pager { display: none !important; }
  body { background: #fff; }
  .card, .bq, .rev { box-shadow: none; break-inside: avoid; }
}
