/* 契约（改这个文件前先读这 6 行）
   1. 这个文件同时喂「工作台」和「生成站」，两端加载的是同一份；不要写只给某一端的样式。
   2. 加载顺序 shell.css → studio.css：同特异性时 studio.css 会赢。
      样式「看起来没生效」先查是不是被后加载的同名规则盖掉（本项目栽过两次，见踩坑清单 P2）。
   3. 块与块之间的垂直距离只有一个来源：--block-gap。所有块自身 margin 归零；
      新增块类型时写 margin-block: 0，不要自带上下 margin。
   4. 颜色 / 字号 / 间距一律用变量，变量由 studio.js#applyTypes() 和 build.mjs 同时写进 <html>，
      改一处必须改另一处（否则两端不一致）。
   5. 不许用 CSS 隐藏编辑端专属元素：阅读端是运行时 remove() 掉的（红线 10）。
   6. 构建期会按产物 JS/HTML 裁剪 CSS（css-purge.mjs）：动态类名必须能在产物里找到，注释说明挡不住裁剪。
*/
/* ---------------------------------------------------------------
   思源 → 静态站 · 阅读器外壳
   同一套气质：米白纸面、宋体、暗红点缀、大留白；
   内容块沿用思源的类名（.protyle-wysiwyg / .p / .h2 / .callout），
   所以以后可以直接把 XYS 主题的内容段贴进来。
   --------------------------------------------------------------- */

:root {
  --paper: #f2f2ef;
  --paper-hi: #fbfaf6;
  --paper-lo: #e9e8e2;
  --desk: #e3e2dc;
  --ink: #171717;
  --ink-2: #525252;
  --ink-3: #8b8b84;
  --line: rgba(23, 23, 23, .09);
  --line-soft: rgba(23, 23, 23, .055);
  --accent: #7a0a0a;
  --accent-2: #a33a2a;
  --accent-soft: rgba(122, 10, 10, .075);
  --serif: "WenYuanSerifSC", "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
  /* 界面字体（左栏、标签条、面包屑、右栏、按钮）永远用系统字体：
     站点里 --serif 会指向按页切出来的网页字体，界面不该为它多下载几百 KB。 */
  --ui-serif: "WenYuanSerifSC", "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "JetBrainsMono-Regular", Consolas, "Courier New", monospace;
  --rail: 258px;
  --rel: 306px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 23, 23, .05), 0 18px 50px -34px rgba(23, 23, 23, .45);
  /* 思源的行内配色：正文里很多 <span style="color:var(--b3-…)">，
     这里按思源 daytime 主题的原值补上，站点才能还原作者标的颜色。 */
  --b3-theme-primary: #3575f0;
  --b3-theme-secondary: #ff9200;
  --b3-theme-error: #d23f31;
  --b3-theme-background: #fff;
  --b3-theme-on-background: #222;
  --b3-theme-on-surface: #5f6368;
  --b3-theme-surface: #f6f6f6;
  --b3-card-error-color: #790600;
  --b3-card-error-background: #f5d1cf;
  --b3-card-warning-color: #8a4f00;
  --b3-card-warning-background: #ffe8c8;
  --b3-card-info-color: #005599;
  --b3-card-info-background: #d6eaf9;
  --b3-card-success-color: #006b04;
  --b3-card-success-background: #d7eed8;
  --b3-font-color1: var(--b3-card-error-color);
  --b3-font-color2: var(--b3-card-warning-color);
  --b3-font-color3: var(--b3-card-info-color);
  --b3-font-color4: var(--b3-card-success-color);
  --b3-font-color5: var(--b3-theme-on-surface);
  --b3-font-color6: var(--b3-theme-primary);
  --b3-font-color7: var(--b3-theme-secondary);
  --b3-font-color8: var(--b3-theme-error);
  --b3-font-color9: #a40074;
  --b3-font-color10: #007080;
  --b3-font-color11: #006e2a;
  --b3-font-color12: #6b5a00;
  --b3-font-color13: var(--b3-theme-background);
  --b3-font-background1: var(--b3-card-error-background);
  --b3-font-background2: var(--b3-card-warning-background);
  --b3-font-background3: var(--b3-card-info-background);
  --b3-font-background4: var(--b3-card-success-background);
  --b3-font-background5: #e2e3e4;
  --b3-font-background6: #acd0fc;
  --b3-font-background7: #fddaab;
  --b3-font-background8: #ffb0a9;
  --b3-font-background9: #fdbfff;
  --b3-font-background10: #b1ffff;
  --b3-font-background11: #affad1;
  --b3-font-background12: #fff88f;
  --b3-font-background13: var(--b3-theme-on-background);
}

* { box-sizing: border-box; }
/* 表单控件默认不继承字体（浏览器会给 Arial）：界面字体统一从 body 继承。 */
button, input, select, textarea { font-family: inherit; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink-2);
  font-family: var(--ui-serif);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* 纸面颗粒，很淡 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

::selection { background: rgba(122, 10, 10, .14); color: var(--ink); }

/* ============================== 布局 ============================== */

.app {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  transition: grid-template-columns .25s ease;
}

.app > * { min-height: 0; }

.app.is-rel { grid-template-columns: var(--rail) minmax(0, 1fr) var(--rel); }
.app.is-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.app.is-collapsed.is-rel { grid-template-columns: 0 minmax(0, 1fr) var(--rel); }

.rail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px 12px 10px;
  overflow: hidden;
  background: var(--paper);
  border-right: 1px solid var(--line-soft);
}

.rail--right {
  border-right: 0;
  border-left: 1px solid var(--line-soft);
  padding: 18px 16px 16px;
  overflow-y: auto;
}

.app.is-collapsed .rail { opacity: 0; pointer-events: none; }

/* 启动期：首帧就按上次的开合状态画，别让读者看到「先收起再展开」的伸缩。
   head 里的内联脚本会读 localStorage 并把状态打在 <html data-rail / data-rel> 上，
   core.js 恢复完状态后把这些标记摘掉（之后一切照常走 class）。 */
html[data-rail="open"] .app.is-collapsed { grid-template-columns: var(--rail) minmax(0, 1fr); }
html[data-rail="open"] .app.is-collapsed > .rail:not(.rail--right) { opacity: 1; pointer-events: auto; }
html[data-rail="shut"] .app { grid-template-columns: 0 minmax(0, 1fr); }
html[data-rail="shut"] .app.is-rel { grid-template-columns: 0 minmax(0, 1fr) var(--rel); }
html[data-rail="shut"] .app > .rail:not(.rail--right) { opacity: 0; pointer-events: none; }
html[data-rel="open"] .app { grid-template-columns: var(--rail) minmax(0, 1fr) var(--rel); }
html[data-rel="open"] .app.is-collapsed { grid-template-columns: 0 minmax(0, 1fr) var(--rel); }
html[data-rel="open"] .app .rail--right { display: block; animation: none; }

/* 启动期一律不做过渡：状态类名是 JS 补上的，动画不该被看到 */
html[data-booting] *,
html[data-booting] *::before,
html[data-booting] *::after {
  transition: none !important;
  animation-duration: 0s !important;
}

.app.is-rel .rail--right { animation: railIn .22s ease both; }
@keyframes railIn { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }

.stage {
  min-width: 0;
  min-height: 0;
  padding: 0;
  display: flex;
}

.panes { display: flex; gap: 0; width: 100%; min-width: 0; min-height: 0; }
.panes > .pane + .pane { border-left: 1px solid var(--line-soft); }
/* 双栏之间的拖动条：拖动改两侧比例（工作台与阅读端共用） */
.pane-resizer {
  flex: 0 0 7px;
  margin: 0 -3px;
  position: relative;
  z-index: 6;
  cursor: col-resize;
}
.pane-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 1px;
  background: var(--line-soft);
  transition: background .15s;
}
.pane-resizer:hover::before { background: rgba(122, 10, 10, .38); }
body.is-resizing { cursor: col-resize; }
body.is-resizing * { user-select: none !important; }

.app:not(.is-rel) .rail--right { display: none; }

@media (max-width: 1180px) {
  .app.is-rel { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .rail--right {
    position: fixed; top: 0; right: 0; bottom: 0; width: var(--rel);
    background: var(--paper); border: 0; border-left: 1px solid var(--line);
    box-shadow: -24px 0 60px -42px rgba(23, 23, 23, .55); z-index: 40;
  }
}

/* ============================== 侧栏 ============================== */

.rail__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand__mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #f6f3ea;
  font-size: 14px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}

.brand__text {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .01em;
  white-space: nowrap;
}

.brand__text em {
  display: block;
  font-style: normal;
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 2px;
}

.icon {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  width: 26px; height: 26px;
  padding: 0;                /* 别用浏览器给 <button> 的默认内边距：会把里面的 SVG 挤偏 */
  border-radius: 7px;
  display: grid; place-items: center;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
  /* 2026-11-04：给小图标加定位基准，命中区用 ::after 扩到 32px（见文件末尾） */
  position: relative;
}
.icon:hover { background: rgba(23, 23, 23, .055); color: var(--ink); }
.icon--tiny { width: 18px; height: 18px; font-size: 11px; border: 1px solid var(--line); border-radius: 50%; }
.icon--tiny svg { width: 12px; height: 12px; display: block; }

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 16px 0 6px;
  padding: 0 8px;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, .42);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.search:focus-within {
  border-color: rgba(122, 10, 10, .3);
  background: rgba(255, 255, 255, .7);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search svg { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 1.4; stroke-linecap: round; }
.search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 13px; color: var(--ink);
}
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { appearance: none; }
.search kbd {
  display: inline-block;
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.2;
  color: var(--ink-3);
  vertical-align: middle;
  position: relative;
  top: -0.04em;
  background: linear-gradient(180deg, #fffefb, #f5f2ea);
  border: 1px solid rgba(23, 23, 23, .10);
  border-bottom: 2px solid rgba(23, 23, 23, .13);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
}

.tree { flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px 8px; }

.tree__label {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 12px 8px 4px;
}

.tree__item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 26px;
  padding: 0 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #5d5d57;
  font-family: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.tree__item:hover { background: rgba(23, 23, 23, .045); color: var(--ink); }
.tree__item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
/* 单字图标方块（侧栏「页」/ 标签条 / 关系条目 / 数据库列表）。
   2026-11-04 修「文字不在方块中心」：
   根因是 `line-height: normal` 会按字体的 ascent/descent 排（CJK 字体 ascent 12 / descent 3，
   比例 4:1，天然偏下），而且 10px 字号下「页」的墨迹高达 15px，比 13px 的内容区还高、必然溢出。
   做法：方块 15 → 16（内容区 13 → 14，容得下 13.5px 墨迹）、字号 10 → 9、
   line-height 写成 1（不跟字体度量走）、再补 1px 抵消 CJK 仍然略偏下的视觉重心。
   **改这套参数要同步 `.tab__icon` / `.rel-item__thumb` / `.db-list__glyph`**，否则只对一个。 */
.tree__glyph {
  flex: none;
  width: 16px; height: 16px;
  display: grid; place-items: center;
  padding-top: 1px;
  font-size: 9px;
  line-height: 1;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--ink-3);
  background: rgba(255, 255, 255, .45);
}
.tree__glyph .emoji-img { width: 10px; height: 10px; }
.tree__item.is-active .tree__glyph { border-color: rgba(122, 10, 10, .25); color: var(--accent); }
.tree__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree__count { font-family: var(--sans); font-size: 10.5px; color: #6e6e68; }
.tree__item.is-active .tree__count { color: rgba(122, 10, 10, .65); }

/* 搜索结果 */
.hit {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 8px;
  cursor: pointer;
  transition: background .14s;
}
.hit:hover { background: rgba(23, 23, 23, .045); }
.hit__kicker { font-family: var(--sans); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.hit__text { display: block; margin-top: 3px; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.hit__text mark { background: var(--accent-soft); color: var(--accent); padding: 0 1px; border-radius: 2px; }
.hit__doc { display: block; margin-top: 4px; font-size: 11px; color: var(--ink-3); }

/* 次要文字（反链计数 / 页脚状态）：2026-11-04 提高对比度。
   实测 --ink-3（#8b8b84）在 --paper（#f2f2ef）上只有 **3.06:1**，
   低于 WCAG AA 的 4.5:1。换成 #6e6e68（4.56:1）—— 仍明显淡于正文，
   但小字（10.5px）也能看清。**不要再改回 --ink-3**。
   另外左栏页脚原来两个小按钮在 .foot__tools 里靠左排，右边空一大片；
   现在 .foot__tools 靠右贴边、间距 8px。 */
.tree__count {
  font-family: var(--sans);
  font-size: 10.5px;
  color: #6e6e68;
}
.studio-dock__projects {
  position: relative;
  flex: none;
}
.studio-dock__projects > summary {
  list-style: none;
}
.studio-dock__projects > summary::-webkit-details-marker { display: none; }
.studio-dock__projects[open] > summary {
  background: var(--accent-soft);
  color: var(--accent);
}
.studio-dock__projects-menu {
  position: absolute;
  left: calc(100% + 6px);
  top: 0;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-hi);
  box-shadow: 0 14px 34px -18px rgba(23, 23, 23, .4);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.studio-dock__projects-sep {
  height: 1px;
  margin: 4px;
  background: var(--line-soft);
}
.rail__project--home { color: var(--accent); }
.rail__project--home svg { width: 14px; height: 14px; flex: none; }
.rail__project {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  color: #6e6e68;
  font-family: var(--sans);
  font-size: 10.5px;
  text-decoration: none;
  white-space: nowrap;
}
.rail__project b { color: var(--accent); font-weight: 600; }
.rail__project:hover { color: var(--accent); background: rgba(23, 23, 23, .045); }
.rail__project.is-on { color: var(--accent); background: var(--accent-soft); }
/* 菜单里的「心猿社」用亮红；顶部合并按钮未展开时保持普通 dock 图标的灰。 */
#portalHome { color: var(--accent); }

.rail__foot {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  /* 用户 2026-11-17 定：页脚工具组改为左对齐，和文档树的左缘对齐。 */
  padding: 9px 4px 2px;
  margin: 6px -4px 0;
  border-top: 1px solid var(--line-soft);
  font-family: var(--sans);
  font-size: 10.5px;
  color: #6e6e68;
  white-space: nowrap;
}
.foot-toggle {
  color: #6e6e68;
}
.foot__tools {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex: none;
  margin-left: 0;
}
/* 左侧状态文字在工作台里是 `display:none`（studio.css 有 `#status { display:none }`，
   阅读态不显示字数统计），所以这个页脚实际只有右侧两个按钮 —— 靠右排即可。
   **不要再给 #status 加 min-width:0**：那会把它压成 0 宽（实测 w=0、文字消失）。 */
.rail__foot > #status > #statusText {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.foot-toggle {
  position: relative;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 6px 2px 5px;
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  background: transparent;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: .06em;
  color: #6e6e68;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}.foot-toggle::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .45;
  transition: opacity .2s, background .2s;
}
.foot-toggle:hover { color: var(--ink-2); border-color: var(--line); }
.foot-toggle.is-on { color: var(--accent); border-color: rgba(122, 10, 10, .22); background: var(--accent-soft); }
.foot-toggle.is-on::before { opacity: 1; }

/* 页脚「源码」入口：只在把「?」改成别的地址时出现（AGPL 第 13 条仍然满足） */
.foot-src {
  position: relative;   /* 命中区用 ::after 扩到 32px（见文件末尾） */
  display: inline-flex; align-items: center;
  padding: 2px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: .06em;
  color: var(--ink-3);
  text-decoration: none;
  transition: color .2s, border-color .2s, background .2s;
}
.foot-src:hover { color: var(--accent); border-color: rgba(122, 10, 10, .22); background: var(--accent-soft); }

/* 页脚备案信息（ICP / 公安备案）：放在正文最后，读者读完才看到。
   自带一套克制的默认样式——用户没写自定义 CSS 时也要能看；
   写了自定义 CSS 就由 .site-foot / .site-foot__* 覆盖这层。 */
.site-foot {
  margin: 34px 0 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.9;
  color: var(--ink-3);
  text-align: center;
}
.site-foot__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
}
.site-foot__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: inherit;
  text-decoration: none;
  transition: color .2s;
}
.site-foot__item:hover { color: var(--ink-2); }
/* 两条备案号之间的竖线（2026-11-11 用户定：公安备案在左、ICP 在右，中间一条竖线）。
   用字符「丨」而不是 border，这样换行时它跟着那一行走、不会变成半截线。 */
.site-foot__sep {
  color: var(--ink-3);
  opacity: .65;
  user-select: none;
  margin: 0 -6px;
}
/* 极窄屏：这一行实测需要 342px（两条备案号 + 竖线 + 间距）；
   正文宽度 = 视口 − 44px，所以视口 ≤386px 时它必然折成两行，竖线会孤零零挂在第一行末尾。
   那时干脆不显示竖线，让两条各自居中成行（390px 的手机仍是一行，竖线照常显示）。 */
