/* HanPath — 自包含样式。零外部依赖（字体走系统栈，纹理走内联 SVG data URI）。
   视觉语言：宣纸 / 朱砂 / 墨 —— 面向「学汉字」人群的东亚古典基调。
   明暗双主题（跟随系统 + 手动切换），RTL 一律用逻辑属性。

   ★ 只用纯 CSS 生成质感，不引外部图片：既零成本，也不会因第三方资源挂掉而变形。

   第三轮重排的四处「不合理布局」及判据：
   1) 15 个栏目平铺 → 分组下拉（桌面悬停 / 键盘 focus-within），窄屏抽屉里分组展开；
      无 JS 时退回完整嵌套列表，所有链接始终在 DOM 里。
   2) 顶部区块从「一大坨吸顶」→ 紧凑吸顶：滚动后只收起标语，导航与搜索始终可用。
      表头吸顶依赖真实量到的头部高度（--hdr-h，由 app.js 写入），
      并且只在 ≥48rem 关掉 .tblwrap 的横向滚动 —— 否则 overflow 容器
      会让 position:sticky 静默失效（「写了」不等于「生效」）。
   3) 长表格（241 汉字 / 150 词 / 24 部首）加索引条 + 即时过滤，不再是一条无尽滚动。
   4) 页脚从两行文字 → 四栏内链 + 全语种，页内链接密度直接翻倍。 */

:root {
  /* 这里只放**结构性**变量。配色一律由 static/skins.css 按 [data-skin] 提供 ——
     两处都定义颜色会变成「谁后加载谁生效」的隐式耦合。 */
  --radius: 8px;
  --radius-lg: 14px;
  --maxw: 72rem;              /* 原来 64rem：1280px 下卡片网格被挤成 2 列 */
  --hdr: 3.5rem;              /* 单行头部高度（桌面）；--hdr-h 是 JS 量出的真实值 */
  --hdr-h: 0px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 18px rgba(0,0,0,.06);
  --shadow-hover: 0 2px 6px rgba(0,0,0,.08), 0 12px 30px rgba(0,0,0,.10);
  /* 宣纸纤维：内联 SVG turbulence，不产生网络请求 */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif CN",
           "STSong", "SimSun", "Noto Serif SC", "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
}
/* 暗色只覆盖结构性阴影 —— 颜色由 skins.css 的 [data-theme="dark"][data-skin] 负责 */
html[data-theme="dark"] {
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 6px 18px rgba(0,0,0,.35);
  --shadow-hover: 0 2px 6px rgba(0,0,0,.55), 0 12px 30px rgba(0,0,0,.45);
}



* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); background-color: var(--paper);
  background-image: var(--grain),
    radial-gradient(1200px 600px at 15% -10%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(178,58,46,.05), transparent 55%);
  background-size: 180px 180px, auto, auto;
  background-blend-mode: multiply, normal, normal;
  font: 16px/1.7 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
        "Noto Sans", "Noto Sans Arabic", "Noto Sans Devanagari", "Noto Sans JP", sans-serif;
}
html[data-theme="dark"] body, html:not([data-theme="light"]) body { background-blend-mode: overlay, normal, normal; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) body { background-blend-mode: overlay, normal, normal; }
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* 视觉上隐藏但仍被读屏与搜索引擎读到 */
.vh {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; inset-inline-start: -9999px; top: 0; background: var(--brand);
  color: var(--brand-ink); padding: .5rem .9rem; border-radius: 0 0 var(--radius) 0; z-index: 60;
}
.skip:focus { inset-inline-start: 0; }

/* ---------------- 头部：单行 sticky（品牌 | 导航 | 搜索 | 语言 | 外观 | 菜单） ----------------
   第四轮改版。旧版三行堆叠（品牌+搜索+语言+主题 / 标语 / 导航），窄屏实测 150px，
   占掉手机上四成首屏。现在压成一行，标语移进首页 hero。 */
.top {
  position: sticky; top: 0; z-index: 40;
  /* ★ 这里**不能**用 backdrop-filter / transform / filter / will-change：
     它们会让 .top 变成「fixed 定位后代的包含块」，而窄屏抽屉 .gnav 正是它的后代。
     实测后果：抽屉高度塌成 59px（≈头部高度），translateY(-105%) 只上移 62px，
     于是页面顶部永远露出约 53px 的抽屉残影 —— 看起来像「顶栏变成了一个 Start 按钮」，
     而且完全不报错。改用不透明底色，既没有这个陷阱，移动端也少一次合成开销。 */
  background: var(--paper-2);
  border-block-end: 1px solid var(--line);
}
.topbar {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: .2rem;
  min-height: var(--hdr); padding-inline: clamp(.6rem, 2vw, 1.1rem);
}
.brand {
  display: inline-flex; align-items: center; gap: .5rem; flex: 0 0 auto;
  text-decoration: none; color: var(--ink); padding-inline-end: .6rem;
}
.brand-t { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; }
/* 印章 Logo：朱底白字 + 内描边 */
.logo {
  display: inline-grid; place-items: center; width: 1.95rem; height: 1.95rem;
  background: var(--brand); color: var(--brand-ink); border-radius: 6px;
  font-family: var(--serif); font-size: 1.08rem; font-weight: 700; line-height: 1;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--brand-ink) 55%, transparent);
}
.spacer { flex: 1 1 auto; min-width: .4rem; }

