@property --cscroll-amp {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

/* ^ hoisted: these at-rules are invalid inside @layer. */
/* 📜 搜索那一族样式（顶栏搜索药丸 + 整屏浮层，共 23 条）已于 2026-09-04 整块删除。
   那是搜索最早两版的设计，类名一直没变，所以即使早已不是当前设计也仍然在生效 ——
   新面板被它的 `min-height: 100vh` 撑成过 900px 高。
   这套组件现在**只由 009-side-rail.css 定义一处**。 */

@layer foundation {
/* Kill the rubber band. At the end of the page you could keep dragging upward
   and haul the whole document off the bottom of the screen, exposing the blank
   overscroll gutter under the footer — there is no content down there, so the
   bounce reads as the layout coming apart. `none` also stops pull-to-refresh
   at the top, which is the same gesture from the other end and the price of
   having neither.

   Unqualified `html` on purpose. This was `html:has(body.public-body)`, which
   silently skipped /about — About is a standalone page whose <body> carries no
   class at all — and needlessly required :has(). This stylesheet is loaded by
   exactly two entry points, header.ejs (every public page) and about.ejs, so
   plain `html` reaches all of them and nothing else; admin never loads it. */
html {
  overscroll-behavior-y: none;
}

body.public-body {
  --font-display: var(--font-sans);
  --font-body: var(--font-sans);
  --font-ui: var(--font-sans);
  --bg: #ece6da;
  --bg-deep: #e2dace;
  --ink: #1a1814;
  --text: #2e2b26;
  /* Fred 2026-08-20：「不要用这种淡淡的灰色和淡淡的灰线。用黑的大大方方的，不然小气得很，可读性太差。」原值在纸底上实测 3.78:1，正文小字的 AA 线是 4.5:1。
     --text-dim 只当线用（边框/分隔线），没有跟着调 —— 它作为线是对的，
     作为文字色则**不要再用**，见下面 .col-id / .e-category 两处的改法。 */
  --text-light: #5f594e;
  --text-dim: rgba(46, 43, 38, 0.22);
  /* 强调色 = 调色盘里的**鸢尾紫**。2026-08-23 第二次改：上一版我取了竖栏菜单 hover
     的 #533963，Fred：「这个紫色真的对吗。太他妈深了吧。全站好多地方哪来的这种紫色。」
     ——他是对的，那个值不在调色盘里，是我从 hover 的字色里抠出来的。
     现在用他给的那张盘：鸢尾紫 #A9AFE0。

     ⚠️ **一个色不够，要一对。** #A9AFE0 很浅（压在宣纸上 1.7:1），
     当色块（滚动条拇指、热力图最深格、进度条填充、指针拖尾）好看，
     但**当文字、或者当白字的底，一律不够**。
     所以另有 --accent-ink = #48508e（同一支鸢尾往深里走，调色盘里本来就有
     `--topic-iris`），凡是「字」或者「白字压在上面」的地方都用它。
     选哪个的判据只有一条：**这块颜色上要不要认字**。 */
  --accent: #A9AFE0;
  --accent-ink: #48508e;
  --accent-pale: #cfd3ec;
  --warm: #c8a882;
  --glass-bg: rgba(246, 241, 234, 0.8);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 24px 64px rgba(42, 28, 16, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.48);
  --glass-inner: rgba(255, 255, 255, 0.24);
  /* 和宣纸底（010-paper-bg.css）同一个色，纸还没画出来的那一帧不会闪。 */
  background: #ede7de;
  color: var(--text);
  font-family: var(--font-body);
  font-size: calc(16px * var(--user-text-scale, 1));
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.9s ease, color 0.7s ease;
}

/* 深浅切换期间（001-settings-i18n.js 里那次 View Transition）掐掉全站的 transition：
   浏览器要拍的是**终态**快照，不能拍到一半在爬色的中间帧。动画只有 css-layers.ejs
   里那一个圆。这条在 foundation 层里写 !important —— 层越早、important 越强，压得住
   后面各层自己写的 transition。 */
html.is-theme-switching,
html.is-theme-switching *,
html.is-theme-switching *::before,
html.is-theme-switching *::after,
html.is-lang-switching,
html.is-lang-switching *,
html.is-lang-switching *::before,
html.is-lang-switching *::after {
  transition: none !important;
}

html[data-theme="dark"] body.public-body {
  /* neutral warm greys (About's family) — the old values were GitHub's
     blue-grey palette (#c9d1d9/#e6edf3), which tinted every dark text 蓝紫 */
  --bg: #0b0b0d;
  --bg-deep: #141416;
  --ink: #e6e3df;
  --text: #eceae6;
  --text-light: rgba(230, 227, 222, 0.72);
  --text-dim: rgba(230, 227, 222, 0.16);
  --accent: #A9AFE0;
  --accent-ink: #A9AFE0;
  --accent-pale: #D4B896;
  --warm: #a49e95;
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  --glass-highlight: rgba(255, 255, 255, 0.14);
  --glass-inner: rgba(255, 255, 255, 0.06);
  /* solid near-black under the void stage (the old gold-radial gradient
     was dead code — this rule below always overrode it) */
  background: #010204;
}

html[data-theme="eye"] body.public-body {
  --bg: #ece6da;
  --bg-deep: #e2dace;
  --ink: #1a1814;
  --text: #2e2b26;
  --text-light: #5f594e;
  --text-dim: rgba(46, 43, 38, 0.22);
  --accent: #A9AFE0;
  --accent-ink: #48508e;
  --accent-pale: #cfd3ec;
  --warm: #c8a882;
  --glass-bg: rgba(246, 241, 234, 0.8);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 24px 64px rgba(42, 28, 16, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.48);
  --glass-inner: rgba(255, 255, 255, 0.24);
}

body.public-body a {
  color: inherit;
}

/* 语言开关要认 <html> 上的类，不只是 <body> 上的。
   服务端现在直接在 <html> 上渲染 en-mode（见 lib/language.js），首屏就是对的语言；
   body 上那份由 JS 在运行时切换语言时补上，两者都得生效。
   只认 body 的话，首屏会先画出中文、等 JS 跑完再隐藏 —— 那正是要消灭的闪烁。 */
html.en-mode .lang-zh,
body.en-mode .lang-zh {
  display: none !important;
}

html:not(.en-mode) body:not(.en-mode) .lang-en {
  display: none !important;
}

body.public-body img {
  max-width: 100%;
}

body.public-body .container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-inline: clamp(22px, 5vw, 64px);
  box-sizing: border-box;
}

/* ── Landscape notch guard (viewport-fit=cover) ──
   Inset the two full-width columns once, at the top, rather than patching every
   gutter rule underneath them. Both env() terms are 0 in portrait and on any
   device without a notch, so this rule changes nothing there; sideways on an
   iPhone it is what stops the first and last character of every line
   disappearing under the sensor housing. nav.top is NOT here — it sits outside
   .main and subtracts the same insets from its own 100vw width. */
@media (max-width: 768px) {
  body.public-body .main-manju,
  body.public-body .footer-area {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
}

body.public-body .main-manju {
  position: relative;
  z-index: 1;
  padding-top: 6.8rem;

  /* ⚠️ **断不开的长串会把整页缩小，不是把一行切掉。** 站里的正文是原样的手记，
     里面随时会出现一整条链接（`https://open.spotify.com/track/26I8…?si=…`）。
     那是一个不可分割的「词」：它把所在元素的 **min-content 宽度**顶到 400–500px，
     而 viewport meta 是 `width=device-width, initial-scale=1` —— 浏览器为了容下它，
     把**布局视口整个撑宽**。390 的屏上实测 innerWidth = 482：不是某一行超出去，
     是**全站的字一起变小**。Fred 2026-08-30：「如果那个沉思字太多了，可以缩放整个页面。无语。」

     ⚠️ **必须是 `anywhere`，不能是 `break-word`。** 两者在**排版**时行为一样
     （只在会溢出时才断词，普通文字一个字都不动），区别只有一处：
     `anywhere` 把断点计进 min-content，`break-word` **不计**。撑大是 min-content
     算出来的，所以 `break-word` 从头到尾就治不了它。
     003-listing-pages.css:517 那条 `.prose { overflow-wrap: break-word }` 的注释里
     写的正是「the whole page zooms」这个症状 —— 药下错了，症状一直在。
     （那条也一并改成 anywhere 了。）

     `min-width: 0` 是另一半：`.main-manju` 里到处是 flex / grid item，
     它们的自动最小尺寸就是内容的 min-content，不许收缩 —— 子元素断了词，
     卡在外面那一层照样撑。

     判据在 `scripts/mobile-probe.js` 第 ⑤ 条：它**往正文里注入**一条 64 字符的
     长链接再量 `innerWidth`，所以查的是版式扛不扛得住，
     而不是「今天库里刚好有没有这种内容」。 */
  min-width: 0;
  overflow-wrap: anywhere;
}

/* 代码块和表格是**故意**要横向滚的（它们自带 overflow-x），
   断词会把一行代码折成锯齿。把它们排除在外。 */
body.public-body .main-manju :is(pre, code, kbd, samp) {
  overflow-wrap: normal;
}

/* 标题到正文的那一段留白同样走变量 —— 作品页要把它收窄，见 007。 */
.public-page-head {
  max-width: 1000px;
  width: 100%;
  /* 和面包屑同一条栏、同样的左右留白 —— 整页只有一个左边缘。
     `.public-page-head` / `.public-page-title` **全站只有作品页在用**
     （grep views/ 只命中 works-shelf.ejs 两行），所以直接改这里不影响别人。 */
  max-width: var(--works-column, 1320px);
  margin: 0 auto var(--page-head-gap, 4rem);
  padding: 0 var(--works-gutter, 48px);
  text-align: left;
}

/* 标题照 **`.gal-main-title` / `.archive-main-title`** 来，逐字对齐。
   参考稿 concept-refined-craft/style.css 里三个页头是两套：
     .gal-main-title / .archive-main-title   700 / clamp(38px,5.2vw,64px) / -0.025em
     .thinking-main-title                    400 / clamp(48px,6vw,76px)  / -0.02em
   拾遗和文稿是一样的，沉思是那个例外。

   2026-08-23 我先按「Works 和 Thinking 都是一个西文单词」把它对到了 400 那套，
   Fred 拿拾遗的「the quiet observations」和它并排一贴：「这俩一样嘛我请问」——
   一个 700 一个 400，当然不一样。**站里三分之二的页头是 700 那套，跟着多数走。**
   （更早之前这里是 300 字重、80px，比任何一个页头都薄一档。）

   ⚠️ 沉思那页现在是唯一还用 400/76 的 —— 参考稿本来就那么写的，Fred 也没提过它。
   要不要连它一起统一，等他一句话。 */
.public-page-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(38px, 5.2vw, 64px);
  font-weight: 700;
  font-style: italic;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text, var(--ink));
}