@media (max-width: 386px) {
  .site-foot__sep { display: none; }
}
.site-foot__icon {
  width: auto;
  height: 16px;
  max-width: 24px;
  object-fit: contain;
  flex: none;
  vertical-align: -3px;
}
.site-foot__extra { margin-top: 6px; }
.site-foot__extra p { margin: 0; }

/* 打印时页脚留着（备案信息属于必须可见的内容），但不要分页把标题和正文撕开 */
@media print {
  .site-foot { break-inside: avoid; }
}

/* ============================== 标签页 / 分栏 ============================== */

.pane {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  background: var(--paper);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.pane__tabs {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 46px;
  padding: 0 8px 0 9px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0));
}

.tabs__list { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs__list::-webkit-scrollbar { display: none; }

.tab {
  display: flex; align-items: center; gap: 7px;
  flex: none;
  max-width: 220px;
  height: 30px;
  padding: 0 6px 0 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #6f6f69;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.tab:hover { background: rgba(23, 23, 23, .04); color: var(--ink); }
.tab.is-active {
  background: var(--paper-hi);
  border-color: var(--line-soft);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(23, 23, 23, .05);
}
.tab__dot { width: 6px; height: 6px; border-radius: 2px; background: var(--ink-3); opacity: .55; flex: none; }
.tab.is-active .tab__dot { background: var(--accent); opacity: 1; }
.tab__icon {
  flex: none;
  width: 16px; height: 16px;
  display: grid; place-items: center;
  /* 和 .tree__glyph 同一套参数（见上面那段注释）：9px 字 + line-height 1 + 1px 下沉补偿 */
  padding-top: 1px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, .45);
  color: var(--ink-3);
  font-size: 9px;
  line-height: 1;
}
.tab.is-active .tab__icon {
  border-color: rgba(122, 10, 10, .22);
  background: var(--accent-soft);
  color: var(--accent);
}
.tab__icon .twemoji { width: 12px; height: 12px; }
.tab__pin { color: var(--accent); font-size: 7px; line-height: 1; opacity: .75; }
.tab.is-tab-drop-before { box-shadow: inset 2px 0 0 var(--accent); }
.tab.is-tab-drop-after { box-shadow: inset -2px 0 0 var(--accent); }
.tab.is-tab-drag { opacity: .45; }
.tab-overflow {
  flex: none;
  position: sticky;
  right: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 24px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink-3);
  cursor: pointer;
  box-shadow: -10px 0 12px -10px rgba(23, 23, 23, .28);
}
.tab-overflow svg { width: 14px; height: 14px; }
.tab-overflow:hover {
  /* 悬停时也要保持不透明：直接用半透明色会把后面的标签文字透出来 */
  background: linear-gradient(rgba(23, 23, 23, .07), rgba(23, 23, 23, .07)), var(--paper);
  color: var(--ink);
}
.tab-menu { width: 240px; max-height: 60vh; overflow-y: auto; }
.tab-menu__item {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 2px 3px 2px 0;
  border-radius: 6px;
  color: var(--ink-2);
  font: 11px/1.5 var(--sans);
}
.tab-menu__item:hover { background: rgba(23, 23, 23, .05); }
.tab-menu__item.is-on { background: var(--accent-soft); color: var(--accent); }
.tab-menu__jump {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  padding: 5px 6px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tab-menu__jump .tab__icon { width: 14px; height: 14px; font-size: 9px; }
.tab-menu__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-menu__close {
  width: 18px; height: 18px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 5px; background: transparent;
  color: var(--ink-3); font-size: 13px; line-height: 1; cursor: pointer;
  opacity: .55; transition: opacity .15s, background .15s, color .15s;
}
.tab-menu__close:hover { background: rgba(23, 23, 23, .1); color: var(--ink); opacity: 1; }
.tab-menu__pin { margin-left: auto; color: var(--accent); font-size: 8px; }
.tab__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab__close {
  width: 17px; height: 17px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 5px; background: transparent;
  color: var(--ink-3); font-size: 13px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .15s, background .15s, color .15s;
}
/* 图标按钮不吃浏览器默认内边距（默认 1px 6px，会把里面的 × / SVG 挤偏）。
   这一组都是纯图标按钮，宽度写死 17–28px，加了内边距就只剩几像素放图标。 */
.tab__close, .tab-overflow, .tab-menu__close, .tool, .tab-add { padding: 0; }
.tab:hover .tab__close, .tab.is-active .tab__close { opacity: 1; }
.tab__close:hover { background: rgba(23, 23, 23, .09); color: var(--ink); }

.tabs__tools { display: flex; align-items: center; gap: 1px; flex: none; }

.tool {
  appearance: none;
  border: 0; background: transparent;
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tool:hover { background: rgba(23, 23, 23, .055); color: var(--ink); }
.tool.is-on { background: var(--accent-soft); color: var(--accent); }
.tool svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; }

.pane__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

/* 滚动条 */
.pane__body::-webkit-scrollbar, .rail::-webkit-scrollbar, .rail--right::-webkit-scrollbar, .tree::-webkit-scrollbar { width: 9px; height: 9px; }
.pane__body::-webkit-scrollbar-thumb, .rail::-webkit-scrollbar-thumb, .rail--right::-webkit-scrollbar-thumb, .tree::-webkit-scrollbar-thumb {
  background: rgba(23, 23, 23, .13); border-radius: 99px; border: 3px solid transparent; background-clip: content-box;
}
.pane__body::-webkit-scrollbar-thumb:hover, .tree::-webkit-scrollbar-thumb:hover { background: rgba(23, 23, 23, .25); background-clip: content-box; }
.pane__body::-webkit-scrollbar-track { background: transparent; }

/* ============================== 文档 ============================== */

.doc {
  width: min(var(--content-w, 748px), calc(100% - 72px));
  margin: 0 auto;
  padding: 34px 0 140px;
}
html[data-width="full"] .doc:not(.doc--wide) {
  width: calc(100% - 48px);
}

.crumbs {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.crumbs i { font-style: normal; color: rgba(122, 10, 10, .55); }

.doc__title {
  margin: 12px 0 16px;
  font-family: var(--serif);
  font-size: var(--doc-title-font-size, 32px);
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--ink);
}
.doc--notags .doc__title { margin-bottom: 34px; }

.doc__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--tag-body-gap, 30px); }

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid rgba(122, 10, 10, .12);
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: .02em;
  cursor: pointer;
  text-decoration: none;   /* 阅读端里标签是 <a>，别吃浏览器默认下划线 */
  transition: background .16s, border-color .16s, transform .16s, color .16s;
}
.tag-pill:hover { background: rgba(122, 10, 10, .13); transform: translateY(-1px); }
.tag-pill.is-on { background: var(--accent); border-color: var(--accent); color: #f7f4ea; }
.tag-pill i { font-style: normal; font-size: 9px; opacity: .55; }

.tag-inline {
  padding: 1px 3px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .94em;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;   /* 同上：阅读端的标签是 <a> */
}
/* 正文里的超链接有波浪下划线（.protyle-wysiwyg a[href]:not(...)，特异性很高），
   标签胶囊不该继承它——这里只能上 !important，否则压不住那条规则。 */
.tag-pill[href],
.tag-inline[href],
.protyle-wysiwyg a.tag-inline,
.protyle-wysiwyg a.tag-pill { text-decoration: none !important; }
.tag-inline:hover { background: rgba(122, 10, 10, .14); }

.doc--wide { width: min(1000px, calc(100% - 72px)); }

.tag-head {
  margin-bottom: 26px;
  padding: 6px 0 22px;
  border-bottom: 1px solid var(--line-soft);
}
.tag-title {
  margin: 12px 0 6px;
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
}
.tag-sub {
  margin: 0 0 18px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-3);
}
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

.tag-blocks { margin-top: 36px; }
.tag-blocks__head {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tag-block {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, .35);
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .16s;
}
.tag-block:hover { border-color: rgba(122, 10, 10, .22); background: rgba(255, 255, 255, .62); transform: translateY(-1px); }
.tag-block__doc { font-family: var(--sans); font-size: 9.5px; letter-spacing: .08em; color: var(--ink-3); }
.tag-block__text { display: block; margin-top: 3px; font-size: 13px; line-height: 1.6; color: var(--ink-2); }

/* 内容块：沿用思源类名 */
.protyle-wysiwyg { font-family: var(--serif); font-size: 16px; color: var(--body-color, #171717); }

.protyle-wysiwyg > * { position: relative; scroll-margin-top: 40px; }

.protyle-wysiwyg .p { margin: 0; line-height: 1.5; }
.protyle-wysiwyg .p + .p { margin-top: 0; }

.protyle-wysiwyg strong { color: var(--ink); font-weight: 700; }
.protyle-wysiwyg em { font-style: normal; color: var(--accent); }

.protyle-wysiwyg .h2 {
  margin: 0;
  font-size: 24.5px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
}
.protyle-wysiwyg .h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--ink);
}
.protyle-wysiwyg .h2 + .p, .protyle-wysiwyg .h3 + .p { color: var(--ink-2); }

