/* ============================================================
   components.css — 组件层（结合实装）
   作用域前缀：cmp- / jhey- / hakim- / josh- / kelli- /
   tobias- / hos- / rauno- / maggie-
   仅增强 clone，不修改其既有滚动/交互逻辑。
   ============================================================ */

/* ---------- 霞鹜文楷（tune8c）：阅读页真实字体，本地子集 woff2 ---------- */
@font-face {
  font-family: "LXGW WenKai";
  src: url("assets/fonts/LXGWWenKai-Regular-smooth.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* tail3 配色：橙红 → 松绿（oklch 60% .15 152）；墨色统一暖调
     --green 品牌松绿（图形/大元素）；--green-deep 文本级深绿（WCAG AA） */
  --green: #1a9951;
  --green-deep: #11693a;
  --hakim-slide: 15;
  --hakim-curve: cubic-bezier(.23, 1, .32, 1);
  --tobias-curve: cubic-bezier(.175, .885, .32, 1.275);
  --cmp-ink: #1d1a16;
  --cmp-mid: #6e675d;
  --cmp-line: #e2dccf;
  --font-display: ui-serif, Georgia, "Songti SC", "STSong", serif;
  --font-text: ui-serif, Georgia, "Songti SC", "STSong", serif;
  --font-ui: Avenir, "Avenir Next", "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
}

/* ---------- 08 jhey · 链接反色 + 手写签名 ---------- */
.cmp-link {
  color: var(--green-deep);
  text-decoration: none;
  padding: 0 .14em;
  border-radius: 2px;
  transition: background-color .25s ease, color .25s ease;
}
.cmp-link:hover { background: var(--green-deep); color: #fff; }
.jhey-sig { display: inline-block; }
.jhey-sig path {
  fill: none; stroke: var(--green); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.jhey-sig.draw path { animation: jhey-draw 1.4s ease forwards; }
@keyframes jhey-draw { to { stroke-dashoffset: 0; } }

/* ---------- 07 josh · 标题锚点 ---------- */
.josh-anchor { position: relative; }
.josh-anchor > .anchor-link {
  position: absolute; left: -1.5em; top: .05em;
  opacity: 0; transform: translateX(-85%);
  transition: transform .25s ease, opacity .25s ease;
  text-decoration: none; color: var(--green-deep);
  font-family: ui-monospace, "SFMono-Regular", monospace; font-size: .7em;
}
.josh-anchor:hover > .anchor-link { opacity: 1; transform: translateX(-100%); }
.josh-bounce { animation: josh-bounce .4s ease alternate 6; }
@keyframes josh-bounce { to { transform: translateY(-3px); } }

/* ---------- 01 kelli · 目录 scrollspy ---------- */
.kelli-catalog {
  position: fixed; left: 14px; top: 50%; transform: translateY(-50%);
z-index: var(--z-catalog); display: flex; flex-direction: column; gap: 14px;
  font: 13px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .04em;
}
.kelli-catalog a {
  color: var(--cmp-mid); text-decoration: none; display: flex; gap: 8px; align-items: center;
  transition: color .2s ease;
}
.kelli-catalog a .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cmp-line); transition: background .2s ease, transform .2s ease; }
.kelli-catalog a.active { color: var(--cmp-ink); }
.kelli-catalog a.active .dot { background: var(--green); transform: scale(1.5); }
.kelli-catalog a.unlocked .dot { background: #58b030; }

/* ---------- 06 tobias · 汉堡菜单圆形扩散（M6 实装） ---------- */
html.no-scroll { overflow: hidden; }
.tobias-toggle {
  /* tune9：菜单层级提到 .main(230) / wrapper(160) 之上，全屏覆盖右侧界面 */
  position: fixed; top: 20px; left: 20px; z-index: var(--z-menu-toggle); width: 44px; height: 44px; padding: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  cursor: pointer; mix-blend-mode: difference;
  isolation: isolate;
  background: none; border: 0; -webkit-tap-highlight-color: transparent;
}
.tobias-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }
.tobias-toggle span {
  display: block; height: 2px; width: 100%; background: #fff; border-radius: 2px;
  transform: translateZ(0); transform-origin: center;
  transition: transform .3s var(--tobias-curve), opacity .2s ease-out, background-color .2s ease;
}
.tobias-toggle:hover span { background: rgba(255,255,255,.65); transform: scaleX(1.2); }
.tobias-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(-135deg); background: #fff; }
.tobias-toggle.open span:nth-child(2) { opacity: 0; background: #fff; }
.tobias-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(135deg); background: #fff; }
.tobias-toggle.open:hover span { background: #fff; }
.tobias-canvas { position: fixed; inset: 0; z-index: var(--z-menu-canvas); display: none; pointer-events: none; }
.tobias-overlay {
  position: fixed; inset: 0; z-index: var(--z-menu); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 28px;
  pointer-events: none;
}
.tobias-canvas,
.tobias-overlay,
.tobias-toggle {
  /* The menu is the outermost interactive layer, including during intro. */
  isolation: isolate;
}
.tobias-overlay.menu-open { pointer-events: auto; }
.tobias-overlay a {
  color: #fff; text-decoration: none;
  font: 400 clamp(32px, 6vw, 64px)/1.1 ui-serif, Georgia, "Songti SC", serif;
  opacity: 0; transform: translateY(16px) scale(.92);
  transition: opacity .55s ease-out, transform .55s ease-out;
}
.tobias-overlay.menu-open a { opacity: 1; transform: none; }
.tobias-overlay.menu-open a:nth-child(1) { transition-delay: 275ms; }
.tobias-overlay.menu-open a:nth-child(2) { transition-delay: 365ms; }
.tobias-overlay.menu-open a:nth-child(3) { transition-delay: 455ms; }
.tobias-overlay.menu-open a:nth-child(4) { transition-delay: 545ms; }
.tobias-overlay.menu-open a:nth-child(5) { transition-delay: 635ms; }
.tobias-overlay a:hover { color: var(--green); }
.tobias-overlay.closing a {
  opacity: 0; transform: translateY(-18px) scale(.94);
  transition: opacity .3s ease-in, transform .3s ease-in;
}
.tobias-overlay.closing a:nth-child(1) { transition-delay: 0ms; }
.tobias-overlay.closing a:nth-child(2) { transition-delay: 60ms; }
.tobias-overlay.closing a:nth-child(3) { transition-delay: 120ms; }
.tobias-overlay.closing a:nth-child(4) { transition-delay: 180ms; }
.tobias-overlay.closing a:nth-child(5) { transition-delay: 240ms; }
html.no-motion .tobias-overlay a { opacity: 1; transform: none; transition: none; }

/* ---------- 05 hos · 无框邮箱表单 ---------- */
.hos-wrap {
  margin-top: 28px;
  flex: 1 1 0;
  min-width: 0;
  max-width: 520px;
}
.hos-field {
  display: flex; align-items: baseline; gap: 12px;
  border-bottom: 1.5px solid var(--cmp-ink); padding: 6px 2px;
  width: 100%;
  max-width: 100%;
}
.hos-field input {
  flex: 1; border: 0; outline: 0; background: transparent; font: 40px/1.2 ui-serif, Georgia, "Songti SC", serif;
  color: var(--cmp-ink); min-width: 0;
}
.hos-field button {
  border: 0; background: transparent; cursor: pointer; font: 18px ui-sans-serif, system-ui, sans-serif;
  color: var(--cmp-mid);
}
.hos-success { height: 60px; margin-top: 10px; opacity: 0; transition: opacity .4s ease; }
.hos-success.show { opacity: 1; }
.hos-success path { fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 03 rauno · 逐字展开 ---------- */
.rauno-reveal .ch { display: inline-block; transform-origin: 0 100%; will-change: transform; }
html.no-motion .rauno-reveal .ch { transform: none !important; }

/* ---------- 10 maggie · 极简阅读层 ----------
   与 reading-design.html 同源：暖纸、标题宋体、诗稿霞鹜文楷、长文进度线。 */
.maggie-overlay {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  display: block; visibility: hidden; opacity: 0; pointer-events: none;
  overflow: auto; overscroll-behavior: contain;
  padding: clamp(220px, 32vh, 380px) 28px clamp(280px, 28vh, 440px);
  background: #f6f1e8; color: var(--cmp-ink);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  clip-path: circle(0 at var(--maggie-origin-x, 50vw) var(--maggie-origin-y, 50vh));
  transform: translateZ(0) scale(.985);
  transition: opacity .24s ease, visibility 0s linear .56s,
    clip-path .56s cubic-bezier(.22, 1, .36, 1),
    transform .56s cubic-bezier(.22, 1, .36, 1);
}
.maggie-overlay.open {
  visibility: visible; opacity: 1; pointer-events: auto;
  clip-path: circle(150% at var(--maggie-origin-x, 50vw) var(--maggie-origin-y, 50vh));
  transform: translateZ(0) scale(1);
  transition-delay: 0s;
}
.maggie-overlay.closing {
  visibility: visible; opacity: 0; pointer-events: none;
  clip-path: circle(0 at var(--maggie-origin-x, 50vw) var(--maggie-origin-y, 50vh));
  transform: translateZ(0) scale(.985);
  transition-delay: 0s;
}
.maggie-overlay:focus { outline: none; }
.maggie-open .tobias-toggle,
.maggie-open .tobias-canvas,
.maggie-open .tobias-overlay {
  visibility: hidden !important;
  pointer-events: none !important;
}
.maggie-overlay ::selection { background: #d8e8dd; color: #123a24; }
.maggie-overlay ::-moz-selection { background: #d8e8dd; color: #123a24; }
.maggie-close {
  position: fixed;
  top: clamp(132px, calc(32vh - 88px), 292px);
  left: max(4px, calc(50% - 552px));
  z-index: var(--z-overlay-top);
  width: 36px; height: 36px; padding: 0; border: 0;
  display: grid; place-items: center; cursor: pointer;
  background: transparent; color: var(--cmp-mid);
  font: 300 30px/1 var(--font-ui);
  transition: color .2s ease, transform .52s cubic-bezier(.22, 1, .36, 1);
}
.maggie-close:hover,
.maggie-close:focus-visible {
  background: #1a1814;
  color: #fff;
  transform: rotate(90deg);
}
.maggie-close:active { background: #1a1814; color: #fff; transform: rotate(90deg) scale(.94); }
.maggie-close:focus { outline: none; }
.maggie-page { max-width: 640px; margin: 0 auto; }
.maggie-page-poem { max-width: 560px; }
.maggie-head { margin: 0 0 52px; }
.maggie-title {
  margin: 0 0 26px;
  font: 400 clamp(30px, 4.4vw, 48px)/1.32 var(--font-display);
  letter-spacing: .01em; text-wrap: balance;
}
.maggie-meta {
  margin: 0; color: #8a8378;
  font: 400 12px/1.4 var(--font-mono); letter-spacing: .12em;
}
.maggie-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-overlay-top);
  height: 2px; opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.maggie-overlay.has-progress .maggie-progress { opacity: 1; visibility: visible; }
.maggie-progress i { display: block; width: 0; height: 100%; background: var(--green-deep); }
.maggie-prose { min-width: 0; }
.maggie-prose p {
  margin: 0 0 1.35em; color: #3f3931;
  font: 400 19px/1.95 var(--font-text);
  text-align: justify; text-justify: inter-ideograph;
}
.maggie-prose p:first-child { margin-top: 0; }
.maggie-prose .maggie-verse {
  margin-bottom: 1.15em; color: var(--cmp-ink);
  font: 400 clamp(19px, 2.2vw, 22px)/2 "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: .02em; text-align: left;
}
.maggie-section {
  margin: 2.4em 0 1em; color: var(--cmp-ink);
  font: 400 clamp(20px, 2.4vw, 26px)/1.6 "LXGW WenKai", "Kaiti SC", "STKaiti", serif;
  letter-spacing: .08em; scroll-margin-top: 8vh;
}
.maggie-prose .lead,
.maggie-prose > p:first-child:only-child { font-size: clamp(18px, 2.3vw, 21px); }
.maggie-prose strong, .maggie-prose b {
  font-weight: 600; color: var(--green-deep);
  font-family: "LXGW WenKai", "Kaiti SC", "STKaiti", serif;
}
.maggie-prose a.maggie-wikilink {
  color: var(--green-deep);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--green-deep) 45%, transparent);
  transition: color .2s ease, border-color .2s ease;
}
.maggie-prose a.maggie-wikilink:hover,
.maggie-prose a.maggie-wikilink:focus-visible {
  color: var(--green);
  border-color: var(--green);
}
.maggie-prose hr {
  width: min(220px, 60%); height: 1px; margin: 2.6em auto;
  border: 0; background: var(--cmp-line);
}
.maggie-foot {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--cmp-line);
}
.maggie-links { display: flex; gap: 18px; flex-wrap: wrap; }
.maggie-links a {
  color: var(--green-deep); text-decoration: none;
  font: 400 13px/1.6 var(--font-ui);
  border-bottom: 1px solid color-mix(in srgb, var(--green-deep) 35%, transparent);
  transition: color .2s ease, border-color .2s ease;
}
.maggie-links a:hover { color: var(--green); border-color: var(--green); }

@media (max-width: 760px) {
  .maggie-overlay { padding: clamp(150px, 26vh, 240px) 20px clamp(220px, 28vh, 340px); }
  .maggie-close { top: clamp(62px, calc(26vh - 88px), 152px); left: 4px; }
  .maggie-head { margin-bottom: 44px; }
  .maggie-prose p { font-size: 18px; line-height: 1.9; }
  .maggie-prose .maggie-verse { font-size: 19px; }
}

/* ---------- maggie extension · 单篇文档、目录与评论 ---------- */
.maggie-document {
  max-width: 1040px;
  --maggie-accent: var(--green-deep);
}
.maggie-document-poem { --maggie-accent: #6b7d66; max-width: 960px; }
.maggie-document-digest { --maggie-accent: #567263; }
.maggie-document-essay .maggie-head {
  padding-left: 22px;
  border-left: 2px solid color-mix(in srgb, var(--maggie-accent) 50%, transparent);
}
.maggie-document-digest .maggie-head {
  padding-bottom: 24px;
  border-bottom: 1px solid color-mix(in srgb, var(--maggie-accent) 38%, var(--cmp-line));
}
.maggie-document-poem .maggie-title {
  font-family: "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: .08em;
}
.maggie-visual {
  position: relative;
  width: min(100%, 720px);
  aspect-ratio: 16 / 7;
  margin: -10px 0 clamp(54px, 7vw, 88px);
  overflow: hidden;
  border-top: 1px solid color-mix(in srgb, var(--maggie-accent) 42%, var(--cmp-line));
  border-bottom: 1px solid color-mix(in srgb, var(--maggie-accent) 26%, var(--cmp-line));
  background: #e9e2d7;
}
.maggie-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.72) contrast(.94);
}
.maggie-visual-placeholder .maggie-visual-art {
  position: absolute;
  inset: 0;
  background-color: #e9e2d7;
  background-image:
    linear-gradient(90deg, transparent 49.8%, rgba(32, 28, 23, .11) 50%, transparent 50.2%),
    linear-gradient(0deg, transparent 49.8%, rgba(32, 28, 23, .08) 50%, transparent 50.2%);
  background-size: 33.333% 100%, 100% 50%;
}
.maggie-visual-placeholder .maggie-visual-art::before,
.maggie-visual-placeholder .maggie-visual-art::after {
  content: "";
  position: absolute;
  display: block;
  border: 1px solid color-mix(in srgb, var(--maggie-accent) 48%, transparent);
}
.maggie-visual-placeholder .maggie-visual-art::before {
  width: 30%; height: 56%; left: 17%; top: 22%; transform: rotate(-5deg);
}
.maggie-visual-placeholder .maggie-visual-art::after {
  width: 24%; height: 42%; right: 18%; top: 29%; transform: rotate(7deg);
}
.maggie-document-digest .maggie-visual { aspect-ratio: 16 / 6; }
.maggie-reading-layout {
  display: grid;
  grid-template-columns: minmax(0, 640px) minmax(150px, 220px);
  gap: clamp(64px, 8vw, 140px);
  align-items: start;
  justify-content: center;
}
.maggie-page-poem .maggie-reading-layout {
  grid-template-columns: minmax(0, 560px) minmax(150px, 200px);
}
.maggie-reading-column { min-width: 0; }
.maggie-prose h2:not(.maggie-section),
.maggie-prose h3,
.maggie-prose h4 {
  color: var(--cmp-ink);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.5;
  scroll-margin-top: 9vh;
}
.maggie-prose h2:not(.maggie-section) { margin: 2.6em 0 .9em; font-size: clamp(23px, 3vw, 32px); }
.maggie-prose h3 { margin: 2.1em 0 .7em; font-size: clamp(20px, 2.5vw, 26px); }
.maggie-prose h4 { margin: 1.8em 0 .6em; font-size: 20px; }
.maggie-document-digest .maggie-prose blockquote {
  margin: 2.2em 0;
  padding: .2em 0 .2em 1.2em;
  border-left: 2px solid color-mix(in srgb, var(--maggie-accent) 60%, transparent);
  color: #6d665d;
}
.maggie-toc {
  position: sticky;
  top: clamp(22px, 8vh, 80px);
  min-width: 0;
  color: #8a8378;
  font: 400 12px/1.65 var(--font-ui);
}
.maggie-toc summary {
  cursor: pointer;
  list-style: none;
  color: var(--maggie-accent);
  font: 400 11px/1.5 var(--font-mono);
  letter-spacing: .16em;
}
.maggie-toc summary::-webkit-details-marker { display: none; }
.maggie-toc summary::after { content: "+"; margin-left: .65em; color: #aaa297; }
.maggie-toc[open] summary::after { content: "−"; }
.maggie-toc-list {
  display: grid;
  gap: 5px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.maggie-toc-item a {
  display: block;
  padding: 2px 0;
  color: #8a8378;
  text-decoration: none;
  transition: color .2s ease, padding-left .2s ease;
}
.maggie-toc-item a:hover,
.maggie-toc-item a.is-active { color: var(--maggie-accent); }
.maggie-toc-item a.is-active { padding-left: 7px; }
.maggie-toc-h3 a { padding-left: 10px; }
.maggie-toc-h4 a { padding-left: 18px; }
.maggie-toc-item a.is-active.maggie-toc-h3,
.maggie-toc-item a.is-active.maggie-toc-h4 { padding-left: 17px; }
.maggie-comments {
  margin-top: clamp(76px, 10vh, 132px);
  padding-top: 0;
}
.maggie-comments-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.maggie-comment-list { display: grid; gap: 22px; }
.maggie-comment { padding-bottom: 22px; border-bottom: 1px solid color-mix(in srgb, var(--cmp-line) 70%, transparent); }
.maggie-comment-meta { display: flex; align-items: baseline; gap: 12px; color: #8a8378; font: 400 11px/1.5 var(--font-mono); }
.maggie-comment-author { color: var(--cmp-ink); }
.maggie-comment-content { margin: 8px 0 0; color: #4c453c; font: 400 16px/1.8 var(--font-text); white-space: pre-wrap; overflow-wrap: anywhere; }
.maggie-comments-empty { display: none; }
.maggie-comment-form {
  position: relative;
  display: block;
  margin-top: 26px;
}
.maggie-comment-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.maggie-comment-input {
  position: relative; z-index: 1;
  display: block; width: 100%; height: 2.35em; min-height: 0; resize: none; overflow: hidden;
  padding: 5px 0; border: 0; outline: 0;
  background: transparent; color: var(--cmp-ink); font: 400 16px/1.8 var(--font-text);
}
.maggie-comment-input::placeholder { color: #a8a095; }
.maggie-comment-input:focus { box-shadow: none; }
.maggie-comment-input-wrap {
  position: relative;
  width: min(100%, 460px);
  min-height: 38px;
}
.maggie-comment-lines {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.maggie-comment-lines i {
  display: block;
  flex: 0 0 auto;
  box-sizing: border-box;
  border-bottom: 1px solid #bdb5a9;
}
.maggie-comment-input-wrap:focus-within .maggie-comment-lines i:last-child { border-color: var(--maggie-accent); }
.maggie-comment-actions {
  width: min(100%, 460px);
  display: flex;
  justify-content: flex-end;
  margin: 15px 0 0;
  padding: 0;
}
.maggie-comment-submit {
  padding: 0; border: 0;
  background: transparent; color: var(--maggie-accent); cursor: pointer;
  font: 400 13px/1.5 var(--font-ui); transition: color .2s ease, border-color .2s ease;
}
.maggie-comment-submit:hover { color: var(--green); border-color: var(--green); }
.maggie-comment-submit:focus { outline: none; }
.maggie-comment-input:focus-visible { outline: none; }
.maggie-toc a:focus-visible,
.maggie-toc summary:focus-visible { outline: 2px solid color-mix(in srgb, var(--maggie-accent) 55%, transparent); outline-offset: 4px; }

/* 阅读层右键菜单：只覆盖 maggie overlay，不改写站点其他页面的菜单。 */
.maggie-context-menu {
  position: fixed;
  z-index: var(--z-overlay-top);
  min-width: 166px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border: 1px solid #1a1814;
  background: #1a1814;
  color: #f6f1e8;
  box-shadow: 6px 6px 0 rgba(26, 24, 20, .16);
}
.maggie-context-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: 400 12px/1.5 var(--font-ui);
  transition: background-color .16s ease, color .16s ease;
}
.maggie-context-menu button:hover,
.maggie-context-menu button:focus-visible {
  background: #f6f1e8;
  color: #1a1814;
}
.maggie-context-menu button:disabled {
  color: #81786d;
  cursor: not-allowed;
}
.maggie-context-menu button:disabled:hover,
.maggie-context-menu button:disabled:focus-visible {
  background: transparent;
  color: #81786d;
}

@media (max-width: 760px) {
  .maggie-document,
  .maggie-page-poem { max-width: 640px; }
  .maggie-reading-layout { display: flex; flex-direction: column; gap: 54px; }
  .maggie-toc { position: static; order: -1; width: 100%; padding: 14px 0 12px; border-top: 1px solid var(--cmp-line); border-bottom: 1px solid var(--cmp-line); }
  .maggie-toc-list { display: flex; gap: 16px; margin-top: 12px; overflow-x: auto; padding-bottom: 3px; }
  .maggie-toc-item { flex: 0 0 auto; max-width: 18em; }
  .maggie-toc-item a,
  .maggie-toc-h3 a,
  .maggie-toc-h4 a,
  .maggie-toc-item a.is-active.maggie-toc-h3,
  .maggie-toc-item a.is-active.maggie-toc-h4 { padding-left: 0; white-space: nowrap; }
  .maggie-toc-item a.is-active { padding-left: 0; border-bottom: 1px solid var(--maggie-accent); }
  .maggie-document-essay .maggie-head { padding-left: 15px; }
  .maggie-visual { aspect-ratio: 16 / 10; margin-top: -2px; }
  .maggie-comments { margin-top: 72px; }
  .maggie-comment-actions { margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .maggie-close { transition: none; }
}

/* ============================================================
   网格纸条纹 / 文字胶囊 / 最右镜像（替代 mausumi 条纹与 W.）
   ============================================================ */

/* tune8e 性能：网格纸动画从 background-position 改为 transform
   （GPU 合成，不再每帧重绘背景），宽度多 26px 保证无缝循环。 */
.grid-stripes {
  position: absolute; top: 0; bottom: 0; left: 0; z-index: var(--z-base); pointer-events: none;
  width: calc(100% + 26px);
  background-color: #ede5d9;
  background-image:
    linear-gradient(to right, rgba(32,28,23,.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(32,28,23,.10) 1px, transparent 1px);
  background-size: 26px 26px;
  animation: gridScroll 0.8s linear infinite;
}
@keyframes gridScroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-26px, 0, 0); }
}

/* tune8e 性能：手风琴加号由 lottie 改为纯 CSS 十字，
   不再为 121 个 .plus 创建 lottie SVG 实例。 */
#library .plus {
  position: relative;
  width: 1.5vh;
  height: 1.5vh;
  transition: transform 0.35s ease;
}
#library .plus::before,
#library .plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background-color: #1a1814;
  transform: translate(-50%, -50%);
}
#library .plus::before { width: 1.5vh; height: 2px; }
#library .plus::after { width: 2px; height: 1.5vh; }

/* 文字胶囊：Ansel（tune9：改为指向 about.html 的链接） */
.name-capsule {
  position: relative; z-index: var(--z-content);
  font: 600 clamp(28px, 4vw, 56px)/1 ui-serif, Georgia, "Songti SC", serif;
  letter-spacing: .04em; color: #201c17;
  padding: .34em 1.05em;
  border: 2px solid #201c17; border-radius: 200px;
  background: #ede5d9; box-shadow: 10px 10px 0 0 #2a241d;
  text-decoration: none; display: inline-block; cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.name-capsule:hover {
  transform: translate(-2px, -2px);
  box-shadow: 12px 12px 0 0 #2a241d;
  background-color: #e8dfd0;
}

/* tobias 三条横杠：开合均平滑（补齐全收起动画） */
.tobias-toggle span {
  will-change: transform;
  transition: transform .4s var(--tobias-curve), opacity .25s ease;
}
.tobias-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.tobias-toggle.open span:nth-child(2) { transform: scaleX(0); opacity: 0; }
.tobias-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 入场覆盖页：网格纸面 + 撕纸边缘收起 ----------
   转场覆盖全局网格时自身保持不透明，离场只收起纸面和边缘，
   不再夹带倒计时、跑马灯或黑色块等无关装饰。 */
.new-transition {
  z-index: var(--z-transition);
  position: fixed;
  inset: 0;
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
}
/* 首页（body.overflow）覆盖层初始即显示，避免 JS 就绪前页面裸露闪烁；
   非首页不含该结构，此规则仅作保险。 */
body:not(.overflow) > .new-transition {
  display: none;
}
.transition-sheet {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #ede5d9;
  clip-path: inset(0 0 0 0);
  -webkit-clip-path: inset(0 0 0 0);
  transform: translateZ(0);
  will-change: clip-path;
}
.transition-grid {
  position: absolute;
  inset: 0;
  width: calc(100% + 26px);
  background-color: #ede5d9;
  background-image:
    linear-gradient(to right, rgba(32,28,23,.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(32,28,23,.12) 1px, transparent 1px);
  background-size: 26px 26px;
  animation: gridScroll .8s linear infinite;
  will-change: transform;
}
/* 开场进度线（2026-08-24 o 版）：纸面覆盖期间一条黑线从中部自左向右
   跑满（2.4s，与 JS INTRO_HOLD_MS 同步），跑满瞬间纸面开始先快后慢
   收起——复刻参考站开场的“进度酝酿”感，不引入倒计时/跑马灯。 */
.transition-sheet::after {
  content: "";
  position: absolute;
  top: 46%;
  left: 6vw;
  right: 6vw;
  height: 2px;
  background: #1a1814;
  opacity: .9;
  transform: scaleX(0);
  transform-origin: left center;
  animation: intro-progress 2.4s linear forwards;
  will-change: transform;
  z-index: 3;
}
@keyframes intro-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.transition-edge {
  position: absolute;
  left: 0;
  width: 100%;
  height: clamp(82px, 15vh, 170px);
  overflow: hidden;
  z-index: 2;
  pointer-events: none;
  background: #f6f1e8;
  /* The source artwork is used only as a luminance mask: its white paper
     becomes the visible edge and its black matte becomes transparent. */
  -webkit-mask-image: url("assets/mausumi/images/paper-cut-full.svg");
  mask-image: url("assets/mausumi/images/paper-cut-full.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-mode: luminance;
  mask-mode: luminance;
}
.transition-edge-top {
  top: -1px;
  transform: rotate(180deg);
  transform-origin: center top;
}
.transition-edge-bottom {
  /* The sheet retracts toward the top, so its lower torn edge follows the
     same path instead of drifting down and leaving a hard horizontal seam. */
  bottom: 0;
}
.new-transition.is-closing .transition-sheet {
  animation: paper-sheet-collapse 1.4s cubic-bezier(.22, 1, .36, 1) forwards;
}
.new-transition.is-closing .transition-edge-top {
  animation: paper-edge-top-collapse 1.4s cubic-bezier(.22, 1, .36, 1) forwards;
}
.new-transition.is-closing .transition-edge-bottom {
  animation: paper-edge-bottom-collapse 1.4s cubic-bezier(.22, 1, .36, 1) forwards;
}
@keyframes paper-sheet-collapse {
  0% { clip-path: inset(0 0 0 0); -webkit-clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 0 100% 0); -webkit-clip-path: inset(0 0 100% 0); }
}
@keyframes paper-edge-top-collapse {
  0% { transform: rotate(180deg) translateY(0); opacity: 1; }
  100% { transform: rotate(180deg) translateY(-105%); opacity: 0; }
}
@keyframes paper-edge-bottom-collapse {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-100vh); opacity: 0; }
}
.new-transition.is-hidden {
  display: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .transition-grid,
  .transition-sheet::after { animation: none; }
  .new-transition.is-closing .transition-sheet,
  .new-transition.is-closing .transition-edge-top,
  .new-transition.is-closing .transition-edge-bottom {
    animation-duration: 1ms;
  }
}

/* ---------- 单页区块：工程 / 阅读（并入首页） ---------- */
.sp-works,
.sp-reading {
  position: relative;
  padding: 14vh 8vw 16vh;
  color: #fff;
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.sp-reading { padding-top: 24vh; }
.sp-head { margin-bottom: 7vh; }
.sp-head .menu-el.popular {
  color: var(--green);
  font-size: 13px;
  letter-spacing: .24em;
  margin-bottom: 1.2rem;
}
.sp-head h2 { font-weight: 400; }
.sp-sub { color: rgba(255, 255, 255, .6); margin-top: 1.2rem; font-size: 15px; letter-spacing: .1em; }

.sp-works-list { display: flex; flex-direction: column; }
.sp-work {
  display: flex; align-items: baseline; gap: 2rem;
  padding: 1.8rem 0; border-bottom: 1px solid rgba(255, 255, 255, .14);
  transition: padding-left .3s ease;
}
.sp-work-no {
  font: 13px ui-monospace, "SFMono-Regular", monospace;
  color: rgba(255, 255, 255, .4); letter-spacing: .12em;
}
.sp-work-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .45rem; }
.sp-work-title {
  font: 400 clamp(22px, 2.4vw, 34px)/1.35 ui-serif, Georgia, "Songti SC", serif;
  transition: color .2s ease;
}
.sp-work-desc { color: rgba(255, 255, 255, .58); font-size: 14px; line-height: 1.85; max-width: 46em; }
.sp-work-tag {
  font: 12px ui-sans-serif, system-ui, sans-serif;
  color: rgba(255, 255, 255, .4); letter-spacing: .18em; white-space: nowrap;
}
.sp-work:hover { padding-left: 1rem; }
.sp-work:hover .sp-work-title { color: var(--green); }
.sp-work:hover .sp-work-no { color: #fff; }

.sp-posts { display: flex; flex-direction: column; margin-bottom: 10vh; }
.sp-post {
  display: flex; gap: 2rem; align-items: baseline;
  padding: 1.1rem 0; border-bottom: 1px solid rgba(255, 255, 255, .1);
  color: inherit; text-decoration: none; transition: padding-left .3s ease;
}
.sp-post-date { font: 12px ui-monospace, "SFMono-Regular", monospace; color: rgba(255, 255, 255, .4); }
.sp-post-title { font: 400 18px/1.6 ui-serif, Georgia, "Songti SC", serif; }
.sp-post-tag {
  font-size: 12px; color: rgba(255, 255, 255, .4);
  margin-left: auto; letter-spacing: .18em; white-space: nowrap;
}
.sp-post:hover { padding-left: 1rem; }
.sp-post:hover .sp-post-title { color: var(--green); }

.sp-reading-grid {
  display: grid; grid-template-columns: minmax(0, 34em) 1fr;
  gap: 4rem; align-items: start;
}
.sp-body {
  min-width: 0;
  font: 400 17px/2.05 ui-serif, Georgia, "Songti SC", serif;
  color: rgba(255, 255, 255, .82);
}
.sp-body h2,
.sp-body h3,
.sp-body h4 { font-weight: 400; margin-top: 3em; margin-bottom: .7em; scroll-margin-top: 6rem; }
.sp-body h2 { font-size: 26px; letter-spacing: .03em; border-bottom: 1px solid rgba(255, 255, 255, .15); padding-bottom: .35em; }
.sp-body h3 { font-size: 21px; color: rgba(255, 255, 255, .88); }
.sp-body h4 { font-size: 18px; color: rgba(255, 255, 255, .8); }
.sp-body strong, .sp-body b { font-weight: 400; color: #fff; }
.sp-body a { color: var(--green); text-decoration: none; }
.sp-body blockquote {
  margin: 2em 0; padding-left: 1.2em;
  border-left: 2px solid rgba(255, 255, 255, .25);
  color: rgba(255, 255, 255, .65); font-style: italic;
}
.sp-body code {
  font: 13px ui-monospace, "SFMono-Regular", monospace;
  background: rgba(255, 255, 255, .08); padding: .12em .4em; border-radius: 3px;
}
.sp-body pre {
  background: rgba(0, 0, 0, .45); padding: 1.2em 1.4em;
  border-radius: 6px; overflow-x: auto; line-height: 1.7;
}
.sp-body pre code { background: none; padding: 0; }
.sp-toc {
  position: sticky; top: 7rem; font-size: 13px; line-height: 2.1;
  color: rgba(255, 255, 255, .5);
}
.sp-toc-label {
  display: block; margin-bottom: .8rem; font-size: 11px;
  letter-spacing: .26em; text-transform: uppercase; color: rgba(255, 255, 255, .4);
}
.sp-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.sp-toc a { color: rgba(255, 255, 255, .5); text-decoration: none; transition: color .2s ease; }
.sp-toc a:hover { color: #fff; }
.sp-toc a.is-active { color: #fff; }
.sp-toc a.is-active::before { content: "· "; color: var(--green); }
.sp-toc .toc-3 { padding-left: 1em; }

@media screen and (max-width: 767px) {
  .sp-works, .sp-reading { padding: 10vh 6vw 12vh; }
  .sp-reading-grid { grid-template-columns: 1fr; }
  .sp-toc { position: static; margin-bottom: 2.5rem; }
  .sp-work { flex-wrap: wrap; gap: .5rem 1.2rem; }
  .sp-work-tag, .sp-post-tag { white-space: normal; }
  .sp-post { flex-wrap: wrap; gap: .5rem 1.2rem; }
}

@media screen and (max-width: 479px) {
  .hos-wrap {
    width: 100%;
    max-width: 100%;
  }
}

/* ============================================================
   界面字体分工（先生决议 2026-08-17）：展示、正文索引与 UI 各自协调；
   霞鹜文楷只保留在上方 maggie 正文阅读浮层。
   ============================================================ */
body, .body { font-family: var(--font-text); }
.heading, .heading.featured, .poem-title, .poem-desc, .name-capsule,
.works-title, .content-title { font-family: var(--font-display); }
.date, .menu-el, .menu-el.popular, .menu-el.about, .marquee-text,
.works-account-head, .content-meta, .content-link, .library-empty-note {
  font-family: var(--font-ui);
}

/* ============================================================
   可访问性（2026-08-15 a11y pass）：
   键盘焦点可见 / 跳过导航链接 / reduced-motion 兜底
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--green-deep);
  outline-offset: 3px;
}

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: var(--z-skip);
  padding: 10px 16px;
  background: var(--green-deep); color: #fff;
  font: 14px/1.4 ui-sans-serif, system-ui, sans-serif; text-decoration: none;
  border-radius: 6px;
  transform: translateY(-220%);
  transition: transform .2s ease;
}
.skip-link:focus-visible { transform: none; }

/* ============================================================
   账号与内容（#works，library 右栏内）
   2026-08-17：诗、文章、深读、产品统一进入多账号索引。
   账号靠留白分段；内容类型靠几何标记与排版密度区分。
   ============================================================ */
.works-section {
  position: relative;
  padding: 9vh 0 7vh;
  color: #1a1814;
}
/* 首页尾段脱离旧 library 双栏容器，使用独立的内容宽度。 */
.works-section.home-works {
  width: min(1120px, calc(100vw - 8vw));
  margin: 0 auto;
  padding-top: 12vh;
  padding-bottom: 8vh;
}
.works-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 11vh;
}
.works-title {
  font-weight: 400;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1;
  letter-spacing: 0;
}
.works-account + .works-account { margin-top: 13vh; }
.works-account-head {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: .9rem;
  padding: 0;
  margin-bottom: 3.8rem;
}
.works-account-index {
  color: rgba(26, 24, 20, .44);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.works-account-name {
  margin: 0;
  font-family: var(--font-ui);
  font-size: clamp(18px, 1.65vw, 22px);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
}
.works-account-note {
  color: rgba(26, 24, 20, .58);
  font-size: 13px;
  letter-spacing: 0;
}
.works-account-body { margin-left: 3.3rem; }
.content-entry {
  position: relative;
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  padding: 1.5rem 0;
}
.content-entry + .content-entry { margin-top: 1.4rem; }
.content-type-mark {
  position: relative;
  display: block;
  width: 1.25rem;
  height: 1.5rem;
  margin-top: .35rem;
  color: var(--green-deep);
}
.content-poem .content-type-mark::before {
  content: "";
  position: absolute;
  left: .45rem;
  top: 0;
  width: 1px;
  height: 1.35rem;
  background: currentColor;
}
.content-essay .content-type-mark::before {
  content: "";
  position: absolute;
  left: .2rem;
  top: .2rem;
  width: .62rem;
  height: .62rem;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.content-deep-read .content-type-mark::before {
  content: "";
  position: absolute;
  left: .15rem;
  top: .1rem;
  width: .72rem;
  height: .72rem;
  border-left: 1px solid currentColor;
  border-top: 1px solid currentColor;
}
.content-product .content-type-mark::before,
.content-product .content-type-mark::after {
  content: "";
  position: absolute;
  left: .12rem;
  top: .5rem;
  width: .82rem;
  height: 1px;
  background: currentColor;
}
.content-product .content-type-mark::after { transform: rotate(90deg); }
.content-main { min-width: 0; }
.content-title {
  margin: 0;
  font-size: clamp(23px, 2.45vw, 34px);
  font-weight: 400;
  line-height: 1.38;
  letter-spacing: 0;
  text-wrap: balance;
  transition: color .2s ease;
}
.content-meta {
  margin-top: .55rem;
  color: rgba(26, 24, 20, .54);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: .04em;
}
.content-summary {
  max-width: 38em;
  margin: 1rem 0 0;
  color: rgba(26, 24, 20, .76);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.85;
  letter-spacing: 0;
}
.content-link {
  position: relative;
  z-index: 2;
  align-self: center;
  color: var(--green-deep);
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
  transition: transform .2s ease;
}
.content-link:hover { transform: translate(3px, -3px); }
.content-hit {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.content-entry:hover .content-title,
.content-entry:focus-within .content-title { color: var(--green-deep); }

.poetry-field {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 2.5rem;
  row-gap: .3rem;
  margin-top: 5vh;
}
.poetry-field .content-entry {
  grid-template-columns: 1.2rem minmax(0, 1fr);
  gap: .75rem;
  padding: .85rem 0;
}
.poetry-field .content-entry + .content-entry { margin-top: 0; }
.poetry-field .content-title {
  font-size: 17px;
  line-height: 1.55;
  text-wrap: pretty;
}
.poetry-field .content-meta { margin-top: .25rem; font-size: 11px; }
.poetry-field .content-link { display: none; }

/* 桌面竖向阶段：内容与留白沿中缝交叉接力，而不是固定空置左半页。 */
@media (min-width: 992px) {
  .works-section.home-works {
    width: min(1120px, calc(100vw - 8vw));
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
  }
  .library-right { overflow: visible; }
  .works-section {
    width: 100vw;
    margin-left: -50vw;
    padding-right: 0;
    padding-left: 0;
  }
  .works-head {
    width: 50%;
    margin-left: 50%;
    padding-right: 3vw;
    padding-left: 3vw;
  }
  .works-account[data-account="bujianchuanxing"] {
    width: 100%;
  }
  .works-account[data-account="bujianchuanxing"] > .works-account-head {
    width: 50%;
    margin-left: 50%;
    padding-right: 3vw;
    padding-left: 3vw;
  }
  .works-account[data-account="bujianchuanxing"] > .works-account-body {
    margin-left: 0;
  }
  .works-account[data-account="bujianchuanxing"] > .works-account-body > .content-entry {
    width: 50%;
    margin-left: 50%;
    padding-right: 3vw;
    padding-left: calc(3vw + 3.3rem);
  }
  .works-account[data-account="bujianchuanxing"] .poetry-field {
    width: 100%;
    padding-right: 3vw;
    padding-left: 3vw;
    column-gap: 7vw;
  }
  .works-account[data-account="jenny"],
  .works-account[data-account="vellum"] {
    width: 50%;
    padding-right: 3vw;
    padding-left: 3vw;
  }
  .works-account[data-account="jenny"] {
    margin-left: 0;
    padding-top: 6vh;
    padding-bottom: 6vh;
    background: #ede5d9;
  }
  .works-account[data-account="vellum"] {
    margin-left: 50%;
  }
  .works-account[data-account="jenny"] + .works-account[data-account="vellum"] {
    margin-top: 16vh;
  }
  .library-end {
    width: 100vw;
    margin-left: -50vw;
  }
}

@media (max-width: 767px) {
  .works-section { padding: 72px 20px 40px; }
  .works-head { flex-direction: column; align-items: flex-start; gap: .6rem; }
  .works-head { margin-bottom: 72px; }
  .works-account + .works-account { margin-top: 88px; }
  .works-account-head { grid-template-columns: 2rem minmax(0, 1fr); margin-bottom: 36px; }
  .works-account-note { grid-column: 2; }
  .works-account-body { margin-left: 0; }
  .content-entry { grid-template-columns: 1.25rem minmax(0, 1fr) auto; gap: .75rem; padding: 1.2rem 0; }
  .content-entry + .content-entry { margin-top: 1.1rem; }
  .content-title { font-size: 23px; line-height: 1.42; }
  .content-summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-size: 16px;
    line-height: 1.75;
  }
  .poetry-field { grid-template-columns: 1fr; margin-top: 36px; }
  .poetry-field .content-title { font-size: 18px; }
}

/* ---------- 静态占位模式（先生 2026-08-24：删除动画设计，留占位） ----------
   html.no-motion 时：全部 CSS 动画/过渡归零（汉堡扩散、逐字展开、
   gridScroll、悬停过渡等），JS 侧由 components.js motionOn() 同步停用；
   结构与交互（菜单开合、阅读层开合）保留，瞬时出现/消失。
   动画重做时移除 no-motion 类即可。 */
html.no-motion *,
html.no-motion *::before,
html.no-motion *::after {
  animation: none !important;
  transition: none !important;
}
/* 入场覆盖层不再使用（开场动画已删除），保留 DOM 占位。 */
html.no-motion .new-transition {
  display: none !important;
}