/* 中文那半**不要斜体**。中文没有真正的斜体字面，`font-style: italic` 只能让浏览器
   把字形整体倾斜（合成倾斜），笔画粗细和重心全是歪的 —— 中文模式下的「作品」
   看着就是别扭。西文那半照旧走 Newsreader 的真斜体。
   （站里其余三个页头都是纯西文大字，只有作品页的标题是中英两份。） */
.public-page-title .lang-zh {
  font-style: normal;
}

@media (max-width: 900px) {
  /* ⚠️ 这里原来还有一条 `.public-page-title { font-size: clamp(3rem,15vw,3.6rem) }` ——
     那是这颗标题还用 300 字重、80px 那套时留下的。桌面端对齐之后它还在，
     于是**手机上作品页 57.6px、其余三页 38px**，四个页头在窄屏又分家了。
     上面那条 clamp(38px,5.2vw,64px) 本来就带下限，手机上自己会收到 38px，
     不需要再覆盖一次。**把一个值对齐到别人时，记得连它的媒体查询一起看。**

     `padding: 0` 也去掉了：桌面端的左右留白（--works-gutter）是用来和面包屑
     共用一条左边缘的，窄屏一样要，归零会让标题贴到竖栏上。 */
  .public-page-head {
    margin-bottom: var(--page-head-gap, 3rem);
  }
}