.protyle-wysiwyg .list {
  margin: 0;
  padding-left: 22px;
  line-height: 1.5;
}
.protyle-wysiwyg .list li { margin: 2px 0; padding-left: 2px; margin-left: calc(var(--level, 0) * 22px); }
.protyle-wysiwyg .list li::marker { color: rgba(122, 10, 10, .55); }
/* 任务列表：勾选状态只读显示（不能点），已完成的照思源加删除线。 */
.protyle-wysiwyg .list--tasks { list-style: none; }
.protyle-wysiwyg .list--tasks > li {
  position: relative;
  list-style: none;
  padding-left: 24px;
  min-height: 1.5em;
}
.protyle-wysiwyg .list--tasks > li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .34em;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(23, 23, 23, .38);
  border-radius: 3px;
  background: transparent;
}
.protyle-wysiwyg .list--tasks > li.is-done::after,
.protyle-wysiwyg .list--tasks > li.is-doing::after,
.protyle-wysiwyg .list--tasks > li.is-canceled::after,
.protyle-wysiwyg .list--tasks > li.is-custom::after {
  content: "";
  position: absolute;
  left: 2px;
  top: .34em;
  width: 12px;
  height: 12px;
  display: grid;
  place-items: center;
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1;
  color: var(--paper-hi, #fff);
}
.protyle-wysiwyg .list--tasks > li.is-done::before { background: var(--accent); border-color: var(--accent); }
.protyle-wysiwyg .list--tasks > li.is-done::after { content: "✓"; }
.protyle-wysiwyg .list--tasks > li.is-doing::after { content: "–"; color: var(--ink-2); }
.protyle-wysiwyg .list--tasks > li.is-canceled::before { border-color: rgba(23, 23, 23, .28); }
.protyle-wysiwyg .list--tasks > li.is-canceled::after { content: "×"; color: var(--ink-3); }
.protyle-wysiwyg .list--tasks > li.is-custom::after { content: attr(data-task-char); color: var(--ink-2); font-size: 9px; }
.protyle-wysiwyg .list--tasks > li.is-done { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.protyle-wysiwyg .list--tasks > li.is-canceled { color: var(--ink-3); }

.protyle-wysiwyg .bq {
  margin: 0;
  padding: 6px 0 6px 18px;
  border-left: 2px solid rgba(122, 10, 10, .35);
  color: #6b6b64;
  font-size: 16.5px;
  line-height: 1.85;
}

.callout {
  --co: #6b7280;
  display: flex;
  gap: 12px;
  margin: 18px 0;
  padding: 13px 16px 14px;
  border-radius: 12px;
  background: rgba(227, 227, 222, .45);
  background: color-mix(in srgb, var(--co) 7%, transparent);
  border: 1px solid rgba(23, 23, 23, .05);
  border-color: color-mix(in srgb, var(--co) 16%, transparent);
  box-shadow: inset 2px 0 0 rgba(23, 23, 23, .08);
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--co) 55%, transparent);
  line-height: 1.8;
  color: var(--ink-2);
}
.callout--tip { --co: #5b7a5c; }
.callout--note { --co: #5c6b7a; }
.callout--warning { --co: #a1783f; }
.callout--important { --co: #7a5680; }
.callout--caution { --co: #a04a40; }

.callout__icon {
  flex: none;
  width: auto;
  min-width: 26px;
  height: 26px;
  margin: 0;
  padding: 0 2px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background .16s, transform .16s;
}
.callout__icon:hover { background: rgba(23, 23, 23, .06); transform: translateY(-1px); }
.callout__icon .emoji-img { width: 18px; height: 18px; object-fit: contain; border-radius: 3px; }
.callout__body { min-width: 0; }
.callout__body .ref { text-decoration-color: rgba(122, 10, 10, .28); }

.widget {
  margin: 20px 0;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, .6);
}
.widget iframe { display: block; width: 100%; border: 0; }

.ref.is-broken {
  color: var(--ink-3);
  text-decoration: underline wavy rgba(160, 74, 64, .45);
  text-underline-offset: 3px;
  cursor: help;
}

/* 同步块 */
.embed { display: block; }
/* 目标是超级块时，嵌入内容由多个子块组成；块间距沿用全站唯一的那一个值。 */
.embed > * + * { margin-top: var(--block-gap, 12px); }
.embed--broken,
.embed--cycle {
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(23, 23, 23, .02);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
}

.protyle-wysiwyg mark {
  padding: 0 2px;
  border-radius: 2px;
  background: rgba(240, 200, 80, .34);
  color: inherit;
}
.protyle-wysiwyg sup,
.protyle-wysiwyg sub { font-size: .74em; line-height: 0; }

/* 键帽（2026-11-07 方案 1）：纸白渐变 + 顶部高光 + 2px 底边。
   position/top 修掉 inline-block + vertical-align:middle 造成的约 2px 下沉（键帽中心对齐行盒中心）。 */
.protyle-wysiwyg kbd {
  display: inline-block;
  padding: 3px 7px;
  margin: 0 1px;
  font-family: inherit;
  font-size: 82%;
  font-variant-emoji: text;
  line-height: 1.15;
  color: var(--ink-2);
  vertical-align: middle;
  position: relative;
  top: -0.16em;
  background: linear-gradient(180deg, #fffefb, #f4f1e9);
  border: 1px solid rgba(23, 23, 23, .12);
  border-bottom: 2px solid rgba(23, 23, 23, .16);
  border-radius: 5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

/* 行内备注：正文保留；备注正文始终隐藏，只作为内容来源。
   浮层用 body 下的 .memo-tip（position: fixed）显示 —— 表格外层
   .table-wrap 是 overflow: auto，absolute 浮层会被它裁掉（踩坑 P38）。 */
.inline-memo {
  position: relative;
  padding: 0 1px;
  background: rgba(0, 85, 153, .09);
  border-bottom: 2px solid rgba(0, 85, 153, .38);
  cursor: help;
}
.inline-memo__note { display: none !important; }
/* 备注浮层：挂在 body 下、fixed 定位，不受任何祖先 overflow 裁剪。
   位置由 studio.js#installInlineMemoTips() 按备注元素的位置实时计算。 */
.memo-tip {
  position: fixed;
  z-index: 86;
  display: none;
  width: max-content;
  max-width: min(360px, calc(100vw - 24px));
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-hi, #fff);
  box-shadow: 0 10px 28px rgba(23, 23, 23, .14);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
  pointer-events: none;
}
.memo-tip.is-on { display: block; }
.memo-tip > :first-child { margin-top: 0; }
.memo-tip > :last-child { margin-bottom: 0; }
@media print { .memo-tip { display: none !important; } }

/* PDF 批注引用：只保留文字，标一个不能跳转的提示。 */
.file-annotation-ref {
  border-bottom: 1px dashed rgba(122, 10, 10, .38);
  cursor: help;
}

.code-block {
  position: relative;
  margin: 20px 0;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(23, 23, 23, .035);
  overflow: hidden;
}.code-block__lang {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 0;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.code-copy {
  margin-left: auto;
  padding: 2px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
.code-copy:hover { border-color: rgba(122, 10, 10, .3); color: var(--accent); }
.code-block pre { margin: 0; padding: 10px 16px 18px; overflow-x: auto; }
.code-block code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  color: #3d3d38;
  white-space: pre;
}
.tok-com { color: #9b9b92; font-style: italic; }
.tok-str { color: #8a4b2f; }
.tok-key { color: #7a0a0a; font-weight: 600; }
.tok-num { color: #4f6b53; }

.protyle-wysiwyg :not(pre) > code {
  font-family: var(--mono);
  font-size: 13.2px;
  background: rgba(23, 23, 23, .06);
  border-radius: 5px;
  padding: 1px 5px;
  color: #3d3d38;
}

.table-wrap { margin: 20px 0; overflow-x: auto; }
.protyle-wysiwyg table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.protyle-wysiwyg thead th {
  padding: 0 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.protyle-wysiwyg tbody td { padding: 10px; border-bottom: 1px solid var(--line-soft); color: var(--ink-2); }
.protyle-wysiwyg tbody tr:hover td { background: rgba(23, 23, 23, .02); }

/* 图注要「跟着图片」：figure 收成图片那么宽，居中排版才有意义。
   用户 2026-11-12：「这个文字，我希望一直跟在图片下面，在图片下面居中显示」——
   以前 figure 是整栏宽（750），图只有 262 时，图注虽然在 figure 内居中，
   但相对「图片」是偏到右边的。现在 figure 用 fit-content，图注中心 = 图片中心。 */
.figure:not(.figure--empty) {
  width: fit-content;
  max-width: 100%;
}
.figure { margin: 26px 0; }
/* 图片宽度（2026-11-11 用户：按思源画布里的尺寸显示，不要每张都整屏宽）：
   有 block.width 时行内写 width:Npx（思源里拖出来的那个值）；
   没有就按**原始像素**显示，只在超过正文宽度时才缩下来。
   —— 所以小图（比如 300px 宽的示意图）保持 300px，不会被拉成整行。 */
.figure img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--paper-hi);
}
/* SVG 多数是透明底的导出图（draw.io / 架构图）。
   用户 2026-11-11：「svg图片背景要是白色」——白底，避免线条直接压在纸色 / 暗色上看不清。
   PNG / WebP 照片有自己的一层底，保持纸色不刺眼。 */
.figure .figure__img--svg {
  background: #ffffff;
}
/* 2026-11-12 用户：「这种SVG图，我希望它是变成默认的白背景」——
   不只正文里那一种写法的图，**任何**指向 .svg 的 <img> 都默认白底：
   灯箱里那张大图、媒体库预览、HTML 块里的图、卡片里的图……全都盖住。
   用属性选择器兜住没加 class 的地方（灯箱的图是运行时换 src 的，没有 class）。
   排除三样：emoji 小图标（本来就是透明的小图，加了白底会变成白方块）、
   封面大图与卡片封面（满幅裁切，白底会露出边）。 */
img[src$=".svg" i]:not(.twemoji):not(.cover__img):not(.card__cover-img),
img[src*=".svg?" i]:not(.twemoji):not(.cover__img):not(.card__cover-img) {
  background-color: #ffffff;
}
.figure figcaption {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .03em;
  color: var(--ink-3);
  text-align: center;
}

/* 行内图片：列表项 / 表格单元格 / 提示块里保留原位，不撑破容器。 */
.inline-img {
  display: inline-block;
  max-width: 100%;
  max-height: 320px;
  margin: 2px 1px;
  vertical-align: middle;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
  background: var(--paper-hi);
  cursor: zoom-in;
}
/* 行内 SVG 也是透明底：白底，和块级 SVG 同一口径 */
.inline-img.inline-img--svg { background: #ffffff; }
.protyle-wysiwyg td .inline-img,
.protyle-wysiwyg th .inline-img { max-height: 220px; }
.protyle-wysiwyg .list .inline-img { max-height: 180px; }

/* 公式：KaTeX 在导入时已经渲染成 HTML，这里只管排版。
   KaTeX 的 CSS 只在有公式的页面加载（工作台常驻）。 */
.math-inline { display: inline-block; max-width: 100%; vertical-align: middle; }
.math-inline .katex { font-size: 1.05em; }
.math-inline--raw { font-family: var(--mono); font-size: .92em; color: var(--ink-2); }
.math-block {
  margin: var(--block-gap, 12px) 0;
  overflow-x: auto;
  text-align: center;
}
.math-block .katex-display { margin: 0; }
.math-block .katex { font-size: 1.08em; }

/* HTML 块：沙箱 iframe，像内嵌网页；高度由 iframe 里的脚本回报。 */
.html-block { margin: var(--block-gap, 12px) 0; }
.html-block__frame {
  display: block;
  width: 100%;
  height: 420px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--paper-hi, #fff);
}

/* 嵌入网页（思源 NodeIFrame）：整块照原样嵌进来，宽度跟正文一致；
   高度用块里记的那一个（思源自己也是把高度记在块上）。
   兜底链接「打不开？打开原网页」默认隐藏，只有判定真的打不开时才显示（见下方 .is-failed）。 */
.iframe-block { margin: var(--block-gap, 12px) 0; }
.iframe-block__frame {
  display: block;
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--paper-hi, #fff);
}
.iframe-block__open {
  display: none;
  margin-top: 5px;
  color: var(--ink-3);
  font-family: var(--ui-serif, var(--sans));
  font-size: 12px;
  text-decoration: none;
  transition: color .15s;
}
/* 只有「真的打不开」时才露出来（判定见 studio.js#installIframeBlocks）：
   派发 error / 10 秒没 load / 同源被 XFO·CSP 拦下。平时这条链接不占位、不打扰阅读。 */
.iframe-block.is-failed .iframe-block__open { display: inline-block; }
.iframe-block__open:hover { color: var(--accent); text-decoration: underline; }
.iframe-block--empty {
  padding: 14px 16px;
  border: 1px dashed var(--line-soft);
  border-radius: 10px;
  color: var(--ink-3);
  font-size: 12.5px;
}
/* 打印：iframe 不会真正打印出内容，只留兜底链接，免得留一块空白。 */
@media print {
  .iframe-block__frame { display: none; }
}

.protyle-wysiwyg .hr { height: 1px; margin: 0; background: var(--line-soft); border: 0; }

.ref {
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(122, 10, 10, .32);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  border-radius: 3px;
  transition: color .15s, background .15s, text-decoration-color .15s;
}
.ref:hover { color: var(--accent); background: var(--accent-soft); text-decoration-color: var(--accent); }
.ref.is-broken,
.ref.is-broken:hover {
  color: var(--ink-3);
  text-decoration: underline wavy rgba(160, 74, 64, .45);
  cursor: not-allowed;
  background: transparent;
}
.block-hyperlink,
.protyle-wysiwyg a[href^="siyuan://blocks/"] {
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(122, 10, 10, .32);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  border-radius: 3px;
  transition: color .15s, background .15s, text-decoration-color .15s;
}
.block-hyperlink:hover,
.protyle-wysiwyg a[href^="siyuan://blocks/"]:hover {
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration-color: var(--accent);
}
.block-hyperlink.is-broken {
  color: var(--ink-3);
  text-decoration: underline wavy rgba(160, 74, 64, .45);
  cursor: not-allowed;
  background: transparent;
}

/* 文末反链 / 未链接提及（默认折叠） */
.doc-backlinks {
  margin-top: 64px;
  padding-top: 4px;
  border-top: 1px solid var(--line-soft);
}
.doc-backlinks__head {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  margin: 20px 0 8px;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.doc-backlinks__head::-webkit-details-marker { display: none; }
.doc-backlinks__head::after {
  content: "›";
  margin-left: auto;
  font-size: 13px;
  letter-spacing: 0;
  transition: transform .18s ease;
}
.doc-backlinks[open] .doc-backlinks__head::after { transform: rotate(90deg); }
.doc-backlinks__head:hover { color: var(--ink-2); }
.doc-backlinks__head b { font-weight: 500; color: var(--ink-2); }
.doc-backlinks__body { margin-top: 4px; }
.doc-backlinks__label {
  margin: 14px 0 6px;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.backlink {
  display: block;
  margin-bottom: 5px;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, .32);
  text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}
.backlink:hover {
  border-color: rgba(122, 10, 10, .2);
  background: rgba(255, 255, 255, .62);
  transform: translateY(-1px);
}
.backlink__kicker {
  display: block;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: .06em;
  color: var(--accent);
}
.backlink__text {
  display: block;
  margin-top: 2px;
  font-size: 12.8px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* 块链接按钮（hover 出现） */
.block-link {
  position: absolute;
  left: -26px;
  top: 2px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s, color .15s;
}
.protyle-wysiwyg > *:hover > .block-link { opacity: .55; }
.block-link:hover { opacity: 1; background: rgba(23, 23, 23, .06); color: var(--accent); }
.block-link[data-ref-count]:not([data-ref-count="0"])::after {
  content: attr(data-ref-count);
  position: absolute;
  top: -5px; right: -5px;
  min-width: 10px; height: 10px;
  padding: 0 2px;
  border-radius: 99px;
  background: var(--accent);
  color: #f7f4ea;
  font-family: var(--sans);
  font-size: 7px;
  line-height: 10px;
  text-align: center;
}
@media (hover: none) { .block-link { display: none; } }

/* 引用块（transclusion） */
.block-ref {
  margin: 24px 0;
  padding: 10px 16px 14px;
  border-left: 2px solid rgba(122, 10, 10, .3);
  border-radius: 0 10px 10px 0;
  background: rgba(23, 23, 23, .022);
}
.block-ref__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.block-ref__source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  cursor: pointer;
}
.block-ref__source span { opacity: .45; }
.block-ref__source:hover { text-decoration: underline; text-underline-offset: 3px; }
.block-ref__body > .p { margin: 0; }
.block-ref__body .h2 { margin: 0; font-size: 19px; }
.block-ref__body .h3 { margin: 0; font-size: 17px; }
.block-ref__body .callout { margin: 0; }
.block-ref__body .block-link { display: none; }

.muted { color: var(--ink-3); font-size: 14px; }

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.2;
  color: var(--ink-2);
  vertical-align: middle;
  position: relative;
  top: -0.08em;
  background: linear-gradient(180deg, #fffefb, #f4f1e9);
  border: 1px solid rgba(23, 23, 23, .12);
  border-bottom: 2px solid rgba(23, 23, 23, .16);
  border-radius: 5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

/* 块定位闪光 */
.is-flash { animation: flash 1.8s ease-out both; }
@keyframes flash {
  0% { background: rgba(122, 10, 10, .11); box-shadow: inset 2px 0 0 var(--accent); }
  60% { background: rgba(122, 10, 10, .05); box-shadow: inset 2px 0 0 rgba(122, 10, 10, .35); }
  100% { background: transparent; box-shadow: inset 2px 0 0 transparent; }
}

/* 空面板 */
.empty {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 40px;
  text-align: center;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-3);
}
.empty__list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 360px; }
.empty__list button {
  border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .5);
  border-radius: 99px; padding: 6px 12px;
  font-family: inherit; font-size: 12.5px; color: var(--ink-2); cursor: pointer;
}
.empty__list button:hover { border-color: rgba(122, 10, 10, .3); color: var(--accent); }

/* ============================== 关系栏 ============================== */

.rail__title {
  font-family: var(--sans);
  font-size: 9.5px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 6px;
}

.rel-group + .rel-group { margin-top: 26px; }
/* 每组可折叠（<details>）：标题行就是 summary，右边一个小箭头 */
.rel-group > summary { list-style: none; cursor: pointer; user-select: none; }
.rel-group > summary::-webkit-details-marker { display: none; }
.rel-group__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin: 22px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--sans);
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
}
.rel-group__head::after {
  content: "›";
  margin-left: 6px;
  font-size: 13px;
  letter-spacing: 0;
  transition: transform .18s ease;
}
.rel-group[open] > summary .rel-group__head::after { transform: rotate(90deg); }
.rel-group > summary:hover .rel-group__head { color: var(--ink-2); }
.rel-group__body { padding-top: 2px; }
.rel-group__head b { font-weight: 500; color: var(--ink-2); letter-spacing: 0; text-transform: none; font-size: 11px; }

.rel-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 10px;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 9px;
  margin-bottom: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, .34);
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
}
.rel-item:hover {
  border-color: rgba(122, 10, 10, .22);
  background: rgba(255, 255, 255, .66);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -16px rgba(23, 23, 23, .5);
}
.rel-item__thumb {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  /* 同样按 CJK 墨迹调：字号按方块缩，line-height 1 + 1px 补偿，见 .tree__glyph 的注释 */
  font-size: 13px;
  line-height: 1;
  padding-top: 1px;
  color: rgba(255, 255, 255, .9);
  background: linear-gradient(135deg, var(--c1), var(--c2));
  overflow: hidden;
}
.rel-item__thumb--plain { background: rgba(23, 23, 23, .05); color: var(--ink-3); }
.rel-item__main { min-width: 0; }
.rel-item__kicker { display: block; font-family: var(--sans); font-size: 9.5px; letter-spacing: .08em; color: var(--ink-3); }
.rel-item__text {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
  font-size: 12.6px; line-height: 1.55; color: var(--ink-2);
}
.rel-item__arrow { color: var(--ink-3); font-size: 14px; opacity: 0; transform: translateX(-2px); transition: opacity .18s, transform .18s; }
.rel-item:hover .rel-item__arrow { opacity: 1; transform: none; color: var(--accent); }
.rel-empty { font-family: var(--sans); font-size: 11.5px; color: var(--ink-3); padding: 8px 2px; }

/* 空状态：没有任何可显示的页面时（不再有「全部文档」卡片墙） */
.empty-state { padding: 84px 0 120px; text-align: center; }
.empty-state__title { font-size: 18px; font-weight: 600; color: var(--ink); letter-spacing: .01em; }
.empty-state__hint { margin-top: 10px; font-family: var(--sans); font-size: 12px; color: var(--ink-3); }

/* ============================== 悬浮预览 ============================== */

.preview {
  position: fixed;
  z-index: 60;
  width: 348px;
  max-height: 62vh;
  overflow: hidden;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fdfcf8;
  box-shadow: 0 22px 60px -24px rgba(23, 23, 23, .45), 0 2px 8px rgba(23, 23, 23, .06);
  font-size: 13.6px;
  line-height: 1.75;
  color: #46463f;
  animation: pvIn .14s ease both;
}
@keyframes pvIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.preview__head {
  display: flex; justify-content: space-between; gap: 10px;
  margin-bottom: 8px;
  font-family: var(--sans);
  font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
}
.preview__title { font-weight: 500; color: var(--ink); letter-spacing: 0; text-transform: none; font-size: 11.5px; }
.preview__body p { margin: 0 0 6px; }
.preview__body .callout, .preview__body .bq { margin: 6px 0; padding: 8px 10px; }
.preview__body .code-block { margin: 6px 0; }
.preview__body .figure { display: none; }

/* 提示（工作台 / 站点共用这一份：toast 文案是两端都会弹的）
   bottom 44px：抬到「已定位到」提示（82px）之下留 8px 间隙，
   两条同时出现时不叠；手机上再抬一档避开手势条。 */
.toast {
  position: fixed;
  left: 50%; bottom: 44px;
  transform: translateX(-50%);
  z-index: 80;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(251, 250, 246, .94);
  backdrop-filter: blur(6px);
  box-shadow: 0 12px 30px -16px rgba(23, 23, 23, .35);
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--ink-2);
  animation: pvIn .2s ease both;
}
.toast b { font-weight: 600; color: var(--accent); }
.toast button { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 13px; }
@media (max-width: 900px) {
  .toast { bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
}

/* ============================== 封面 / 索引 / 动效 ============================== */

.cover--clay { --c1: #a97355; --c2: #c8a488; --c3: #e9d8c4; }
.cover--sage { --c1: #6d7d64; --c2: #a7b29a; --c3: #dfe3d2; }
.cover--ink  { --c1: #23262b; --c2: #434850; --c3: #7d828b; }
.cover--sand { --c1: #a3854f; --c2: #cbb98d; --c3: #eee2c8; }

/* 文档封面 */
.cover {
  position: relative;
  height: calc(var(--cover-vh, 26) * 1vh);
  overflow: hidden;
  background:
    radial-gradient(90% 120% at 16% 6%, rgba(255, 255, 255, .34), transparent 54%),
    radial-gradient(72% 120% at 88% 104%, rgba(20, 20, 20, .22), transparent 62%),
    linear-gradient(112deg, var(--c1) 0%, var(--c2) 58%, var(--c3) 128%);
  box-shadow: inset 0 -1px 0 rgba(23, 23, 23, .12);
  animation: coverIn .7s cubic-bezier(.2, .8, .2, 1) both;
}
.cover__img, .hero__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.cover--image::after, .hero--image::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(18, 18, 18, .42), rgba(18, 18, 18, 0) 58%);
  pointer-events: none;
}
.cover--image .cover__glyph { display: none; }

/* Hero 式页面封面 */
.cover--hero {
  display: flex;
  align-items: flex-end;
  height: auto;
  min-height: calc(var(--cover-vh, 26) * 1vh);
}
.cover--hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(12, 12, 12, .55), rgba(12, 12, 12, 0) 62%);
  pointer-events: none;
}
.cover__hero {
  position: relative;
  z-index: 3;
  min-width: 0;
  max-width: 900px;
  padding: 56px 56px 42px;
  overflow-wrap: anywhere;
}
.cover__hero-kicker {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(248, 245, 236, .62);
}
.cover__hero-title {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #f8f5ec;
}
.cover__hero-sub {
  max-width: 640px;
  margin: 14px 0 26px;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.85;
  color: rgba(248, 245, 236, .72);
}
.cover__hero-cta { margin-top: 2px; }
.cover__hero-art {
  position: absolute;
  right: -10px;
  bottom: -90px;
  z-index: 1;
  font-size: 300px;
  line-height: 1;
  font-weight: 700;
  color: rgba(247, 244, 234, .06);
  user-select: none;
  pointer-events: none;
}
.cover__hero-art .twemoji { width: 1em; height: 1em; opacity: .15; }
.doc--hero { padding-top: 26px; }
.cover::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .14) 0 1px, transparent 1px 72px);
  opacity: .45;
}
.cover__grain, .hero__grain, .card__cover::before {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: .3;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.cover__glyph {
  position: absolute;
  right: 30px; bottom: -54px;
  font-size: 200px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.05em;
  color: rgba(255, 255, 255, .2);
  user-select: none;
}
.cover__glyph--emoji { font-size: 124px; bottom: 6px; opacity: .9; }

/* ===== 纸面封面（2026-11-11 用户选定）=====
   叠纸卡 / 票根 / 剪报 / 明信片 / 档案袋 / 线装书。
   这些样式全部走 --cv-* 变量：纸色、文字色、强调色、标题/摘要/眉标字号
   都由工作台「封面设置」写入 look，正文与站点共用同一份。 */
.cover--paper {
  background: var(--cv-paper, #f3eddd);
  color: var(--cv-ink, #171717);
}
.cover--paper::before { display: none; }
.cover--paper .cover__crumb {
  top: 12px; left: 14px;
  max-width: 62%;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  color: var(--cv-ink, #171717);
  opacity: .5;
  font-size: 9.5px;
}
.cover--paper .cover__crumb .crumb-link:hover { color: var(--cv-accent, #7a0a0a); }
.cover--paper .cover__crumb i { color: rgba(23, 23, 23, .3); }
.cover--paper .cover__kicker {
  font-family: var(--sans);
  font-size: var(--cv-kicker-size, clamp(7px, calc(var(--cover-vh, 26) * 1vh * .033), 11px));
  line-height: 1.4;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: inherit;
  opacity: .58;
}
.cover--paper .cover__title {
  margin: 0;
  font-family: var(--cv-title-font, var(--serif));
  font-size: var(--cv-title-size, clamp(19px, calc(var(--cover-vh, 26) * 1vh * .13), 46px));
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -.025em;
  color: inherit;
  overflow-wrap: anywhere;
}
.cover--paper .cover__sub {
  margin: 0;
  font-family: var(--cv-sub-font, var(--serif));
  font-size: var(--cv-sub-size, clamp(9px, calc(var(--cover-vh, 26) * 1vh * .045), 15px));
  line-height: 1.7;
  color: inherit;
  opacity: .68;
  overflow-wrap: anywhere;
}
.cover--paper .doc__tags { margin: 0; gap: 5px; }
/* 标签胶囊的样子可切：线框（默认）/ 实心 / 方角 / 纯文字 */
.cover--paper .tag-pill {
  background: var(--cv-tag-bg, transparent);
  border: var(--cv-tag-border, 1px solid currentColor);
  border-radius: var(--cv-tag-radius, 99px);
  color: inherit;
  opacity: .58;
  font-size: clamp(7px, calc(var(--cover-vh, 26) * 1vh * .032), 10px);
  padding: 2px 7px;
}
.cover--paper .tag-pill:hover { background: rgba(23, 23, 23, .06); opacity: .9; }
.cover--paper [data-hero-edit] { outline: none; }
.cover--paper [data-hero-edit]:empty::before { content: attr(data-placeholder); opacity: .38; }
/* 16A 叠纸卡（照片在右、比纸卡小） */
.cover--collage {
  background:
    radial-gradient(90% 120% at 10% 0%, rgba(255, 255, 255, .45), transparent 58%),
    var(--cv-paper, #e7ddca);
}
.cover__collage-card {
  position: absolute;
  left: 6%; top: 14%; width: 58%; height: 70%;
  z-index: 2;
  display: flex; flex-direction: column; justify-content: center;
  gap: 2%;
  padding: 3% 3.4%;
  background: #fbfaf6;
  box-shadow: 0 18px 38px -26px rgba(23, 23, 23, .5);
  transform: rotate(calc(-1.5deg + var(--cv-tilt, 0deg)));
}
.cover__collage-card::before {
  content: ""; position: absolute; top: -7px; left: 50%;
  width: 54px; height: 14px;
  background: rgba(255, 255, 255, .5);
  box-shadow: 0 1px 3px rgba(23, 23, 23, .1);
  transform: translateX(-50%) rotate(calc(-2deg + var(--cv-tilt, 0deg)));
}
.cover__collage-card.is-no-tape::before { display: none; }
.cover__collage-photo {
  position: absolute;
  right: 3.5%; top: 8%; width: 28%; height: 62%;
  z-index: 1;
  margin: 0;
  padding: 6px 6px 22px;
  background: #fffdf8;
  box-shadow: 0 22px 44px -28px rgba(23, 23, 23, .55);
  transform: rotate(calc(4deg + var(--cv-tilt, 0deg)));
}
.cover__collage-photo img { width: 100%; height: 100%; object-fit: var(--cv-photo-fit, cover); }
.cover__collage-photo figcaption {
  position: absolute; left: 6px; right: 6px; bottom: 4px;
  text-align: center;
  font-family: var(--cv-small-font, var(--mono));
  font-size: var(--cv-caption-size, 8px); line-height: 1.3; letter-spacing: .1em;
  color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cover--collage.is-solo .cover__collage-card { left: 14%; width: 72%; }
.cover--collage.is-solo .cover__collage-photo { display: none; }

/* 23 票根 */
.cover--ticket {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(92px, 22%, 168px);
}
.cover__ticket-main {
  position: relative;
  display: flex; flex-direction: column; justify-content: center;
  gap: 2%;
  min-width: 0;
  padding: 40px 4% 4% 5%;
}
.cover__ticket-stub {
  position: relative;
  margin: 6% 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
  background: rgba(163, 133, 79, .1);
  border-left: 2px dashed rgba(23, 23, 23, .25);
}
.cover--ticket::before, .cover--ticket::after {
  content: "";
  position: absolute; z-index: 5;
  display: block;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--paper, #f2f2ef);
  right: calc(clamp(92px, 22%, 168px) - 7px);
}
.cover--ticket::before { top: -7px; }
.cover--ticket::after { bottom: -7px; }
.cover__ticket-no {
  font-family: var(--mono);
  font-size: var(--cv-no-size, clamp(22px, calc(var(--cover-vh, 26) * 1vh * .2), 58px));
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.05em;
  color: inherit;
}
.cover__ticket-label, .cover__ticket-year {
  font-family: var(--sans);
  font-size: var(--cv-small-size, clamp(6px, calc(var(--cover-vh, 26) * 1vh * .026), 9px));
  line-height: 1.3;
  letter-spacing: .14em;
  text-align: center;
  opacity: .55;
}
.cover__barcode {
  width: 72%; height: clamp(16px, calc(var(--cover-vh, 26) * 1vh * .1), 34px);
  background: repeating-linear-gradient(90deg,
    currentColor 0 2px, transparent 2px 4px,
    currentColor 4px 7px, transparent 7px 9px,
    currentColor 9px 10px, transparent 10px 15px);
  opacity: .62;
}

/* 25 剪报 */
.cover--news { display: flex; flex-direction: column; padding: 40px 4% 2.6%; }
.cover__news-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-bottom: 4px;
  border-bottom: 2px solid currentColor;
}
.cover__news-mast {
  font-family: var(--serif);
  font-size: var(--cv-mast-size, clamp(12px, calc(var(--cover-vh, 26) * 1vh * .06), 19px));
  letter-spacing: .2em;
  line-height: 1.2;
}
.cover__news-date {
  font-family: var(--mono);
  font-size: var(--cv-small-size, clamp(6px, calc(var(--cover-vh, 26) * 1vh * .026), 9px));
  letter-spacing: .1em;
  opacity: .5;
  white-space: nowrap;
}
.cover--news .cover__title { margin-top: .7%; font-size: var(--cv-title-size, clamp(23px, calc(var(--cover-vh, 26) * 1vh * .13), 46px)); }
.cover__news-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: .55%; padding-bottom: .5%;
  border-bottom: 1px solid rgba(23, 23, 23, .2);
  font-family: var(--sans);
  font-size: var(--cv-small-size, clamp(6px, calc(var(--cover-vh, 26) * 1vh * .028), 9.5px));
  letter-spacing: .1em;
  opacity: .65;
}
.cover--news .doc__tags { gap: 5px; }
.cover__news-body {
  display: flex;
  align-items: stretch;
  gap: clamp(10px, 2vw, 22px);
  flex: 1 1 0;
  min-height: 44px;                       /* 封面很矮时照片也有个像样的高度 */
  margin-top: .9%;
  margin-bottom: clamp(6px, 1.2%, 14px);   /* 和底部那条线留一口气，照片不会贴到线上 */
  overflow: hidden;                       /* 最后一道保险：再高的图也画不到这条线以下 */
  container-type: inline-size;            /* 让照片能按「这一行的宽度」给自己封顶 */
}
.cover__news-body.is-solo { flex-direction: column; }
.cover__news-lines {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 34px;
  background-image: repeating-linear-gradient(0deg,
    rgba(23, 23, 23, .16) 0 1px, transparent 1px var(--cv-line-gap, 8px));
  opacity: .85;
}
.cover__news-photo {
  position: relative;
  flex: 0 0 auto;
  align-self: center;                     /* 照片在正文行里居中 */
  /* 高度 = min(整行高度, 行宽的 55% 换算成比例高度)。
     比例来自 --cv-photo-ratio-n（设置里可切换 16:9 / 4:3 / 3:2 / 1:1），
     所以照片永远撑满行高、又不会被行宽挤扁。 */
  height: min(100%, calc(100cqw * 0.55 * 16 / 9 / var(--cv-photo-ratio-n, 1.7778)));
  width: auto;                            /* 宽度由比例 + 高度算出来，图跟着一起放大 */
  aspect-ratio: var(--cv-photo-ratio, 16 / 9);
  margin: 0;
  padding: 3px;
  border: 1px solid rgba(23, 23, 23, .28);
  background: #fffdf8;
  overflow: hidden;
}
.cover__news-photo img { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: var(--cv-photo-fit, cover) var(--cv-photo-pos, center); filter: grayscale(1) contrast(1.05); }
/* 图注压在图的下沿（半透明白带），照片再扁也不会被挤掉 */
.cover__news-photo figcaption {
  position: absolute; left: 3px; right: 3px; bottom: 3px; z-index: 2;
  padding: 2px 4px 1px;
  background: rgba(255, 253, 248, .88);
  font: 7px/1.35 var(--sans); letter-spacing: .05em;
  color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 三张封面照片的图注都能点着改（和标题 / 摘要同一套）：留出光标、悬停提亮一层 */
.cover__collage-photo figcaption,
.cover__news-photo figcaption,
.cover__post-photo figcaption { cursor: text; outline: none; }
.cover__collage-photo figcaption:hover,
.cover__news-photo figcaption:hover,
.cover__post-photo figcaption:hover { color: var(--ink-2); background: rgba(255, 253, 248, .96); }
.cover__news-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: auto;              /* 贴在封面底部，图片再高也不会被线压到 */
  padding-top: 1%;
  border-top: 1px solid currentColor;
  font-family: var(--sans);
  font-size: var(--cv-small-size, clamp(6px, calc(var(--cover-vh, 26) * 1vh * .026), 9px));
  letter-spacing: .1em;
  opacity: .55;
}

/* 26 明信片 */
.cover--postcard { display: grid; grid-template-columns: 42% minmax(0, 1fr); }
.cover__post-photo {
  position: relative;
  margin: 15% 0 5% 5%;
  padding: 7px 7px 24px;
  background: #fffdf8;
  box-shadow: 0 16px 32px -26px rgba(23, 23, 23, .55);
  transform: rotate(calc(-1.2deg + var(--cv-tilt, 0deg)));
}
.cover__post-photo img { width: 100%; height: 100%; object-fit: var(--cv-photo-fit, cover); }
.cover__post-photo figcaption {
  position: absolute; left: 7px; right: 7px; bottom: 4px;
  text-align: center;
  font-family: var(--cv-small-font, var(--mono));
  font-size: var(--cv-caption-size, 8px); line-height: 1.3; letter-spacing: .08em;
  color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cover__post-body {
  position: relative;
  display: flex; flex-direction: column; justify-content: center;
  gap: 2%;
  min-width: 0;
  padding: 5% 5% 5% 4%;
}
.cover__stamp {
  position: absolute; right: 5%; top: 6%;
  width: clamp(28px, calc(var(--cover-vh, 26) * 1vh * .17), 54px);
  aspect-ratio: 4 / 5;
  display: grid; place-items: center;
  border: 1px solid rgba(23, 23, 23, .2);
  background: rgba(122, 10, 10, .06);
  transform: rotate(2deg);
}
.cover__stamp::before {
  content: ""; position: absolute; inset: 4px;
  border: 1px dashed rgba(23, 23, 23, .28);
}
.cover__stamp b {
  font-family: var(--serif);
  font-size: clamp(14px, calc(var(--cover-vh, 26) * 1vh * .1), 26px);
  color: var(--cv-accent, #7a0a0a);
  opacity: .7;
}
.cover__post-lines {
  position: absolute; right: 6%; bottom: 7%;
  width: 28%;
  display: flex; flex-direction: column; gap: 5px;
  opacity: .4;
}
.cover__post-lines i { display: block; height: 1px; background: rgba(23, 23, 23, .5); }
.cover--postcard.is-solo { grid-template-columns: minmax(0, 1fr); }
.cover--postcard.is-solo .cover__post-photo { display: none; }
.cover--postcard.is-solo .cover__post-body { padding-right: 18%; }

/* 27 档案袋 */
.cover--folder { background: var(--cv-paper, #cdb68f); }
.cover__folder-flap {
  position: absolute; top: 0; left: 0; right: 0; height: 38%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(23, 23, 23, .05));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.cover__folder-button {
  position: absolute; left: 50%; top: calc(38% - 7px); z-index: 4;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #c9b28a;
  border: 1px solid rgba(23, 23, 23, .3);
  transform: translateX(-50%);
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .18);
}
.cover__folder-string {
  position: absolute; left: 50%; top: calc(38% + 5px); z-index: 3;
  width: 34px; height: 17px;
  border: 1.5px solid var(--cv-accent, #7a0a0a);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  transform: translateX(-50%);
  opacity: .45;
}
.cover__folder-meta {
  position: absolute; left: 5%; top: 36px;
  font-family: var(--sans);
  font-size: var(--cv-small-size, clamp(6px, calc(var(--cover-vh, 26) * 1vh * .027), 9px));
  letter-spacing: .16em;
  opacity: .45;
}
.cover__folder-label {
  position: absolute; left: 5%; bottom: 8%; z-index: 2;
  width: var(--cv-label-width, min(58%, 560px));
  padding: 2.6% 3%;
  background: #fbf7ec;
  transform: rotate(calc(-1.2deg + var(--cv-tilt, 0deg)));
  box-shadow: 0 18px 36px -26px rgba(23, 23, 23, .55);
}
.cover--folder .cover__title { margin-top: 1.6%; }
.cover--folder .cover__sub { margin-top: 1.4%; }
.cover--folder .doc__tags { margin-top: 1.8%; }
.cover__folder-stamp {
  position: absolute; right: 6%; bottom: 11%;
  width: var(--cv-stamp-size, clamp(46px, calc(var(--cover-vh, 26) * 1vh * .24), 84px));
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  border: 2px solid var(--cv-accent, #7a0a0a);
  color: var(--cv-accent, #7a0a0a);
  transform: rotate(calc(-6deg + var(--cv-stamp-tilt, 0deg)));
  opacity: .55;
}
.cover__folder-stamp b {
  font-family: var(--cv-no-font, var(--mono));
  font-size: var(--cv-no-size, clamp(13px, calc(var(--cover-vh, 26) * 1vh * .09), 26px));
  line-height: 1;
}
.cover__folder-stamp span {
  font-family: var(--cv-small-font, var(--sans));
  font-size: var(--cv-small-size, clamp(6px, calc(var(--cover-vh, 26) * 1vh * .027), 9px));
  letter-spacing: .18em;
}

/* 28 线装书 */
.cover--thread { background: var(--cv-paper, #efe7d4); }
.cover__thread-stitch {
  position: absolute; left: 3.5%; top: 18%; bottom: 18%;
  width: 10px;
}
.cover__thread-stitch::before {
  content: ""; position: absolute; left: 4px; top: 0; bottom: 0;
  width: 1px; background: rgba(23, 23, 23, .22);
}
.cover__thread-stitch i {
  position: absolute; left: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #e7dcc4;
  border: 1px solid rgba(23, 23, 23, .38);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, .7);
}
.cover__thread-stitch i:nth-child(1) { top: -4px; }
.cover__thread-stitch i:nth-child(2) { top: 33%; }
.cover__thread-stitch i:nth-child(3) { top: 66%; }
.cover__thread-stitch i:nth-child(4) { bottom: -4px; }
.cover__thread-body {
  position: absolute; left: 11%; right: 9%; top: 50%;
  transform: translateY(-50%);
  min-width: 0;
}
.cover--thread .cover__title { margin-top: 1.8%; }
.cover--thread .cover__sub { margin-top: 1.8%; max-width: 92%; }
.cover--thread .doc__tags { margin-top: 2.4%; }
.cover__thread-no {
  position: absolute; top: 5%; right: 4%;
  font-family: var(--mono);
  font-size: var(--cv-small-size, clamp(6px, calc(var(--cover-vh, 26) * 1vh * .027), 9px));
  letter-spacing: .12em;
  opacity: .5;
}
.cover__thread-seal {
  position: absolute; right: 4.5%; bottom: 9%;
  width: var(--cv-stamp-size, clamp(34px, calc(var(--cover-vh, 26) * 1vh * .18), 62px));
  aspect-ratio: 1;
  display: grid; place-items: center;
  border: 2px solid var(--cv-accent, #7a0a0a);
  color: var(--cv-accent, #7a0a0a);
  font-family: var(--cv-small-font, var(--serif));
  font-size: clamp(11px, calc(var(--cover-vh, 26) * 1vh * .055), 18px);
  line-height: 1.12;
  text-align: center;
  transform: rotate(calc(-4deg + var(--cv-stamp-tilt, 0deg)));
  opacity: .62;
}

/* 索引页封面 */
.hero {
  position: relative;
  min-height: clamp(240px, calc(var(--cover-vh, 36) * 1vh), 82vh);
  display: flex;
  align-items: flex-end;
  padding: 56px 56px 46px;
  overflow: hidden;
  background:
    radial-gradient(80% 120% at 12% 4%, rgba(255, 255, 255, .18), transparent 55%),
    radial-gradient(70% 120% at 92% 100%, rgba(12, 12, 12, .3), transparent 62%),
    linear-gradient(125deg, var(--c1) 0%, var(--c2) 62%, var(--c3) 138%);
  box-shadow: inset 0 -1px 0 rgba(23, 23, 23, .15);
  animation: coverIn .7s cubic-bezier(.2, .8, .2, 1) both;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .12) 0 1px, transparent 1px 88px);
  opacity: .4;
}
.hero__inner { position: relative; z-index: 2; max-width: 660px; }
.hero__glyph {
  position: absolute;
  right: -10px; bottom: -96px;
  z-index: 1;
  font-size: 320px;
  line-height: 1;
  font-weight: 700;
  color: rgba(247, 244, 234, .055);
  user-select: none;
}
.hero__glyph--emoji { font-size: 200px; bottom: -30px; color: rgba(247, 244, 234, .14); }
.crumbs--hero { color: rgba(247, 244, 234, .5); }
.hero__title {
  margin: 16px 0 16px;
  font-family: var(--serif);
  font-size: 46px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #f8f5ec;
}
.hero__sub {
  margin: 0 0 28px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(248, 245, 236, .55);
}
.hero__cta {
  display: inline-flex; align-items: center;
  padding: 10px 20px;
  border: 1px solid rgba(248, 245, 236, .3);
  border-radius: 99px;
  background: rgba(248, 245, 236, .04);
  color: #f8f5ec;
  font-family: var(--serif);
  font-size: 13.5px;
  text-decoration: none;   /* 阅读端这个按钮是 <a>，不能带下划线 */
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}
.hero__cta span { margin-left: 9px; transition: transform .2s; }
.hero__cta:hover { background: rgba(248, 245, 236, .12); border-color: rgba(248, 245, 236, .5); transform: translateY(-1px); }
.hero__cta:hover span { transform: translateX(3px); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: var(--db-card-gap, 16px);
}
.cards-block { margin: 0; }
.db-located-record { margin: 12px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); font: 12px/1.6 var(--sans); }
.db-located-record strong { display: block; color: var(--ink); font-size: 14px; margin: 3px 0; }
.cards-block-group { margin: 0; }
.db-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 10px;
}
.db-view-tab {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, .55);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
}
.db-view-tab:hover { border-color: rgba(122, 10, 10, .25); color: var(--accent); }
.db-view-tab.is-on {
  border-color: rgba(122, 10, 10, .22);
  background: var(--accent-soft);
  color: var(--accent);
}
.db-view-panel[hidden] { display: none; }
.cards-block__head { margin: 0 0 12px; }
/* 顶栏保留（以后放筛选 / 分类）；现在没有内容时不占高度、不留白。 */
.cards-block__head.is-empty { margin: 0; min-height: 0; padding: 0; overflow: hidden; }
/* 预览（阅读态）：标题与视图标签左对齐，标签在上方左侧 */
.cards-block__head.is-reading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.cards-block__head.is-reading .db-views { justify-content: flex-start; flex-wrap: wrap; }
/* 顶栏左侧：筛选 / 排序（都可以多条件，改完立刻重画卡片） */
.cards-block__tools { display: flex; align-items: center; gap: 6px; margin-left: 0; }
.cards-block__head.is-reading.has-tools {
  flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; width: 100%;
}
.cards-block__head.is-reading.is-empty.has-tools { margin: 0 0 10px; min-height: 0; overflow: visible; }
.db-tool {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 11px; border: 1px solid var(--line-soft); border-radius: 999px;
  background: #fff; color: var(--ink-2); font: 11.5px/1 var(--sans); cursor: pointer;
}
/* 图标（漏斗 / 上下箭头）：13px，颜色跟着文字走 */
.db-tool > svg { width: 13px; height: 13px; flex: none; }
.db-tool:hover { border-color: var(--accent); color: var(--accent); }
.db-tool.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.db-tool i { font-style: normal; font-size: 10px; opacity: .8; }
.cards-block__title {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}
/* 卡片数据库（表格 / 列表 / 卡片） */
.db-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 12px;
}
.cards-block__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.db-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  min-width: 0;
}
.db-count {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  white-space: nowrap;
}
.db-search,
.db-sort {
  height: 28px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, .65);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11.5px;
  outline: 0;
}
.db-search {
  width: 130px;
  padding: 0 8px;
}
.db-sort { padding: 0 4px; }
.db-search:focus,
.db-sort:focus { border-color: rgba(122, 10, 10, .3); box-shadow: 0 0 0 3px var(--accent-soft); }
.db-table {
  margin: 2px 0 8px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: auto;
  max-height: 62vh;
  background: rgba(255, 255, 255, .25);
  scrollbar-width: thin;
  scrollbar-color: rgba(122, 10, 10, .38) rgba(23, 23, 23, .06);
}
.db-table::-webkit-scrollbar { width: 10px; height: 10px; }
.db-table::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 99px;
  background: rgba(122, 10, 10, .36);
  background-clip: padding-box;
}
.db-table::-webkit-scrollbar-thumb:hover { background: rgba(122, 10, 10, .5); background-clip: padding-box; }
.db-table::-webkit-scrollbar-track { background: rgba(23, 23, 23, .05); }
.db-table-shell { position: relative; }
.db-table-fade {
  position: absolute;
  top: 0;
  bottom: 10px;
  z-index: 4;
  width: 30px;
  pointer-events: none;
  opacity: 0;
  transition: none;
}
.db-table-fade--left {
  left: 0;
  border-radius: 10px 0 0 10px;
  background: linear-gradient(to right, rgba(247, 245, 239, .96), rgba(247, 245, 239, 0));
}
.db-table-fade--right {
  right: 0;
  border-radius: 0 10px 10px 0;
  background: linear-gradient(to left, rgba(247, 245, 239, .96), rgba(247, 245, 239, 0));
}
.db-table-shell.is-scroll-left .db-table-fade--left,
.db-table-shell.is-scroll-right .db-table-fade--right { opacity: 1; }
.db-table__head,
.db-table__row {
  display: flex;
  min-width: max-content;
}
.db-table__head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f7f5ef;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .04em;
}
.db-table__row { border-top: 1px solid var(--line-soft); }
.db-table__row:hover { background: rgba(23, 23, 23, .018); }
.db-th,
.db-cell {
  flex: 0 0 132px;
  min-width: 0;
  box-sizing: border-box;
  padding: var(--db-cell-pad-y, 10px) var(--db-cell-pad-x, 12px);
  border-right: 1px solid var(--line-soft);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.55;
}
/* 表头：类型图标与字段名同排，不再折成两行 */
.db-table__head .db-th {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.db-table__head .db-th .db-field-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 列脚「计算」默认不显示，悬停列脚才出现，避免一排空心按钮 */
.db-foot__add { opacity: 0; transition: opacity .12s ease; }
.db-table__foot:hover .db-foot__add { opacity: .55; }
.db-foot__cell:hover .db-foot__add { opacity: 1; }
.db-celltext {
  display: block;
  min-height: 20px;
  overflow: hidden;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.db-celltext.is-empty { color: var(--line); }
.db-celltext--title { color: var(--ink); font-weight: 600; font-size: 12.5px; }
.db-table .db-cell:not(.is-wrap) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-table .db-cell--date:not(.is-wrap),
.db-table .db-cell--datefield:not(.is-wrap) {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.45;
}
.db-cell--datefield .db-celltext { white-space: normal; overflow-wrap: anywhere; }
.db-table--compact .db-th,
.db-table--compact .db-cell { padding-top: 4px; padding-bottom: 4px; }
.db-table--comfortable .db-th,
.db-table--comfortable .db-cell { padding-top: 14px; padding-bottom: 14px; }
.db-cell.is-wrap,
.db-th.is-wrap { white-space: normal; overflow-wrap: anywhere; }
.db-cell.is-wrap .db-celltext {
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
}
.db-cell.is-wrap .db-target { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
.db-th.is-wrap .db-field-name { white-space: normal; }
/* 系统列的宽度一律由内联样式（fit 计算）决定，这里不再写死，避免表头与数据行错位 */

.db-th:last-child,
.db-cell:last-child { border-right: 0; }
.db-th--ops { flex: 0 0 104px; }
.db-th--check,
.db-cell--check { flex: 0 0 34px; min-width: 34px; }
/* 名称列：冻结在左侧；宽度只由内联 fit 决定，这里不写死任何 flex 值 */
.db-cell--name {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fbfaf6;
}
.db-cell--name .db-celltext--title { padding-right: 16px; }
/* 名称就是双链：点击直接跳目标；右侧小按钮改名 */
.db-name-link { cursor: pointer; }
.db-name-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.db-row-edit {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1;
  opacity: 0;
  cursor: pointer;
}
.db-cell--name:hover .db-row-edit { opacity: 1; }
.db-row-edit:hover { color: var(--accent); }
.db-table__head .db-th:first-child { background: #f7f5ef; }
/* 行操作列吸收剩余宽度，避免右侧出现一大片空白 */
.db-th--ops,
.db-cell--ops { flex: 1 1 104px; min-width: 104px; }
.db-table__body { min-width: max-content; }
.db-group { border-top: 1px solid var(--line-soft); }
.db-group:first-child { border-top: 0; }
.db-group__head {
  position: sticky;
  left: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: max-content;
  padding: 7px 10px;
  border: 0;
  background: #f7f5ef;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}
.db-group__head b { color: var(--ink-3); font-weight: 500; }
.db-group__chev { color: var(--ink-3); font-size: 10px; }
.db-list .db-group { border-top: 1px solid var(--line-soft); }
.db-list .db-group:first-child { border-top: 0; }
.db-list .db-group__head {
  position: static;
  min-width: 0;
  border-radius: 0;
}
.db-board__col-add {
  flex: 0 0 140px;
  height: 34px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10px;
  cursor: pointer;
}
.db-board__col-add:hover { border-color: rgba(122, 10, 10, .3); color: var(--accent); }
.db-static-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 12px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, .42);
}
.db-static-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.db-static-filter + .db-static-filter {
  padding-left: 14px;
  border-left: 1px solid var(--line-soft);
}
.db-static-filter__label {
  margin-right: 3px;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
}
.db-static-filter__btn {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  cursor: pointer;
}
.db-static-filter__btn:hover {
  border-color: rgba(122, 10, 10, .25);
  color: var(--accent);
}
.db-static-filter__btn.is-on {
  border-color: rgba(122, 10, 10, .2);
  background: var(--accent-soft);
  color: var(--accent);
}
.db-static-count {
  margin-left: auto;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
}
.db-static-empty {
  padding: 16px 4px;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 12px;
}
.db-static-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}
.db-static-search {
  flex: 1 1 200px;
  max-width: 280px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #fff;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11.5px;
  outline: 0;
}
.db-static-search:focus { border-color: rgba(122, 10, 10, .35); }
.db-static-page {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #fff;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
}
.db-static-pager { display: flex; align-items: center; gap: 4px; }
.db-static-pager button {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-3);
  font-size: 13px;
  cursor: pointer;
}
.db-static-pager button:disabled { opacity: .35; cursor: default; }
.db-static-pager span {
  min-width: 50px;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  text-align: center;
}
.db-static-tools__count {
  margin-left: auto;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
}
.db-table__foot {
  display: flex;
  min-width: max-content;
  border-top: 1px solid var(--line-soft);
  background: #f7f5ef;
}
.db-foot__cell {
  display: flex;
  flex: 0 0 132px;
  flex-direction: column;
  gap: 1px;
  padding: 5px 10px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  background: none;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10.5px;
  text-align: left;
}
.db-foot__cell:last-child { border-right: 0; }
.db-foot__cell b {
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.db-foot__cell small { color: var(--ink-3); font-size: 10px; }
.db-foot__cell:first-child { flex: 0 0 34px; background: #f7f5ef; }
.db-foot__cell--name {
  flex: 1 1 210px;
  min-width: 175px;
  background: #f7f5ef;
}
.db-cal {
  margin: 10px 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, .35);
}
.db-cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.db-cal__month { color: var(--ink); font-family: var(--serif); font-size: 16px; }
.db-cal__tools { display: flex; align-items: center; gap: 4px; }
.db-cal__field-label { color: var(--ink-3); font-family: var(--sans); font-size: 10.5px; }
.db-cal .db-tool-btn {
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #fff;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  cursor: pointer;
}
.db-cal .db-tool-btn:hover { border-color: rgba(122, 10, 10, .3); color: var(--accent); }
.db-cal__weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--line-soft);
  background: #f7f5ef;
}
.db-cal__weekdays span {
  padding: 6px 7px;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10.5px;
  text-align: center;
}
.db-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.db-cal__day {
  min-height: 88px;
  padding: 5px 6px 6px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: #fbfaf6;
}
.db-cal__day:nth-child(7n) { border-right: 0; }
.db-cal__day.is-outside { background: rgba(23, 23, 23, .022); }
.db-cal__day.is-outside .db-cal__num { color: var(--line); }
.db-cal__day.is-today { box-shadow: inset 0 0 0 1px rgba(122, 10, 10, .32); }
.db-cal__num {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
}
.db-cal__add {
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
  opacity: 0;
  cursor: pointer;
}
.db-cal__day:hover .db-cal__add { opacity: 1; }
.db-cal__events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  max-height: 70px;
  overflow-y: auto;
}
.db-cal__event {
  display: block;
  width: 100%;
  padding: 2px 5px;
  border: 0;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 10.5px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
button.db-cal__event:hover,
a.db-cal__event:hover { background: rgba(122, 10, 10, .14); }
.db-cal__undated {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-top: 1px solid var(--line-soft);
}
.db-cal__undated-label {
  margin-right: 2px;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10.5px;
}
.db-cal__undated .db-cal__event { width: auto; }
.db-cal__empty {
  padding: 26px 18px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  text-align: center;
}
.db-cal__empty b { display: block; margin-bottom: 4px; color: var(--ink-2); font-size: 12px; }
.db-cal__empty p { margin: 0 0 12px; }
.db-table__row.db-tint--clay,
.db-list__row.db-tint--clay,
.card.db-tint--clay,
.db-board-card.db-tint--clay,
.db-cal__event.db-tint--clay { background: rgba(122, 10, 10, .05); }
.db-table__row.db-tint--sage,
.db-list__row.db-tint--sage,
.card.db-tint--sage,
.db-board-card.db-tint--sage,
.db-cal__event.db-tint--sage { background: rgba(74, 103, 65, .07); }
.db-table__row.db-tint--sand,
.db-list__row.db-tint--sand,
.card.db-tint--sand,
.db-board-card.db-tint--sand,
.db-cal__event.db-tint--sand { background: rgba(164, 133, 79, .1); }
.db-table__row.db-tint--ink,
.db-list__row.db-tint--ink,
.card.db-tint--ink,
.db-board-card.db-tint--ink,
.db-cal__event.db-tint--ink { background: rgba(23, 23, 23, .05); }
.db-cell--tint--clay { background: rgba(122, 10, 10, .06); }
.db-cell--tint--sage { background: rgba(74, 103, 65, .08); }
.db-cell--tint--sand { background: rgba(164, 133, 79, .11); }
.db-cell--tint--ink { background: rgba(23, 23, 23, .06); }
.db-table__foot .db-foot__cell[data-col-key="__name"] {
  flex: 1 1 210px;
  min-width: 175px;
}
.db-table__foot .db-foot__cell[data-col-key="__target"] { flex: 0 0 150px; }
.db-table__foot .db-foot__cell[data-col-key="__updated"] { flex: 0 0 96px; }
.db-foot__cell--ops { flex: 0 0 104px; }
.db-cell--target { flex: 0 0 150px; }
.db-cell--tags { flex: 0 0 150px; }
.db-cell--date { flex: 0 0 96px; color: var(--ink-3); font-size: 11.5px; font-family: var(--sans); }
.db-cell--ops {
  flex: 0 0 104px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  padding-left: 4px;
  padding-right: 8px;
}
.db-input {
  width: 100%;
  min-width: 0;
  padding: 2px 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  outline: 0;
}
.db-input:focus {
  background: #fff;
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.db-input--title { color: var(--ink); font-weight: 600; }
.db-title { color: var(--ink); font-weight: 600; }
.db-table .db-title,
.db-list .db-title { font-family: var(--sans); font-size: 12.5px; }
.db-target {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.db-target:hover { text-decoration: underline; text-underline-offset: 3px; }
.db-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.db-chip {
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 10.5px;
  white-space: nowrap;
}
.db-chip--clay { background: rgba(122, 10, 10, .09); color: #7a0a0a; }
.db-chip--sage { background: rgba(74, 103, 65, .12); color: #4a6741; }
.db-chip--sand { background: rgba(164, 133, 79, .16); color: #856530; }
.db-chip--ink { background: rgba(23, 23, 23, .08); color: #3a3a38; }
.db-chip--relation { background: rgba(23, 23, 23, .055); color: var(--ink-2); }
.db-rollup {
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.db-empty { color: var(--ink-3); opacity: .55; }
.db-check { accent-color: var(--accent); }
.db-op {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.db-op:hover { background: rgba(23, 23, 23, .06); color: var(--ink); }
.db-op--danger:hover { background: rgba(160, 74, 64, .1); color: #a04a40; }
.db-add-row {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-top: 1px dashed var(--line-soft);
  background: transparent;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
}
.db-add-row:hover { background: rgba(122, 10, 10, .035); color: var(--accent); }
.db-list {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
}
.db-list__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 11px;
  border-top: 1px solid var(--line-soft);
}
.db-list__row:first-child { border-top: 0; }
.db-list__row:hover { background: rgba(23, 23, 23, .018); }
.db-list__glyph {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  /* 按 CJK 墨迹调：12px 字在 24px 方块里会偏下，line-height 1 + 1px 补偿 */
  font-size: 11px;
  line-height: 1;
  padding-top: 1px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  color: var(--ink-3);
}
.db-list__main { flex: 1; min-width: 0; }
.db-list__meta {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10.5px;
}
.db-list__props { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; }
.db-list-prop { color: var(--ink-2); font-size: 12px; }
.db-list-prop i { margin-right: 4px; color: var(--ink-3); font-style: normal; font-family: var(--sans); font-size: 10.5px; }
.db-card-props {
  display: flex;
  flex-direction: column;
  gap: var(--card-field-gap, 5px);
  margin: 3px 0 0;
}
/* B 方案（用户指着样图的 B 定的）：一行一个字段，字段名在左、值在右。
   左边那列宽度跟着「字段名字号」一起缩放（可以放 4 个汉字），所以每一行的值都从同一个 x 开始；
   值太长就在右半边换行，chip 多的会自然排成一行。 */
.db-card-prop {
  display: grid;
  grid-template-columns: calc(var(--card-field-label-size, 10px) * var(--card-label-cols, 4.6)) minmax(0, 1fr);
  gap: var(--card-field-label-gap, 8px);
  align-items: baseline;
  min-width: 0;
  color: var(--ink-3);
  font-size: var(--card-field-size, 11.5px);
}
.db-card-prop i { flex: none; min-width: 0; margin-right: 0; font-style: normal; font-family: var(--sans); font-size: var(--card-field-label-size, 10px); color: var(--ink-3); opacity: .85; white-space: nowrap; }
.db-card-prop__v { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 3px; min-width: 0; color: var(--ink-2); }
.db-card-prop__v .db-chip { font-size: 10px; padding: 1px 6px; }
/* 只有一两个字段时：一行放得下两个就并排。
   宽度按内容算（flex-basis:auto，不拉伸），放不下就自动换行，长值不会被挤窄或截掉；
   并排时**长的靠左、短的靠右**（顺序在 cardItemHTML 里按显示宽度排），行末不再留一块空白。
   并排时字段名那一列改成「按自己名字的宽度」，不再留固定 4.6em 的空隙。 */
.db-card-props--pair { flex-direction: row; flex-wrap: wrap; column-gap: 22px; justify-content: space-between; }
.db-card-props--pair .db-card-prop { flex: 0 1 auto; min-width: 0; grid-template-columns: auto minmax(0, 1fr); }
.db-card-prop--number .db-card-prop__v,
.db-card-prop--rollup .db-card-prop__v,
.db-card-prop--formula .db-card-prop__v { color: var(--ink); font-weight: 500; }
.db-num, .db-date { font-variant-numeric: tabular-nums; }
.db-date { color: var(--ink-3); }
.db-check { color: var(--accent); font-weight: 600; }
.db-card-prop--text .db-text {
  /* 长文本只留一行，尾巴用省略号；完整内容在 title 里，悬停可见 */
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  overflow-wrap: normal; min-width: 0; flex: 0 1 auto; max-width: 100%;
}
.db-card-prop--url .db-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.db-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.db-board {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 10px;
}
.db-board__col {
  flex: 0 0 210px;
  min-height: 90px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(23, 23, 23, .018);
  transition: background .12s, border-color .12s;
}
.db-board__col.is-over {
  border-color: rgba(122, 10, 10, .35);
  background: var(--accent-soft);
}
.db-board__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 2px 7px;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
}
.db-board__head b { font-weight: 400; }
.db-board__cards { display: flex; flex-direction: column; gap: 5px; }
.db-board-card {
  display: block;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.db-board-card:hover { border-color: rgba(122, 10, 10, .28); }
.db-board-card b {
  display: block;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
.db-board-card span {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10.5px;
}
.db-board__add {
  width: 100%;
  margin-top: 6px;
  padding: 5px 6px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10.5px;
  cursor: pointer;
}
.db-board__add:hover { border-color: rgba(122, 10, 10, .28); color: var(--accent); }
.db-board-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper-hi);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  animation: cardIn .55s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 65ms);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s, border-color .3s;
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(122, 10, 10, .18);
  box-shadow: 0 22px 44px -28px rgba(23, 23, 23, .55), 0 2px 6px rgba(23, 23, 23, .04);
}
.card:active { transform: translateY(-2px); }

.card__cover {
  position: relative;
  height: 116px;
  overflow: hidden;
  background:
    radial-gradient(120% 160% at 10% 0%, var(--c3) 0%, transparent 60%),
    linear-gradient(120deg, var(--c1), var(--c2));
}
.card__cover::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, .18), transparent 55%);
  opacity: 0;
  transition: opacity .35s;
}
/* 被引用文档有封面图时，卡片封面直接用它（与文档封面同一张）。 */
.card__cover-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.card__cover-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20, 16, 12, .34), rgba(20, 16, 12, .04) 46%, rgba(20, 16, 12, .36));
}
.card__cover--image .card__glyph { color: rgba(255, 255, 255, .26); z-index: 1; }
.card:hover .card__cover::after { opacity: 1; }
.card__glyph {
  position: absolute;
  right: 12px; bottom: -26px;
  font-size: 108px;
  line-height: 1;
  font-weight: 700;
  color: rgba(255, 255, 255, .18);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
.card:hover .card__glyph { transform: translateY(-4px) rotate(-2deg); }
.card__group {
  position: absolute; left: 14px; top: 12px;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .8);
}
.card__tags { position: absolute; top: 10px; right: 12px; z-index: 2; display: flex; gap: 4px; }
/* 非文档卡片的封面设置入口：右上角三个点，悬停才显形；**不要底色**，只靠一点投影压住浅色封面 */
.card__cover-menu {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  width: 22px; height: 22px; display: grid; place-items: center;
  padding: 0; border: 0;
  background: transparent; color: rgba(255, 255, 255, .95);
  font: 15px/1 var(--sans); cursor: pointer; opacity: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55), 0 0 1px rgba(0, 0, 0, .4);
  transition: opacity .15s;
}
.card:hover .card__cover-menu,
.card__cover-menu:focus-visible { opacity: 1; }
.card__cover-menu:hover { background: transparent; color: #fff; }
@media (hover: none) { .card__cover-menu { opacity: .85; } }
.card__cover:has(.card__cover-menu) .card__tags { right: 38px; }
.card__tag {
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .18);
  color: rgba(255, 255, 255, .86);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .02em;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .15s;
}
.card__tag:hover { background: rgba(0, 0, 0, .34); }

.card__body { display: flex; flex-direction: column; flex: 1; padding: 12px 14px 11px; }
.card__title { margin: 0 0 3px; font-size: var(--card-title-size, 17px); font-weight: 600; letter-spacing: -.005em; color: var(--ink); }
.card__desc {
  margin: 0 0 6px;
  font-size: 13.5px; line-height: 1.62; color: var(--ink-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; min-height: 21px; }
.chip {
  font-family: var(--sans);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--accent-soft);
  border: 1px solid rgba(122, 10, 10, .1);
  color: var(--accent);
  cursor: pointer;
  transition: background .16s, transform .16s, border-color .16s;
}
.chip:hover { background: rgba(122, 10, 10, .14); border-color: rgba(122, 10, 10, .24); transform: translateY(-1px); }
.card__foot {
  display: flex; align-items: center; gap: 9px;
  margin-top: auto;
  padding-top: 7px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-3);
}
.card__foot span + span::before { content: "·"; margin-right: 9px; opacity: .7; }

/* 面包屑：封面左上角 / 无封面时正文上方 */
.cover__crumb {
  position: absolute;
  top: 14px; left: 16px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 32px);
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 99px;
  background: rgba(20, 20, 20, .26);
  backdrop-filter: blur(10px) saturate(1.1);
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: .03em;
  color: rgba(255, 255, 255, .82);
  white-space: nowrap;
  overflow: hidden;
}
.cover__crumb .crumb-link {
  border: 0; padding: 0; background: none;
  color: inherit; font: inherit;
  text-decoration: none;   /* 悬停时才出下划线（见下一行），两端一致 */
  cursor: pointer;
  transition: color .15s;
}
.cover__crumb .crumb-link:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.cover__crumb i { font-style: normal; color: rgba(255, 255, 255, .45); }

.doc__crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--ink-3);
}
.doc__crumb .crumb-link {
  border: 0; padding: 0; background: none;
  color: var(--ink-3); font: inherit;
  text-decoration: none;   /* 悬停时才出下划线，两端一致 */
  cursor: pointer;
  transition: color .15s;
}
.doc__crumb .crumb-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.doc__crumb i { font-style: normal; color: rgba(122, 10, 10, .45); }
.doc__crumb + .doc__title, .doc__crumb + .tag-title { margin-top: 2px; }

.pane__progress {
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  opacity: .4;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .12s linear;
  pointer-events: none;
}

/* 动效 */
@keyframes coverIn { from { opacity: 0; transform: scale(1.035); } to { opacity: 1; transform: none; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes paneIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

.doc { animation: docIn .38s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes docIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

.panes.is-split-in .pane:last-child { animation: paneIn .36s cubic-bezier(.2, .8, .2, 1) both; }

@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="on"]) .doc,
  html:not([data-motion="on"]) .cover,
  html:not([data-motion="on"]) .hero,
  html:not([data-motion="on"]) .card,
  html:not([data-motion="on"]) .panes.is-split-in .pane:last-child { animation: none !important; }
}

/* ============================== 面板（封面 / emoji） ============================== */

.pop {
  position: fixed;
  z-index: 70;
  width: 320px;
  padding: 14px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fdfcf8;
  box-shadow: 0 26px 60px -28px rgba(23, 23, 23, .5), 0 2px 8px rgba(23, 23, 23, .06);
  font-family: var(--sans);
  animation: popIn .16s ease both;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.99); } to { opacity: 1; transform: none; } }

.pop__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3);
}
.pop__close {
  width: 22px; height: 22px;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--ink-3);
  font-size: 15px; line-height: 1; cursor: pointer;
}
.pop__close:hover { background: rgba(23, 23, 23, .06); color: var(--ink); }

