@layer notes {
/* ===== 007 · 沉思 record shelf =============================================
   The notes page is a WebGL record-store shelf (public/js/notes-shelf.js).
   This layer owns the page shell, the DOM overlays (hero title, details
   panel, bottom catalogue nav) and the no-WebGL fallback list.
   ========================================================================== */

/* **作用域必须同时带上 page-works。** 这套货架（notes-shelf.js + works-shelf.ejs）
   早就改成服务 /works 了，元素 id 还叫 notes-shelf-* 只是没改名；而这些令牌当年
   只挂在 `.page-notes` 上。于是在 /works 上 `var(--ns-text)` 等一律取不到值，
   颜色回落到继承/初始值 —— 深色模式下目录里的作品标题实测是**纯黑压在深底上**
   （1.02:1，肉眼等于看不见）。 */
body.public-body.page-notes,
body.public-body.page-works {
  --ns-title: #3a352b;
  --ns-text: #4a453a;
  --ns-muted: rgba(74, 69, 58, 0.62);
  --ns-hairline: rgba(58, 53, 43, 0.16);
  --ns-btn-bg: #26231e;
  --ns-btn-ink: #f5f1e6;
}

html[data-theme="dark"] body.public-body.page-notes,
html[data-theme="dark"] body.public-body.page-works {
  --ns-title: #e8e2d2;
  --ns-text: #cfc9bb;
  --ns-muted: rgba(207, 201, 187, 0.55);
  --ns-hairline: rgba(232, 226, 210, 0.14);
  --ns-btn-bg: #e8e2d2;
  --ns-btn-ink: #17151a;
}

/* ── 作品页的页面骨架：一屏装得下，不留多余的空白 ──────────────────────
   Fred 2026-08-21：「works 我觉得目前太多空白了。你把上上下下一些空白给去掉，
   让下面的页面、底部栏啊什么的整体往上移，全部展示出来。」

   原来是：`.main-manju` 顶上 4rem + 5rem 的大标题 + 标题下 4rem，共 208px，
   再加一块写死 `100dvh - 172px`（= 728px）的舞台，最后才是 103px 的页脚 ——
   加起来 1039px，比 900px 高的视口高出 139px，页脚和作品目录**必须滚动才看得见**。

   现在：两段留白收窄成 2.5rem / 1.5rem（走 008 与 001 里那两个变量，不是在这里
   写 `.main-manju` —— 那条在 layer `about` 里，**层压过权重**，从这份表里改不动），
   舞台改成 flex 弹性填充。`body` 本来就是 `display:flex; flex-direction:column;
   min-height:100vh` 的粘性页脚布局（`main{flex:1 1 0}` / `footer{flex:0 1 auto}`），
   所以只要让 main 也变成纵向 flex、舞台 `flex:1`，舞台就正好吃掉「视口 − 标题 − 页脚」
   剩下的那一块，一个像素都不多。高度不用再算，换页脚高度、换标题字号都不会失准。 */
/* 作品页的**内容栏、顶部留白、标题** 2026-08-23 全部对齐其余页面。
   Fred：「works 的左上角顶部的导航栏的位置有点高，别的页面都是下去点的。
   然后为什么 works 还在中间，为什么不和其他页面统一风格。」

   其他页面的两段留白是：`body` 的 --page-top-pad（默认 clamp(2.25rem,5vw,4rem)，
   1920 下算出 64px）+ `.grand-container` 的 48px 内边距 = 面包屑落在 112px。
   作品页没有 .grand-container（它是 3D 画布，套不上列表页那套底盘），
   所以这里**把那 48px 补在自己的头部块上**，两段加起来同样是 112px。
   --page-top-pad 不再压到 2.5rem —— 当初压小是为了让页脚挤进一屏，
   而画布是 `flex:1 1 auto` 弹性填充的，多出来的 72px 由它自己让出来，
   works-hero-probe 会盯着书还在不在框里。

   ⚠️ **1320 / 48px 这两个数来自 012 的 --site-max-width 与 .grand-container**，
   作品页读不到那个 token（012 那个块的作用域没有 page-works，而且不该为了一个宽度
   把整套 --ink-* / --c-* 都灌进来）。改 012 的栏宽时**这里要跟着改**。 */
body.public-body.page-works {
  --page-head-gap: 1.5rem;
  --works-column: 1320px;
  --works-gutter: 48px;
  /* 顶部留白**和左右留白不是同一个数**。014 里 `.grand-container` 的 padding 是
     `48px 48px` → `36px 36px`（≤1100）→ `24px 20px`（≤640）—— 最后一档
     上下 24、左右 20，两者分了家。这里原来只有 --works-gutter 一个变量兼着两用，
     于是 390 档作品页的面包屑落在 44px，其余页面 48px（scripts/page-head-probe.js
     量出来的）。拆成两个。 */
  --works-pad-top: 48px;
}

/* 左右留白跟着其余页面的断点走。`.grand-container` 在 014 里是
   1100px 以下 36px、640px 以下 20px；作品页没有那个容器，所以在这儿照抄一遍。
   ⚠️ 不抄的话窄屏上作品页的左边缘会比别的页多缩进一截
   （390px 实测：拾遗 66、作品 94）—— 桌面对齐了、手机又分家。 */
@media (max-width: 1100px) {
  body.public-body.page-works { --works-gutter: 36px; --works-pad-top: 36px; }
}
@media (max-width: 640px) {
  body.public-body.page-works { --works-gutter: 20px; --works-pad-top: 24px; }
}

body.public-body.page-works .main-manju {
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

body.public-body.page-works .desk-header {
  flex: 0 0 auto;
}

/* --- Scene mount (transparent — the site background shows through) --------
   The scene claims nearly the whole viewport below the title so the cream
   (or star sky) fills the frame and the black footer stays below the fold;
   the records are lifted toward the title inside the canvas (see the shelf
   layout in notes-shelf.js), so this height only needs to leave the title
   its band. */

/* 高度由上面那套 flex 给（作品页），别再写死 —— 这里只留一条 min-height 当地板，
   窗口矮到装不下时页面照旧可以滚，而不是把舞台压成一条缝。
   `page-notes` 已经不走这份表的舞台了（沉思现在只有 015 的编年流），
   保留这条通用值只是为了「万一还有第三个页面挂这个类」时不至于是 0 高。 */
.notes-shelf-scene {
  position: relative;
  width: 100%;
  height: clamp(520px, calc(100dvh - 172px), 1100px);
  overflow: hidden;
}

body.public-body.page-works .notes-shelf-scene {
  flex: 1 1 auto;
  height: auto;
  min-height: 360px;
}

.notes-shelf-scene.is-unavailable {
  height: auto;
  min-height: 0;
}

/* 没有 WebGL / 场景没起来时，舞台要**彻底让位**给下面那份静态清单。
   上面那条作品页的 `min-height: 360px` 权重是 (0,3,1)，压得过
   `.notes-shelf-scene.is-unavailable` 的 (0,2,0) —— 不写这一条，
   兜底状态下清单上方会顶着一块 360px 的空白。 */
body.public-body.page-works .notes-shelf-scene.is-unavailable {
  flex: 0 0 auto;
  min-height: 0;
}

/* 完全没有 JS 的读者：上面那条 is-unavailable 是脚本加的，不会出现 —— 舞台照样按 flex
   撑满一屏（手机档还有 480px 的地板），清单被推到几百像素的空白下面（2026-09-30 审计
   AUD-024）。和静态清单一样用 `html:not(.has-js)` 判，不等脚本。底部目录条也藏掉：
   它的按钮全靠脚本才有用。 */
html:not(.has-js) body.public-body.page-works .notes-shelf-scene {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
}
html:not(.has-js) .notes-shelf-nav { display: none; }
html:not(.has-js) .works-mobile-progress { display: none; }

/* ── 桌面悬停在唱片封套上时浮出的半透明胶囊（Shopify Editions 原版交互）── */
.works-hover-pills {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translate3d(var(--whp-x, 0px), var(--whp-y, 0px), 0) translate(-50%, -50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.24s ease;
}

.works-hover-pills[hidden] {
  display: none;
}

.works-hover-pills.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.works-hover-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  min-height: 30px;
  border-radius: 0;
  border: 1px solid rgba(30, 28, 25, 0.22);
  background: rgba(255, 252, 246, 0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #151413;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.works-hover-pill:hover,
.works-hover-pill:focus-visible {
  background: #ffffff;
  border-color: #151413;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

html[data-theme="dark"] .works-hover-pill {
  background: rgba(20, 21, 28, 0.88);
  border-color: rgba(255, 255, 255, 0.24);
  color: #f3eff8;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.36);
}

html[data-theme="dark"] .works-hover-pill:hover,
html[data-theme="dark"] .works-hover-pill:focus-visible {
  background: rgba(32, 34, 44, 0.96);
  border-color: rgba(255, 255, 255, 0.52);
}

@media (hover: none), (pointer: coarse) {
  .works-hover-pills {
    display: none !important;
  }
}

.works-hover-pill[hidden] {
  display: none;
}

/* ── 手机端右侧竖向叠架进度条（Shopify Editions 手机版进度指示器）──────── */
.works-mobile-progress {
  display: none;
}

.works-mobile-bar-actions {
  display: none;
}

.notes-shelf-canvas {
  position: absolute;
  inset: 0;
  /* 兜底：`<canvas>` 的像素尺寸是 JS 用 `renderer.setSize()` **写成行内样式**的，
     不是 CSS 说了算 —— 一旦那边算错（2026-08-30 就错过一次：它量的是舞台而不是
     这个挂载点，于是画布比这里高出 78px，直接盖在底部目录条上），
     没有这条的话溢出的部分照画不误。裁一下，错也只错在看不见的地方。 */
  overflow: hidden;
}

.notes-shelf-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  /* ⚠️ 这里原来是 **1s**。它不是「加载慢」，是**故意等**的一秒 ——
     画面早就画好了，只是被这条淡入按住。叠上 runEntrance() 里那 500ms 的
     起跑前摇，读者进 /works 要干等一秒多才看见架子。
     Fred 2026-08-30：「works 电脑端和手机端都是这样 中间的架子怎么总会慢1秒。」
     0.35s 仍然是淡入（不会硬切），但不再是「等」。 */
  transition: opacity 0.35s ease;
}

.notes-shelf-scene.canvas-ready .notes-shelf-canvas canvas {
  opacity: 1;
}

/* ── 选中一件作品时：整页退到焦点之外 ────────────────────────────────────
   Fred 2026-08-21：「点开专辑放大以后，我希望也像 thinking 那边做背景模糊效果」；
   2026-09-26：「放大后是有一层对网站其他地方的模糊的，focus 在这个专辑上」。

   现在是**一层全屏的焦点层**（.works-focus，backdrop-filter），把整页 —— 标题、
   目录条、页脚、宣纸底，**连同架子画布本身** —— 一起模糊到后面；专辑画在它上面那张
   全屏的主角画布里（.works-hero-canvas，notes-shelf.js 的 _setupHeroStage），
   简介和「进入」按钮再在最上面。竖栏（z 1100）在焦点层之上，一直清晰、一直能点。

   2026-09-26 之前是「标题 / 目录条 / 页脚各自 filter: blur(6px)」，而架子和宣纸底不糊：
   焦点层次是断的（专辑背后的架子始终是清晰的），专辑的影子也没处落。
   焦点层的不透明度由 JS 跟着离架进度逐帧给，不写 transition。 */
.works-focus {
  position: fixed;
  inset: 0;
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  background: rgba(237, 231, 222, 0.56);
  -webkit-backdrop-filter: blur(16px) saturate(1.04);
  backdrop-filter: blur(16px) saturate(1.04);
  touch-action: none;
}

html[data-theme="dark"] .works-focus {
  background: rgba(6, 7, 11, 0.64);
}

.works-hero-canvas {
  position: fixed;
  inset: 0;
  z-index: 1045;
  width: 100%;
  height: 100%;
  display: none;
  pointer-events: none;
}

/* 主角在镜头前的时候，宣纸水彩停止漂移：焦点层的 backdrop-filter 每一帧都要把
   它底下的东西重新模糊一遍，底下要是在动（水彩一直在动），就是每帧一次全屏模糊。
   停住之后底下是静的。停几秒没人看得出来 —— 那是一段二十几秒走一圈的漂移。 */
body.works-hero-on .pb {
  animation-play-state: paused;
}

/* 面包屑要和这一页的内容栏对齐。
   作品页**没有 .grand-container**（那是列表页/文章页的底盘，3D 画布用不上），
   所以从 012 借来的那条 .article-nav-top 是满宽的，左边缘直接贴着竖栏 ——
   Fred 2026-08-23：「你看看这个左上角路径 works。懒得喷。」
   这一页真正的内容栏是底部目录条的 `.notes-nav-inner`（1200px 居中，
   货架下面那条横线就是它的宽度），面包屑跟着它走，两条左边缘才在同一条竖线上。 */
body.public-body.page-works .article-nav-top {
  width: 100%;
  /* ⚠️ **左右不能用 padding。** 这里原来是
     `max-width: var(--works-column); padding: 0 var(--works-gutter)` ——
     文字的左边缘确实对上了别的页面，可 `.article-nav-top` 那条发丝线是
     **元素自己的 border-bottom，画在框上**，框宽仍是整整 1320，
     于是线比其余页面长 96px（1920 实测 1320 vs 1224，两端各多出 48）。
     和 2026-08-24 底部目录条那条横线是同一个坑：**只能减 max-width，
     加 padding 挪不动它**。改成把两侧留白直接从 max-width 里扣掉。
     上边仍用**外边距** —— 用 padding-top 的话元素框还留在原处，
     只是内容往下挪，和别的页面比「面包屑在第几像素」就对不上。 */
  /* ⚠️ `width` 和 `max-width` **两条都要有**，少一条就少一档断点。
     max-width 管的是「屏幕比栏宽时，栏不要再长」（1920：1224）；
     width 管的是「屏幕比栏窄时，两边仍要留出 gutter」（1100：1032 − 72 = 960）。
     只写 max-width 的话，窄屏上这条线会一路顶到竖栏和屏幕边缘
     （实测 1100 档 x=68 / 宽 1032，其余页面 x=104 / 宽 960）。 */
  width: calc(100% - var(--works-gutter) * 2);
  max-width: calc(var(--works-column) - var(--works-gutter) * 2);
  /* 下边距**故意留空**：这份表在 layer `notes`，012 在 layer `article-craft`，
     层的顺序压过一切，所以面包屑到标题那 36px 由 012 那条统一给 ——
     在这里再写一遍就是把同一个数抄了两份，改一处会漏另一处。 */
  margin: 0 auto;
  margin-top: var(--works-pad-top);
  box-sizing: border-box;
}

/* --- Details panel (selected record) -------------------------------------- */

.notes-shelf-details {
  /* 挂在 <body> 下（notes-shelf.js 搬过去的），fixed、在主角画布之上。
     位置全部由 JS 按主角在视口里的版式写成变量（_applyHeroLayoutToUI）。 */
  position: fixed;
  inset: 0;
  z-index: 1050;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.notes-shelf-details.visible {
  opacity: 1;
  visibility: visible;
  /* 等书飞到一半、焦点层起来了再出现 —— 不然书还在架子上，简介和按钮就先浮在
     一张还没模糊的页面上。放回时（去掉 .visible）不等，立刻开始淡出。 */
  transition-delay: 0.42s;
}

.notes-shelf-details .nsd-left {
  position: absolute;
  left: var(--nsd-text-left, 4rem);
  top: var(--nsd-text-cy, 50%);
  transform: translateY(-50%);
  width: var(--nsd-text-w, 300px);
  transition: opacity 0.4s ease;
}

.notes-shelf-details.is-mobile .nsd-left {
  top: var(--nsd-text-top, 60%);
  transform: none;
  text-align: center;
}

/* 推进去的时候，简介和按钮先退场 —— 它们不该跟着书一起被推大，
   也不该在全屏封面盖上来时还浮在上面。 */
.notes-shelf-details.is-diving .nsd-left,
.notes-shelf-details.is-diving .nsd-actions {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.notes-shelf-details .nsd-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 0.75rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.42s cubic-bezier(0.16, 1, 0.3, 1), transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.notes-shelf-details.is-mobile .nsd-kicker {
  justify-content: center;
}

.notes-shelf-details .nsd-index {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid var(--ns-hairline);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ns-title);
  line-height: 1.3;
}

.notes-shelf-details .nsd-index:empty {
  display: none;
}

.notes-shelf-details .nsd-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 2.6vw, 2.35rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ns-title);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.46s cubic-bezier(0.16, 1, 0.3, 1) 0.05s, transform 0.46s cubic-bezier(0.16, 1, 0.3, 1) 0.05s;
}

.notes-shelf-details .nsd-meta {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ns-muted);
}

.notes-shelf-details .nsd-preview {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 0.94rem;
  line-height: 1.78;
  color: var(--ns-text);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
}

.notes-shelf-details .nsd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 1rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
}

.notes-shelf-details.is-mobile .nsd-tags {
  justify-content: center;
}

.notes-shelf-details .nsd-tags:empty {
  display: none;
}

.notes-shelf-details .nsd-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border: 1px solid var(--ns-hairline);
  color: var(--ns-muted);
}