body.public-body.page-home .main-manju {
  padding-top: var(--nav-h, 46px);
  padding-bottom: 0;
}

/* Homepage footer — visible, snaps with last section */
body.public-body.page-home .footer-area {
  display: block;
  scroll-snap-align: none;
  scroll-snap-stop: normal;
  margin-top: 0;
}

body.public-body .section,
body.public-body .about {
  position: relative;
  z-index: 1;
}

#rippleCanvas {
  position: fixed;
  inset: 0;
  z-index: 140;
  pointer-events: none;
}

/* 文内推荐卡（lib/content.js 渲染的 .recommend-card）。 */
body.public-body .recommend-card {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.04);
  border: none;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(42, 28, 16, 0.08);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  backdrop-filter: blur(14px) saturate(1.04);
  -webkit-backdrop-filter: blur(14px) saturate(1.04);
  transition:
    transform 0.5s cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 0.5s ease,
    background 0.8s ease;
}

html[data-theme="dark"] body.public-body .recommend-card {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.04), transparent 46%),
    linear-gradient(180deg, rgba(22, 22, 26, 0.55), rgba(12, 12, 15, 0.45));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
}

body.public-body .recommend-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%);
  pointer-events: none;
  opacity: 0.14;
}

body.public-body .recommend-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, box-shadow 0.35s ease;
}