.pop__row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pop__label { width: 32px; flex: none; font-size: 10.5px; color: var(--ink-3); letter-spacing: .06em; }
.pop__range { flex: 1; min-width: 0; accent-color: var(--accent); height: 18px; }
.pop__val { width: 38px; text-align: right; font-family: var(--mono); font-size: 10px; color: var(--ink-3); }

.swatches { display: flex; align-items: center; gap: 6px; flex: 1; }
.swatch {
  width: 22px; height: 22px;
  padding: 0;
  border: 1px solid rgba(23, 23, 23, .14);
  border-radius: 7px;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  cursor: pointer;
  transition: transform .15s, outline-color .15s;
}
.swatch:hover { transform: translateY(-1px); }
.swatch.is-on { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch--auto {
  width: auto; padding: 0 7px;
  font-family: var(--sans); font-size: 9px;
  letter-spacing: .06em;
  color: var(--ink-3);
  background: rgba(23, 23, 23, .04);
}

.pop__url {
  flex: 1; min-width: 0; height: 27px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 0 8px;
  font-family: var(--sans); font-size: 10.5px;
  color: var(--ink-2);
  background: #fff;
}
.pop__url:focus { outline: 0; border-color: rgba(122, 10, 10, .3); box-shadow: 0 0 0 3px var(--accent-soft); }
.pop__file {
  flex: none;
  padding: 5px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  font-size: 10px;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.pop__file:hover { border-color: rgba(122, 10, 10, .28); color: var(--accent); }

.pop__emoji {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.pop__emoji:hover { border-color: rgba(122, 10, 10, .3); transform: translateY(-1px); }
.pop__hint { font-size: 9.5px; color: var(--ink-3); }
.pop__hint--block { margin: -4px 0 10px 42px; }

.cover-styles { display: flex; gap: 6px; flex: 1; }
.cover-style {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 5px 4px 4px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.cover-style:hover { border-color: rgba(122, 10, 10, .25); }
.cover-style.is-on { border-color: rgba(122, 10, 10, .45); box-shadow: 0 0 0 2px var(--accent-soft); }
.cover-style em {
  font-style: normal;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .04em;
  color: var(--ink-3);
}
.cover-style__art {
  position: relative;
  width: 100%;
  height: 22px;
  border-radius: 4px;
  overflow: hidden;
}
.cover-style__art--hero { background: linear-gradient(130deg, #23262b, #7d828b); }
.cover-style__art--hero::after {
  content: "";
  position: absolute; left: 5px; bottom: 5px;
  width: 58%; height: 3px;
  border-radius: 2px;
  background: rgba(248, 245, 236, .75);
}
.cover-style__art--doc { background: linear-gradient(120deg, #a97355, #e9d8c4); }
.cover-style__art--doc::after {
  content: "";
  position: absolute; right: 5px; bottom: -2px;
  width: 11px; height: 11px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .35);
  transform: rotate(8deg);
}
.cover-style__art--image { background: linear-gradient(160deg, #cdd3c5, #8a9a86); }
.cover-style__art--image::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 12px;
  background: #59684f;
  clip-path: polygon(0 100%, 30% 35%, 55% 70%, 75% 45%, 100% 100%);
  opacity: .65;
}

.pop__foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.pop__reset { border: 0; background: transparent; color: var(--accent); font-size: 10.5px; cursor: pointer; padding: 0; }
.pop__saved { font-size: 9.5px; color: var(--ink-3); }

.pop--emoji { width: 300px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.emoji-cell {
  aspect-ratio: 1;
  display: grid; place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  transition: background .14s, border-color .14s;
}
.emoji-cell:hover { background: rgba(23, 23, 23, .05); }
.emoji-cell.is-on { border-color: rgba(122, 10, 10, .35); background: var(--accent-soft); }
.emoji-custom { display: flex; gap: 6px; margin-top: 10px; }
.emoji-field { display: flex; gap: 6px; margin-top: 2px; }
.emoji-custom input, .emoji-field input {
  flex: 1; min-width: 0; height: 28px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 0 8px;
  font-family: var(--sans); font-size: 11px;
  background: #fff;
}
.emoji-custom input:focus, .emoji-field input:focus { outline: 0; border-color: rgba(122, 10, 10, .3); box-shadow: 0 0 0 3px var(--accent-soft); }
.emoji-custom button, .emoji-field button {
  flex: none;
  border: 1px solid rgba(122, 10, 10, .16);
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  padding: 0 11px;
  cursor: pointer;
}
.emoji-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  margin-bottom: 10px;
  border-radius: 9px;
  background: rgba(23, 23, 23, .045);
}
.emoji-tab {
  flex: 1;
  padding: 5px 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.emoji-tab:hover { color: var(--ink-2); }
.emoji-tab.is-on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(23, 23, 23, .08);
}
.emoji-now {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  padding: 7px 9px;
  border: 1px dashed var(--line-soft);
  border-radius: 9px;
}
.emoji-now__icon { display: grid; place-items: center; width: auto; min-width: 30px; height: 30px; padding: 0 4px; font-size: 20px; }
.emoji-now__icon .twemoji { width: 24px; height: 24px; }
.emoji-now__meta { font-family: var(--sans); font-size: 9.5px; letter-spacing: .08em; color: var(--ink-3); }
.emoji-hint {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 9.5px;
  line-height: 1.7;
  color: var(--ink-3);
}
.emoji-foot {
  display: flex; justify-content: space-between;
  margin-top: 10px; padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 9.5px; color: var(--ink-3);
}
.emoji-foot button {
  border: 0; background: transparent; padding: 0;
  color: var(--ink-3); font-size: 9.5px;
  text-decoration: underline; cursor: pointer;
}

.emoji-img { width: 1em; height: 1em; vertical-align: -0.12em; object-fit: contain; }
.twemoji {
  width: 1em; height: 1em;
  display: inline-block;
  vertical-align: -0.14em;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}
.twemoji-fallback { line-height: 1; }

.icon-text {
  display: inline-grid;
  place-items: center;
  font-family: var(--serif);
  font-size: .95em;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  color: inherit;
}
.icon-text[data-len="2"] { font-size: .72em; letter-spacing: .02em; }
.icon-text[data-len="3"] { font-size: .56em; }
.icon-text[data-len="4"] { font-size: .46em; }
.icon-text[data-len="5"], .icon-text[data-len="6"] { font-size: .4em; letter-spacing: .02em; }

/* 英文/数字在图标里用无衬线，并做一次视觉基线校正 */
.icon-text[data-latin="1"] {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: .02em;
  transform: translateY(.06em);
}
/* 封面、卡片封面、Hero 上的水印仍然用宋体，不做校正 */
.cover__glyph .icon-text,
.hero__glyph .icon-text,
.card__glyph .icon-text {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -.02em;
  transform: none;
}

.callout__icon .twemoji { width: 18px; height: 18px; }
.tree__glyph .twemoji { width: 12px; height: 12px; }
.rel-item__thumb .twemoji { width: 16px; height: 16px; }
.emoji-cell .twemoji { width: 18px; height: 18px; }
.pop__emoji .twemoji { width: 18px; height: 18px; }

@media (max-width: 900px) {
  .app, .app.is-rel { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; top: 0; bottom: 0; left: 0; width: var(--rail);
    background: var(--paper); border-right: 1px solid var(--line);
    z-index: 50; box-shadow: 0 0 40px rgba(23, 23, 23, .12);
    transform: translateX(-102%);
    transition: transform .22s ease;
  }
  .app.is-drawer .rail { transform: none; }
  /* 站点（只读）在窄屏要留一个能打开文档树的按钮：工作台有自己的 dock，阅读端没有。 */
  .static #railToggle { display: grid !important; }
  .stage { padding: 0; }
  .panes { gap: 0; }
  .doc { width: calc(100% - 44px); padding-top: 24px; }
  .doc__title { font-size: var(--doc-title-font-size, 32px); }
  .pane + .pane { display: none; }
  .tab__close { opacity: 1; }
  .cover__glyph { font-size: 150px; bottom: -40px; }
  .hero { padding: 36px 28px 30px; }
  .hero__title { font-size: 32px; }
  .hero__glyph { font-size: 220px; bottom: -64px; }
  .cards { grid-template-columns: 1fr; }
  .doc--wide { width: calc(100% - 40px); }
  .tag-title { font-size: 32px; }
  .cover__crumb { top: 10px; left: 10px; padding: 5px 9px; font-size: 10px; }
  .cover__hero { padding: 56px 28px 30px; }
  .cover__hero-title { font-size: 34px; }
  .cover__hero-sub { font-size: 14px; margin: 10px 0 20px; }
  .cover__hero-art { font-size: 200px; bottom: -60px; }

  /* 纸面封面：手机上把纸卡 / 照片 / 票根都收一档，避免把字挤没 */
  body.studio:not(.static) .cover--paper { width: calc(100% - 38px); }
  .cover--paper .cover__crumb { top: 9px; left: 10px; font-size: 8.5px; }
  .cover--paper .cover__kicker { font-size: 8px; }
  .cover--paper .cover__sub { font-size: 10.5px; line-height: 1.55; }
  .cover__collage-card { left: 5%; top: 15%; width: 64%; height: 72%; padding: 4% 4.5%; }
  .cover__collage-photo { right: 2%; top: 10%; width: 30%; height: 56%; }
  .cover--collage .cover__title { font-size: 25px; }
  .cover--collage .cover__sub { font-size: 10px; }
  .cover__ticket-main { padding: 34px 4% 4% 4%; }
  .cover--ticket { grid-template-columns: minmax(0, 1fr) 88px; }
  .cover--ticket::before, .cover--ticket::after { right: 81px; }
  .cover--ticket .cover__title { font-size: 25px; }
  .cover__ticket-no { font-size: 30px; }
  .cover--news { padding: 34px 4% 3%; }
  .cover__news-body { gap: 10px; min-height: 34px; }
  .cover--news .cover__title { font-size: 26px; }
  .cover__post-photo { margin-top: 18%; }
  .cover--postcard .cover__title { font-size: 22px; }
  .cover__folder-label { width: 66%; }
  .cover--folder .cover__title { font-size: 25px; }
  .cover__folder-stamp { width: 54px; }
  .cover--thread .cover__title { font-size: 28px; }
  .cover__thread-body { left: 10%; right: 6%; }
  .cover__thread-seal { width: 42px; }
  .pop { width: min(320px, calc(100vw - 24px)); }
  .pop--emoji { width: min(300px, calc(100vw - 24px)); }
}

@media (max-width: 720px) {
  .cards-block__title { font-size: 18px; }
  .db-head-tools { flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
  .db-view-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .db-view-tabs::-webkit-scrollbar { display: none; }
  .db-views {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .db-views::-webkit-scrollbar { display: none; }
  .db-toolbar { gap: 6px 8px; }
  .db-tools { flex-wrap: wrap; gap: 6px; }
  .db-search { flex: 1 1 150px; width: auto; }
  .db-static-filters { padding: 8px 10px; gap: 6px 10px; }
  .db-static-filter { width: 100%; }
  .db-static-filter + .db-static-filter {
    margin-top: 6px;
    padding-top: 6px;
    padding-left: 0;
    border-left: 0;
    border-top: 1px dashed var(--line-soft);
  }
  .db-static-filter__label { min-width: 40px; }
  .db-static-tools { gap: 6px; }
  .db-static-search { flex: 1 1 100%; max-width: none; }
  .db-static-page { height: 28px; }
  .db-static-pager button { width: 28px; height: 28px; }
  .db-static-tools__count { margin-left: 0; }
  .db-table { max-height: 70vh; }
  .db-list__row { padding: 10px; gap: 8px; }
  .db-card-props { gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="on"]) * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .pane__body { scroll-behavior: auto; }
}

.cover__hero .doc__tags { margin: 10px 0 12px; }
.cover__hero .tag-pill { background:rgba(255,255,255,.12); color:inherit; border-color:rgba(255,255,255,.2); }

.cover--hero[data-tag-color="glass"] .tag-pill { background:rgba(255,255,255,.18); color:#fff; border-color:rgba(255,255,255,.35); }
.cover--hero[data-tag-color="accent"] .tag-pill { background:#7a0a0a; color:#fff; border-color:#a54444; }
.cover--hero[data-tag-color="sage"] .tag-pill { background:#536c50; color:#fff; border-color:#83987e; }
.cover--hero[data-tag-color="gold"] .tag-pill { background:#8b713e; color:#fff; border-color:#bca675; }

.doc--hero[data-tag-color="accent"] > .doc__tags .tag-pill { background:#7a0a0a; color:#fff; border-color:#a54444; }
.doc--hero[data-tag-color="sage"] > .doc__tags .tag-pill { background:#536c50; color:#fff; border-color:#83987e; }
.doc--hero[data-tag-color="gold"] > .doc__tags .tag-pill { background:#8b713e; color:#fff; border-color:#bca675; }

.hero__cta:hover, .hero__cta:hover span { transform:none; }
.hero__cta[data-cta-size="small"] { padding:6px 13px; font-size:12px; }
.hero__cta[data-cta-size="large"] { padding:13px 25px; font-size:15px; }
.hero__cta[data-cta-style="filled"] { background:#f8f5ec; color:#252525; }
.hero__cta[data-cta-style="filled"]:hover { background:#fff; }
.hero__cta[data-cta-style="text"] { background:transparent; border-color:transparent; padding-left:0; }

.cover--ocean { --c1:#183c50; --c2:#315b6c; --c3:#7899a1; }
.cover--plum { --c1:#44303e; --c2:#735b6e; --c3:#b6a0ad; }
.cover--forest { --c1:#263e31; --c2:#4c6754; --c3:#96aa8f; }
.cover--rose { --c1:#754b4c; --c2:#ad7e7c; --c3:#dfc3b9; }
.cover--hero .cover__hero-title { font-size:clamp(20px,5vw,var(--hero-title-size,62px)); color:var(--hero-title-color,#f8f5ec); }
.cover--hero .cover__hero-sub { font-size:var(--hero-sub-size,15.5px); color:var(--hero-sub-color,#f8f5ec); }
.cover--hero .cover__hero-kicker { font-size:var(--hero-kicker-size,10px); color:var(--hero-kicker-color,#c4c2bb); }
.cover-tags-corner { position:absolute; z-index:4; top:18px; right:56px; max-width:55%; }
.cover-tags-corner .doc__tags { justify-content:flex-end; margin:0; }
.cover--hero[data-tag-shape="square"] .tag-pill { border-radius:3px; }
.cover--hero[data-tag-shape="outline"] .tag-pill { background:transparent; border:1px solid currentColor; }
.cover--hero[data-tag-shape="plain"] .tag-pill { background:transparent; border-color:transparent; padding-left:0; padding-right:4px; }
.hero__cta[data-cta-style="square"] { border-radius:4px; }
.hero__cta[data-cta-style="glass"] { background:rgba(255,255,255,.18); border-color:rgba(255,255,255,.25); }
.hero__cta[data-cta-style="line"] { border:0; border-bottom:1px solid currentColor; border-radius:0; background:transparent; padding-left:0; padding-right:0; }
.hero__cta span:empty { display:none; }

.doc--hero[data-tag-shape="square"] > .doc__tags .tag-pill { border-radius:3px; }
.doc--hero[data-tag-shape="outline"] > .doc__tags .tag-pill { background:transparent; border:1px solid currentColor; }
.doc--hero[data-tag-shape="plain"] > .doc__tags .tag-pill { background:transparent; border-color:transparent; }

/* 用户可选的网站文字样式；默认值保持原来的纸感。
   注意顺序：可变字体（Noto …）必须排在前面。本机同时装了静态的
   "Source Han Serif SC"，它没有 wght 轴，排前面会让字重调节完全失效。 */
html[data-site-font="sans"] { --serif: "Microsoft YaHei", "PingFang SC", sans-serif; --ui-serif: "Microsoft YaHei", "PingFang SC", sans-serif; }
html[data-site-font="system"] { --serif: system-ui, sans-serif; --ui-serif: system-ui, sans-serif; }
.protyle-wysiwyg { font-size:var(--body-font-size,16px); }
.protyle-wysiwyg .p, .protyle-wysiwyg .list { line-height:var(--body-line-height,1.9); }

html[data-site-font="source-serif"] { --serif: "Noto Serif SC", "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif CN", "思源宋体", "Songti SC", serif; --ui-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif; }
html[data-site-font="source-sans"] { --serif: "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", "Source Han Sans CN", "思源黑体", "Microsoft YaHei", sans-serif; --ui-serif: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }

.db-table__row[hidden],
.db-group[hidden] { display: none !important; }

/* 图片封面不添加黑色渐变遮罩，保留原图亮度。 */
.cover--image::after, .hero--image::after, .cover--hero.cover--image::after { background:none; }

/* 六级标题：编号只用于显示，不改写思源正文。编号字号跟标题一致（显式写 inherit，避免被继承链上的字号带跑）。 */
.protyle-wysiwyg :is(.h1,.h2,.h3,.h4,.h5,.h6)[data-heading-number]::before { content: attr(data-heading-number) "  "; color:var(--accent); margin-right:.28em; font-variant-numeric:tabular-nums; font-size:var(--heading-number-size, inherit); line-height:inherit; }
.protyle-wysiwyg .h1 { margin:0; font-size:28px; line-height:1.35; font-weight:700; color:var(--ink); }
/* 跳转到某个块（引用 / 关系 / 大纲）时，块停在视口顶部并留一点空隙，不要顶死。 */
.protyle-wysiwyg .eblock,
.protyle-wysiwyg [data-id],
.db-record-target,
#blocks [id] { scroll-margin-top: 20px; }

/* 跳转落点高亮：点引用块 / 块链接 / 大纲后，目标块闪一下，1.6 秒后自动消失。
   用一层「向外扩开的浮动框」（::after 绝对定位）来画，所以框比正文略大、文字四周
   留出内边距，看起来像一张卡片；因为不占布局，块间距和排版一个像素都不动。
   和左栏文档树（treeLocate）、数据库卡片行同一个节奏。 */
.protyle-wysiwyg .eblock.is-located { z-index: 1; }
.protyle-wysiwyg .eblock.is-located::after {
  content: "";
  position: absolute;
  inset: -12px -26px;
  min-height: 44px;
  border-radius: 14px;
  pointer-events: none;
  animation: blockLocate 1.6s ease;
}
@keyframes blockLocate {
  0%, 100% { background: transparent; box-shadow: inset 0 0 0 0 rgba(122, 10, 10, 0); }
  14%, 62% {
    background: rgba(122, 10, 10, .05);
    box-shadow: inset 0 0 0 2px rgba(122, 10, 10, .26);
  }
}
/* 系统开了「减少动态效果」：不做闪烁，静态描边停 1.6 秒 */
@media (prefers-reduced-motion: reduce) {
  .protyle-wysiwyg .eblock.is-located::after {
    animation: none;
    background: rgba(122, 10, 10, .05);
    box-shadow: inset 0 0 0 2px rgba(122, 10, 10, .26);
  }
}
.protyle-wysiwyg .h4 { margin:0; font-size:17px; line-height:1.5; font-weight:600; color:var(--ink); }
.protyle-wysiwyg .h5 { margin:0; font-size:15.5px; line-height:1.5; font-weight:600; color:var(--ink); }
.protyle-wysiwyg .h6 { margin:0; font-size:14px; line-height:1.5; font-weight:600; color:var(--ink-2); }
/* 六级标题的字号与思源一致（1.75 / 1.55 / 1.38 / 1.25 / 1.13 / 1em），
   跟着正文字号缩放；不再提供逐级自定义（文档标题仍可单独设置）。 */
.protyle-wysiwyg .h1 { font-size:1.75em; }
.protyle-wysiwyg .h2 { font-size:1.55em; }
.protyle-wysiwyg .h3 { font-size:1.38em; }
.protyle-wysiwyg .h4 { font-size:1.25em; }
.protyle-wysiwyg .h5 { font-size:1.13em; }
.protyle-wysiwyg .h6 { font-size:1em; }
/* 标题不再有专属的上下间距：和正文、分割线、数据库一样，只吃统一的 --block-gap。 */

/* 正文普通超链接：常态跟正文同色，只用一条细实线下划线；悬停才变成暗红并加深下划线（不再有底色）。 */
.protyle-wysiwyg a[href]:not(.ref):not(.block-hyperlink):not([href^="siyuan://blocks/"]):not(.tag-inline):not(.tag-pill) {
  color: inherit;
  border-bottom: 0;
  text-decoration: underline;
  text-decoration-color: rgba(122, 10, 10, .45);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .15s, text-decoration-color .15s;
}
.protyle-wysiwyg a[href]:not(.ref):not(.block-hyperlink):not([href^="siyuan://blocks/"]):not(.tag-inline):not(.tag-pill):hover {
  color: var(--accent);
  background: transparent;
  text-decoration-color: var(--accent);
}
/* 数据库里的卡片 / 表格行 / 标题本身就是链接：一律不要下划线（包括波浪线） */
.cards-block a[href],
.cards-block a[href]:hover,
.cards-block a[href]:focus,
.cards-block a[href]:active { text-decoration: none !important; border-bottom: 0; }

/* 文档标题 / 标签 / 正文三段间距，分别由工作台设置控制。 */
.doc__title { margin-bottom: var(--title-body-gap, 12px); }
.doc--notags .doc__title { margin-bottom: var(--title-body-gap, 12px); }
.doc:not(.doc--hero) > .doc__title:has(+ .doc__tags) { margin-bottom: var(--title-tag-gap, 8px); }
.doc:not(.doc--hero) > .doc__title + .doc__tags { margin-bottom: var(--tag-body-gap, var(--title-body-gap, 12px)); }
.document-icon { display:inline-block; width:1em; height:1em; vertical-align:-.13em; flex:none; }
.tree__glyph .document-icon, .tab__icon .document-icon, .db-list__glyph .document-icon { width:14px; height:14px; }
.cover__glyph .document-icon, .cover__hero-art .document-icon, .card__glyph .document-icon { width:.8em; height:.8em; }

/* 思源里的行内字号照原样保留（2026-11-01 用户确认：富文本要同步过来）。
   标题序号的字号由 JS 按「标题里最大那段文字」单独设定，见 --heading-number-size。 */
.protyle-wysiwyg :is(.bq,.callout__body) { line-height:var(--body-line-height,1.9); }
.protyle-wysiwyg > :is(.h1,.h2,.h3,.h4,.h5,.h6):first-child { margin-top:0; }
.protyle-wysiwyg > .eblock:first-child > :is(.h1,.h2,.h3,.h4,.h5,.h6) { margin-top:0; }
/* 统一块间距：所有块（段落 / 标题 / 分割线 / 数据库 / 表格 / 图片 / 引用…）之间的
   垂直距离只由 --block-gap 决定。各块自身的外边距一律清零，否则会叠加出不同的间距
   （以前段落 4px、标题 7/24px、分割线 20/40px，同一个值调不出统一节奏）。 */
.protyle-wysiwyg > * + * { margin-top: var(--block-gap, 12px); }
/* .eblock 在 studio.css 里写了 margin:0（两端共用），特异性相同、后加载会盖掉上面那行，
   所以这里用 > .eblock + .eblock 把它压回来。 */
.protyle-wysiwyg > .eblock + .eblock { margin-top: var(--block-gap, 12px); }
.protyle-wysiwyg .eblock > :not(.eblock__tools) { margin-block: 0; }
/* 引用 / 提示框 / 超级块内部的块也用同一个间距 */
.protyle-wysiwyg :is(.bq, .callout, .sb) > * + * { margin-top: var(--block-gap, 12px); }
/* 超级块分栏：导入时把列信息挂在子块上，渲染时包成 CSS Grid；手机上堆成一列。 */
.protyle-wysiwyg .sb--cols {
  display: grid;
  grid-template-columns: var(--sb-cols, repeat(2, minmax(0, 1fr)));
  gap: 20px;
  align-items: start;
}
.protyle-wysiwyg .sb__col { min-width: 0; }
.protyle-wysiwyg .sb__col > * + * { margin-top: var(--block-gap, 12px); }
.protyle-wysiwyg .sb__col > .eblock + .eblock { margin-top: var(--block-gap, 12px); }
@media (max-width: 900px) {
  .protyle-wysiwyg .sb--cols { grid-template-columns: 1fr !important; gap: 0; }
}
@media print {
  .protyle-wysiwyg .sb--cols { grid-template-columns: 1fr !important; }
}
.db-title--link { border:0; padding:0; background:none; text-align:left; cursor:pointer; color:inherit; font:inherit; }

/* 阅读端多级文档目录。 */
.tree__branch { margin:0; }
.tree__branch > summary { list-style:none; padding-left:calc(8px + var(--tree-depth, 0) * 14px); }
.tree__branch > summary::-webkit-details-marker { display:none; }
.tree__branch > summary .tree__caret { flex:none; width:13px; height:13px; display:grid; place-items:center; color:var(--ink-3); }
.tree__branch[open] > summary .tree__caret { transform:rotate(90deg); }
.tree__branch-link { display:flex; align-items:center; flex:1; min-width:0; gap:8px; padding:0; border:0; background:transparent; color:inherit; font:inherit; text-align:left; text-decoration:none; cursor:pointer; }
.tree__nested-leaf { padding-left:calc(8px + var(--tree-depth, 0) * 14px); }

.tree__nested-leaf > .tree__caret { flex:none; width:13px; height:13px; opacity:0; }

/* 阅读端把工作台里的按钮换成了 <a>：这些元素两端都不该有下划线，颜色也不该吃浏览器默认值。
   只用单个类名（最低优先级）写，:hover 的下划线规则仍然能覆盖它。 */
.rel-item { color: var(--ink-2); }
.brand, .tree__item, .tool, .rel-item, .card, .tree__branch-link, .tree__folder-name,
.icon, .foot-toggle, .tree__tags-bottom .tree__item { text-decoration: none; }

/* ---------- 字重：正文与标题分开（300–800，跟随可变字体的 wght 轴） ---------- */
.protyle-wysiwyg { font-weight: var(--body-weight, 400); }
.protyle-wysiwyg .h1,
.protyle-wysiwyg .h2,
.protyle-wysiwyg .h3,
.protyle-wysiwyg .h4,
.protyle-wysiwyg .h5,
.protyle-wysiwyg .h6,
.protyle-wysiwyg .doc__title { font-weight: var(--heading-weight, 600); }

/* ============================== 灯箱（2026-11-10 重做）==============================
   只做四件事：**缩略图快速选择 / Ctrl+滚轮缩放 / 滚轮翻页 / Ctrl+左键拖动平移**。
   这一版刻意**删掉了**上一版的顶部胶囊工具条（− ＋ 适应 1:1 下载 ↗ ⋯）、图片读数、
   底部图注、左右箭头按钮、双击缩放、键盘翻页 / 缩放快捷键、全屏、旋转翻转、复制、
   bare 收起栏、下滑关闭、左右滑跟手 —— 只留用户点名要的四件。
   离开这张图只有三条路：Esc、点图片外的空白、右上角 ×。

   两个必须写进注释的实情：
   1. `.lightbox__stage` 放大后要能滚，所以**必须** justify-content:flex-start
      （居中会把溢出部分落到负向坐标，scrollLeft 到不了，左半边永远看不到）。
   2. 鼠标不按 Ctrl 拖动时**不能**做任何事，也不能让随后的 click 把灯箱关掉
      —— 这在 v2 时害过：桌面按住图往下拖会把灯箱关掉。 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  /* 深底带一点暖调，和纸面气质一致；不透明，避免正文透上来干扰看片 */
  background: #121110;
  overscroll-behavior: contain;
  user-select: none;
  /* 手机：整块面板不参与浏览器的原生 pan / zoom，否则双指捏合会被浏览器抢走 */
  touch-action: none;
}
.lightbox[hidden] { display: none; }

/* 暗角：四周压暗，视线聚到图片上 */
.lightbox__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, .5) 100%);
}
body.is-lightbox { cursor: default; }
/* 纸面颗粒（body::after）在灯箱里会糊在照片上：打开时先摘掉 */
body.is-lightbox::after { opacity: 0; }
/* 封面 / 正文图片给个「可放大」的手型提示 */
.cover__img, .figure img { cursor: zoom-in; }

/* 关闭：右上角一颗，任何时候都能点到（含手机安全区） */
.lightbox__close {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(14px + env(safe-area-inset-right, 0px));
  z-index: 6;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
  background: rgba(20, 20, 20, .62);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, .82);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  /* 逃生入口不加过渡：冻结窗口里过渡不推进会让它永远看不见（踩坑 P31） */
}
.lightbox__close:hover,
.lightbox__close:focus-visible { background: rgba(255, 255, 255, .16); color: #fff; }

/* 舞台（2026-11-12 重做）：永远 overflow: hidden —— 不再把它变成滚动容器。
   为什么：用户报「一放大就突然跳到左上角」与「放大到一定程度就出现上下 / 左右滚动条」。
   旧实现为了能滚到 scrollLeft=0，把布局改成 flex-start + margin:0，
   图还没超出舞台时就从居中跳到左上；一超出就露出滚动条。
   现在编放由 JS 写 translate 平移，范围由 lightboxClampPan() 夹住。 */
.lightbox__frame {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}
.lightbox__stage {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  touch-action: none;
}
/* 图片：适应屏幕时靠 max-width/height 缩进舞台，四周用 margin 留白（替代被去掉的 padding） */
.lightbox__img {
  display: block;
  /* 不许被 flex 压缩：放大时宽高由 JS 写死，容器装不下就该溢出（由 translate 挪），
     而不是被挤回适应尺寸 */
  flex: 0 0 auto;
  max-width: calc(100% - 48px);
  max-height: calc(100% - 32px);
  width: auto;
  height: auto;
  object-fit: contain;
  margin: auto;
  border-radius: 3px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .62);
  cursor: zoom-in;
  -webkit-user-drag: none;
}
/* 放大：宽高由 JS 写死；居中由 flex 负责，位移由 JS 写 translate（不再用滚动容器） */
.lightbox__img.is-actual {
  max-width: none;
  max-height: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: grab;
}
/* 按住 Ctrl：光标变成「可拖动」，松开就变回抓手/放大镜 */
.lightbox.is-ctrl .lightbox__img { cursor: grab; }
.lightbox.is-panning .lightbox__img { cursor: grabbing; }

/* 缩略图条：底部一条，多图时才出现；两侧渐隐暗示还能滚 */
.lightbox__thumbs {
  position: relative;
  z-index: 4;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px calc(14px + env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) calc(14px + env(safe-area-inset-left, 0px));
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}
.lightbox__thumbs[hidden] { display: none; }
.lightbox__thumbs::-webkit-scrollbar { height: 0; display: none; }
.lightbox__thumb {
  flex: none;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, .05);
  cursor: pointer;
  opacity: .48;
  transition: opacity .16s, border-color .16s, box-shadow .16s;
}
.lightbox__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox__thumb:hover { opacity: .8; }
.lightbox__thumb.is-on {
  opacity: 1;
  border-color: rgba(255, 255, 255, .82);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .3), 0 10px 24px rgba(0, 0, 0, .45);
}

/* 键盘焦点：深底上要看得见 */
.lightbox :is(button, [tabindex]):focus-visible {
  outline: 2px solid rgba(255, 255, 255, .8);
  outline-offset: 2px;
}

/* 手机：关闭按钮 44px 命中区、缩略图 44px、四周留白收窄 */
@media (max-width: 900px) {
  .lightbox__close {
    width: 44px;
    height: 44px;
    font-size: 17px;
    top: calc(8px + env(safe-area-inset-top, 0px));
    right: calc(10px + env(safe-area-inset-right, 0px));
  }
  .lightbox__img { max-width: calc(100% - 24px); max-height: calc(100% - 24px); }
  .lightbox__thumbs { padding-top: 8px; }
  .lightbox__thumb { width: 44px; height: 44px; }
}

/* 系统开了「减少动态效果」：缩略图不做过渡 */
@media (prefers-reduced-motion: reduce) {
  .lightbox__thumb { transition: none; }
}

/* ============================== 命中区（桌面 32px）==============================
   2026-11-04：把桌面端「看得见但点不准」的小控件扩到 32px 热区。
   实测修复前的真实尺寸：页脚「?」18×18、「动效」43×18、面包屑高 14、
   正文折叠箭头 18×18（全站 782 个）、侧栏折叠箭头 13×13。

   做法一律用**不可见的 ::after 撑开热区**，不改元素本身的视觉尺寸 ——
   直接把 min-width 撑到 32 会让「动效」变成大胶囊、面包屑撑破封面、折叠箭头压住正文。
   移动端（≤900px）已在 studio.css 里单独扩到 44px，这里的 32 是桌面标准（WCAG 2.2 AA 要求 24）。 */

/* 页脚一带：关于「?」、「源码」小胶囊、「动效」开关 */
.icon,
.foot-src,
.foot-toggle {
  position: relative;
}
.icon::after,
.foot-src::after,
.foot-toggle::after,
.cover__crumb .crumb-link::after,
.doc__crumb .crumb-link::after,
.crumbs .crumb-link::after,
.eblock__fold::after,
.tree__caret::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100%, 32px);
  height: max(100%, 32px);
  transform: translate(-50%, -50%);
  /* 热区只负责「接住点击」，不影响布局与观感 */
  border-radius: 8px;
}

/* 面包屑是行内元素，要 relative 才有定位基准 */
.cover__crumb .crumb-link,
.doc__crumb .crumb-link,
.crumbs .crumb-link {
  position: relative;
}

/* 正文标题折叠箭头（absolute 定位，热区跟着走）与侧栏折叠箭头 */
.eblock__fold {
  position: absolute;
}
.tree__caret {
  position: relative;
}

/* 2026-11-09：键帽样式的块链接（思源的 `text kbd a`）
   外观要和普通键帽一模一样（纸白渐变、1px 边 + 2px 底边、5px 圆角、82% 字号），
   只是它能点、能跳到对应的块。所以这里把链接那一层的下划线 / 悬停底色全部摘掉，
   只在悬停时把键帽底色压深一档、指针变手型，让人知道「这个键帽可以点」。 */
.protyle-wysiwyg .block-hyperlink--kbd,
.protyle-wysiwyg a.block-hyperlink--kbd {
  text-decoration: none;
  border-bottom: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.protyle-wysiwyg .block-hyperlink--kbd:hover,
.protyle-wysiwyg a.block-hyperlink--kbd:hover {
  text-decoration: none;
  background: transparent;
  color: inherit;
}
/* 悬停时只改键帽自己：底色深一点、底边显出来，和「按下去」的手感一致 */
.protyle-wysiwyg .block-hyperlink--kbd > span > kbd,
.protyle-wysiwyg .block-hyperlink--kbd > kbd,
.protyle-wysiwyg a.block-hyperlink--kbd:hover > span > kbd {
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.protyle-wysiwyg .block-hyperlink--kbd:hover > span > kbd,
.protyle-wysiwyg .block-hyperlink--kbd:hover > kbd {
  background: linear-gradient(180deg, #f7f4ec, #e9e4d8);
  border-color: rgba(122, 10, 10, .28);
  border-bottom-color: rgba(122, 10, 10, .42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
}
.protyle-wysiwyg .block-hyperlink--kbd:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* 2026-11-09：键帽链接的字号要和其他键帽一致。
   思源给这个 span 写了 `style="font-size: 12px"`，键帽按 82% 缩放后只有 9.84px，
   而同页其它键帽是 13.12px（16px × 82%），看起来明显小一号（用户要求「外观和其他键盘块一样」）。
   这里把那一层的字号收回正文（inherit），键帽就回到和其它键帽同一档。
   注意只作用于「键帽 + 链接」这一种组合，普通链接的行内字号照旧。 */
.protyle-wysiwyg .block-hyperlink--kbd > span,
.protyle-wysiwyg a.block-hyperlink--kbd > span {
  font-size: inherit !important;
}

/* 2026-11-09：落点提示「已定位到：XXX」
   远距离跳转（一屏以上）时，红框可能在滚动途中不容易被注意到；
   到位瞬间在屏幕**底部**弹出这一行很淡的胶囊，和红框同节奏消失（1.7 秒）。

   为什么放底部（用户 2026-11-09 要求）：顶部是正文的第一条，一条横贯的胶囊
   正好压住「刚滚过去要读的那一段」；底部是阅读时的空白带，弹出来不挡内容。
   和 toast 的高度错开（toast 44px、这里 82px，两条同时出现也不叠，见 studio.css 的 .studio-toast）。
   z-index 70：高于移动端抽屉（63）与遮罩（62），低于「更多」面板（80）——
   手机上从抽屉里点大纲时提示才不会被抽屉盖住。
   不是模态、不挡点击、不占布局。 */
.locate-hint {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(10px);
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(122, 10, 10, .22);
  background: rgba(246, 244, 238, .94);
  box-shadow: 0 6px 20px rgba(23, 23, 23, .12);
  backdrop-filter: blur(6px);
  color: var(--accent);
  font: 500 12px/1.4 var(--sans);
  letter-spacing: .02em;
  max-width: min(520px, calc(100% - 48px));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
}
.locate-hint.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 900px) {
  /* 手机上底部要避开浏览器工具栏 / 手势条 */
  .locate-hint { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); font-size: 11.5px; padding: 5px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .locate-hint { transition: none; }
}

/* 捏合中：光标不变，但要拦住文本选择 */
.lightbox.is-pinch .lightbox__img { cursor: default; }