.notes-shelf-details.visible .nsd-kicker,
.notes-shelf-details.visible .nsd-title,
.notes-shelf-details.visible .nsd-preview,
.notes-shelf-details.visible .nsd-tags {
  opacity: 1;
  transform: translateY(0);
}

.notes-shelf-details .nsd-actions {
  position: absolute;
  /* 站在书的正下方：书的中心 x 和下沿 + 间距都由 JS 按版式算好（--nsd-cx / --nsd-btn-top）。 */
  left: var(--nsd-cx, 50%);
  top: var(--nsd-btn-top, 80%);
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  pointer-events: auto;
  justify-content: center;
}

@media (max-width: 640px) {
  /* 手机上把内边距和间隙收一档，先争取排成一行；真排不下再 wrap。 */
  .notes-shelf-details .nsd-actions {
    gap: 8px;
  }
  .notes-shelf-details .nsd-btn {
    padding: 9px 14px;
  }
}

.notes-shelf-details .nsd-btn {
  padding: 10px 24px;
  min-width: 92px;
  border-radius: 0;
  border: 1px solid var(--ns-btn-bg);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

/* 「进入」—— 选中之后唯一的一颗按钮，站在书的正下方。
   照 Fred 定的口味：可点击感交给颜色 + 字重 + 一个 → 箭头，不要发丝线。
   2026-09-26 从强调色（#A9AFE0 底 + 米白字，对比度只有 2:1 上下）换成
   原来「打开」那颗的深底浅字 —— 截图上读得最清楚的就是那一颗。 */
.notes-shelf-details .nsd-btn-enter {
  gap: 7px;
  padding-right: 20px;
  background: var(--ns-btn-bg);
  color: var(--ns-btn-ink);
  text-decoration: none;
  font-weight: 600;
}

.notes-shelf-details .nsd-btn-enter:hover {
  opacity: 0.86;
}

.notes-shelf-details .nsd-btn-enter .nsd-enter-arrow {
  transition: transform 0.25s ease;
}

.notes-shelf-details .nsd-btn-enter:hover .nsd-enter-arrow {
  transform: translateX(3px);
}

.notes-shelf-details .nsd-btn-enter[hidden] {
  display: none;
}

/* --- 推进去的最后一段：作品原图，全屏 -----------------------------------
   主角画布里的封面推到盖满视口时，这一层在推进的最后 22% 里淡进来接住
   （不透明度由 notes-shelf.js 逐帧写），然后跳转；按返回回来时它先淡出，
   露出同一取景的 3D 封面，再原路退回。两者取景一致：都是按长边铺满、居中裁。
   挂在 <body> 下，盖住一切（包括竖栏 —— 作品页本身是全屏的，接得上）。 */
.works-dive {
  position: fixed;
  inset: 0;
  z-index: 1300;
  overflow: hidden;
}

.works-dive[hidden] {
  display: none;
}

.works-dive-art,
.works-dive-photo {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.works-dive-photo {
  opacity: 0;
}

/* --- Bottom catalogue nav -------------------------------------------------- */

.notes-shelf-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 7;
  padding: 0 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.6s ease, visibility 0.6s ease, transform 0.6s ease;
}

.notes-shelf-nav.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notes-shelf-nav .notes-nav-inner {
  /* 和面包屑、标题同一条栏、同样的左右留白 —— 那条横线的两端要和页头对齐。
     2026-08-23 之前这里是 1200px 而页头 1320px，两条边缘差 12px。
     注：里面的 `.notes-nav-list` 是 1100px 居中，加了 48px 留白之后
     (1320−96−1100)/2 = 62，item 落点和以前逐像素相同，只有横线变宽了。 */
  /* ⚠️ 这里要的是**框本身**收到内容栏那么宽，不能用内边距 ——
     那条横线是这个元素的 `border-top`，画在框上，加 padding 只让内容内缩、
     线还是原来那么长。所以直接减掉两侧留白。
     里面的 `.notes-nav-list` 是 1100px 居中：(1224−1100)/2 = 62，
     item 落点和改之前逐像素相同，变的只有横线两端。 */
  max-width: calc(var(--works-column, 1320px) - 2 * var(--works-gutter, 48px));
  margin: 0 auto;
  border-top: 1px solid var(--ns-hairline);
  padding-bottom: 18px;
}

.notes-shelf-nav .notes-nav-list {
  display: flex;
  gap: clamp(24px, 3.6vw, 48px);
  justify-content: safe center;
  padding-top: 14px;
  max-width: 1100px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.notes-shelf-nav .notes-nav-list::-webkit-scrollbar {
  display: none;
}

.notes-shelf-nav .notes-nav-item {
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  padding: 6px 0 0;
  min-width: max-content;
  width: 120px;
  /* 作品没填时间 / 技术栈时只剩标题一行，按钮原来只有 22px 高，手机上按不准
     （2026-09-30 审计 AUD-046）。两行的时候本来就有 33px 上下，这条不改它们。 */
  min-height: 36px;
  flex-shrink: 0;
  font-family: inherit;
}

.notes-shelf-nav .notes-nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: -15px;
  width: 28px;
  height: 1.5px;
  background: var(--ns-title);
  opacity: 0;
  transform: scaleX(0.4);
  transform-origin: left center;
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.notes-shelf-nav .notes-nav-item:hover::before,
.notes-shelf-nav .notes-nav-item.is-hovered::before,
.notes-shelf-nav .notes-nav-item.active::before {
  opacity: 1;
  transform: scaleX(1);
}

.notes-shelf-nav .nav-date {
  /* 2026-09-12 从 <p> 换成 <span>（<button> 只能装短语内容），块级要自己写出来。 */
  display: block;
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.4;
  letter-spacing: 0.04em;
  font-family: var(--font-sans);
  color: var(--ns-muted);
  transition: color 0.3s ease;
}

.notes-shelf-nav .nav-note-title {
  margin: 2px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ns-text);
  position: relative;
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.notes-shelf-nav .notes-nav-item:hover .nav-date,
.notes-shelf-nav .notes-nav-item.is-hovered .nav-date,
.notes-shelf-nav .notes-nav-item.active .nav-date {
  color: var(--ns-text);
}

/* 手机上抬到 14px，并切换成 Shopify Editions 手机端底栏布局（左：当前专辑时期+标题，右：详情 + 打开双胶囊） */
@media (max-width: 767px) {
  .works-hover-pills {
    display: none !important;
  }

  .works-mobile-progress {
    display: block;
    position: absolute;
    right: 18px;
    top: 44%;
    transform: translateY(-50%);
    width: 2px;
    height: 132px;
    border-radius: 0;
    background: rgba(58, 53, 43, 0.18);
    overflow: visible;
    pointer-events: none;
    z-index: 8;
    transition: opacity 0.35s ease, visibility 0.35s ease;
  }

  html[data-theme="dark"] .works-mobile-progress {
    background: rgba(232, 226, 210, 0.18);
  }

  body.works-hero-on .works-mobile-progress {
    opacity: 0;
    visibility: hidden;
  }

  .works-mobile-progress-thumb {
    position: absolute;
    left: -1px;
    right: -1px;
    bottom: 0;
    height: var(--wmp-h, 28px);
    border-radius: 0;
    background: var(--ns-title);
    transform: translateY(var(--wmp-y, 0px));
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .notes-shelf-nav .notes-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 4px 14px;
    border-top: 1px solid var(--ns-hairline);
  }

  .notes-shelf-nav .notes-nav-list {
    padding-top: 0;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
  }

  .notes-shelf-nav .notes-nav-item {
    display: none;
    width: auto;
    min-width: 0;
    padding: 2px 0;
    min-height: 40px;
  }

  .notes-shelf-nav .notes-nav-item::before {
    display: none;
  }

  .notes-shelf-nav .notes-nav-item.is-mobile-current {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .notes-shelf-nav .nav-date {
    font-size: 12px;
  }

  .notes-shelf-nav .nav-note-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ns-title);
    max-width: 46vw;
  }

  .works-mobile-bar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }

  .works-mobile-btn {
    min-height: 38px;
    padding: 0 15px;
    border-radius: 0;
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  }

  .works-mobile-btn--details {
    background: transparent;
    color: var(--ns-title);
    border: 1px solid rgba(58, 53, 43, 0.28);
  }

  html[data-theme="dark"] .works-mobile-btn--details {
    background: transparent;
    color: #f3eff8;
    border-color: rgba(255, 255, 255, 0.24);
  }

  .works-mobile-btn--open {
    background: var(--ns-btn-bg);
    color: var(--ns-btn-ink);
    border: 1px solid var(--ns-btn-bg);
  }

  .works-mobile-btn[hidden] {
    display: none;
  }
}