body.public-body .recommend-card:hover {
  transform: translateY(-8px) scale(1.008);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.16);
}

html[data-theme="dark"] body.public-body .recommend-card:hover {
  box-shadow: 0 26px 56px rgba(0, 0, 0, 0.34);
}

body.public-body .recommend-card:hover::after {
  opacity: 1;
  box-shadow: inset 0 0 0 1px rgba(83, 57, 99, 0.12);
}

html[data-theme="dark"] body.public-body .recommend-card:hover::after {
  box-shadow: inset 0 0 0 1px rgba(196, 167, 125, 0.14);
}

body.public-body .nav {
  background: transparent;
}

/* ═══════════════════════════════════════════════════════════════════════════
   THE liquid-glass tokens. Single source of truth — do not copy this block.

   It lives on :root, not on body.public-body, because /about is a standalone
   page whose <body> carries NO class: a body.public-body block never reached
   it, which is why the tokens used to be duplicated into
   008-about-nav-global.css and again inline in views/about.ejs, and why
   changing the glass in one place did nothing on About. This stylesheet is
   loaded by header.ejs (every public page) AND about.ejs, so :root reaches
   both. Custom properties inherit, so every rule that used to read these off
   body.public-body still resolves to the same value.

   Dark is keyed on BOTH signals: the site uses html[data-theme="dark"],
   About's own inline CSS uses body.dark-mode, and About sets both.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  /* ── canonical liquid-glass tokens · LIGHT = dark glass (readable light ink) ──
     Ported from the dark-glass-test reference. Two things make it read as glass
     rather than as a grey slab:
       1. the darkening comes from backdrop-filter brightness(), and the fill is
          PURE BLACK at low alpha. The old fill was rgba(18,16,30,.55) — a
          blue-purple tint at 55%, which turned the warm cream page into a dead
          cool grey. Black + brightness keeps the page's warm hue.
       2. an edge treatment: bright inset above, dark inset below, and a lift
          shadow — see --lg-edge / --lg-lift / --lg-rim.
     The reference's own numbers (fill .08, brightness .85) are NOT usable here:
     measured over the then-current page bg #f2ede3, they put the light ink at
     1.81:1. .18/.55 measures 4.95:1, which clears AA and beats the old 4.30:1.
     (Those two ratios were measured before the page bg moved to #ede7de; the
     new bg is ~2% darker, which does not change either verdict.) */
  --lg-fill: rgba(0, 0, 0, 0.08);
  --lg-blur: blur(12px) brightness(0.85) saturate(1.2);
  --lg-highlight: rgba(255, 255, 255, 0.5);
  --lg-edge: inset 0 1px 2px rgba(255, 255, 255, 0.25), inset 0 -1px 2px rgba(0, 0, 0, 0.6);
  --lg-lift: 0 8px 32px rgba(0, 0, 0, 0.15);
  /* Rim light. Stops are ABSOLUTE px, not %: on the 1180px-wide nav a 20% stop
     spread the glint over 236px and it vanished. px keeps the corners crisp at
     any element size, which is what makes the reference's edges read. */
  --lg-rim: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0.7) 0px,
    rgba(255, 255, 255, 0.15) 80px,
    rgba(255, 255, 255, 0) 150px,
    rgba(255, 255, 255, 0) calc(100% - 150px),
    rgba(255, 255, 255, 0.1) calc(100% - 80px),
    rgba(255, 255, 255, 0.5) 100%
  );
  /* ── Corner rim, for the three LARGE panels only (nav.top, .gb-container,
     .article-after-card). Small pills/buttons keep --lg-rim above.
     Why this is RADIAL and --lg-rim is linear: a `to bottom right` linear
     gradient's axis length is 2WH/√(W²+H²) — on the 1180×46 nav that is 92px,
     and a point (x,0) on the TOP edge only advances 0.039x along it. So the
     whole 1180px top edge lives inside the first 46px of the gradient and
     renders as one long white line no matter how the stops are tuned. Four
     radial gradients pinned to the corners give a glint whose falloff is the
     same in every direction and is independent of the element's size.
     Light top-left + bottom-right, shadow on the other two corners. */
  --lg-rim-corner:
    radial-gradient(circle 72px at 0% 0%, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.26) 26%, rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle 72px at 100% 100%, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.20) 26%, rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle 72px at 100% 0%, rgba(0, 0, 0, 0.40) 0%, rgba(0, 0, 0, 0.12) 26%, rgba(0, 0, 0, 0) 100%),
    radial-gradient(circle 72px at 0% 100%, rgba(0, 0, 0, 0.40) 0%, rgba(0, 0, 0, 0.12) 26%, rgba(0, 0, 0, 0) 100%);
  /* Light glass ⇒ DARK ink. This is forced, not a taste call: over #ede7de the
     reference glass composites to ~(185,181,174), on which the old near-white
     ink measures ~1.85:1. Dark ink on the same glass measures 8.05:1.
     (Over the previous #f2ede3 bg these were (189,185,178) and 8.53:1.) */
  --lg-ink: #1f1c2e;
  --lg-ink-dim: rgba(31, 28, 46, 0.62);
  --lg-inner: rgba(0, 0, 0, 0.06);
  --lg-inner-hover: rgba(0, 0, 0, 0.10);
  --lg-inner-border: rgba(0, 0, 0, 0.12);
  --lg-press: rgba(0, 0, 0, 0.30);
}