/* 图标：统一 currentColor 描边，换皮肤自动跟着变 */
.ico {
  width: 1.15em; height: 1.15em; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.ib {
  display: inline-flex; align-items: center; gap: .35rem;
  background: none; border: 1px solid transparent; color: var(--ink-2);
  font: inherit; font-size: .88rem; line-height: 1;
  padding: .42rem .5rem; border-radius: var(--radius); cursor: pointer;
}
.ib:hover { background: var(--paper); color: var(--ink); border-color: var(--line); }
.ib[aria-expanded="true"] { background: var(--paper); color: var(--brand); border-color: var(--line-2); }
.ib-t { font-size: .82rem; white-space: nowrap; }

/* ---------------- 导航：单行 7 组，宽屏悬停出面板 ---------------- */
.gnav { display: flex; align-items: center; gap: .05rem; flex: 0 1 auto; min-width: 0; }
/* 抽屉专用的头部/底部只在窄屏出现；桌面导航是行内的，没有「抽屉」这回事 */
.gn-hd, .gn-ft { display: none; }
/* ★ 分组图标只给抽屉用。桌面上 7 个图标多占约 140px，实测会把最后一项「More」
   挤到搜索框底下（遮挡检测抓到：button.gt 中心点 elementFromPoint = input#hp-q），
   也就是「看得见却点不到」。桌面导航没有图标也完全成立。 */
.gnav .gt .gi-ico { display: none; }
.gnav .g { position: relative; }
.gnav .gt {
  display: inline-flex; align-items: center; gap: .2rem;
  background: none; border: 0; font: inherit; font-size: .89rem; line-height: 1;
  color: var(--ink-2); padding: .5rem .55rem; border-radius: var(--radius);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.gnav .gt:hover { background: var(--paper); color: var(--ink); }
.gnav .g.on > .gt, .gnav .gt.single.on { color: var(--brand); font-weight: 600; }
.gnav .gt .ico { width: .75em; height: .75em; stroke-width: 2.4; opacity: .55; }
.gnav .gm {
  position: absolute; inset-block-start: calc(100% + .3rem); inset-inline-start: 0;
  min-width: 19rem; max-width: 25rem;
  background: var(--paper-2); border: 1px solid var(--line-2);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-hover);
  padding: .4rem; z-index: 50;
}
.gnav .gm ul { list-style: none; margin: 0; padding: 0; }
.gnav .gi { display: block; padding: .5rem .6rem; border-radius: var(--radius); text-decoration: none; }
.gnav .gi:hover { background: var(--paper); }
.gnav .gi-t { display: block; font-weight: 600; font-size: .93rem; color: var(--ink); }
.gnav .gi-d { display: block; font-size: .78rem; line-height: 1.42; color: var(--muted); margin-block-start: .12rem; }
.gnav .gi.on { background: color-mix(in srgb, var(--brand) 9%, transparent); }
.gnav .gi.on .gi-t { color: var(--brand); }
/* 面板默认不可见。★ 无 JS 时必须变回完整的嵌套列表 ——
   否则那些「组」是 <button>，点了没反应，整个分组下的页面都进不去。 */
.gnav .gm { display: none; }

/* ★★ `.open`（点击展开）这条规则**必须放在媒体查询外面**。
   它原来只写在 `@media (min-width: 64rem)` 里，于是窄屏上：点组标题 → JS 加上了
   `.open`、aria 也翻了，但 `display` 仍是 none → **屏幕上什么都不发生**，
   该组下的页面在手机上完全进不去。用户报的「手机端点了一点反馈都没有」就是这条。
   hover 那条只对指针设备有意义，仍留在宽屏区间里。 */
.js .gnav .g > .gm.open { display: block; }

html:not(.js) .gnav { flex-wrap: wrap; }
html:not(.js) .gnav .gm {
  display: block; position: static; min-width: 0; max-width: none;
  box-shadow: none; border: 0; background: none; padding: 0;
}
html:not(.js) .gnav .g > .gt .ico { display: none; }
@media (min-width: 64rem) {
  .js .gnav .g:hover > .gm,
  .js .gnav .g:focus-within > .gm { display: block; }
}
/* 展开态：标题高亮 + 箭头转向，让「点了有反应」这件事可见 */
.gnav .gt .ico { transition: transform .18s ease; }
.gnav .g.open > .gt { color: var(--brand); }
.gnav .g.open > .gt .ico { transform: rotate(180deg); }

/* ---------------- 搜索：宽屏常驻，窄屏按钮展开 ---------------- */
/* 搜索：给它一个真实的下限宽度，否则 1280px 下占位符会被截成
   "Search a character, wor" —— 这是旧版最扎眼的一处。 */
.srch { position: relative; display: flex; align-items: center; flex: 0 1 auto; width: clamp(11rem, 22vw, 20rem); min-width: 0; }
.srch input[type="search"] {
  width: 100%; font: inherit; font-size: .9rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 999px;
  padding-block: .45rem; padding-inline: .85rem 2.2rem;
}
.srch input[type="search"]::placeholder { color: var(--muted); }
.srch input:focus { outline: 2px solid color-mix(in srgb, var(--brand) 50%, transparent); outline-offset: 1px; }
.srch-go {
  position: absolute; inset-inline-end: .25rem; display: inline-flex;
  background: none; border: 0; color: var(--muted); padding: .35rem;
  border-radius: 50%; cursor: pointer;
}
.srch-go:hover { color: var(--brand); }
.srch-res {
  position: absolute; inset-block-start: calc(100% + .4rem); inset-inline: 0;
  background: var(--paper-2); border: 1px solid var(--line-2);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-hover);
  max-height: 60vh; overflow: auto; z-index: 50;
}
.sbtn { display: none; }

