/* 教檢歷屆試題練習 — 設計系統
   主色藍、輔色青綠、點綴琥珀；預設淺色，可在頁首手動切換深色（不跟隨系統）。
   字體使用系統中文字型堆疊（蘋方、微軟正黑、思源黑體），不載入外部字型，速度最快也沒有隱私顧慮。 */
:root {
  color-scheme: light;
  --bg: #f5f7fc;
  --bg-alt: #ebeffa;
  --surface: #ffffff;
  --surface-2: #f8faff;
  --ink: #0c1a36;
  --ink-2: #2f3e5c;
  --muted: #5f6e88;
  --line: #e3e9f4;
  --line-strong: #cdd7e8;
  --ring-track: #e3e9f4;
  --accent: #2d5bf0;
  --accent-hover: #2149d1;
  --accent-ink: #ffffff;
  --accent-soft: #e9efff;
  --accent-line: #b9ccfb;
  --teal: #0ea5a0;
  --teal-soft: #dff5f3;
  --amber: #e08a00;
  --amber-soft: #fff1d6;
  --ok: #0e8a52;
  --ok-soft: #e3f6ec;
  --ok-line: #b6e3cb;
  --bad: #d23b3b;
  --bad-soft: #fdecec;
  --bad-line: #f3c2c2;
  --warn: #8a5a00;
  --warn-soft: #fff4d6;
  --warn-line: #f2dd9b;
  --header-bg: rgba(255, 255, 255, .86);
  --shadow-sm: 0 1px 2px rgba(12, 26, 54, .05);
  --shadow: 0 1px 2px rgba(12, 26, 54, .04), 0 10px 28px rgba(45, 91, 240, .07);
  --shadow-lg: 0 2px 4px rgba(12, 26, 54, .05), 0 22px 48px rgba(45, 91, 240, .14);
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1120;
  --bg-alt: #0f1a30;
  --surface: #121c31;
  --surface-2: #16223c;
  --ink: #e9effc;
  --ink-2: #c6d1e8;
  --muted: #92a0bd;
  --line: #22304b;
  --line-strong: #314566;
  --ring-track: #22304b;
  --accent: #4f78f6;
  --accent-hover: #6a8ef8;
  --accent-ink: #ffffff;
  --accent-soft: #172447;
  --accent-line: #33498a;
  --teal: #2fc8c0;
  --teal-soft: #0f2d33;
  --amber: #f2b13c;
  --amber-soft: #33270c;
  --ok: #3fd28a;
  --ok-soft: #0f2c20;
  --ok-line: #1f5a40;
  --bad: #ff7a7a;
  --bad-soft: #351718;
  --bad-line: #6b2b2d;
  --warn: #f2c35a;
  --warn-soft: #33270c;
  --warn-line: #5f4a14;
  --header-bg: rgba(12, 19, 36, .82);
  --shadow-sm: none;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 22px 48px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16.5px/1.75 "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background .25s, color .25s;
}
a { color: var(--accent); }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 30; border-radius: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
main { padding-top: 32px; padding-bottom: 72px; min-height: 72vh; outline: none; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }

/* ---------- header ---------- */
.site-header { background: var(--header-bg); backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; font-size: 19px; letter-spacing: .03em; color: var(--ink); text-decoration: none; flex: none; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; font-size: 19px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #2d5bf0, #0ea5a0); box-shadow: 0 6px 14px rgba(45, 91, 240, .3); }
.brand span.sub { font-weight: 500; color: var(--muted); font-size: 14px; letter-spacing: 0; }
.nav-wrap { display: flex; align-items: center; gap: 6px; min-width: 0; }
nav { display: flex; gap: 2px; min-width: 0; }
nav a { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); text-decoration: none; padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; }
nav a .ico { width: 17px; height: 17px; opacity: .85; }
nav a:hover { background: var(--accent-soft); color: var(--accent); }
nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
nav b { background: var(--bad); color: #fff; border-radius: 999px; font-size: 11.5px; padding: 0 7px; font-weight: 700; line-height: 1.6; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; flex: none; transition: background .15s, border-color .15s; }
.icon-btn:hover { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

/* ---------- typography ---------- */
h1 { font-size: 30px; line-height: 1.3; margin: 0 0 8px; font-weight: 800; letter-spacing: .01em; }
h2 { font-size: 21px; margin: 40px 0 16px; font-weight: 800; letter-spacing: .01em; }
h3 { font-size: 17.5px; margin: 0 0 6px; font-weight: 700; }
.page-head { margin-bottom: 26px; }
.page-head .lead { margin: 0; }
.lead { color: var(--muted); margin: 0 0 24px; font-size: 17px; max-width: 46em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--accent); background: var(--accent-soft); padding: 5px 13px; border-radius: 999px; margin-bottom: 16px; }
.grid { display: grid; gap: 18px; }
.grid.cols3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 44px 0 16px; }
.sec-head h2 { margin: 0; }
.sec-head p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }

/* ---------- hero ---------- */
.hero { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 24px; overflow: hidden; border-radius: 28px; padding: 52px 48px; margin-bottom: 22px; border: 1px solid var(--line);
  background: radial-gradient(600px 300px at 100% 0%, color-mix(in srgb, var(--teal) 16%, transparent), transparent 70%), radial-gradient(520px 320px at 0% 100%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%), linear-gradient(135deg, var(--surface) 0%, var(--bg-alt) 100%); box-shadow: var(--shadow); }
.hero h1 { font-size: 44px; line-height: 1.22; margin: 0 0 16px; letter-spacing: .005em; }
.hero h1 em { font-style: normal; background: linear-gradient(120deg, #2d5bf0, #0ea5a0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 17.5px; margin-bottom: 28px; max-width: 34em; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { display: block; width: 100%; }
.hero-art svg { display: block; width: 100%; height: auto; max-height: 360px; animation: float 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- stat cards ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 8px; }
.stat-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat-card .ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); flex: none; }
.stat-card .ic.teal { background: var(--teal-soft); color: var(--teal); }
.stat-card .ic.amber { background: var(--amber-soft); color: var(--amber); }
.stat-card .ic .ico { width: 24px; height: 24px; }
.stat-card b { display: block; font-size: 26px; line-height: 1.15; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-card span { color: var(--muted); font-size: 13.5px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 24px 22px; box-shadow: var(--shadow-sm); }
a.card { display: block; color: inherit; text-decoration: none; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
a.card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.card .icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; margin-bottom: 16px; background: var(--accent-soft); color: var(--accent); }
.card .icon.teal { background: var(--teal-soft); color: var(--teal); }
.card .icon.amber { background: var(--amber-soft); color: var(--amber); }
.card .icon .ico { width: 24px; height: 24px; }
.card h3 { font-size: 18.5px; color: var(--ink); }
.card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.card .go { display: inline-flex; align-items: center; gap: 5px; margin-top: 14px; font-size: 14.5px; font-weight: 700; color: var(--accent); }
.card .go .ico { transition: transform .2s var(--ease); }
a.card:hover .go .ico { transform: translateX(4px); }
.notice { display: flex; gap: 12px; background: var(--warn-soft); color: var(--ink-2); border: 1px solid var(--warn-line); padding: 14px 18px; border-radius: var(--r); font-size: 15px; margin: 20px 0; }
.notice > .ico { color: var(--amber); margin-top: 4px; width: 20px; height: 20px; }
.notice b { color: var(--warn); }

/* ---------- presets & tabs ---------- */
.presets { display: flex; gap: 10px; flex-wrap: wrap; }
.preset { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 16px; cursor: pointer; transition: all .15s var(--ease); }
.preset:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); transform: translateY(-1px); }
.preset .ico { width: 17px; height: 17px; color: var(--accent); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 5px; background: var(--bg-alt); border-radius: 14px; width: fit-content; max-width: 100%; margin-bottom: 20px; }
.tab { font: inherit; font-size: 15px; font-weight: 600; color: var(--muted); background: transparent; border: 0; border-radius: 10px; padding: 8px 18px; cursor: pointer; white-space: nowrap; transition: all .15s; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }

/* ---------- subject cards (首頁) ---------- */
.scards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.scard { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow-sm); transition: box-shadow .2s var(--ease), border-color .2s, transform .2s var(--ease); animation: rise .4s var(--ease) both; }
.scard:hover { border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-2px); }
.scard-top { display: flex; align-items: flex-start; gap: 12px; }
.scard-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.scard-ic.teal { background: var(--teal-soft); color: var(--teal); }
.scard-ic.amber { background: var(--amber-soft); color: var(--amber); }
.scard h3 { margin: 0; font-size: 17px; line-height: 1.4; }
.scard .meta-line { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.pbar { height: 8px; border-radius: 99px; background: var(--ring-track); overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--teal)); transition: width .6s var(--ease); }
.pmeta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.scard-actions { display: flex; gap: 8px; margin-top: auto; }
.scard-actions .btn { padding: 7px 16px; min-height: 40px; font-size: 14.5px; border-radius: 10px; }
.sys-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-left: 8px; vertical-align: 2px; }
.sys-tag.old { background: var(--bg-alt); color: var(--muted); }
.sys-tag.common { background: var(--teal-soft); color: var(--teal); }