/* ===== Floating Pill Nav — the pill's own tokens (public pages only; About
   styles its nav inline) ===== */
body.public-body {
  --nav-h: 46px;
  --pill-bg: linear-gradient(175deg, rgba(0,0,0,.06) 0%, rgba(0,0,0,.03) 50%, rgba(0,0,0,.01) 100%);
  --pill-border: rgba(0,0,0,.08);
  --pill-top: rgba(0,0,0,.06);
  --pill-text-hover: var(--text);
  --pill-text-muted: var(--text-light);
}
html[data-theme="dark"] body.public-body {
  --pill-bg: linear-gradient(175deg, rgba(255,255,255,.20) 0%, rgba(255,255,255,.09) 50%, rgba(255,255,255,.04) 100%);
  --pill-border: rgba(255,255,255,.24);
  --pill-top: rgba(255,255,255,.32);
  --pill-text-hover: rgba(255,255,255,.92);
  --pill-text-muted: rgba(255,255,255,.38);
}

html[data-theme="dark"],
body.dark-mode {
  /* ── canonical liquid-glass tokens · DARK = light glass (reference look) ──
     UNCHANGED by the light-mode glass port: --lg-edge/--lg-lift/--lg-rim below
     restate exactly what dark mode already rendered, so the same shared
     declarations produce byte-identical dark output. */
  --lg-fill: rgba(255, 255, 255, 0.05);
  --lg-blur: blur(4px) saturate(1.05);
  --lg-highlight: rgba(255, 255, 255, 0.12);
  --lg-edge: inset 0 1px 1px var(--lg-highlight);
  --lg-lift: 0 0 0 rgba(0, 0, 0, 0);
  --lg-rim: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0.45) 0%,
    rgba(255, 255, 255, 0.15) 20%,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0.15) 80%,
    rgba(255, 255, 255, 0.45) 100%
  );
  /* see the light-mode block for why this one is radial */
  --lg-rim-corner:
    radial-gradient(circle 60px at 0% 0%, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.18) 26%, rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle 60px at 100% 100%, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.14) 26%, rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle 60px at 100% 0%, rgba(0, 0, 0, 0.50) 0%, rgba(0, 0, 0, 0.16) 26%, rgba(0, 0, 0, 0) 100%),
    radial-gradient(circle 60px at 0% 100%, rgba(0, 0, 0, 0.50) 0%, rgba(0, 0, 0, 0.16) 26%, rgba(0, 0, 0, 0) 100%);
  --lg-ink: #f5f3fa;
  --lg-ink-dim: rgba(245, 243, 250, 0.55);
  --lg-inner: rgba(255, 255, 255, 0.06);
  --lg-inner-hover: rgba(255, 255, 255, 0.12);
  --lg-inner-border: rgba(255, 255, 255, 0.18);
  --lg-press: rgba(0, 0, 0, 0.38);
}

