:root { --bd: #e3e8ef; --fg: #1f2937; --dim: #526074; --bg: #f6f8fa; --card: #fff; --pri: #2563eb; --ok: #16a34a; --bad: #b91c1c; }
/* 字号四档：桌面 M(18px)/L(26px)/XL(34px)/XXL(40px)；手机（≤700px）等比档 → 25/32/40/48px（v2.5）。
   所有文字用 rem 随档位整体缩放（服务中老年用户）。v1.8：默认 16→18px；v1.9：手机默认 18→25px（+7≥+6 要求）、
   最大档 24→40px（+16 要求）。缩放原则：阅读型文字线性放大；结构 chrome（导航标签/图标/品牌/答题卡数字）
   用 min(rem, px) 加上限防溢出；纯图形（热力图/进度条/边框）不随字号缩放。
   v1.9c：卡片/选项/表格/知识卡/法规条/横幅/筛选条/toast 等文字容器的内边距、间距、最小高度全部 em/clamp 化，
   随档位同步放大——大字配大盒，避免"字号放大后容器仍按旧 px 挤小字"。 */
/* ================= v2.0 设计令牌（重构层，见 00_总览与文档\13_设计系统重构方案_v2.0.md §3） ================= */
:root {
  color-scheme: light;
  /* 灰阶 Slate */ --slate-50:#f8fafc; --slate-100:#f1f5f9; --slate-200:#e2e8f0; --slate-300:#cbd5e1;
  --slate-400:#94a3b8; --slate-500:#64748b; --slate-600:#475569; --slate-700:#334155;
  --slate-800:#1e293b; --slate-900:#0f172a; --slate-950:#020617;
  /* 主色蓝 */ --blue-50:#eff6ff; --blue-100:#dbeafe; --blue-200:#bfdbfe; --blue-300:#93c5fd;
  --blue-400:#60a5fa; --blue-500:#3b82f6; --blue-600:#2563eb; --blue-700:#1d4ed8;
  --blue-800:#1e40af; --blue-900:#1e3a8a; --blue-950:#172554;
  /* ok 绿 */ --green-50:#f0fdf4; --green-100:#dcfce7; --green-200:#bbf7d0; --green-300:#86efac;
  --green-400:#4ade80; --green-500:#22c55e; --green-600:#16a34a; --green-700:#15803d;
  --green-800:#166534; --green-900:#14532d;
  /* bad 红 */ --red-50:#fef2f2; --red-100:#fee2e2; --red-200:#fecaca; --red-300:#fca5a5;
  --red-400:#f87171; --red-500:#ef4444; --red-600:#dc2626; --red-700:#b91c1c;
  --red-800:#991b1b; --red-900:#7f1d1d;
  /* warn 琥珀 */ --amber-50:#fffbeb; --amber-100:#fef3c7; --amber-200:#fde68a; --amber-300:#fcd34d;
  --amber-400:#fbbf24; --amber-500:#f59e0b; --amber-600:#d97706; --amber-700:#b45309;
  --amber-800:#92400e; --amber-900:#78350f;
  /* 语义层（浅色） */
  --surface-page:#f6f8fa; --surface-card:#ffffff; --surface-sunken:#f1f5f9; --surface-hover:#f8fafc;
  --surface-brand:#0f172a; --surface-toast:rgba(15,23,42,.92); --hover-on-brand:rgba(255,255,255,.08);
  --bg-track:#e5e7eb;
  --line-1:#e3e8ef; --line-2:#cbd5e1; --line-3:#94a3b8; --line-on-brand:rgba(255,255,255,.25);
  --text-1:#1f2937; --text-2:#526074; --text-3:#64748b; --text-invert:#ffffff; --text-on-brand:#cbd5e1;
  --pri:var(--blue-600); --pri-hover:var(--blue-700); --pri-active:var(--blue-800);
  --pri-soft:var(--blue-50); --pri-ring:rgba(37,99,235,.35);
  --ok:var(--green-600); --ok-strong:var(--green-700); --ok-soft:var(--green-50); --ok-line:var(--green-200);
  --bad:var(--red-700); --bad-hover:var(--red-800); --bad-soft:var(--red-50); --bad-line:var(--red-200);
  --warn:var(--amber-500); --warn-strong:var(--amber-700); --warn-ink:var(--amber-800);
  --warn-soft:var(--amber-50); --warn-line:var(--amber-200);
  --info:var(--blue-900); --info-soft:var(--blue-50);
  --focus-ring:var(--blue-600);
  --heat-0:#e5e7eb; --heat-1:var(--blue-200); --heat-2:var(--blue-300); --heat-3:var(--blue-400);
  --heat-4:var(--blue-500); --heat-5:var(--blue-700);
  --grad-brand:linear-gradient(135deg,#0f172a,#1e3a8a); --grad-btn:linear-gradient(180deg,#3b82f6,#2563eb);
  /* 兼容别名（旧名桥接，全站替换后可删） */ --bd:var(--line-1); --fg:var(--text-1); --dim:var(--text-2);
  --bg:var(--surface-page); --card:var(--surface-card);
  /* 圆角阶梯 */ --r-xs:4px; --r-sm:6px; --r-md:8px; --r-lg:12px; --r-xl:14px; --r-2xl:24px; --r-full:999px;
  /* 阴影阶梯 */ --shadow-xs:0 1px 2px rgba(15,23,42,.05);
  --shadow-sm:0 1px 3px rgba(15,23,42,.10), 0 1px 2px rgba(15,23,42,.06);
  --shadow-md:0 4px 6px -1px rgba(15,23,42,.10), 0 2px 4px -2px rgba(15,23,42,.06);
  --shadow-lg:0 10px 15px -3px rgba(15,23,42,.10), 0 4px 6px -4px rgba(15,23,42,.05);
  --shadow-xl:0 20px 25px -5px rgba(15,23,42,.15), 0 8px 10px -6px rgba(15,23,42,.05);
  --shadow-2xl:0 25px 50px -12px rgba(15,23,42,.25); --shadow-up:0 -2px 12px rgba(15,23,42,.08);
  --ring-mark:0 0 0 2px var(--warn);
  /* 间距阶梯 */ --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:20px; --sp-6:24px;
  --sp-8:32px; --sp-10:40px; --sp-12:48px; --sp-16:64px;
  --em-1:.25em; --em-2:.5em; --em-3:.75em; --em-4:1em; --em-5:1.5em; --em-6:2em;
  /* 字号/行高 */ --fs-2xs:.8125rem; --fs-xs:.875rem; --fs-sm:.9375rem; --fs-md:1rem;
  --fs-lg:1.0625rem; --fs-xl:1.1875rem; --fs-2xl:1.25rem; --fs-3xl:1.375rem; --fs-4xl:1.5rem; --fs-hero:2rem;
  --cap-aux:18px; --lh-tight:1.3; --lh-base:1.6; --lh-reading:1.75; --lh-loose:1.8;
  /* z-index/字体/断点 */ --z-sticky:10; --z-filter:50; --z-dock:60; --z-nav:200; --z-toast:999;
  --font-sans:"Segoe UI","PingFang SC","Microsoft YaHei","Noto Sans SC",system-ui,sans-serif;
  --ease-out:cubic-bezier(.2,.8,.2,1);
}
html[data-font='L'] { --cap-aux:20px; }
html[data-font='XL'] { --cap-aux:22px; }
html[data-font='XXL'] { --cap-aux:24px; }
/* ================= 深色：语义层重定义（v2.0 语义层 + v2.5 手动开关双轨） =================
   跟随系统（未选 data-theme 或 data-theme 非 light）与手动 html[data-theme='dark'] 同值；
   手动 html[data-theme='light'] 时排除系统深色覆盖、强制浅色。 */
@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) {
    color-scheme: dark;
    --surface-page:var(--slate-900); --surface-card:var(--slate-800); --surface-sunken:#263449; --surface-hover:#263449;
    --surface-brand:var(--slate-950); --surface-toast:rgba(30,41,59,.95); --hover-on-brand:rgba(255,255,255,.1);
    --bg-track:#334155;
    --line-1:var(--slate-700); --line-2:var(--slate-600); --line-3:var(--slate-500);
    --text-1:var(--slate-200); --text-2:var(--slate-400); --text-3:var(--slate-500);
    --pri:var(--blue-500); --pri-hover:var(--blue-400); --pri-active:var(--blue-300);
    --pri-soft:#1e3a8a; --pri-ring:rgba(59,130,246,.4);
    --ok:var(--green-500); --ok-strong:var(--green-400); --ok-soft:#052e16; --ok-line:var(--green-600);
    --bad:var(--red-400); --bad-soft:#450a0a; --bad-line:var(--red-700);
    --warn:var(--amber-400); --warn-strong:var(--amber-300); --warn-soft:#451a03; --warn-ink:var(--amber-200); --warn-line:var(--amber-800);
    --info:var(--blue-300); --info-soft:#1e3a8a; --focus-ring:var(--blue-400); --heat-0:var(--slate-700);
    --shadow-sm:0 1px 3px rgba(0,0,0,.4); --shadow-md:0 4px 6px -1px rgba(0,0,0,.5);
    --shadow-lg:0 10px 15px -3px rgba(0,0,0,.6); --shadow-2xl:0 25px 50px -12px rgba(0,0,0,.7);
    --shadow-up:0 -2px 12px rgba(0,0,0,.4); --grad-brand:linear-gradient(135deg,#020617,#1e3a8a);
  }
}
html[data-theme='dark'] {
  color-scheme: dark;
  --surface-page:var(--slate-900); --surface-card:var(--slate-800); --surface-sunken:#263449; --surface-hover:#263449;
  --surface-brand:var(--slate-950); --surface-toast:rgba(30,41,59,.95); --hover-on-brand:rgba(255,255,255,.1);
  --bg-track:#334155;
  --line-1:var(--slate-700); --line-2:var(--slate-600); --line-3:var(--slate-500);
  --text-1:var(--slate-200); --text-2:var(--slate-400); --text-3:var(--slate-500);
  --pri:var(--blue-500); --pri-hover:var(--blue-400); --pri-active:var(--blue-300);
  --pri-soft:#1e3a8a; --pri-ring:rgba(59,130,246,.4);
  --ok:var(--green-500); --ok-strong:var(--green-400); --ok-soft:#052e16; --ok-line:var(--green-600);
  --bad:var(--red-400); --bad-soft:#450a0a; --bad-line:var(--red-700);
  --warn:var(--amber-400); --warn-strong:var(--amber-300); --warn-soft:#451a03; --warn-ink:var(--amber-200); --warn-line:var(--amber-800);
  --info:var(--blue-300); --info-soft:#1e3a8a; --focus-ring:var(--blue-400); --heat-0:var(--slate-700);
  --shadow-sm:0 1px 3px rgba(0,0,0,.4); --shadow-md:0 4px 6px -1px rgba(0,0,0,.5);
  --shadow-lg:0 10px 15px -3px rgba(0,0,0,.6); --shadow-2xl:0 25px 50px -12px rgba(0,0,0,.7);
  --shadow-up:0 -2px 12px rgba(0,0,0,.4); --grad-brand:linear-gradient(135deg,#020617,#1e3a8a);
}
html[data-theme='light'] { color-scheme: light; }
html { font-size: 18px; }
html[data-font='L'] { font-size: 26px; }
html[data-font='XL'] { font-size: 34px; }
html[data-font='XXL'] { font-size: 40px; }
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-sans); background: var(--bg); color: var(--fg); line-height: var(--lh-base); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
header { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: var(--surface-brand); color: #fff; }
.brand { display: flex; align-items: center; gap: .5em; font-weight: 700; font-size: min(1.0625rem, 24px); white-space: nowrap; }
.brand-mark { width: 1.6em; height: 1.6em; flex: none; color: #fff; }
.brand-name { margin: 0; font-size: inherit; font-weight: 700; line-height: var(--lh-tight); }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav button { display: inline-flex; align-items: center; gap: .4em; background: transparent; color: var(--text-on-brand); border: none; padding: 8px 12px; border-radius: var(--r-full); cursor: pointer; font-size: min(.9375rem, 20px); }
.nav-ico { display: inline-flex; align-items: center; justify-content: center; font-size: min(1.0625rem, 22px); }
.nav-ico .ico { width: 1.1em; height: 1.1em; }
nav button.on { background: var(--pri); color: #fff; }
.toolbox { display: flex; gap: 4px; align-items: center; }
.toolbox button { border-color: var(--line-on-brand); color: var(--text-on-brand); background: transparent; font-size: min(.875rem, 16px); }
.userbox { display: flex; align-items: center; gap: 10px; font-size: min(.875rem, 16px); color: var(--text-on-brand); }
.userbox button { font-size: min(1rem, 18px); }
/* v2.0 通用图标（icons.js 的 41 个 SVG 共用，随字号/深色自动适配） */
.ico { width: 1.1em; height: 1.1em; vertical-align: -.18em; flex: none; pointer-events: none; }
.ico-sm { width: .9em; height: .9em; vertical-align: -.12em; }
button { cursor: pointer; border-radius: 8px; border: 1px solid var(--bd); background: var(--surface-card); padding: .6em 1.1em; font-size: 1rem; min-height: max(44px, 2.75em); }
button.primary { background: var(--grad-btn); color: #fff; border-color: var(--pri); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
button.primary:hover { background: var(--pri-hover); }
button:active:not(:disabled) { transform: scale(.98); }
button.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
/* 交卷：桌面用描边态弱化"错误红"压迫感，手机保留实心保证触控辨识（v2.1） */
#ex-submit { background: transparent; color: var(--bad); border-color: var(--bad); }
#ex-submit:hover { background: var(--bad-soft); }
@media (max-width: 700px) {
  #ex-submit { background: var(--bad); color: #fff; }
  #ex-submit:hover { background: var(--bad-hover); }
}
button.ghost { background: transparent; }
button.small { padding: .55em .85em; font-size: min(.875rem, 18px); }
button:disabled { opacity: .5; cursor: not-allowed; }
main { padding: 16px 20px 40px; max-width: min(72rem, 1440px); margin: 0 auto; }
/* 阅读宽度收敛（v1.8）：题目主列 ≤40rem 居中，宽屏不再一题横跨整屏（中文 45 字/行舒适线） */
#study-card, #pt-card, #ex-qcard { max-width: 40rem; margin-inline: auto; }
.kb-content, .kb-overview, .law { max-width: 46rem; }
.card { background: var(--card); border: 1px solid var(--bd); border-radius: 14px; padding: clamp(18px, 1.5rem, 36px) clamp(20px, 1.75rem, 42px); margin-bottom: 18px; box-shadow: var(--shadow-sm); transition: box-shadow .16s var(--ease-out), border-color .16s var(--ease-out); }
.hidden { display: none !important; }
.dim { color: var(--dim); font-size: min(.875rem, 18px); }
h2 { font-size: 1.25rem; font-weight: 700; margin: 0 0 .6em; text-wrap: balance; }
h3 { font-size: 1.1875rem; }
h4 { font-size: 1.125rem; }
.row-between h2 { margin: 0; }
.card h2 { margin-top: 0; }
/* v2.1 大字号档协调：信息行计数标题封顶，避免 XXL 下与相邻小控件比例崩塌 */
#study-count { font-size: min(1.0625rem, 22px); }
#study-today { white-space: normal; }
/* 筛选/重置成组靠右：换行时两键同行不被拆散 */
#f-apply { margin-left: auto; }
.row-between { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6em; gap: .6em; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1em; }
@media (max-width: 860px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.filterbar { display: flex; gap: .5em; align-items: center; padding: .6em 1.1em; background: var(--surface-card); border-bottom: 1px solid var(--bd); flex-wrap: wrap; font-size: min(.875rem, var(--cap-aux)); }
.filterbar label { color: var(--dim); }
select, input[type=text], input[type=password], input[type=number] { padding: .6em .7em; border: 1px solid var(--bd); border-radius: 8px; font-size: min(1rem, 20px); background: var(--surface-card); }
/* 数字输入去掉原生 spinner（与自绘控件风格统一，v2.1） */
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
/* 浏览器自动填充去黄/灰底（保留填充能力，只统一底色，v2.1） */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--surface-card) inset;
  -webkit-text-fill-color: var(--fg);
  border-color: var(--bd) !important;
  transition: background-color 9999s ease-out 0s;
  caret-color: var(--fg);
}
/* 原生 checkbox rem 化：随字号档位同步放大（v1.9 组件同步缩放），否则超大字号下勾选框显得过小 */
input[type=checkbox] { width: min(1.25rem, 24px); height: min(1.25rem, 24px); min-width: 20px; min-height: 20px; accent-color: var(--pri); vertical-align: middle; }
.stem { font-size: 1.25rem; line-height: 1.75; margin: 12px 0 16px; font-weight: 600; text-wrap: pretty; }
.qhead { color: var(--dim); font-size: min(.875rem, 18px); margin-bottom: 4px; }
.tag { background: var(--pri-soft); color: var(--pri-hover); padding: .15em .5em; border-radius: var(--r-sm); margin-left: .5em; font-size: min(.8125rem, 16px); }
.opts { display: flex; flex-direction: column; gap: .8em; }
.opt { display: flex; gap: .7em; align-items: flex-start; padding: .8em 1em; border: 1px solid var(--bd); border-radius: 12px; cursor: pointer; line-height: 1.65; font-size: 1.0625rem; min-height: 3em; }
.opt:hover { background: var(--surface-hover); }
.opt[aria-checked='true'] { border-color: var(--pri); background: var(--pri-soft); }
.opt .k { font-weight: 700; color: var(--pri); min-width: 1.5em; }
.opt.ok { border-color: var(--ok); background: var(--ok-soft); }
.opt.bad { border-color: var(--bad); background: var(--bad-soft); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right::after { content: '✓'; color: var(--ok-strong); font-weight: 700; margin-left: auto; padding-left: .5em; flex: none; }
.opt.bad::after { content: '✗'; color: var(--bad); font-weight: 700; margin-left: auto; padding-left: .5em; flex: none; }
/* 练习/考试作答中的"选中态"用主色，绿色只留给判分后的正确答案（v2.2 语义收敛） */
#ex-opts .opt.ok, #pt-opts .opt.ok { border-color: var(--pri); background: var(--pri-soft); }
.feedback { margin: 1em 0; padding: .8em 1em; border-radius: var(--r-lg); background: var(--surface-hover); border: 1px dashed var(--bd); line-height: 1.7; }
.feedback.ok { background: var(--ok-soft); border-color: var(--ok); }
.feedback.bad { background: var(--bad-soft); border-color: var(--bad); }
.sheet { display: flex; flex-wrap: wrap; gap: .4em; margin-top: .7em; }
.sheet button { min-width: min(2.25rem, 44px); min-height: 40px; padding: .4em .5em; position: relative; font-size: min(1rem, 22px); }
.sheet button.done { background: var(--ok-soft); border-color: var(--ok); }
.sheet button.done::after { content: '✓'; position: absolute; top: 0; right: 2px; font-size: .62em; line-height: 1.2; color: var(--ok); }
.sheet button.marked { box-shadow: var(--ring-mark); }
.sheet button.cur { background: var(--pri); color: var(--text-invert); }
.tbl { width: 100%; border-collapse: collapse; font-size: min(.9375rem, 18px); }
.tbl th, .tbl td { border-bottom: 1px solid var(--bd); padding: .65em .75em; text-align: left; }
/* 窄屏横向滚动包装：管理表7列/成绩表6列在 320px 不再把整页撑出横向滚动；min-width 用 em 随字号档位同步放大 */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl-wrap .tbl { min-width: 30em; }
/* 视觉隐藏（仅供屏幕阅读器）：表单 label 等 */
.vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.statline { display: flex; gap: 1.4em; flex-wrap: wrap; font-size: 1rem; }
.statline b { font-size: 1.5rem; color: var(--pri); }
.bar { height: 8px; border-radius: var(--r-xs); background: var(--bg-track); margin: 4px 0 12px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--pri); }
.hotlist { columns: 2; gap: 1.3em; }
@media (max-width: 700px) { .hotlist { columns: 1; } }
.hotlist li { margin-bottom: 6px; font-size: .9375rem; }
.msg { color: var(--bad); font-size: min(.875rem, 18px); min-height: 1.25em; }
/* v1.9b 登录/注册卡片放大：与大字正文匹配——桌面默认 648px（min(36rem,720px) 随档放大至 720px），
   内边距/控件间距随字号档位同步缩放；v1.9 双端字号：桌面标题 36px/副标题 22.5px/输入 22.5px/按钮 24.75px，
   手机根字号 25px 下对应 40/30/31.25/34.4px；标题/按钮加 px 上限避免超大档溢出 */
.auth-wrap { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 100vh; min-height: 100svh; min-height: 100dvh; background: var(--grad-brand); padding: 24px 16px; }
.auth-wrap::before, .auth-wrap::after { content: ''; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .3; pointer-events: none; }
.auth-wrap::before { width: 320px; height: 320px; background: var(--blue-600); top: -80px; right: -60px; }
.auth-wrap::after { width: 260px; height: 260px; background: var(--blue-800); bottom: -70px; left: -50px; }
.auth-card { position: relative; background: var(--surface-card); border-radius: 24px; padding: clamp(40px, 3rem, 72px) clamp(28px, 2.75rem, 64px); width: min(36rem, 720px); max-width: calc(100vw - 32px); box-shadow: var(--shadow-2xl); }
.auth-card h1 { font-size: min(2rem, 40px); line-height: 1.4; margin: 0 0 12px; }
.auth-card h1 .brand-mark { width: 1.05em; height: 1.05em; vertical-align: -.12em; }
.auth-card .sub { color: var(--dim); margin: 0 0 32px; font-size: min(1.25rem, 26px); }
@media (max-width: 700px) { .auth-card h1 .auth-line, .auth-card .sub .auth-line { display: block; } }
.auth-card input { width: 100%; margin-bottom: 1.1em; font-size: 1.25rem; padding: 1em .9em; border-radius: 12px; }
.auth-card input::placeholder { color: var(--text-3); }
.auth-card .primary { width: 100%; font-size: min(1.375rem, 32px); font-weight: 600; min-height: 66px; }
.auth-card .msg { font-size: min(1.125rem, 22px); min-height: 1.5em; }
.tabs { display: flex; gap: 4px; margin-bottom: 1.5em; background: var(--surface-sunken); border-radius: var(--r-lg); padding: 4px; }
.tabs button { flex: 1; font-size: min(1.25rem, 26px); min-height: 58px; border: none; background: transparent; color: var(--text-2); border-radius: calc(var(--r-lg) - 4px); }
.tabs button.on { background: var(--grad-btn); color: #fff; box-shadow: var(--shadow-sm); }
.mini { display: flex; gap: .4em; align-items: center; }
.report-head { font-size: 1.375rem; margin-bottom: 8px; }
.pass { color: var(--ok-strong); font-weight: 700; }
.fail { color: var(--bad); font-weight: 700; }
.wrongitem { border-left: 3px solid var(--bad); padding: .7em .8em; margin: .5em 0; background: var(--bad-soft); border-radius: 0 8px 8px 0; font-size: .9375rem; line-height: 1.7; }
/* v1.9 大字号防长串溢出：无空格连续串（英文条款/代码）在超大档位下强制断行 */
.stem, .opt, .opt span, .feedback, .wrongitem, #toast, .kb-content, .kb-card p, .deep-sec > div, .law { overflow-wrap: anywhere; }

/* ---------- 深度学习体系 ---------- */
.deep { margin-top: .6em; border-top: 1px solid var(--bd); padding-top: .5em; font-size: .9375rem; }
.deep-sec { margin: .6em 0; }
.deep-sec > b { color: var(--info); }
.deep-sec > b .ico { color: var(--pri); }
.deep-sec > div { margin-top: .25em; line-height: 1.75; white-space: normal; }
.deep-sec.trap { background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 8px; padding: .7em .8em; }
.deep-sec.trap > b { color: var(--warn-strong); }
.law { background: var(--surface-sunken); border-left: 3px solid var(--line-3); padding: .7em .8em; margin: .4em 0; border-radius: 0 6px 6px 0; color: var(--text-2); line-height: 1.7; font-size: .9375rem; }
blockquote.law { margin: 6px 0; font-size: .9375rem; }
.kb-open { margin: .25em .4em .25em 0; text-align: left; }
.kb-open.on { border-color: var(--pri); color: var(--pri); background: var(--pri-soft); }
.kb-inline { margin-top: 6px; }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(14rem, 260px), 1fr)); gap: .8em; padding-bottom: .5em; }
.kb-card { border: 1px solid var(--bd); border-radius: var(--r-lg); padding: .9em 1em; cursor: pointer; background: var(--surface-card); box-shadow: var(--shadow-xs); }
.kb-card:hover { border-color: var(--pri); box-shadow: var(--shadow-md); }
.kb-card h4 { margin: 0 0 .25em; font-size: 1.0625rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-card p { margin: 0 0 .4em; font-size: 1rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.kb-card .mini { font-size: min(.8125rem, 16px); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-card-full h3 { margin: 0 0 4px; }
.kb-overview { background: var(--pri-soft); border-radius: 8px; padding: .8em .9em; margin: .6em 0; line-height: 1.75; font-size: 1rem; }
.kb-sec { border: 1px solid var(--bd); border-radius: 8px; padding: .55em .8em; margin: 8px 0; }
.kb-sec summary { cursor: pointer; font-weight: 600; color: var(--info); min-height: 44px; display: flex; align-items: center; font-size: 1.0625rem; }
.kb-content { margin-top: 8px; line-height: 1.75; font-size: 1rem; }
.kb-sec .kb-practice { margin-top: 8px; }
.trap-item { margin: 4px 0; line-height: 1.65; }
.formrow { display: flex; gap: .6em; align-items: center; flex-wrap: wrap; margin: 10px 0; }

/* ---------- v2.0 新组件类（icons.js/结构升级配套，2026 视觉现代化） ---------- */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 999; }
.skip-link:focus { left: 12px; top: 12px; background: var(--surface-card); color: var(--fg); padding: .6em 1em; border-radius: 8px; box-shadow: var(--shadow-md); }
.dot { display: inline-block; width: .9em; height: .9em; border-radius: 50%; vertical-align: -.1em; margin-right: .3em; }
.dot-done { background: var(--ok); } .dot-marked { background: var(--warn); } .dot-cur { background: var(--pri); }
.st-today, .st-streak { display: inline-flex; align-items: center; gap: .3em; white-space: nowrap; }
.st-streak .ico { color: var(--warn); }
.pt-summary-stats { display: flex; gap: 1em; flex-wrap: wrap; margin: 1em 0; }
.pt-stat { flex: 1 1 0; min-width: min(10rem, 100%); text-align: center; background: var(--surface-sunken); border-radius: var(--r-lg); padding: .9em .5em; }
.pt-num { display: block; font-size: min(1.75rem, 32px); color: var(--pri); font-variant-numeric: tabular-nums; }
.pt-stat .dim { display: block; margin-top: .3em; }
.heat-wrap { max-width: 860px; }
.heat-row { display: flex; align-items: center; gap: .4em; margin-bottom: 3px; }
.heat-month { width: 2.4em; flex: none; text-align: right; font-size: min(.75rem, 14px); color: var(--dim); white-space: nowrap; }
.heat-row .heat-grid { flex: 1; display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; max-width: 860px; }
.heat-legend { margin-top: 8px; }
.heat-empty { margin: .5em 0 0; }
.pt-summary-actions, .report-actions { display: flex; gap: .7em; flex-wrap: wrap; margin-top: 1.2em; }
/* 骨架屏（v2.5） */
.skel { background: linear-gradient(90deg, var(--surface-sunken) 25%, var(--surface-hover) 50%, var(--surface-sunken) 75%); background-size: 200% 100%; animation: skel 1.4s infinite; border-radius: var(--r-sm); }
@keyframes skel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
/* 管理表移动端卡片化（v2.5）：桌面表格、手机卡片列表 */
#view-admin .ad-cards { display: none; }
@media (max-width: 700px) {
  #view-admin .tbl-wrap { display: none; }
  #view-admin .ad-cards { display: grid; gap: .7em; }
  .ad-card { background: var(--surface-card); border: 1px solid var(--bd); border-radius: var(--r-lg); padding: .8em .9em; box-shadow: var(--shadow-xs); }
  .ad-card-head { display: flex; justify-content: space-between; align-items: center; gap: .6em; margin-bottom: .5em; flex-wrap: wrap; }
  .ad-card-user { color: var(--dim); font-size: min(.875rem, var(--cap-aux)); }
  .ad-card-stats { display: flex; flex-wrap: wrap; gap: .4em 1em; font-size: min(.875rem, var(--cap-aux)); color: var(--dim); }
  .ad-card-stats b { color: var(--pri); font-variant-numeric: tabular-nums; }
}
.banner-txt { display: inline-flex; align-items: center; gap: .5em; flex: 1 1 auto; min-width: 0; }
.banner-txt .ico { color: var(--warn-ink); }
.banner-meta { display: inline-flex; align-items: center; gap: .6em; flex-wrap: wrap; }

/* ---------- 交互与外观打磨 ---------- */
/* 触控优化（全局）：消除点击高亮与双击缩放延迟 */
.opt, .sheet button, .kb-card { -webkit-tap-highlight-color: transparent; touch-action: manipulation; -webkit-touch-callout: none; }
#toast { position: fixed; right: 24px; bottom: 28px; left: auto; transform: translateY(20px); background: var(--surface-toast); color: var(--text-invert); padding: .8em 1.1em; border-radius: 10px; font-size: min(.9375rem, 17px); max-width: min(60vw, 420px); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease-out), transform .25s var(--ease-out); z-index: var(--z-toast); box-shadow: var(--shadow-lg); }
#toast.show { opacity: 1; transform: translateY(0); }
.mode-mobile #toast { right: auto; left: 50%; transform: translate(-50%, 20px); max-width: min(88vw, 420px); }
.mode-mobile #toast.show { transform: translate(-50%, 0); }
button { transition: background .15s, border-color .15s, color .15s; }
button.primary:hover { background: var(--pri-hover); }
button.danger:hover { background: var(--bad-hover); }
button.ghost:hover { background: var(--surface-sunken); }
button:focus-visible, .opt:focus-visible, .kb-card:focus-visible, .sheet button:focus-visible, nav button:focus-visible, summary:focus-visible,
select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.opt { transition: border-color .15s, background .15s; }
.opt:active { transform: scale(.995); }
.kb-card { transition: border-color .15s, box-shadow .15s; }
nav button:hover { background: var(--hover-on-brand); }
.tbl tr:nth-child(even) td { background: var(--surface-hover); }
.sheet-legend { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
/* 考试顶栏吸顶：倒计时/进度/交卷始终可见 */
.exam-topbar { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--card); padding: .5em 0; margin-bottom: 10px; border-bottom: 1px solid var(--bd); box-shadow: var(--shadow-xs); }

/* ---------- 学习系统扩展：公告 / 热力图 / 笔记反馈 / 每日目标 ---------- */
.banner { display: flex; justify-content: space-between; align-items: center; gap: .75em; background: var(--warn-soft); border-bottom: 1px solid var(--warn-line); color: var(--warn-ink); padding: .55em 1.1em; font-size: min(.9375rem, 18px); flex-wrap: wrap; }
.goal-input { width: min(4em, 110px); padding: .2em .3em; font-size: min(1rem, 24px); }
.mini label { font-size: min(.9375rem, var(--cap-aux)); }
#study-tools textarea { width: 100%; min-height: max(72px, 4.5em); margin: 8px 0; padding: .6em .7em; border: 1px solid var(--bd); border-radius: 8px; font-size: 1rem; font-family: inherit; resize: vertical; }
#study-tools select { margin: 8px 8px 8px 0; max-width: 220px; }
#study-note-wrap .mini, #study-fb-wrap .mini { margin-top: 4px; }
.heat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13px, 1fr)); gap: 3px; max-width: 860px; }
.heat-grid i { display: inline-block; width: 100%; aspect-ratio: 1; border-radius: 3px; background: var(--heat-0); }
.heat-grid i.h1 { background: var(--heat-1); }
.heat-grid i.h2 { background: var(--heat-2); }
.heat-grid i.h3 { background: var(--heat-3); }
.heat-grid i.h4 { background: var(--heat-4); }
.heat-grid i.h5 { background: var(--heat-5); }
#st-heat .dim i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin: 0 1px; }
#st-heat .dim i.h0 { background: var(--heat-0); } #st-heat .dim i.h1 { background: var(--heat-1); } #st-heat .dim i.h2 { background: var(--heat-2); } #st-heat .dim i.h3 { background: var(--heat-3); } #st-heat .dim i.h4 { background: var(--heat-4); } #st-heat .dim i.h5 { background: var(--heat-5); }
@media (max-width: 700px) {
  .banner { font-size: min(.9375rem, 18px); padding: .5em .6em; }
  .heat-grid { grid-template-columns: repeat(auto-fill, minmax(10px, 1fr)); gap: 2px; }
  #ad-announce-text { flex-basis: 100%; }
}

/* ---------- 移动端优化（≤700px）：字号 / 触控热区 / 布局 ----------
    依据：iOS 输入框字号<16px 会触发聚焦自动缩放；Apple HIG 建议点击目标≥44pt；
    WCAG 2.5.5 目标尺寸(AAA)≥44px；Material 触控目标 48dp。
    v1.8：题干 22.5px、选项 20.25px、按钮 19.1px、辅助文字 15.75px，消灭 13px 以下小字。
    v1.9→v2.5：手机档位由"每档+7"改为等比 25/32/40/48，默认即 25px；M 档实测题干 31.25px、
    选项 28.1px、基础 26.6px、按钮 26.6px、辅助 21.9px；登录/注册页双端加大见 v1.9 专项 */
@media (max-width: 700px) {
  html { font-size: 25px; }
  html[data-font='L'] { font-size: 32px; }
  html[data-font='XL'] { font-size: 40px; }
  html[data-font='XXL'] { font-size: 48px; }
  body { font-size: 1.0625rem; }
  header { gap: 6px; padding: 8px 10px; }
  .brand { font-size: min(.9375rem, 20px); }
  .userbox { font-size: min(.875rem, 16px); gap: 6px; }
  nav { gap: 2px; }
  nav button { padding: 10px 8px; font-size: min(.875rem, 18px); min-height: 44px; }
  nav button .nav-ico { font-size: min(1.125rem, 24px); }
  main { padding: 12px 12px 48px; }
  .card { padding: clamp(14px, 1rem, 28px) clamp(12px, .8rem, 22px); margin-bottom: 12px; border-radius: 12px; }
  h2 { font-size: 1.1875rem; }
  h3 { font-size: 1.125rem; }
  h4 { font-size: 1.0625rem; }
  .stem { font-size: 1.25rem; line-height: 1.75; }
  .qhead { font-size: min(.875rem, 18px); margin-bottom: 6px; }
  .tag { font-size: min(.875rem, 16px); padding: .15em .4em; margin-left: 6px; }
  .opts { gap: .7em; }
  .opt { padding: .75em .7em; font-size: 1.125rem; line-height: 1.65; gap: .65em; min-height: max(52px, 2.6em); }
  .opt .k { font-size: 1.125rem; min-width: 1.5em; }
  button { padding: .7em .9em; font-size: min(1.0625rem, 22px); }
  button.small { padding: .5em .8em; font-size: min(1rem, 18px); min-height: 44px; }
  .mini { gap: .4em; flex-wrap: wrap; }
  select, input[type=text], input[type=password], input[type=number], textarea { font-size: min(1.0625rem, 20px); padding: .55em .55em; max-width: 100%; }
  textarea { width: 100%; }
  select { min-width: 0; min-height: 44px; }
  #kb-kw { flex: 1 1 100%; min-width: 0; }
  #kb-group { flex: 1 1 auto; max-width: 100%; }
  .filterbar { gap: .5em .7em; padding: .55em .6em; font-size: min(1rem, 18px); }
  .filterbar input[type=text] { flex: 1 1 100%; }
  .feedback, .deep { font-size: 1rem; }
  .deep-sec > div { line-height: 1.8; }
  .deep-sec.trap { padding: .6em .7em; }
  .law, blockquote.law { font-size: .9375rem; padding: .6em .7em; }
  .kb-grid { grid-template-columns: minmax(0, 1fr); }
  .kb-card { padding: .8em .7em; }
  .kb-card h4 { font-size: 1.0625rem; }
  .kb-overview, .kb-content { font-size: 1rem; line-height: 1.8; }
  .sheet { gap: .4em; }
  .sheet button { min-width: 44px; min-height: 44px; font-size: min(1rem, 22px); }
  .tbl { font-size: min(.9375rem, 18px); }
  .tbl th, .tbl td { padding: .55em .5em; }
  .statline { font-size: 1rem; gap: .9em; }
  .statline b { font-size: 1.5rem; }
  .wrongitem { font-size: 1rem; padding: .6em .6em; }
  .trap-item { font-size: .9375rem; }
  .hotlist { columns: 1; }
  .hotlist li { font-size: 1rem; margin-bottom: 8px; }
  .auth-card { padding: clamp(36px, 2.2rem, 56px) clamp(20px, 1.4rem, 36px); width: 100%; max-width: 560px; }
  .auth-card h1 { font-size: min(1.6rem, 44px); }
  .auth-card .sub { font-size: min(1.2rem, 30px); }
  .auth-card input { font-size: 1.25rem; padding: .75em .6em; margin-bottom: .75em; }
  .tabs button { font-size: min(1.2rem, 30px); min-height: 60px; }
  .auth-card .primary { font-size: min(1.375rem, 36px); min-height: 64px; }
  .auth-card .msg { font-size: min(1.125rem, 26px); }
  .formrow { gap: .5em .7em; }
  #ex-clock { font-size: min(1.0625rem, 26px); }
}

/* ---------- v2.0 2026 设备适配层（E13/C3 落地；基础规则与字面量原样保留） ----------
   平板字号带 701-1023px：根 22/28/36/44px（触屏平板不再白吃手机 25px 大字，横竖版均可读）；
   大屏 ≥1200px 题目列放宽（44rem）+ 知识内容 52rem；≥1440px 主体 88rem/1600px + 热榜 3 列；
   平板两栏考试 721-860px 补充（861+ 原有两栏规则不动）。 */
@media (min-width: 701px) and (max-width: 1023px) {
  html { font-size: 22px; }
  html[data-font='L'] { font-size: 28px; }
  html[data-font='XL'] { font-size: 36px; }
  html[data-font='XXL'] { font-size: 44px; }
}
@media (min-width: 1200px) {
  #study-card, #pt-card, #ex-qcard { max-width: 44rem; }
  .kb-content, .kb-overview, .law { max-width: 52rem; }
}
@media (min-width: 1440px) {
  main { max-width: min(88rem, 1600px); }
  .hotlist { columns: 3; }
}
@media (min-width: 721px) and (max-width: 860px) {
  #exam-run { display: grid; grid-template-columns: minmax(0, 1fr) clamp(240px, 30vw, 340px); gap: 10px; align-items: start; }
  #exam-run .exam-topbar { grid-column: 1 / -1; }
  #exam-run .sheet { grid-column: 2; grid-row: 2; position: sticky; top: 48px; margin-top: 0; }
  #exam-run > .card { grid-column: 1; grid-row: 2; margin-bottom: 0; }
  #exam-run .sheet-legend { grid-column: 2; grid-row: 3; margin-top: 0; }
}
/* 横向安全区（刘海横屏） */
@media (orientation: landscape) and (max-width: 1023px) {
  .mode-mobile main { padding-left: calc(12px + env(safe-area-inset-left)); padding-right: calc(12px + env(safe-area-inset-right)); }
}

/* ---------- 手机版结构模式（body.mode-mobile，JS 按设备自动判定/可手动切换） ----------
    竖版：底部标签导航（图标+文字分离，拇指热区）+ 紧凑头部 + 筛选抽屉 + 安全区适配；横版：考试两栏。 */
/* 移动端头部两行布局：品牌独占首行（不再截断），操作控件第二行（v2.1） */
.mode-mobile header { padding: calc(6px + env(safe-area-inset-top)) 8px 6px; gap: 6px; flex-wrap: wrap; row-gap: 4px; }
.mode-mobile .brand { flex: 1 1 100%; font-size: min(.875rem, 20px); }
.mode-mobile .toolbox { gap: 2px; flex-shrink: 0; }
.mode-mobile .toolbox button { padding: .5em; font-size: min(.875rem, 16px); white-space: nowrap; min-height: 44px; }
.mode-mobile .userbox { gap: 4px; flex-shrink: 0; margin-left: auto; }
.mode-mobile .userbox button { padding: .4em .5em; font-size: min(.8125rem, 16px); min-height: 44px; }
.mode-mobile nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav); background: var(--surface-brand); border-top: 1px solid var(--hover-on-brand); display: flex; gap: 0; flex-wrap: nowrap; padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); }
.mode-mobile nav button { flex: 1 1 0; min-width: 0; padding: 6px 2px; min-height: 48px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1.15; }
.mode-mobile nav button .nav-ico { font-size: min(1.25rem, 28px); }
.mode-mobile nav button .nav-txt { font-size: min(.75rem, 15px); }
.mode-mobile main { padding: 12px 12px calc(128px + env(safe-area-inset-bottom)); }
.mode-mobile .filterbar { display: none; }
.mode-mobile .filterbar.open { display: flex; position: sticky; top: 0; z-index: 50; }
.mode-mobile #filt-btn { display: inline-block; }
.mode-mobile #toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
.mode-mobile .banner { font-size: min(.9375rem, 18px); }
.mode-mobile #study-tools .mini .dim { display: none; } /* 快捷键提示仅桌面显示 */
.mode-mobile .shortcut-hint { display: none; }
/* 学习页控制栏吸底：翻题/收藏/答案按钮常驻拇指热区（顶部信息行保持原样） */
.mode-mobile .study-controls { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: var(--z-dock); background: var(--card); border: 1px solid var(--bd); border-radius: var(--r-lg); padding: .4em .5em; margin-bottom: .8em; box-shadow: var(--shadow-md); }
.mode-mobile .study-controls .mini { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5em; width: 100%; }
.mode-mobile .filterbar.open { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .5em .7em; }
.mode-mobile .filterbar label { white-space: nowrap; }
.mode-mobile .filterbar input[type=text] { grid-column: 1 / -1; width: auto; }
.mode-mobile .filterbar #f-apply { margin-left: 0; grid-column: 1; }
.mode-mobile .filterbar #f-reset { grid-column: 2; }
/* XXL 档筛选条改两对网格：筛选/重置始终成组同行（v2.2） */
html[data-font='XXL'] .mode-desktop .filterbar { display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: .5em .8em; }
html[data-font='XXL'] .mode-desktop .filterbar #f-kw { grid-column: 1 / -1; }
html[data-font='XXL'] .mode-desktop .filterbar #f-apply { margin-left: 0; grid-column: 3; }
html[data-font='XXL'] .mode-desktop .filterbar #f-reset { grid-column: 4; }
/* 深色通知横幅：中性卡面 + 左侧警示条，去掉高饱和暖橙块（v2.2；v2.5 手动开关双轨） */
@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) .banner { background: var(--surface-card); color: var(--text-1); border-left: 3px solid var(--warn); border-bottom-color: var(--line-1); }
  html:not([data-theme='light']) .banner-txt .ico { color: var(--warn); }
}
html[data-theme='dark'] .banner { background: var(--surface-card); color: var(--text-1); border-left: 3px solid var(--warn); border-bottom-color: var(--line-1); }
html[data-theme='dark'] .banner-txt .ico { color: var(--warn); }
.mode-mobile .study-controls button { min-width: 0; padding: .6em .4em; min-height: 48px; white-space: nowrap; line-height: 1.3; font-size: min(1.0625rem, 20px); }
/* 学习卡左滑翻题：竖滑交给原生滚动，横滑只给 JS，避免与 iOS 边缘返回手势/橡皮筋冲突 */
.mode-mobile #study-card { touch-action: pan-y; overscroll-behavior-x: none; }
.mode-mobile .kb-open { min-height: 44px; }
@media (max-width: 340px) { .mode-mobile nav button .nav-txt { font-size: min(.625rem, 12px); } }
/* 窄屏（≤480px）：隐藏用户名文本（品牌已独占首行，无需收窄） */
@media (max-width: 480px) {
  .mode-mobile .userbox span { display: none; }
}
/* 超窄屏（≤359px）：进一步收窄工具箱按钮，320px 设备头部仍两行 */
@media (max-width: 359px) {
  .mode-mobile .toolbox button { padding: .4em; }
}
/* 考试两栏（左题目右答题卡吸顶）：桌面宽屏 ≥861px 与 手机横屏（如 812×375）共用；v1.8 右栏 280px + 居中 */
@media (min-width: 861px), (orientation: landscape) and (max-height: 480px) {
  #exam-run { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 18rem, 420px); gap: 10px; align-items: start; justify-content: center; }
  #exam-run .exam-topbar { grid-column: 1 / -1; }
  #exam-run .sheet { grid-column: 2; grid-row: 2; position: sticky; top: 48px; margin-top: 0; max-height: 60vh; overflow-y: auto; }
  #exam-run > .card { grid-column: 1; grid-row: 2; margin-bottom: 0; }
  #exam-run .sheet-legend { grid-column: 2; grid-row: 3; margin-top: 0; }
}
/* 手机横屏（高度受限）：答题卡略窄，底部导航收缩，主区留白减小 */
@media (orientation: landscape) and (max-height: 480px) {
  #exam-run { grid-template-columns: minmax(0, 1fr) clamp(250px, 16rem, 360px); }
  .mode-mobile nav button { min-height: 36px; padding: 2px; gap: 1px; }
  .mode-mobile nav button .nav-ico { font-size: min(.9375rem, 18px); }
  .mode-mobile nav button .nav-txt { font-size: min(.625rem, 12px); }
  .mode-mobile main { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
  .mode-mobile #toast { bottom: calc(52px + env(safe-area-inset-bottom)); }
}

/* ---------- 学习页空态引导卡（首次进入/筛选无结果时） ---------- */
.study-guide { text-align: center; padding: .7em .3em; }
.study-guide-ico { display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; color: var(--pri); background: var(--pri-soft); border-radius: var(--r-full); padding: .45em; margin-bottom: .4em; }
.study-guide-ico .ico { width: 1.3em; height: 1.3em; }
.study-guide .primary { margin-top: .6em; }
/* 空态插画（v2.5） */
.empty { text-align: center; padding: .8em .5em; color: var(--dim); }
.empty .illus { width: min(7rem, 45vw); height: auto; margin-bottom: .4em; }
.empty .illus .soft { fill: #eff6ff; }
.empty .empty-t { font-weight: 700; color: var(--fg); font-size: 1.0625rem; margin: .2em 0; }
.empty p { margin: .2em 0; }
@media (prefers-color-scheme: dark) { html:not([data-theme='light']) .empty .illus .soft { fill: #1e3a8a; } }
html[data-theme='dark'] .empty .illus .soft { fill: #1e3a8a; }
/* 移动端空态收紧 + 复习页说明段仅桌面展示（v2.5） */
@media (max-width: 700px) {
  .empty { padding: .2em .4em; }
  .empty .illus { width: min(3.8rem, 32vw); margin-bottom: .15em; }
  .empty p { margin: .1em 0; }
  .empty .empty-t { font-size: 1.0625rem; margin: .1em 0; }
  #view-review .card > p.dim { display: none; }
}
.study-guide ol { text-align: left; margin: .7em auto; padding-left: 1.4em; max-width: min(26rem, 480px); line-height: 2; color: var(--fg); font-size: 1rem; }

/* ---------- 深色模式：由顶部 v2.0 语义层重定义接管（prefers-color-scheme: dark），不再逐选择器覆盖 ---------- */

/* ---------- 打印（错题本/成绩单导出，v2.5 七项修补） ---------- */
@page { margin: 14mm 12mm; }
@media print {
  /* ① 隐藏交互 chrome：头部/筛选/公告/toast/工具箱/账号区/吸底栏/底部导航/快捷键提示 + 补：登录切换 tab/计时条/答题卡/收藏笔记反馈等操作按钮 */
  header, #filterbar, #toast, #banner, .toolbox, .userbox, .study-controls, .mode-mobile nav, .shortcut-hint,
  .tabs, .exam-topbar, .sheet, .sheet-legend, .study-guide-ico, #guide-filter, #study-tools .mini button,
  #study-ans, #study-prev, #study-next, #study-fav, #ex-mark, #ex-prev, #ex-next, #ex-submit, .pt-summary-actions, .report-actions { display: none !important; }
  body { background: #fff; color: #000; }
  main { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
  /* ② 打印时所有彩色背景清零，只留黑白可读 */
  .feedback, .wrongitem { border-color: #ccc; }
  .feedback.ok, .opt.ok, .feedback.bad, .opt.bad, .opt.right, .wrongitem, .tag, .kb-overview, .deep-sec.trap,
  .opt[aria-checked='true'], .banner { background: none !important; }
  .opt.right::after, .opt.bad::after { content: none; }
  /* ③ 折叠卡 details 全部展开打印（错题本/知识卡核心场景不丢内容） */
  .kb-sec > * { display: block !important; }
  .kb-sec summary { min-height: 0; }
  /* ④ 表格：去除横向滚动包装，行允许跨页断行保护 */
  .tbl-wrap { overflow: visible; }
  .tbl-wrap .tbl { min-width: 0; }
  .tbl tr, .opt, .kb-card { page-break-inside: avoid; }
  /* ⑤ 打印色彩策略：默认节省墨盒（背景/图形不打印） */
  * { print-color-adjust: economy; -webkit-print-color-adjust: economy; color-adjust: economy; }
  /* ⑥ 链接打印时展开 URL 便于核对法规来源 */
  a[href]::after { content: '（' attr(href) '）'; font-size: .85em; color: #555; }
}
