/* ============================================================
   兜里有岸 · 全新框架（2026-11-02 全面重做；2026-11-06 改 Miaomiaowu X 暖纸贴片风格）
   身份：Miaomiaowu X 面板风格——暖白米色纸感底、细深暖灰描边、硬偏移贴纸阴影、
   赤陶焦橙主色（#c96f4a）、浅鲑粉高亮、彩虹进度条。单一系统无衬线栈。
   结构：1 tokens / 2 base / 3 shells / 4 home&cat / 5 practice
         / 6 palette&draft&verdict / 7 other views / 8 overlays&a11y
   铁律：本文件是唯一真相源；JS 一个 class/id 名都不改；
   暗色只走 body.night；练习列只留一条 760px，内容列只留一条 980px。
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root{
  --font-system:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,
    "PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC",sans-serif,
    "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
  /* 亮色：Miaomiaowu X 暖米白纸底 #faf5ee，暖白卡片 #fffdf9，深暖炭黑字 #221a16，赤陶主色 #c96f4a */
  --bg-canvas:#faf5ee; --bg-surface:#fffdf9; --bg-surface-alt:#f4ece1;
  --bg-glow:none;
  --bg-raised:#fffdf9; --bg-overlay:rgba(34,26,22,.45);
  --bg-panel:#fffdf9; --bg-hero:#fffdf9; --accent-gold:#c96f4a;
  --text-primary:#221a16; --text-secondary:#6b5e55; --text-tertiary:#96887e;
  --text-placeholder:#9e9086; --text-inverse:#fffdf9;
  --border-subtle:#d6c7bc; --border-strong:#9e8c80;
  /* 品牌：赤陶焦橙（主按钮、选中 chip、激活标签、开关、单选框） */
  --brand:#c96f4a; --brand-strong:#b85d38; --brand-soft:#fbe7d9; --brand-text:#b85d38;
  --brand-rgb:201,111,74;
  --select-highlight:#f7b6a3;
  --rainbow-grad:linear-gradient(90deg,#e5483b 0%,#f28e0e 18%,#eab308 35%,#22c55e 52%,#1f9ce6 74%,#9e5af5 90%,#e14ba9 100%);
  /* 判分语义（保留红绿语义，表面与边框融合暖纸贴片语言；警告横幅采用淡奶油黄 #fef3e4） */
  --success-surface:#e3f6eb; --success-border:#68b884; --success-text:#1e7534; --success-solid:#248a3d;
  --error-surface:#fceae6; --error-border:#d98279; --error-text:#b8261a; --error-solid:#c93326;
  --warning-surface:#fef3e4; --warning-border:#e2caa5; --warning-text:#9a5b13; --warning-solid:#c97a16;
  --info-surface:#f4ece1; --info-border:#d6c7bc; --info-text:#6b5e55; --info-solid:#221a16;
  /* 组色（对应真实 4 组 + 扩展） */
  --cat-politics:var(--brand); --cat-common:var(--brand); --cat-current:var(--brand);
  --cat-law:var(--brand); --cat-idioms:var(--brand); --cat-quant:var(--brand);
  --focus-ring:0 0 0 2px rgba(201,111,74,.38);
  --shadow-sm:2px 2px 0 #c8b9b1;
  --shadow-md:3px 3px 0 #c4b5ad;
  --shadow-lg:4px 4px 0 #b5a49b;
  --brand-hover:#be633e; --brand-active:#a34e2b;
  --fill:rgba(158,140,128,.14); --fill-2:rgba(158,140,128,.20); --fill-3:rgba(158,140,128,.26);
  --shadow-up:0 -2px 0 #d6c7bc;
  --space-1:.25rem; --space-2:.5rem; --space-3:.75rem; --space-4:1rem;
  --space-5:1.25rem; --space-6:1.5rem; --space-8:2rem; --space-10:2.5rem; --space-12:3rem;
  --radius-xs:2px; --radius-sm:4px; --radius-md:4px; --radius-lg:6px; --radius-xl:8px; --radius-full:4px;
  --ease-standard:cubic-bezier(.2,0,0,1);
  --dur-fast:150ms; --dur-normal:240ms;
  --page-gutter:16px;
  /* 旧变量别名（app.js 模板内联 style 仍在引用，值已映射到新色板，不得删除） */
  --text:var(--text-primary); --text2:var(--text-secondary); --text3:var(--text-tertiary); --ink:var(--text-primary);
  --paper:var(--bg-surface); --surface-2:var(--bg-surface-alt); --line:var(--border-subtle); --line-strong:var(--border-strong);
  --bg:var(--bg-canvas); --card:var(--bg-surface);
  /* v324 毛玻璃（Gemini 会诊）：卡片专用半透明底＋模糊，日/夜各一套；v325 加强：0.84→0.65、10px→18px（yang 嫌 v324 太淡） */
  --glass-bg:rgba(255,253,249,.65); --glass-blur:blur(18px) saturate(1.2);
  --cobalt:var(--brand); --disc-blue:#221a16; --violet:#6b5e55; --emerald:#248a3d;
  --tangerine:#c96f4a; --crimson:#c93326;
  --laser-green:#248a3d; --verdict-green:#248a3d; --verdict-red:#c93326;
  --disc-blue-rgb:201,111,74; --violet-rgb:107,94,85; --emerald-rgb:36,138,61; --tangerine-rgb:201,111,74;
  --crimson-rgb:201,51,38;
  --air-feature:6px; --air-sheet:8px; --col-max:100%; --section-margin:48px;
  --wb-gold:var(--brand);
  --fc-front-text-subtle:var(--text-secondary);
}
/* 暗色：必须写全底色与文字色（旧教训） */
body.night{
  /* 暗色：暖深咖啡炭底 #161311，卡片 #211d1a，赤陶主色 #d47652，无蓝无冷灰 */
  --bg-canvas:#161311; --bg-surface:#211d1a; --bg-surface-alt:#2c2622;
  --bg-glow:none;
  --bg-raised:#2c2622; --bg-overlay:rgba(10,8,7,.68);
  --bg-panel:#211d1a; --bg-hero:#211d1a; --accent-gold:#d47652;
  --text-primary:#f2ece4; --text-secondary:#b5a89d; --text-tertiary:#85796f;
  --text-placeholder:#7d7067; --text-inverse:#161311;
  --border-subtle:#3d352f; --border-strong:#5c5047;
  --brand:#d47652; --brand-strong:#c96f4a; --brand-soft:rgba(212,118,82,.18); --brand-text:#e89574;
  --brand-rgb:212,118,82;
  --select-highlight:rgba(212,118,82,.28);
  --rainbow-grad:linear-gradient(90deg,#e5483b 0%,#f28e0e 18%,#eab308 35%,#22c55e 52%,#1f9ce6 74%,#9e5af5 90%,#e14ba9 100%);
  --success-surface:rgba(46,184,87,.18); --success-border:#2eb857; --success-text:#5cd67d; --success-solid:#2eb857;
  --error-surface:rgba(217,74,61,.20); --error-border:#e05245; --error-text:#ff8075; --error-solid:#e05245;
  --warning-surface:rgba(217,155,38,.16); --warning-border:#9e7322; --warning-text:#f0b849; --warning-solid:#d99b26;
  --info-surface:#2c2622; --info-border:#3d352f; --info-text:#b5a89d; --info-solid:#f2ece4;
  --cat-politics:var(--brand); --cat-common:var(--brand); --cat-current:var(--brand);
  --cat-law:var(--brand); --cat-idioms:var(--brand); --cat-quant:var(--brand);
  --focus-ring:0 0 0 2px rgba(212,118,82,.45);
  --shadow-sm:2px 2px 0 #0c0a08;
  --shadow-md:3px 3px 0 #0c0a08;
  --shadow-lg:4px 4px 0 #080706;
  --shadow-up:0 -2px 0 #3d352f;
  --brand-hover:#df8360; --brand-active:#b85d38;
  --fill:rgba(181,168,157,.16); --fill-2:rgba(181,168,157,.22); --fill-3:rgba(181,168,157,.30);
  --text:var(--text-primary); --text2:var(--text-secondary); --text3:var(--text-tertiary); --ink:var(--text-primary);
  --paper:var(--bg-surface); --surface-2:var(--bg-surface-alt); --line:var(--border-subtle); --line-strong:var(--border-strong);
  --bg:var(--bg-canvas); --card:var(--bg-surface);
  /* v324 毛玻璃夜间：暖棕深色，不走黑玻璃；v325 加强：0.82→0.65、12px→18px */
  --glass-bg:rgba(33,29,26,.65); --glass-blur:blur(18px) saturate(1.2);
  --cobalt:var(--brand); --disc-blue:#f2ece4; --violet:#b5a89d; --emerald:#2eb857;
  --tangerine:#d47652; --crimson:#e05245;
  --laser-green:#2eb857; --verdict-green:#2eb857; --verdict-red:#e05245;
  --disc-blue-rgb:212,118,82; --violet-rgb:181,168,157; --emerald-rgb:46,184,87;
  --tangerine-rgb:212,118,82; --crimson-rgb:224,82,69;
  --fc-front-text-subtle:var(--text-secondary);
  --wb-gold:var(--brand);
  background:var(--bg-glow),var(--bg-canvas); color:var(--text-primary);
}
@media (min-width:900px){ :root{ --page-gutter:24px; } }

/* ---------- 2. RESET & BASE ---------- */
*{ box-sizing:border-box; }
html{ touch-action:manipulation; -webkit-text-size-adjust:100%; }
html,body{ overscroll-behavior-y:none; }
body{
  margin:0; font-family:var(--font-system); font-size:15px; line-height:1.6;
  background-color:var(--bg-canvas); color:var(--text-primary);
  -webkit-font-smoothing:antialiased; -webkit-tap-highlight-color:transparent;
}
body.draft-open{ user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; }
a{ color:var(--brand-text); text-decoration:underline; }
button{ font-family:inherit; cursor:pointer; }
button:disabled{ cursor:default; opacity:.4; }
.login-field label{ display:block; font-size:16px; font-weight:800; color:var(--text-primary); }
.login-field input{ width:100%; box-sizing:border-box; min-height:52px; padding:12px 16px; margin:6px 0 16px; border:2px solid var(--text-primary); border-radius:12px; background:#fff; font-size:16px; }
/* 登录页：参考站分屏样式（左视觉 + 右表单），移动端上下叠放；登录页单独全屏白色、居中，不走站内莓红底色与桌面侧栏；v320（Gemini 会诊）：body 与 #wb-main 必须透明，否则不透明白层盖住 z-index:0 的 body::before 壁纸；登录卡片本身仍实色白 */
body:has(.login-split){ background-color:transparent !important; background-image:none !important; }
body:has(.login-split) #wb-rail, body:has(.login-split) #wb-subnav, body:has(.login-split) #wb-tabs{ display:none !important; }
body:has(.login-split) #wb-main{ background-color:transparent !important; background-image:none !important; }
.ed-gutter:has(>.login-split){ display:flex; align-items:center; justify-content:center; min-height:100dvh; padding-top:24px; padding-bottom:24px; background:transparent !important; }
.login-split{ display:flex; flex-direction:column; width:100%; margin:0; border:1px solid #e5e5e5; border-radius:20px; overflow:hidden; box-shadow:var(--shadow-md); background:#fff !important; }
.login-visual{ position:relative; overflow:hidden; padding:0; min-height:260px; background:url("login-visual.jpg?v=v288"); background-size:cover; background-position:center; }
.login-visual-line{ position:relative; margin-top:12px; font-size:17px; font-weight:800; line-height:1.5; text-shadow:0 1px 10px rgba(255,255,255,.85); }
.login-form{ padding:28px 22px 24px; background:#fff; color:#1f1319; }
/* 登录页字体：只改登录页，接近参考站的圆润粗体效果。用站内已加载的 Xiaolai Mono SC
  （圆体手写风，首页标题同款字体，不新增字体文件，避免新字体加载失败），其余回落系统圆体。 */
.login-form, .login-form input, .login-form button{ font-family:'Xiaolai Mono SC','PingFang SC','Hiragino Maru Gothic ProN','Microsoft YaHei',sans-serif; }
.login-hello{ font-weight:900; letter-spacing:.02em; }
.login-welcome{ font-weight:800; }
.login-field label{ font-weight:900; letter-spacing:.04em; }
.login-field input{ font-weight:700; }
.login-tabs .chip, .login-form .btn, .login-alt button{ font-weight:900; letter-spacing:.06em; }
.login-hello{ text-align:center; font-size:38px; font-weight:900; line-height:1.2; }
.login-welcome{ text-align:center; font-size:19px; font-weight:700; color:var(--text-secondary); margin:6px 0 22px; }
.login-welcome span{ color:var(--text-primary); text-decoration:underline wavy var(--accent-gold) 2px; text-underline-offset:6px; }
.login-cur{ text-align:center; font-size:13px; color:var(--text-secondary); margin:-10px 0 14px; }
.login-tabs{ display:flex; gap:4px; padding:4px; margin-bottom:22px; border:2px solid var(--text-primary); border-radius:9999px; }
.login-tabs .chip{ flex:1; border:none; background:transparent; min-height:42px; font-size:15px; }
.login-tabs .chip.on{ background:var(--text-primary); color:var(--bg-surface); }
.login-form .btn{ min-height:54px; border-radius:12px; font-size:17px; letter-spacing:.05em; }
.login-alt{ text-align:center; margin-top:16px; font-size:14px; color:var(--text-secondary); }
.login-alt button{ border:none; background:transparent; color:var(--brand-text); font-size:14px; font-weight:800; padding:0 2px; }
/* 登录页在夜间也保持白色底（参考站效果），文字一律用深色，保证在白底上可读 */
body.night:has(.login-split){ background-color:transparent !important; background-image:none !important; color:#1f1319; }
body.night .login-hello, body.night .login-welcome span, body.night .login-field label{ color:#1f1319; }
body.night .login-welcome, body.night .login-cur, body.night .login-alt{ color:#3b2537; }
body.night .login-tabs{ border-color:#1f1319; }
body.night .login-tabs .chip{ color:#3b2537; }
body.night .login-tabs .chip.on{ background:#1f1319; color:#fff; }
body.night .login-field input{ background:#fff; border-color:#1f1319; color:#1f1319; }
body.night .login-form .btn{ background:#7b2d5b; color:#fff; }
body.night .login-alt button{ color:#7b2d5b; }

@media (min-width:900px){
  .login-split{ flex-direction:row; min-height:560px; margin:0; }
  .login-visual{ flex:1.05; padding:56px 48px; display:flex; flex-direction:column; justify-content:flex-start; }
  .login-visual-line{ font-size:20px; }
  .login-form{ flex:1; padding:56px 56px 40px; display:flex; flex-direction:column; justify-content:center; }
  .login-hello{ font-size:44px; }
}
input,select,textarea{ font-family:inherit; font-size:15px; color:var(--text-primary);
  background:var(--bg-surface); border:1px solid var(--border-strong); border-radius:var(--radius-sm);
  padding:10px 12px; outline:none; }
input[type=radio],input[type=checkbox]{ accent-color:var(--brand); }
select option:checked,select option:hover{ background:var(--select-highlight); color:var(--text-primary); }
input:focus-visible,select:focus-visible,textarea:focus-visible{ box-shadow:var(--focus-ring); border-color:var(--brand); }
button:focus-visible{ outline:none; box-shadow:var(--focus-ring); }
::placeholder{ color:var(--text-placeholder); }
::selection{ background:var(--select-highlight); color:var(--text-primary); }
#app{ min-height:100dvh; }
.muted{ color:var(--text-tertiary); }
.spacer{ flex:1; }
/* 通用容器与标题 */
.page{ padding:24px var(--page-gutter) 40px; animation:pageIn 180ms ease; }
#app.no-enter .page,#app.no-enter .has-tabbar{ animation:none; }
.ed-gutter{ padding-left:var(--page-gutter); padding-right:var(--page-gutter);
  padding-left:calc(var(--page-gutter) + env(safe-area-inset-left));
  padding-right:calc(var(--page-gutter) + env(safe-area-inset-right)); }
.has-tabbar{ padding-bottom:calc(68px + env(safe-area-inset-bottom)); }
.card{ background:var(--bg-surface); border:1px solid var(--border-strong); border-radius:var(--radius-lg);
  padding:16px; margin-bottom:12px; box-shadow:var(--shadow-md); }
.sec-title{ font-size:13px; font-weight:700; letter-spacing:.04em; color:var(--text-primary);
  margin:32px 0 16px; padding-bottom:8px; border-bottom:1px solid var(--border-strong); }
.sec-title:first-child{ margin-top:0; }
/* 按钮 */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:44px;
  padding:12px 24px; border-radius:var(--radius-sm); border:1px solid var(--brand-strong);
  background:var(--brand); color:#fff; font-size:15px; font-weight:700; box-shadow:var(--shadow-sm); }
body.night .btn{ background:var(--brand); border-color:var(--brand-strong); color:#fff; }
@media (hover:hover){ .btn:hover:not(:disabled){ transform:translate(-1px,-1px); background:var(--brand-hover); box-shadow:var(--shadow-md); } }
.btn.ghost{ background:var(--bg-surface); border-color:var(--border-strong); color:var(--text-primary); box-shadow:var(--shadow-sm); }
body.night .btn.ghost{ background:var(--bg-surface); border-color:var(--border-strong); color:var(--text-primary); }
.btn.block{ display:flex; width:100%; }
.btn:active{ transform:translate(1px,1px); background:var(--brand-active); box-shadow:1px 1px 0 var(--border-strong); }
/* LOGIN FREEZE (2026-11-03, yang: login page temporarily unchanged in Apple v290; v293: moved after global .btn so freeze wins, plus restored v289 login details):
   login button and alt link keep v289 berry, even though global .btn is now terracotta sticker. */
body:has(.login-split) .login-split{ box-shadow:0 1px 3px rgba(0,0,0,.08),0 8px 24px rgba(0,0,0,.08); }
body:has(.login-split) .login-tabs .chip{ border:none; border-radius:9999px; background:transparent; box-shadow:none; color:#3b2537; }
body:has(.login-split) .login-tabs .chip.on{ background:#1f1319; color:#fff; box-shadow:none; }
body:has(.login-split) .login-form .btn{ background:#7b2d5b; border-color:transparent; border-radius:12px; padding:0 20px; box-shadow:none; }
body.night:has(.login-split) .login-form .btn{ background:#7b2d5b; border-color:transparent; box-shadow:none; }
body:has(.login-split) .login-alt button{ color:#7b2d5b; }
body:not(.night):has(.login-split) .login-welcome{ color:#3b2537; }
body:has(.login-split) .login-welcome span{ text-decoration-color:#b77238; }
@media (hover:hover){ body:has(.login-split) .login-form .btn:hover{ background:#7b2d5b; transform:none; box-shadow:none; } }
body:has(.login-split) .login-form .btn:active{ transform:none; background:#7b2d5b; box-shadow:none; }
/* 小按钮（题量设置等） */
.sbtn{ min-height:44px; padding:0 18px; border-radius:var(--radius-sm); border:1px solid var(--border-strong);
  background:var(--bg-surface); color:var(--text-primary); font-size:14px; font-weight:700; box-shadow:var(--shadow-sm); }
.sbtn.primary{ background:var(--brand); border-color:var(--brand-strong); color:#fff; box-shadow:var(--shadow-sm); }
body.night .sbtn.primary{ background:var(--brand); border-color:var(--brand-strong); color:#fff; }
/* chips */
.chips{ display:flex; flex-wrap:wrap; gap:10px; }
.chip{ min-height:36px; padding:0 14px; border-radius:var(--radius-full); border:1px solid var(--border-strong);
  background:var(--bg-surface); color:var(--text-primary); font-size:14px; font-weight:600; box-shadow:var(--shadow-sm); }
.chip.sm{ min-height:30px; padding:0 11px; font-size:12px; }
.chip.on{ background:var(--brand); border-color:var(--brand-strong); color:#fff; font-weight:800; box-shadow:var(--shadow-sm); }
@keyframes pageIn{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:none; } }
@keyframes rowIn{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:none; } }

/* ---------- 3. SHELLS ---------- */
/* 启动动画 */
#wb-splash{ position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center;
  background:var(--bg-canvas); }
body.night #wb-splash{ background:var(--bg-canvas); }
.wb-sp-card{ position:relative; width:min(320px,86vw); background:var(--bg-surface);
  border:1px solid var(--border-strong); border-radius:var(--radius-xl); box-shadow:var(--shadow-lg);
  padding:44px 28px 30px; text-align:center; }
.wb-sp-mark{ position:absolute; color:var(--brand); font-size:16px; font-weight:800; line-height:1; }
.wb-sp-title{ font-size:36px; font-weight:800; letter-spacing:.06em; color:var(--text-primary); line-height:1.25; }
.wb-sp-motto{ margin-top:10px; font-size:13px; font-style:italic; color:var(--text-secondary); }
.wb-sp-dots{ display:flex; align-items:center; justify-content:center; gap:8px; margin-top:24px; }
.wb-sp-pencil{ color:var(--brand); display:inline-flex; animation:wb-pencil 1440ms linear infinite; }
.wb-sp-dot{ width:8px; height:8px; border-radius:50%; background:var(--border-strong); animation:wb-dotfill 1440ms linear infinite; }
.wb-sp-dot:nth-child(2){ animation-delay:180ms; } .wb-sp-dot:nth-child(3){ animation-delay:360ms; }
.wb-sp-dot:nth-child(4){ animation-delay:540ms; } .wb-sp-dot:nth-child(5){ animation-delay:720ms; }
.wb-sp-skip{ position:absolute; top:calc(20px + env(safe-area-inset-top)); right:20px; min-height:44px; padding:0 14px;
  border:1px solid var(--border-strong); border-radius:var(--radius-full); background:var(--bg-surface);
  color:var(--text-primary); font-size:13px; font-weight:600; box-shadow:var(--shadow-sm); }
@keyframes wb-dotfill{ 0%,55%{ background:var(--border-strong); } 60%,100%{ background:var(--brand); } }
@keyframes wb-pencil{ 0%{ transform:translateX(0); } 25%{ transform:translateX(18px); } 50%{ transform:translateX(36px); }
  75%{ transform:translateX(54px); } 100%{ transform:translateX(54px); } }
/* 手机顶栏 */
.topbar{ position:sticky; top:0; z-index:50; height:48px; display:flex; align-items:center; gap:8px;
  padding:0 8px; background:var(--bg-surface); border-bottom:1px solid var(--border-strong); }
body.night .topbar{ background:var(--bg-surface); }
.topbar .back,.topbar .tbtn{ min-width:44px; height:44px; display:inline-flex; align-items:center; justify-content:center;
  border:none; background:transparent; color:var(--text-primary); font-size:16px; border-radius:var(--radius-md); }
.topbar .title{ position:absolute; left:50%; transform:translateX(-50%); max-width:calc(100% - 110px);
  font-size:16px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.topbar .tbtn{ margin-left:auto; }
/* 手机底栏 */
.tabbar{ position:fixed; left:0; right:0; bottom:0; z-index:100; min-height:56px;
  background:var(--bg-surface); border-top:1px solid var(--border-strong);
  padding-bottom:env(safe-area-inset-bottom); }
body.night .tabbar{ background:var(--bg-surface); }
.tabbar-inner{ max-width:980px; margin:0 auto; display:flex; }
.tabbar .tab{ flex:1; min-height:56px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  border:none; background:transparent; color:var(--text-secondary); font-size:13px; font-weight:600; }
.tabbar .tab.on{ color:var(--brand); font-weight:800; }
.tabbar .tab .tab-star,.tabbar .tab .e{ display:none; }
/* 手机分类条（首页横向贴片条，保留入口，只换新颜） */
.wb-strip{ display:flex; gap:8px; overflow-x:auto; scrollbar-width:none; padding:8px var(--page-gutter); }
.wb-strip::-webkit-scrollbar{ display:none; }
.wb-home-strip{ position:sticky; top:48px; z-index:49; background:var(--bg-canvas); border-bottom:1px solid var(--border-subtle); }
.wb-home-strip .wb-tab{ flex:none; min-height:36px; padding:0 14px; border-radius:var(--radius-full);
  border:1px solid var(--border-strong); background:var(--bg-surface); color:var(--text-primary);
  font-size:13px; font-weight:600; white-space:nowrap; box-shadow:var(--shadow-sm); }
.wb-home-strip .wb-tab:active{ background:var(--bg-surface-alt); }
/* 错题本分段条（与分类条同款粘性条） */
.wb-seg{ position:sticky; top:48px; z-index:49; display:flex; gap:8px; overflow-x:auto;
  background:var(--bg-surface); border-bottom:1px solid var(--border-subtle); padding:8px var(--page-gutter); }
/* 桌面工作台 */
#wb-rail,#wb-subnav,#wb-tabs{ display:none; }
@media (min-width:900px){
  body{ display:flex; flex-direction:row; align-items:stretch; }
  #wb-rail{ display:flex; flex-direction:column; position:sticky; top:0; height:100vh; width:256px; flex:none;
    z-index:60; background:transparent; border-right:1px solid var(--border-strong); padding:16px; gap:12px; }
  body.night #wb-rail{ background:transparent; border-right:1px solid var(--border-strong); }
  .wb-rail-item{ display:flex; flex-direction:row; align-items:center; justify-content:flex-start; gap:12px; min-height:52px; padding:12px 16px;
    border:1px solid transparent; background:transparent; color:var(--text-secondary); font-size:15px; font-weight:600; border-radius:var(--radius-md); text-align:left; }
  .wb-rail-item svg{ width:24px; height:24px; flex:none; }
  .wb-rail-item.on{ color:#fff; background:var(--brand); border-color:var(--brand-strong); box-shadow:var(--shadow-sm); }
  body.night .wb-rail-item{ color:var(--text-secondary); }
  body.night .wb-rail-item.on{ color:#fff; background:var(--brand); border-color:var(--brand-strong); }
  .wb-rail-item:focus-visible{ box-shadow:var(--focus-ring); }
  #wb-subnav{ display:flex; flex-direction:column; position:sticky; top:0; height:100vh; width:320px; flex:none;
    z-index:59; background:transparent; border-right:1px solid var(--border-subtle); overflow:hidden; }
  body.wb-subnav-collapsed #wb-subnav{ display:none; }
  .wb-sub-head{ display:flex; align-items:center; justify-content:space-between; padding:14px 16px;
    font-size:18px; font-weight:800; border-bottom:1px solid var(--border-subtle); }
  .wb-sub-x{ min-width:44px; height:44px; border:none; background:transparent; color:var(--text-secondary); font-size:18px; }
  .wb-sub-search{ padding:12px 16px; border-bottom:1px solid var(--border-subtle); }
  .wb-sub-search input{ width:100%; font-size:16px; }
  .wb-sub-body{ overflow-y:auto; padding:8px 0 24px; }
  .wb-sub-gt{ display:flex; align-items:center; gap:8px; padding:16px 16px 8px; font-size:16px; font-weight:800; letter-spacing:.04em; color:var(--text-secondary); cursor:pointer; }
  .wb-sub-caret{ transition:transform 150ms ease; }
  .wb-sub-g:not(.open) .wb-sub-caret{ transform:rotate(-90deg); }
  .wb-sub-g:not(.open) .wb-sub-items{ display:none; }
  .wb-sub-item{ display:block; width:100%; text-align:left; padding:12px 16px; border:none; background:transparent;
    color:var(--text-primary); font-size:16px; }
  .wb-sub-item:hover{ background:var(--select-highlight); color:var(--text-primary); }
  .wb-sub-item:active{ background:var(--brand-soft); }
  #wb-main{ flex:1; min-width:0; }
  #wb-tabs{ display:block; position:sticky; top:0; z-index:55; background:var(--glass-bg);
    -webkit-backdrop-filter:var(--glass-blur); backdrop-filter:var(--glass-blur);
    border-bottom:1px solid var(--border-strong); }
  .wb-tabs-inner{ display:flex; gap:10px; overflow-x:auto; padding:0 16px; scrollbar-width:none; }
  .wb-tabs-inner::-webkit-scrollbar{ display:none; }
  .wb-tab{ flex:none; min-height:44px; padding:0 14px; display:inline-flex; align-items:center; gap:8px;
    border:none; background:transparent; color:var(--text-secondary); font-size:13px; font-weight:600; }
  .wb-tab.on{ color:var(--brand-text); font-weight:800; box-shadow:inset 0 -3px 0 var(--brand); }
  .wb-tab-x{ min-width:28px; height:28px; border:none; background:transparent; color:var(--text-tertiary); font-size:16px; }
  .tabbar{ display:none; }
  .wb-home-strip{ display:none; }
  .has-tabbar{ padding-bottom:40px; }
  #app{ max-width:980px; margin:0 auto; }
}
@media (min-width:900px){
  /* 桌面：标签条 44px 在最上，视图顶栏贴在其下粘性，避免两条 sticky 重叠互盖 */
  .topbar{ top:45px; }
  /* 错题本分段条桌面端为页内静态行，不粘性 */
  .wb-seg{ position:static; }
}
@media (min-width:900px) and (max-width:1400px){
  /* v293 P2: 900-1400px 目录面板改为悬浮覆盖, 不再挤压主内容 (.cat-buttons 保持 4 列); >1400px 仍走上方 sticky, <900px 仍 display:none; 收起规则在后, 仍优先. */
  #wb-subnav{ position:fixed; left:256px; top:0; height:100vh; width:320px; z-index:49; background:transparent; box-shadow:var(--shadow-lg); border-right:1px solid var(--border-subtle); }
  body.wb-subnav-collapsed #wb-subnav{ display:none; }
}

/* ---------- 4. HOME & CAT ---------- */
/* Hero */
.ed-hero{ margin-bottom:20px; }
.ed-cover{ background:var(--bg-hero); border:1px solid var(--border-strong); border-radius:var(--radius-xl);
  box-shadow:var(--shadow-md); padding:24px 20px; margin:20px 0; position:relative; overflow:hidden; }
.ed-cover::before{ content:none; }
.ed-cover-top{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.ed-cover-actions{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:16px; }
.ed-cover-actions .btn{ font-size:15px; }
.ed-coverlines{ margin-top:14px; display:flex; flex-direction:column; gap:6px; font-size:14px; color:var(--text-secondary); }
.ed-coverlines b{ color:var(--text-primary); font-weight:800; }
/* 功能卡片 */
.home-feats{ display:flex; flex-direction:column; gap:12px; margin:20px 0; }
.ed-feat{ display:flex; align-items:center; gap:12px; width:100%; text-align:left; color:var(--text-primary);
  font-family:inherit; cursor:pointer; position:relative; overflow:hidden;
  background:var(--bg-surface);
  border:1px solid var(--border-strong); border-radius:var(--radius-lg); padding:14px 16px; box-shadow:var(--shadow-sm); }
.ed-feat-marker{ width:8px; height:8px; flex:none; border-radius:2px; background:var(--cat,var(--text-primary)); margin-top:2px; }
.ed-feat-body{ flex:1; min-width:0; }
.ed-feat-head{ display:block; font-size:16px; font-weight:600; line-height:1.4; color:var(--text-primary); }
.ed-feat-sub{ display:block; font-size:14px; line-height:1.7; color:var(--text-secondary); margin-top:4px; }
.ed-feat-arrow{ font-size:20px; color:var(--text-tertiary); flex:none; }
/* 分类大按钮（桌面 4 列；手机端隐藏，走首页横向条入口） */
.cat-buttons{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:20px 0; }
@media (max-width:899.98px){ .cat-buttons{ display:none; } }
.cat-btn{ position:relative; overflow:hidden; display:flex; align-items:center; gap:14px; width:100%;
  padding:18px 16px; border-radius:var(--radius-lg); background:var(--bg-surface);
  border:1px solid var(--border-strong); box-shadow:var(--shadow-sm); color:var(--text-primary); text-align:left; }
.cat-btn:active{ background:var(--bg-surface-alt); }
.cat-btn .vignette{ width:46px; height:46px; flex:none; color:var(--cat,var(--text-primary)); }
.cat-btn-body{ flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.cat-btn-name{ font-size:20px; font-weight:800; line-height:1.3; }
.cat-btn-count{ font-size:13px; color:var(--text-secondary); font-weight:600; }
.cat-btn-go{ font-size:22px; color:var(--text-tertiary); flex:none; }
/* 专项行（首页继续/待办与分类列表共用） */
.ed-row{ display:flex; align-items:center; gap:16px; width:100%; min-height:64px; padding:12px 0;
  border:none; border-bottom:1px solid var(--border-subtle); background:transparent; cursor:pointer;
  text-align:left; color:var(--text-primary); font-family:inherit; }
.ed-row.enter{ animation:rowIn 180ms ease both; }
.ed-row-idx{ width:44px; flex:none; font-size:13px; font-weight:700; color:var(--text-tertiary); text-align:center; font-variant-numeric:tabular-nums; }
.ed-row-tag{ width:44px; flex:none; font-size:13px; font-weight:700; color:var(--cat,var(--text-secondary)); }
.ed-row .vignette{ width:32px; height:32px; flex:none; }
.ed-name{ flex:1; min-width:0; font-size:17px; font-weight:700; }
.ed-name .stars{ font-size:13px; font-weight:600; color:var(--text-tertiary); }
.ed-go{ font-size:18px; color:var(--text-tertiary); flex:none; }
/* 首页桌面分栏 */
@media (min-width:900px){
  .home-spread{ display:grid; grid-template-columns:minmax(0,1.55fr) minmax(0,1fr); column-gap:48px; align-items:start; }
  .home-feats{ grid-column:1/-1; grid-row:2; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-top:8px; }
  .home-feats .ed-feat{ margin-bottom:0; }
  .cat-buttons{ grid-template-columns:repeat(4,minmax(0,1fr)); grid-column:1/-1; grid-row:1; }
}
/* 继续上次 / 题量设置 */
.resume-sec{ margin:20px 0; }
.qcustom{ display:flex; flex-direction:column; gap:12px; }
.qcount{ display:flex; align-items:center; gap:12px; }
.qcount .lbl{ font-size:14px; font-weight:600; color:var(--text-secondary); }
.qcount .num{ font-size:20px; font-weight:800; font-variant-numeric:tabular-nums; }
.qc-card{ margin-top:12px; }
.qc-card .qcount{ justify-content:center; gap:20px; }
.qc-card .chips{ justify-content:center; gap:18px; margin-top:16px; }
.qc-card .qcustom{ margin-top:16px; }

/* ---------- 5. PRACTICE CORE ---------- */
body.in-practice #app{ height:100dvh; display:flex; flex-direction:column; overflow:hidden; }
body.in-practice #wb-subnav,body.in-practice #wb-tabs{ display:none !important; }
.practice-page{ flex:1; min-height:0; display:flex; flex-direction:column; touch-action:pan-y; }
.p-scroll{ flex:1; min-height:0; overflow-y:auto; padding:16px var(--page-gutter) 20px; }
.p-scroll > *{ min-width:0; }
/* 自制顶栏 */
.p-topbar{ position:sticky; top:0; z-index:50; min-height:52px; display:flex; align-items:center; gap:8px;
  padding:0 8px; background:var(--bg-surface); border-bottom:1px solid var(--border-strong); flex:none; }
.p-topbar .back{ min-width:40px; height:40px; display:inline-flex; align-items:center; justify-content:center;
  border:none; background:transparent; color:var(--text-primary); border-radius:var(--radius-md); }
.p-topbar .p-title{ flex:1; min-width:0; font-size:16px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.p-topbar .p-prog{ flex:none; font-variant-numeric:tabular-nums; }
.p-topbar .p-prog .cur{ font-size:16px; font-weight:700; }
.p-topbar .p-prog .tot{ font-size:13px; font-weight:600; color:var(--text-secondary); }
.p-topbar .p-timer{ flex:none; font-size:13px; font-weight:600; font-variant-numeric:tabular-nums;
  background:var(--bg-surface-alt); border:1px solid var(--border-strong); border-radius:var(--radius-full); padding:5px 11px; }
.p-topbar .tbtn,.p-topbar .pal-btn{ min-width:40px; height:40px; display:inline-flex; align-items:center; justify-content:center;
  border:none; background:transparent; color:var(--text-primary); font-size:14px; font-weight:700; border-radius:var(--radius-md); }
.p-topbar .pal-btn{ font-size:13px; }
/* 收藏星标（v321）：未收藏 ☆ 默认色，已收藏 ★ 金色 */
.p-topbar .fav-btn{ font-size:19px; color:var(--text-primary); }
.p-topbar .fav-btn.on{ color:#eab308; }
/* 题干与分式 */
.bundle-tag{ display:inline-block; font-size:12px; font-weight:600; color:var(--text-secondary);
  background:var(--bg-surface-alt); border:1px solid var(--border-subtle); border-radius:var(--radius-full); padding:3px 10px; margin-bottom:10px; }
.bundle-tag:empty{ display:none; }
.stem{ font-size:17px; font-weight:500; line-height:1.65; color:var(--text-primary); overflow-wrap:break-word;
  white-space:pre-line; font-variant-numeric:tabular-nums; }
.stem.lstem{ font-size:17px; }
.stem.big{ font-size:52px; font-weight:800; text-align:center; line-height:1.3; }
.stem .kn{ font-weight:700; }
.stem .stem-q{ margin-top:10px; font-weight:700; }
.fix-del{ color:var(--text2); text-decoration:line-through; text-decoration-thickness:2px; }
.fix-corr{ color:var(--verdict-red); font-weight:600; }
.diff-dim{ color:var(--text2); }
.diff-hi{ color:var(--verdict-red); font-weight:600; }
.expl-distractor{ padding-left:8px; border-left:2px solid var(--line); margin-bottom:10px; }
.stem .stem-pt{ margin-top:8px; padding-left:1.3em; text-indent:-1.3em; }
.stem-inner.long .material{ position:sticky; top:0; z-index:5; background:var(--bg-surface-alt);
  border-left:3px solid var(--brand); padding:16px 22px; border-radius:0 var(--radius-md) var(--radius-md) 0; white-space:pre-wrap; }
#p-frac{ flex:none; margin:8px 0; font-variant-numeric:tabular-nums; }
/* 选项行 */
.optbtns{ display:flex; flex-direction:column; gap:12px; margin-top:28px; width:100%; }
.optbtns button{ position:relative; display:flex; align-items:flex-start; min-height:56px; width:100%;
  padding:13px 16px; background:var(--bg-surface); border:1px solid var(--border-strong);
  border-radius:var(--radius-md); color:var(--text-primary); text-align:left; box-shadow:var(--shadow-sm);
  transition:border-color var(--dur-fast),background var(--dur-fast),box-shadow var(--dur-fast); user-select:none; }
@media (hover:hover){ .optbtns button:hover:not(:disabled){ border-color:var(--brand); background:var(--bg-surface-alt); } }
.optbtns button:focus-visible{ outline:none; border-color:var(--brand); box-shadow:var(--focus-ring); }
.optbtns button:active:not(:disabled) .opt-badge{ transform:scale(.96); }
.opt-badge{ display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; min-width:32px;
  margin-right:12px; background:var(--bg-surface-alt); border:1px solid var(--border-strong);
  border-radius:var(--radius-sm); font-weight:800; font-size:15px; color:var(--text-primary); transition:transform 80ms ease; }
.opt-text{ flex:1; font-size:16px; line-height:1.6; color:var(--text-primary); padding-top:2px; }
.optbtns button.sel{ border-color:var(--brand-strong); background:var(--brand-soft); box-shadow:2px 2px 0 var(--brand-strong); }
.optbtns button.sel .opt-badge{ background:var(--brand); border-color:var(--brand-strong); color:#fff; }
body.night .optbtns button.sel .opt-badge{ background:var(--brand); border-color:var(--brand-strong); color:#fff; }
.optbtns button.correct{ border-color:var(--success-solid) !important; background:var(--success-surface) !important;
  color:var(--success-text) !important; box-shadow:2px 2px 0 var(--success-border) !important; animation:bloomSpring 450ms cubic-bezier(.34,1.56,.64,1); }
.optbtns button.correct .opt-badge{ background:var(--success-solid); border-color:var(--success-solid); color:#fff; }
.optbtns button.wrong{ border-color:var(--error-solid) !important; background:var(--error-surface) !important;
  color:var(--error-text) !important; box-shadow:2px 2px 0 var(--error-border) !important; animation:swaySoft 400ms ease-out; }
.optbtns button.wrong .opt-badge{ background:var(--error-solid); border-color:var(--error-solid); color:#fff; }
.optbtns button.correct-show{ border-color:var(--success-border) !important; background:var(--success-surface) !important; box-shadow:2px 2px 0 var(--success-border) !important; }
.optbtns button.correct-show .opt-badge{ background:var(--success-solid); border-color:var(--success-solid); color:#fff; }
@keyframes bloomSpring{ 0%{ transform:scale(.96); } 44%{ transform:scale(1.02); } 78%{ transform:scale(1); } 100%{ transform:scale(1); } }
@keyframes bloomHalo{ 0%{ opacity:.8; transform:scale(.8); } 100%{ opacity:0; transform:scale(1.25); } }
.optbtns button.correct::after{ content:""; position:absolute; inset:-1.5px; border-radius:var(--radius-md);
  border:2px solid color-mix(in srgb, var(--success-solid) 65%, var(--brand)); pointer-events:none;
  animation:bloomHalo 450ms ease-out forwards; }
@keyframes swaySoft{ 0%{ transform:translateX(0) rotate(0); } 25%{ transform:translateX(6px) rotate(.8deg); }
  60%{ transform:translateX(0) rotate(0); } 100%{ transform:translateX(0) rotate(0); } }
@keyframes sweepLine{ 0%{ transform:scaleX(0); opacity:0; } 20%{ opacity:.9; } 100%{ transform:scaleX(1); opacity:0; } }
.optbtns button.wrong::before{ content:""; position:absolute; top:0; left:12px; right:12px; height:2px;
  border-radius:2px; background:var(--brand); transform-origin:left; pointer-events:none;
  animation:sweepLine 400ms ease-out forwards; }
/* 数字键盘与文本输入 */
#p-keypad-wrap{ flex:none; }
#p-keypad-wrap:empty{ display:none; }
.answer-display{ border-bottom:2px solid var(--border-strong); padding:10px 4px; margin-bottom:12px;
  font-size:22px; font-weight:700; font-variant-numeric:tabular-nums; min-height:48px; }
.answer-display .ph{ font-size:18px; color:var(--text-placeholder); font-weight:500; }
.keypad{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; padding:16px var(--page-gutter) 0; }
.keypad button{ min-height:52px; background:var(--bg-surface); border:1px solid var(--border-strong);
  border-radius:var(--radius-md); font-size:26px; font-weight:700; color:var(--text-primary); padding:18px 0; box-shadow:var(--shadow-sm); }
.keypad button.fn{ font-size:20px; color:var(--text-secondary); }
.keypad button:active{ background:var(--bg-surface-alt); }
#p-textinput{ width:100%; min-height:120px; resize:vertical; }
#p-textinput[readonly]{ background:var(--bg-surface-alt); }
/* 底栏与提交条 */
.p-bottombar{ flex:none; min-height:60px; display:flex; align-items:center; gap:8px; padding:8px 12px;
  padding-bottom:calc(8px + env(safe-area-inset-bottom));
  background:var(--bg-surface);
  border-top:1px solid var(--border-strong); }
.p-bbtn{ flex:none; min-height:44px; padding:0 14px; border-radius:var(--radius-sm); border:1px solid var(--border-strong);
  background:var(--bg-surface); color:var(--text-primary); font-size:14px; font-weight:700; box-shadow:var(--shadow-sm); }
.p-bbtn.draft{ min-width:44px; padding:0; font-size:20px; }
.p-bfill{ flex:1; }
#p-submitbar{ display:flex; }
#p-submitbar:empty{ display:none; }
#p-submitbar .btn,#p-submit{ min-height:44px; }
.submit-bar{ display:flex; align-items:center; gap:8px; padding:10px 0; border-top:1px solid var(--border-subtle); }
.submit-bar .btn{ font-size:14px; }
/* 反馈与锁定提示 */
#p-feedback:empty{ display:none; }
.feedback{ font-size:15px; padding:10px 0 10px 14px; border-left:3px solid var(--border-strong); }
.feedback.ok{ border-left-color:var(--success-solid); }
.feedback.err{ border-left-color:var(--error-solid); }
.feedback .exp{ line-height:1.7; color:var(--text-secondary); }
.feedback .ans{ font-weight:700; color:var(--text-primary); }
.locked-line{ font-size:13px; text-align:center; color:var(--text-tertiary); padding:8px 0; }
/* 练习页桌面 */
@media (min-width:900px){
  body.in-practice #app{ max-width:760px; }
  .p-topbar{ min-height:56px; }
  .p-topbar .p-timer{ font-size:14px; }
  .stem{ font-size:18px; line-height:1.7; }
  .stem.lstem{ font-size:18px; }
  .optbtns button{ padding:16px 20px; font-size:17px; line-height:1.6; }
  .p-bbtn{ font-size:15px; }
}

/* ---------- 6. PALETTE / DRAFT / VERDICT ---------- */
/* 答题卡 */
.pal-mask{ position:fixed; inset:0; z-index:90; background:rgba(0,0,0,.4); display:flex;
  align-items:flex-end; justify-content:center; }
.pal-sheet{ width:100%; max-height:72vh; background:var(--bg-surface); border:1px solid var(--border-strong); border-radius:var(--radius-xl) var(--radius-xl) 0 0;
  display:flex; flex-direction:column; overflow:hidden; box-shadow:var(--shadow-lg); }
.pal-grab{ width:36px; height:4px; border-radius:2px; background:var(--border-strong); margin:10px auto 4px; flex:none; }
.pal-head{ display:flex; align-items:center; gap:8px; padding:8px 12px 8px 16px; border-bottom:1px solid var(--border-subtle); flex:none; }
.pal-ttl{ font-size:17px; font-weight:800; }
.pal-count{ font-size:13px; font-weight:600; color:var(--text-secondary); }
.pal-x{ min-width:44px; height:44px; margin-left:auto; border:none; background:transparent; color:var(--text-primary); font-size:20px; }
.pal-grid{ flex:1; min-height:0; display:grid; grid-template-columns:repeat(5,1fr); gap:12px; padding:16px; overflow-y:auto; align-content:start; }
.pal-cell{ min-height:44px; display:flex; align-items:center; justify-content:center; position:relative;
  border-radius:var(--radius-sm); font-size:15px; font-weight:700; font-variant-numeric:tabular-nums;
  border:1px solid var(--border-strong); background:var(--bg-surface); color:var(--text-secondary); box-shadow:var(--shadow-sm); }
.pal-cell.answered{ background:var(--brand); border-color:var(--brand-strong); color:#fff; }
.pal-cell.seen{ border-color:var(--border-strong); color:var(--text-primary); }
.pal-cell.next{ border:1.5px solid var(--border-strong); }
.pal-cell.locked{ opacity:.45; border-style:dashed; pointer-events:none; }
.pal-cell.cur{ border:2px solid var(--brand); font-weight:800; color:var(--text-primary); }
.pal-cell.cur::after{ content:""; position:absolute; top:-4px; right:-4px; width:6px; height:6px; border-radius:50%;
  background:var(--brand); animation:palPulse 1.2s ease-in-out infinite; }
@keyframes palPulse{ 0%,100%{ opacity:1; } 50%{ opacity:.3; } }
.pal-foot{ flex:none; padding:12px 16px; border-top:1px solid var(--border-subtle);
  padding-bottom:calc(12px + env(safe-area-inset-bottom)); }
.pal-hint{ font-size:12px; color:var(--text-tertiary); margin-top:8px; }
/* 草稿纸 */
.draft-mask{ position:fixed; inset:0; z-index:120; display:flex; flex-direction:column;
  -webkit-touch-callout:none; user-select:none; -webkit-user-select:none;
  background-color:rgba(250,245,238,.28);
  background-image:linear-gradient(rgba(34,26,22,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(34,26,22,.07) 1px,transparent 1px),linear-gradient(rgba(34,26,22,.14) 1px,transparent 1px),linear-gradient(90deg,rgba(34,26,22,.14) 1px,transparent 1px);
  background-size:28px 28px,28px 28px,140px 140px,140px 140px; }
body.night .draft-mask{ background-color:rgba(22,19,17,.36);
  background-image:linear-gradient(rgba(242,236,228,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(242,236,228,.08) 1px,transparent 1px),linear-gradient(rgba(242,236,228,.16) 1px,transparent 1px),linear-gradient(90deg,rgba(242,236,228,.16) 1px,transparent 1px); }
.draft-layers{ position:relative; flex:1; min-height:0;
  margin-top:calc(64px + env(safe-area-inset-top)); margin-bottom:env(safe-area-inset-bottom); }
.draft-layers canvas{ position:absolute; inset:0; width:100%; height:100%; display:block;
  touch-action:none; cursor:crosshair; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; }
#dc-bg{ pointer-events:none; }
.d-x{ position:absolute; top:calc(12px + env(safe-area-inset-top)); right:14px; z-index:2;
  width:46px; height:46px; border:1px solid var(--border-strong); border-radius:var(--radius-sm); background:var(--bg-surface);
  font-size:20px; color:var(--text-primary); display:flex; align-items:center; justify-content:center; box-shadow:var(--shadow-sm); }
.draft-bar{ position:fixed; top:calc(12px + env(safe-area-inset-top)); left:12px; z-index:121;
  background:var(--bg-surface); border:1px solid var(--border-strong); border-radius:var(--radius-md);
  box-shadow:var(--shadow-lg); padding:6px 8px; }
.db-row{ display:flex; gap:6px; align-items:center; justify-content:center; flex-wrap:wrap; }
.db-sep{ width:1px; align-self:stretch; background:var(--border-subtle); margin:6px 5px; flex:none; }
.draft-bar button{ min-height:36px; line-height:1; flex:none; display:flex; align-items:center; justify-content:center;
  padding:6px 10px; border-radius:var(--radius-sm); border:1px solid var(--border-subtle);
  background:var(--bg-surface); color:var(--text-primary); font-size:16px;
  -webkit-touch-callout:none; user-select:none; -webkit-user-select:none; }
.draft-bar button.on{ background:var(--brand); color:#fff; border-color:var(--brand-strong); }
.draft-bar button:disabled{ opacity:.35; }
#d-clear{ color:var(--text-secondary); touch-action:none; }
.sw{ width:42px; height:44px; min-width:0; min-height:0; padding:0; background:transparent; border-color:transparent;
  display:inline-flex; align-items:center; justify-content:center; }
.sw-dot{ width:22px; height:22px; border-radius:50%; border:2px solid #fff; box-shadow:0 0 0 1px rgba(0,0,0,.15); display:block; flex:none; }
.draft-bar .sw.on{ background:transparent; border-color:transparent; }
.draft-bar .sw.on .sw-dot{ box-shadow:0 0 0 2px var(--text-primary); }
#d-expand{ display:none; }
.draft-bar.collapsed .db-row{ display:none !important; }
.draft-bar.collapsed #d-expand{ display:flex; align-items:center; justify-content:center; }
.draft-bar.collapsed{ padding:4px; }
#d-expand{ width:48px; height:48px; padding:0; gap:1px; }
#d-expand .sw-dot{ width:14px; height:14px; }
#d-expand .exp-arrow{ font-size:18px; line-height:1; }
#d-thickbtn .tdot{ font-size:14px; line-height:1; }
#d-thickbtn small{ font-size:11px; color:var(--text-secondary); margin-left:2px; }
@media (max-width:599.98px) and (orientation:portrait){
  .draft-bar{ top:auto; left:50%; right:auto; transform:translateX(-50%);
    bottom:calc(12px + env(safe-area-inset-bottom)); max-width:94vw; padding:5px 7px; }
  .draft-bar.collapsed{ left:auto; right:12px; transform:none; }
  .draft-bar .db-row{ gap:4px; }
  .draft-bar .db-sep{ margin:4px 2px; }
  .draft-bar button{ padding:4px 5px; font-size:14px; min-height:32px; }
  .draft-layers{ margin-top:env(safe-area-inset-top); margin-bottom:calc(62px + env(safe-area-inset-bottom)); }
}
/* 判分闪层与飘分（时序已验证，不动动画时长语义） */
.verdict{ position:fixed; top:0; left:0; right:0; z-index:400; pointer-events:none;
  display:flex; flex-direction:column; align-items:center; padding-top:calc(64px + env(safe-area-inset-top));
  opacity:0; }
.verdict.show{ animation:verdictIn 1.05s ease forwards; }
.verdict .v-mark{ font-size:40px; font-weight:800; line-height:1; }
.verdict .v-mark.ok{ color:var(--success-solid); animation:markPop 450ms cubic-bezier(.34,1.56,.64,1); }
.verdict .v-mark.err{ color:var(--error-solid); animation:markSway 400ms ease-out; }
.verdict .combo{ font-size:15px; font-weight:800; color:var(--brand-text); margin-top:6px; }
@keyframes verdictIn{ 0%{ opacity:0; transform:scale(.85); } 12%{ opacity:1; transform:scale(1); }
@keyframes markPop{ 0%{ transform:scale(.6); } 45%{ transform:scale(1.15); } 75%{ transform:scale(1); } 100%{ transform:scale(1); } }
@keyframes markSway{ 0%{ transform:translateX(0) rotate(0); } 25%{ transform:translateX(5px) rotate(.6deg); } 60%{ transform:translateX(0) rotate(0); } 100%{ transform:translateX(0) rotate(0); } }
  80%{ opacity:1; } 100%{ opacity:0; transform:scale(1); } }
.float-pts{ position:fixed; z-index:500; font-size:18px; font-weight:800; color:var(--success-solid);
  pointer-events:none; animation:floatUp 400ms linear forwards; }
.float-pts.practice{ font-size:26px; animation:floatUpP 450ms cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes floatUp{ from{ opacity:1; transform:translateY(0); } to{ opacity:0; transform:translateY(-48px); } }
@keyframes floatUpP{ 0%{ opacity:0; transform:translateY(0) scale(.85); } 30%{ opacity:1; transform:translateY(-8px) scale(1.1); }
  100%{ opacity:0; transform:translateY(-24px) scale(1); } }
/* 答题卡桌面：右抽屉 */
@media (min-width:900px){
  .pal-mask{ justify-content:flex-end; align-items:stretch; }
  .pal-sheet{ width:340px; max-width:92vw; max-height:none; height:100dvh; border-radius:0;
    border-left:1px solid var(--border-strong); }
  .pal-cell{ font-size:16px; }
}

/* ---------- 7. OTHER VIEWS ---------- */
/* 结果页与统计行 */
.rstat{ display:flex; flex-direction:column; gap:0; background:var(--bg-surface);
  border:1px solid var(--border-strong); border-radius:var(--radius-lg); box-shadow:var(--shadow-md); overflow:hidden; }
.rstat .rs{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px;
  border-bottom:1px solid var(--border-subtle); }
.rstat .rs:last-child{ border-bottom:none; }
.rstat .rs .k{ font-size:13px; font-weight:500; color:var(--text-secondary); }
.rstat .rs .v{ font-size:20px; font-weight:800; font-variant-numeric:tabular-nums; }
.record-badge{ display:inline-block; font-size:14px; font-weight:800; color:var(--brand-text);
  background:var(--brand-soft); border:1px solid var(--brand); border-radius:var(--radius-full); padding:6px 14px; }
.record-badge.pop{ animation:rowIn 240ms ease; }
/* 列表通用（历史/错题/申论/写作列表） */
.litem{ padding:18px 0; border-bottom:1px solid var(--border-subtle); }
.litem .t{ font-size:13px; font-weight:800; color:var(--text-secondary); margin-bottom:4px; }
.litem .m{ font-size:14px; line-height:1.7; color:var(--text-secondary); }
.litem .m.stem{ font-size:15px; color:var(--text-primary); }
.litem .m .ua{ color:var(--error-text); text-decoration:line-through; }
.litem .ops{ display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.litem .ops button{ min-height:44px; padding:0 14px; border-radius:var(--radius-md);
  border:1px solid var(--border-strong); background:var(--bg-surface); color:var(--text-primary);
  font-size:14px; font-weight:600; box-shadow:var(--shadow-sm); }
.litem.seg-active{ border-left:3px solid var(--brand); padding-left:12px; background:var(--brand-soft); }
/* 错题本分段钮（手机端基样式；桌面 .wb-tabs-inner 规则不受影响） */
.wb-seg .wb-tab{ flex:none; border:1px solid var(--border-strong); background:var(--bg-surface); border-radius:var(--radius-sm);
  padding:6px 12px; font-size:13px; font-weight:600; color:var(--text-primary); cursor:pointer;
  font-family:inherit; white-space:nowrap; box-shadow:var(--shadow-sm); }
.wb-seg .wb-tab.on{ background:var(--brand); border-color:var(--brand-strong);
  color:#fff; font-weight:800; box-shadow:var(--shadow-sm); }
/* 错题本 */
#w-list{ position:relative; }
.w-filter{ display:flex; gap:10px; align-items:center; margin:12px 0; }
.w-filter select{ flex:1; min-width:0; }
.w-menu{ position:absolute; min-width:120px; background:var(--bg-raised); border:1px solid var(--border-strong);
  border-radius:var(--radius-md); box-shadow:var(--shadow-lg); padding:4px; z-index:130; }
.w-menu[hidden]{ display:none; }
.w-menu-item{ display:block; width:100%; text-align:left; min-height:44px; padding:0 14px; border:none;
  background:transparent; color:var(--text-primary); font-size:14px; border-radius:var(--radius-xs); }
.w-menu-item:hover{ background:var(--select-highlight); }
.w-menu-item.danger{ color:var(--error-text); }
/* 统计：扇形图与列表 */
.donut-wrap{ position:relative; width:180px; height:180px; margin:8px auto; }
.donut-wrap svg{ width:100%; height:100%; display:block; }
.donut-track{ stroke:var(--border-subtle); }
#donut-arc{ transition:stroke-dasharray 800ms cubic-bezier(.2,0,0,1); }
.donut-center{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.donut-center .v{ font-size:32px; font-weight:800; font-variant-numeric:tabular-nums; line-height:1.1; }
.donut-center .k{ font-size:12px; color:var(--text-secondary); }
.donut-legend{ display:flex; flex-wrap:wrap; gap:12px; justify-content:center; font-size:13px; color:var(--text-secondary); margin:8px 0 20px; }
.donut-legend .dot{ display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:4px; }
.plog{ display:flex; flex-direction:column; }
.plog .pr{ display:flex; align-items:center; gap:10px; padding:12px 16px; border-bottom:1px solid var(--border-subtle);
  font-size:14px; }
.plog .pr .t{ margin-left:auto; font-size:13px; color:var(--text-secondary); font-variant-numeric:tabular-nums; }
.plog .pr .rk{ font-size:13px; font-weight:800; color:var(--text-tertiary); }
.plog.modlist .pr{ border-left:3px solid var(--cat,var(--border-strong)); }
.plog .pr.mod2{ flex-direction:column; align-items:stretch; gap:4px; }
.plog .pr .modline{ display:flex; align-items:center; gap:10px; }
.plog .pr .modline2{ font-size:12px; color:var(--text-tertiary); padding-left:32px; font-variant-numeric:tabular-nums; }
.plog .weak-pill{ font-size:12px; font-weight:700; color:var(--error-text); background:var(--error-surface);
  border-radius:var(--radius-full); padding:2px 8px; margin-right:6px; }
.plog .weak-txt{ color:var(--error-text); }
.trend-empty{ font-size:14px; color:var(--text-tertiary); padding:16px 0; }
.trend-tip{ font-size:13px; color:var(--text-secondary); }

/* 打卡与我的 */
#ck-go{ min-height:48px; }
#buddy-lottie{ cursor:pointer; }
#buddy-lottie.buddy-tap{ animation:buddyTap 600ms ease; }
@keyframes buddyTap{ 0%{ transform:scale(1); } 40%{ transform:scale(1.12); } 100%{ transform:scale(1); } }
.mine-row{ display:flex; align-items:center; gap:12px; padding:14px 0; border-bottom:1px solid var(--border-subtle); }
.mine-row .vignette{ width:32px; height:32px; flex:none; }
.mine-row .t{ flex:1; min-width:0; display:flex; flex-direction:column; }
.mine-row .t span{ font-size:13px; color:var(--text-secondary); }
.mine-row .a{ font-size:20px; color:var(--text-tertiary); }
/* 设置 */
.switch{ position:relative; width:52px; height:30px; flex:none; border-radius:9999px;
  border:1px solid var(--border-strong); background:var(--bg-surface-alt); }
.switch::after{ content:""; position:absolute; top:2px; left:2px; width:24px; height:24px; border-radius:50%;
  background:#fffdf9; border:1px solid var(--border-strong); transition:left var(--dur-fast); }
.switch.on{ background:var(--brand); border-color:var(--brand-strong); }
.switch.on::after{ left:24px; border-color:transparent; }
.set-acts{ display:flex; flex-direction:column; gap:10px; margin-top:12px; }
/* 一表通算 */
.trow{ display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--border-subtle); }
.trow .lab{ flex:none; width:96px; font-size:14px; font-weight:600; color:var(--text-secondary); }

.trow input{ flex:1; }
/* 背诵卡片（公式/成语/政治/规范词共用） */
.fc-count{ font-size:14px; font-weight:700; color:var(--text-secondary); text-align:center; margin-bottom:10px;
  font-variant-numeric:tabular-nums; }
.fccard{ position:relative; min-height:220px; margin:0 var(--page-gutter); cursor:pointer;
  perspective:1000px; -webkit-perspective:1000px; isolation:isolate; }
.fc-inner{ position:absolute; inset:0; transform-style:preserve-3d; -webkit-transform-style:preserve-3d;
  transition:transform 180ms ease; -webkit-transition:-webkit-transform 180ms ease; will-change:transform; }
.fccard.flipped .fc-inner{ -webkit-transform:rotateY(180deg); transform:rotateY(180deg); }
.fc-face{ position:absolute; inset:0; backface-visibility:hidden; -webkit-backface-visibility:hidden;
  -webkit-transform:translateZ(0); transform:translateZ(0);
  display:flex; flex-direction:column; align-items:center; justify-content:flex-start;
  padding:24px 20px; background:var(--bg-surface); border:1px solid var(--border-strong); border-radius:var(--radius-xl);
  box-shadow:var(--shadow-md); overflow-y:auto; overflow-x:hidden; word-break:break-word; text-align:center; }
.fc-front{ border-top:4px solid var(--brand); }
.fc-back{ -webkit-transform:rotateY(180deg) translateZ(0); transform:rotateY(180deg) translateZ(0); }
.fc-t{ font-size:20px; font-weight:800; line-height:1.5; }
.fc-f{ font-size:17px; line-height:1.7; }
.fc-d{ font-size:15px; line-height:1.7; color:var(--text-secondary); margin-top:8px; }
.fc-hint{ font-size:13px; color:var(--text-tertiary); text-align:center; margin-top:12px; }
.fc-ops{ display:flex; gap:10px; margin-top:16px; }
.fc-ops button{ flex:1; min-height:48px; border-radius:var(--radius-md); border:1px solid var(--border-strong);
  background:var(--bg-surface); color:var(--text-primary); font-size:15px; font-weight:700; box-shadow:var(--shadow-sm); }
.fc-ops button:active{ background:var(--bg-surface-alt); }
/* 申论素材与规范词 */
.mcard{ background:var(--bg-surface); border:1px solid var(--border-strong); border-radius:var(--radius-lg);
  padding:14px 16px; margin-bottom:12px; box-shadow:var(--shadow-sm); }
.m-copy{ min-height:44px; padding:0 14px; border-radius:var(--radius-md); border:1px solid var(--border-strong);
  background:var(--bg-surface); color:var(--text-primary); font-size:14px; font-weight:600; box-shadow:var(--shadow-sm); }
/* 申论写作 */
.essay-ta{ width:100%; min-height:280px; line-height:1.8; resize:vertical; }
/* 闯关与时政板块 */
.xhg-head{ font-size:17px; font-weight:800; margin-bottom:4px; }
.xhg-sub{ font-size:14px; color:var(--text-secondary); }
.xhg-subs{ display:flex; flex-direction:column; gap:10px; margin-top:12px; }
#xhsz-list{ display:flex; flex-direction:column; gap:10px; }

/* ---------- 7b. HERO 细化 ---------- */
.ed-indexbar{ display:flex; gap:8px; margin:16px 0; }
.ed-idx{ flex:1; text-align:center; background:var(--bg-surface); border:1px solid var(--border-strong);
  border-radius:var(--radius-md); padding:12px 4px; box-shadow:var(--shadow-sm); }
.ed-idx .v{ font-size:20px; font-weight:800; font-variant-numeric:tabular-nums; line-height:1.2; }
.ed-idx .v.stat-pop{ color:var(--brand-text); animation:pageIn 180ms ease; }
.ed-idx .k{ font-size:12px; color:var(--text-secondary); margin-top:2px; }
.ed-dateline{ display:flex; justify-content:space-between; gap:12px; font-size:13px; color:var(--text-tertiary); margin-bottom:16px; }
.ed-dday{ font-size:16px; font-weight:800; color:var(--text-primary); font-variant-numeric:tabular-nums; }
.ed-kicker{ font-size:12px; font-weight:800; letter-spacing:.04em; color:var(--brand-text); }
.ed-headline{ font-family:'Patrick Hand','Xiaolai Mono SC','Comic Sans MS',cursive,sans-serif;
  font-size:40px; font-weight:400; line-height:1.15; letter-spacing:.08em; color:var(--text-primary); margin-top:8px; }
body.night .ed-headline{ color:var(--text-primary); }
.ed-standfirst{ font-size:20px; font-weight:600; line-height:1.6; letter-spacing:.035em; color:var(--text-secondary); margin-top:8px; }
body.night .ed-standfirst{ color:var(--text-secondary); }
@media (min-width:900px){
  .ed-cover{ padding:16px 20px; margin:12px 0; }
  .ed-headline{ font-size:30px; }
  .ed-standfirst{ font-size:18px; }
  .ed-cover-actions{ margin-top:10px; }
  .ed-coverlines{ margin-top:8px; }
}
.ed-swap{ min-width:44px; height:44px; border:none; background:transparent; color:var(--text-secondary); font-size:18px; }
.ed-wronglink{ font-size:14px; font-weight:700; color:var(--brand-text); background:none; border:none; padding:0; }
.ed-ok{ color:var(--success-text); font-weight:700; }
.btn.ed-outline{ background:var(--bg-surface); border-color:var(--border-strong); color:var(--text-primary); box-shadow:var(--shadow-sm); }
  body.night .btn.ed-outline{ background:var(--bg-surface); border-color:var(--border-strong); color:var(--text-primary); }
.ed-acc{ margin-top:12px; }
.ed-agenda{ margin-top:16px; display:flex; flex-direction:column; }
.ed-agenda-row{ display:flex; align-items:center; gap:8px; padding:10px 0; border-top:1px solid var(--border-subtle);
  font-size:14px; }
.ed-agenda-tx{ flex:1; min-width:0; }
.ed-agenda-go{ font-size:18px; color:var(--text-tertiary); }
.ed-agenda-done{ font-size:13px; color:var(--text-secondary); }
.ed-agenda-row.overdue .ed-agenda-tx{ color:var(--error-text); }
.step{ min-width:44px; height:44px; border-radius:var(--radius-md); border:1px solid var(--border-strong);
  background:var(--bg-surface); color:var(--text-primary); font-size:20px; font-weight:700; box-shadow:var(--shadow-sm); }
.rstat .rs.wrong .v{ color:var(--error-text); }
.skel{ background:var(--bg-surface-alt); border-radius:var(--radius-md); animation:skelPulse 1.4s ease-in-out infinite; }
@keyframes skelPulse{ 0%,100%{ opacity:.6; } 50%{ opacity:1; } }
.vignette{ display:inline-flex; }
.vignette svg{ width:100%; height:100%; }

/* ---------- 8. OVERLAYS & A11Y ---------- */
.fb-backdrop{ position:fixed; inset:0; z-index:390; background:var(--bg-overlay);
  display:flex; align-items:center; justify-content:center; padding:20px; }
.fb-card{ width:100%; max-width:480px; background:var(--bg-surface); border:1px solid var(--border-strong);
  border-top:3px solid var(--brand); border-radius:var(--radius-lg); padding:24px; box-shadow:var(--shadow-lg); }
.fb-card .ttl{ font-size:20px; font-weight:800; margin-bottom:10px; }
.fb-card .ans{ font-size:17px; font-weight:700; color:var(--error-text); }
.fb-card .btn{ margin-top:16px; }
.toast{ position:fixed; left:50%; bottom:120px; transform:translate(-50%,12px); z-index:600;
  background:var(--text-primary); color:var(--text-inverse); font-size:14px; font-weight:600; border-radius:var(--radius-md);
  padding:12px 18px; box-shadow:var(--shadow-lg); opacity:0; pointer-events:none;
  transition:opacity var(--dur-fast),transform var(--dur-fast); max-width:calc(100vw - 32px); text-align:center; }
.toast.show{ opacity:1; transform:translate(-50%,0); pointer-events:auto; }
.toast-action{ position:fixed; left:50%; bottom:90px; transform:translate(-50%,12px); z-index:600; max-width:min(90vw,1040px);
  display:flex; gap:10px; align-items:center; background:var(--text-primary); color:var(--text-inverse); font-size:14px;
  border-radius:var(--radius-md); padding:10px 12px 10px 18px; box-shadow:var(--shadow-lg);
  opacity:0; pointer-events:none; transition:opacity var(--dur-fast),transform var(--dur-fast); }
.toast-action.show{ opacity:1; transform:translate(-50%,0); pointer-events:auto; }
.toast-action button{ min-height:36px; padding:0 14px; border:none; border-radius:var(--radius-sm);
  background:var(--bg-surface); color:var(--text-primary); font-size:14px; font-weight:700; }
.confetti{ position:fixed; top:-20px; z-index:550; width:9px; height:14px; pointer-events:none;
  animation:fall linear forwards; }
@keyframes fall{ to{ transform:translateY(105vh) rotate(720deg); opacity:.7; } }
/* 夜间：旧模板内联 var(--cobalt) 白色按钮在深底上不可见，CSS 层纠正 */
body.night #webapk-ok{ background:var(--brand) !important; color:#ffffff !important; }
/* 减动效 */
@media (prefers-reduced-motion:reduce){
  *,::before,::after{ animation-duration:.01ms !important; animation-iteration-count:1 !important;
    transition-duration:.01ms !important; scroll-behavior:auto !important; }
  .optbtns button.wrong{ animation:none !important; }
  .float-pts{ display:none !important; }
}

/* 更新横幅：底部悬浮小药丸，不占文档流。旧版是文档流里的深色大块，登录页没有顶栏时
   会被 append 到 body，在桌面 flex 布局里撑成一整条黑色侧板（2026-11-03 yang 截图），故改成 fixed。 */
.update-banner{ position:fixed; left:50%; bottom:calc(20px + env(safe-area-inset-bottom)); z-index:200;
  display:flex; align-items:center; gap:10px; width:max-content; max-width:calc(100vw - 32px);
  margin:0; padding:10px 10px 10px 16px; background:var(--warning-surface); color:var(--text-primary);
  border:1px solid var(--border-strong); border-radius:var(--radius-md); box-shadow:var(--shadow-lg);
  font-size:14px; font-weight:700; opacity:0; pointer-events:none;
  transform:translate(-50%,12px); transition:opacity 180ms ease,transform 180ms ease; }
.update-banner.show{ opacity:1; pointer-events:auto; transform:translate(-50%,0); }
.update-banner.ub-above-tabbar{ bottom:calc(84px + env(safe-area-inset-bottom)); }
.update-banner button{ border:1px solid var(--brand-strong); background:var(--brand); color:#fff; padding:7px 16px;
  font-size:13px; font-weight:700; font-family:inherit; cursor:pointer; border-radius:var(--radius-sm); box-shadow:var(--shadow-sm); }
body.night .update-banner button{ background:var(--brand); color:#fff; }
.update-banner .ub-close{ background:none; color:var(--text-secondary); padding:6px 8px; font-size:15px; opacity:.8; }
/* 确认弹窗（JS 按需创建） */
.cf-mask{ position:fixed; inset:0; z-index:390; background:var(--bg-overlay); display:flex; align-items:center;
  justify-content:center; padding:20px; opacity:0; pointer-events:none; transition:opacity 120ms linear; }
.cf-mask.show{ opacity:1; pointer-events:auto; }
.cf-box{ background:var(--bg-surface); border:1px solid var(--border-strong);
  border-top:3px solid var(--brand); border-radius:var(--radius-xl); padding:24px 22px 18px; width:100%;
  max-width:340px; text-align:center; box-shadow:var(--shadow-lg); }
.cf-msg{ font-size:16px; font-weight:600; color:var(--text-primary); line-height:1.6;
  white-space:pre-line; margin-bottom:18px; }
.cf-btns{ display:flex; gap:12px; }
.cf-btns button{ flex:1; border:1px solid var(--border-strong); padding:12px 0; font-size:16px; font-weight:700;
  font-family:inherit; cursor:pointer; border-radius:var(--radius-sm); box-shadow:var(--shadow-sm); }
.cf-cancel{ background:var(--bg-surface); color:var(--text-primary); border:1px solid var(--border-strong); }
.cf-ok{ background:var(--brand); border-color:var(--brand-strong); color:#fff; }
.cf-ok.danger{ background:var(--error-solid); border-color:var(--error-solid); }
/* 待办回收站条 */
.td-trash-bar{ display:flex; justify-content:space-between; align-items:center;
  padding:12px 0; border-bottom:1px solid var(--border-subtle); font-size:13px; color:var(--text-secondary); }
.td-trash-bar button,.td-trash-acts button{ border:1px solid var(--border-strong); background:var(--bg-surface);
  color:var(--text-primary); font-size:13px; font-weight:700; padding:6px 12px; cursor:pointer; font-family:inherit; border-radius:var(--radius-sm); box-shadow:var(--shadow-sm); }
.td-trash-acts button.danger{ color:var(--error-text); border-color:var(--error-border); }
.td-trash-acts{ display:flex; gap:8px; margin-top:8px; }
/* 背诵断点抽屉 */
.resume-drawer{ background:var(--warning-surface); border:1px solid var(--warning-border);
  border-radius:var(--radius-sm); padding:12px 14px; margin:0 0 12px; box-shadow:var(--shadow-sm); }
.resume-drawer .rd-t{ font-size:14px; color:var(--text-primary); }
.resume-drawer .rd-s{ display:block; font-size:12px; color:var(--text-secondary); margin-top:4px; font-weight:400; }
.resume-drawer .rd-ops{ display:flex; gap:8px; margin-top:10px; }
.resume-drawer .rd-ops .sbtn{ flex:1; }
/* 下拉刷新提示（平时透明占位） */
.ptr-ind{ text-align:center; font-size:13px; color:var(--text-secondary); padding:0;
  height:0; overflow:visible; position:relative; z-index:30;
  opacity:0; transform:translateY(-10px); transition:opacity 120ms linear; pointer-events:none; }
/* 通用 pop 淡入 */
.pop{ animation:pageIn 180ms ease; }
/* 320px 窄屏：顶栏题号板与计时缩字，给标题留位置 */
@media (max-width:480px){
  .p-topbar .pal-btn{ font-size:11px; }
  .p-topbar .p-timer{ font-size:12px; }
}

/* ---------- 移植：重写时漏掉的旧规则（原样恢复，变量已映射到新色板） ---------- */
.empty {text-align: center; color: var(--text3); padding: 40px 0; font-size: 14px; }
#w-list .w-more {margin-left: auto; width: 44px; height: 44px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--text3); font-size: 18px; letter-spacing: 2px; cursor: pointer; font-family: inherit; }
.seg-eq {flex-wrap: nowrap; }
.seg-eq .chip {flex: 1; text-align: center; }
.field {width: 100%; border: none; border-bottom: 2px solid var(--line-strong);
  background: transparent; color: var(--text); font-size: 16px; padding: 10px 2px;
  font-family: inherit; border-radius: 0; }
.field:focus {outline: none; border-bottom-color: var(--ink); }
.field::placeholder {color: var(--text3); }
.stars .st-on {color: var(--cat, var(--ink)); }
.stars .st-off {color: var(--text3); }
.ed-dept {display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: var(--section-margin) 0 28px; border-bottom: 3px double var(--line-strong); }
.ed-dept-name {font-size: 20px; font-weight: 700; line-height: 1.3; }
.ed-dept-count {font-size: 12px; color: var(--text3); letter-spacing: .06em; }
.resume-item {padding: 14px 0; border-bottom: 1px solid var(--line); }
.resume-item .ri-t {font-size: 15px; font-weight: 700; }
.resume-item .ri-s {font-size: 12px; color: var(--text3); margin-top: 2px; }
.resume-item .ri-ops {display: flex; gap: 16px; margin-top: 8px; }
.qcustom .field {width: 96px; text-align: center; }
.qc-title {text-align: center; }
.stat-hero {text-align: center; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.radar-poly {fill: none; stroke: var(--ink); }
.weak-tip {font-size: 14px; font-weight: 700; }
.buddy-card {padding-top: 8px; }
.ed-lv {font-size: 16px; font-weight: 700; }
.ed-track {height: 8px; background: var(--bg-surface-alt); border: 1px solid var(--border-subtle); border-radius: 9999px; margin: 10px 0 4px; position: relative; overflow: hidden; }
.ed-track i {display: block; height: 100%; background: var(--rainbow-grad); border-radius: 9999px; }
.lvtrack {display: flex; gap: 0; margin-top: 12px; }
.lvstep {flex: 1; text-align: center; }
.lvstep .d {display: block; width: 8px; height: 8px; margin: 0 auto 4px; background: var(--line); border-radius: 2px; }
.lvstep.pass .d {background: var(--brand); }
.lvstep.on .d {background: var(--brand); width: 10px; height: 10px; }
.lvstep .n {font-size: 11px; color: var(--text3); }
.lvstep.on .n {color: var(--text); font-weight: 800; }
.plog.actlog .pr .p {color: var(--verdict-green); font-weight: 800; font-variant-numeric: tabular-nums; }
.checkin-hero {text-align: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.checkin-hero .streak {font-size: 36px; font-weight: 800; line-height: 1.1; }
.checkin-hero .lab {font-size: 14px; color: var(--text2); margin-top: 6px; }
.checkin-btn {display: block; width: 100%; border: 1px solid var(--brand-strong); background: var(--brand); color: #fff;
  font-size: 16px; font-weight: 700; padding: 14px 0; cursor: pointer; font-family: inherit; letter-spacing: 1px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.checkin-btn.done {background: var(--bg-surface); color: var(--text2); border: 1px solid var(--border-strong); box-shadow: none; }
.checkin-btn:disabled {opacity: .45; }
.checkin-cal {display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.checkin-cal .d {background: var(--paper); aspect-ratio: 1; display: flex; align-items: center;
  justify-content: center; font-size: 13px; color: var(--text2); font-variant-numeric: tabular-nums; }
.checkin-cal .d.hit {background: var(--brand); color: #fff; font-weight: 800; }
.checkin-cal .d.today {outline: 2px solid var(--brand); outline-offset: -2px; color: var(--text); font-weight: 700; }

.tip {padding: 12px 14px; border: 1px solid var(--warning-border); border-radius: var(--radius-sm); background: var(--warning-surface); font-size: 14px;
  line-height: 1.7; color: var(--warning-text); margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.pc-filters {display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; margin-bottom: 10px; align-items: center; }
.pc-stat {font-size: 12px; color: var(--text2); margin-left: 4px; }
.pc-cat {font-size: 11px; font-size: clamp(11px, 2.8cqw, 12px);
  color: var(--fc-front-text-subtle); font-weight: 700; margin-bottom: 10px; letter-spacing: .08em; }
.polity-q {line-height: 1.55; }
.pc-a {font-size: 15px; font-size: clamp(14px, 3.8cqw, 17px); font-weight: 500;
  line-height: 1.7; letter-spacing: .01em; text-align: left; padding: 0 6px;
  max-height: 46vh; overflow-y: auto; color: var(--text); }
.pc-a[data-chars="short"] {font-size: 17px; font-size: clamp(16px, 4.6cqw, 21px); font-weight: 600; line-height: 1.6; }
.pc-a[data-chars="long"] {font-size: 14px; font-size: clamp(14px, 3.4cqw, 15px); font-weight: 400; line-height: 1.75; }
.m-head {display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.m-cat {color: var(--text2); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.m-date {font-size: 12px; color: var(--text3); }
.m-title {font-size: 16px; font-weight: 600; margin-bottom: 6px; line-height: 1.4; }
.ed-pullquote {font-size: 16px; font-weight: 700; line-height: 1.75;
  padding: 22px; border: 1px solid var(--border-subtle); border-left: 3px solid var(--brand); border-radius: var(--air-feature); margin: 10px 0; color: var(--text); background: var(--bg-surface-alt); box-shadow: var(--shadow-sm); }
body.night .ed-pullquote {background: var(--bg-surface-alt); }
.m-body {font-size: 15px; line-height: 1.85; color: var(--text2); white-space: pre-wrap; }
.m-foot {display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.m-src {font-size: 12px; color: var(--text3); }
.score-row {display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 15px; }
.score-row .field {margin: 0; width: 76px; text-align: center; }
.score-row .field:disabled {opacity: .45; }
.xhg-card {padding: 14px 0; border-bottom: 1px solid var(--line); }
.trow .chk {flex: none; padding: 0 12px; font-size: 18px; }
.q-folio {font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--text3);
  font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.fracwrap {display: flex; align-items: center; justify-content: center; gap: 26px; padding: 6px var(--page-gutter) 10px; }
.fracwrap .frac {text-align: center; font-size: 28px; font-weight: 700; }
.frac .top {border-bottom: 2px solid var(--text); padding: 2px 14px; }
.frac .bot {padding: 2px 14px; }
.fracvs {color: var(--text2); font-size: 16px; }
.frac {display: inline-block; vertical-align: middle; text-align: center; margin: 0 3px; font-size: .92em; }
.frac > span {display: block; padding: 1px 8px; line-height: 1.5; }
.frac > span:first-child {border-bottom: 2px solid currentColor; }
.txt-answrap {padding: 8px var(--page-gutter) 0; }
.ans-line {text-align: center; font-size: 14px; font-weight: 700; color: var(--text2); margin-top: 6px; }
.result-hero {text-align: center; padding: 30px var(--page-gutter) 10px; }
.result-hero .big {font-size: 40px; font-weight: 800; color: var(--verdict-green); }
.result-hero .lab {color: var(--text2); margin-top: 4px; }
.earn-line {text-align: center; font-size: 14px; color: var(--text2); }
.earn-line.pop {animation: pageIn 180ms ease; }
.db-mini input[type=range] {width: 64px; flex: none; }

.wb-rail-item .wb-rail-glyph {font-size: 20px; line-height: 1; }
.wb-sub-empty {padding: 16px; font-size: 13px; color: var(--text2); }
.wb-sub-nores{ padding:16px; font-size:14px; line-height:1.7; color:var(--brand-text); cursor:pointer; }

@media (min-width:900px){ .sec-title{ margin:48px 0 16px; } }

/* ---------- v316：题目检索＋错题 10 次自动掌握＋全站壁纸 ---------- */
/* v317 壁纸：全站固定背景（含登录页），半透明淡淡显示；卡片仍为实色、文字不受影响；
   手机用竖版图、桌面用横板图（900px 分界，与站内桌面断点一致） */
body::before{
  content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background:url("wallpaper-m.jpg?v=v317") center/cover no-repeat;
  opacity:.60; /* v326：壁纸 0.30→0.60——卡片玻璃要透出壁纸，壁纸本身太淡是根因 */
}
@media (min-width:900px){
  body::before{ background-image:url("wallpaper.jpg?v=v317"); }
}
body.night::before{ opacity:.30; } /* v326：夜间壁纸 0.16→0.30 */
#app{ position:relative; z-index:1; }
/* 首页搜索入口 */
.search-bar{
  display:flex; align-items:center; gap:10px; width:100%;
  min-height:48px; padding:0 16px; margin:14px 0 4px;
  background:var(--bg-surface); border:1px solid var(--border-strong); border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm); cursor:pointer; text-align:left;
}
.search-bar-icon{ font-size:17px; line-height:1; }
.search-bar-ph{ flex:1; font-size:15px; color:var(--text-tertiary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.search-bar-go{ font-size:20px; color:var(--text-tertiary); line-height:1; }
/* 检索页 */
.search-card{ margin-top:16px; }
.search-row{ display:flex; gap:10px; }
.search-row input{
  flex:1; min-width:0; min-height:48px; padding:10px 14px;
  border:1px solid var(--border-strong); border-radius:var(--radius-sm);
  background:var(--bg-surface); color:var(--text-primary); font-size:16px;
}
.search-row input:focus{ outline:2px solid var(--brand); outline-offset:1px; }
.search-hint{ margin-top:10px; font-size:13px; line-height:1.6; }
#search-meta{ margin:14px 0 4px; font-size:13px; }
.search-item .s-opt{
  padding:6px 10px; margin:4px 0; border:1px solid var(--border-subtle);
  border-radius:var(--radius-sm); background:var(--bg-surface-alt);
  font-size:14px; line-height:1.6; color:var(--text-secondary);
}
/* 错题本：答对进度 */
.w-prog{ display:flex; align-items:center; flex-wrap:wrap; gap:8px; font-size:13px; }
.w-prog-bar{
  flex:1; min-width:80px; height:8px; border:1px solid var(--border-strong);
  border-radius:9999px; background:var(--bg-surface-alt); overflow:hidden;
}
.w-prog-bar i{ display:block; height:100%; background:var(--brand); border-radius:9999px; }

/* ---------- v324 全站卡片毛玻璃（Gemini 会诊方案落地） ----------
   作用域只限卡片容器：.card/.mcard/.rstat/.fb-card/.cf-box/.wb-sp-card/
   .ed-cover/.search-bar/.pal-sheet/.ed-idx（首页四张统计卡）/.cat-btn（首页四组入口）。
   v326 补 .ed-idx/.cat-btn：这两处也是卡片感表面，v324 漏了所以还是实白。
   不动：按钮与小芯片（.btn/.keypad/.wb-seg .wb-tab/.ed-idx）、栏
   （.topbar/.tabbar/#wb-tabs/.wb-seg）、登录卡（.login-split）、
   3D 翻卡 .fccard（backdrop-filter 会压扁 preserve-3d，翻面失效）。
   边框与硬偏移阴影沿用原有 var(--border-strong)/var(--shadow-*)，
   圆角沿用原有 2–8px，不改。Gemini 建议的 contain:paint 未加——
   它会裁掉卡片内溢出的子元素（如徽章），先保正确，滚动若卡再加。
   本块放文件末尾，靠后出现赢过前面同优先级 background 声明。 */
.card, .mcard, .rstat, .fb-card, .cf-box, .wb-sp-card, .ed-cover, .search-bar, .pal-sheet, .ed-idx, .cat-btn{
  background:var(--glass-bg);
  -webkit-backdrop-filter:var(--glass-blur);
  backdrop-filter:var(--glass-blur);
}
/* 不支持 backdrop-filter 的浏览器回退为实色卡，不留半透明无模糊 */
@supports not ((-webkit-backdrop-filter:blur(1px)) or (backdrop-filter:blur(1px))){
  .card, .mcard, .rstat, .fb-card, .cf-box, .wb-sp-card, .ed-cover, .search-bar, .pal-sheet, .ed-idx, .cat-btn{
    background:var(--bg-surface);
  }
  #wb-tabs{ background:var(--bg-surface); }
}

/* ---------- v328 字体大小设置（题目与选项文字三档） ---------- */
/* 选中态：与选中 chip 同款陶土底白字 */
.fs-btn.on{ background:var(--brand); border-color:var(--brand-strong); color:#fff; }
body.night .fs-btn.on{ background:var(--brand); border-color:var(--brand-strong); color:#fff; }
/* 大：题干 17→19px，选项 16→18px */
body.fs-1 .stem{ font-size:19px; }
body.fs-1 .stem.lstem{ font-size:19px; }
body.fs-1 .opt-text{ font-size:18px; }
/* 特大：题干 17→21px，选项 16→20px */
body.fs-2 .stem{ font-size:21px; }
body.fs-2 .stem.lstem{ font-size:21px; }
body.fs-2 .opt-text{ font-size:20px; }