/* Click bounce animation for active pill */

/* ===== Ink / Spoiler — overhaul ===== */
body.public-body .spoiler-text {
  position: relative;
  display: inline-block;
  cursor: help;
  margin: 0 0.04em;
}

body.public-body .spoiler-text:focus-visible {
  outline: none;
}

body.public-body .spoiler-text__value {
  position: relative;
  z-index: 1;
  color: transparent !important;
  text-shadow: none !important;
  padding: 0.06em 0.28em;
  border-radius: 0.4em;
  line-height: inherit;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.16);
  transition: color 0.26s ease, box-shadow 0.26s ease;
}

body.public-body .spoiler-text__ink-overlay {
  position: absolute;
  inset: -0.06em -0.12em;
  z-index: 2;
  display: block;
  border-radius: 0.42em;
  background:
    linear-gradient(170deg, rgba(10, 10, 10, 0.98) 0%, rgba(24, 22, 20, 0.96) 42%, rgba(15, 13, 12, 0.98) 100%);
  overflow: hidden;
  transition: opacity 0.28s ease, filter 0.28s ease;
}

body.public-body .spoiler-text__dots {
  display: block;
  width: 100%;
  height: 100%;
}

body.public-body .spoiler-text:hover .spoiler-text__value,
body.public-body .spoiler-text:focus-visible .spoiler-text__value {
  color: inherit !important;
  box-shadow: none;
}

body.public-body .spoiler-text:hover .spoiler-text__ink-overlay,
body.public-body .spoiler-text:focus-visible .spoiler-text__ink-overlay {
  opacity: 0;
  filter: blur(4px);
}

