/* NoteLoom publish theme */
:root {
  --bg: 255 255 255;
  --bg-subtle: 248 249 250;
  --fg: 15 23 42;
  --fg-muted: 85 103 128;
  --fg-subtle: 148 163 184;
  --border: 226 232 240;
  --accent: 51 122 241;
  --accent-text: 37 99 235;
  --error: 220 38 38;
  --warning: 217 119 6;
  --success: 22 163 74;
  /* callout 专属调色板（镜像 index.css；9 色相对齐 Obsidian 默认，别名已在
     alertDetect 归一到 13 规范类型） */
  --callout-blue: 51 122 241;
  --callout-cyan: 8 145 178;
  --callout-teal: 13 148 136;
  --callout-green: 22 163 74;
  --callout-yellow: 202 138 4;
  --callout-orange: 217 119 6;
  --callout-red: 220 38 38;
  --callout-purple: 124 58 237;
  --callout-gray: 100 116 139;
  --code-bg: 241 245 249;
  --code-fg: 51 65 85;
  --quote-bar: 203 213 225;
  --table-border: 226 232 240;
  --highlight-bg: 255 243 163;
  --highlight-fg: 31 41 55;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: 15 23 42;
    --bg-subtle: 30 41 59;
    --fg: 241 245 249;
    --fg-muted: 148 163 184;
    --fg-subtle: 100 116 139;
    --border: 51 65 85;
    --accent: 106 170 255;
    --accent-text: 106 170 255;
    --error: 248 113 113;
    --warning: 251 191 36;
    --success: 74 222 128;
    --callout-blue: 106 170 255;
    --callout-cyan: 34 211 238;
    --callout-teal: 45 212 191;
    --callout-green: 74 222 128;
    --callout-yellow: 234 179 8;
    --callout-orange: 251 191 36;
    --callout-red: 248 113 113;
    --callout-purple: 167 139 250;
    --callout-gray: 148 163 184;
    --code-bg: 30 41 59;
    --code-fg: 226 232 240;
    --quote-bar: 71 85 105;
    --table-border: 51 65 85;
    --highlight-bg: 212 184 80;
    --highlight-fg: 23 30 46;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: rgb(var(--bg));
  color: rgb(var(--fg));
  font-family: "Inter", "Noto Sans SC", system-ui, -apple-system, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.75;
}

.nl-page { min-height: 100vh; display: flex; flex-direction: column; }

/* 页头顶栏：左 NoteLoom 品牌（logo + 名）+ 右「用 NoteLoom 打开」两端对齐，
   通栏细分隔线压住页头。品牌是产品标识，集合名/页数在侧栏头，二者语义不重复。
   零 JS——纯 <a> 链接。 */