/* ---------- buttons & form controls ---------- */
.btn { font: inherit; font-weight: 700; font-size: 15.5px; background: var(--accent); color: var(--accent-ink); border: 1.5px solid var(--accent); border-radius: 12px; padding: 10px 24px; cursor: pointer; min-height: 48px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 32%, transparent); transition: background .15s, transform .12s, box-shadow .15s; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 38%, transparent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.lg { min-height: 54px; padding: 12px 32px; font-size: 16.5px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--accent); border-color: var(--accent-line); box-shadow: none; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { background: var(--surface); color: var(--bad); border-color: var(--bad-line); box-shadow: none; }
.btn.danger:hover { background: var(--bad-soft); }
.link-btn { display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 14px; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 4px 2px; font-weight: 600; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { color: var(--muted); opacity: .6; cursor: default; text-decoration: none; }
.link-btn .ico { width: 16px; height: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
select, input[type=search], input[type=text] { font: inherit; font-size: 15.5px; padding: 8px 12px; border: 1.5px solid var(--line-strong); border-radius: 11px; background: var(--surface); color: var(--ink); min-height: 46px; transition: border-color .15s, box-shadow .15s; }
select:hover, input[type=search]:hover, input[type=text]:hover { border-color: var(--accent-line); }
select:focus, input[type=search]:focus, input[type=text]:focus { border-color: var(--accent); outline: 3px solid color-mix(in srgb, var(--accent) 20%, transparent); }
textarea, input[type=email] { font: inherit; font-size: 15.5px; padding: 10px 12px; border: 1.5px solid var(--line-strong); border-radius: 11px; background: var(--surface); color: var(--ink); width: 100%; transition: border-color .15s, box-shadow .15s; }
input[type=email] { min-height: 46px; padding-top: 8px; padding-bottom: 8px; }
textarea { resize: vertical; min-height: 140px; line-height: 1.7; }
textarea:hover, input[type=email]:hover { border-color: var(--accent-line); }
textarea:focus, input[type=email]:focus { border-color: var(--accent); outline: 3px solid color-mix(in srgb, var(--accent) 20%, transparent); }
.report-form { display: grid; gap: 18px; }
.report-form label.field input[type=text] { width: 100%; }
.report-form label.field span.small { font-weight: 400; align-self: flex-end; }
.exp-wrap { margin-top: 10px; }
.exp-btn { font-weight: 700; }
.explain { margin-top: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); font-size: 15px; line-height: 1.8; }
.exp-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.exp-why { margin: 0 0 10px; color: var(--ink); }
.exp-opts { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.exp-opts li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); }
.exp-opts li.ok { color: var(--ok); font-weight: 600; }
.exp-opts .letter { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-alt); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; margin-top: 2px; }
.exp-opts li.ok .letter { background: var(--ok); color: #fff; }
.exp-concepts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0; font-size: 14.5px; color: var(--muted); }
.form-status.bad { color: var(--bad); font-weight: 600; }
.notice.ok { background: var(--ok-soft); border-color: var(--ok-line); }
.notice.ok > .ico { color: var(--ok); }
.notice.ok b { color: var(--ok); }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 14px; color: var(--muted); font-weight: 600; }
fieldset { border: 0; padding: 0; margin: 0 0 24px; }
legend { font-weight: 700; padding: 0; margin-bottom: 10px; font-size: 15.5px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 6px 15px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 14.5px; line-height: 1.55; color: var(--ink-2); transition: background .12s, border-color .12s, color .12s, transform .12s; }
.chip:hover span { border-color: var(--accent-line); background: var(--surface-2); }
.chip input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.chip input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.chip small { opacity: .7; margin-left: 5px; font-weight: 500; }
.chip-group-label { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .06em; margin: 14px 0 8px; }
.chip-group-label:first-child { margin-top: 0; }
.check { display: flex; align-items: center; gap: 9px; font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 26px; box-shadow: var(--shadow-sm); }

