/* 参考博客 PaperMod 的文字层级；亮色配色继续使用现有主题。 */
:root{color-scheme:light}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue",sans-serif;font-size:18px;line-height:1.6;word-break:break-word}
h1,h2,h3,h4{line-height:1.3;font-weight:700;letter-spacing:-.02em}
h1{font-size:34px;margin-bottom:14px}
h2{font-size:24px;margin-bottom:14px}
h3{font-size:20px;margin-bottom:12px}
.logo{font-size:24px;line-height:1.3;letter-spacing:0}
.muted{font-size:14px;line-height:1.7}
.qtext{font-size:18px;line-height:1.8}
.opt,.passage,.an-box .c,.kf-item,.road-item .ds{font-size:16px;line-height:1.8}
.wb-item .q{font-size:18px;line-height:1.8}
.wrong-item{font-size:15px;line-height:1.7}
.an-box .h{font-size:15px;margin-bottom:8px}
.sec-title{flex-wrap:wrap}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;flex:none;width:36px;height:36px;border-radius:50%;color:var(--muted)}
.theme-toggle:hover{background:var(--bg);color:var(--text)}
.theme-toggle svg{display:block;flex-shrink:0}
.theme-toggle .icon-sun{display:none}
.tabbar{padding:6px 0 calc(6px + env(safe-area-inset-bottom))}
.tabbar .t{flex-direction:row;justify-content:center;min-height:44px}
.tabbar .t svg{display:block;flex:none}
@media(max-width:640px){
  h1{font-size:28px}
  h2{font-size:22px}
  .logo{font-size:22px}
}

/* 仅暗色覆盖：沿用蓝/紫主色和黄、蓝、紫、红、绿的功能区分。 */
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#1d1e20;--card:#2e2e33;--text:#e5e7eb;--muted:#abb1bd;--line:#484951;
  --brand:#8ab4ff;--brand2:#c0a0ff;--brand-dark:#a9c6ff;
  --ok:#84d4a0;--ok-bg:#22392f;--err:#f0a2a2;--err-bg:#41292e;
  --warn:#f1c06e;--warn-bg:#3c3425;--shadow:0 2px 10px rgba(0,0,0,.18);
}
[data-theme="dark"] .theme-toggle .icon-sun{display:block}
[data-theme="dark"] .theme-toggle .icon-moon{display:none}
[data-theme="dark"] header,[data-theme="dark"] .tabbar{background:var(--bg)}
[data-theme="dark"] .sum-hero{background:linear-gradient(135deg,#252c40,#322a42);border-color:#42455c}
[data-theme="dark"] .stat,[data-theme="dark"] .sum-grid .s{background:#292a30;border-color:var(--line)}
[data-theme="dark"] .pt-card,[data-theme="dark"] .pt-list,[data-theme="dark"] .wb-item,[data-theme="dark"] .road-item::before{background:var(--card)}
[data-theme="dark"] .btn{background:#2563eb;color:#fff}
[data-theme="dark"] .btn:hover{background:#1d4ed8}
[data-theme="dark"] .btn.alt{background:var(--card);color:var(--brand)}
[data-theme="dark"] .btn.gray{background:#383a42;color:#d4d7df}
[data-theme="dark"] .btn.ok{background:#247747}
[data-theme="dark"] .section-nav .active{background:#2563eb;color:#fff}
[data-theme="dark"] th,[data-theme="dark"] .kf-item,[data-theme="dark"] .wb-head,[data-theme="dark"] .passage,[data-theme="dark"] .opt,[data-theme="dark"] .cause-btn{background:#24252a;color:var(--text)}
[data-theme="dark"] .wb-head:hover,[data-theme="dark"] .pt-item:hover{background:#383a42}
[data-theme="dark"] .search-label input,[data-theme="dark"] .answer-draft,[data-theme="dark"] .score-input,[data-theme="dark"] .fill-row input{background:#24252a;color:var(--text)}
[data-theme="dark"] .opt .k{background:var(--card);border-color:var(--line);color:var(--muted)}
[data-theme="dark"] .opt:hover:not(:disabled){background:#273653}
[data-theme="dark"] .opt.picked,[data-theme="dark"] .pt-item.active{background:#273653}
[data-theme="dark"] .opt.right{background:var(--ok-bg)}
[data-theme="dark"] .opt.wrong{background:var(--err-bg)}
[data-theme="dark"] .opt.right .k{background:var(--ok);color:#1d1e20;border-color:var(--ok)}
[data-theme="dark"] .opt.wrong .k{background:var(--err);color:#1d1e20;border-color:var(--err)}
[data-theme="dark"] .tag,[data-theme="dark"] .lvl,[data-theme="dark"] .cause-chip{background:#28334f;color:#b7cfff}
[data-theme="dark"] .tag.warn,[data-theme="dark"] .lvl.l2{background:var(--warn-bg);color:var(--warn)}
[data-theme="dark"] .tag.err,[data-theme="dark"] .lvl.l3{background:var(--err-bg);color:var(--err)}
[data-theme="dark"] .tag.ok{background:var(--ok-bg);color:var(--ok)}
[data-theme="dark"] .tag.done{background:linear-gradient(90deg,#2563eb,#7c3aed);color:#fff}
[data-theme="dark"] .cause-chip b,[data-theme="dark"] .wbl-item .en{color:var(--brand)}
[data-theme="dark"] .cause-btn.on{background:#5448a7;color:#fff}
[data-theme="dark"] .an-box .c{color:var(--text)}
[data-theme="dark"] .an-how{background:var(--warn-bg)}
[data-theme="dark"] .an-how .h{color:var(--warn)}
[data-theme="dark"] .an-ex{background:#263143}
[data-theme="dark"] .an-base{background:#332c46}
[data-theme="dark"] .an-trap{background:var(--err-bg)}
[data-theme="dark"] .an-trap .h{color:var(--err)}
[data-theme="dark"] .an-ref{background:var(--ok-bg)}
[data-theme="dark"] .an-pts{background:#2b304b}
[data-theme="dark"] .an-pts .h{color:#b8bcff}
[data-theme="dark"] .wrong-item,[data-theme="dark"] .res-banner.err{border-color:#74444c}
[data-theme="dark"] .res-banner.ok{border-color:#3e7053}
[data-theme="dark"] .sum-hero .cmt{color:var(--muted)}
[data-theme="dark"] .pt-bar{background:#41434c}
[data-theme="dark"] .mock-clock{background:var(--warn-bg);color:var(--warn)}
/* 既有题图使用黑色线条，保持白色纸面以免改变图示含义。 */
[data-theme="dark"] .figbox{background:#fff}