.notes-shelf-nav .notes-nav-item:hover .nav-note-title,
.notes-shelf-nav .notes-nav-item.is-hovered .nav-note-title,
.notes-shelf-nav .notes-nav-item.active .nav-note-title {
  color: var(--ns-title);
}

/* --- Empty state ----------------------------------------------------------- */

.notes-shelf-empty {
  min-height: 46vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 2rem 4rem;
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ns-muted, #8a8375);
}

/* --- Static list (screen readers, crawlers, no-WebGL fallback) ------------ */

.notes-shelf-static {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 「书架起不来时的静态回退」有两条触发路径 ——
     ① JS 那条：works-shelf.ejs 里 4 秒没见到 canvas 就给它加 `.is-fallback`（WebGL 挂了、
        importmap 不支持、场景初始化抛了）；
     ② **完全没有 JS 的读者**：那条 setTimeout 根本不会跑。2026-09-12 实测 —— 关掉 JS 打开
        /works，画布 0×0、静态回退仍被裁成 1×1，**整页是空白的**。
   所以每条规则都带上 `html:not(.has-js) .notes-shelf-static`：`has-js` 由 header.ejs 那段
   首帧内联脚本加，没有 JS 就加不上，回退直接以完整样式出现。
   （特异度：`html:not(.has-js) .notes-shelf-static` 是 0-2-1，压得过上面那条 0-1-0 的裁切规则。） */
:is(.notes-shelf-static.is-fallback, html:not(.has-js) .notes-shelf-static) {
  position: static;
  /* 不能是 auto：父级 .main-manju 是纵向 flex，auto 宽 + 左右 auto 外边距会把清单收成
     内容那么窄（1440 宽实测 153px）。要的是「最多 760、居中」（2026-09-30 审计 AUD-024）。 */
  width: 100%;
  box-sizing: border-box;
  height: auto;
  margin: 0 auto;
  padding: 7rem 2rem 4rem;
  overflow: visible;
  clip: auto;
  white-space: normal;
  max-width: 760px;
}

:is(.notes-shelf-static.is-fallback, html:not(.has-js) .notes-shelf-static) .ns-static-item {
  padding: 2rem 0;
  border-bottom: 1px solid var(--ns-hairline);
}

:is(.notes-shelf-static.is-fallback, html:not(.has-js) .notes-shelf-static) h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--text, var(--ns-title));
}