.nl-topbar { width: 100%; border-bottom: 1px solid rgb(var(--border)); }
.nl-topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; max-width: 1080px; margin: 0 auto; padding: 0.85rem 1.5rem;
}
.nl-tb-site { display: inline-flex; align-items: center; gap: 9px; min-width: 0; text-decoration: none; }
.nl-tb-glyph {
  width: 26px; height: 26px; border-radius: 7px; flex: none; overflow: hidden;
  background: #fff; border: 1px solid rgb(var(--border));
  display: inline-flex; align-items: center; justify-content: center;
}
.nl-tb-glyph img { width: 100%; height: 100%; display: block; object-fit: contain; }
.nl-tb-name { font-size: 0.9rem; font-weight: 650; color: rgb(var(--fg)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nl-tb-site:hover .nl-tb-name { text-decoration: underline; }
.nl-open-app {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 0.8125rem; font-weight: 500; color: rgb(var(--fg-muted)); text-decoration: none;
  border: 1px solid rgb(var(--border)); border-radius: 8px;
  padding: 0.34rem 0.8rem; white-space: nowrap;
  transition: color .14s, border-color .14s, background-color .14s;
}
.nl-open-app svg { width: 14px; height: 14px; color: rgb(var(--fg-subtle)); transition: color .14s; }
.nl-open-app:hover { background: rgb(var(--accent) / 0.08); color: rgb(var(--accent-text)); border-color: rgb(var(--accent) / 0.35); }
.nl-open-app:hover svg { color: rgb(var(--accent-text)); }
/* 分享时限（ADR-029）：顶栏右组 = 相对倒计时片 +「打开」按钮。倒计时片默认
   隐藏（无 is-live），shareLifeScript 现算天数后加 is-live 显出——静态页零 JS
   下无法真实递减，故无 JS 时片保持隐藏、由页脚绝对到期日兜底。≤2 天转琥珀。 */
.nl-tb-right { display: inline-flex; align-items: center; gap: 14px; flex: none; }
.nl-share-life {
  display: none; align-items: center; gap: 5px; flex: none;
  font-size: 0.8rem; font-weight: 500; color: rgb(var(--fg-muted)); white-space: nowrap;
}
.nl-share-life.is-live { display: inline-flex; }
.nl-share-life svg { width: 13px; height: 13px; flex: none; color: rgb(var(--fg-subtle)); }
.nl-share-life.warn { color: rgb(var(--warning)); font-weight: 600; }
.nl-share-life.warn svg { color: rgb(var(--warning)); }
@media (max-width: 560px) { .nl-share-life.is-live { display: none; } }
.nl-layout { display: flex; flex: 1; gap: 2.25rem; width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }
.nl-doc { flex: 1; min-width: 0; max-width: 720px; margin: 0 auto; padding: 2.5rem 0 4rem; }

/* 整站侧栏导航（卡 07-A/C，单篇无）：<details open> 外壳。桌面 ≥861px = 240px
   sticky 侧栏、恒展开、summary 当站名头不可折叠；<860px = 顶部折叠导航（原生
   details/summary，零 JS）。 */
.nl-site-nav {
  width: 240px; flex: none;
  background: rgb(var(--bg-subtle));
  border-right: 1px solid rgb(var(--border));
  position: sticky; top: 0; align-self: flex-start;
  max-height: 100vh; overflow-y: auto;
  /* 深层级护栏：树行缩进 depth*16+7 且图标 flex:none 不可压缩，depth≥11 会
     超出 240px 定宽（主程序面板可拖宽，静态站没有该退路）——横向裁掉而不是
     出横向滚动条（overflow-y:auto 会把 overflow-x 连带算成 auto） */
  overflow-x: hidden;
  font-size: 0.875rem;
  /* overlay 式滚动条：默认极淡近乎隐形，鼠标进侧栏才浮现，悬停轨道再加深。
     Firefox 只能 thin + 半透明色；WebKit 走 6px 细条 + 2px 内缩透明边。 */
  scrollbar-width: thin;
  scrollbar-color: rgb(var(--fg) / 0.12) transparent;
  scrollbar-gutter: stable;
}
.nl-site-nav::-webkit-scrollbar { width: 8px; }
.nl-site-nav::-webkit-scrollbar-track { background: transparent; }
.nl-site-nav::-webkit-scrollbar-thumb {
  background: rgb(var(--fg) / 0.09);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.nl-site-nav:hover::-webkit-scrollbar-thumb { background: rgb(var(--fg) / 0.18); background-clip: padding-box; }
.nl-site-nav::-webkit-scrollbar-thumb:hover { background: rgb(var(--fg) / 0.3); background-clip: padding-box; }
.nl-nav-summary {
  list-style: none; display: flex; align-items: center; gap: 0.5rem;
  padding: 1.05rem 1rem 0.75rem; margin-bottom: 0.35rem;
  border-bottom: 1px solid rgb(var(--border));
}
.nl-nav-summary::-webkit-details-marker { display: none; }
/* 侧栏头 = 集合标识：文件夹图标 + 集合名 + 页数（顶栏放产品品牌，这里放集合归属）。
   分享页里站名不是链接（回首页走顶栏品牌）；官方站点的品牌标指官网，站名就是回这个站首页的
   <a>。宽屏 summary 整个 pointer-events:none（见下），链接要单独放开才点得到。 */
.nl-nav-hd-ico { width: 15px; height: 15px; flex: none; color: rgb(var(--fg-muted)); }
.nl-nav-title {
  flex: 1; min-width: 0; font-size: 0.8rem; font-weight: 650; letter-spacing: 0.005em;
  color: rgb(var(--fg)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
a.nl-nav-title { text-decoration: none; pointer-events: auto; }
a.nl-nav-title:hover { text-decoration: underline; }
.nl-nav-count { margin-left: auto; flex: none; font-size: 0.7rem; font-variant-numeric: tabular-nums; color: rgb(var(--fg-muted)); }
.nl-nav-toggle { display: none; }
.nl-nav-body { padding: 7px 8px 2rem; }
/* 侧栏文件树：单行时与主程序左栏树同规格——31px 行高、8px 圆角 pill、13px 字；
   缩进由生成器写行内 padding-left（depth*16+7），pill 高亮全宽。
   目录行 = <summary>（嵌套 details 可折叠零 JS），页面行 = <a>。
   ‼️ 长名**换行**，不截成省略号：主程序的左栏能拖宽，静态站的侧栏定宽 240px、没有这条退路，
   截断之后访客无论如何都看不到后半截（法律库实测：「澳门特别行政区驻军…」一类几十篇只剩前缀、
   彼此分不出来）。单行高度不变（上下 6px + 行高 19px = 31px），图标按第一行居中。 */
.nl-nav-row {
  display: flex; align-items: flex-start; gap: 8px; position: relative;
  min-height: 31px; margin: 1px 0; padding-top: 6px; padding-bottom: 6px; padding-right: 8px;
  border-radius: 8px; font-size: 13px; line-height: 19px;
  color: rgb(var(--fg-muted)); text-decoration: none;
  user-select: none;
  transition: background-color 0.12s, color 0.12s;
}
summary.nl-nav-row { cursor: pointer; list-style: none; }
summary.nl-nav-row::-webkit-details-marker { display: none; }
.nl-nav-row:hover { background: rgb(var(--fg) / 0.05); color: rgb(var(--fg)); text-decoration: none; }
.nl-nav-row:hover .nl-nav-ico { color: rgb(var(--fg-muted)); }
.nl-nav-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* chevron 开合翻转（带 0.15s 过渡；文件夹图标仍双图标瞬时替换，两者叠加）。
   margin-top 让图标对齐第一行的中线（行高 19px：chevron (19-11)/2，图标 (19-15)/2） */
.nl-nav-chev { width: 11px; height: 11px; margin-top: 4px; flex: none; color: rgb(var(--fg-muted)); transition: transform 0.15s; }
.nl-nav-dir[open] > summary .nl-nav-chev { transform: rotate(90deg); }
.nl-nav-ico { width: 15px; height: 15px; margin-top: 2px; flex: none; color: rgb(var(--fg-muted)); }
.nl-nav-pad { width: 11px; flex: none; }
/* 嵌套缩进导引线：目录下页面行左侧一条淡竖线（选中行除外——选中用左强调条） */
.nl-nav-dir > a.nl-nav-row:not(.nl-nav-current)::before {
  content: ""; position: absolute; left: 14px; top: -1px; bottom: -1px;
  width: 1px; background: rgb(var(--border));
}
/* 文件夹开/合两枚图标同时在 DOM，按 details[open] 显隐（零 JS 换图标） */
.nl-nav-fo { display: none; }
.nl-nav-dir[open] > summary .nl-nav-fo { display: block; }
.nl-nav-dir[open] > summary .nl-nav-fc { display: none; }
/* 当前页与主程序「选中行」同规则（#17 纪律①）：accent/.14 底 + font-medium +
   左 inset 2px accent 条（::before，不挤缩进）+ 图标 accent 色 */
.nl-nav-current, .nl-nav-current:hover {
  background: rgb(var(--accent) / 0.12); color: rgb(var(--fg)); font-weight: 600;
}
.nl-nav-current::before {
  content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 3px;
  border-radius: 0 3px 3px 0; background: rgb(var(--accent));
}
.nl-nav-current .nl-nav-ico { color: rgb(var(--accent-text)); }
/* 桌面：details 恒展开当侧栏，summary 锁死不可折叠（站名链接除外，
   pointer-events 只挡鼠标）。键盘 Tab 到 summary 按 Enter 仍会切 open 态——
   details 闭合的内容隐藏是 UA 内部机制（::details-content 的
   content-visibility:hidden），子元素 display 覆盖不了；这里用
   ::details-content 直接钉住恒显（Chromium 131+/Firefox 138+ 渐进生效，
   老浏览器退化为「Enter 收起、再 Enter 复原」，焦点仍在 summary 不致丢树）。 */
@media (min-width: 861px) {
  .nl-nav-summary { cursor: default; pointer-events: none; }
  .nl-site-nav::details-content { content-visibility: visible; }
}
/* 窄屏 <860px：顶部折叠导航，展开把正文下推（非浮层） */
@media (max-width: 860px) {
  .nl-layout { flex-direction: column; gap: 0; }
  .nl-site-nav {
    width: auto; position: static; max-height: none; overflow: visible;
    /* align-self 复位（基础规则的 flex-start 在 column 布局里会让 nav 按
       max-content 自适应宽、深层级时撑出页面横滚）；深层级横向裁掉
       （clip 不产生滚动容器，纵向保持 visible） */
    align-self: auto; overflow-x: clip;
    border-right: 0; border-bottom: 1px solid rgb(var(--border));
  }
  .nl-nav-summary { cursor: pointer; padding: 0.7rem 1rem; margin-bottom: 0; }
  .nl-nav-count { display: none; }
  .nl-nav-toggle {
    display: inline-flex; align-items: center; gap: 5px; margin-left: auto; flex: none;
    border: 1px solid rgb(var(--border)); border-radius: 999px;
    padding: 4px 11px; font-size: 0.72rem; color: rgb(var(--fg-muted));
  }
  .nl-nav-toggle svg { width: 12px; height: 12px; transition: transform 0.15s; }
  .nl-site-nav[open] .nl-nav-toggle svg { transform: rotate(180deg); }
  .nl-nav-body { padding: 0.25rem 7px 0.75rem; }
  .nl-nav-row { min-height: 34px; padding-top: 7px; padding-bottom: 8px; font-size: 13.5px; }
}

/* 站点根 landing 引导（卡 07，正文区；官方固定文案）：站名 + 元信息 + 提示 +
   「用 NoteLoom 打开」CTA */
.nl-intro { max-width: 460px; margin: 3rem auto; text-align: center; }
.nl-doc .nl-intro-title { font-size: 1.7rem; font-weight: 700; line-height: 1.3; margin: 0; }
.nl-intro-meta { font-size: 0.82rem; color: rgb(var(--fg-muted)); margin-top: 0.5rem; }
.nl-intro-hint { font-size: 0.9rem; color: rgb(var(--fg-muted)); margin: 1.1rem 0 0; }
/* 落地页 CTA：复用顶栏 .nl-open-app 结构，加 accent 淡底描边更醒目 */
.nl-intro-actions { margin-top: 1.75rem; }
.nl-intro-actions .nl-open-app {
  padding: 0.5rem 1.15rem; font-size: 0.875rem;
  background: rgb(var(--accent) / 0.1); color: rgb(var(--accent-text));
  border-color: rgb(var(--accent) / 0.3);
}
.nl-intro-actions .nl-open-app svg { color: rgb(var(--accent-text)); }
.nl-intro-actions .nl-open-app:hover { background: rgb(var(--accent) / 0.16); border-color: rgb(var(--accent) / 0.45); }

/* 标题（与 reading 排版 token 同档） */
.nl-doc h1, .nl-doc h2, .nl-doc h3, .nl-doc h4, .nl-doc h5, .nl-doc h6 {
  line-height: 1.35; margin: 1.6em 0 0.6em; scroll-margin-top: 1rem;
}
.nl-doc h1 { font-size: 1.875rem; font-weight: 700; margin-top: 0.8em; }
.nl-doc h2 { font-size: 1.28rem; font-weight: 650; }
.nl-doc h3 { font-size: 1.25rem; font-weight: 600; }
.nl-doc h4 { font-size: 1.125rem; font-weight: 600; }
.nl-doc h5 { font-size: 1rem; font-weight: 600; }
.nl-doc h6 { font-size: 0.875rem; font-weight: 600; color: rgb(var(--fg-muted)); }

.nl-doc p { margin: 0.5em 0; }
.nl-doc p.nl-blank-line { height: 1lh; margin: 0; }
.nl-doc a { color: rgb(var(--accent-text)); text-decoration: none; }
.nl-doc a:hover { text-decoration: underline; }
.nl-doc hr { border: 0; border-top: 1px solid rgb(var(--border)); margin: 1.5em 0; }
.nl-doc img { max-width: 100%; height: auto; border-radius: 6px; }

/* 列表与任务项 */
.nl-doc ul, .nl-doc ol { padding-left: 1.6em; margin: 0.5em 0; }
.nl-doc li { margin: 0.15em 0; }
.nl-doc li.task-list-item { list-style: none; margin-left: -1.6em; padding-left: 1.6em; }
.nl-doc li.task-list-item input[type="checkbox"] { margin-right: 0.45em; vertical-align: -0.15em; accent-color: rgb(var(--accent)); }

/* 引用（竖线视觉，不改字色——与 reading 同规则） */
.nl-doc blockquote {
  margin: 0.75em 0; padding: 0 0 0 1em;
  border-left: 3px solid rgb(var(--quote-bar));
}

/* 行内代码 / 代码块（reading 无语法高亮，纯文本同档） */
.nl-doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: rgb(var(--code-bg)); color: rgb(var(--code-fg));
  border-radius: 4px; padding: 0.1em 0.35em;
}
.nl-doc pre {
  background: rgb(var(--code-bg)); color: rgb(var(--code-fg));
  border: 1px solid rgb(var(--border)); border-radius: 9px;
  padding: 0.75rem 1rem; overflow-x: auto; margin: 0.75em 0;
  line-height: 1.6;
}
.nl-doc pre code { background: none; padding: 0; border-radius: 0; font-size: 0.875em; }

/* 带语言的代码块（卡 06）：.nl-codebox 包裹 + 右上语言角标 */
.nl-doc .nl-codebox { position: relative; margin: 0.9em 0; }
.nl-doc .nl-codebox pre { margin: 0; }
/* 语言角标带 code-bg 底片：长首行代码横向溢出到右上时不与角标叠字（角标不透明
   压住其下代码，本就是标签不是内容） */
.nl-doc .nl-codelang {
  position: absolute; top: 1px; right: 1px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; color: rgb(var(--fg-subtle)); user-select: none;
  pointer-events: none; white-space: nowrap;
  background: rgb(var(--code-bg)); padding: 6px 11px 4px 10px;
  border-radius: 0 9px 0 8px;
}

/* 表格（卡 06）：9px 圆角外框 + bg-subtle 表头，与代码块同一圆角档；
   内部仅底/列分隔线（无满格网格），末行去底线。
   display:block + overflow-x:auto 让宽表横向滚动（内部单元格仍走匿名 table 布局），
   但块级默认撑满容器——窄表会拉出满宽空框、内容缩左。故 width:fit-content 让边框
   按内容收缩，max-width:100% 仍封顶（宽表命中 100% + 溢出滚动，两不误）。 */
.nl-doc table {
  border-collapse: collapse; display: block; overflow-x: auto;
  width: fit-content; max-width: 100%; margin: 0.9em 0; font-size: 0.9375em;
  border: 1px solid rgb(var(--table-border)); border-radius: 9px;
}
.nl-doc th, .nl-doc td {
  padding: 0.5em 0.875em; text-align: left; vertical-align: top;
  border-bottom: 1px solid rgb(var(--table-border));
}
.nl-doc th + th, .nl-doc td + td { border-left: 1px solid rgb(var(--table-border)); }
.nl-doc tr:last-child td { border-bottom: 0; }
.nl-doc th { background: rgb(var(--bg-subtle)); font-weight: 600; }
.nl-doc td img { max-width: 240px; }

/* 扩展语法 */
.nl-doc mark { background: rgb(var(--highlight-bg)); color: rgb(var(--highlight-fg)); border-radius: 2px; padding: 0 0.1em; }
.nl-doc kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8em; border: 1px solid rgb(var(--border));
  border-bottom-width: 2px; border-radius: 4px; padding: 0.05em 0.4em;
  background: rgb(var(--bg-subtle));
}

/* wikilink：集内 = accent 链接；集外/坏链 = 点线样式化文本（无 href） */
.nl-doc a.wikilink { color: rgb(var(--accent-text)); }
.nl-doc .wikilink-unresolved {
  color: rgb(var(--fg-muted));
  border-bottom: 1px dotted rgb(var(--fg-subtle));
  cursor: default;
}
.nl-doc .nl-link-unresolved { color: rgb(var(--fg-muted)); }
.nl-doc .nl-img-missing {
  display: inline-block; color: rgb(var(--fg-muted));
  background: rgb(var(--bg-subtle)); border: 1px dashed rgb(var(--border));
  border-radius: 6px; padding: 0.1em 0.6em; font-size: 0.875em;
}

/* Callout（卡 06 + main 的 13 类型 callout 系统，镜像 index.css）：每类型只设
   --alert-c（指向 --callout-* 三元组），fg/淡底/边框在 .noteloom-alert 上按 --alert-c
   一次性派生（1px 同色/.3 全描边 + 左 3px 主色条 + 9px 圆角 + 同色/.08 淡底，暗色抬
   到 .16）。头部 .noteloom-alert-header 取主色加粗，正文字色不变（状态色纪律⑤）。
   发布页静态无折叠交互，图标随渲染层不落地（sanitizer 不放行 stroke-width）。 */
.nl-doc .noteloom-alert {
  --alert-c: var(--callout-blue);
  --alert-bg-a: 0.08;
  margin: 1.1em 0; padding: 12px 15px;
  border: 1px solid rgb(var(--alert-c) / 0.3);
  border-left: 3px solid rgb(var(--alert-c));
  background: rgb(var(--alert-c) / var(--alert-bg-a));
  border-radius: 9px;
}
@media (prefers-color-scheme: dark) {
  .nl-doc .noteloom-alert { --alert-bg-a: 0.16; }
}
.nl-doc .noteloom-alert-note,
.nl-doc .noteloom-alert-todo { --alert-c: var(--callout-blue); }
.nl-doc .noteloom-alert-abstract,
.nl-doc .noteloom-alert-info { --alert-c: var(--callout-cyan); }
.nl-doc .noteloom-alert-tip { --alert-c: var(--callout-teal); }
.nl-doc .noteloom-alert-success { --alert-c: var(--callout-green); }
.nl-doc .noteloom-alert-question { --alert-c: var(--callout-yellow); }
.nl-doc .noteloom-alert-warning { --alert-c: var(--callout-orange); }
.nl-doc .noteloom-alert-failure,
.nl-doc .noteloom-alert-danger,
.nl-doc .noteloom-alert-bug { --alert-c: var(--callout-red); }
.nl-doc .noteloom-alert-example { --alert-c: var(--callout-purple); }
.nl-doc .noteloom-alert-quote { --alert-c: var(--callout-gray); }
.nl-doc .noteloom-alert-header {
  font-size: 0.9em; font-weight: 600; line-height: 1.4;
  color: rgb(var(--alert-c)); margin: 0 0 0.25rem;
}
.nl-doc .noteloom-alert > p:last-child { margin-bottom: 0; }

/* 数学（KaTeX 自身样式由 katex.min.css 提供；这里只管容器） */
.nl-doc .noteloom-math-block { margin: 0.75em 0; overflow-x: auto; text-align: center; }
.nl-doc .noteloom-math-error {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: rgb(var(--error));
}

/* #5 Mermaid（发布 / PDF 也渲图）：renderNoteBodyHtml 把 mermaid 围栏块渲成
   div.nl-mermaid-embed 内嵌 svg（SVG 自带内联样式与主题色）。容器居中 + 响应式收缩；
   渲染失败退回的 pre 源码块走通用代码块样式。 */
.nl-doc .nl-mermaid-embed { margin: 0.75em 0; overflow-x: auto; text-align: center; }
.nl-doc .nl-mermaid-embed svg { max-width: 100%; height: auto; }
.nl-doc .nl-pub-embed {
  margin: 0.75em 0; border: 1px solid rgb(var(--border));
  border-radius: 9px; overflow: hidden;
}
.nl-doc .nl-pub-embed-header {
  padding: 0.35em 1em; background: rgb(var(--bg-subtle));
  font-size: 0.8125em; color: rgb(var(--fg-muted));
  border-bottom: 1px solid rgb(var(--border));
}
.nl-doc .nl-pub-embed-body { padding: 0.25em 1em 0.5em; }
.nl-doc .nl-pub-embed-body > :first-child { margin-top: 0.35em; }
.nl-doc .nl-pub-attachment {
  display: inline-block; margin: 0.35em 0; padding: 0.35em 0.9em;
  border: 1px solid rgb(var(--border)); border-radius: 8px;
  background: rgb(var(--bg-subtle)); color: rgb(var(--fg-muted));
  font-size: 0.875em;
}

/* 脚注区（卡 06）：remark-rehype 输出 section.footnotes + h2#footnote-label；
   渲染层把标题从 sr-only 转为 .nl-fn-label 小标，上加 96px 短分隔线 */
.nl-doc section.footnotes { margin-top: 2.75em; font-size: 0.875em; color: rgb(var(--fg-muted)); }
.nl-doc .nl-fn-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
  color: rgb(var(--fg-subtle)); margin: 0 0 8px;
}
.nl-doc .nl-fn-label::before {
  content: ""; display: block; width: 96px;
  border-top: 1px solid rgb(var(--border)); margin-bottom: 10px;
}
.nl-doc .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* 页脚：品牌标（logo + NoteLoom 字标，链接回首页）+ 下接发布声明 */
.nl-page-footer {
  border-top: 1px solid rgb(var(--border));
  padding: 2rem 1.5rem 2.25rem; text-align: center;
}
.nl-footer-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.nl-footer-glyph {
  width: 22px; height: 22px; border-radius: 6px; flex: none; overflow: hidden;
  background: #fff; border: 1px solid rgb(var(--border));
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .14s;
}
.nl-footer-glyph img { width: 100%; height: 100%; display: block; object-fit: contain; }
.nl-footer-mark {
  font-size: 14px; font-weight: 700; letter-spacing: 0.01em;
  color: rgb(var(--fg-muted)); transition: color .14s;
}
.nl-footer-brand:hover .nl-footer-mark { color: rgb(var(--fg)); }
.nl-footer-brand:hover .nl-footer-glyph { border-color: rgb(var(--fg) / 0.28); }
/* 分享时限页脚行（ADR-029）：绝对到期日，烤死即准、无需 JS——无 JS 时顶栏
   相对片隐藏，此行为唯一时限信息来源。≤2 天由 shareLifeScript 加 warn。 */
.nl-footer-life {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 11px; font-size: 12px; color: rgb(var(--fg-subtle));
}
.nl-footer-life svg { width: 13px; height: 13px; flex: none; }
.nl-footer-life.warn { color: rgb(var(--warning)); font-weight: 600; }
.nl-footer-line { margin-top: 9px; font-size: 12px; color: rgb(var(--fg-subtle)); }
.nl-footer-line a {
  color: rgb(var(--fg-muted));
  text-decoration: underline; text-underline-offset: 2px;
  text-decoration-color: rgb(var(--fg-subtle));
}
.nl-footer-line a:hover { color: rgb(var(--fg)); text-decoration-color: rgb(var(--fg)); }

/* 文档头（卡 06）：标题 + 更新时间元信息行 + 呼吸分隔线 */
.nl-doc .nl-dochead h1 { margin: 0; }
.nl-doc .nl-doc-meta {
  display: flex; align-items: center; gap: 7px;
  margin-top: 14px; font-size: 13px; color: rgb(var(--fg-muted));
}
.nl-doc .nl-doc-meta svg { flex: none; }
.nl-doc .nl-dochead-sep {
  border: 0; border-top: 1px solid rgb(var(--border)); margin: 24px 0 28px;
}