/* ===================================================================
   Custom page scrollbar (replaces the native browser scrollbar on the
   public site, desktop + mobile). A thin vertical line on the right
   edge whose upper portion is accent-tinted (= progress) with a round
   draggable head at the current scroll position. Hover makes the line
   quiver; long-press the head (>1s) auto-scrolls back to the top.
   Native bar is hidden only once JS has booted (html.has-custom-scrollbar)
   so the page still has a scrollbar if scripting fails.
   =================================================================== */

html.has-custom-scrollbar {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* old Edge */
}
html.has-custom-scrollbar.is-cscroll-dragging {
  scroll-behavior: auto !important;
}
html.has-custom-scrollbar::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;                  /* Chrome / Safari viewport bar */
}

.cscroll {
  position: fixed;
  right: 0;
  top: 12vh;
  bottom: 12vh;
  width: 26px;
  z-index: 160;
  pointer-events: none;          /* only the rail/head are interactive */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.cscroll.is-ready {
  opacity: 1;
  visibility: visible;
}

/* 菜单打开时整页是锁死的（body 上 `overflow: hidden`），这条页面进度线
   就没有任何东西可指了 —— 而它偏偏贴在视口**最右边**，成了菜单里唯一
   一根多余的竖条。Fred 2026-09-05：「最右边那个自带的那个滑动条去掉。」
   （菜单里留下的那条 `.nsc` 是搜索结果面板自己的迷你进度条，落在左栏和
   导航之间的留白里，跟这根不是一回事，别一起删。） */
body.is-menu-open .cscroll {
  opacity: 0;
  visibility: hidden;
}

/* The rail is the hover / drag-start target and carries the quiver. */
.cscroll-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 8px;
  width: 14px;
  pointer-events: auto;
  cursor: pointer;
  --cscroll-amp: 0px;
  transition: --cscroll-amp 0.28s ease;
  will-change: transform;
}
.cscroll.is-vibing .cscroll-rail {
  --cscroll-amp: 1.7px;
  animation: cscroll-quiver 0.13s ease-in-out infinite;
}

@keyframes cscroll-quiver {
  0%, 100% { transform: translateX(calc(-1 * var(--cscroll-amp))); }
  50%      { transform: translateX(var(--cscroll-amp)); }
}

/* Faint full-height track line. */
.cscroll-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--text) 18%, transparent);
}

/* Accent fill from the top down to the head (= scroll progress). */
.cscroll-fill {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 0;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--accent);
}

/* The round draggable head. */
.cscroll-thumb {
  position: absolute;
  top: 0;
  left: 50%;
  --cscroll-y: 0px;
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  margin-top: -5.5px;            /* centre on its scroll position */
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  transform: translate3d(0, var(--cscroll-y), 0) scale(1);
  transition: box-shadow 0.2s ease;
  will-change: transform;
}
.cscroll-rail:hover .cscroll-thumb,
.cscroll.is-dragging .cscroll-thumb {
  transform: translate3d(0, var(--cscroll-y), 0) scale(1.25);
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.26);
}
.cscroll.is-dragging .cscroll-thumb { cursor: grabbing; }

/* keyed on data-theme ONLY — the old extra `body.public-body` qualifier meant
   About (whose body has no such class) kept the LIGHT scrollbar in dark mode */
html[data-theme="dark"] .cscroll-line {
  background: color-mix(in srgb, #fff 16%, transparent);
}
html[data-theme="dark"] .cscroll-thumb {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

/* No mobile sizing here on purpose: initCustomScrollbar() bails on coarse
   pointers and ≤768px, so on a phone this element is never created and the
   NATIVE scrollbar is left alone. Making it merely easier to drag was the
   earlier attempt; the bar simply doesn't belong on a touch screen. */

@media (prefers-reduced-motion: reduce) {
  .cscroll.is-vibing .cscroll-rail { animation: none; }
  .cscroll-thumb { transition: none; }
}
}