:is(.notes-shelf-static.is-fallback, html:not(.has-js) .notes-shelf-static) .ns-static-meta {
  margin: 0 0 1rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--ns-muted);
}

/* --- Responsive ------------------------------------------------------------ */

@media (max-width: 900px) {
  .notes-shelf-details .nsd-preview {
    -webkit-line-clamp: 3;
  }

  .notes-shelf-scene {
    height: clamp(420px, calc(100dvh - 150px), 900px);
  }

  /* ⚠️ **地板 300px 在手机上是不够的，而且它就是那个「作品页看着坏了」。**
     `body` 是 `min-height: 100dvh` 的 flex 纵列，舞台是 `flex: 1 1 auto`：
     它拿到的是「一屏减去页头再减去页脚」。390×812 实测 —— 页头 246、
     页脚 229，舞台只剩 **335px**。而舞台里叠着三层各自定位的东西：
     简介（`bottom: 176px`）、按钮排（锚在书的下沿）、底部目录条（`bottom: 0`，70px 高）。
     335px 装不下，于是**按钮排和目录条重叠了 62px** —— 截图上就是（当时的）
     「翻面 / 打开」被一块灰的挡住一半。Fred 2026-08-30：「这个 works 懒得喷 自己看」。
     两件事一起改：
       ① 舞台给一个真的地板，页脚照桌面的意图**沉到首屏以下**（页面可以滚）；
       ② 画布的**下沿抬到目录条上方**，3D 不画到目录条底下。
          （简介和按钮 2026-09-26 起挂在 body 下、按视口排，不再跟着画布。） */
  body.public-body.page-works {
    --works-shelf-navh: 78px;
  }

  body.public-body.page-works .notes-shelf-scene {
    height: auto;
    min-height: 480px;
  }

  body.public-body.page-works .notes-shelf-canvas {
    bottom: var(--works-shelf-navh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .notes-shelf-canvas canvas,
  .notes-shelf-details,
  .notes-shelf-nav {
    transition-duration: 0.01ms !important;
  }
}
}