/* ---------------- 顶栏下拉面板（语言 / 外观） ---------------- */
.mw { position: relative; }
.menu {
  position: absolute; inset-block-start: calc(100% + .35rem); inset-inline-end: 0;
  min-width: 14rem; max-width: 21rem;
  /* ★ 用 dvh 减去头部：72vh 在小屏上会超出可视区，面板最后一项被裁掉
     （实测 390×720 里 Auto 一半在屏外）。dvh 才是「真的可用高度」。 */
  max-height: calc(100dvh - var(--hdr, 3.6rem) - 1.25rem);
  overflow: auto;
  background: var(--paper-2); border: 1px solid var(--line-2);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-hover);
  padding: .35rem; z-index: 50;
}
/* 这两个面板靠 JS 打开；无 JS 时语言的替代入口是页脚的全语种文字链。 */
.menu { display: none; }
.menu.open { display: block; }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu-h {
  margin: .45rem .55rem .15rem; font-size: .7rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.mi {
  display: flex; align-items: center; gap: .5rem; width: 100%;
  text-align: start; background: none; border: 0; font: inherit;
  font-size: .88rem; color: var(--ink-2); padding: .42rem .55rem;
  border-radius: var(--radius); cursor: pointer; text-decoration: none;
}
.mi:hover { background: var(--paper); color: var(--ink); }
.mi .ico { margin-inline-start: auto; width: .95em; height: .95em; opacity: 0; }
.mi.on { color: var(--brand); font-weight: 600; }
.mi.on .ico { opacity: 1; }
.langlist { columns: 2; column-gap: .15rem; }
.langlist li { break-inside: avoid; }
.sw { flex: 0 0 auto; width: 1.05rem; height: 1.05rem; border-radius: 50%; border: 1px solid var(--line-2); }
.sw-paper { background: linear-gradient(135deg, #f7f2e7 52%, #b23a2e 52%); }
.sw-jade { background: linear-gradient(135deg, #eef0e8 52%, #266b50 52%); }
.sw-cinnabar { background: linear-gradient(135deg, #f3e7dd 52%, #c0341f 52%); }
.sw-ink { background: linear-gradient(135deg, #ecebe7 52%, #2c4a6e 52%); }

/* ---------------- 窄屏：导航变离屏抽屉，搜索变按钮展开 ---------------- */
@media (max-width: 63.99rem) {
  .gnav {
    /* 显式的 top/bottom：`inset-block: var(--hdr) 0` 在实测里没能把高度撑开。 */
    position: fixed; top: var(--hdr); bottom: 0; left: 0; right: 0;
    /* ★ 抽屉是 flex 纵列：内容 + margin-top:auto 的底部信息块，
       这样「内容不够长」时底部信息贴在抽屉底，而不是留一大片白。
       ★ 必须显式 align-items:stretch —— 桌面那条 .gnav 的 align-items:center
       会继承到这里，在纵向 flex 里变成「子项水平居中」，
       实测 .gn-hd 只有 141px 宽、每组行 128–171px 宽且居中（判据：量 rect）。 */
    display: flex; flex-direction: column; align-items: stretch; overflow: auto; padding: 0;
    background: var(--paper); border-block-start: 1px solid var(--line);
    /* ★★ 收起态的位移必须用 calc(-100% - var(--hdr))，不能用 -105%。
       抽屉高度 = 100vh − hdr，而 translateY 的百分比按「自身高度」算：
       -105% 只比自身高多走 5%（≈39px），而它起步位置在 hdr 之下，需要多走整整一个 hdr。
       实测 390px 屏：抽屉 rect = 0,-771 高 788 → 底边 17，**页面顶部永远露出 17px 抽屉**
       （不报错、不影响布局、只有量 rect 才看得见）。
       再加 visibility/pointer-events 兜底：即使位移算错，也绝不会露出或拦走点击。 */
    transform: translateY(calc(-100% - var(--hdr, 3.6rem) - 2px));
    visibility: hidden; pointer-events: none;
    /* 代替 html{overflow:hidden} 锁背景：overflow 会改滚动容器（视口宽度 375→390，
       整页横向重排 15px），overscroll-behavior 只拦滚动链，不动布局。 */
    overscroll-behavior: contain;
    transition: transform .22s ease, visibility .22s;
    z-index: 39;
  }
  .js .gnav.open { transform: none; visibility: visible; pointer-events: auto; }
  html:not(.js) .gnav {
    position: static; transform: none; visibility: visible; pointer-events: auto;
    padding: 0; border: 0; display: block;
  }
  /* ---- 抽屉头部：标题 + 关闭钮（吸在抽屉顶，滚动时一直在） ---- */
  .gn-hd {
    position: sticky; top: 0; z-index: 2;
    display: flex; align-items: center; justify-content: space-between;
    padding: .35rem .5rem .35rem 1rem;
    background: var(--paper); border-block-end: 1px solid var(--line);
  }
  .gn-t { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
  .gn-x { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem;
    background: none; border: 0; color: var(--ink-2); cursor: pointer; border-radius: var(--radius); }
  .gn-x .ico { width: 1.25rem; height: 1.25rem; }
  .gn-x:active { background: var(--paper-2); }
  /* ---- 分组行：图标 + 标题 + 箭头，52px 级触控行 ---- */
  .gnav .g, .gnav .gt.single { border-block-end: 1px solid var(--line); }
  .gnav .gt {
    display: flex; align-items: center; gap: .8rem; width: 100%;
    padding: .9rem 1rem; font-size: 1.02rem; font-weight: 500;
    justify-content: flex-start; text-align: start;
  }
  .gnav .gt .gi-ico { display: inline-flex; color: var(--brand); opacity: .9; flex: 0 0 auto; }
  .gnav .gt .gi-ico .ico { width: 1.15rem; height: 1.15rem; }  .gnav .gt .ico { margin-inline-start: auto; color: var(--muted); transition: transform .18s ease; }
  .gnav .g.open > .gt .ico { transform: rotate(180deg); color: var(--brand); }
  .gnav .g.open > .gt, .gnav .gt.single.on { color: var(--brand); }
  /* ---- 子项：缩进 + 内侧竖线（层级一眼可见），标题 + 一行说明 ---- */
  .gnav .gm { position: static; min-width: 0; max-width: none; box-shadow: none;
    border: 0; background: var(--paper-2); padding: .2rem 0 .4rem; }
  .gnav .gm ul { margin: 0; padding: 0; }
  .gnav .gm .gi {
    position: relative; display: flex; flex-direction: column; gap: .12rem;
    padding: .6rem 1rem .6rem 2.9rem; min-height: 2.9rem;
  }
  .gnav .gm .gi::before {
    content: ""; position: absolute; inset-inline-start: 1.35rem;
    inset-block: .55rem; width: 2px; border-radius: 2px; background: var(--line-2);
  }
  .gnav .gm .gi.on::before { background: var(--brand); }
  .gnav .gm .gi-t { font-size: .98rem; font-weight: 500; }
  .gnav .gm .gi-d { font-size: .8rem; line-height: 1.4; color: var(--muted); }
  /* ---- 抽屉底部：品牌 + 标语 + 语言入口（margin-top:auto 贴底） ---- */
  .gn-ft { display: block; margin-block-start: auto; padding: 1rem 1rem 1.4rem;
    background: var(--paper-2); border-block-start: 1px solid var(--line); }
  .gn-ft-b { margin: 0; display: flex; align-items: center; gap: .5rem; font-weight: 700; font-family: var(--serif); }
  .gn-ft-b .logo { width: 1.5rem; height: 1.5rem; font-size: .95rem; }
  .gn-ft-t { margin: .35rem 0 0; font-size: .84rem; line-height: 1.5; color: var(--muted); }
  .gn-ft-l { margin: .5rem 0 0; font-size: .88rem; }
  /* ★ 触控目标：顶栏按钮原来是 32×32（Apple 建议 ≥44，WCAG 2.5.8 下限 24）。
     手机上手点偏一点就落到空白，感觉就是「按了没反应」。 */
  .ib { min-width: 2.6rem; min-height: 2.6rem; justify-content: center; padding: .4rem; }
  .mb, .sbtn { display: inline-flex; }
  .srch { display: none; }
  .srch.open {
    display: flex; position: absolute; inset-inline: .9rem;
    inset-block-start: calc(100% + .35rem); flex: 1 1 auto;
  }
  /* 无 JS 的窄屏：搜索框直接铺一行，否则手机上根本没有搜索入口 */
  html:not(.js) .srch { display: flex; flex: 1 1 100%; order: 9; margin-block-end: .5rem; }
}
@media (min-width: 64rem) {
  .mb { display: none; }
}
/* 窄屏空间不够：语言按钮只留地球图标。
   ★ 这条是实测出来的：360px 下汉堡按钮会被挤出 2px（页面出现横向滚动），
     而 320–360 段正是最便宜的那批手机。 */
@media (max-width: 47.99rem) {
  .ib-t { display: none; }
  .topbar { gap: .05rem; }
  .ib { padding: .42rem .42rem; }
  .brand { padding-inline-end: .3rem; }
}

/* 滚动后头部略收（只收内边距，不动字号，避免跳动） */
.top.shrink .topbar { min-height: 3rem; }
/* ---------------- layout ---------------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 1.1rem 1rem 2.6rem; }
h1, h2, h3, .display { font-family: var(--serif); letter-spacing: .01em; }
h1 { font-size: 1.85rem; line-height: 1.35; margin: .2rem 0 .5rem; font-weight: 700; }
h2 { font-size: 1.3rem; margin: 2rem 0 .7rem; font-weight: 700; scroll-margin-top: calc(var(--hdr-h) + .6rem); }
h2:first-of-type { margin-top: 1.4rem; }
h3 { font-size: 1.06rem; margin: 1.3rem 0 .4rem; }
p { margin: .55rem 0; }
.lead { color: var(--muted); font-size: 1.05rem; }
section { margin-bottom: 1.5rem; }
.page > *:first-child { margin-top: 0; }

/* 锚点跳转必须避开吸顶头部，否则「点字看释义」会落在标题下面被挡住 */
[id^="c-"], [id^="v-"], [id] { scroll-margin-top: calc(var(--hdr-h) + .8rem); }

/* ---------------- 面包屑 / 上一页下一页 ---------------- */
.crumbs { margin: 0 0 .5rem; font-size: .88rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; padding: 0; margin: 0; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-inline-end: .3rem; color: var(--line-2); }
.crumbs li[aria-current] { color: var(--ink-2); }

.pager { display: flex; gap: .7rem; justify-content: space-between; margin-top: 2.2rem; }
.pager .pg {
  flex: 1 1 0; display: flex; flex-direction: column; gap: .15rem; min-height: 3.4rem;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper-2);
  padding: .55rem .85rem; box-shadow: var(--shadow); color: inherit;
}
.pager a.pg:hover { text-decoration: none; border-color: var(--brand); transform: translateY(-1px); }
.pager .pg.next { text-align: end; align-items: flex-end; }
.pager .pg.empty { visibility: hidden; }
.pager .dir { font-size: .78rem; color: var(--muted); }
.pager .nm { font-family: var(--serif); font-weight: 700; color: var(--ink); }

/* ---------------- hero：中式底纹 + 标题 + 按钮（装饰在 deco.css 里） ---------------- */
.hero {
  position: relative; overflow: hidden;
  margin: .6rem 0 1.2rem; padding: clamp(1.4rem, 3.4vw, 2.6rem) clamp(1.1rem, 3vw, 2.2rem);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--paper-2); box-shadow: var(--shadow);
}
.hero-in { max-width: 40rem; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(1.6rem, 4.2vw, 2.35rem); line-height: 1.2; margin: 0 0 .3rem; }
.hero-hz { font-family: var(--serif); font-size: clamp(1rem, 2.2vw, 1.2rem); color: var(--accent); margin: 0 0 .8rem; }
.hero .lead { font-size: clamp(.98rem, 2vw, 1.08rem); color: var(--ink-2); margin: 0 0 1.2rem; max-width: 34rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--brand); color: var(--brand-ink); text-decoration: none;
  font-weight: 600; font-size: .95rem; padding: .6rem 1.1rem;
  border: 1px solid var(--brand); border-radius: var(--radius); cursor: pointer;
}
.btn:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.ghost:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }
/* 装饰性大字：纯展示，不进正文语义 */
.hzrow {
  position: absolute; inset-block-start: 50%; inset-inline-end: 1.2rem;
  transform: translateY(-50%); display: flex; gap: .35rem; z-index: 0;
}
.hzcell {
  display: grid; place-items: center; width: clamp(2rem, 5vw, 3rem); height: clamp(2rem, 5vw, 3rem);
  border: 1px dashed var(--line-2); border-radius: 4px;
  font-family: var(--serif); font-size: clamp(1.1rem, 2.6vw, 1.6rem);
  color: color-mix(in srgb, var(--ink) 22%, transparent);
}
@media (max-width: 47.99rem) { .hzrow { display: none; } }

/* ---------------- 统计条（.stats 是学习路径页仍在用的旧类，一并保留） ---------------- */
.statstrip { margin: 0 0 1.6rem; }
.statstrip ul, .stats {
  display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; list-style: none;
  margin: 0; padding: .6rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper-2);
}
.statstrip li, .stats li { font-size: .85rem; color: var(--muted); }
.statstrip b, .stats b { font-family: var(--serif); font-size: 1.05rem; color: var(--ink); margin-inline-end: .25rem; }

/* ---------------- 内容区与卡片网格 ---------------- */
.sec { margin: 0 0 2.2rem; }
.sec-lead { color: var(--muted); margin: -.3rem 0 1rem; }
.grp-h {
  font-size: .96rem; font-weight: 700; letter-spacing: .04em; color: var(--ink-2);
  margin: 1.5rem 0 .6rem; padding-block-end: .3rem; border-block-end: 1px solid var(--line);
}
.cards { display: grid; gap: .9rem; grid-template-columns: 1fr; }
/* .grid 是旧类，其他页面（学习路径等）仍在用，保持可用 */
.grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
@media (min-width: 34rem) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 56rem) {
  .cards.cols-3, .cards.cols-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 72rem) {
  .cards.cols-4 { grid-template-columns: repeat(4, 1fr); }
}
.card {
  display: block; background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1rem 1.1rem;
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
}
a.card:hover { border-color: var(--line-2); box-shadow: var(--shadow-hover); }
.card h3, .card h4 { margin: 0 0 .3rem; font-size: 1.02rem; }
.card p { margin: 0; font-size: .88rem; line-height: 1.5; color: var(--muted); }
a.card:hover h3, a.card:hover h4 { color: var(--brand); }
.card .kicker { display: block; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-block-end: .15rem; }
a.card .go { display: inline-block; margin-block-start: .35rem; font-size: .84rem; color: var(--brand); }
/* 入门三卡：数字徽标 */
.card--start { position: relative; padding-inline-start: 3.1rem; }
.card--start .num {
  position: absolute; inset-block-start: 1rem; inset-inline-start: 1rem;
  display: grid; place-items: center; width: 1.6rem; height: 1.6rem;
  border-radius: 50%; background: var(--brand); color: var(--brand-ink);
  font-size: .85rem; font-weight: 700;
}
.card--feature { background: color-mix(in srgb, var(--brand) 5%, var(--paper-2)); }
.card--feature .hz.big { font-family: var(--serif); font-size: 1.7rem; color: var(--ink); margin: 0 0 .2rem; }
.card--feature .py { color: var(--brand); font-size: .88rem; margin: 0 0 .3rem; }
.card--l1 p { color: var(--ink-2); }
.card--l1 .row { margin-block-start: .6rem; }
.card--lang { text-align: start; }
.card--lang:hover h3 { color: var(--brand); }
@media (min-width: 56rem) { .cardgrid-langs { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 72rem) { .cardgrid-langs { grid-template-columns: repeat(4, 1fr); } }
.sec-root h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
/* ---------------- 工具条（过滤 / 打印） ---------------- */
.toolbar {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 1rem 0 .6rem;
  padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--paper-2); box-shadow: var(--shadow);
  position: sticky; top: var(--hdr-h); z-index: 20;
}
.toolbar .fld { display: inline-flex; align-items: center; gap: .4rem; flex: 1 1 14rem; min-width: 0; }
.toolbar .fld > span { font-size: .86rem; color: var(--muted); white-space: nowrap; }
.toolbar input[type="search"] {
  flex: 1 1 auto; min-width: 6rem; background: var(--paper); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 999px; padding: .34rem .8rem; font: inherit; font-size: .92rem;
  min-height: 2.25rem;
}
.toolbar input[type="search"]:focus { border-color: var(--brand); }
.fcount { font-size: .84rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.toolbar .printbtn { margin-inline-start: auto; }
@media print {
  .toolbar { display: none; }
}

/* 汉字索引条：241 个字一眼可扫，也是「页内链接密度」最直接的补法 */
.chipindex { display: flex; flex-wrap: wrap; gap: .2rem; margin: .5rem 0 .2rem; }
.chipindex a {
  display: grid; place-items: center; width: 1.85rem; height: 1.85rem; font-family: var(--serif);
  font-size: 1rem; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; background: var(--paper-2);
}
.chipindex a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; background: color-mix(in srgb, var(--brand) 7%, transparent); }

/* ---------------- hanzi ---------------- */
.hz { font-family: var(--serif); }
.big { font-size: 3.4rem; line-height: 1.15; }
.py { color: var(--brand-2); font-variant-numeric: tabular-nums; }
.gloss { color: var(--muted); }

/* 表格：宽屏关掉 overflow 容器，表头才真的吸得住（见文件头注释 2） */
.tblwrap { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper-2); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { padding: .5rem .7rem; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
th { background: color-mix(in srgb, var(--paper) 70%, var(--paper-2)); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--brand) 5%, transparent); }
tbody tr[hidden] { display: none; }
@media (max-width: 47.99rem) {
  .tblwrap { overflow-x: auto; }
}
@media (min-width: 48rem) {
  .tblwrap { overflow: visible; }
  .tblwrap th { position: sticky; top: var(--hdr-h); z-index: 18; }
}
/* 打印时不要阴影和底色，只要字 */
@media print {
  .tblwrap { box-shadow: none; border-color: #999; }
  th { position: static; background: #f2f2f2; }
}

/* ---------------- tools ---------------- */
.tool {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.05rem; box-shadow: var(--shadow); margin: 1.1rem 0;
}
.tool h2, .tool h3 { margin-top: 0; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row.wrap > * { flex: 0 0 auto; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip {
  border: 1px solid var(--line); background: var(--paper-2); color: var(--ink);
  border-radius: 999px; padding: .3rem .72rem; font: inherit; font-size: .9rem; cursor: pointer;
  min-height: 2.1rem;
  transition: border-color .12s, background .12s;
}
.chip:hover { border-color: var(--brand); }
.chip[aria-pressed="true"], .chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn {
  background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 10px;
  padding: .6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow);
  min-height: 2.6rem; display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover { text-decoration: none; background: var(--brand-2); }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line-2); box-shadow: none; }
.btn.ghost:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.btn:disabled { opacity: .5; cursor: default; }

.stage {
  min-height: 6.5rem; display: grid; place-items: center; padding: 1rem; gap: .3rem;
  background: var(--paper-2); border: 1px dashed var(--line-2); border-radius: var(--radius-lg); text-align: center;
  position: relative;
}
.out { font-size: 1.1rem; min-height: 1.7rem; }
.readout { font-size: 2.1rem; font-weight: 600; }

.tonebar { display: flex; gap: .5rem; flex-wrap: wrap; }
.tonebtn {
  flex: 1 1 8rem; border: 2px solid var(--line); background: var(--paper-2); color: var(--ink);
  border-radius: 10px; padding: .6rem; cursor: pointer; text-align: center; font: inherit; min-height: 3.6rem;
}
.tonebtn:hover { border-color: var(--brand); }
.tonebtn .n { display: block; font-size: 1.7rem; font-family: var(--serif); }
.tonebtn[data-t="1"] .n { color: var(--tone1); }
.tonebtn[data-t="2"] .n { color: var(--tone2); }
.tonebtn[data-t="3"] .n { color: var(--tone3); }
.tonebtn[data-t="4"] .n { color: var(--tone4); }
.tonebtn[data-t="5"] .n { color: var(--tone5); }
.tonebtn.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.tonebtn.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }

/* 米字格：写字练习 */
.padwrap { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
canvas.pad {
  width: 100%; max-width: 20rem; aspect-ratio: 1; touch-action: none; display: block;
  background: var(--paper-2); border: 1px solid var(--line-2); border-radius: var(--radius);
  flex: 0 0 auto;
}
.padside { flex: 1 1 14rem; min-width: 0; }
.progress { height: 8px; background: color-mix(in srgb, var(--paper) 60%, var(--paper-2)); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .3s; }

/* 笔顺动画容器（hanzi-writer） */
.strokebox { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.strokesvg { width: 12rem; height: 12rem; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--paper-2); flex: 0 0 auto; }
.strokeside { flex: 1 1 14rem; min-width: 0; }
@media (max-width: 30rem) { .strokesvg { width: 9rem; height: 9rem; } }

.note { font-size: .93rem; color: var(--muted); border-inline-start: 3px solid var(--brand); padding-inline-start: .75rem; }
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }
.badge {
  display: inline-block; font-size: .78rem; padding: .1rem .5rem; border-radius: 999px;
  background: var(--paper-2); border: 1px solid var(--line-2); color: var(--muted);
}
.badge.pill { font-family: inherit; }

/* ---------------- 「装到主屏」提示条 ----------------
   站已经能离线工作，但**在线时没有一处告诉访客**；能力不被看见等于没做。
   默认 hidden（无 JS 时永远不出现，不会留一个死按钮）。
   位置：窄屏贴底（拇指够得到）、宽屏右下角浮卡；z 在抽屉与顶栏之上。 */
.inst {
  position: fixed; z-index: 46;
  inset-inline: .6rem; inset-block-end: .6rem;
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  padding: .7rem .85rem;
  background: var(--paper-2); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover);
}
.inst[hidden] { display: none; }
.inst-ico { display: inline-flex; flex: 0 0 auto; color: var(--brand); }
.inst-ico .ico { width: 1.4rem; height: 1.4rem; }
.inst-tx { flex: 1 1 12rem; min-width: 0; }
.inst-t { margin: 0; font-weight: 600; font-size: .95rem; }
.inst-d { margin: .15rem 0 0; font-size: .84rem; line-height: 1.45; color: var(--muted); }
.inst-act { display: flex; gap: .4rem; flex: 0 0 auto; }
.inst-act .btn { font-size: .86rem; padding: .45rem .8rem; }
.inst-act .btn[hidden] { display: none; }
@media (min-width: 48rem) {
  /* 宽屏不占底边：做成右下角浮卡，避免盖住正文最后一屏 */
  .inst { inset-inline: auto 1rem; inset-block-end: 1rem; max-width: 26rem; }
}
@media print { .inst { display: none; } }

/* 页脚里的「装到主屏」入口：做成看起来像链接的按钮（它需要 JS 行为，不能是 <a>） */
.lnkbtn {
  background: none; border: 0; padding: 0; font: inherit; color: var(--brand);
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.lnkbtn[hidden] { display: none; }

/* ---------------- 离线能力：把「看不见的能力」说出来 ----------------
   Service Worker 在后台注册，访客完全感知不到；不显式表达就等于没做。
   页脚徽标是静态事实（真装了 SW），顶部横条只在 js 探测到断网时出现。 */
.osbadge {
  display: inline-flex; align-items: center; gap: .45rem;
  margin: .7rem 0 0; padding: .2rem .7rem;
  font-size: .85rem; color: var(--ink-2);
  background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 999px;
}
.osnote {
  display: flex; align-items: center; gap: .5rem;
  margin: 0; padding: .55rem 1rem;
  font-size: .9rem; background: var(--brand); color: var(--brand-ink);
  position: relative; z-index: 5;
}
/* ★ 必须显式写：上面的 display:flex 会盖掉 UA 样式表的 [hidden]{display:none}，
   结果「默认隐藏」的横条反而永远挂在页顶 —— 这类 bug 不报错，只是不对。 */
.osnote[hidden] { display: none; }
.osdot {
  flex: 0 0 auto; width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 24%, transparent);
}
.osnote .osdot { background: var(--brand-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-ink) 26%, transparent); }
.lv1 { color: var(--tone3); } .lv2 { color: var(--tone4); } .lv3 { color: var(--accent); }

/* 每日一读 / 学习路径 */
.poem {
  font-family: var(--serif); padding: 1.2rem 1.1rem; border: 1px solid var(--line-2);
  border-radius: var(--radius-lg); background: var(--paper-2); box-shadow: var(--shadow);
}
.poem .line { font-size: 1.5rem; line-height: 2; letter-spacing: .06em; }
.poem .meta { color: var(--muted); font-size: .95rem; margin-top: .5rem; }
.steps { counter-reset: d; list-style: none; padding: 0; margin: 0; }
.steps li {
  counter-increment: d; position: relative; padding: .6rem 0 .6rem 2.6rem;
  border-bottom: 1px solid var(--line);
}
.steps li::before {
  content: counter(d); position: absolute; inset-inline-start: 0; top: .6rem;
  width: 1.85rem; height: 1.85rem; display: grid; place-items: center; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink); font-size: .85rem; font-weight: 700;
}

/* 「先看/后练」两段式：学习路径与书写页共用 */
.split { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 48rem) { .split.two { grid-template-columns: 1fr 1fr; } }

/* ---------------- footer ---------------- */
.foot { border-top: 1px solid var(--line-2); background: color-mix(in srgb, var(--paper) 65%, var(--paper-2)); padding: 1.3rem 1rem 1.8rem; margin-top: 2.4rem; }
.foot .inner { max-width: var(--maxw); margin: 0 auto; }
.fcols { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); margin-bottom: 1rem; }
.fcol .fh { font-family: inherit; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 .35rem; }
.fcol ul { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.fcol li { margin: .16rem 0; }
.altlangs { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem .85rem; padding: 0; margin: .35rem 0 .8rem; font-size: .92rem; }
.src { color: var(--muted); font-size: .88rem; margin: 0; }

@media (max-width: 25rem) {
  /* 320px 级设备（iPhone SE 一代 / 老安卓）：品牌 + 4 个 42px 按钮放不下，
     实测 #menubtn 被挤出视口 4px 并产生横向滚动条。
     收紧按钮并压缩品牌内边距 —— 不隐藏任何入口，搜索仍然在顶栏。 */
  .ib { min-width: 2.25rem; min-height: 2.25rem; }
  .brand { padding-inline-end: .3rem; gap: .35rem; }
  .topbar { gap: .12rem; }
}
@media (max-width: 34rem) {
  h1 { font-size: 1.5rem; } .hero h1 { font-size: 1.7rem; } .big { font-size: 2.6rem; }
  .hero { padding: 1.2rem 1rem; } .hero::after { font-size: 3.2rem; opacity: .6; inset-inline-end: .5rem; }
  .tag { display: none; }
  .pager { flex-direction: column; }
  .pager .pg.next { text-align: start; align-items: flex-start; }
  .pager .pg.empty { display: none; }
}

/* 练习纸：只留字与米字格，其余全部撤掉 —— 打印出来就能直接写 */
@media print {
  .top, .foot, .pager, .crumbs, .skip, .srch, .actions, .tool .row, .tonebar, .progress { display: none !important; }
  body { background: #fff !important; color: #000; font-size: 12pt; }
  main { max-width: none; padding: 0; }
  a { color: #000; text-decoration: none; }
  .card, .tool, .hero, .poem { box-shadow: none; border-color: #999; break-inside: avoid; }
  .tblwrap { break-inside: auto; }
  h2 { break-after: avoid; }
  .strokesvg, canvas.pad { border-color: #999; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   书写页 v4：上下布局 —— 先看笔顺，再照着写
   旧版是「描红在上、笔顺在下」的两张并排卡，各带一个选字器：
   顺序反了（先练后看），而且选了上面下面不动。
   现在：一个 sticky 选字器 → 笔顺演示（上）→ 描红（下）。
   ========================================================================== */
.wpick {
  position: sticky; top: var(--hdr-h); z-index: 18;
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  margin: 0 0 1rem; padding: .55rem .8rem;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.wpick label { font-size: .85rem; color: var(--muted); }
.wpick select {
  font: inherit; font-size: 1.05rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: .3rem .5rem; min-width: 8rem;
}
.wmeta { margin-inline-start: auto; display: inline-flex; align-items: center; gap: .35rem;
  font-size: .85rem; color: var(--muted); }
.wcard { margin: 0 0 1.2rem; }
.whead { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-block-end: .5rem; }
.whead h2 { margin: 0; }
.wnanim .wanim-body { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
/* ★ 盒子的尺寸必须**与内容无关**：先前用 width:max-content，
   盒宽取决于 SVG 宽、SVG 宽又取自盒宽 → 循环依赖，实测塌成 17px、字形缩成 2px。
   现在盒子自己定尺寸，JS 把实测尺寸喂给 HanziWriter —— 三者一致。 */
.hzbox {
  flex: 0 0 auto; width: clamp(11rem, 42vw, 17rem); aspect-ratio: 1;
  display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--paper);
}
/* ★ 不要用 CSS 覆盖 SVG 的宽高：hanzi-writer 把 width/height/padding 烘进内部坐标变换，
   CSS 再缩一次就等于二次缩放（实测字形只占盒子的 12% 且偏在左上角）。
   这里让它恰好等于 JS 实测并写进 --hw 的那个值 —— CSS 与库用同一个数，
   就不会出现「属性 162px 而渲染 144px」这种只差一点的错位（量 rect 才看得见）。 */
.hzbox .strokesvg { display: block; width: var(--hw, 100%); height: var(--hw, auto); }
.wctl { flex: 1 1 18rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.wctl .wb { font-size: .86rem; padding: .45rem .7rem; }
.wctl .wb[aria-pressed="true"] {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  border-color: var(--line-2); color: var(--brand);
}
.wsep { flex: 0 0 1px; align-self: stretch; background: var(--line); margin-inline: .2rem; }
.mini { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--muted); }
.mini select {
  font: inherit; font-size: .85rem; background: var(--paper); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius); padding: .2rem .3rem;
}
@media (max-width: 47.99rem) {
  .wnanim .wanim-body { flex-direction: column; align-items: stretch; }
  .hzbox { align-self: center; }
  .wctl { justify-content: center; }
}

/* ===========================================================
   视觉打磨层（本轮追加在最后，靠层叠覆盖上面的同名规则）
   目标：把「白底圆角卡片」的通用感，换成有墨/纸/印的统一视觉语言。
   全部用 token 上色 ⇒ 8 组皮肤自动跟随；不用 !important、不用内联样式。
   =========================================================== */

/* ---- 1. 标题：中文式「题签」——竖向墨条 + 标题 ----
   以前 h2 就是一行加粗文字，页面全靠字号分层级，没有视觉锚点。 */
h2 { position: relative; padding-inline-start: .7rem; }
h2::before {
  content: ""; position: absolute; inset-inline-start: 0;
  inset-block: .18em; width: .22rem; border-radius: 2px;
  background: linear-gradient(to bottom, var(--brand), color-mix(in srgb, var(--brand) 55%, transparent));
}
/* 分组小标题：一枚小印 + 底线 */
.grp-h { display: flex; align-items: center; gap: .45rem; }
.grp-h::before {
  content: ""; width: .55rem; height: .55rem; border-radius: 2px;
  background: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

/* ---- 2. 按钮：墨印感（上亮下暗的微渐变 + 按压反馈） ---- */
.btn {
  background: linear-gradient(to bottom, color-mix(in srgb, var(--brand) 92%, #fff 8%), var(--brand));
  box-shadow: var(--shadow-card), inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover), inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent); filter: saturate(1.05); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow); }
.btn.ghost { background: var(--paper-2); box-shadow: none; }
.btn.ghost:hover { border-color: var(--brand); transform: translateY(-1px); }

/* ---- 3. 卡片：悬停浮起 + 品牌色顶线，链接卡片一眼可点 ---- */
.card { transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
a.card:hover, .cards a.card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line-2));
  box-shadow: var(--shadow-hover);
}
a.card:hover h3, a.card:hover h4 { color: var(--brand); }

/* ---- 4. 统计条：数字更大更稳，像一枚枚小书签 ---- */
.statstrip b, .stats b { font-size: 1.18rem; font-weight: 700; }
.statstrip li, .stats li { display: inline-flex; align-items: baseline; gap: .3rem; }

/* ---- 5. 汉字装饰格：第一格做成「印」，其余做墨框（传统画上只有一方印是红的） ---- */
.hzcell {
  border: 1px solid color-mix(in srgb, var(--ink) 26%, transparent);
  border-radius: 6px; color: color-mix(in srgb, var(--ink) 55%, transparent);
  background: color-mix(in srgb, var(--paper) 60%, transparent);
}
.hzcell:first-child {
  background: var(--brand); color: var(--brand-ink); border: 0;
  box-shadow: var(--shadow-card); transform: rotate(-3deg);
}
.hzcell:nth-child(2) { transform: rotate(2deg); }
.hzcell:nth-child(3) { transform: rotate(-1.5deg); }
.hzcell:nth-child(4) { transform: rotate(1.5deg); }