/* ---------- practice setup ---------- */
.setup { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 26px 6px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.step-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 14px; flex: none; }
.step-head h2 { margin: 0; font-size: 18.5px; }
.step-head .hint { margin-left: auto; font-size: 13.5px; color: var(--muted); }
.summary { position: sticky; top: 88px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow); }
.summary .count { font-size: 54px; line-height: 1.05; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; background: linear-gradient(120deg, var(--accent), var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.summary .count small { font-size: 18px; font-weight: 700; color: var(--muted); -webkit-text-fill-color: var(--muted); margin-left: 4px; }
.summary dl { margin: 16px 0 18px; display: grid; gap: 8px; font-size: 14px; }
.summary dl div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.summary dt { color: var(--muted); flex: none; }
.summary dd { margin: 0; text-align: right; font-weight: 600; }
.summary .row { margin-bottom: 14px; }
.summary .row label { flex: 1; min-width: 120px; }
.mbar { display: none; }

/* ---------- question ---------- */
.qtop { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.qtop h1 { font-size: 22px; margin: 0; }
.live { display: inline-flex; align-items: center; gap: 14px; font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.live .ok { color: var(--ok); }
.live .bad { color: var(--bad); }
.live .n { color: var(--muted); font-weight: 600; }
.progress { height: 8px; background: var(--ring-track); border-radius: 99px; overflow: hidden; margin: 10px 0 20px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--teal)); transition: width .35s var(--ease); border-radius: 99px; }
.qcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px 32px 24px; margin-bottom: 18px; box-shadow: var(--shadow); animation: rise .35s var(--ease) both; }
.qcard.sm { padding: 22px 26px; border-radius: var(--r-lg); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.qno { display: inline-grid; place-items: center; min-width: 44px; height: 30px; padding: 0 12px; border-radius: 9px; background: var(--ink); color: var(--bg); font-weight: 800; font-size: 14px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; font-size: 14px; color: var(--muted); }
.tag { display: inline-block; padding: 1px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; line-height: 1.7; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.plain { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); font-weight: 500; }
.tag.teal { background: var(--teal-soft); color: var(--teal); }
.ctx { background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--r-sm); padding: 14px 18px; margin: 0 0 20px; font-size: 15.5px; line-height: 1.85; }
.ctx-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; letter-spacing: .07em; color: var(--accent); margin-bottom: 4px; }
.ctx p, .stem { margin: 0; white-space: pre-line; }
.stem { font-size: 18.5px; margin-bottom: 22px; line-height: 1.85; font-weight: 500; }
.opts { display: grid; gap: 11px; }
.opt { display: flex; gap: 14px; text-align: left; align-items: flex-start; font: inherit; font-size: 16.5px; background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 13px 18px; cursor: pointer; width: 100%; min-height: 56px; transition: border-color .15s, background .15s, box-shadow .15s, transform .12s var(--ease); }
.opt:hover:not(:disabled) { border-color: var(--accent); background: var(--surface-2); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 14%, transparent); transform: translateX(2px); }
.opt:active:not(:disabled) { transform: scale(.995); }
.opt .letter { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--accent-line); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 14px; margin-top: 0; background: var(--surface); transition: all .15s; }
.opt .otext { padding-top: 3px; }
.opt.picked { border-color: var(--accent); background: var(--accent-soft); }
.opt.picked .letter { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.opt:disabled { cursor: default; color: var(--ink); }
.opt.correct { border-color: var(--ok); background: var(--ok-soft); animation: pop .35s var(--ease); }
.opt.correct .letter { background: var(--ok); color: #fff; border-color: var(--ok); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); animation: shake .35s; }
.opt.wrong .letter { background: var(--bad); color: #fff; border-color: var(--bad); }
.opt .mark { margin-left: auto; padding-top: 3px; font-weight: 700; font-size: 14px; flex: none; display: inline-flex; align-items: center; gap: 4px; }
.opt.correct .mark { color: var(--ok); }
.opt.wrong .mark { color: var(--bad); }
@keyframes pop { 0% { transform: scale(.985); } 60% { transform: scale(1.012); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.otext { white-space: pre-line; }
.feedback { display: flex; gap: 14px; margin-top: 20px; padding: 16px 20px; border-radius: 16px; font-size: 15.5px; animation: rise .3s var(--ease) both; }
.feedback.ok { background: var(--ok-soft); border: 1px solid var(--ok-line); }
.feedback.bad { background: var(--bad-soft); border: 1px solid var(--bad-line); }
.feedback .fic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex: none; color: #fff; }
.feedback.ok .fic { background: var(--ok); }
.feedback.bad .fic { background: var(--bad); }
.feedback.none .fic { background: var(--muted); }
.feedback .fic .ico { width: 20px; height: 20px; stroke-width: 2.4; }
.feedback strong { font-size: 17.5px; }
.feedback p { margin: 4px 0 0; }
.feedback .fbody { min-width: 0; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.tools { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.kbd { display: inline-block; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 0 7px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); background: var(--surface); }

/* page viewer */
.pv-panel { margin: 12px 0 0; width: 100%; flex-basis: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; background: var(--bg); }
.pv-nav { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 10px; font-size: 14px; }
.pv-panel img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: #fff; border-radius: 6px; }

/* quiz bottom bar */
.pv.open { flex: 1 1 100%; }
.pv { display: block; }
.quizbar { position: sticky; bottom: 0; z-index: 8; margin: 6px -24px 0; padding: 14px 24px calc(14px + env(safe-area-inset-bottom)); background: var(--header-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stickybar { position: sticky; bottom: 0; background: var(--header-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 14px 0; margin-top: 22px; z-index: 8; box-shadow: 0 -8px 24px rgba(12, 26, 54, .06); }
.stickybar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 0; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 18px; display: inline-flex; align-items: center; gap: 6px; }

/* ---------- results ---------- */
.result { display: grid; grid-template-columns: auto 1fr; gap: 34px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 34px 40px; box-shadow: var(--shadow); margin-bottom: 8px; animation: rise .4s var(--ease) both; }
.result h1 { margin-bottom: 6px; }
.result .lead { margin-bottom: 18px; }
.ring { display: inline-block; line-height: 0; }
.ring .ring-arc { transition: stroke-dashoffset .9s var(--ease); }
.score { font-size: 44px; font-weight: 800; line-height: 1.2; color: var(--accent); font-variant-numeric: tabular-nums; }
.rstats { display: flex; gap: 28px; flex-wrap: wrap; margin: 6px 0 18px; }
.rstats div { font-size: 13.5px; color: var(--muted); }
.rstats b { display: block; font-size: 24px; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.3; }
.rstats .ok b { color: var(--ok); }
.rstats .bad b { color: var(--bad); }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.kpi .k-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.kpi .k-top .ico { color: var(--accent); width: 18px; height: 18px; }
.kpi b { display: block; font-size: 30px; font-weight: 800; line-height: 1.25; font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi b small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.dash { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.dash .panel h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.dash .panel h3 .ico { color: var(--accent); }
.tbar { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.tbar:last-child { border-bottom: 0; }
.tbar .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbar .pct { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.tbar .pbar { height: 9px; }
.tbar .pbar i.low { background: linear-gradient(90deg, var(--bad), var(--amber)); }
.empty { text-align: center; color: var(--muted); padding: 56px 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty .em-ic { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); }
.empty .em-ic .ico { width: 30px; height: 30px; }
.empty h3 { color: var(--ink); font-size: 19px; }
.empty p { margin: 0 auto 18px; max-width: 28em; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px 18px; font-size: 15px; display: flex; gap: 12px; justify-content: space-between; align-items: center; box-shadow: var(--shadow-sm); }
.list li div { min-width: 0; }
.list li .snip { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- mock papers ---------- */
.paper { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.paper:hover { border-color: var(--accent-line); box-shadow: var(--shadow); }
.paper b { font-size: 19px; }
.subhead { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-size: 17px; font-weight: 700; }

/* ---------- trend ---------- */
.toptopics { display: grid; gap: 4px; }
.tt { display: grid; grid-template-columns: 28px minmax(0, 1fr) 130px 64px; gap: 14px; align-items: center; padding: 10px 4px; border-bottom: 1px dashed var(--line); }
.tt:last-child { border-bottom: 0; }
.tt .rk { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 13px; }
.tt .nm { font-weight: 600; line-height: 1.4; }
.tt .nm small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.tt .sh { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); }
table.trend { border-collapse: collapse; font-size: 13px; width: 100%; min-width: 800px; }
table.trend th, table.trend td { border-bottom: 1px solid var(--line); padding: 6px 8px; color: var(--ink); }
table.trend thead th { background: var(--surface-2); color: var(--muted); font-weight: 700; position: sticky; top: 0; }
table.trend th.num, table.trend td.num { text-align: center; font-variant-numeric: tabular-nums; min-width: 32px; }
table.trend th.stick { position: sticky; left: 0; background: var(--surface); text-align: left; min-width: 200px; font-weight: 600; z-index: 1; }
table.trend th.stick.sub { font-weight: 400; padding-left: 22px; color: var(--ink-2); }
table.trend tr.l1 > * { border-top: 2px solid var(--line-strong); font-weight: 700; background-color: var(--surface-2); }
table.trend tr.l1 > th.stick { background: var(--surface-2); }
details.tgroup { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 16px; margin-bottom: 8px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
details.tgroup summary { cursor: pointer; padding: 6px 0; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details.tgroup summary::-webkit-details-marker { display: none; }
details.tgroup summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .2s; margin-right: 4px; flex: none; }
details.tgroup[open] { border-color: var(--accent-line); box-shadow: var(--shadow-sm); }
details.tgroup[open] summary { margin-bottom: 8px; color: var(--accent); }
details.tgroup[open] summary::before { transform: rotate(45deg); border-color: var(--accent); }
details.tgroup .chips { padding-bottom: 10px; }

/* ---------- tables, figures ---------- */
table.kv { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table.kv th, table.kv td { text-align: left; border-bottom: 1px solid var(--line); padding: 11px 16px; vertical-align: top; }
table.kv tr:last-child th, table.kv tr:last-child td { border-bottom: 0; }
.figs { margin: 12px 0 18px; }
.fig-label { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.figs a { display: block; margin-bottom: 8px; }
.figs img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.prose h2 { font-size: 20px; margin-top: 34px; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 8px; }

/* ---------- footer, loading ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding: 30px 0 48px; line-height: 1.85; }
.site-footer p { margin: 0 0 8px; max-width: 62em; }
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .foot-links { font-weight: 600; }
.site-footer .foot-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); margin-bottom: 10px; font-size: 16px; }
.skel { display: grid; gap: 16px; }
.skel i { display: block; border-radius: 16px; background: linear-gradient(90deg, var(--line) 25%, var(--bg-alt) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .setup { grid-template-columns: 1fr; }
  .summary { display: none; }
  .mbar { display: flex; position: sticky; bottom: 0; z-index: 9; margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--header-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 -8px 24px rgba(12, 26, 54, .08); }
  .mbar .mcount { font-size: 22px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.2; }
  .mbar .mcount small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
  .dash { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; padding: 36px 30px; }
  .hero-art { max-width: 340px; margin: 0 auto; order: -1; }
  .hero-art svg { max-height: 250px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  main { padding-top: 20px; padding-bottom: 56px; }
  h1 { font-size: 25px; }
  h2 { font-size: 19px; margin-top: 30px; }
  .bar { flex-wrap: wrap; gap: 8px; }
  .bar { position: relative; }
  .nav-wrap { width: 100%; position: static; }
  #theme-btn { position: absolute; top: 9px; right: 16px; }
  nav { overflow-x: auto; scrollbar-width: none; flex: 1; margin: 0 -2px; padding-bottom: 2px; }
  nav::-webkit-scrollbar { display: none; }
  nav a { padding: 7px 13px; flex: none; }
  nav a .ico { display: none; }
  .brand span.sub { display: none; }
  .hero { padding: 26px 20px 28px; border-radius: 22px; }
  .hero h1 { font-size: 30px; }
  .hero .lead { font-size: 16px; }
  .hero-cta .btn { flex: 1; padding-left: 14px; padding-right: 14px; white-space: nowrap; }
  .hero h1 { font-size: 27px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 12px 14px; gap: 10px; }
  .stat-card .ic { width: 38px; height: 38px; }
  .stat-card b { font-size: 21px; }
  .scards { grid-template-columns: 1fr; }
  .qcard { padding: 20px 18px 18px; border-radius: 18px; }
  .stem { font-size: 17.5px; }
  .opt { font-size: 16px; padding: 12px 14px; gap: 12px; }
  .step { padding: 18px 18px 4px; }
  .step-head .hint { display: none; }
  .panel { padding: 18px 16px; }
  .result { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 26px 20px; gap: 18px; }
  .rstats { justify-content: center; }
  .result .actions { justify-content: center; }
  .quizbar { margin: 6px -16px 0; padding-left: 16px; padding-right: 16px; }
  .quizbar > .muted { display: none; }
  .quizbar { justify-content: flex-end; }
  .tt { grid-template-columns: 26px minmax(0, 1fr) 64px; }
  .tt .spark { display: none; }
  .tbar { grid-template-columns: minmax(0, 1fr) 80px auto; }
  .score { font-size: 38px; }
  .tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .actions, .tools, .stickybar, .quizbar, .mbar, .hero-cta { display: none; }
  body { background: #fff; }
  .qcard, .card, .panel { box-shadow: none; animation: none; }
}
