/* ═══════════════════════════════════════════════════════
   昔涟 · 如我所书 —— 主题样式（浅色 · 一页永恒）
   基调：玫瑰色天光 × 银白浅滩 × 樱粉花瓣 × 星金
   ═══════════════════════════════════════════════════════ */

:root {
  /* ── 底色：银白泛粉，如一页永恒的结晶浅滩 ── */
  --bg-base:    #fdf9fb;
  --bg-rose:    #fbf1f5;
  --bg-cream:   #fdf8ef;
  --bg-lav:     #f6f3fc;
  --bg-card:    #ffffff;

  /* ── 文字：深紫灰墨色 ── */
  --ink:        #463a52;
  --ink-soft:   #6d6079;
  --ink-faint:  #9c90a8;

  /* ── 樱粉 ── */
  --pink:       #e07aa8;   /* 装饰主色 */
  --pink-deep:  #c2568a;   /* 强调 */
  --pink-text:  #b04e7e;   /* 小字号安全色 · 对比度 ≈ 5.4:1 */
  --pink-pale:  #fdeef4;
  --pink-mist:  #f8dcea;

  /* ── 星金 ── */
  --gold:       #d9a94a;
  --gold-deep:  #a97c22;
  --gold-text:  #946c1c;   /* 小字号安全色 · 对比度 ≈ 4.8:1 */
  --gold-pale:  #fdf4de;

  /* ── 堇紫 / 天青 ── */
  --violet:     #9484d4;
  --violet-deep:#6f5fb8;
  --violet-pale:#f1edfb;
  --blue:       #7aa8d4;
  --blue-deep:  #4a78a8;

  /* ── 午夜蓝（《如我所书》封面色，用于徽记与信笺逻辑段） ── */
  --midnight:   #3c4a8c;

  /* ── 线 / 影 ── */
  --line:       rgba(148, 132, 212, .22);
  --line-pink:  rgba(224, 122, 168, .26);
  --line-warm:  rgba(217, 169, 74, .28);
  --sh-xs:      0 1px 3px rgba(120, 88, 110, .07);
  --sh-sm:      0 3px 12px rgba(120, 88, 110, .09);
  --sh-md:      0 10px 30px rgba(120, 88, 110, .12);
  --sh-lg:      0 22px 54px rgba(120, 88, 110, .16);
  --sh-pink:    0 10px 30px rgba(224, 122, 168, .22);

  --radius:     18px;
  --radius-sm:  12px;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --font-sans:  "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;

  /* 装饰纹样 */
  --ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 14'%3E%3Cpath d='M4 7h44' stroke='%23dfa8c4' stroke-width='1' stroke-linecap='round'/%3E%3Cpath d='M92 7h44' stroke='%23dfa8c4' stroke-width='1' stroke-linecap='round'/%3E%3Cpath d='M70 1l4.2 6L70 13l-4.2-6z' fill='%23e07aa8'/%3E%3Ccircle cx='56' cy='7' r='1.7' fill='%23d9a94a'/%3E%3Ccircle cx='84' cy='7' r='1.7' fill='%23d9a94a'/%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ⚠️ overflow-x: clip 让 html 的计算值已非 visible —— 按规范 <body> 的 overflow
   就不再传播到视口了，所以锁滚动必须挂在 <html> 上（见 .account-open）。 */
html { scroll-behavior: smooth; overflow-x: clip; }

/* 槽位预留只在「滚动条真的占宽度」的环境下开（class 由 account.js 按
   innerWidth - clientWidth 判定）。覆盖式滚动条本来就不占位，若也强制预留，
   右侧会凭空多出一条 11~15px 白边，把贴右的音乐胶囊挤偏、和左边的对话胶囊不对称。
   传统滚动条下预留 = 它本来就占的位置，视觉零变化，换来开关弹窗时 fixed 层不抻缩。 */
html.has-classic-scrollbar { scrollbar-gutter: stable; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--ink);
  line-height: 1.85;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* 极轻的纸张颗粒，营造书页质感。
   原来带 mix-blend-mode: multiply —— 全屏固定层一旦参与混合，整页每帧都要重新合成，
   实测是滚动掉帧的头号原因（p50 24.4→16.8ms，最长帧 150→31ms，超 32ms 的帧 13→0）。
   底色本身接近纯白、颗粒又是中性灰，去掉混合后合成结果几乎不变，所以直接删掉混合模式。 */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 9998;
  pointer-events: none; opacity: .045;
  background-image: var(--grain);
}

::selection { background: var(--pink-mist); color: var(--pink-deep); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-rose); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--pink), var(--violet));
  border-radius: 6px; border: 2px solid var(--bg-rose);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(var(--pink-deep), var(--violet-deep)); }

/* ═══════════════ 阅读进度条 ═══════════════ */
/* 用 transform:scaleX 而不是 width：width 是布局属性，滚动中每帧改写会触发
   整页重排，和封面上移/平滑滚动抢主线程，表现为掉帧卡顿。
   transform + will-change 走合成器，更新零布局成本。 */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 2.5px; width: 100%;
  transform: scaleX(0); transform-origin: 0 50%;
  z-index: 160; pointer-events: none;
  background: linear-gradient(90deg, var(--pink), var(--gold) 55%, var(--violet));
  box-shadow: 0 0 10px rgba(224, 122, 168, .6);
  transition: transform .12s linear;
  will-change: transform;
}

/* ═══════════════ 导航 ═══════════════ */
/* 悬浮胶囊：不贴边、圆角全包、软阴影。
   居中用 left/right + margin:auto，**不要用 transform: translateX(-50%)** ——
   .nav 上有 backdrop-filter，本身已为 fixed 子元素创建包含块，
   再加 transform 会让移动端下拉菜单的定位基准再变一层 */
.nav {
  position: fixed; top: 14px; left: 0; right: 0;
  /* 胶囊贴合内容宽度，避免中间空出一大块；max-width 兜住窄视口 */
  width: max-content; max-width: calc(100vw - 28px);
  /* z-index 必须高于随行播放器（190）：≤860px 汉堡菜单从导航展开，
     而播放器在最窄视口会降到导航下方，两者会重叠 —— 导航层级低就会被胶囊盖住菜单。
     仍低于灯箱（300）。 */
  margin: 0 auto; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  gap: clamp(18px, 5vw, 68px);
  padding: 8px 10px 8px 18px;
  border-radius: 999px;
  background: rgba(253, 249, 251, .74);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow: 0 6px 24px rgba(120, 88, 110, .10);
  transition: background .35s, box-shadow .35s, border-color .35s;
}
.nav.scrolled {
  background: rgba(253, 249, 251, .93);
  border-color: var(--line-pink);
  box-shadow: 0 10px 32px rgba(120, 88, 110, .16);
}

.nav-logo {
  display: flex; align-items: center; gap: 9px;
  color: var(--pink-deep); text-decoration: none;
  font-family: var(--font-serif); font-size: 17px; letter-spacing: 3px;
  transition: color .3s;
}
.nav-logo:hover { color: var(--violet-deep); }

/* 《如我所书》封面星盘徽记：银色线条的复杂星盘，中心闪耀柔光的星辰，
   外圈环绕月亮的阴晴圆缺，几颗蓝色星星仿佛捕捉了流星划过的瞬间 */
.logo-chart { overflow: visible; flex: none; }
.logo-chart .logo-moonring { transform-box: view-box; transform-origin: 22px 22px; animation: logoSpin 64s linear infinite; }
/* 月相自身反向旋转，公转时不跟着翻倒；transform-box: fill-box 让它绕自身中心转 */
.logo-chart .logo-moon { transform-box: fill-box; transform-origin: center; animation: logoSpinBack 64s linear infinite; }
.logo-chart .logo-core { transform-box: fill-box; transform-origin: center; animation: logoCoreBreath 5.2s ease-in-out infinite; }
.logo-chart .logo-core-glow { transform-box: fill-box; transform-origin: center; animation: logoCoreGlow 5.2s ease-in-out infinite; }
.logo-chart .logo-shoot { animation: logoShoot 8.5s ease-in-out infinite; }
@keyframes logoSpin { to { transform: rotate(360deg); } }
@keyframes logoSpinBack { to { transform: rotate(-360deg); } }
@keyframes logoCoreBreath {
  0%, 100% { transform: scale(1); opacity: .9; }
  50%      { transform: scale(1.16); opacity: 1; }
}
@keyframes logoCoreGlow {
  0%, 100% { opacity: .45; transform: scale(.88); }
  50%      { opacity: .95; transform: scale(1.18); }
}
/* 流星：斜掠而过，大部分时间不可见 */
@keyframes logoShoot {
  0%, 70%   { opacity: 0; transform: translate(7px, 9px) rotate(38deg) scaleX(.4); }
  74%       { opacity: .95; transform: translate(10px, 12px) rotate(38deg) scaleX(1); }
  86%, 100% { opacity: 0; transform: translate(33px, 35px) rotate(38deg) scaleX(.5); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-chart .logo-moonring, .logo-chart .logo-moon,
  .logo-chart .logo-core,
  .logo-chart .logo-core-glow, .logo-chart .logo-shoot { animation: none; }
  .logo-chart .logo-shoot { opacity: 0; }
}

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: var(--ink-soft); text-decoration: none; font-size: 14px;
  letter-spacing: 1px; padding: 9px 17px; border-radius: 999px;
  white-space: nowrap; position: relative;
  transition: color .28s, background .28s, box-shadow .28s;
}
.nav-links a:hover { color: var(--pink-deep); background: rgba(224, 122, 168, .09); }
/* 当前项：渐变胶囊 + 白字（原为下划线，已由胶囊取代）。
   配色：粉色主导，紫色只在末端收尾（原 #e79ec3→#ada0e2 的紫段偏蓝紫、明度低，右下角发闷）。
   浅底上白字对比度会降，故补一层柔和投影 + 略加字重来保可读性 */
.nav-links a.active {
  color: #fff; font-weight: 600;
  background: linear-gradient(135deg, #eea8c9 0%, #e9b0d3 62%, #d6b0e6 100%);
  box-shadow: 0 4px 16px rgba(205, 150, 200, .34), inset 0 1px 0 rgba(255, 255, 255, .42);
  text-shadow: 0 1px 3px rgba(150, 80, 130, .34);
}

.nav-toggle {
  display: none; background: var(--bg-card); border: 1px solid var(--line-pink);
  color: var(--pink-deep); font-size: 17px; border-radius: 10px;
  width: 40px; height: 40px; cursor: pointer; box-shadow: var(--sh-xs);
  transition: .25s;
}
.nav-toggle:hover { background: var(--pink-pale); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; top: 74px; right: 14px; flex-direction: column;
    align-items: stretch; min-width: 168px;
    background: rgba(255, 255, 255, .97); border: 1px solid var(--line-pink);
    border-radius: 20px; padding: 12px; gap: 4px;
    box-shadow: var(--sh-lg);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .3s;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { text-align: center; }
}

/* ═══════════════ 封面 · 扉页 ═══════════════ */
.cover {
  /* sticky + top:0：扉页钉在视口顶部不动，下方区块从下面滑上来把它盖住，
     而不是扉页自己往上滚走。配合 .section 的 z-index 与不透明背景才成立。
     高度保持 100vh —— 一旦加高，background-size:cover 会重新缩放，人物比例就变了。 */
  position: sticky; top: 0; z-index: 0;
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  /* 插画已抽到独立图层 .cover-art（滚动时先上移再停住，见下）；
     这里只留柔光渐变与底色 */
  background:
    radial-gradient(ellipse 52% 48% at 68% 46%, rgba(253,246,249,.62), transparent 72%),
    linear-gradient(90deg, rgba(253,246,249,0) 52%, rgba(253,246,249,.32) 100%),
    linear-gradient(180deg, rgba(253,241,246,.45) 0%, rgba(253,249,251,0) 22%, rgba(253,246,242,0) 72%, rgba(253,241,246,.6) 100%),
    radial-gradient(ellipse 70% 48% at 50% 0%, rgba(248, 200, 220, .55), transparent 62%),
    radial-gradient(ellipse 55% 40% at 88% 92%, rgba(217, 169, 74, .2), transparent 60%),
    radial-gradient(ellipse 50% 38% at 8% 78%, rgba(148, 132, 212, .2), transparent 60%),
    linear-gradient(178deg, #fdf1f6 0%, var(--bg-base) 46%, #faf5fc 78%, #fdf6f2 100%);
  overflow: hidden;
}
/* 插画图层：滚动时整体上移，把人物头顶的蓝天推出视口后停住，
   让麦田与人物主体多留一会儿，再由下方区块滑上来遮挡。
   位移由 JS 直接写 inline transform（封顶 22vh，C1 连续缓动）；reduce-motion 时不写，保持 0。
   will-change 让浏览器把它提升为独立合成层——图层只有一屏高，不像场景轨道那样有巨型层开销。 */
.cover-art {
  position: absolute; inset: 0; pointer-events: none;
  background: url('../images/cover-bg-wide.jpg') 68% center / cover no-repeat;
}
/* 窄屏：cover 全屏铺图在竖向视口下只能截到一条竖缝（人物会被裁掉），
   改为「人物置于上方画面带 + 文字落在下方浅色区」的分层方案。
   画面带用伪元素实现，见本区块末尾 */
@media (max-width: 860px) {
  .cover {
    align-items: flex-start;
    padding-top: 54vh;
    background: linear-gradient(178deg, #fdf1f6 0%, var(--bg-base) 100%);
  }
  /* 窄屏不走全屏铺图 + 上移方案，仍用 ::after 画面带，故隐藏插画图层 */
  .cover-art { display: none; }
}

/* 柔和光晕团（bokeh），模拟玫瑰色天光 */
.cover::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  opacity: .45;
  background:
    radial-gradient(circle 180px at 18% 24%, rgba(255, 220, 235, .55), transparent 70%),
    radial-gradient(circle 140px at 82% 20%, rgba(255, 238, 205, .5), transparent 70%),
    radial-gradient(circle 220px at 68% 76%, rgba(232, 224, 252, .5), transparent 70%),
    radial-gradient(circle 120px at 28% 82%, rgba(255, 226, 240, .45), transparent 70%);
  filter: blur(6px);
  animation: bokehDrift 22s ease-in-out infinite alternate;
}
/* 这条无限动画跑在被 blur 的全屏层上，合成器因此永不空闲 —— 实测单独关掉它
   就能把 p50 从 24.4 拉到 15.9ms。封面被下方区块完全盖住后（scrollY > 封面高）
   它已经看不见，直接从合成树里摘掉。
   注意：只写 animation-play-state: paused 不够 —— 实测它几乎不改善（p50 仍 16.9），
   暂停的动画仍让这个带 blur 的图层留在合成树里；display:none 才真正省下开销。 */
.cover.is-covered::before { display: none; }
@keyframes bokehDrift {
  from { transform: translate3d(-14px, -8px, 0) scale(1); }
  to   { transform: translate3d(14px, 10px, 0) scale(1.06); }
}

.cover-stars { position: absolute; inset: 0; pointer-events: none; }
.cover-stars i {
  position: absolute; border-radius: 50%;
  background: var(--spark, #e8b0c8);
  box-shadow: 0 0 6px var(--spark, #e8b0c8);
  animation: twinkle var(--dur, 3s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}
@keyframes twinkle { from { opacity: .1; transform: scale(.75); } to { opacity: .8; transform: scale(1.1); } }

/* 花瓣层：固定在视口之上，**只在封面显示**。
   ① 空间上被下方区块裁掉：z-index 取 **0** —— 与 .cover（同为 0）同级、但 DOM 在其后，
      所以画在封面**之上**；而 .section 是 1，画在花瓣**之上** ⇒
      区块滑上来盖住封面时，它那部分的花瓣被区块的不透明背景直接盖掉。
      ⚠️ 曾取 5（高于所有区块），于是花瓣浮在滑上来的区块上面（用户反馈「下面遮上来的那部分不要显示花瓣」）。
      改回 5 就会复现，别再调高。
   ② 时间上再渐隐一层：opacity 由 JS 按「封面被盖住的比例」逐帧写（见 main.js 的 updatePetalVeil），
      滚出封面后恒为 0，不是整站飘落。
   pointer-events:none 保证不挡任何交互；灯箱是 300，仍在花瓣之上。
   ⚠️ transition 保持很短（.2s）：opacity 是滚动驱动、每帧都在变，过渡一长就明显滞后于手指。 */
#petalCanvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; transition: opacity .2s ease;
}

.cover-inner {
  position: relative; z-index: 2; text-align: center;
  padding: 112px 24px 74px; max-width: 880px;
}
/* 桌面端：文字在右侧留白区居中，为左侧人物让出空间。
   用容器 padding 而非子项 margin —— 这样 .cover-inner 作为 flex 项可自动收缩，
   在 861~1180px 区间不会横向溢出（margin 写法会让总宽超出视口）。
   文字层跟随插画层同步上移（JS 写 inline transform），避免"图走了字没走"的脱钩感。
   窄屏不应用：那边文字在画面带下方，上移会压住图，JS 里也跳过了窄屏的 coverInner。 */
@media (min-width: 861px) {
  .cover { padding-left: clamp(300px, 34vw, 700px); }
}
/* 窄屏的文字微调统一放在本区块末尾（见 .scroll-hint 之后），
   否则同权重下会被后面的基础规则覆盖回去 */

/* 封蜡/图标的轻柔浮动（信件封蜡按钮沿用） */
@keyframes emblemFloat {
  0%, 100% { transform: translateY(0) rotate(-1.6deg); }
  50% { transform: translateY(-13px) rotate(1.6deg); }
}

.cover-kicker {
  margin-top: 20px; font-size: 12.5px; letter-spacing: 5.5px;
  color: var(--ink-soft); text-transform: uppercase;
}

/* 封面文字压在插画上：加白色柔光晕，保证在蓝天/麦田上都可读 */
.cover-kicker, .cover-latin, .typewriter, .cover-quote-src {
  text-shadow:
    0 1px 2px rgba(255, 255, 255, .95),
    0 0 12px rgba(255, 255, 255, .85),
    0 0 26px rgba(255, 255, 255, .55);
}

.cover-title {
  font-family: var(--font-serif);
  font-size: clamp(42px, 8.4vw, 96px);
  font-weight: 600; letter-spacing: 8px; text-indent: 8px; margin: 4px 0 2px;
  line-height: 1.22;
  background: linear-gradient(158deg, #a8548a 8%, var(--pink-deep) 38%, var(--violet-deep) 72%, var(--blue-deep) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 0 26px rgba(255, 255, 255, .78)) drop-shadow(0 6px 22px rgba(194, 86, 138, .28));
}

/* 六字标题在窄屏收字距，避免贴边/换行 */
@media (max-width: 400px) {
  .cover-title { font-size: clamp(34px, 8.6vw, 42px); letter-spacing: 4px; text-indent: 4px; }
}

.cover-latin {
  font-size: 13.5px; letter-spacing: 3.5px; color: var(--gold-text);
  margin-bottom: 34px; position: relative; display: inline-block;
}
.cover-latin::before, .cover-latin::after {
  content: "✦"; position: absolute; top: 50%; transform: translateY(-50%);
  color: var(--gold); font-size: 9px; opacity: .75;
}
.cover-latin::before { left: -20px; }
.cover-latin::after { right: -20px; }

.typewriter {
  font-family: var(--font-serif);
  font-size: clamp(16px, 2.4vw, 21px);
  color: var(--pink-text); min-height: 2.4em; letter-spacing: 1.2px;
}
.typewriter .caret {
  display: inline-block; width: 2px; height: 1.1em; vertical-align: -.15em;
  background: var(--pink-deep); margin-left: 3px; border-radius: 1px;
  animation: blink .85s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.cover-quote-src { margin-top: 10px; font-size: 12.5px; color: var(--ink-soft); letter-spacing: .5px; }

.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink-faint); text-decoration: none; font-size: 12.5px; letter-spacing: 3px;
  padding: 8px 20px; border-radius: 999px;
  background: rgba(255, 255, 255, .5); border: 1px solid var(--line-pink);
  backdrop-filter: blur(8px); transition: .3s;
}
.scroll-hint svg { animation: hintBob 1.9s ease-in-out infinite; }
.scroll-hint:hover {
  color: var(--pink-deep); background: #fff;
  box-shadow: var(--sh-pink); transform: translateX(-50%) translateY(-2px);
}
@keyframes hintBob { 50% { transform: translateY(5px); } }

/* 窄屏文字微调：必须在上面所有基础规则之后，否则会被同权重规则覆盖 */
@media (max-width: 860px) {
  /* 画面带用伪元素 + cover 才能在任何宽高比下都铺满整宽。
     写进 .cover 的 background 里用 auto 46% 时，横屏等宽视口会露出图片左右边缘。
     高度用 vh 而非 %：% 会跟着被文字撑高的封面一起变高，导致压住标题 */
  .cover::after {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 44vh;
    background: url('../images/cover-bg-wide.jpg') 25% 0% / cover no-repeat;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 56%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 56%, transparent 100%);
    pointer-events: none;
  }
  /* 底部留白不能去掉：「翻开书页」是相对 .cover-inner 定位的，
     去掉后它会往上窜、压住打字机那行 */
  .cover-inner { padding: 0 24px 74px; }
  .cover-kicker { letter-spacing: 2.5px; }
  .cover-latin { margin-bottom: 26px; }
}
/* 横屏窄高视口：画面带按 44vh 算只剩一条，人物只剩头顶，需要单独加高并把取景上移。
   但 66vh 同样必须用 min() 兜底：横屏窄屏的高必然小于宽（≤860），
   而「66vh + 约 340px 文字块 ≤ 100vh」需要 vh ≥ 1000 —— 永远达不到。
   所以高度 701~859 这一段（max-height:700 规则盖不到）按钮会被整个裁掉，
   实测 800×720 差 65px、860×800 差 48px。这里复用 --band 机制统一兜底。
   取景仍用 25% 30%（比竖屏更靠上，避免只剩头顶）。 */
@media (max-width: 860px) and (orientation: landscape) {
  .cover {
    --band: min(66vh, calc(100vh - 280px));
    padding-top: var(--band);
  }
  .cover::after {
    height: max(0px, calc(var(--band) - 4vh));
    background-position: 25% 30%;
  }
  /* 与下面 max-height:700 那条同样的收紧（两条会同时命中矮横屏，
     靠源码顺序让后者覆盖，值保持一致以免出现跳变） */
  .cover-inner { padding: 0 20px 74px; }
  .cover-kicker { margin-top: 0; letter-spacing: 2px; }
  .cover-title { font-size: clamp(24px, 6.2vw, 31px); }
  .cover-latin { margin-bottom: 12px; }
  .typewriter { font-size: 13px; }
  .cover-quote-src { margin-top: 6px; font-size: 12px; }
}

/* 矮视口兜底：上面两条按 54/66vh 留画面带，加上约 330px 的文字块就超过 100vh，
   而 .cover 是 overflow:hidden —— 超出部分被裁掉，「翻开书页」整个看不见。
   实测 844×390 差 144px、667×375 差 120px、740×360 差 137px，横屏手机全军覆没。
   这里把画面带压下来，并用 min() 兜一层底：只要「画面带 + 文字块 > 100vh」就继续压，
   保证按钮始终留在屏幕内。文字块同时收紧间距，让画面带能多留一点。
   只作用于高度 <700px 的窄屏 —— 桌面端与竖屏手机一个像素都不动。
   注意必须排在上面那条 landscape 规则之后（媒体查询不加权重，靠源码顺序覆盖）。 */
@media (max-width: 860px) and (max-height: 700px) {
  .cover {
    /* 30vh 是理想值；若仍塞不下，就退到"视口高 - 文字块高度"（280px = 实测高 + 余量） */
    --band: min(30vh, calc(100vh - 280px));
    padding-top: var(--band);
  }
  /* 画面带保持比留白短一截（原来 54/44、66/58 都是这个关系），底部 mask 淡出后接文字 */
  .cover::after {
    height: max(0px, calc(var(--band) - 4vh));
    background-position: 25% 22%;
  }
  /* 底部留白必须保持 74px，不能跟着一起压：「翻开书页」是 absolute; bottom:28px + 高 41px，
     实际占掉 28~69px。压到 34px 时它会直接压在上面那行引文上（第一版就是这么错的）。
     所以这里只收 kicker / latin 的外边距和标题字号，底部留白原样不动。 */
  .cover-inner { padding: 0 20px 74px; }
  .cover-kicker { margin-top: 0; letter-spacing: 2px; }
  .cover-title { font-size: clamp(24px, 6.2vw, 31px); }
  .cover-latin { margin-bottom: 12px; }
  .typewriter { font-size: 13px; }
  .cover-quote-src { margin-top: 6px; font-size: 12px; }
}

/* 宽而极矮的视口（横屏宽屏手机如 932×430、小窗口）：走的是桌面版布局，
   .cover-inner 的 112px + 74px 上下留白在 430px 高的视口里占掉 43%，
   把「翻开书页」挤到折线以下（实测 932×430 差 18px）。
   这里只压缩**顶部**留白与两处外边距，不动插画取景、不动任何字号比例。
   底部留白同样保持 74px 原值（理由同上：它是「翻开书页」的占位，压了就会压住引文）。
   高度 ≥541px 的视口完全不受影响。 */
@media (min-width: 861px) and (max-height: 540px) {
  .cover-inner { padding-top: 40px; }
  .cover-kicker { margin-top: 0; }
  .cover-latin { margin-bottom: 14px; }
}

/* ═══════════════ 记忆涟漪 ═══════════════ */
/* 铺满视口、只做视觉不拦截事件；层级在内容之上、导航(200)之下 */
#rippleCanvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 120;
}

/* ═══════════════ 形态切换 ═══════════════ */
/* 原「记忆重载」白光特效（.flash-overlay + .reload-shard + reloadWhite/Old/New/Shard
   四条关键帧）已按要求移除，切换现在是即时的。
   形态面板自身保留一个 0.65s 的淡入上移（.form-panel.active 的 panelIn），
   它属于常规过渡而非特效；若要连它一起去掉，删掉该 animation 即可。 */

/* ═══════════════ 通用区块 ═══════════════ */
/* z-index + 不透明背景：扉页是 sticky 钉在顶部的，后续区块必须自己"实心"，
   否则会透出底下的扉页；靠这两条才能形成"从下往上把扉页盖住"的效果。 */
.section { padding: clamp(66px, 9vw, 112px) clamp(18px, 5vw, 64px); position: relative; z-index: 1; background: var(--bg-base); }

.section-head { max-width: 780px; margin: 0 auto clamp(38px, 5vw, 58px); text-align: center; }
.kicker {
  font-size: 11.5px; letter-spacing: 5px; color: var(--gold-text);
  text-transform: uppercase; margin-bottom: 12px; font-weight: 500;
}
.section-head h2 {
  font-family: var(--font-serif); font-weight: 600;
  font-size: clamp(28px, 4.6vw, 43px); letter-spacing: 5px;
  background: linear-gradient(118deg, #8a5a86 4%, var(--pink-deep) 48%, var(--violet-deep) 96%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  margin-bottom: 6px;
}
.section-head h2::after {
  content: ""; display: block; width: 140px; height: 14px;
  margin: 16px auto 0; background: var(--ornament) center/contain no-repeat;
  opacity: .9;
}
.section-head .sub { color: var(--ink-soft); font-size: 14.5px; margin-top: 16px; }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .85s ease, transform .85s cubic-bezier(.22,.8,.36,1); }
.reveal.visible { opacity: 1; transform: none; }

/* ── 图片占位槽 ── */
.img-slot {
  position: relative; border-radius: var(--radius);
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 226, 240, .7), transparent 58%),
    radial-gradient(circle at 76% 78%, rgba(232, 224, 252, .65), transparent 58%),
    linear-gradient(150deg, #fffcfd, var(--bg-lav));
  border: 1.5px dashed rgba(224, 122, 168, .4);
  overflow: hidden; min-height: 300px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--sh-sm); transition: box-shadow .4s, border-color .4s;
}
.img-slot:hover { box-shadow: var(--sh-md); }
.img-slot img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center; border: none;
  animation: imgIn .85s ease;
}
@keyframes imgIn { from { opacity: 0; transform: scale(1.05); } }
.img-slot.filled { border-style: solid; border-color: rgba(224, 122, 168, .45); box-shadow: var(--sh-md); }
.img-slot.filled .img-slot-inner { display: none; }
/* 占位槽四角花饰（场景图除外，避免压在天空上） */
.img-slot:not(.filled):not(.scene-bg)::before,
.img-slot:not(.filled):not(.scene-bg)::after {
  content: "❀"; position: absolute; color: var(--pink); opacity: .3;
  font-size: 15px; pointer-events: none; z-index: 2;
}
.img-slot:not(.filled):not(.scene-bg)::before { top: 12px; left: 14px; }
.img-slot:not(.filled):not(.scene-bg)::after { bottom: 12px; right: 14px; }

.img-slot-inner {
  text-align: center; padding: 26px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.img-slot-inner svg { color: var(--pink); opacity: .5; }
.slot-label { font-size: 14px; letter-spacing: 2px; color: var(--ink-soft); font-family: var(--font-serif); }
.slot-hint {
  font-size: 11px; color: var(--ink-faint); font-family: Consolas, "Courier New", monospace;
  background: rgba(255, 255, 255, .7); padding: 3px 11px; border-radius: 999px;
  border: 1px solid var(--line);
}

/* ═══════════════ 三形态 ═══════════════ */
/* 2026-10-31：三形态区块（#forms）已按用户要求整块删除，本段 18 条 .form-* 规则
   **当前没有任何匹配元素**，保留留档。main.js 第 4 节的三形态切换逻辑同理留着
   （`$$('.form-tab')` 拿到空数组，forEach 不执行，不会报错）。
   素材补齐后：还原 index.html 里那段 HTML + 导航的「三形态」入口即可复活。 */
.forms-section {
  background:
    radial-gradient(ellipse 60% 42% at 88% 6%, rgba(248, 220, 234, .55), transparent 62%),
    radial-gradient(ellipse 55% 40% at 6% 94%, rgba(232, 224, 252, .5), transparent 60%),
    linear-gradient(180deg, #fdf6fa, var(--bg-base) 45%, var(--bg-rose) 100%);
}

.form-tabs { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 46px; }
.form-tab {
  background: var(--bg-card); border: 1px solid var(--line);
  color: var(--ink-soft); border-radius: 999px; cursor: pointer;
  padding: 12px 32px; font-size: 16px; letter-spacing: 2.5px;
  font-family: var(--font-serif); box-shadow: var(--sh-xs);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform .3s cubic-bezier(.22,.8,.36,1), box-shadow .3s, border-color .3s, color .3s, background .3s;
}
.form-tab .tab-en { font-size: 10.5px; letter-spacing: 1px; opacity: .65; font-family: var(--font-sans); }
.form-tab:hover {
  border-color: var(--pink); color: var(--pink-deep);
  transform: translateY(-3px); box-shadow: var(--sh-sm);
}
.form-tab.active {
  background: linear-gradient(135deg, #ffe9f2, #f0eafc);
  border-color: var(--pink); color: var(--pink-deep);
  box-shadow: var(--sh-pink); transform: translateY(-2px);
}
.form-tab.active .tab-en { opacity: .8; }

/* 窄屏：三个形态 tab 等分一行。
   原样是 flex + padding 12px 32px，390px 下三枚总宽约 445px 塞不进 354px，
   会折成「2 + 1」两行、第二行孤零零一个，很难看。
   改成三等分网格并收紧内边距与字距，三个并排刚好一行。 */
@media (max-width: 560px) {
  .form-tabs {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px; margin-bottom: 34px;
  }
  .form-tab { padding: 11px 6px; font-size: 15px; letter-spacing: 1px; }
  .form-tab .tab-en { font-size: 9.5px; letter-spacing: 0; }
}

.form-panel { display: none; max-width: 1120px; margin: 0 auto; }
.form-panel.active { display: block; animation: panelIn .65s cubic-bezier(.22,.8,.36,1); }
@keyframes panelIn { from { opacity: 0; transform: translateY(18px) scale(.995); } }

/* ── 三形态图片墙 ──
   原先每个形态是「左立绘 + 右信息卡（标题 / 外观描述 / 性格语言喜好 / 引用卡）」。
   2026-09-24 起文案已全部移除，版面整个让给图片：
   左侧一张主立绘（撑满两行）+ 右侧 2×2 四个细节槽 —— 每个形态 5 个空位。
   槽位仍走 .img-slot 的自动填充机制：把图放进 images/ 用对应文件名即自动显示。 */
.form-name {
  font-family: var(--font-serif); font-size: clamp(23px, 2.6vw, 30px);
  letter-spacing: 3px; color: var(--pink-deep); font-weight: 600;
  text-align: center; margin: 0 0 30px; padding-bottom: 20px; position: relative;
}
.form-name::after {
  content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 68px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--pink), var(--gold));
  opacity: .85;
}

.form-gallery {
  display: grid; grid-template-columns: minmax(260px, 400px) 1fr;
  gap: clamp(14px, 1.8vw, 22px); align-items: stretch;
}
.form-gallery .img-slot-hero { min-height: 470px; }

.gallery-thumbs {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  gap: clamp(14px, 1.8vw, 22px);
}
.gallery-thumbs .img-slot { min-height: 0; }
/* 细节槽比主图小得多，占位内容同步收紧，否则图标+文字会挤成一团 */
.gallery-thumbs .img-slot-inner { padding: 14px; gap: 6px; }
.gallery-thumbs .img-slot-inner svg { width: 26px; height: 26px; }
.gallery-thumbs .slot-label { font-size: 12.5px; letter-spacing: 1.5px; }
.gallery-thumbs .slot-hint { font-size: 10px; padding: 2px 9px; }

@media (max-width: 860px) {
  .form-gallery { grid-template-columns: 1fr; }
  .form-gallery .img-slot-hero { min-height: 380px; }
  .gallery-thumbs .img-slot { min-height: 150px; }
}

/* ═══════════════ 如我所书 · 十五页记忆 ═══════════════ */
.story-section {
  background: radial-gradient(ellipse 75% 12% at 50% 0%, #f6eaf2, transparent 80%),
    linear-gradient(180deg, #fdf8fb, #fcfafb 70%, #f5f0f9 92%, #fdf8fb);
}
.story-section .section-head { max-width: 940px; }
.story-section .section-head h2 { font-weight: 500; letter-spacing: 3px; }
.story-section .section-head h2 span { display: inline-block; }
/* ── 章节书签：挂在左侧的竖排导轨 ──
   原先吸在顶部、与导航胶囊叠在一起，滚动时会压住正文（用户反馈「和目录一起放在顶部会遮挡内容」）。
   改成左侧固定导轨后完全不占正文的垂直空间；只在剧情区块进入视口时出现（JS 加 .is-visible）。

   ⚠️ 宽度受左留白硬约束：正文左缘 = `.story-section` 的 padding-left
   （`clamp(18px, 5vw, 64px)`，≤600px 固定 23px），导轨必须整个落在它左侧：
     ≥861px → padding ≥ 43px，用 34px（左 6px）
     ≤860px → padding 30~43px，收到 26px（左 2px）
     ≤600px → padding 23px，再收到 21px（贴边，左侧不留边）
   改宽度前先按这个算一遍，否则会压到章节标题。 */
.story-bookmarks {
  position: fixed; left: 6px; top: 50%; z-index: 8;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  width: 34px; max-height: calc(100vh - 96px);
  padding: 9px 0; border: 1px solid #e4d5df; border-radius: 17px;
  background: rgba(253, 250, 252, .93);
  box-shadow: 0 10px 26px rgba(86, 65, 87, .09), inset 0 1px 0 #fff;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate(-10px, -50%);
  transition: opacity .35s ease, transform .35s ease, visibility .35s;
}
.story-bookmarks.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(0, -50%); }
/* 34px 放不下「记忆书签」四个字，只留书签图标当标识 */
.story-bookmark-label { display: flex; align-items: center; justify-content: center; flex: none; color: #946c82; }
.story-bookmark-label span { display: none; }
.story-bookmark-label svg { width: 14px; height: 18px; }
.story-bookmark-list { display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 0; flex: 0 1 auto; }
.story-bookmark-list a {
  position: relative; flex: none; display: grid; place-items: center;
  width: 28px; height: 22px; padding: 0; border-radius: 7px;
  text-decoration: none; color: #8e7c8b; font-size: 10px;
  transition: color .25s, background .25s;
}
.story-bookmark-list a span { font-family: Georgia, serif; color: inherit; }
.story-bookmark-list a.active { color: #fff; background: linear-gradient(135deg, #eea8c9 0%, #e9b0d3 62%, #d6b0e6 100%); box-shadow: 0 3px 10px rgba(205, 150, 200, .34); }
.story-bookmark-list a:hover { background: #f8eef3; }
.story-bookmark-list a.active:hover { background: linear-gradient(135deg, #eea8c9 0%, #e9b0d3 62%, #d6b0e6 100%); }
/* 章节名改由悬停浮签显示 —— 竖导轨里塞不下，浮签又能随时取用。
   浮签绝对定位在导轨右侧，不影响导轨宽度。 */
.story-bookmark-list a b {
  display: block; position: absolute; left: calc(100% + 10px); top: 50%;
  transform: translateY(-50%); white-space: nowrap; font-weight: 400;
  padding: 5px 11px; border: 1px solid #e4d5df; border-radius: 8px;
  background: rgba(253, 250, 252, .97); color: #7a5a70; font-size: 11px;
  letter-spacing: .5px; box-shadow: 0 6px 18px rgba(86, 65, 87, .12);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.story-bookmark-list a:hover b,
.story-bookmark-list a:focus-visible b { opacity: 1; }
.story-reading-count { font-family: Georgia, serif; color: #917a8b; font-size: 8px; letter-spacing: .4px; white-space: nowrap; }
.story-chapter-select { display: none; min-width: 0; flex: 1; }
.story-chapter-select select { width: 100%; background: transparent; border: 0; padding: 10px 5px; font: 12px var(--font-sans); color: #79566d; }
/* 容器上限 1180 → 1440 → 1600：1920 视口下原来两侧各空 370px，画面被压到 638px
   （用户反馈「太小了，左右空间还很大」）；随后又反馈长章正文「有些挤」——
   1.5fr/1fr 时正文只有 550px ≈ 36 字/行，第 13 章（419 字）要拉成 12 行。
   再放宽容器 + 把列比调到 1.35fr，正文与画面**同时变大**（不是牺牲画面换正文）。
   区块头仍是 940 居中，不受影响。 */
.story-list { list-style: none; max-width: 1600px; margin: 0 auto; padding: 0; position: relative; }
/* ⚠️ `--chapter-accent` 保持原值（灰紫）—— 它同时供页码、记忆线与图下题签使用，
   那几处不在本次改色范围内。正文区块里要用的金色改为显式写死，不再复用这个变量。 */
/* 书签改成左侧导轨后不再占据顶部，scroll-margin-top 只需让开导航胶囊（底缘 76px）+ 16px。 */
/* 章节改成左右两栏（参考哀丽秘榭的 .scene-stage），并**左右交错**：
   奇数章画面在左、正文在右；偶数章整体对调（用户要求「第一章图片在左边，第二章图片就在右边」）。
   网格用**显式定位**（不再依赖 order + 自动排布）。
   ⚠️ 交错只在两栏区间（≥981px）生效 —— 规则写在下面的 @media (min-width: 981px) 里，
   单栏区间靠媒体查询自然复位，不要在这里加 :nth-child 覆盖列数（会和窄屏媒体查询打权重架）。 */
.story-chapter { --chapter-accent: #946880; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); column-gap: clamp(28px, 3.6vw, 64px); row-gap: 0; align-items: start; padding: clamp(52px, 7vw, 96px) 0 clamp(60px, 7vw, 98px); position: relative; scroll-margin-top: 92px; }
.story-chapter + .story-chapter { border-top: 1px solid #e6dce4; }
/* 首章紧接在区块引语之后：区块头本身已有 clamp(38px,5vw,58px) 的下边距，
   若再叠上整章的 96px 上内边距，第一章的页码与插画会被推得离引语过远
   （用户反馈「第一张图离上面的字这么远」）。首章只留一小段呼吸位。
   注意：此处选择器权重高于窄屏的 `.story-chapter`，值本身已按各宽度收敛。 */
.story-list > .story-chapter:first-child { padding-top: clamp(18px, 2.4vw, 30px); }
.story-page-label { display: flex; align-items: center; gap: 12px; grid-column: 1 / -1; grid-row: 1; margin-bottom: 24px; font: 12px Georgia, serif; letter-spacing: 2px; color: var(--chapter-accent); }
.story-page-label i { width: 44px; height: 1px; background: #d2becb; }
.story-page-label span:last-child { color: #b19aa9; font-size: 9px; }
.story-fig { margin: 0; min-width: 0; position: relative; grid-column: 1; grid-row: 2; }
.story-fig::before { content: ''; position: absolute; inset: 12px -9px 41px 12px; border: 1px solid #d9c3d0; pointer-events: none; }
.story-slot.img-slot { min-height: 0; aspect-ratio: 16 / 9; border-radius: 3px; border: 1px solid #c8b3c1; box-shadow: 0 22px 50px rgba(75, 53, 72, .12); background: #f3e9ef; }
.story-slot.img-slot img { animation: none; object-position: center; }
.story-slot.img-slot:hover { box-shadow: 0 18px 42px rgba(71, 50, 69, .14); }
.story-fig-note { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 19px; min-height: 40px; font-size: 9px; letter-spacing: 1.1px; color: #9b8394; }
.story-fig-note > span { display: flex; flex-direction: column; gap: 4px; }
.story-fig-note b { font-weight: 400; font-family: var(--font-serif); font-size: 11px; color: #806676; letter-spacing: 1.4px; }
/* 右栏是**单列竖排**：版本号 → 标题 → 正文。窄了就不再把标题和正文拆成两列。 */
.story-body { min-width: 0; grid-column: 2; grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 0; align-items: start; }
.story-ver { grid-column: 1; grid-row: auto; margin: 5px 0 12px; color: #9a7f5c; font-size: 10px; letter-spacing: 1.8px; }
.story-ver b { font: 12px Georgia, serif; color: #b3872e; letter-spacing: 1px; margin-right: 13px; }
/* 标题用亮金 #b3872e（32~46px 属大字，3.78:1 达标）；下划线保留粉→金渐变，
   作为「粉正文」与「金标题」之间的过渡。 */
.story-title { grid-column: 1; grid-row: auto; font-family: var(--font-serif); font-size: clamp(27px, 2.7vw, 37px); letter-spacing: 2px; line-height: 1.5; margin: 0 0 20px; font-weight: 500; color: #b3872e; }
.story-title::after { content: ''; display: block; width: 44px; height: 1px; background: linear-gradient(90deg, var(--pink-deep), var(--gold)); margin-top: 14px; }
/* 区块配色分工（2026-10-08 用户定稿）：**标题与引语走金，正文走樱粉**。
   正文不要用偏暗偏灰的玫瑰棕（曾用 #7f5064），15.5px 下饱和度会被抗锯齿吃掉大半、
   读起来就是「黑黑的」。现值 #a8557a 是明亮的樱粉，浅粉底上对比度 4.73:1，仍过 AA。 */
.story-text { grid-column: 1; grid-row: auto; margin: 0; font-size: 15.5px; line-height: 2.05; color: #a8557a; text-align: justify; }
/* 引语用深一档的金 #946c1c —— 它只有 16~20px，不算大字，必须满足 4.5:1（实测 4.76:1），
   亮金 #b3872e 在这一档只有 3.78:1，会糊。 */
/* 引语在 .story-body 内、紧跟正文之后（用户要求「把这部分字移动到正文下面」）。
   这样它永远贴在正文列下方，不会被更高的画面列推下去。 */
/* 字号与正文完全一致（用户要求「调整成正文一样的大小」）—— 曾用 clamp(16px,1.7vw,20px)，
   1920 下会到 20px，比正文大一圈。引语靠金色 + 居中 + 上方纹饰与正文区分，不靠字号。
   ⚠️ 降到 15.5px 后仍属「小字」，颜色必须维持深金 #946c1c（4.54:1 过 AA），不要换成亮金。 */
.story-quote { grid-column: 1; grid-row: auto; width: 100%; max-width: 830px; margin: 32px auto 0; padding: 30px 0 0; background: var(--ornament) center top / 104px 11px no-repeat; text-align: center; color: var(--gold-text); font-family: var(--font-serif); font-size: 15.5px; line-height: 2.05; letter-spacing: .4px; }
.story-quote-who { display: block; margin: 0 0 7px; font-family: var(--font-sans); font-size: 10px; letter-spacing: 2px; color: var(--gold-text); }
.story-memory-mark { flex: none; width: 98px; height: 42px; overflow: visible; color: var(--chapter-accent); opacity: .75; }
.story-memory-mark .memory-path { fill: none; stroke: currentColor; stroke-width: .85; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2.6s cubic-bezier(.22,.75,.3,1); }
.story-memory-mark.is-drawn .memory-path { stroke-dashoffset: 0; }
.story-memory-mark .memory-star { fill: currentColor; opacity: .65; }
/* 关键页与普通页共用尺寸、排版和留白，仅以记忆线区分。
   ⚠️ **标题与引语在 15 章里必须同色** —— 用户明确要求「不同章节对应部分字体颜色统一」。
   所以这里不再按 tone 覆盖标题/引语的文字颜色（曾经麦田/希望是金、永恒是紫，看起来就是不统一）。
   `--chapter-accent` 仍按章保留差异，但它现在只服务于**区块外**的页码与图下记忆线。 */
.story-feature[data-tone="wheat"] { --chapter-accent: #a57b3f; }
.story-feature[data-tone="wheat"] .story-slot, .story-feature[data-tone="hope"] .story-slot { border-color: #c5a97d; }
.story-feature[data-tone="wheat"] .story-fig::before, .story-feature[data-tone="hope"] .story-fig::before { border-color: #ddc7a4; }
.story-feature[data-tone="wheat"].in-view img { animation: storyWheatLens 22s ease-in-out infinite alternate; }
@keyframes storyWheatLens { from { transform: scale(1); } to { transform: scale(1.018); } }
.story-feature[data-tone="eternal"] { --chapter-accent: #9480b5; }
.story-feature[data-tone="eternal"] .story-memory-mark.is-drawn .memory-star { animation: memoryGather 3.4s ease both; }
@keyframes memoryGather { from { opacity: 0; transform: translate(var(--sx, 0px), var(--sy, 0px)); } to { opacity: .65; transform: none; } }
.story-feature[data-tone="hope"] { --chapter-accent: #b48b4d; }
.story-feature[data-tone="hope"] .memory-path { stroke-width: 1.15; transition-duration: 1.8s; }
.story-feature[data-tone="causal"] { --chapter-accent: #a17a9f; }
.story-feature[data-tone="causal"] .memory-path { stroke-width: 1; transition-duration: 3.6s; }
.story-feature[data-tone="epilogue"] { --chapter-accent: #a58f9e; }
.story-feature[data-tone="epilogue"] .story-slot { box-shadow: 0 10px 32px rgba(85, 71, 85, .07); }
/* 子项错时出现，章节盒子本身不隐藏，避免观察器与锚点失效。 */
html.gallery-ready .story-chapter:not(.is-read) .story-fig,
html.gallery-ready .story-body:not(.is-body-read) { opacity: 0; transform: translateY(18px); }
.story-chapter .story-fig, .story-chapter .story-body { transition: opacity .8s ease, transform .85s cubic-bezier(.2,.7,.3,1); }
.story-body.is-body-read { transition-delay: .1s; }
/* 引语已回到 .story-body 内（紧跟正文），随正文块一起显现，再由自身动画收一笔。
   keyframe 起点保持 opacity:0。 */
.story-body.is-body-read .story-quote { animation: storyQuoteIn 1s .34s ease both; }
@keyframes storyQuoteIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.story-endpaper { max-width: 1600px; margin: 24px auto 0; border-top: 1px solid #e5d7e1; padding: 78px 18px 30px; text-align: center; }
.story-endpaper > svg { width: 108px; height: 43px; color: #bca0b3; margin-bottom: 22px; }
.endpaper-kicker { color: #a391a1; font-size: 10px; letter-spacing: 4px; }
.endpaper-title { font: 500 clamp(18px, 2.5vw, 25px) var(--font-serif); color: #795e72; letter-spacing: 2px; margin: 19px 0 27px; line-height: 1.8; }
.story-return { display: inline-flex; align-items: center; gap: 14px; color: #976c87; text-decoration: none; font-size: 12px; letter-spacing: 2px; padding: 12px 23px; border: 1px solid #d9c0d1; border-radius: 2px; transition: background .3s; }
.story-return:hover { background: #f4e8f0; }
.story-return svg { width: 18px; height: 18px; }
/* 窄屏正文左留白更小（padding 30~43px），导轨必须跟着收窄，否则会压到章节标题。 */
@media (max-width: 860px) {
  .story-bookmarks { left: 2px; width: 26px; }
  .story-bookmark-list a { width: 22px; height: 20px; font-size: 9px; }
  .story-bookmark-list a b { font-size: 10px; }
  .story-reading-count { display: none; }
  .story-chapter { scroll-margin-top: 88px; }
}
/* ── 两栏区间（≥981px）：奇数章画面在左，偶数章画面在右 ──
   用 min-width 包住，单栏区间就自然不存在这些规则，不必再写一遍复位。 */
@media (min-width: 981px) {
  .story-chapter:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
  .story-chapter:nth-child(even) .story-fig { grid-column: 2; }
  .story-chapter:nth-child(even) .story-body { grid-column: 1; }
}
/* 981~1199px：两栏还塞得下，但 1.35fr 会把正文压到 24 字/行（1024 笔记本尤其明显）。
   这一段改成等宽两栏（交错保留），正文回到 27~37 字/行，画面也不至于瘦成一条。
   ⚠️ 必须把 :nth-child(even) 一起写进来 —— 它的权重高于裸 .story-chapter，不写会被它盖掉。 */
@media (min-width: 981px) and (max-width: 1199px) {
  .story-chapter, .story-chapter:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 980px) {
  /* 与哀丽秘榭同一断点退回单栏：页码 → 画面 → 正文（引语跟着正文走）。
     单栏下一律「图在上」，不做左右交错。 */
  .story-chapter { grid-template-columns: minmax(0, 1fr); column-gap: 0; row-gap: 0; }
  .story-page-label { grid-column: 1; grid-row: 1; margin-bottom: 20px; }
  .story-fig { grid-column: 1; grid-row: 2; }
  /* 单栏时正文回到 680px 居中，否则 980px 视口下会拉成 54 字/行、读起来太累。 */
  .story-body { grid-column: 1; grid-row: 3; max-width: 680px; margin: 30px auto 0; }
  .story-title { font-size: clamp(28px, 4.6vw, 38px); }
  .story-bookmark-label span { display: none; }
  /* 引语字号跟着正文走，窄屏正文是 16px，这里也 16px。 */
  .story-text, .story-quote { font-size: 16px; }
}
@media (max-width: 600px) {
  .story-section { padding-left: 23px; padding-right: 23px; }
  .story-section .section-head h2 { font-size: clamp(24px, 7vw, 32px); letter-spacing: 1.4px; line-height: 1.6; }
  .story-section .section-head h2 span { display: block; }
  .story-section .section-head .sub { font-size: 13px; line-height: 1.9; }
  /* 正文左留白只有 23px：导轨贴边并再收一档，左侧不留边、右缘做成半圆。 */
  .story-bookmarks { left: 0; width: 21px; padding: 7px 0; border-left: 0; border-radius: 0 12px 12px 0; }
  .story-bookmark-list a { width: 18px; height: 20px; font-size: 8px; border-radius: 5px; }
  .story-bookmark-label svg { width: 12px; height: 15px; }
  .story-chapter { padding: 40px 0 46px; scroll-margin-top: 84px; }
  .story-body { margin-top: 24px; }
  .story-page-label { font-size: 11px; }
  .story-fig::before { inset: 8px -6px 43px 8px; }
  .story-fig-note { font-size: 8px; letter-spacing: .5px; padding-top: 14px; }
  .story-fig-note b { font-size: 10px; }
  .story-memory-mark { width: 82px; }
  .story-title { font-size: 30px; margin-bottom: 20px; }
  .story-text { font-size: 16px; line-height: 2; text-align: left; }
  .story-quote { font-size: 16px; line-height: 2; margin-top: 28px; padding-top: 26px; }
  .story-endpaper { padding-top: 53px; }
}
/* 矮视口：竖导轨要装得下 15 格 + 图标 + 计数，把每格压扁一点免得超出视口 */
@media (max-height: 620px) { .story-bookmark-list a { height: 17px; } }
@media (prefers-reduced-motion: reduce) {
  html.gallery-ready .story-chapter:not(.is-read) .story-fig,
  html.gallery-ready .story-body:not(.is-body-read) { opacity: 1; transform: none; }
  .story-chapter .memory-path { stroke-dashoffset: 0; transition: none; }
  .story-chapter img, .story-chapter .memory-star, .story-chapter .story-quote { animation: none !important; }
}

/* ═══════════════ 人物星图 · 记忆观星台 ═══════════════ */
/* 星图已移入档案馆第 7 个页签（.arch-panel-wide），原 section 背景不再使用 */
.star-colophon { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 24px; color: #917e99; font-size: 10px; letter-spacing: 2px; }
.star-colophon span:first-child { font: 13px var(--font-serif); letter-spacing: 3px; color: #765879; }
.star-colophon i { width: 35px; height: 1px; background: #c7b6d2; }
.star-observatory { --star-accent: #e05a95; --star-ink: #a8406f; display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; max-width: 1400px; margin: 0 auto; border: 1px solid #d9cde1; border-radius: 5px; background: #fcfafd; box-shadow: 0 24px 70px rgba(90, 62, 106, .09); overflow: clip; }
.star-toolbar { order: 0; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 23px; border-bottom: 1px solid #e4dbe9; background: rgba(255, 253, 255, .8); }
.star-legend { display: flex; gap: 5px; min-width: 0; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #d9c9e0 transparent; }
.star-filter { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 39px; padding: 7px 12px; border: 1px solid transparent; border-radius: 2px; background: transparent; font: 11px var(--font-sans); color: #76667f; cursor: pointer; white-space: nowrap; transition: background .25s, border-color .25s, color .25s; }
.star-filter span { font: 10px Georgia, serif; color: #a28baa; }
.star-filter:hover { background: #f4ecf7; }
.star-filter.active { background: #f0e8f4; border-color: #d7c5df; color: #73557e; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
/* 图例、星点与球层使用同一组关系颜色。 */
.dot-bond { background: #e05a95; box-shadow: 0 0 0 3px rgba(224, 90, 149, .1); }
.dot-gold { background: #c9922a; box-shadow: 0 0 0 3px rgba(201, 146, 42, .12); }
.dot-mem { background: #7f6fd0; box-shadow: 0 0 0 3px rgba(127, 111, 208, .12); }
.dot-ally { background: #4a80c0; box-shadow: 0 0 0 3px rgba(74, 128, 192, .12); }
.dot-dark { background: #78789a; box-shadow: 0 0 0 3px rgba(120, 120, 154, .12); }
.star-tools { display: flex; gap: 5px; flex: none; }
.star-tools button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 39px; padding: 7px 10px; border: 1px solid #dfd2e6; border-radius: 2px; background: #fdfbfe; color: #806b8b; font: 11px var(--font-sans); cursor: pointer; }
.star-tools button:hover { background: #f1eaf5; }
.star-tools svg { width: 17px; height: 17px; }
.star-play-icon { display: none; }
#starRotate[aria-pressed="true"] .star-play-icon { display: block; }
#starRotate[aria-pressed="true"] .star-pause-icon { display: none; }
.star-layout { order: 1; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); align-items: stretch; min-width: 0; }
.star-views { min-width: 0; display: flex; }
.star-stage { display: flex; flex-direction: column; min-width: 0; width: 100%; padding: 25px 22px 24px; position: relative; background: radial-gradient(ellipse at 50% 42%, #fffaff, #f5f0fa 65%, #efeaf5 100%); }
.star-stage-heading, .star-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 10px; letter-spacing: 1.5px; color: #917c9a; }
.star-stage-heading span:first-child { color: #77617f; }
.star-stage-heading span:last-child, .star-panel-heading span:last-child { font: 9px Georgia, serif; letter-spacing: 1.2px; }
.star-globe-stack { position: relative; width: 100%; max-width: 640px; margin: 13px auto 18px; isolation: isolate; }
.star-globe { width: 100%; aspect-ratio: 1 / 1; display: block; border-radius: 3px; cursor: grab; touch-action: none; outline: none; }
.star-globe-gl { position: relative; z-index: 1; }
.star-globe-surface, .star-globe-label { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.star-globe-surface { z-index: 0; }
.star-globe-label { z-index: 2; }
.star-globe.grabbing { cursor: grabbing; }
.star-globe.pointing { cursor: pointer; }
.star-globe:focus-visible { outline: 2px solid #b894c9; outline-offset: -2px; }
.star-focus { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: auto; padding: 20px 8px 0; border-top: 1px solid #ddd0e5; color: var(--star-ink); font: 16px var(--font-serif); letter-spacing: 1px; flex-wrap: wrap; }
.star-focus-origin { color: #a65889; }
.star-focus svg { width: clamp(45px, 7vw, 86px); height: 18px; color: var(--star-accent); }
.star-focus-rel { width: 100%; text-align: center; margin-top: -6px; font: 10px var(--font-sans); color: #8e7898; letter-spacing: 1.7px; }
/* 公共读屏辅助类仍供其他区块使用。人物索引本身现在始终可见。 */
.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; }
.star-panel { min-width: 0; padding: 25px 28px 24px; border-left: 1px solid #e1d6e8; background: linear-gradient(145deg, #fefcfd, #fbf8fc); display: flex; flex-direction: column; }
.star-panel > * { flex: none; }
.star-panel-heading { margin-bottom: 19px; }
.star-panel-content { min-width: 0; }
.star-tools button:disabled { cursor: default; opacity: .55; }
.star-panel-rel { font-size: 10px; letter-spacing: 1.7px; margin: 0 0 8px; font-weight: 400; color: var(--star-ink); }
.star-panel h3 { font: 500 clamp(27px, 2.6vw, 36px) var(--font-serif); letter-spacing: 2px; color: #624767; line-height: 1.5; }
.star-title { font-size: 11.5px; color: #89758d; margin: 9px 0 23px; line-height: 1.8; }
.star-quote { font: 15px/1.95 var(--font-serif); color: #68516e; border-top: 1px solid #e4d7e8; border-bottom: 1px solid #e4d7e8; padding: 20px 0; margin: 0 0 21px; text-align: left; position: relative; }
.star-quote::before { content: ''; width: 36px; height: 1px; position: absolute; top: -1px; left: 0; background: var(--star-accent); }
.star-note-label { font-size: 9px; letter-spacing: 2px; color: #a088ac; margin-bottom: 8px; }
.star-note { font-size: 12.5px; color: #77617f; text-align: justify; line-height: 1.95; }
.star-panel-pager { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: auto; padding-top: 23px; color: #99809e; }
.star-panel-pager button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; padding: 6px 4px; border: 0; background: transparent; color: #896b91; font: 11px var(--font-sans); cursor: pointer; }
.star-panel-pager button:hover { color: var(--star-ink); }
.star-panel-pager svg { width: 17px; height: 17px; }
.star-panel-pager > span { font: 10px Georgia, serif; letter-spacing: 2px; }
/* 无论文案长短，人物图片与记忆铭牌都保持16:9，不吸收剩余高度。 */
/* ⚠️ 官方立绘原图是**方形(1:1)**，格子必须同比例，否则 object-fit:cover 会把人物的腿裁掉
   （曾用 16/9，实测白厄只剩上半身）。max-width 用来压住面板总高，别让它把整段撑长。
   ⚠️ 必须显式写 `width: 100%`：面板是 flex column，光靠 align-items:stretch 时，
      一旦带上 `margin: 0 auto`（auto 外边距会取消 stretch），宽度会塌成 0（实测 2px）。 */
.star-portrait.img-slot { min-height: 0; aspect-ratio: 1 / 1; flex: none; width: 100%; max-width: 520px; margin: 0 auto 25px; border: 1px solid #d4c2de; border-radius: 2px; background: radial-gradient(ellipse at 80% 20%, #fdf6ec, transparent 60%), linear-gradient(135deg, #f1e8f4, #faf5fc 50%, #eee8f6); box-shadow: none; }
.star-portrait.img-slot::before, .star-portrait.img-slot::after { display: none; }
.star-portrait.img-slot img { animation: none; transition: opacity .35s; object-position: top center; }
.star-portrait.img-slot.is-loading img { opacity: .35; }
.star-memory-plaque.img-slot-inner { width: 100%; height: 100%; position: absolute; inset: 0; padding: 18px; gap: 5px; justify-content: center; color: var(--star-ink); overflow: hidden; }
.star-plaque-art { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .28; pointer-events: none; }
.star-plaque-mark { position: absolute; right: 14%; top: 9%; font: 120px/1 var(--font-serif); opacity: .045; pointer-events: none; }
.star-plaque-kicker { font-size: 9px; letter-spacing: 4px; opacity: .8; }
.star-portrait .slot-label { position: relative; font: 500 clamp(22px, 2.3vw, 31px) var(--font-serif); letter-spacing: 5px; margin-top: 4px; }
.star-plaque-caption { font-size: 9px; letter-spacing: 2px; margin-top: 8px; }
.star-directory { order: 2; padding: 22px 27px 27px; border-top: 1px solid #dfd2e6; background: #fdfbfe; min-width: 0; }
.star-directory-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; color: #836b8d; font-size: 10px; letter-spacing: 2px; }
.star-directory-heading span:last-child { color: #a28aab; font-size: 9px; letter-spacing: 1px; }
.star-person-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.star-person-list li { min-width: 0; }
.star-person-list button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 59px; text-align: left; padding: 11px 12px; background: #faf6fc; border: 1px solid #e6dceb; border-radius: 2px; color: #81678b; font: 11px var(--font-sans); cursor: pointer; transition: background .25s, border-color .25s; }
.star-person-list button:hover { background: #f3eaf8; border-color: #d5bcdf; }
.star-person-list button[aria-current="true"] { background: #f0e5f5; border-color: var(--person-accent); color: var(--person-ink); }
.star-person-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--person-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--person-accent) 10%, transparent); flex: none; }
.star-person-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; line-height: 1.6; }
.star-person-text b { font-weight: 500; }
.star-person-text small { font-size: 8px; color: #a18bab; }
.star-observatory button:focus-visible { outline: 2px solid #ae83c1; outline-offset: 2px; }
.star-observatory.has-no-gl .star-globe-stack { display: none; }
.star-observatory.has-no-gl .star-stage { min-height: 220px; }
.star-observatory.has-no-gl .star-stage-heading::after { content: '人物索引可直接查看每段相遇'; font-size: 11px; letter-spacing: 0; }
.star-observatory.has-no-gl .star-tools { display: none; }
/* 宽屏：把「相遇索引」从底部横条改成**左侧竖排导轨** —— 观星台变成「索引 | 天球 | 档案」三栏，
   正好吃掉两侧的大片留白，同时省掉底部那一整块纵向空间。
   ⚠️ 三栏要成立，容器宽度必须 ≥ 导轨 + 主区。主区**不能比旧版 1260 还窄**，否则这一档的天球
      会比 1440px（横条版式）更小，看着像退步 —— 反推得 1700px 才够，所以断点定在这里。
      低于这个宽度就退回「主区在上、索引横条在下」的老版式，不动。
   ⚠️ 三条子项都要**显式指定 grid-row/column**：父级 .star-observatory 是 grid，
      只靠 order 自动排布会在两列下乱位。 */
@media (min-width: 1700px) {
  .star-observatory { max-width: 1800px; grid-template-columns: clamp(248px, 16.5vw, 300px) minmax(0, 1fr); }
  .star-toolbar { grid-row: 1; grid-column: 1 / -1; }
  .star-layout { grid-row: 2; grid-column: 2; }
  .star-directory { grid-row: 2; grid-column: 1; border-top: 0; border-right: 1px solid #dfd2e6; display: flex; flex-direction: column; min-height: 0; }
  .star-person-list { grid-template-columns: minmax(0, 1fr); gap: 5px; align-content: stretch; flex: 1 1 auto; min-height: 0; grid-auto-rows: minmax(42px, 1fr); }
  .star-person-list button { min-height: 42px; padding: 8px 10px; gap: 8px; }
  /* 竖排导轨里姓名与关系并成一行，18 条正好和左侧天球等高。 */
  .star-person-text { flex: 1 1 auto; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 8px; }
  /* 方形立绘让面板变高，天球区会多出纵向空白 —— 见上方 @media (min-width:981px) 的统一处理。 */
  .star-globe-stack { max-width: 780px; }
}
/* ⚠️ 双栏档（>980px）：方形立绘让**右栏面板比左栏舞台高**，而舞台是 stretch 的，
   于是多出来的纵向空间会被 .star-focus 的 margin-top:auto 全部吃走 ——
   实测 1000px 下「球底 → 引语线」空隙高达 **381px**，看着就是球体下方一大片空白。
   给天球也加 auto 上下边距，把这段空白摊到上下两边。
   ⚠️ 别只写在 ≥1700 的三栏块里：981~1699 的双栏同样会犯（用户 2026-10-10 就是在 ~1000px 截到的）。 */
@media (min-width: 981px) {
  .star-globe-stack { margin-top: auto; margin-bottom: auto; }
  /* ⚠️ 必须同时摘掉引语线自己的 margin-top:auto。否则自由空间被 3 个 auto 边距平分，
     球下仍是球上的 2 倍（实测 172 / 263）。摘掉后只有天球上下两个 auto ⇒ 严格 50/50 居中。 */
  .star-focus { margin-top: 0; }
}
@media (max-width: 1100px) {
  .star-toolbar { flex-wrap: wrap; padding: 14px 18px; }
  .star-legend { flex: 1; }
  .star-stage { padding: 22px 17px; }
  .star-panel { padding: 22px; }
  .star-person-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .star-layout { grid-template-columns: minmax(0, 1fr); }
  .star-stage { padding: 24px 28px; }
  .star-globe-stack { max-width: 540px; margin-top: 6px; }
  .star-panel { border-left: 0; border-top: 1px solid #dfd2e6; padding: 28px; }
  .star-portrait.img-slot { width: 100%; max-width: min(100%, 520px); margin-left: auto; margin-right: auto; }
  .star-directory { order: 1; border-bottom: 1px solid #dfd2e6; border-top: 0; }
  .star-layout { order: 2; }
  .star-panel h3 { font-size: 32px; }
}
@media (max-width: 600px) {
  .star-colophon { gap: 10px; font-size: 9px; letter-spacing: .4px; }
  .star-colophon span:first-child { font-size: 11px; letter-spacing: 1px; }
  .star-colophon i { width: 20px; }
  .star-toolbar { gap: 10px; padding: 12px; }
  .star-legend { flex-basis: 100%; padding-bottom: 5px; }
  .star-filter { min-height: 42px; padding: 7px 10px; }
  .star-tools { margin-left: auto; }
  .star-tools button { min-height: 42px; }
  .star-directory { padding: 16px 13px; }
  .star-person-list { grid-template-columns: none; grid-template-rows: repeat(2, auto); grid-auto-flow: column; grid-auto-columns: 145px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #d7c1e1 transparent; padding: 3px 2px 8px; }
  .star-person-list button { min-height: 59px; }
  .star-stage { padding: 18px 10px; }
  .star-stage-heading { padding: 0 3px; font-size: 9px; letter-spacing: .7px; }
  .star-stage-heading span:last-child { font-size: 8px; }
  .star-focus { gap: 11px; padding-top: 17px; font-size: 15px; }
  .star-focus-rel { font-size: 9px; letter-spacing: 1px; }
  .star-panel { padding: 22px 17px; }
  .star-panel h3 { font-size: 29px; }
  .star-portrait .slot-label { font-size: 24px; letter-spacing: 2px; }
  .star-plaque-mark { font-size: 85px; }
  .star-quote { font-size: 16px; line-height: 1.95; }
  .star-note { font-size: 14px; text-align: left; }
  .star-title { font-size: 12px; }
  .star-panel-pager button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .star-portrait.img-slot img { transition: none; } }

/* ═══════════════ 哀丽秘榭 · 黄昏记忆画廊 ═══════════════ */
.elysia-section {
  --scene-accent: #967341;
  background: radial-gradient(ellipse 65% 32% at 15% 30%, #f8ebd6, transparent 70%),
    radial-gradient(ellipse 55% 35% at 95% 58%, #f3e8ef, transparent 70%),
    linear-gradient(180deg, #fdf5f6, #fffaf2 48%, #fdf9f7);
  padding-bottom: clamp(68px, 8vw, 112px);
}
.elysia-section .section-head { max-width: 850px; }
.elysia-section .section-head h2 { background: linear-gradient(118deg, #8e6c38, #b75c85 70%, #786594); -webkit-background-clip: text; background-clip: text; }
.scene-gallery { max-width: 1320px; margin: 0 auto; }
.scene-gallery-topline { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 15px; margin-bottom: 28px; border-bottom: 1px solid #d9c7aa; font-size: 10px; color: #927c60; letter-spacing: 2.8px; }
.scene-stage { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 60px); align-items: start; }
.scene-view { margin: 0; position: relative; min-width: 0; }
.scene-view::before { content: ''; position: absolute; inset: 13px -11px 31px 12px; border: 1px solid rgba(166, 137, 90, .28); pointer-events: none; }
.scene-viewer.img-slot { aspect-ratio: 16 / 9; min-height: 0; border-radius: 3px; border: 1px solid rgba(149, 119, 76, .4); background: #efe4d9; box-shadow: 0 18px 44px rgba(98, 73, 47, .12); isolation: isolate; cursor: zoom-in; }
.scene-viewer img { object-fit: cover; object-position: center; animation: none; z-index: 1; }
.scene-viewer .scene-image { opacity: 0; transform: scale(1.035); transition: opacity .9s ease, transform 1.4s cubic-bezier(.2,.65,.3,1); }
.scene-viewer .scene-image.is-current { opacity: 1; transform: scale(1); }
.scene-viewer .scene-image.is-leaving { opacity: 0; transform: scale(1.02); }
.scene-viewer .scene-image.is-current.is-settled { animation: sceneLens 20s ease-in-out infinite alternate; }
.scene-gallery:not(.in-view) .scene-viewer .scene-image.is-current.is-settled,
.scene-gallery:not(.in-view) .scene-motes i,
html.page-hidden .scene-gallery .scene-image,
html.page-hidden .scene-motes i { animation-play-state: paused; }
@keyframes sceneLens { from { transform: scale(1); } to { transform: scale(1.024); } }
.scene-view-caption { display: flex; justify-content: space-between; gap: 14px; padding: 17px 0 0; font-size: 11px; letter-spacing: 1.6px; color: #826d57; }
.scene-view-caption span:last-child { font-size: 10px; color: #93887d; }
.scene-reading { min-width: 0; padding: 6px 0 0; }
.scene-reading-head { display: flex; justify-content: space-between; align-items: center; font-size: 10px; letter-spacing: 2.5px; color: #8e7a62; }
.scene-reading-count { font-family: Georgia, serif; letter-spacing: 2px; }
.scene-reading-no { font-family: var(--font-serif); font-size: 48px; line-height: 1.4; color: #c1a77e; margin-top: 18px; }
.scene-reading h3 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(23px, 2.3vw, 32px); line-height: 1.5; letter-spacing: 2px; color: #684f3e; margin: 4px 0 12px; }
.scene-reading-rule { display: flex; align-items: center; gap: 12px; color: #b79a69; margin: 14px 0 20px; }
.scene-reading-rule span { width: 52px; height: 1px; background: currentColor; }
.scene-reading-rule svg { width: 14px; height: 14px; }
.scene-reading-text { font-size: 14px; line-height: 2; color: #716153; text-align: justify; min-height: 9em; }
.scene-reading.is-changing h3, .scene-reading.is-changing .scene-reading-text { animation: sceneTextIn .6s ease both; }
@keyframes sceneTextIn { from { opacity: .15; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.scene-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(160, 132, 91, .25); }
.scene-nav { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border: 1px solid #d9c7ac; border-radius: 50%; background: transparent; color: #80653c; cursor: pointer; transition: background .25s, border-color .25s; }
.scene-nav svg { width: 22px; height: 22px; }
.scene-nav:hover { background: #f4e8d7; border-color: #a88b5c; }
.scene-expand { display: flex; align-items: center; gap: 12px; padding: 10px 0; border: 0; background: transparent; color: #85633b; font: 12px var(--font-sans); letter-spacing: 1px; cursor: pointer; }
.scene-expand svg { width: 16px; height: 16px; }
.scene-reading-foot { font-family: var(--font-serif); font-size: 11px; letter-spacing: 1px; color: #98877a; margin-top: 22px; }
.scene-motes { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.scene-motes i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #ffe3a2; box-shadow: 0 0 7px rgba(255,210,120,.6); opacity: 0; animation: sceneMote 11s linear infinite; }
.scene-motes i:nth-child(1) { left: 12%; top: 82%; animation-delay: -1s; }
.scene-motes i:nth-child(2) { left: 27%; top: 70%; animation-delay: -4s; }
.scene-motes i:nth-child(3) { left: 42%; top: 88%; animation-delay: -8s; }
.scene-motes i:nth-child(4) { left: 62%; top: 66%; animation-delay: -2s; }
.scene-motes i:nth-child(5) { left: 78%; top: 82%; animation-delay: -6s; }
.scene-motes i:nth-child(6) { left: 91%; top: 74%; animation-delay: -9s; }
.scene-motes i:nth-child(7) { left: 51%; top: 56%; animation-delay: -5s; }
.scene-motes i:nth-child(8) { left: 33%; top: 43%; animation-delay: -7s; }
.scene-gallery[data-atmosphere="water"] .scene-motes i { background: #faf1df; box-shadow: 0 0 5px #eac994; animation-duration: 15s; }
.scene-gallery[data-atmosphere="forest"] .scene-motes i { background: #dfddf1; box-shadow: 0 0 7px #b7ace5; animation-duration: 13s; }
@keyframes sceneMote { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 22%, 60% { opacity: .65; } 100% { opacity: 0; transform: translate(22px, -52px) scale(1.1); } }
.scene-index-label { max-width: 1320px; margin: 44px auto 9px; display: flex; justify-content: space-between; gap: 16px; font-size: 10px; letter-spacing: 2px; color: #8e7b66; }
/* 裁切窗口与移动内容分开，避免循环时右侧露白。 */
.scene-track { max-width: 1320px; margin: auto; overflow: hidden; overflow: clip; padding: 12px 12px 20px; touch-action: pan-y; }
.scene-track:focus-visible { outline: 2px solid #b89967; outline-offset: -2px; }
.scene-inner { display: flex; gap: 18px; }
.scene-panel { flex: 0 0 clamp(148px, 15vw, 182px); min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
.scene-bg.img-slot { aspect-ratio: 16 / 9; min-height: 0; border-radius: 2px; border: 1px solid rgba(175, 153, 117, .45); box-shadow: none; transition: border-color .3s, box-shadow .3s; }
.scene-bg img { object-position: center; animation: none; }
.scene-bg.img-slot.filled::before { display: none; }
.scene-panel .scene-bg.filled { cursor: pointer; }
.scene-panel.is-selected .scene-bg { border-color: #ae8b53; box-shadow: 0 0 0 3px #f0e1c8; }
.scene-panel:hover .scene-bg { border-color: #a88650; box-shadow: 0 4px 12px rgba(99, 70, 38, .1); }
.scene-card { display: flex; align-items: baseline; gap: 9px; padding: 12px 1px 5px; background: none; border: 0; box-shadow: none; }
.scene-card .scene-no { font-family: var(--font-serif); font-size: 11px; color: #a78c63; flex: none; }
.scene-card h3 { font-family: var(--font-serif); font-size: 12px; line-height: 1.6; font-weight: 400; letter-spacing: .4px; color: #77685c; }
.scene-card > p:not(.scene-no) { display: none; }
.scene-panel.is-selected .scene-card h3 { color: #8a5d2f; font-weight: 600; }
.scene-progress { position: relative; max-width: 1320px; height: 4px; margin: 2px auto 0; background: #eee3d2; border-radius: 2px; cursor: pointer; touch-action: none; }
.scene-progress::before { content: ''; position: absolute; inset: -12px 0; }
.scene-progress:focus-visible { outline: 2px solid #a98b5d; outline-offset: 5px; }
.scene-progress-thumb { position: absolute; top: 0; left: 0; height: 100%; background: linear-gradient(90deg, #b49361, #cd9c9e); border-radius: 2px; pointer-events: none; transition: transform .3s ease; }
.scene-progress.is-dragging .scene-progress-thumb { transition: none; }
.scene-bg-village, .scene-bg-courtyard, .scene-bg-swing, .scene-bg-pond, .scene-bg-mill, .scene-bg-dock, .scene-bg-chime { background: #e9d7bf; }
.scene-bg-entrance, .scene-bg-maze, .scene-bg-grove { background: #d6c9cd; }
@media (max-width: 980px) {
  .scene-stage { grid-template-columns: 1fr; gap: 36px; }
  .scene-reading { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(0, 1.4fr); gap: 0 32px; }
  .scene-reading-head { grid-column: 1 / -1; margin-bottom: 14px; }
  .scene-reading-no { grid-column: 1; grid-row: 2; margin: 0; font-size: 38px; }
  .scene-reading h3 { grid-column: 1; grid-row: 3; align-self: start; margin-top: 3px; }
  .scene-reading-rule { display: none; }
  .scene-reading-text { grid-column: 2; grid-row: 2 / 5; min-height: 0; font-size: 15px; }
  .scene-controls { grid-column: 1; grid-row: 4; margin-top: 14px; }
  .scene-reading-foot { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .elysia-section { padding-left: 22px; padding-right: 22px; }
  .elysia-section .section-head h2 { font-size: clamp(24px, 6.4vw, 34px); letter-spacing: 1px; }
  .scene-gallery-topline { font-size: 8px; letter-spacing: 1.2px; margin-bottom: 22px; gap: 12px; }
  .scene-gallery-topline span:last-child { white-space: nowrap; }
  .scene-view::before { inset: 9px -7px 30px 8px; }
  .scene-view-caption { font-size: 10px; letter-spacing: .4px; gap: 8px; padding-top: 14px; }
  .scene-view-caption span:last-child { font-size: 8px; letter-spacing: .3px; }
  .scene-stage { gap: 32px; }
  .scene-reading { display: block; }
  .scene-reading-head { margin-bottom: 0; }
  .scene-reading-no { font-size: 31px; margin-top: 18px; }
  .scene-reading h3 { font-size: 25px; margin: 2px 0 16px; }
  .scene-reading-rule { display: flex; margin: 12px 0 18px; }
  .scene-reading-text { font-size: 15px; line-height: 2; text-align: left; }
  .scene-controls { margin-top: 24px; }
  .scene-reading-foot { margin-top: 20px; }
  .scene-index-label { margin-top: 34px; font-size: 9px; letter-spacing: .8px; }
  .scene-panel { flex-basis: 148px; }
}
@media (prefers-reduced-motion: reduce) {
  .scene-viewer .scene-image, .scene-motes i { animation: none !important; transition: none; }
  .scene-motes { display: none; }
  .scene-track { overflow-x: auto; }
  .scene-progress { display: none; }
  .scene-reading.is-changing h3, .scene-reading.is-changing .scene-reading-text { animation: none; }
}
/* ═══════════════ 歌与短片 ═══════════════ */
/* 2026-10-31：歌与信并入档案馆页签（#arch-song），原来那个独立的
   <section class="song-section"> 已删除 —— 这条规则现在**没有匹配元素**，纯属留档。
   2026-11-03：信笺区块删掉后，页签与大标题已改名为「歌与短片」。
   区块自带的粉紫背景也随之停用，改跟档案馆的底色走（这是"并进去"该有的样子）。
   要恢复独立区块时连 HTML 和这条一起还原。 */
.song-section {
  background:
    radial-gradient(ellipse 58% 42% at 12% 12%, rgba(248, 220, 234, .55), transparent 60%),
    radial-gradient(ellipse 55% 40% at 90% 88%, rgba(232, 224, 252, .55), transparent 60%),
    var(--bg-base);
}

.song-grid {
  display: grid; grid-template-columns: 1fr 1.2fr;
  gap: clamp(20px, 3vw, 40px); max-width: 1200px; margin: 0 auto; align-items: start;
}
@media (max-width: 980px) { .song-grid { grid-template-columns: 1fr; } }

.lyrics-card {
  background: linear-gradient(168deg, #ffffff, #fdf7fb 62%, #faf6fd);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(26px, 3.4vw, 42px); box-shadow: var(--sh-md);
  position: relative; overflow: hidden;
}
/* 粉色羽毛笔装饰 */
.lyrics-card::before {
  content: ""; position: absolute; top: -34px; right: -26px;
  width: 132px; height: 132px; opacity: .13; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M78 12C50 20 30 42 24 72l-8 16 16-8c30-6 52-26 60-54 4-14-8-18-14-14z' fill='%23c2568a'/%3E%3Cpath d='M70 22L28 64' stroke='%23fff' stroke-width='2' opacity='.5'/%3E%3C/svg%3E") center/contain no-repeat;
  transform: rotate(12deg);
}
.lyrics-card h3 {
  font-family: var(--font-serif); font-size: 22px; letter-spacing: 3.5px;
  color: var(--pink-deep); margin-bottom: 22px; text-align: center; font-weight: 600;
}
.lyrics-card h3 small {
  display: block; font-size: 11.5px; color: var(--ink-faint);
  letter-spacing: 1px; font-family: var(--font-sans); margin-top: 8px; font-weight: 400;
}
.lyrics p {
  font-family: var(--font-serif); font-size: 14.5px; line-height: 2.2;
  color: var(--ink-soft); text-align: center; margin-bottom: 24px;
}
.lyrics .lyrics-final {
  color: var(--pink-text); font-size: 15.5px; margin-bottom: 0;
  padding-top: 20px; border-top: 1px solid var(--line-pink); position: relative;
}
.lyrics .lyrics-final::before {
  content: "♪"; position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: #fdf8fb; padding: 0 12px; color: var(--pink); font-size: 14px;
}

.song-side { display: flex; flex-direction: column; gap: clamp(20px, 3vw, 32px); }

/* 主题曲播放卡片（网易云外链播放器） */
.music-card {
  background: linear-gradient(168deg, #ffffff, #fdf7fb 62%, #faf6fd);
  border: 1px solid var(--line-pink);
  border-radius: var(--radius);
  padding: clamp(20px, 2.6vw, 26px);
  box-shadow: var(--sh-md);
  position: relative; overflow: hidden;
}
.music-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--pink), var(--gold) 55%, var(--violet));
  opacity: .7;
}
.music-card h3 {
  font-family: var(--font-serif); font-size: 17px; letter-spacing: 2px;
  color: var(--pink-deep); margin-bottom: 14px; font-weight: 600;
}
.music-card h3 small {
  display: block; font-size: 11.5px; color: var(--ink-faint);
  font-family: var(--font-sans); margin-top: 6px;
  letter-spacing: 1px; font-weight: 400;
}
/* 曲目列表：点击切歌（换 <audio> 的 src） */
.music-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.music-item {
  display: flex; align-items: baseline; gap: 10px; width: 100%;
  background: var(--bg-lav); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 14px; cursor: pointer;
  font-family: var(--font-sans); text-align: left; color: var(--ink-soft);
  position: relative; transition: background .25s, border-color .25s, transform .25s;
}
.music-item:hover { border-color: var(--pink); background: var(--pink-pale); transform: translateX(2px); }
.music-item.active {
  background: linear-gradient(135deg, var(--pink-pale), var(--violet-pale));
  border-color: var(--pink); transform: translateX(2px);
}
.music-item.active::before {
  content: "♪"; position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  color: var(--pink); font-size: 13px;
}
.music-title {
  font-family: var(--font-serif); font-size: 14px; letter-spacing: 1px;
  font-weight: 600; color: var(--ink); white-space: nowrap;
}
.music-item.active .music-title { color: var(--pink-text); }
.music-artist { font-size: 11px; color: var(--ink-faint); }
.music-item.active .music-artist { color: var(--pink-text); opacity: .75; }

/* 随行播放器独立于各区块，避免 reveal / transform 改变 fixed 定位基准。
   默认与导航胶囊同高对齐在右上角；导航胶囊在 861~1264px 会撑得很宽，
   此时由 JS 加 .is-below-nav 把它降到导航下方，避免压住导航。 */
.global-music-dock {
  /* ⚠️ `--dock-h` 不只是 min-height，它还参与面板的 max-height 计算
     （`calc(100vh - --dock-top - --dock-h - --dock-gap - 18px)`）。
     2026-10-11 歌词**不再单独占一行**（原来那版是第三行，会让展开时高度掉 11px 而跳一下），
     改成与曲名同一行、放在曲名右侧 ⇒ 两行结构 = 标签 13.3 + 间距 2 + max(曲名 20.8, 歌词 14.7) = 36.1，
     加 toggle 的 10px padding 与 2px 边框 = 48.1，**小于**圆盘的 42 + 10 + 2 = 54 ⇒ 实际高度由圆盘决定，仍是 54px。
     展开时隐藏歌词**不会**改变这一行的高度（曲名比歌词高），所以开合不跳。 */
  --dock-top: 14px; --dock-gap: 12px; --dock-h: 54px;
  position: fixed; right: max(22px, env(safe-area-inset-right));
  top: var(--dock-top); z-index: 190;
  /* ⭐ **宽度回到原版 224px**（2026-10-11 用户：「你把宽度调成原来的样子吧」）。
     曾经为了「给歌词留位」一路加到 268px，被否两次（「太宽了缩短一点」「说了歌词不够你就加一个左右滚动」）。
     ⇒ **宽度按胶囊本身的观感定，别按歌词长度定**：歌词放不下本来就是靠横向跟随 + mask 加深解决的，
     不需要靠加宽。宽度演变：224 → 268（否）→ 248（否）→ 236（否）→ **224**。
     ⚠️ 加宽会让「完整胶囊能否与导航同行」更容易量不过 ⇒ `syncDockSlot()` 会更早收成圆钮，
     这是实测逻辑的正常反应，不要为了保住宽胶囊去改那段判定。 */
  width: 224px; max-width: calc(100vw - 28px);
}
/* 导航胶囊底缘在 72~76px，留 10px 呼吸位再落下 */
.global-music-dock.is-below-nav { --dock-top: 86px; }
.global-music-toggle {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: var(--dock-h);
  padding: 5px 14px 5px 5px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .78); color: var(--pink-deep);
  /* 通透半透明磨砂玻璃质感，与顶部导航胶囊呼应 */
  background: linear-gradient(115deg, rgba(255, 251, 253, .78), rgba(245, 240, 251, .75));
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 8px 30px rgba(100, 65, 95, .12), inset 0 1px 0 rgba(255, 255, 255, .95), 0 0 0 1px rgba(222, 183, 205, .38);
  font-family: var(--font-sans); text-align: left;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.global-music-toggle:hover, .global-music-dock.is-open .global-music-toggle {
  background: linear-gradient(115deg, rgba(255, 252, 254, .88), rgba(248, 242, 253, .86));
  border-color: rgba(224, 122, 168, .75);
  box-shadow: 0 10px 34px rgba(164, 96, 141, .20), inset 0 1px 0 #fff, 0 0 0 1px rgba(224, 122, 168, .4);
}
/* 这个圆**永远是胶片图**（收起胶囊 / 展开面板 / 窄屏圆钮 三种形态共用同一个 disc）。
   底色只留 #fff 当图没加载时的兜底，不再叠 CSS 同心圆纹 —— 那圈纹是胶片位的前身，
   留着会在图周围多出一圈假唱片边。
   ⚠️ 量尺寸时注意：`getBoundingClientRect()` 给的是**旋转后的包围盒**，
   42px 的方块转到 45° 会量出 ~59（= 42×√2），那不是溢出，别当 bug 修。 */
.global-music-disc {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  color: #955c85; border: 1px solid rgba(203, 166, 194, .7);
  background: #fff; overflow: hidden;
  box-shadow: 0 2px 10px rgba(120, 62, 106, .28);
}
/* 收起胶囊左侧那个圆 = 旋转的胶片（昔涟立绘裁成的圆）。
   ⚠️ **默认就要显示，不要只挂在 .is-compact 下**（踩过）：
   `.is-compact` 是 52px 圆钮，只在 syncDockSlot() 实测「宽胶囊放不下」时才加；
   1600px 这类宽屏永远量得下、永远不加 is-compact，
   而用户看到的恰恰是这个**收起胶囊**（宽、有字、无面板），不是圆钮。
   曾经把胶片挂在 .is-compact 下，结果收起胶囊里仍是 CSS 同心圆纹，图白裁了。
   图本身已是带透明圆角的 WebP，旋转时不会露方角。 */
.global-music-reel { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.global-music-reel img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; animation: reel-spin 14s linear infinite; animation-play-state: paused; transform-origin: 50% 50%; }
@keyframes reel-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
/* 唱片默认静止，点一下胶囊才转（JS 给 #globalMusicDock 加 .is-spinning）。
   ⚠️ 不要再用 :hover 改 animation-duration —— 改 duration 会让动画按新周期重算进度
   （9s 周期的 50% 会变成 5s 周期的 90%），角度瞬跳 144°，用户看到的就是「鼠标移上去突然转一段」。
   启停一律走 animation-play-state。 */
.global-music-dock.is-spinning .global-music-reel img { animation-play-state: running; }
@media (prefers-reduced-motion: reduce) { .global-music-reel img { animation: none; } }
.global-music-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: 2px; }
.global-music-label { font-size: 9.5px; letter-spacing: 1.4px; color: #99748f; line-height: 1.4; }
/* 第二行 = 曲名 + 右侧随行歌词，**同一行**（2026-10-11 用户改版：
   「不要把歌词放在下面…放在右下角空的地方，就是昔涟那两个字的右边」）。 */
.global-music-line { display: flex; align-items: center; gap: 7px; min-width: 0; }
.global-music-current {
  /* 曲名优先：`flex-basis: auto` ⇒ 先按内容占位，放不下时才收缩（配合 ellipsis）。
     ⚠️ 不要给曲名加 `max-width` 百分比来「给歌词保底」：本面板 5 首纯音乐的曲名都超过文案区
     （「心忆 Remembrance of the Heart」≈212px），按比例切会让两边都残缺。
     改由 JS 判「歌词位够不够宽」，不够就把歌词整行藏掉、宽度全让给曲名（见 `.is-hidden`）。 */
  flex: 0 1 auto; min-width: 0;
  font-family: var(--font-serif); font-size: 13px; font-weight: 600; letter-spacing: 1px; color: #694e70; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 胶囊随行歌词 = 曲名右边那块空白。
   224px 胶囊扣掉圆盘/间距/箭头后文案区 121px，再扣曲名与 7px 间距，歌词实得 ~86px
   （昔涟那首曲名只有 2 字，所以基本全是歌词的）。
   ⚠️ 溢出量不能靠 CSS 算，必须 JS 量（`measureDockLyric`）后写 `--shift`：
   句子长短每次都不同，写死一个位移必然要么跑不够、要么留一截看不到。
   ⚠️⚠️ `flex: 1 1 0` 的 **basis 必须是 0**，不能写 `flex: 1 1 auto`：
   `auto` 会取歌词的 max-content（最长 167px）当基准，一上来就把曲名挤到收缩
   ⇒ 「昔涟」被截成「昔…」。basis 0 则先让曲名按内容占位，歌词只吃**剩下的**。 */
.global-music-lyric {
  flex: 1 1 0; min-width: 0;
  overflow: hidden; white-space: nowrap;
  font-size: 10.5px; line-height: 1.4; letter-spacing: .4px;
}
/* 歌词位太窄（< 44px ≈ 4 个字）就整行藏掉，把宽度全让给曲名。
   ⚠️ 实测当前 6 首曲子**都走不到这个分支**（是安全网，不是常规路径）：
   胶囊曲名取 `.music-title` 空格前那段（`title.split(' ')[0]`），
   最长是「再度和你 / 一页永恒 / 秘榭曲谣」= 4 字 ≈ 56px，歌词位仍有 58px。
   留着它是为了以后换更长的曲名时别把歌词挤成一条碎影。
   ⚠️ 是否加这个类由 JS 量（`measureDockLyric`）决定，别写成媒体查询。 */
.global-music-lyric.is-hidden { display: none; }
/* ⭐ 与面板同一套「逐渐加深」：**同一段文字叠两层**（下层灰紫、上层樱粉 mask 揭开）。
   `width: max-content` 是关键：让盒子宽度 == 文字宽度，mask 的百分比才正好映射到文字上。
   `--shift` 由 JS 按播放进度写（= 溢出量 × p），所以文字是**跟着唱到哪个字**横向走的，
   不再是「自己无限来回跑」的 CSS 动画。
   ⚠️ 纯音乐（整首没词）没有进度可跟 ⇒ 不横移（`--shift` 恒为 0），
   占位「纯音乐」三个字靠 `.is-plain` **居中**显示（见下方）。 */
.global-music-lyric-text {
  position: relative; display: block;
  width: max-content;
  transform: translateX(var(--shift, 0px));
}
.global-music-lyric-base { color: #a996ad; }        /* 未唱到：灰紫 */
.global-music-lyric-on {
  position: absolute; left: 0; right: 0; top: 0;
  color: #a8557a; pointer-events: none;             /* 已唱到：樱粉 */
  /* --p: 0 → -6%（整层被遮住）；1 → 100%（整行揭开）。两侧各 6% 是羽化宽度。
     ⚠️ 偏 6% 的原因同面板：写 0% 会让 x=0 处正好半透明，行首漏出一小截粉字。 */
  -webkit-mask-image: linear-gradient(90deg, #000 var(--p, -6%), transparent calc(var(--p, -6%) + 6%));
          mask-image: linear-gradient(90deg, #000 var(--p, -6%), transparent calc(var(--p, -6%) + 6%));
}
/* ⭐ 纯音乐（整首没词）：占位就是「纯音乐」三个字，在歌词位里**居中**。
   （用户原话：「纯音乐就直接在显示歌词那里居中写个纯音乐吧，然后滚动不要了」）
   - 3 个字 ≈ 32.7px，而歌词位有 58~86px ⇒ **任何曲名下都放得下，不需要任何滚动**。
   - 为什么只在 `.is-plain` 下居中：有词时要保持左对齐 —— 横移与 mask 界线都按**左缘**算，
     居中会让「界线正好落在正在唱的字上」那个恒等式失效（虽然溢出时 auto 边距本来就归 0，
     但别依赖这个巧合）。纯音乐没有进度，居中不会破坏任何东西。
   - ⚠️ 曾给纯音乐做过跑马灯（往返 → 单向瞬跳），两次都被否 ⇒ **别再给它加动画**。 */
.global-music-lyric.is-plain .global-music-lyric-text { margin: 0 auto; }
/* 展开面板时这一行不显示歌词 —— 面板里已经有完整的单行歌词了，重复没必要。
   ⭐ 与「第三行」那版不同：现在歌词与曲名同行，隐藏它**不会**改变行高
   （这一行的高度由更高的曲名决定），所以展开/收起不会跳，`--dock-h` 也不用为它加码。 */
.global-music-dock.is-open .global-music-lyric { display: none; }
/* ⚠️ 这里**不需要** prefers-reduced-motion 守卫：横移由播放进度（`--shift = 溢出量 × p`）
   直接驱动 —— 性质同进度条，暂停即静止、拖进度条即跟随；纯音乐的占位是静止居中。
   **这一行现在没有任何自主动画**（旧的跑马灯已彻底删除）。 */
/* ⭐ 箭头旋转与面板位移**同步**（同曲线同节奏）—— 两边各转各的会让「展开」散架。
   同样分展开/收起两条：收起跟面板一起加速离开，展开跟面板一起缓停。 */
.global-music-toggle-icon { flex: none; transition: transform .24s cubic-bezier(.5, 0, .8, .4); }
.global-music-dock.is-open .global-music-toggle-icon { transform: rotate(180deg); transition: transform .44s cubic-bezier(.38, .68, .3, 1); }
.global-music-panel {
  /* 挂在按钮下方展开：面板顶 = 视口顶 + 停靠位 + 按钮高 + 间隙，据此算可用高度。 */
  position: absolute; right: 0; top: calc(100% + var(--dock-gap));
  width: 392px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - var(--dock-top) - var(--dock-h) - var(--dock-gap) - 18px);
  max-height: calc(100dvh - var(--dock-top) - var(--dock-h) - var(--dock-gap) - 18px);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  padding: 20px; border-radius: 22px;
  /* 优雅磨砂玻璃材质，透出下方天光与浅滩 */
  background: linear-gradient(155deg, rgba(255, 253, 254, .82), rgba(253, 246, 251, .76) 55%, rgba(246, 240, 252, .80));
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, .78);
  box-shadow: 0 20px 60px rgba(83, 49, 78, .18), 0 0 0 1px rgba(232, 212, 226, .5), inset 0 1.5px 0 rgba(255, 255, 255, .95);
  /* 收起时只降不透明度、不加 display:none / visibility:hidden ——
     保留 <audio> 的播放进度与元素状态。 */
  /* ⭐ 展开动画的锚点 = 胶囊右侧那个箭头（箭头中心距面板右缘 = 14px 右内边距 + 9px 半宽 = 23px）。
     392px 的大面板若只做 10px 平移，眼睛读到的就是「直接闪出来」；
     从按钮那一角放大 + 上浮一小段，才有「从胶囊里长出来」的连贯感。 */
  /* ⭐ 锚点从「箭头中心」(100%-23px) 改回**右上角** `100% 0`
     —— container transform 要求**缩放时右边缘与顶边不动**：
     右缘不动才能和胶囊右缘对齐（两者都贴 right:22px），
     顶边不动才能紧贴胶囊下缘（实测面板顶 66px、胶囊底 68px，本就差 2px）。 */
  transform-origin: 100% 0;
  opacity: 0; pointer-events: none;
  /* ⭐⭐ 起始形状 = 胶囊的形状（Material 的 container transform）：
     非均匀缩放，让面板收起时正好是 224×54 —— 即胶囊的尺寸。
     · scaleX = 224 / 392 = **.571**
     · scaleY =  54 / 506 = **.107**
     ⚠️ 392×506 是**面板的真实布局尺寸**，别用 getBoundingClientRect 量：
        收起态带 scale，rect 给的是变换后尺寸（实测会量成 368×476，正好是 0.94 倍）。
        用 `offsetWidth/offsetHeight` 才对得上。
     ⚠️ translateY(-10px) 让起始色块与胶囊底部有约 12px 重叠，
        读起来才像「从胶囊里挤出来」，而不是「在下方另起一块」。 */
  transform: translateY(-10px) scale(.571, .107);
  /* 收起方向：缩回胶囊。比展开短，但留够 .24s —— 太快就看不到「缩回去」这一步。 */
  transition: opacity .18s cubic-bezier(.4, 0, .7, .45),
              transform .24s cubic-bezier(.5, 0, .8, .4);
}
/* ⭐ 展开方向：**缓起缓停、收尾极平**的曲线 `cubic-bezier(.2, .9, .32, 1)`。
   实测行程分布：50% 走 84% / 75% 走 97% / 90% 走 99.6%
   —— 中段仍有可见位移，最后四分之一几乎停住，这才是「丝滑」而不是「急停」。
   ⚠️ 别用 `cubic-bezier(.16,1,.3,1)` 那类「easeOutExpo」：实测它在**半程就走完 97%**
   （暂停在 160ms 时 transform 已是 scale .999），后半程几乎不动 —— 看起来仍是「快闪一下」，
   正是「生硬」的来源。
   ⚠️ **别指望 overshoot（回弹）能看出来**：行程只有 scale .06 / 位移 14px，
   就算曲线过冲 1.3%，实际也只有 0.2px，肉眼为零。小位移面板的「弹性」要靠
   **收尾平顺 + 内容错峰**，不是靠回弹。
   ⚠️ opacity 与 transform **分开配**，且**故意让两者错开**：
   · transform 曲线 y1=.9 —— 起步猛，面板先「从胶囊里窜出来」
   · opacity 曲线 y1=0 —— 起步慢，随后才追上，在 .26s（全程 65%）走完
   ⇒ 观感是「先长大、再逐渐变实」，即「浮现」；
     若两者节奏对齐，就会变成一整块硬邦邦拍上去。
   ⚠️ 别被「opacity 时长更短就该更早完成」误导：曲线形状决定早期谁领先，
     时长只决定谁先收尾。实测（无头，仅看相对先后）202ms 时
     scale 已走 75% 而 opacity 只走 33%，正是上面这个编排。
   ⚠️ 展开与收起的 `transition` 必须**分开写**：生效的是「当前状态」那条规则，
   所以展开曲线要写在 `.is-open` 里，收起时才轮到上面那条加速曲线。 */
.global-music-dock.is-open .global-music-panel {
  opacity: 1; pointer-events: auto; transform: none;
  /* ⭐ 曲线从 `(.2,.9,.32,1)` 换成 `(.38,.68,.3,1)`：
     原来 y1=.9 起步太猛，scale 从 .107 一窜就过去了，根本看不清「胶囊→面板」这段变形。
     现在分布 20%→37% / 50%→76% / 80%→96%，前段慢到看得清长大，收尾仍然平。
     ⚠️ 别改用带 overshoot 的曲线：行程现在大到 scaleY .893，
     过冲 1.3% 就是 6px 的「弹一下」，对下拉面板过头了。
     ⚠️ opacity 起步慢（y1=0）是关键 —— 60ms 时它才 0.06，
     把「压扁阶段」挡在几乎全透明的时候，用户看不到怪形状。 */
  transition: opacity .3s cubic-bezier(.4, 0, .55, 1),
              transform .44s cubic-bezier(.38, .68, .3, 1);
}
.global-music-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.global-music-panel-head strong { display: block; font-family: var(--font-serif); color: var(--pink-deep); font-size: 18px; font-weight: 600; letter-spacing: 3px; line-height: 1.6; }
.global-music-close, .music-nav {
  display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px;
  padding: 0; border-radius: 50%; border: 1px solid rgba(222, 183, 205, .55);
  color: var(--pink-deep); background: rgba(255, 255, 255, .62);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(100, 65, 95, .06), inset 0 1px 0 rgba(255, 255, 255, .9);
  transition: background .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.global-music-close:hover, .music-nav:hover {
  background: rgba(253, 238, 244, .88);
  border-color: var(--pink);
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(224, 122, 168, .22), inset 0 1px 0 #fff;
}
.global-music-embed { width: 100%; max-width: 332px; margin: 0 auto; }
/* 自建播放器：原来是网易云外链 iframe，跨域读不到播放/暂停状态 ⇒ 换成 <audio> 直连官方外链地址。
   这样 play/pause 完全可控，唱片才能「跟着播放转」。 */
.music-player {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(253, 238, 244, .62), rgba(241, 237, 251, .62));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .82);
  box-shadow: 0 4px 18px rgba(150, 95, 135, .07), 0 0 0 1px rgba(234, 223, 233, .6), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.music-play { position: relative; flex: none; display: grid; place-items: center; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 12px; cursor: pointer; overflow: hidden; background: url("../images/music-cover.jpg") center/cover no-repeat; box-shadow: 0 3px 12px rgba(120, 60, 105, .3); transition: transform .18s, box-shadow .18s; }
/* 半透明遮罩：保证白色图标在任何封面图上都看得清 */
.music-play::before { content: ""; position: absolute; inset: 0; background: rgba(58, 22, 52, .3); transition: background .18s; }
.music-play:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(120, 60, 105, .36); }
.music-play:hover::before { background: rgba(58, 22, 52, .18); }
.music-play:focus-visible { outline: 2px solid var(--pink-deep); outline-offset: 3px; }
.music-ico { position: relative; z-index: 1; display: block; width: 22px; height: 22px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .55)); }
.music-ico-pause, .music-play.is-playing .music-ico-play { display: none; }
.music-play.is-playing .music-ico-pause { display: block; }
.music-meter { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
/* 当前曲目行 = 「歌曲名 - 歌手」，在**进度条上方**。
   （2026-10-11 用户要求：「把这个进度条整体下移，然后空出来的空间放上歌曲名歌手」，
   参照网易云播放器的排布。）
   ⚠️⚠️ 曲名必须用**中文那半截**（`title.split(' ')[0]`，与胶囊同一套）：
   这行可用只有约 **234px**（332 − 28 内边距 − 2 边框 − 56 封面 − 12 间距），
   而带英文副题的完整曲名最长「心忆 Remembrance of the Heart」= **184px**，
   加歌手 102px + 分隔 13px = **299px** ⇒ 6 首里 4 首要被截 29~65px（近 5 个字）。
   砍成中文后最长 167px，**一首都不用截**。完整曲名仍在面板下方的曲目列表里，
   悬停这行也有 `title` 提示。
   ⚠️ 曲名保留可收缩（`flex: 0 1 auto` + ellipsis）作安全网，歌手**永不收缩**（`flex: none`）。
   ⚠️ 分隔符写成 `.music-now-artist::before` 而不是放进 DOM：它挂在**不收缩**的元素上，
   曲名万一被截也不会把「-」一起吃掉（挂在曲名上就会）。 */
.music-now {
  /* ⚠️ 不能用 `align-items: baseline`：`.music-now-title` 带 `overflow: hidden`，
     按规范它的基线会退化成**下外边距边**，曲名会明显比歌手低一截。
     两者都是单行 nowrap、字号行高相同 ⇒ `center` 就等于基线对齐。 */
  margin: 0; display: flex; align-items: center; min-width: 0;
  font-size: 12.5px; line-height: 1.35; letter-spacing: .3px;
}
.music-now-title {
  flex: 0 1 auto; min-width: 0;
  font-family: var(--font-serif); font-weight: 600; color: #694e70;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.music-now-artist { flex: none; color: #99748f; white-space: nowrap; }
.music-now-artist::before { content: "-"; margin: 0 6px 0 3px; color: #c2aac9; }
.music-bar { position: relative; height: 5px; border-radius: 3px; cursor: pointer; background: rgba(180, 130, 165, .28); }
.music-bar:focus-visible { outline: 2px solid var(--pink-deep); outline-offset: 3px; }
.music-bar-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: 3px; background: linear-gradient(90deg, #e585b0, #a8557a); }
/* 时间行 = `起播时间 · 歌词 · 总时长`，**三段同一行**。
   2026-10-11 用户要求：「我让你把进度条整体下移没让你把高度增高，两端时间中间那么大的空放歌词不行吗」
   ⇒ 歌词不再单独占一行（那会把 .music-meter 撑成 4 行、播放器从 84px 涨到 101.4px），
   而是插进两端时间中间的空档里 —— 正好把「那么大」的空白填掉，行数仍是 3 行。
   ⚠️ 用 `center` 而不是 `space-between`：歌词要真的落在中间那段，两端时间才贴边。
   ⚠️ `line-height: 1.4` 必须显式写：默认行高会让时间标签比歌词矮一截，两者基线错开 ~1px。 */
.music-times { display: flex; align-items: center; gap: 6px; font-size: 10.5px; line-height: 1.4; letter-spacing: .6px; color: #99748f; font-variant-numeric: tabular-nums; }
.music-times > span { flex: none; }   /* 两端时间永不收缩，收缩全留给歌词 */
/* 歌词：夹在两端时间中间，跟着播放换句。
   外层定高 + overflow: hidden，内层每次换句播一遍「由下往上翻」的动画；
   两层是必须的 —— 元素自己的 transform 不会被自己的 overflow 裁掉，
   只做一层的话字会翻到框外去。
   ⚠️ 字号 10.5px 是量出来的：本曲 24 句最长一句「陌生的情节 熟悉的侧脸 都重叠 oh~」约
      198px @12.5px ⇒ 换算 167px @10.5px，而这段空档只有 **171px**
      （meter 234 − 两端时间各 25.5 − 两个 6px 间距）⇒ 12.5px 有 3 句被截、11px 仍有 2 句被截，
      10.5px 刚好 24 句全放得下（余量 3.8px）。同时与同行的两个时间标签**同号**，读起来是一整行元信息。 */
.music-lyric {
  flex: 1 1 0; min-width: 0;   /* basis 必须是 0，写 auto 会按 max-content 撑开、把两端时间挤走 */
  margin: 0; height: 1.4em; overflow: hidden;
  font-size: 10.5px; line-height: 1.4em; letter-spacing: .4px;
}
/* 单行歌词 = **同一段文字叠两层**（下层灰紫、上层樱粉），上层用 mask 从左往右揭开。
   比「逐字变色」平滑得多，而且两层文字布局完全一致，扫过的位置天然对齐。
   ⚠️ `width: max-content` 是关键：让容器宽度 == 文字宽度，mask 的百分比才正好映射到文字上。
   若用「满宽容器 + text-align:center」，文字居中、比容器窄，前 ~10% 的进度会落在文字左边的空白里。 */
.music-lyric-text {
  position: relative; display: block;
  width: max-content; max-width: 100%; margin: 0 auto;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.music-lyric-base { color: #a996ad; }
.music-lyric-on {
  position: absolute; left: 0; right: 0; top: 0;
  overflow: hidden; text-overflow: ellipsis;   /* 要跟下层用同一套截断规则，否则长句两层会错位 */
  color: #a8557a; pointer-events: none;
  /* --p: 0 → -6%（整层被遮住）；1 → 100%（整行揭开）。两侧各 6% 是羽化宽度。 */
  -webkit-mask-image: linear-gradient(90deg, #000 var(--p, -6%), transparent calc(var(--p, -6%) + 6%));
          mask-image: linear-gradient(90deg, #000 var(--p, -6%), transparent calc(var(--p, -6%) + 6%));
}
.music-lyric.is-idle .music-lyric-text { letter-spacing: .6px; }   /* 纯音乐 / 前奏：淡一档 */
@keyframes music-lyric-roll {
  from { opacity: 0; transform: translateY(80%); }
  to   { opacity: 1; transform: none; }
}
.music-lyric-text.is-rolling { animation: music-lyric-roll .4s cubic-bezier(.22, .7, .3, 1); }
.global-music-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 12px 0; }
.global-music-controls > div { display: flex; gap: 7px; }
.global-music-count { color: #927990; font-size: 11px; letter-spacing: 1.5px; font-variant-numeric: tabular-nums; }
.global-music-list { display: flex; flex-direction: column; gap: 6px; padding-right: 2px; }
.global-music-list .music-item {
  flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 26px 9px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .50);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .68);
  box-shadow: 0 2px 8px rgba(100, 65, 95, .03), inset 0 1px 0 rgba(255, 255, 255, .8);
}
.global-music-list .music-item:hover {
  background: rgba(255, 255, 255, .78);
  border-color: rgba(224, 122, 168, .55);
  box-shadow: 0 4px 14px rgba(160, 90, 135, .10), inset 0 1px 0 #fff;
  transform: translateX(3px);
}
.global-music-list .music-item.active {
  background: linear-gradient(115deg, rgba(250, 234, 242, .88), rgba(240, 233, 248, .88));
  border-color: rgba(224, 122, 168, .75);
  box-shadow: 0 4px 16px rgba(224, 122, 168, .18), inset 0 1px 0 rgba(255, 255, 255, .9);
  transform: translateX(3px);
}
.global-music-list .music-title { white-space: normal; font-size: 12px; letter-spacing: .3px; line-height: 1.6; }
.global-music-list .music-artist { display: none; }
/* ⭐ 面板**内部四块内容错峰落位**（标题 → 播放器 → 控制条 → 曲目列表）。
   面板外壳先「长出来」，内容再依次跟上，一次展开就有了编排感；
   整块一起亮会显得像一张图被硬贴上去。
   ⚠️ 同样用 `translate` 独立属性：`.music-play:hover` 用的是 `transform`，
   这两块是祖先元素，虽然不冲突，但保持与曲目列表同一套写法更不容易踩坑。
   ⚠️ 收起时不给延迟（延迟只写在 `.is-open` 下）—— 收起是一起快速退场，
   逐个退会拖泥带水。 */
.global-music-panel-head,
.global-music-embed,
.global-music-controls {
  opacity: 0; translate: 0 -8px;
  transition: opacity .14s ease, translate .18s cubic-bezier(.42, 0, .85, .4);
}
.global-music-dock.is-open .global-music-panel-head,
.global-music-dock.is-open .global-music-embed,
.global-music-dock.is-open .global-music-controls {
  opacity: 1; translate: 0 0;
  transition: opacity .22s ease, translate .32s cubic-bezier(.2, .9, .32, 1);
}
/* ⭐ 延迟整体往后推（原 .04/.08/.12s）：面板现在是从 scaleY .107 长大的，
   内容出现太早会露出一堆被压扁的文字。按曲线算各起飞点的面板高度占比 ——
   · .10s → 46%   · .15s → 60%   · .20s → 73%
   内容从「已经长到六七成」时才开始浮现，变形就落在还能接受的范围内。 */
.global-music-dock.is-open .global-music-panel-head { transition-delay: .10s; }
.global-music-dock.is-open .global-music-embed      { transition-delay: .15s; }
.global-music-dock.is-open .global-music-controls   { transition-delay: .20s; }
/* ⭐ 展开时曲目**逐条**淡入上浮 —— 让「展开」有先后顺序，而不是整块一起亮。
   ⚠️ 位移必须用 `translate` **独立属性**，不能用 `transform`：
   `.music-item` 的 `transform` 已经被 `:hover` / `.active` 的 `translateX(2px)` 占着，
   再用 animation/transition 去写 `transform` 会在动画交还的瞬间弹一下。
   `translate` 与 `transform` 是两套独立属性，叠加生效、互不干扰。
   ⚠️ 延迟值放进 `--stagger` 自定义属性，`transition-delay` 只写一条 ——
   这样 reduced-motion 里覆盖一条同权重规则就能全灭，不用跟 `:nth-child` 的权重打架。 */
.global-music-list .music-item {
  opacity: 0; translate: 0 -7px;
  /* 曲线与面板那条**保持一致** —— 一次展开是一个整体动作，两套曲线会显得散。 */
  transition: opacity .18s ease, translate .22s cubic-bezier(.38, .68, .3, 1),
              background .25s, border-color .25s, transform .25s, box-shadow .25s;
}
.global-music-dock.is-open .global-music-list .music-item {
  opacity: 1; translate: 0 0;
  transition-delay: var(--stagger, 0s);   /* 收起时无延迟：一起快速退场 */
}
/* ⭐ 起点 .20s 接在控制条（.20s）之后，步长 .018s。
   最后一首 .29s 起飞、.51s 收完 —— 比面板（.44s）晚 70ms，是余韵不是拖沓。 */
.global-music-dock.is-open .global-music-list .music-item:nth-child(1) { --stagger: .20s; }
.global-music-dock.is-open .global-music-list .music-item:nth-child(2) { --stagger: .218s; }
.global-music-dock.is-open .global-music-list .music-item:nth-child(3) { --stagger: .236s; }
.global-music-dock.is-open .global-music-list .music-item:nth-child(4) { --stagger: .254s; }
.global-music-dock.is-open .global-music-list .music-item:nth-child(5) { --stagger: .272s; }
.global-music-dock.is-open .global-music-list .music-item:nth-child(6) { --stagger: .29s; }
.global-music-dock.is-open .global-music-list .music-item:nth-child(n+7) { --stagger: .308s; }
/* 前庭敏感用户。⚠️ 样式表末尾已有一条全局兜底 `transition-duration: .01ms !important`，
   时长本来就被压平了 —— 这里只补**它管不到的两件事**：
   ① 去掉面板的缩放/位移（否则收起态会停在 scale(.965) 上）；
   ② 清掉逐条延迟 —— `transition-delay` 不受 `transition-duration` 影响，
      不清的话 reduced-motion 下曲目仍会「一个一个」冒出来。
   ⚠️ 必须放在上面那些规则**之后** —— `.is-open … .music-item` 与基础规则同权重 (0,4,0)，靠源码顺序取胜。 */
@media (prefers-reduced-motion: reduce) {
  .global-music-panel,
  .global-music-dock.is-open .global-music-panel { transform: none; }
  .global-music-panel-head, .global-music-embed, .global-music-controls { translate: none; }
  /* ⚠️ 内容层与曲目列表的选择器权重都是 (0,3,0)/(0,4,0)，
     必须把 `.is-open` 版本也写进来才能盖掉延迟 —— 只写基础选择器会被权重压过去。 */
  .global-music-dock.is-open .global-music-panel-head,
  .global-music-dock.is-open .global-music-embed,
  .global-music-dock.is-open .global-music-controls { translate: none; transition-delay: 0s; }
  .global-music-list .music-item { translate: none; }
  .global-music-dock.is-open .global-music-list .music-item { translate: none; transition-delay: 0s; }
}
.music-open {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 11px 16px; color: var(--pink-deep); border: 1px solid rgba(222, 183, 205, .7);
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(253, 238, 244, .72), rgba(241, 237, 251, .72));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(120, 88, 110, .06), inset 0 1px 0 rgba(255, 255, 255, .8);
  font-family: var(--font-sans); font-size: 13px; cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .2s;
}
.music-open:hover {
  border-color: var(--pink);
  background: linear-gradient(120deg, rgba(253, 238, 244, .92), rgba(241, 237, 251, .92));
  box-shadow: 0 4px 16px rgba(224, 122, 168, .18), inset 0 1px 0 #fff;
  transform: translateY(-1px);
}
/* 收成一个圆钮：只留音符（曲名与歌单都还在展开的面板里）。
   宽胶囊在窄屏会压住居中的区块小标（「STORY · 昔涟剧情回顾」右半截），
   所以放不下时就该收窄。

   ⚠️ **不要用媒体查询决定这件事**，必须由 JS 实测（见 syncDockSlot）。踩过两次：
   ① 断点写 600px 时，601~767 是「窄导航 + 224px 宽胶囊」，右侧空着两百多像素
      却量出放不下，胶囊被降到导航下方、凭空浮在封面插画上；
   ② 把断点一口气提到 860px 后，856px 这种**明明放得下完整胶囊**的宽度也被强行收成圆钮，
      导航与圆钮之间空出一大段（用户：「顶部空缺太大了完全可以把音乐胶囊展开」）。
   ⇒ 真正要回答的问题是「这一刻放不放得下」，那就现场量，别用视口宽度猜。 */
.global-music-dock.is-compact { --dock-h: 52px; width: 52px; }
.global-music-dock.is-compact .global-music-toggle { padding: 0; gap: 0; justify-content: center; }
.global-music-dock.is-compact .global-music-copy,
.global-music-dock.is-compact .global-music-toggle-icon { display: none; }
/* 圆钮只放大尺寸，边框/底色/阴影都继承基类（基类已经是胶片态了）。 */
.global-music-dock.is-compact .global-music-disc { width: 46px; height: 46px; border: 0; }
/* 圆钮态全部交给 .is-compact，不再留媒体查询副本 ——
   `js/main.js` 是 body 末尾的同步脚本，样式表已就绪，syncDockSlot() 在首帧绘制前就跑完了，
   不会闪一下完整胶囊。同一套规则写两处只会日后改一处忘一处。 */
@media (max-width: 600px) {
  /* 手机上右留白收到 12px —— 22px 会白白吃掉 10px 可用宽度，
     让 390px 这种常见机型从「圆钮并排」掉成「圆钮降到导航下方」。
     syncDockSlot() 读的是 computed right，会自动跟着变，不需要额外同步。 */
  .global-music-dock { right: max(12px, env(safe-area-inset-right)); }
  .global-music-panel { width: 366px; max-width: calc(100vw - 24px); padding: 15px; border-radius: 17px; }
  .global-music-list .music-title { font-size: 12px; }
  .music-card .music-item { flex-wrap: wrap; gap: 2px 10px; padding-right: 28px; }
  .music-card .music-title { white-space: normal; }
}

.film-card {
  background: linear-gradient(168deg, #ffffff, #fdfaf3 60%, #fdf7ea);
  border: 1px solid var(--line-warm); border-radius: var(--radius);
  padding: clamp(24px, 3vw, 34px); box-shadow: var(--sh-md);
}
.film-card h3 {
  font-family: var(--font-serif); font-size: 19px; letter-spacing: 2.5px;
  color: var(--gold-text); margin-bottom: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.film-card h3::before { content: "▶"; font-size: 10px; color: var(--gold); }
.film-card p { font-size: 13.8px; color: var(--ink-soft); text-align: justify; }
.film-card blockquote {
  margin: 15px 0; padding: 15px 20px; border-left: 3px solid var(--gold);
  background: var(--gold-pale); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-serif); font-size: 13.8px; color: #7a5c1e;
}
.film-end { margin-top: 13px; font-size: 12.8px; color: var(--ink-faint); }
.film-end b { color: var(--pink-text); font-weight: 500; letter-spacing: 1px; }

/* 信 */
.letter-wrap { position: relative; }
.letter-seal {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 15px;
  background: linear-gradient(135deg, #fff6fa, #fdf2f7 55%, #f6f1fd);
  border: 1.5px dashed rgba(224, 122, 168, .5); border-radius: var(--radius);
  color: var(--pink-text); font-size: 14.5px; letter-spacing: 2px;
  padding: 22px; cursor: pointer; font-family: var(--font-serif);
  transition: .32s; box-shadow: var(--sh-sm);
}
.letter-seal:hover {
  border-color: var(--pink); background: linear-gradient(135deg, #fff0f6, #f4eefc);
  box-shadow: var(--sh-pink); transform: translateY(-2px);
}
.letter-seal svg { animation: emblemFloat 4.5s ease-in-out infinite; }
.letter-wrap.open .letter-seal { display: none; }

.letter-body {
  display: none;
  background: linear-gradient(rgba(253, 248, 236, .99), rgba(249, 241, 224, .99));
  color: #4c3c3c; border-radius: var(--radius);
  padding: clamp(28px, 4vw, 48px);
  box-shadow: var(--sh-lg), inset 0 0 70px rgba(200, 160, 120, .13);
  border: 1px solid rgba(200, 160, 120, .35);
  font-family: var(--font-serif); animation: letterIn .7s cubic-bezier(.22,.8,.36,1);
  position: relative;
}
.letter-wrap.open .letter-body { display: block; }
@keyframes letterIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }
/* 信纸四角压花 */
.letter-body::before, .letter-body::after {
  content: "❦"; position: absolute; color: #c09a6a; opacity: .32; font-size: 17px;
}
.letter-body::before { top: 14px; left: 18px; }
.letter-body::after { bottom: 14px; right: 18px; }

.letter-body h4 {
  text-align: center; font-size: 20px; letter-spacing: 5px;
  color: #96606e; margin-bottom: 22px; font-weight: 600;
}
.letter-body p { font-size: 14.5px; line-height: 2.15; margin-bottom: 15px; text-align: justify; }

/* ── 羽毛笔逐字书写 ── */
.letter-body .ink { opacity: 0; transition: opacity .14s ease; }
.letter-body .ink.written { opacity: 1; }
.letter-quill {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  pointer-events: none; z-index: 3; will-change: transform;
}
.letter-quill::before {          /* 笔尖微光 */
  content: ""; position: absolute; left: -3.5px; top: -3.5px;
  width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, rgba(224, 122, 168, .8) 52%, rgba(224, 122, 168, 0) 100%);
  box-shadow: 0 0 13px 3px rgba(224, 122, 168, .55);
  animation: quillTip .68s ease-in-out infinite alternate;
}
.letter-quill::after {           /* 粉色羽毛：上宽下尖，收成笔尖 */
  content: ""; position: absolute; left: 0; top: -37px;
  width: 14px; height: 37px;
  background: linear-gradient(158deg, #fbd8e8 0%, #e07aa8 58%, #b04e7e 100%);
  border-radius: 58% 58% 9% 9% / 74% 74% 4% 4%;
  transform: rotate(20deg); transform-origin: bottom left;
  box-shadow: 0 3px 9px rgba(194, 86, 138, .32), inset 1px 0 0 rgba(255, 255, 255, .5);
  animation: quillFeather 2.6s ease-in-out infinite alternate;
}
@keyframes quillTip { from { transform: scale(.78); opacity: .7; } to { transform: scale(1.25); opacity: 1; } }
@keyframes quillFeather { from { transform: rotate(19deg); } to { transform: rotate(28deg); } }
.letter-quill.done { opacity: 0; transition: opacity .7s ease .15s; }
@media (prefers-reduced-motion: reduce) {
  .letter-body .ink { opacity: 1; transition: none; }
  .letter-quill { display: none; }
}
.letter-logic {
  color: var(--midnight) !important; font-size: 13.2px !important;
  letter-spacing: 1.2px; text-align: center !important; padding: 12px;
  border-top: 1px solid rgba(60, 74, 140, .28);
  border-bottom: 1px solid rgba(60, 74, 140, .28);
  background: rgba(60, 74, 140, .045);
}
.letter-close {
  display: block; margin: 20px auto 0; background: #fff;
  border: 1px solid rgba(150, 96, 110, .4); color: #96606e;
  border-radius: 999px; padding: 7px 24px; font-size: 12.5px;
  cursor: pointer; letter-spacing: 2px; font-family: var(--font-serif);
  transition: .26s; box-shadow: var(--sh-xs);
}
.letter-close:hover { background: rgba(150, 96, 110, .08); transform: translateY(-1px); box-shadow: var(--sh-sm); }

/* ═══════════════ 档案馆 ═══════════════ */
.archive-section {
  background:
    radial-gradient(ellipse 60% 42% at 88% 4%, rgba(232, 224, 252, .55), transparent 60%),
    linear-gradient(180deg, var(--bg-base), var(--bg-lav) 55%, var(--bg-rose) 100%);
}

.arch-tabs { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 38px; }
.arch-tab {
  background: var(--bg-card); border: 1px solid var(--line);
  color: var(--ink-soft); border-radius: 11px; cursor: pointer;
  padding: 9px 22px; font-size: 13.5px; letter-spacing: 2px;
  font-family: var(--font-sans); transition: .26s; box-shadow: var(--sh-xs);
}
.arch-tab:hover { border-color: var(--gold); color: var(--gold-text); transform: translateY(-2px); box-shadow: var(--sh-sm); }
.arch-tab.active {
  background: linear-gradient(135deg, var(--gold-pale), var(--pink-pale));
  border-color: var(--gold); color: var(--gold-text);
  box-shadow: 0 6px 20px rgba(217, 169, 74, .24); font-weight: 500;
}

.arch-panel { display: none; max-width: 1180px; margin: 0 auto; }
.arch-panel.active { display: block; animation: panelIn .5s cubic-bezier(.22,.8,.36,1); }
/* 人物星图页签：不受 .arch-panel 的 1180px 限制，让星图自己的 1400/1800px 容器生效 */
.arch-panel-wide { max-width: none; }

.arch-h {
  font-family: var(--font-serif); font-size: 17px; letter-spacing: 3.5px;
  color: var(--gold-text); margin: 36px 0 17px; font-weight: 600;
  display: flex; align-items: center; gap: 13px;
}
.arch-h::before { content: "❖"; color: var(--pink); font-size: 12px; opacity: .8; }
.arch-h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-warm), transparent); }

/* 档案 · 角色 */
.profile-grid { display: grid; grid-template-columns: 304px 1fr; gap: clamp(20px, 3vw, 36px); align-items: start; }
/* 主立绘是整幅构图（上方拱门、下方脚下涟漪都要），窄屏 cover 时**居中裁**；
   全局默认的 top center 会把脚切在框底边上 */
.profile-grid .img-slot img { object-position: center; }
/* 两张宽幅图本身就是 4:5。窄屏下单列会把槽拉宽到 351×384（0.91），cover 又裁掉一截，
   干脆让槽保持 4:5，图片原样铺满、一点不裁 */
@media (max-width: 860px) {
  .profile-grid .img-slot-wide,
  .eternal-intro .img-slot-wide { min-height: 0; aspect-ratio: 4 / 5; }
}
@media (max-width: 860px) { .profile-grid { grid-template-columns: 1fr; } }
.img-slot-wide { min-height: 384px; }

.info-table {
  width: 100%; border-collapse: collapse; font-size: 13.8px;
  background: var(--bg-card); border-radius: var(--radius-sm);
  overflow: hidden; box-shadow: var(--sh-sm); border: 1px solid var(--line);
}
.info-table th, .info-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.info-table th {
  color: var(--pink-text); font-weight: 600; white-space: nowrap; width: 116px;
  letter-spacing: 1px; background: var(--pink-pale);
}
.info-table td { color: var(--ink-soft); }
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: none; }
.info-table tr { transition: background .25s; }
.info-table tr:hover td { background: #fdfafd; }

.eval-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(252px, 1fr)); gap: 16px; }
.eval-grid blockquote {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 19px 21px;
  box-shadow: var(--sh-xs); transition: .32s cubic-bezier(.22,.8,.36,1);
  position: relative; overflow: hidden;
  /* 网格已把卡片拉成等高，出处靠 margin-top:auto 落到卡底，
     否则引文长短不一时署名会悬在中间、四张卡参差不齐 */
  display: flex; flex-direction: column;
}
.eval-grid blockquote::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--pink), var(--violet));
  opacity: 0; transition: opacity .32s;
}
.eval-grid blockquote:hover { transform: translateY(-4px); box-shadow: var(--sh-md); border-color: var(--line-pink); }
.eval-grid blockquote:hover::before { opacity: .85; }
.eval-grid p { font-family: var(--font-serif); font-size: 13.4px; color: var(--ink-soft); }
.eval-grid cite { display: block; margin-top: auto; padding-top: 11px; font-size: 12.2px; color: var(--gold-text); font-style: normal; text-align: right; }

/* 档案 · 技能 */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 16px; }
.skill-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 20px 22px;
  box-shadow: var(--sh-xs); transition: .32s cubic-bezier(.22,.8,.36,1);
  position: relative; overflow: hidden;
}
.skill-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2.5px;
  background: linear-gradient(90deg, var(--blue), var(--violet) 52%, var(--pink)); opacity: .6;
  transition: opacity .3s;
}
.skill-card:hover { transform: translateY(-4px); box-shadow: var(--sh-md); border-color: rgba(122, 168, 212, .45); }
.skill-card:hover::before { opacity: 1; }
.skill-card-major {
  background: linear-gradient(158deg, #fff8fb, #ffffff 58%);
  border-color: var(--line-pink); box-shadow: var(--sh-sm);
}
.skill-type { font-size: 11px; letter-spacing: 3px; color: var(--blue-deep); margin-bottom: 7px; font-weight: 500; }
.skill-card-major .skill-type { color: var(--pink-text); }
/* 技能图标：B 站 wiki 的图标是白色字形 + 透明底，直接放白卡上看不见，
   已预先烘成粉紫渐变圆角块（images/skills/*.png，128px 源图，按 46px 显示） */
.skill-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 11px; }
.skill-ico {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 11px;
  box-shadow: 0 5px 12px rgba(201, 150, 205, .22);
}
.skill-head .skill-type { margin-bottom: 4px; }
.skill-head h4 { margin-bottom: 0; }
.skill-card h4 { font-family: var(--font-serif); font-size: 16.5px; color: var(--ink); letter-spacing: 1.2px; margin-bottom: 9px; font-weight: 600; }
.skill-card p { font-size: 12.8px; color: var(--ink-soft); line-height: 1.85; }
/* 忆灵卡把「忆灵天赋 + 忆灵技」合成一张，两段之间用虚线分隔（全局 * 已清零 margin） */
.skill-card p + p { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }

.trace-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(262px, 1fr)); gap: 16px; }
.trace-card {
  background: linear-gradient(158deg, var(--gold-pale), #fffdf8 70%);
  border: 1px solid var(--line-warm); border-radius: var(--radius-sm);
  padding: 19px 22px; box-shadow: var(--sh-xs); transition: .3s;
}
.trace-card:hover { transform: translateY(-3px); box-shadow: var(--sh-sm); }
.trace-card b { color: var(--gold-text); font-size: 14.2px; letter-spacing: 1.2px; display: block; margin-bottom: 9px; font-family: var(--font-serif); }
.trace-card p { font-size: 12.8px; color: var(--ink-soft); }
/* 带图标的行迹卡（只有技能面板那 3 张；一页永恒的 .trace-card 没有 .trace-ico，
   所以修饰类必须显式加，不能直接改 .trace-card 为 flex） */
.trace-card-ico { display: flex; gap: 13px; align-items: flex-start; }
.trace-card-ico b { margin-bottom: 6px; }
.trace-ico { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; margin-top: 1px; }

/* 档案 · 星魂 */
.eidolon-list { display: flex; flex-direction: column; gap: 14px; max-width: 840px; margin: 0 auto; }
.eidolon-item {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 19px 22px;
  box-shadow: var(--sh-xs); transition: .32s cubic-bezier(.22,.8,.36,1);
}
.eidolon-item:hover { transform: translateX(4px); border-color: var(--line-pink); box-shadow: var(--sh-sm); }
.eidolon-core {
  background: linear-gradient(120deg, var(--gold-pale), #ffffff 58%);
  border-color: var(--line-warm); box-shadow: var(--sh-sm);
}
/* 星魂徽章：2026-11-03 换源 + 二次修图。
   B 站 wiki 那套「白色符号」不可靠 —— 星魂 6 的图就是星魂 3 的图（像素差异仅 874，
   右下角那块书页装饰还被裁掉大半），且 wiki 上没有备用版本。
   改用游戏内的星魂插画（StarRailStation 的 Eidolons 页用的就是这套，
   与 wiki 的 2048²「昔涟-星魂N-大.png」逐张一致）。
   插画本身是透明底碎片，只占画面 44%~55%，直接压在深色圆上中间一片黑；
   所以改成「同图放大模糊当底色 + 清晰前景 + 暗部提亮(gamma 0.85) + 粉紫柔光」，浅色圆底。 */
.eidolon-no {
  position: relative; flex: 0 0 54px; width: 54px; height: 54px;
  border: none; background: none; padding: 0;
}
.eidolon-no img {
  display: block; width: 54px; height: 54px; border-radius: 50%;
  box-shadow: 0 4px 12px rgba(198, 152, 200, .28);
}
.eidolon-no i {
  position: absolute; right: -5px; bottom: -5px;
  min-width: 19px; height: 19px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px; background: #fff; border: 1px solid rgba(224, 122, 168, .5);
  font: 600 11px/1 var(--font-sans); font-style: normal; color: var(--pink-deep);
  box-shadow: 0 2px 5px rgba(180, 140, 175, .18);
}
.eidolon-core .eidolon-no i { color: var(--gold-text); border-color: rgba(217, 169, 74, .6); }
.eidolon-item h4 { font-size: 15.5px; color: var(--ink); letter-spacing: 1.2px; margin-bottom: 6px; font-family: var(--font-serif); font-weight: 600; }
.eidolon-item p { font-size: 12.8px; color: var(--ink-soft); }
/* 2026-11-02 按用户要求删掉了 2 魂标题后的「核心毕业命座」胶囊。
   规则留档：把 <em class="core-tag">…</em> 贴回 h4 即可复活（与 .guide-* 处理一致）。
   .eidolon-core 的金色卡面保留，仍标出 2 魂是重点。 */
.core-tag {
  font-size: 10.5px; color: var(--gold-text); border: 1px solid rgba(217, 169, 74, .55);
  background: var(--gold-pale); border-radius: 999px; padding: 2px 11px; margin-left: 10px;
  font-style: normal; font-family: var(--font-sans); letter-spacing: 1px; vertical-align: 2px;
}

/* 档案 · 攻略
   ⚠️ 2026-11-02 按用户要求删掉了「场景攻略」页签及其 #arch-guide 面板，
   这组 .guide-* 规则暂时没有使用者。故意留着：把 HTML 面板贴回去即可复活，
   不需要重写样式（与 #forms 三形态、#song 独立节的处理方式一致）。 */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)); gap: 16px; }
.guide-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 21px 24px;
  box-shadow: var(--sh-xs); transition: .32s;
}
.guide-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.guide-card h4 {
  font-family: var(--font-serif); font-size: 15.5px; color: var(--gold-text);
  letter-spacing: 1.2px; margin-bottom: 13px; font-weight: 600;
  padding-bottom: 9px; border-bottom: 1px dashed var(--line-warm);
}
.guide-card ul { list-style: none; }
.guide-card li { position: relative; padding-left: 18px; font-size: 12.8px; color: var(--ink-soft); margin-bottom: 9px; }
.guide-card li::before { content: "❀"; position: absolute; left: 0; color: var(--pink); font-size: 9px; top: 3px; }

/* 档案 · 一页永恒 */
.eternal-intro { display: grid; grid-template-columns: 304px 1fr; gap: clamp(20px, 3vw, 36px); align-items: start; }
@media (max-width: 860px) { .eternal-intro { grid-template-columns: 1fr; } }
.eternal-intro p { font-size: 13.8px; color: var(--ink-soft); text-align: justify; margin-bottom: 13px; }
.eternal-intro b { color: var(--pink-text); }

/* 档案 · 台词 */
.quote-grid { columns: 2; column-gap: 18px; }
@media (max-width: 760px) { .quote-grid { columns: 1; } }
.quote-item {
  break-inside: avoid; margin-bottom: 18px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 19px 22px;
  box-shadow: var(--sh-xs); transition: .32s cubic-bezier(.22,.8,.36,1);
  position: relative; overflow: hidden;
}
.quote-item::before {
  content: "❝"; position: absolute; top: 4px; right: 13px;
  font-size: 30px; color: var(--pink); opacity: .14; font-family: serif;
}
.quote-item:hover { transform: translateY(-4px); box-shadow: var(--sh-md); border-color: var(--line-pink); }
.quote-item p { font-family: var(--font-serif); font-size: 13.8px; color: var(--ink); line-height: 2; }
.quote-item cite {
  display: block; margin-top: 11px; font-size: 11.8px; color: var(--gold-text);
  font-style: normal; text-align: right; letter-spacing: 1.5px;
}

/* ═══════════════ 页脚 ═══════════════ */
.footer {
  text-align: center; padding: 62px 24px 48px; position: relative;
  background:
    radial-gradient(ellipse 70% 60% at 50% 100%, rgba(248, 220, 234, .7), transparent 65%),
    linear-gradient(180deg, var(--bg-rose), #fbf2f7 60%, #fdf6fa);
  border-top: 1px solid var(--line-pink);
}
.footer::before {
  content: ""; display: block; width: 140px; height: 14px;
  margin: 0 auto 26px; background: var(--ornament) center/contain no-repeat; opacity: .8;
}
.footer-quote {
  font-family: var(--font-serif); font-size: clamp(17px, 2.6vw, 22px);
  color: var(--pink-deep); letter-spacing: 2.5px; margin-bottom: 22px; font-weight: 600;
}
.footer-note { font-size: 11.8px; color: var(--ink-faint); line-height: 2.1; }
.footer-made { margin-top: 18px; font-size: 11.8px; color: var(--gold-text); letter-spacing: 3.5px; }

/* ═══════════════ 无障碍与动效偏好 ═══════════════ */
button:focus-visible, a:focus-visible, .star-globe:focus-visible {
  outline: 2.5px solid var(--pink-deep); outline-offset: 3px; border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}


/* ═══════════════ 图片放大查看 ═══════════════ */
/* 卡片显示 900px 缩略图，点击才按需加载原图（2730×1536） */
.img-slot[data-full].filled { cursor: zoom-in; }
.img-slot[data-full].filled::before {           /* 右上角放大提示 */
  /* 与 .hint-icon 同款箭头：伪元素放不了内联 SVG，改用 data URI 背景。
     同样是 45° 对称双头箭头，13px 下墨迹约 9px，比原来的文字字形锐利得多。
     原来的 content: "⤢" 在 13px 下墨迹仅 8.3px 且依赖字体，一并换掉。 */
  content: ""; position: absolute; top: 10px; right: 12px; z-index: 3;
  width: 26px; height: 26px; border-radius: 50%;
  pointer-events: none;
  background-color: rgba(60, 40, 55, .42);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23fff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.4 2.6 2.6 9.4'/%3E%3Cpath d='M6.8 2.6h2.6v2.6'/%3E%3Cpath d='M5.2 9.4H2.6V6.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 13px 13px;
  backdrop-filter: blur(4px);
  opacity: .55; transition: opacity .28s, transform .28s;
}
.img-slot[data-full].filled:hover::before { opacity: 1; transform: scale(1.08); }

.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(38, 26, 38, .9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
body.lightbox-open { overflow: hidden; }

.lightbox-figure {
  margin: 0; display: flex; flex-direction: column; align-items: center; gap: 16px;
  transform: scale(.94); transition: transform .3s cubic-bezier(.22,.8,.36,1);
}
.lightbox.open .lightbox-figure { transform: none; }
.lightbox-img {
  max-width: 92vw; max-height: 78vh; width: auto; height: auto; display: block;
  border-radius: var(--radius);
  box-shadow: 0 26px 76px rgba(0, 0, 0, .55);
  background: rgba(255, 255, 255, .05);
}
.lightbox-img:not([src]) { min-width: 220px; min-height: 140px; }
.lightbox-caption {
  color: rgba(255, 246, 250, .84); font-size: 13px; letter-spacing: 4px;
  font-family: var(--font-serif);
}
.lightbox-hint {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  margin: 0; color: rgba(255, 246, 250, .68); font-size: 12.5px; letter-spacing: 2px; pointer-events: none;
  opacity: 0; transition: opacity .25s;
}
.lightbox-hint.show { opacity: 1; }
.lightbox-close {
  position: absolute; top: 22px; right: 26px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .1);
  color: #fff; font-size: 16px; cursor: pointer; transition: .26s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .24); transform: rotate(90deg); }

@media (max-width: 640px) {
  .lightbox-img { max-width: 94vw; max-height: 72vh; }
  .lightbox-close { top: 14px; right: 14px; width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox-figure, .lightbox-close, .lightbox-hint { transition: none; }
}


/* 灯箱左右切换与页码 */
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 52px; height: 52px; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .26); background: rgba(255, 255, 255, .1);
  color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
  font-family: var(--font-serif);
  transition: background .26s, transform .26s, opacity .26s;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, .24); }
.lightbox-prev { left: clamp(12px, 3vw, 40px); }
.lightbox-next { right: clamp(12px, 3vw, 40px); }
.lightbox-prev:hover { transform: translateY(-50%) translateX(-3px); }
.lightbox-next:hover { transform: translateY(-50%) translateX(3px); }
.lightbox-nav[hidden] { display: none; }

.lightbox-counter {
  position: absolute; top: 30px; left: 50%; transform: translateX(-50%); z-index: 2;
  color: rgba(255, 246, 250, .72); font-size: 12.5px; letter-spacing: 3px;
  font-family: var(--font-sans); pointer-events: none;
}

@media (max-width: 640px) {
  .lightbox-nav { width: 42px; height: 42px; font-size: 21px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-counter { top: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .lightbox-nav { transition: none; }
}


/* 场景漫游：可点击放大的提示（放在副标题下方，浏览卡片前就能看到） */
.scene-click-hint {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  margin: 18px auto 0; padding: 8px 20px;
  font-size: 12.5px; letter-spacing: 1.2px; color: var(--pink-deep);
  font-family: var(--font-sans); line-height: 1.5;
  background: rgba(255, 255, 255, .74);
  border: 1px solid var(--line-pink); border-radius: 999px;
  box-shadow: var(--sh-sm);
}
/* 放大箭头用内联 SVG，不用文字字符「⤢」(U+2922)：
   该字形在 11px 下墨迹只有 7×7px，斜边与箭头糊成一团，放大看是"歪"的；
   而且 U+2922 不在常见 Linux 字体里，会退化成豆腐块。
   SVG 是矢量的，任意尺寸都锐利，也不依赖系统字体。
   路径按 45° 严格对称设计：轴线 (9.4,2.6)-(2.6,9.4)，两端箭头各两根 2.6 长倒钩，
   描边 1.5 + 圆头，墨迹范围 1.85~10.15（viewBox 12），中心精确落在 (6,6)。 */
.scene-click-hint .hint-icon {
  flex: none; width: 19px; height: 19px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #e79ec3, #ada0e2);
}
.scene-click-hint .hint-icon svg { display: block; }
/* 暂停态：点击卡片文字区后切换，默认隐藏，避免常驻占位 */
.scene-click-hint .hint-pause {
  display: none; align-items: center; gap: 6px; color: #b07a9c;
}
.scene-click-hint .hint-pause::before {
  content: ""; flex: none; width: 1px; height: 12px; border-radius: 1px;
  background: var(--line-pink);
}
.scene-click-hint.is-paused {
  border-color: rgba(224, 122, 168, .55);
}
.scene-click-hint.is-paused .hint-pause { display: inline-flex; }
@media (max-width: 560px) {
  .scene-click-hint { font-size: 11.5px; padding: 7px 15px; gap: 6px; }
  /* 窄屏下"已暂停…"会折到第二行，行首的分隔竖线看起来像误画的一笔，去掉；
     两段文字之间的间距交给 flex 的 gap */
  .scene-click-hint .hint-pause::before { display: none; }
}

/* ═══════════════ 随行对话 · 昔涟 ═══════════════
   与右下角的音乐胶囊同为**悬浮椭圆胶囊**（基础形态统一，全站视觉才不散），
   但内部重新设计，不会认混：
     · 音乐 = 旋转胶片圆盘 + 双行文字 +  Chevron 箭头
     · 聊天 = 涟漪星徽 + 淡金分隔线 + 单行文案 + 呼吸点
   位置在左上角、面板往**下**长（音乐在右下、往上长），
   徽记取导航星盘的凹弧四芒星，外圈两环是首页点击泛起的记忆涟漪。
   ⚠️ 悬停用 translateY(-2px) 上浮而不是 translateX：贴边签条才适合横向抽出，
      悬浮胶囊横移会显得"要掉下去"。
   ⚠️ top:19px 是**与导航条中心对齐**算出来的（导航 top:14 + 高≈62 → 中心≈45，
      胶囊高 52 → 45−26=19）。上移到同一行后有个新问题：视口在 860~1200 之间时
      居中的导航条左缘会伸到胶囊头顶，两者重叠 —— 由 chat.js 的 syncChatSlot()
      实测后把胶囊降级成圆钮解决（和音乐胶囊 syncDockSlot 同一思路）。 */
.global-chat-dock {
  position: fixed; left: 22px; top: 19px; z-index: 191;
  /* ⚠️ `--chat-full-w` 是「胶囊完整宽度」的**唯一正本**：`js/chat.js` 的
     syncChatSlot() 读它算右缘。以前 JS 手抄了一份 `CHAT_FULL_W = 204`，
     而 1180 断点把 width 改成 186 后没同步 ⇒ 1140~1180 之间明明没撞也缩成圆钮。
     ⚠️ 它必须与 width 同值，但**不随** `.is-compact`（48px）改变 —— 降级时也要按完整宽度判。 */
  --chat-full-w: 204px;
  width: 204px; max-width: calc(100vw - 44px);
}
.global-chat-toggle {
  position: relative;
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 52px;
  padding: 6px 15px 6px 6px;
  border: 1px solid var(--line-pink); border-radius: 999px;
  background: linear-gradient(105deg, #fffdfd, var(--pink-pale) 58%, var(--violet-pale));
  box-shadow: 0 8px 30px rgba(100, 65, 95, .15), inset 0 1px 0 #fff;
  font-family: var(--font-sans); text-align: left; cursor: pointer;
  transition: transform .28s cubic-bezier(.22, 1, .36, 1), box-shadow .25s, border-color .25s;
}
/* 悬停/展开时上浮 2px —— 比阴影变化更"活"，且和音乐的纯阴影 hover 区分开 */
.global-chat-toggle:hover, .global-chat-dock.is-open .global-chat-toggle {
  transform: translateY(-2px); border-color: var(--pink);
  box-shadow: 0 12px 36px rgba(164, 96, 141, .26), inset 0 1px 0 #fff;
}
/* 徽记与文案之间的淡金分隔线：音乐胶囊没有这道线，也是"信笺"质感的最小注脚 */
.global-chat-sep {
  flex: none; width: 1px; height: 20px;
  background: linear-gradient(180deg, transparent, rgba(205, 165, 95, .55) 25%, rgba(205, 165, 95, .55) 75%, transparent);
}

/* ── 徽记：圆形头像（2026-10-21，按音乐播放器胶囊的封面做法）──
   原来这里是「凹弧四芒星 + 两圈扩散涟漪」的 SVG；现在换成昔涟头像的圆形裁切，
   外面留一圈 1px 粉边 + 一圈缓慢呼吸的光环（替代原来的涟漪，保留"活着"的感觉）。
   ⚠️ 头像本身是 160×160 方图，靠 object-fit:cover + border-radius:50% 裁圆，
      不要给 img 直接加 border-radius 之外的处理，也不要用 background-image（会丢 alt/尺寸语义）。 */
.global-chat-mark {
  position: relative; flex: none; display: grid; place-items: center;
  width: 36px; height: 36px;
}
.global-chat-avatar {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover;
  /* 1px 粉边压在图片上（inset），再给一层很淡的外阴影把它"托"起来 */
  box-shadow: 0 0 0 1px rgba(214, 132, 176, .5), 0 2px 7px rgba(150, 80, 130, .16);
}
/* 呼吸光环：贴边起、只向外扩 16% 就散掉 —— 贴得近才像"在呼吸"，
   扩太远会变成一圈独立的环，小尺寸下像重影（实测 36px 时 1.28 太远）。 */
.global-chat-mark::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(224, 122, 168, .45); opacity: 0; pointer-events: none;
  animation: chatHalo 3.4s ease-out infinite;
}
@keyframes chatHalo {
  0%   { transform: scale(1);    opacity: .4; }
  60%, 100% { transform: scale(1.16); opacity: 0; }
}
/* 单行文案（音乐是两行）：更矮更轻，徽记和文字一排放得下 */
.global-chat-copy { display: flex; flex: 1; min-width: 0; align-items: center; }
.global-chat-status {
  font-family: var(--font-serif); font-size: 13.5px; font-weight: 600; letter-spacing: 1.6px;
  color: var(--pink-deep); line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 在线呼吸点：取代音乐胶囊那颗 Chevron 箭头 —— 更省宽度，状态也更直观 */
.global-chat-dot {
  flex: none; width: 6px; height: 6px; border-radius: 50%;
  background: var(--pink); box-shadow: 0 0 0 3px rgba(224, 122, 168, .16);
  animation: chatDot 2.6s ease-in-out infinite;
}
@keyframes chatDot {
  0%, 100% { opacity: .5; transform: scale(.85); }
  50%      { opacity: 1; transform: scale(1.15); }
}
/* 忙碌态：文字改成「正在回忆…」的同时，点转金、涟漪加快一倍 */
.global-chat-dock.is-busy .global-chat-dot { background: var(--gold); animation-duration: .9s; }
.global-chat-dock.is-busy .global-chat-mark::after { animation-duration: 1.2s; }

/* 面板贴着胶囊**下方**展开（左上角，所以往屏幕内部长；音乐在右下是往上长） */
.global-chat-panel {
  position: absolute; left: 0; top: calc(100% + 12px);
  /* 2026-10-15 用户要求「这个聊天框太小了加大一点」：384 → 480，并**固定高度**。
     原来只写 max-height，高度随内容浮（开场那几句只有 330px 左右）；
     现在写死 height，一展开就是稳定的大窗，消息多少都不跳。 */
  width: 480px; max-width: calc(100vw - 40px);
  /* 顶 19 + 胶囊 52 + 间距 12 + 底留 28 = 111；用 dvh 兼容移动端地址栏伸缩。
     ⚠️ height 必须用 min()：矮屏（笔记本横屏）要让它让位，否则面板下缘会伸到视口外。
        万一 min() 不被支持、整条声明作废，还会退回 auto —— max-height 仍在，
        行为正好退化成本次改动之前的样子，不会坏。 */
  height: min(620px, calc(100dvh - 111px));
  max-height: calc(100vh - 111px); max-height: calc(100dvh - 111px);
  display: flex; flex-direction: column;
  padding: 16px; border: 1px solid var(--line-pink); border-radius: 20px;
  /* 2026-10-21 用户要求：聊天界面用 images/chat-bg.jpg 当背景。
     素材与首页背景图同规格：3128×1340、q82、约 408KB（cover-bg-wide.jpg 是 413KB）。
     面板是 480×620 的竖长条，图是 2.33:1 横幅 ⇒ cover 只露出中间约 1/3 宽度，
     所以横向位置钉在 41%（昔涟坐着的位置）；**换图或换构图要重新量这个百分比**。
     ⚠️⚠️ **不要再铺半透明白色罩层**：2026-10-21 03:0x 用户明确「要你做淡化了吗看着有点淡」，
     背景就是原图直出。可读性靠局部解决（见下面 .global-chat-panel-head 的柔光底），别糊整张图。 */
  background-color: #fdf7fb;
  background-image: url('../images/chat-bg.jpg?v=20261021b');
  background-size: cover;
  background-position: 41% center;
  background-repeat: no-repeat;
  box-shadow: 0 18px 64px rgba(83, 49, 78, .19), inset 0 1px 0 #fff;
  /* container transform：起始形状 ≈ 胶囊（204×52），锚在左上角。
     ⚠️ scaleX 的分子永远是胶囊宽、分母永远是面板宽，**改宽度必须同步重算**，
        否则收起态会从一个和胶囊不一样大的形状开始长。
        基准档 .425 = 204/480；其余档见下方分档。
     scaleY .08 让起始高 ≈ 620×.08 = 49.6px，略低于胶囊的 52 —— **必须小于胶囊高**，
     否则起始态会冒出胶囊外，"从胶囊里长出来"就穿了。
     矮屏时 height < 620，乘出来只会更小，更安全。 */
  transform-origin: 0 0; opacity: 0; pointer-events: none;
  transform: translateY(-8px) scale(.425, .08);
  transition: opacity .18s cubic-bezier(.4, 0, .7, .45),
              transform .22s cubic-bezier(.4, 0, .7, .45);
}
.global-chat-dock.is-open .global-chat-panel {
  opacity: 1; pointer-events: auto; transform: none;
  /* 曲线与音乐面板（.38,.68,.3,1）刻意不同：这条更"轻"，收尾更早 */
  transition: opacity .26s cubic-bezier(.4, 0, .55, 1),
              transform .4s cubic-bezier(.22, 1, .36, 1);
}
/* 内容三层错峰：关闭时 .01s 立刻消失（避免收起时内容残留），
   打开时按面板"从上往下长"的顺序依次浮现 */
.global-chat-panel-head, .global-chat-log, .global-chat-form {
  opacity: 0; transform: translateY(-4px);
  transition: opacity .01s linear, transform .01s linear;
}
.global-chat-dock.is-open .global-chat-panel-head,
.global-chat-dock.is-open .global-chat-log,
.global-chat-dock.is-open .global-chat-form {
  opacity: 1; transform: none;
  transition: opacity .3s ease, transform .34s cubic-bezier(.22, 1, .36, 1);
}
.global-chat-dock.is-open .global-chat-panel-head { transition-delay: .07s; }
.global-chat-dock.is-open .global-chat-log      { transition-delay: .12s; }
.global-chat-dock.is-open .global-chat-form     { transition-delay: .16s; }
/* 标题区：背景图直出后靠这层**局部**柔光保可读 —— 只覆盖头部一条，
   向下渐隐到透明，不会像整张罩层那样把画面压淡（用户 2026-10-21 否掉过整层罩）。 */
.global-chat-panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin: -6px -8px 12px; padding: 6px 8px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, .45) 62%, rgba(255, 255, 255, 0));
}
.global-chat-head-brand { display: flex; align-items: center; min-width: 0; }
.global-chat-panel-head strong {
  display: block; font-family: var(--font-serif); color: var(--pink-deep);
  font-size: 18px; font-weight: 600; letter-spacing: 2.5px; line-height: 1.2;
}
.global-chat-sub { display: none; }
.global-chat-head-actions { display: flex; align-items: center; gap: 6px; flex: none; }
/* 2026-10-22「新话题」按钮已删：原 .global-chat-clear / :hover 两条规则一并移除 */
/* 2026-10-24 新增「重置上下文」钮：与全屏/收起同一套图标钮外观，直接并入选择器，
   不另写一份 —— 几颗钮并排，尺寸/描边/悬停必须完全一致。
   2026-10-24 再加「历史对话」钮，继续并进这条选择器。 */
.global-chat-close, .global-chat-close:focus-visible,
.global-chat-expand, .global-chat-expand:focus-visible,
.global-chat-reset, .global-chat-reset:focus-visible,
.global-chat-archive-btn, .global-chat-archive-btn:focus-visible {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px;
  padding: 0; border-radius: 50%; border: 1px solid var(--line-pink);
  color: var(--pink-deep); background: rgba(255, 255, 255, .8); cursor: pointer;
  transition: background .2s, border-color .2s;
}
.global-chat-close:hover, .global-chat-expand:hover, .global-chat-reset:hover,
.global-chat-archive-btn:hover { background: var(--pink-pale); border-color: var(--pink); }
.global-chat-archive-btn[aria-expanded="true"] { background: var(--pink-pale); border-color: var(--pink); }
/* 重置进行中：按钮压暗 + 图标转圈当加载态（/reset 通常 1 秒内回来，但没有反馈会像没点上） */
.global-chat-reset:disabled { opacity: .45; cursor: default; }
.global-chat-reset.is-busy svg { animation: chatResetSpin .9s linear infinite; }
@keyframes chatResetSpin { to { transform: rotate(-360deg); } }
/* 全屏按钮（2026-10-15 新增）：两个图标都常驻在按钮里，靠 CSS 换显 ——
   默认藏 .ic-collapse，进了全屏藏 .ic-expand。比 JS 换 innerHTML 稳，
   不会在动画中途闪一下（换 DOM 会丢掉正在跑的 transition）。 */
.global-chat-expand .ic-collapse { display: none; }
.global-chat-dock.is-full .global-chat-expand .ic-expand { display: none; }
.global-chat-dock.is-full .global-chat-expand .ic-collapse { display: block; }
/* 消息区 */
.global-chat-log {
  flex: 1;
  min-height: 160px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  scroll-behavior: smooth;
}

/* ── 登录门槛（2026-10-30 新增）──
   未登录时由这一层顶替消息列表：和 log 同一块位置、同样是 flex:1，
   所以面板展开后的观感（高度、输入行的位置）跟登录态完全一致。
   ⚠️ `[hidden]` 必须显式写 display:none —— 本层自己就是 flex，
      不写这条，它的 display:flex 会盖掉 [hidden] 而照常渲染出来。 */
.global-chat-gate {
  flex: 1;
  min-height: 160px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  display: flex; align-items: center; justify-content: center;
  padding: 18px 6px;
}
.global-chat-gate[hidden] { display: none !important; }
/* ⚠️ 同一道坑的另一边：log 自己也是 flex，JS 会用 `log.hidden = true` 把它藏起来，
   没有这条它就照常渲染，和 gate 同时占着正文区。 */
.global-chat-log[hidden] { display: none !important; }
.chat-gate-card {
  width: 100%; max-width: 316px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 26px 22px 21px;
  border-radius: 20px;
  background: linear-gradient(165deg, #fffdfe 0%, #fdf8fb 52%, #faf6ff 100%);
  border: 1px solid var(--line-pink);
  box-shadow: var(--sh-sm);
  text-align: center;
}
/* 徽记 = 胶囊那颗昔涟头像（images/chat-avatar.jpg），原来是 CSS 画的凹弧四角星。
   这一层只负责尺寸和定位，**描边与投影全部交给里面的 .global-chat-avatar**
   （和胶囊共用同一套：1px 粉边 + 2px/7px 淡投影）。
   ⚠️ 别给这层加 overflow:hidden —— 会把 img 自己那圈粉边和投影一并裁掉；
      圆形靠 img 的 border-radius:50% + object-fit:cover 就够了。
   ⚠️ 别再补 border 或外扩光晕：img 已自带描边和投影，再叠一层会和投影混成
      灰边（实测 6px/.07 的淡粉晕把边缘压得发灰），反而不如胶囊干净。 */
.chat-gate-mark {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
}
.chat-gate-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.chat-gate-desc { font-size: 12.5px; line-height: 1.9; color: var(--ink-soft); }
.chat-gate-btn {
  margin-top: 4px; padding: 9px 24px;
  border: none; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  box-shadow: var(--sh-pink);
  transition: transform .2s ease, box-shadow .2s ease;
}
.chat-gate-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(224, 122, 168, .3); }
.chat-gate-btn:active { transform: none; }

/* ── 登录失效横幅（2026-10-30 新增）──
   登录过但令牌中途失效时才出现。此时已发出的内容不收回，只在这里提示并锁住输入。 */
.global-chat-relock {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 9px 10px 9px 13px;
  border-radius: 12px;
  background: var(--gold-pale);
  border: 1px solid var(--line-warm);
}
.global-chat-relock[hidden] { display: none !important; }
.global-chat-relock-text { flex: 1; min-width: 0; font-size: 12px; line-height: 1.7; color: var(--gold-text); }
.global-chat-relock-btn {
  flex: none; padding: 5px 13px; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 12px; color: var(--gold-text);
  background: #fff; border: 1px solid var(--line-warm);
  transition: background .2s ease;
}
.global-chat-relock-btn:hover { background: #fffaf0; }

/* 未登录 / 失效时输入行整体变灰，别让人以为是卡住了。
   ⚠️ .global-chat-input 自己是 transparent —— 底色在 .global-chat-box 上，
      所以改的是 box 而不是 input（改 input 等于没改）；发送/选图那两个按钮
      各自已有 :disabled 规则，不用在这里重复。 */
.global-chat-dock.is-locked .global-chat-box {
  background: var(--bg-lav);
  border-color: var(--line);
}
.global-chat-dock.is-locked .global-chat-input {
  color: var(--ink-faint);
  cursor: not-allowed;
}

/* ── 消息行：头像 + 气泡（2026-10-31）──
   结构由 chat.js 的 addMsg() 生成：bot = [头像][气泡]，user = [气泡][头像]。
   ⚠️ 头像必须是 .chat-msg 的**兄弟节点**。做成 ::before 会落在气泡内部，
      被气泡自己的底色/边框/圆角包住，看起来是「气泡里嵌了个圆」而不是并排的头像。 */
.chat-row {
  display: flex; align-items: flex-end; gap: 8px;
  /* 96% 而不是 92%：头像 32 + 间距 8 = 40px 是行内固定开销，
     留 92% 会把气泡挤得比加头像之前（86% 无头像）还窄。 */
  max-width: 96%;
}
.chat-row.bot { align-self: flex-start; }
.chat-row.user { align-self: flex-end; }
.chat-row-avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, var(--pink-mist), var(--violet-pale));
  color: var(--pink-deep); font-family: var(--font-serif); font-size: 13px;
  box-shadow: 0 2px 6px rgba(205, 150, 200, .22);
  margin-bottom: 2px;
}
/* 有图时把渐变底让出来（2026-10-31 用户：「为什么显示的头像有白边」）。
   头像 PNG 的四角是**完全透明**的，浅色底会从图片圆边透出来，
   在深色背景上看就是紧贴图片的一圈白边。和 .account-avatar 同一套处理。 */
.chat-row-avatar:has(img) {
  background: none;
}
.chat-row-avatar img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%;
}
/* 2026-10-31：两侧一律严格 32×32，不加任何缩放。
   昔涟那张（聊天胶囊同款）是「整颗头 + 肩 + 星空」的构图，脸占比本来就比游戏头像小，
   这是图片本身的差异；用户明确选了「撤掉缩放，严格 32」，所以这里不再做补偿。 */
/* 气泡在行内吃满剩余宽度，上限由 .chat-row 控制（92%） */
.chat-row .chat-msg { max-width: 100%; min-width: 0; }

.chat-msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  animation: chatBotMsgAppear 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.chat-msg.is-restored {
  animation: none !important;
}
/* ⚠️ 2026-10-31 起对齐交给 .chat-row（气泡不再是 log 的直接 flex 子项），
   这里不能再写 align-self —— 在 .chat-row 内部它会变成交叉轴对齐，
   把气泡顶到行首，头像和气泡就错位了。 */
.chat-msg.user {
  background: linear-gradient(120deg, rgba(253, 238, 244, 0.82), rgba(241, 237, 251, 0.82));
  border: 1px solid rgba(224, 122, 168, 0.4);
  border-bottom-right-radius: 4px;
  color: #6b4a63;
  transform-origin: bottom right;
  animation-name: chatUserMsgAppear;
  box-shadow: 0 3px 12px rgba(224, 122, 168, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.chat-msg.bot {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-bottom-left-radius: 4px;
  color: #5d5566;
  font-family: var(--font-serif);
  transform-origin: bottom left;
  animation-name: chatBotMsgAppear;
  box-shadow: 0 4px 16px rgba(194, 86, 138, 0.08), 0 1px 3px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
/* 昔涟多段消息连续排列时的优雅贴合感 */
.chat-row.bot + .chat-row.bot {
  margin-top: -2px;
}
/* 只发图 / 只发表情包（不带文字）⇒ 不要那圈白底气泡（2026-10-25 用户要求「不要带白框」）。
   类由 chat.js 的 addMsg() 在「有 shots 且 text 为空」时加上。
   ⚠️ 必须写在 .chat-msg.user / .chat-msg.bot **之后** —— 三者特异性都是 (0,2,0)，
      靠先后顺序取胜，写到前面会被气泡样式盖回去。
   ⚠️ 只清视觉（底色/边框/阴影/内边距/圆角）。左右对齐不在这里管 ——
      2026-10-31 起由外层 .chat-row 的 align-self 负责。 */
.chat-msg.is-media-only {
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}
/* 图是唯一内容时，margin-bottom 会多出 6px 的空档 */
.chat-msg.is-media-only .chat-msg-img {
  margin-bottom: 0;
}
/* 多张图之间留一点缝，否则贴纸会连成一片 */
.chat-msg.is-media-only .chat-msg-img + .chat-msg-img {
  margin-top: 6px;
}
/* 「正在回忆」：AstrBot 首字要等 20~60 秒，必须让用户知道还活着 */
.chat-msg.thinking {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.8);
  border: 1px dashed rgba(224, 122, 168, 0.5);
  color: #a98ba0;
  font-style: normal;
  animation-duration: 0.25s;
}
/* 分段消息之间的「正在写」微型等待气泡 */
.chat-msg.chat-typing-bubble {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px dashed rgba(224, 122, 168, 0.45);
  color: #b392a8;
  font-family: var(--font-sans);
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: chatTypingAppear 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.chat-typing-word {
  opacity: 0.85;
  letter-spacing: 0.5px;
}

@keyframes chatBotMsgAppear {
  0% {
    opacity: 0;
    transform: translate3d(-8px, 12px, 0) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}
@keyframes chatUserMsgAppear {
  0% {
    opacity: 0;
    transform: translate3d(8px, 12px, 0) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}
@keyframes chatTypingAppear {
  0% {
    opacity: 0;
    transform: translate3d(-4px, 8px, 0) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.chat-dots { display: inline-flex; gap: 4px; vertical-align: middle; margin-right: 8px; }
.chat-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--pink); animation: chatBlink 1.3s ease-in-out infinite; }
.chat-dots i:nth-child(2) { animation-delay: .18s; }
.chat-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes chatBlink { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
/* 2026-10-22 用户要求去掉等待气泡里的 "Ns" 秒数 ⇒ .chat-wait 规则与 JS 里的
   <span class="chat-wait"> 一并删除，只留分段安抚词。别再加回秒数计数。 */
.chat-msg.error { align-self: flex-start; background: rgba(255, 245, 247, 0.85); border: 1px solid rgba(240, 200, 212, 0.8); color: #a3455f; font-size: 12.5px; }
/* 输入区
   2026-10-14 发图片功能：表单拆成「待发图片排队区」+「输入行」两层，
   所以 form 改纵向 flex；原来的 align-items:flex-end 下沉到 .global-chat-row。 */
.global-chat-form { position: relative; display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.global-chat-row { display: flex; align-items: flex-end; gap: 8px; min-width: 0; }
/* 选图按钮：与发送键同尺寸，但用淡描边而不是洋红渐变 —— 别抢「发送」的视觉重心 */
.global-chat-pick {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--line-pink); border-radius: 50%; cursor: pointer;
  color: var(--pink-deep); background: #fff;
  transition: transform .18s, border-color .2s, color .2s;
}
.global-chat-pick:hover,
.global-chat-pick[aria-expanded="true"],
.global-chat-pick.is-active {
  transform: scale(1.05); border-color: var(--pink); color: var(--pink-deep); background: var(--pink-pale);
}
.global-chat-pick:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ── 输入框本体（2026-10-15 改）──
   边框/底色/圆角从 textarea 上移到这一层：待发图片和文字共用**同一个圆角框**，
   图在上、文字在下 —— 用户说的「放到对话框里面文字上面」就是这里。
   ⚠️ 别和 `.chat-msg-img`（发出后的气泡）搞混，那是另一处，两处都要保持「图在上」。
   高度由内容撑：没图时 = 文字一行，有图时 = 缩略图 + 间隙 + 文字。
   ⚠️ 面板展开的四层错峰按 .global-chat-form 走，这层是 form 的子元素，不受影响。 */
.global-chat-box {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px;
  padding: 9px 12px; border: 1px solid var(--line-pink); border-radius: 12px;
  background: #fff; transition: border-color .2s;
}
.global-chat-box:focus-within { border-color: var(--pink); }

/* ── 待发图片排队区（在输入框**里面**、文字上方）──
   横排小缩略图，每张右上角一个 ×。⚠️ 高度压到 34px：
   太高会在用户还没打字时就先把输入框撑高。 */
.chat-staged { display: flex; flex-wrap: wrap; gap: 6px; }
/* ⚠️ 作者样式的 display:flex 会盖掉 UA 的 [hidden]{display:none}，必须自己写一条 */
.chat-staged[hidden] { display: none; }
.chat-staged-item { position: relative; width: 34px; height: 34px; }
.chat-staged-item img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  border: 1px solid var(--line-pink); border-radius: 8px; background: #fff;
}
/* 移除按钮：只有 hover 到这一张才显形，免得满屏小叉子 */
.chat-staged-x {
  position: absolute; top: -5px; right: -5px; width: 15px; height: 15px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  color: #fff; background: rgba(140, 80, 120, .82); font-size: 11px; line-height: 1;
  opacity: 0; transition: opacity .18s;
}
.chat-staged-item:hover .chat-staged-x { opacity: 1; }

/* 用户消息里夹带的图片：**排在文字上面**（2026-10-14 用户要求）。
   所以间距用 margin-bottom —— 图在上、文字在下，空档该落在图与文字之间。
   ⚠️ 这是「**已发出**的消息气泡」；「输入框里**待发**的图片」在 .global-chat-box 那层，
      两处是两回事，2026-10-15 用户澄清过一次，别再混。
   ⚠️⚠️ **普通图片：长边统一封顶**（2026-10-25 第三次纠正，用户：「横版的图会比竖版的大很多」）。
      走过两版弯路，都记下来别再犯：
      ① `max-width:100% + max-height:260` —— 横图长边 = 气泡宽 342、竖图长边只到 260，
         长边不相等 ⇒ **横图看起来比竖图大一圈**（实测 342×146 对 195×260，面积差 1.7 倍）。
      ② `clamp(88px,28vw,132px)` —— 压到表情包量级，用户当场否掉「太小了」。
      现在：**max-width 与 max-height 用同一个值** clamp(120px,46vw,240px)
      ⇒ 横图 240×135、竖图 135×240、方图 240×240，**长边永远相等**，面积按比例对称。
      340 那一版用户仍嫌大（「太大图片，缩小」），降到 240 后是表情包 100 的 2.4 倍。
      ⚠️ 别只写 max-width 或只写 max-height —— 只写一个就回到「长边不相等」的老问题。
      ⚠️ 481 张表情素材实测**全是 1:1 方图**（仅 4 张差 0.1），表情之间尺寸不会有大差异；
         真要收，只动 .is-emoji 那条，别动这条。 */
.chat-msg-img {
  display: block;
  max-width: clamp(120px, 46vw, 240px);
  max-height: clamp(120px, 46vw, 240px);
  margin-bottom: 6px; border-radius: 8px; cursor: zoom-in;
}
/* 表情包单独定尺寸（2026-10-25 用户两次要求：「发送的表情包显示得太大了」「小窗还是太大」）。
   普通图片走上面那条，只有带 .is-emoji 的才收小。
   ⚠️ 用 clamp(64px, 21vw, 100px) 而不是写死 + 媒体查询：面板宽度随视口变
      （480 → calc(100vw-200) → calc(100vw-56)），写死一个值必然在小窗偏大、大屏偏小。
      21vw 在 ≥476 视口就顶到 100 上限；360 视口 ≈ 76；320 视口 ≈ 67。
      ⚠️ 上一版是 24vw/108，用户反馈小窗仍偏大；且当时 @media(≤420) 里还有一条写死的
         116px 把 clamp 整个盖掉了（116 > 420×24%≈101），等于小窗根本没生效 —— 那条已删。
   ⚠️ 同时给 max-width 与 max-height：表情包里竖图不少，只限宽会让长条表情顶出半屏；
      两个 max 同时生效时图片按原比例取更严的那一边，不会变形。
   ⚠️ 只缩小不放大 —— 原图本身小于上限的仍按原尺寸显示，不会被拉糊。 */
.chat-msg-img.is-emoji {
  max-width: clamp(64px, 21vw, 100px);
  max-height: clamp(64px, 21vw, 100px);
  border-radius: 10px;
  /* 表情包不响应点击（2026-10-25 用户要求去掉「跳到另一个界面」）⇒ 光标也别装成可放大 */
  cursor: default;
}
/* ── 看大图（2026-10-25 新增）──
   只给照片用：点消息里的图 → 在面板内铺一层，不再 window.open 新标签。
   ⚠️ `.chat-lightbox` 用了 display:flex，会盖掉 UA 的 [hidden]{display:none}，
      必须自己补一条 `.chat-lightbox[hidden]` —— 否则关不掉。
   ⚠️ z-index 取 14：比历史对话(15)、确认层(16/20)都低，看大图不该压住要操作的弹层。 */
.chat-lightbox {
  position: absolute; inset: 0; z-index: 14;
  display: flex; align-items: center; justify-content: center;
  padding: 26px 20px;
  background: rgba(48, 30, 45, .74);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  border-radius: inherit;
  cursor: zoom-out;
  animation: chatLightboxIn .18s ease-out;
}
.chat-lightbox[hidden] { display: none; }
@keyframes chatLightboxIn { from { opacity: 0; } to { opacity: 1; } }
.chat-lightbox-img {
  max-width: 100%; max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .38);
  background: #fff;
  cursor: default;
}
.chat-lightbox-close {
  position: absolute; top: 10px; right: 10px;
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer;
  transition: background .18s, border-color .18s;
}
.chat-lightbox-close:hover { background: rgba(255, 255, 255, .3); border-color: rgba(255, 255, 255, .6); }
/* ⚠️ flex:none + width:100%，**绝不能写 flex:1**：在纵向 flex 容器里
   flex-basis:0% 会把 textarea 高度压成 0，而高度是 autoGrow() 写 inline style 控制的。 */
.global-chat-input {
  flex: none; width: 100%; max-height: 96px; padding: 0; resize: none;
  font-family: var(--font-sans); font-size: 13.5px; line-height: 1.7; color: #5d5566;
  border: 0; background: transparent;
}
.global-chat-input:focus { outline: none; }

/* ── 表情包弹层（2026-10-15 新增）──
   position:absolute 挂在 .global-chat-form 上（所以 form 要 position:relative），
   bottom:100% 让它长在输入行**上方**，且**不占流** —— 不会把输入行挤下去。
   z-index 高于消息列表，浮在对话内容之上。 */
.chat-emoji-pop {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 6;
  display: flex; flex-direction: column; gap: 7px; max-height: 268px; padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .82);
  background: linear-gradient(160deg, rgba(255, 253, 254, .92), rgba(253, 246, 251, .88) 60%, rgba(246, 241, 251, .92));
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: 0 16px 44px rgba(83, 49, 78, .18), 0 0 0 1px rgba(224, 122, 168, .32), inset 0 1.5px 0 rgba(255, 255, 255, .95);
  transform-origin: 67px bottom;
  animation: chatEmojiPopIn .28s cubic-bezier(.16, 1, .3, 1) forwards;
}
.chat-emoji-pop.is-closing {
  animation: chatEmojiPopOut .18s cubic-bezier(.4, 0, .7, .45) forwards;
  pointer-events: none;
}
/* ⚠️ 作者样式的 display:flex 会盖掉 UA 的 [hidden]{display:none}，必须自己写一条 */
.chat-emoji-pop[hidden] { display: none; }

@keyframes chatEmojiPopIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes chatEmojiPopOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(.96);
  }
}

/* 删除归档的二次确认（2026-10-25）：复用 .global-chat-confirm 全部外观，只把层级压到 16 ——
   比重归确认(20)低、比归档面板(15)高。三层不会同时出现，但万一同时出现，必须它盖归档、
   归档盖面板，别反。
   ⚠️ 必须写成双类选择器把特异性提到 (0,2,0)：单类写在 .global-chat-confirm 之前会被
      那条的 z-index:20 按「后来者胜」盖掉（实测踩过，读到的是 20）。 */
.global-chat-confirm.global-chat-confirm-archive { z-index: 16; }

/* ── 历史对话面板（2026-10-24）──
   重置时归档下来的旧对话，点面板头的书页钮翻看。铺满面板，比重置确认低一级（z-index 15），
   所以重置确认永远压在它上面 —— 两件事不会同时出现，但层级不能反。
   ⚠️ 同样是 display:flex，[hidden] 规则必须自己写。 */
.global-chat-archive {
  position: absolute; inset: 0; z-index: 15;
  display: flex; flex-direction: column;
  padding: 10px 10px 6px; border-radius: 20px;
  /* ⚠️ 必须够实（.96+）：这一层盖住的是面板头 + 消息区，透明度低一点就能看见底下
     四颗按钮和标题的鬼影，两层 UI 叠在一起很脏。blur 只是兜底，不靠它遮。
     用斜向渐变而不是纯白 —— 纯白在这个粉调面板里像贴了一张纸。 */
  background: linear-gradient(165deg, rgba(255, 253, 253, .97), rgba(252, 244, 249, .96) 55%, rgba(246, 242, 252, .97));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: chatArchiveIn .22s cubic-bezier(.22, 1, .36, 1);
}
.global-chat-archive[hidden] { display: none; }
@keyframes chatArchiveIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.global-chat-archive-head {
  flex: none; display: flex; align-items: center; gap: 6px;
  padding: 2px 2px 9px; border-bottom: 1px solid var(--line-pink);
}
#globalChatArchiveTitle {
  flex: 1; margin: 0; font-family: var(--font-serif); font-size: 14px; font-weight: 600;
  color: var(--pink-deep); letter-spacing: 2px; line-height: 1.6;
}
.global-chat-archive-back, .global-chat-archive-close {
  display: inline-flex; align-items: center; gap: 3px; flex: none;
  padding: 4px 8px; border: 1px solid var(--line-pink); border-radius: 999px;
  background: rgba(255, 255, 255, .85); color: var(--pink-deep);
  font-family: var(--font-sans); font-size: 11px; letter-spacing: 1px; cursor: pointer;
  transition: background .18s, border-color .18s;
}
.global-chat-archive-close { padding: 4px; border-radius: 50%; }
.global-chat-archive-back:hover, .global-chat-archive-close:hover { background: var(--pink-pale); border-color: var(--pink); }
/* ⚠️ back 靠 hidden 属性切显隐；上面给了 display:inline-flex，必须补回 [hidden] 的 display:none */
.global-chat-archive-back[hidden] { display: none; }
.global-chat-archive-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; padding: 10px 2px 4px;
  display: flex; flex-direction: column; gap: 8px;
}
/* 列表一行 = 卡片 + 右上角删除键（2026-10-25）。
   ⚠️ 卡片本身是 <button>，删除键不能塞进它里面（button 不能嵌套 button）⇒
      用 row 做定位容器，删除键绝对定位盖在卡片右上角，是卡片的**兄弟**。
   ⚠️ 卡片右侧要留 padding-right 让文字/轮数避开删除键。 */
.chat-archive-row { position: relative; }
.chat-archive-item {
  display: block; width: 100%; text-align: left; padding: 10px 42px 10px 12px;
  border: 1px solid var(--line-pink); border-radius: 14px;
  background: rgba(255, 255, 255, .88); cursor: pointer;
  box-shadow: 0 2px 8px rgba(194, 86, 138, .05);
  transition: background .18s, border-color .18s, transform .18s;
}
.chat-archive-item:hover { background: var(--pink-pale); border-color: var(--pink); transform: translateY(-1px); }
.chat-archive-item-del {
  /* 垂直居中而不是贴右上角：右上角那行是「时间 / N 轮」，贴上去会跟轮数挤成一串 */
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%); z-index: 1;
  display: inline-grid; place-items: center; width: 26px; height: 26px;
  padding: 0; border: 1px solid transparent; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: #a8446e; cursor: pointer;
  opacity: .8;
  transition: opacity .18s, background .18s, border-color .18s, color .18s;
}
.chat-archive-row:hover .chat-archive-item-del,
.chat-archive-item-del:focus-visible { opacity: 1; }
.chat-archive-item-del:hover {
  background: #fdeef4; border-color: var(--pink); color: var(--pink-deep);
}
.chat-archive-item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.chat-archive-time { font-family: var(--font-serif); font-size: 12px; color: var(--pink-deep); letter-spacing: .5px; }
.chat-archive-count { flex: none; font-size: 10.5px; color: #a98ba0; letter-spacing: .5px; }
.chat-archive-preview {
  margin-top: 5px; font-size: 11.5px; line-height: 1.75; color: #8b7383;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* 详情：复用气泡的观感，但字号小一档（这是回看，不是当前对话） */
.chat-archive-meta {
  align-self: stretch; text-align: center; font-size: 10.5px; letter-spacing: 1px;
  color: #b392a8; padding-bottom: 2px;
}
/* 一轮 = 一问 + 其后所有分段回答。轮内贴紧、轮间拉开，不然昔涟分段发的几条
   会和下一问混成一片（用户 2026-10-24 要求「一问一答算一轮」）。 */
.chat-archive-round { display: flex; flex-direction: column; gap: 4px; }
.chat-archive-round + .chat-archive-round { margin-top: 10px; }
.chat-archive-msg {
  max-width: 88%; padding: 9px 13px; border-radius: 15px;
  font-size: 12.5px; line-height: 1.85; white-space: pre-wrap; word-break: break-word;
}
/* 详情 meta 行：时间+轮数 在左，「删除这段」在右（2026-10-25 新增） */
.chat-archive-meta {
  align-self: stretch; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; font-size: 10.5px; letter-spacing: 1px; color: #b392a8; padding-bottom: 2px;
}
.chat-archive-del {
  flex: none; padding: 3px 10px; border: 1px solid var(--line-pink); border-radius: 999px;
  background: rgba(255, 255, 255, .85); color: #b0567f;
  font-family: var(--font-sans); font-size: 10.5px; letter-spacing: 1px; cursor: pointer;
  transition: background .18s, border-color .18s, color .18s;
}
.chat-archive-del:hover { background: var(--pink-pale); border-color: var(--pink); color: var(--pink-deep); }
.chat-archive-msg.user {
  align-self: flex-end; border-bottom-right-radius: 4px; color: #6b4a63;
  background: linear-gradient(120deg, rgba(253, 238, 244, .9), rgba(241, 237, 251, .9));
  border: 1px solid rgba(224, 122, 168, .38);
}
.chat-archive-msg.bot {
  align-self: flex-start; border-bottom-left-radius: 4px; color: #5d5566;
  font-family: var(--font-serif);
  background: rgba(255, 255, 255, .9); border: 1px solid rgba(255, 255, 255, .8);
}
/* 归档详情里的表情包（2026-10-25 起归档只存表情包**路径**，能重贴回来）。
   只发图没文字时同样不要白框 —— 与主聊天区 .chat-msg.is-media-only 保持一致。
   ⚠️ 必须写在 .chat-archive-msg.user/.bot 之后：特异性都是 (0,2,0)，靠顺序取胜。 */
.chat-archive-msg.is-media-only {
  padding: 0; background: none; border: 0;
}
.chat-archive-img {
  display: block; width: clamp(64px, 21vw, 100px); height: auto; border-radius: 8px;
}
.chat-archive-img + .chat-archive-img { margin-top: 4px; }
.chat-archive-empty {
  margin: auto; padding: 24px 8px; text-align: center;
  font-family: var(--font-serif); font-size: 12px; line-height: 2.1; color: #a98ba0;
}

/* ── 重置上下文的二次确认弹层（2026-10-24）──
   铺满面板（.global-chat-panel 是 position:absolute，天然当定位上下文），
   背后压一层半透明白 + 模糊：既遮住对话内容，又不至于把昔涟的背景图盖死。
   ⚠️ 必须自己写 [hidden] 规则 —— 同上，display:flex 会盖掉 UA 的 display:none。 */
.global-chat-confirm {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  border-radius: 20px;
  background: rgba(255, 251, 252, .7);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
}
.global-chat-confirm[hidden] { display: none; }
.global-chat-confirm-card {
  width: 100%; max-width: 336px; padding: 20px 18px 16px;
  border: 1px solid var(--line-pink); border-radius: 18px;
  background: linear-gradient(160deg, #fffdfd, #fdf6fa 62%, #f6f1fb);
  box-shadow: 0 18px 44px rgba(83, 49, 78, .2), inset 0 1px 0 #fff;
  animation: chatConfirmIn .24s cubic-bezier(.22, 1, .36, 1);
}
@keyframes chatConfirmIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.global-chat-confirm-title {
  margin: 0 0 8px; font-family: var(--font-serif); font-size: 15px; font-weight: 600;
  color: var(--pink-deep); letter-spacing: 1.5px; line-height: 1.6;
}
.global-chat-confirm-text {
  margin: 0 0 16px; font-size: 12px; line-height: 1.95; color: #7d6675;
}
.global-chat-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.global-chat-confirm-actions button {
  min-width: 76px; padding: 8px 16px; border-radius: 999px;
  font-family: var(--font-sans); font-size: 12.5px; letter-spacing: 1px; cursor: pointer;
  border: 1px solid var(--line-pink); background: rgba(255, 255, 255, .9); color: var(--pink-deep);
  transition: background .18s, border-color .18s, color .18s;
}
.global-chat-confirm-actions button:hover { background: var(--pink-pale); border-color: var(--pink); }
/* 确认键用实心主色（与取消键拉开层级）；提高一级特异性，别被上面那条 hover 盖掉 */
.global-chat-confirm-actions .global-chat-confirm-ok {
  background: var(--pink); border-color: var(--pink); color: #fff;
}
.global-chat-confirm-actions .global-chat-confirm-ok:hover {
  background: var(--pink-deep); border-color: var(--pink-deep); color: #fff;
}

/* ── 聊天须知（2026-10-25）──
   AI 聊天用户协议。两个用途共用同一块 DOM：刷新后首次打开面板的**强制提醒**，
   以及面板底部那条链接的**随时查看**。
   ⚠️ z-index:18 —— 必须压在归档面板(15)与删除确认(16)之上，否则从底部链接点开时
      会被盖住；比重置确认(20)低，因为重置确认是破坏性操作、必须永远在最上面。
   ⚠️ 遮罩透明度给到 .82 + blur：这一层要让人**读得下去**，太透明会跟背后的对话糊在一起。
   ⚠️ display:flex 会盖掉 UA 的 [hidden]{display:none}，必须自己补一条。 */
/* 聊天须知 + 聊天提示共用同一套壳（2026-10-26 加提示页时改成组合选择器，
   两套 DOM 只差内容，没必要写两份）。z-index 都是 18，但两者互斥、不会同时开。 */
.global-chat-terms, .global-chat-tips {
  position: absolute; inset: 0; z-index: 18;
  display: flex; align-items: center; justify-content: center; padding: 14px;
  border-radius: inherit;
  background: rgba(255, 251, 252, .82);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  animation: chatTermsIn .24s cubic-bezier(.22, 1, .36, 1);
}
.global-chat-terms[hidden], .global-chat-tips[hidden] { display: none; }
@keyframes chatTermsIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.global-chat-terms-card, .global-chat-tips-card {
  display: flex; flex-direction: column;
  width: 100%; max-width: 392px; max-height: 100%;
  border: 1px solid var(--line-pink); border-radius: 18px;
  background: linear-gradient(160deg, #fffdfd, #fdf6fa 62%, #f6f1fb);
  box-shadow: 0 18px 44px rgba(83, 49, 78, .2), inset 0 1px 0 #fff;
  overflow: hidden;
}
.global-chat-terms-head, .global-chat-tips-head {
  flex: none; padding: 15px 18px 10px; text-align: center;
  border-bottom: 1px solid var(--line-pink);
}
#globalChatTermsTitle, #globalChatTipsTitle {
  display: block; margin: 0; font-family: var(--font-serif); font-size: 16px; font-weight: 600;
  color: var(--pink-deep); letter-spacing: 4px; line-height: 1.6;
}
.global-chat-terms-sub, .global-chat-tips-sub {
  display: block; margin-top: 1px; font-size: 10px; letter-spacing: 1.5px; color: #a98ba0;
}
.global-chat-terms-body, .global-chat-tips-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; padding: 12px 18px 14px;
  font-size: 12px; line-height: 1.95; color: #7d6675;
}
.global-chat-terms-body p, .global-chat-tips-body p { margin: 0 0 3px; }
.global-chat-terms-lead { color: var(--pink-text); }
.global-chat-terms-h, .global-chat-tips-h {
  margin: 11px 0 2px; font-family: var(--font-serif); font-size: 12.5px; font-weight: 600;
  color: var(--pink-deep); letter-spacing: 1.5px; line-height: 1.6;
}
.global-chat-terms-body strong, .global-chat-tips-body strong { color: var(--pink-text); font-weight: 600; }
.global-chat-terms-foot, .global-chat-tips-foot {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 10px 18px 15px; border-top: 1px solid var(--line-pink);
}
/* 勾选同意行：13px 原生方框 + 文字，用 label 包住让整行都能点。
   ⚠️ 用 accent-color 而不是 appearance:none 手绘 —— 手绘要重造 focus 环和
      disabled 态，还容易漏掉高对比度模式；原生方框加 accent-color 就够好看，
      键盘焦点环、读屏语义全都是浏览器白送的。 */
.global-chat-terms-agree {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; letter-spacing: .8px; line-height: 1.5; color: #8a7080;
  cursor: pointer; user-select: none; -webkit-user-select: none;
}
.global-chat-terms-agree input {
  flex: none; width: 13px; height: 13px; margin: 0;
  accent-color: var(--pink); cursor: pointer;
}
.global-chat-terms-agree:hover { color: var(--pink-deep); }
/* 底部唯一出口。disabled 态就是「还差哪道锁」—— 文案由 chat.js 逐秒改写，
   ⚠️ 别在这里写死文字，也别用 visibility/opacity 假装禁用：:disabled 要让键盘和
      读屏软件都知道这颗钮此刻不能按。 */
.global-chat-terms-ok, .global-chat-tips-ok {
  width: 100%; max-width: 220px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--pink); background: var(--pink); color: #fff;
  font-family: var(--font-sans); font-size: 12.5px; letter-spacing: 2px; cursor: pointer;
  transition: background .18s, border-color .18s;
}
.global-chat-terms-ok:hover:not(:disabled), .global-chat-tips-ok:hover:not(:disabled) { background: var(--pink-deep); border-color: var(--pink-deep); }
.global-chat-terms-ok:disabled {
  background: rgba(224, 122, 168, .26); border-color: rgba(224, 122, 168, .34);
  color: #b98aa5; cursor: default;
}
/* ── 顶部操作区：聊天指南集成小胶囊（聊天须知 + 聊天提示）──
   2026-10-27 移至右上角操作区，与历史对话、重置等功能按钮归拢在一起。
   统一高度 34px，白晶磨砂胶囊质感，内部细分为须知与提示两个点击块。 */
.global-chat-guide-pill {
  display: inline-flex; align-items: center; height: 34px; padding: 2px 3px;
  border-radius: 999px; border: 1px solid var(--line-pink);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(120, 88, 110, .06), inset 0 1px 0 #fff;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.global-chat-guide-pill:hover {
  border-color: rgba(224, 122, 168, .6);
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 4px 14px rgba(224, 122, 168, .16), inset 0 1px 0 #fff;
}
.global-chat-pill-btn {
  display: inline-flex; align-items: center; gap: 4px; height: 28px;
  padding: 0 8px; border-radius: 999px; border: none; background: transparent;
  color: #8c6a83; font-family: var(--font-sans); font-size: 11.5px;
  font-weight: 500; letter-spacing: .5px; cursor: pointer;
  transition: background .18s, color .18s;
}
.global-chat-pill-btn svg {
  flex: none; width: 13px; height: 13px; color: var(--pink-deep);
  transition: transform .18s;
}
.global-chat-pill-btn:hover {
  background: var(--pink-pale); color: var(--pink-deep);
}
.global-chat-pill-btn:hover svg {
  transform: scale(1.1);
}
.global-chat-pill-sep {
  flex: none; width: 1px; height: 14px;
  background: rgba(224, 122, 168, .3); margin: 0 1px;
}
@media (max-width: 480px) {
  .global-chat-panel-head { gap: 6px; }
  .global-chat-head-actions { gap: 4px; }
  .global-chat-close, .global-chat-expand, .global-chat-reset, .global-chat-archive-btn {
    width: 30px; height: 30px;
  }
  .global-chat-close svg, .global-chat-expand svg, .global-chat-reset svg, .global-chat-archive-btn svg {
    width: 15px; height: 15px;
  }
  .global-chat-guide-pill { height: 30px; padding: 2px; }
  .global-chat-pill-btn { height: 26px; padding: 0 6px; font-size: 10.5px; gap: 3px; }
  .global-chat-pill-btn svg { width: 11px; height: 11px; }
}
@media (max-width: 380px) {
  .global-chat-pill-btn span { display: none; }
  .global-chat-pill-btn { padding: 0 6px; }
}
.chat-emoji-tabs {
  flex: none; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(224, 122, 168, .35) transparent;
}
.chat-emoji-tabs::-webkit-scrollbar {
  height: 4px;
}
.chat-emoji-tabs::-webkit-scrollbar-track {
  background: rgba(224, 122, 168, .06);
  border-radius: 999px;
}
.chat-emoji-tabs::-webkit-scrollbar-thumb {
  background: rgba(224, 122, 168, .35);
  border-radius: 999px;
}
.chat-emoji-tabs::-webkit-scrollbar-thumb:hover {
  background: rgba(224, 122, 168, .6);
}
.chat-emoji-tab {
  flex: none; padding: 4px 11px; border: 1px solid var(--line-pink); border-radius: 999px;
  background: rgba(255, 255, 255, .82); color: #a98ba0; font-family: var(--font-sans); font-size: 11px;
  line-height: 1.5; white-space: nowrap; cursor: pointer;
  box-shadow: 0 1px 3px rgba(120, 80, 110, .04);
  transition: background .18s, color .18s, border-color .18s, transform .18s, box-shadow .18s;
}
.chat-emoji-tab:hover {
  border-color: var(--pink); color: var(--pink-deep);
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(224, 122, 168, .15);
}
.chat-emoji-tab.is-on {
  background: linear-gradient(120deg, #fdeaf2, #f2ecfc);
  border-color: var(--pink); color: #6b4a63; font-weight: 500;
  box-shadow: 0 2px 10px rgba(224, 122, 168, .2);
}
/* 卡片式表情格（2026-10-20）：每张 = 图标 + 下方动作名小字。
   比纯悬停 tooltip 直观；未命名口用淡点占位，不留空洞也不编名字。 */
.chat-emoji-grid {
  flex: 1; min-height: 0; overflow-y: auto; align-content: start;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px;
  padding: 2px 4px 2px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(224, 122, 168, .3) transparent;
  animation: chatEmojiGridIn .22s cubic-bezier(.2, .9, .3, 1);
}
.chat-emoji-grid::-webkit-scrollbar {
  width: 4px;
}
.chat-emoji-grid::-webkit-scrollbar-track {
  background: transparent;
}
.chat-emoji-grid::-webkit-scrollbar-thumb {
  background: rgba(224, 122, 168, .3);
  border-radius: 999px;
}
.chat-emoji-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(224, 122, 168, .6);
}
@keyframes chatEmojiGridIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.chat-emoji-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 100%; padding: 5px 4px 4px; cursor: pointer;
  border: 1px solid rgba(214, 176, 205, .4); border-radius: 12px;
  background: linear-gradient(170deg, #fff, #fdf8fb);
  box-shadow: 0 1px 2px rgba(120, 80, 110, .05);
  transition: transform .18s cubic-bezier(.2, .8, .3, 1), border-color .18s,
              box-shadow .18s, background .18s;
}
.chat-emoji-item img {
  display: block; width: 100%; aspect-ratio: 1; object-fit: contain;
}
/* 卡片小字 = **纯动作名**（2026-10-21 01:2x 用户明确：显示侧不出现角色名，
   角色名只用于注入给 AstrBot 的那句话）。单行 nowrap + 省略号；
   481 个动作名里 478 个 ≤4 字，只有「满是世俗的欲望」这类极长标题才会被省略号收尾。
   ⚠️ 别再往这里塞角色名行 —— 用户已经强调过两次。 */
.chat-emoji-cap {
  display: block; width: 100%; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
  text-align: center; font-family: var(--font-serif); font-size: 9.5px; line-height: 1.5;
  letter-spacing: .3px; color: #a98ba0; transition: color .18s;
}
.chat-emoji-cap.is-none { color: #cdb9c8; }
.chat-emoji-item:hover {
  background: #fff; border-color: var(--pink); transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(224, 122, 168, .22);
}
.chat-emoji-item:hover .chat-emoji-cap { color: var(--pink-deep); }
.chat-emoji-item:active { transform: translateY(0) scale(.96); }
.chat-emoji-item:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.chat-emoji-empty { grid-column: 1 / -1; padding: 20px 0; text-align: center; font-size: 11px; color: #b49cb0; }
/* 矮屏（笔记本横屏等）把弹层压一压，免得顶穿面板 */
@media (max-height: 640px) { .chat-emoji-pop { max-height: 220px; } }
.global-chat-send {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  background: linear-gradient(130deg, var(--pink), var(--violet));
  box-shadow: 0 3px 12px rgba(160, 90, 140, .3); transition: transform .18s, opacity .18s;
}
.global-chat-send:hover { transform: scale(1.05); }
.global-chat-send:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ── 分档适配 ──────────────────────────────────────────
   上界 1180：整体收窄，文字保留（两行文案最短约 70px，158px 装得下）
   760：收成圆钮（此时导航已退成汉堡，左上留白更紧，文字胶囊会显笨重）
   420：再缩一圈，给超窄屏留出内容
   ⚠️ 每档都要同步改 scaleX：分母是面板宽、分子是胶囊宽，
      不改的话收起态会从一个和胶囊不一样大的形状开始长。 */
@media (max-width: 1180px) {
  .global-chat-dock { width: 186px; --chat-full-w: 186px; }
  /* 别让面板顶到右侧：扣掉音乐胶囊那侧的空间 */
  .global-chat-panel { width: min(480px, calc(100vw - 200px)); transform: translateY(-8px) scale(.3875, .08); }
}
@media (max-width: 760px) {
  /* ⚠️ 这一档必须和音乐胶囊 `.is-compact` **逐像素同规格**：圆钮 52 / 图 46 / 白边 3px。
     2026-10-21 用户连着三次截图的根因就在这 —— `.is-compact` 改成 46 时忘了同步这里，
     ≤760px 走的是媒体查询而不是 JS 降级，头像还是基类的 36px，白边厚达 6px
     （音乐那边只有 3px），于是「白框比音乐胶囊多 / 还是那么宽 / 两个圆不一样大」。 */
  .global-chat-dock { top: 19px; width: 52px; }
  .global-chat-toggle {
    padding: 0; justify-content: center; min-height: 52px; border-radius: 50%;
  }
  .global-chat-copy, .global-chat-dot, .global-chat-sep { display: none; }
  .global-chat-toggle:hover, .global-chat-dock.is-open .global-chat-toggle { transform: none; }
  .global-chat-mark { width: 46px; height: 46px; }
  .global-chat-mark::after { display: none; }
  /* 顶 19 + 圆钮 52 + 间距 12 + 底留 14 = 97 */
  .global-chat-panel {
    width: calc(100vw - 56px);
    /* 手机上高度放开到 680：本来就只有这一块面板，不必再留桌面那种"贴角小窗"的余量 */
    height: min(680px, calc(100dvh - 97px));
    max-height: calc(100vh - 97px); max-height: calc(100dvh - 97px);
    /* 圆钮 52 宽 / 面板 (100vw-56) 宽，760 视口下 ≈ 52/704；scaleY 让起始高 ≈ 680×.055 = 37 < 52 */
    transform: translateY(-6px) scale(.074, .055);
  }
}
@media (max-width: 420px) {
  .global-chat-dock { top: 21px; width: 44px; }
  .global-chat-toggle { min-height: 44px; }
  /* 同上：44px 圆钮配 42px 头像，只留 1px 白边（原来是 32px / 6px 边） */
  .global-chat-mark { width: 42px; height: 42px; }
  /* 圆钮 44 / 面板 (100vw-44)≈376 @420 视口 */
  .global-chat-panel { width: calc(100vw - 44px); transform: translateY(-6px) scale(.12, .055); }
  /* ⚠️ 这里**不要**再给 .chat-msg-img.is-emoji 写覆盖值（2026-10-25 删掉过一版 116px）：
     上面的 clamp(72px, 24vw, 108px) 已经随视口连续缩放，420 视口算出 ~101、360 ~86、320 ~77。
     再写死 116 反而比 clamp 更大，正好把「小窗要更小」抵消掉。 */
}
/* ── JS 降级：与导航条同一行后，中等视口下导航左缘会压到胶囊上 ──
   由 chat.js 的 syncChatSlot() 实测重叠后加 .is-compact。
   ⚠️ 判据必须用「假设完整宽度 204」而不是当前宽度：否则降级成圆钮后
      hit 变 false、class 被移除、又变宽 → 无限抖动。 */
/* ⚠️ 52 这个数跟着音乐胶囊 `.is-compact` 的圆钮走，两处必须一致（改一个就要改另一个），
   图 46 + 3px 白边 = 52，和音乐那颗逐像素同规格。 */
.global-chat-dock.is-compact { width: 52px; }
/* 圆钮 52 高时重新算中心：导航中心 ≈ 45.9，22+26=48 —— 与 ≤760px 那档的 19+26=45 同一算法 */
.global-chat-dock.is-compact { top: 22px; }
.global-chat-dock.is-compact .global-chat-copy,
.global-chat-dock.is-compact .global-chat-sep,
.global-chat-dock.is-compact .global-chat-dot { display: none; }
.global-chat-dock.is-compact .global-chat-toggle {
  padding: 0; justify-content: center; min-height: 52px; border-radius: 50%;
}
/* 2026-10-21 用户要求「白框相较于音乐胶囊太多了 / 两个圆大小一样吗」：
   圆钮态下把头像做成 **46px**（= 音乐胶囊 `.is-compact .global-music-disc` 的 46px，
   两处数字必须一致，改一个就要改另一个），按钮 **52** ⇒ 白边 3px，和音乐那颗一模一样。
   同时**关掉呼吸光环**：`::after` 会 scale 到 1.16（46→53px），比按钮还大，
   在圆钮态看起来就是外圈多出一道粉环 —— 那正是用户说的"宽"。
   ⚠️⚠️ 只改 `.is-compact` 是**不够的**：≤760px 走的是媒体查询（JS 那时会主动摘掉
   is-compact），2026-10-21 就因此漏改，媒体查询里头像还是基类 36px、白边厚 6px。
   ⇒ 改圆钮尺寸必须同时改 `.is-compact` 与 `@media (max-width:760px)` 两处。 */
.global-chat-dock.is-compact .global-chat-mark { width: 46px; height: 46px; }
.global-chat-dock.is-compact .global-chat-mark::after { display: none; }
.global-chat-dock.is-compact .global-chat-toggle:hover,
.global-chat-dock.is-compact.is-open .global-chat-toggle { transform: none; }
/* 圆钮宽 52 / 面板 ≤480 → .108；面板也相应收窄，别越过导航右缘。
   scaleY 取 .075（620×.075 ≈ 46.5）—— 圆钮 52 高，起始高必须压在它下面。 */
.global-chat-dock.is-compact .global-chat-panel {
  width: min(480px, calc(100vw - 94px));
  transform: translateY(-6px) scale(.108, .075);
}
/* ⚠️⚠️ 展开态必须显式盖回 transform:none（2026-10-15 实测发现，**既有 bug**）：
   上面这条 `.global-chat-dock.is-compact .global-chat-panel` 与
   `.global-chat-dock.is-open .global-chat-panel` 都是 3 个 class、**特异性相同**，
   而它写在后面 ⇒ 后者被盖掉。结果：中等视口（≈761~1130px，此时 syncChatSlot()
   会加 .is-compact）一展开，面板仍被 scale(.125,.11) 压成 **48×41 的小条**，
   输入框完全看不见。（≤760px 时 JS 会摘掉 is-compact，所以那一档反而是好的。）
   多一个 class 提高特异性即可，不能靠挪顺序 —— 顺序容易在后续改动里被破坏。 */
.global-chat-dock.is-compact.is-open .global-chat-panel { transform: none; }

/* ═══════════════ 全屏对话（2026-10-15 新增）═══════════════
   由头部的「全屏」按钮切换，`.is-full` 与 `.is-open` 挂在同一个 dock 上。
   三件事必须同时做，少一件就不像全屏：
     ① 面板 `position: fixed; inset: 0` —— 用户选的是「铺满整个视口」，
        包括顶端那条导航条，所以它必须真的盖住导航；
     ② dock 的 z-index 抬到 260 —— 导航 200 / 音乐胶囊 190 都在它之下，
        而灯箱是 300、仍在它之上（全屏时点不到图片，但顺序不能反）；
     ③ `html.chat-full` 锁滚动 —— 否则在面板空白处滚滚轮会把底下的整页滚走，
        退出全屏时页面位置就变了。
   ⚠️ 这几条**必须写在 `.is-compact` 系列之后**：`.is-compact .global-chat-panel`
      与 `.is-full .global-chat-panel` 都是 3 个 class、特异性完全相同，靠源码顺序决胜；
      而且 ≤1180/≤760/≤420 三个媒体查询里的 `.global-chat-panel` 只有 1 个 class，
      特异性低，不会来抢。这里统一再加 `.is-open` 凑到 4 个 class，
      同时压过同样 4 class 的 `.is-compact.is-open .global-chat-panel`。 */
.global-chat-dock.is-full { z-index: 260; }
/* 锁滚动加在 html 上而不是 body：视口滚动条由根元素决定，
   只写 body 在部分浏览器里拦不住（lightbox 用的是 body，那条是历史写法）。
   面板铺满整屏，内容位移被完全遮住，所以不必担心滚动条消失引起的横向抖动。 */
html.chat-full, html.chat-full body { overflow: hidden; }
.global-chat-dock.is-full.is-open .global-chat-panel {
  position: fixed; inset: 0;
  /* ⚠️ width/height 用 auto 而不是 100%：inset:0 已把四边钉死，
     再写 100% 会在有滚动条时溢出。max-* 必须显式 none，否则被上面几条压住。 */
  width: auto; height: auto; max-width: none; max-height: none;
  padding: clamp(14px, 2.2vh, 26px) clamp(14px, 3.4vw, 46px) clamp(12px, 1.8vh, 20px);
  border: 0; border-radius: 0;
  transform: none;
}
/* 全屏时把内容收进一条 880px 的居中阅读栏 ——
   否则 1600px 宽的窗口里气泡会一路拉到 86% 宽，一行几十个字没法读。 */
.global-chat-dock.is-full.is-open .global-chat-panel-head,
.global-chat-dock.is-full.is-open .global-chat-log,
.global-chat-dock.is-full.is-open .global-chat-form {
  width: 100%; max-width: 880px; margin-inline: auto;
}
/* 正常态那条 min-height:160px 是给"高度随内容浮"兜底的；全屏时高度已经钉死，得放开，
   不然 flex:1 的分配会被它顶住。 */
.global-chat-dock.is-full.is-open .global-chat-log { min-height: 0; }
.global-chat-dock.is-full.is-open .global-chat-input { max-height: 32vh; }
/* 进/退全屏各给一次轻微淡入。
   ⚠️ 不能用 transition 做：`position` 从 absolute 变 fixed 时包含块整个换了，
      任何插值都会跳；而且两个状态的 transform 都是 none，本来也没得插。
      改用一次性 keyframe —— JS 加 `.is-full-anim`、400ms 后摘掉，两个方向共用，
      启动瞬间都从"略小 + 半透明"柔到本位，够用了。 */
.global-chat-dock.is-full-anim .global-chat-panel {
  animation: chatFullIn .34s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes chatFullIn { from { opacity: .35; transform: scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .global-chat-toggle, .global-chat-toggle:hover, .global-chat-dock.is-open .global-chat-toggle { transform: none; }
  .global-chat-panel, .global-chat-dock.is-open .global-chat-panel { transform: none; }
  .global-chat-panel-head, .global-chat-log, .global-chat-form,
  .global-chat-dock.is-open .global-chat-panel-head,
  .global-chat-dock.is-open .global-chat-log,
  .global-chat-dock.is-open .global-chat-form { opacity: 1; transform: none; transition: none; }
  .global-chat-mark::after, .global-chat-dot, .chat-dots i { animation: none; }
  /* 全屏切换的淡入是一次性 keyframe，不受上面那条 transition-duration 兜底影响，得单独关 */
  .global-chat-dock.is-full-anim .global-chat-panel { animation: none; }
  .global-chat-dock.is-busy .global-chat-dot { background: var(--pink); }
}

/* ═══════════════ 账号面板（2026-10-29）═══════════════ */
/* 入口在导航胶囊右端。匿名态只有「登录」两个字，登录后变成头像点 + 昵称。
   视觉上刻意和 .nav-links 的胶囊区分：链接是导航，这个是动作。
   左右 padding 对称：没有头像点时文字要真正居中，不能留出看不见的空位。 */
.nav-account {
  display: flex; align-items: center; gap: 7px; flex: none;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line-pink);
  background: rgba(255, 255, 255, .72);
  color: var(--pink-text);
  font-family: var(--font-sans); font-size: 13px; letter-spacing: 1px;
  cursor: pointer; white-space: nowrap;
  transition: color .25s, background .25s, border-color .25s, box-shadow .25s;
}
.nav-account:hover {
  color: var(--pink-deep); background: var(--pink-pale);
  border-color: rgba(224, 122, 168, .45);
  box-shadow: 0 4px 14px rgba(224, 122, 168, .18);
}
.nav-account:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
/* 头像点只在登录后出现；匿名态整块不渲染，所以「登录」前面不会多一颗星 */
.nav-account-mark {
  display: none; place-items: center; flex: none;
  /* 2026-10-31 用户「这个区域的头像有些小」：20 → 26。胶囊高度会跟着涨 6px（34→40），
     .nav 是 flex + padding 撑开的，没有写死高度，所以不会顶坏布局。 */
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-mist), var(--violet-pale));
  color: var(--pink-deep); font-size: 14px; line-height: 1;
  transition: background .25s, color .25s;
}
.nav-account-text { max-width: 8em; overflow: hidden; text-overflow: ellipsis; }
/* 已登录：改成星金调，和「如我所书」的书页气质对上 */
.nav-account.is-in {
  padding-left: 11px;
  border-color: var(--line-warm); background: rgba(253, 244, 222, .78); color: var(--gold-text);
}
.nav-account.is-in:hover { background: var(--gold-pale); border-color: rgba(217, 169, 74, .5); }
.nav-account.is-in .nav-account-mark {
  display: grid;
  background: linear-gradient(135deg, var(--pink), var(--violet)); color: #fff;
}

/* ── 遮罩与卡片 ── */
.account-modal {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.account-modal[hidden] { display: none !important; }
.account-backdrop {
  position: absolute; inset: 0;
  background: rgba(70, 58, 82, .30);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .28s ease;
}
.account-modal.is-open .account-backdrop { opacity: 1; }

.account-card {
  position: relative; width: min(418px, 100%);
  max-height: min(88vh, 760px); overflow-y: auto; overscroll-behavior: contain;
  padding: 30px 30px 26px; border-radius: 24px;
  background: linear-gradient(165deg, #fffdfe 0%, #fdf8fb 52%, #faf6ff 100%);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 30px 70px rgba(90, 60, 90, .24), 0 0 0 1px rgba(224, 122, 168, .12);
  opacity: 0; transform: translateY(12px) scale(.985);
  transition: opacity .3s cubic-bezier(.22, 1, .36, 1), transform .3s cubic-bezier(.22, 1, .36, 1);
}
.account-modal.is-open .account-card { opacity: 1; transform: none; }

.account-close {
  position: absolute; top: 12px; right: 12px;
  display: grid; place-items: center; width: 32px; height: 32px;
  border: none; border-radius: 50%; background: transparent;
  color: var(--ink-faint); font-size: 13px; cursor: pointer;
  transition: background .25s, color .25s;
}
.account-close:hover { background: var(--pink-pale); color: var(--pink-deep); }

/* ── 抬头 ── */
.account-head { text-align: center; margin-bottom: 22px; padding: 0 6px; }
.account-kicker {
  font-size: 10.5px; letter-spacing: .34em; text-indent: .34em;
  color: var(--gold-text);
}
.account-title {
  margin-top: 6px;
  font-family: var(--font-serif); font-size: 24px; font-weight: 600;
  letter-spacing: 3px; color: var(--ink);
}
.account-sub { margin-top: 6px; font-size: 12.5px; line-height: 1.6; color: var(--ink-faint); }

/* ── 表单 ── */
.account-form { display: flex; flex-direction: column; gap: 13px; }
/* ⚠️ 必须兜住：.account-form 的 display:flex 会盖掉 hidden 属性 */
.account-form[hidden], .account-pw-form[hidden], .account-nick-form[hidden],
.account-email-form[hidden] { display: none !important; }

.account-field { display: flex; flex-direction: column; gap: 6px; }
.account-label { font-size: 12.5px; letter-spacing: .5px; color: var(--ink-soft); }
.account-optional { font-size: 11.5px; color: var(--ink-faint); }

.account-input {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--line-pink); background: rgba(255, 255, 255, .92);
  color: var(--ink); font-family: var(--font-sans); font-size: 14px; line-height: 1.5;
  transition: border-color .22s, box-shadow .22s, background .22s;
}
.account-input::placeholder { color: var(--ink-faint); opacity: .85; }
.account-input:focus {
  outline: none; border-color: var(--pink); background: #fff;
  box-shadow: 0 0 0 3px rgba(224, 122, 168, .14);
}
/* 两次密码不一致时给确认框描红，和底部那条提示互相呼应 */
.account-input.is-invalid {
  border-color: rgba(189, 79, 86, .55);
  background: rgba(189, 79, 86, .05);
}
.account-input.is-invalid:focus {
  border-color: rgba(189, 79, 86, .75);
  box-shadow: 0 0 0 3px rgba(189, 79, 86, .12);
}

.account-code-row { display: flex; align-items: stretch; gap: 8px; }
.account-code-row .account-input { flex: 1; min-width: 0; }
.account-code-btn {
  flex: none; padding: 0 13px; border-radius: 12px;
  border: 1px solid var(--line-pink); background: var(--pink-pale);
  color: var(--pink-text); font-family: var(--font-sans); font-size: 12.5px;
  letter-spacing: .5px; white-space: nowrap; cursor: pointer;
  transition: background .22s, color .22s, opacity .22s;
}
.account-code-btn:hover:not(:disabled) { background: var(--pink-mist); color: var(--pink-deep); }
.account-code-btn:disabled { opacity: .6; cursor: default; }

/* 错误 / 成功共用一条：空着时整行收起，不占位 */
.account-error { font-size: 12.5px; line-height: 1.6; color: #bd4f56; }
.account-error:empty { display: none; }
.account-error.is-ok { color: var(--gold-text); }

/* 人机验证（2026-11-11）：Turnstile 自己排 iframe，这里只负责留位。
   `:empty` 兜住「后端没配 Site Key、脚本还没渲染」的空档，别留一条白缝。 */
.account-captcha { margin: 2px 0 6px; }
.account-captcha[hidden] { display: none; }
.account-captcha:empty { display: none; }
.account-captcha.is-failed {
  padding: 8px 10px; border-radius: 10px;
  border: 1px dashed rgba(189, 79, 86, .3); background: rgba(189, 79, 86, .05);
  color: #a63f46; font-size: 12px; line-height: 1.5;
}
.account-captcha iframe { max-width: 100%; }

.account-submit {
  width: 100%; padding: 12px 18px; border: none; border-radius: 999px;
  background: linear-gradient(135deg, #eea8c9 0%, #e9b0d3 62%, #d6b0e6 100%);
  color: #fff; font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  letter-spacing: 3px; text-indent: 3px; cursor: pointer;
  box-shadow: 0 8px 22px rgba(205, 150, 200, .34), inset 0 1px 0 rgba(255, 255, 255, .42);
  transition: transform .2s, box-shadow .25s, opacity .2s;
}
.account-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(205, 150, 200, .42), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.account-submit:active:not(:disabled) { transform: translateY(0); }
.account-submit:disabled { opacity: .62; cursor: default; }

.account-links {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 6px 12px; margin-top: 2px;
}
.account-link {
  padding: 0; border: none; border-bottom: 1px solid transparent; background: none;
  color: var(--pink-text); font-family: var(--font-sans); font-size: 12.5px;
  letter-spacing: .5px; cursor: pointer;
  transition: color .2s, border-color .2s;
}
.account-link:hover { color: var(--pink-deep); border-bottom-color: rgba(194, 86, 138, .4); }

/* ── 我的账号 ── */
.account-identity {
  display: flex; align-items: center; gap: 13px;
  padding: 14px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(253, 238, 244, .92), rgba(246, 243, 252, .92));
  border: 1px solid var(--line-pink);
}
.account-avatar {
  flex: none; display: grid; place-items: center;
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: #fff; font-family: var(--font-serif); font-size: 24px;
  box-shadow: 0 6px 16px rgba(205, 150, 200, .36);
  overflow: hidden;
}
/* 选了头像之后里面是 <img>，撑满整个圆 */
.account-avatar img,
.nav-account-mark img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%; display: block;
}
/* 有图时把渐变底让出来，只留图本身（:has 不支持的浏览器会保留渐变，也不难看） */
.account-avatar:has(img),
.nav-account.is-in .nav-account-mark:has(img) {
  background: transparent;
  box-shadow: none;
}
.account-identity-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-name {
  font-family: var(--font-serif); font-size: 16px; letter-spacing: 1px;
  color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-email { font-size: 12px; color: var(--ink-faint); overflow-wrap: anywhere; }

/* ── 头像选择面板 ── */
.account-avatar-picker {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--line-pink);
}
.account-avatar-picker[hidden] { display: none !important; }
.account-avatar-picker-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
/* 2026-10-31 用户要求去掉分类标签和搜索框，这两组样式（.account-avatar-tabs /
   .account-avatar-tab / .account-avatar-search）连同 DOM 与 JS 筛选逻辑一起删除。 */
.account-avatar-grid {
  display: grid;
  /* 2026-10-31 用户「把左右滑动去了，只保留上下滑动」：
     原来写死 repeat(6, 1fr)，但每格要 48 图 + 8 内边距 + 2 边框 = 58px，
     容器只够 47px/列 ⇒ 横向溢出出滚动条。改成按容器宽度自动定列数，
     每列至少 56px（够放 48 头像），永远不会横向溢出。 */
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 6px;
  max-height: 266px;
  overflow-x: hidden;          /* 只留上下滑；auto 会让它默认横向也能滚 */
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px; border-radius: 12px;
  scrollbar-width: thin;
}
.account-avatar-item {
  /* 只有图、没有名字（2026-10-31）：内边距收成均等的 4px，
     不再为文字预留底部空间，格子也比带名字时矮一截。 */
  padding: 4px; border: 1px solid transparent; border-radius: 12px;
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  /* 允许收缩，否则 48px 的图会把格子撑破列宽（横向滚动的元凶） */
  min-width: 0;
  transition: background .18s, border-color .18s;
}
.account-avatar-item:hover { background: var(--pink-mist); }
.account-avatar-item.is-picked {
  border-color: var(--pink);
  background: rgba(217, 140, 196, .12);
}
.account-avatar-item img {
  /* 跟着格子宽度走（列宽可能小于 48），上限仍是 48；aspect-ratio 保证是正圆 */
  width: 100%; height: auto; aspect-ratio: 1; max-width: 48px;
  border-radius: 50%; display: block;
  background: linear-gradient(135deg, var(--pink-mist), var(--violet-pale));
}
.account-avatar-empty {
  margin: 18px 0; text-align: center; font-size: 12px; color: var(--ink-faint);
}
.account-avatar-actions {
  display: flex; align-items: center; gap: 12px; margin-top: 12px;
}
.account-avatar-actions .account-submit { flex: 1; }
/* 2026-10-31：列数改由 auto-fill 按容器宽度自己算，窄屏不再需要单独覆盖成 4 列。 */

.account-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 13px 0 4px; }
.account-meta > div {
  padding: 9px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .7);
}
.account-meta dt { font-size: 11px; letter-spacing: .5px; color: var(--ink-faint); }
.account-meta dd { margin: 0; font-size: 13px; color: var(--ink); }
/* UID 单独占一行：它比「加入于」长，挤在半栏里会被截断 */
.account-meta > .account-meta-wide { grid-column: 1 / -1; }
.account-meta-wide dd { font-family: var(--font-mono); letter-spacing: .5px; }

.account-actions { display: grid; gap: 8px; margin-top: 12px; }
.account-action {
  padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line-pink); background: rgba(255, 255, 255, .8);
  color: var(--ink-soft); font-family: var(--font-sans); font-size: 13px;
  letter-spacing: .5px; cursor: pointer;
  transition: border-color .22s, color .22s, background .22s;
}
.account-action:hover:not(:disabled) {
  border-color: var(--pink); color: var(--pink-deep); background: var(--pink-pale);
}
.account-action:disabled { opacity: .6; cursor: default; }
.account-action.is-danger { color: #bd4f56; border-color: rgba(189, 79, 86, .28); }
.account-action.is-danger:hover:not(:disabled) {
  background: rgba(189, 79, 86, .07);
  border-color: rgba(189, 79, 86, .5); color: #a63f46;
}
/* 「登出所有设备」的两步确认态 */
.account-action.is-confirming {
  background: rgba(189, 79, 86, .1);
  border-color: rgba(189, 79, 86, .55); color: #a63f46;
}

/* ── 账号管理（仅管理员，2026-10-31）──
   列表用 flex 竖排 + 固定高度滚动；行内三栏：头像 / 文案 / 操作。
   操作按钮比主按钮小一号，删除与封禁走红色系，两步确认态复用 .is-confirming 的观感。 */
.account-action.is-admin {
  color: var(--pink-deep);
  border-color: rgba(194, 86, 138, .38);
  background: linear-gradient(135deg, rgba(253, 238, 244, .95), rgba(246, 243, 252, .95));
}
.account-action.is-admin:hover:not(:disabled) {
  border-color: var(--pink); background: var(--pink-pale);
}

.account-admin-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.account-admin-bar .account-input { flex: 1; min-width: 0; }
.account-select {
  flex: none; height: 38px; padding: 0 8px; border-radius: 10px;
  border: 1px solid var(--line-pink); background: #fff;
  color: var(--ink-soft); font-family: var(--font-sans); font-size: 12.5px;
  cursor: pointer;
}

.account-admin-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 320px;
  overflow-x: hidden;           /* 只留上下滑，和头像网格同一个坑 */
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.account-admin-row {
  /* 账号卡片本身只有 ~350px 宽，放不下「头像 + 名字 + 一排按钮」三列：
     试过三列，中间那列只剩 70px，名字被挤成「折…」。所以固定两行——
     第一行头像 + 文案，按钮整排落到第二行，任何宽度都这么排。 */
  display: grid; grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px 10px; align-items: center;
  padding: 9px 10px; border-radius: 13px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .78);
}
.account-admin-row.is-banned {
  background: rgba(189, 79, 86, .05); border-color: rgba(189, 79, 86, .22);
}
.account-admin-mark {
  flex: none; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, var(--pink-mist), var(--violet-pale));
  color: var(--pink-deep); font-family: var(--font-serif); font-size: 14px;
}
.account-admin-mark:has(img) { background: none; }
.account-admin-mark img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block;
}
.account-admin-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.account-admin-name {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  font-family: var(--font-serif); font-size: 13.5px; color: var(--ink);
}
.account-admin-name > span:first-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-admin-badge {
  flex: none; padding: 1px 6px; border-radius: 999px;
  font-family: var(--font-sans); font-size: 10px; letter-spacing: .5px;
  background: rgba(194, 86, 138, .12); color: var(--pink-deep);
}
.account-admin-badge.is-banned { background: rgba(189, 79, 86, .12); color: #a63f46; }
.account-admin-meta {
  font-size: 11px; color: var(--ink-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-admin-acts {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-start;
}
/* 封禁时长选择条（2026-11-11）：点「封禁」后在原位展开，问一句封多久。
   用 .is-open 而不是 [hidden] —— 这里自带 display，hidden 会被压掉。 */
.account-admin-dur {
  grid-column: 1 / -1;
  display: none; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 6px; border-radius: 10px;
  background: rgba(189, 79, 86, .05);
  border: 1px dashed rgba(189, 79, 86, .28);
}
.account-admin-dur.is-open { display: flex; }
/* 自定义天数（2026-11-11 晚）：点「自定义」把预设那排换成输入框。
   输入框不是 button，尺寸和焦点环得单独给一套。
   「封多久」这个提示**保留**——有它在，输入框里就不用再写占位文字。 */
.account-admin-dur-custom { display: none; align-items: center; gap: 4px; }
.account-admin-dur.is-custom > [data-ban-days],
.account-admin-dur.is-custom > [data-ban-hours],
.account-admin-dur.is-custom > [data-ban-custom] { display: none; }
.account-admin-dur.is-custom > .account-admin-dur-custom { display: inline-flex; }
.account-admin-dur-input {
  width: 78px; height: 26px; padding: 0 7px; border-radius: 8px;
  border: 1px solid rgba(189, 79, 86, .35); background: #fff;
  color: var(--ink); font-family: var(--font-sans); font-size: 12px;
  text-align: center;
  appearance: textfield; -moz-appearance: textfield;
}
.account-admin-dur-input::-webkit-inner-spin-button,
.account-admin-dur-input::-webkit-outer-spin-button {
  -webkit-appearance: none; margin: 0;
}
.account-admin-dur-input:focus {
  outline: none; border-color: #bd4f56;
  box-shadow: 0 0 0 2px rgba(189, 79, 86, .12);
}
/* 单位下拉（天 / 小时）。原来是个 span，2026-11-11 晚改成 select，
   尺寸得跟旁边的输入框、按钮对齐在一条线上。 */
.account-admin-dur-unit {
  height: 26px; padding: 0 2px; border-radius: 8px;
  border: 1px solid rgba(189, 79, 86, .35); background: #fff;
  color: #a63f46; font-family: var(--font-sans); font-size: 11px;
  cursor: pointer;
}
/* 预设多了一档「1 小时」，按钮间距压一压，尽量还排在一行里 */
.account-admin-dur { gap: 3px; }
.account-admin-dur button { padding: 4px 7px; }
/* 「取消」退成纯文字：多一档之后带边框就排不下第二行了，
   而且它本来就是「退出」，弱化一级反而更好认。 */
.account-admin-dur .account-admin-dur-cancel {
  border-color: transparent; background: none; color: var(--ink-faint);
  padding-left: 3px; padding-right: 3px;
}
.account-admin-dur .account-admin-dur-cancel:hover:not(:disabled) {
  background: none; border-color: transparent; color: var(--ink-soft);
}
.account-admin-dur-tip {
  margin-right: 2px; font-family: var(--font-sans);
  font-size: 11px; color: #a63f46;
}
.account-admin-acts button,
.account-admin-dur button {
  padding: 4px 8px; border-radius: 9px; white-space: nowrap;
  border: 1px solid var(--line-pink); background: rgba(255, 255, 255, .9);
  color: var(--ink-soft); font-family: var(--font-sans); font-size: 11px;
  letter-spacing: .3px; cursor: pointer;
  transition: border-color .18s, color .18s, background .18s;
}
.account-admin-acts button:hover:not(:disabled),
.account-admin-dur button:hover:not(:disabled) {
  border-color: var(--pink); color: var(--pink-deep); background: var(--pink-pale);
}
.account-admin-acts button:disabled,
.account-admin-dur button:disabled { opacity: .45; cursor: default; }
.account-admin-acts button.is-danger,
.account-admin-dur button.is-danger { color: #bd4f56; border-color: rgba(189, 79, 86, .28); }
.account-admin-acts button.is-danger:hover:not(:disabled),
.account-admin-dur button.is-danger:hover:not(:disabled) {
  background: rgba(189, 79, 86, .08); border-color: rgba(189, 79, 86, .5); color: #a63f46;
}
.account-admin-acts button.is-confirming,
.account-admin-dur button.is-confirming {
  background: rgba(189, 79, 86, .12);
  border-color: rgba(189, 79, 86, .55); color: #a63f46;
}
.account-admin-empty {
  margin: 22px 0; text-align: center; font-size: 12px; color: var(--ink-faint);
}
.account-admin-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 9px;
}
.account-admin-count { font-size: 11.5px; color: var(--ink-faint); }
.account-admin-actions {
  display: flex; gap: 14px; margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--line-pink);
}

.account-pw-form,
.account-nick-form,
.account-email-form {
  display: flex; flex-direction: column; gap: 11px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--line-pink);
}
.account-pw-actions,
.account-nick-actions { display: flex; align-items: center; gap: 12px; }
.account-pw-actions .account-submit,
.account-nick-actions .account-submit { flex: 1; }

/* 打开时锁住背后的滚动。
   ⚠️ 这条必须挂在 <html> 上，不能挂 <body>：html 的 overflow-x 是 clip（非 visible），
      <body> 的 overflow 就不会传播到视口，写在 body 上等于没写 —— 背后照样能滚。
      宽度 thanks to scrollbar-gutter: stable，开关前后 clientWidth 恒定，不用补白。 */
html.account-open { overflow: hidden; }

@media (max-width: 520px) {
  .account-modal { padding: 12px; align-items: flex-end; }
  .account-card { width: 100%; max-height: 90vh; padding: 26px 20px 22px; border-radius: 22px; }
  .account-title { font-size: 21px; }
  .account-head { margin-bottom: 18px; }
}
@media (max-width: 380px) {
  .nav-account { padding: 7px 11px; font-size: 12px; }
  .nav-account.is-in { padding-left: 9px; }
  .nav-account-text { max-width: 5.5em; }
}
@media (max-height: 700px) {
  .account-card { max-height: 92vh; }
}
@media (prefers-reduced-motion: reduce) {
  .account-backdrop, .account-card, .account-action, .account-submit,
  .account-input, .nav-account, .account-close, .account-code-btn, .account-link { transition: none; }
}

/* ── 账号入口带来的导航挤压（2026-10-29）──
   加了账号按钮之后，861–1000px 这段（链接仍横排、汉堡还没出来）总宽超出胶囊：
   实测 861px 时按钮溢出胶囊右缘 26px，900px 时把站名压成两行、胶囊高度 72→144px。
   这里只收横向留白，不动字号层级；>1000px 的桌面尺寸完全不受影响。
   ⚠️ .nav-logo 必须 flex:none + 不换行，否则它会被优先压缩（flex-shrink 默认 1）。 */
.nav-logo { flex: none; }
.nav-logo span { white-space: nowrap; }

@media (min-width: 861px) and (max-width: 1000px) {
  .nav { gap: 16px; padding: 8px 10px 8px 14px; }
  .nav-links a { padding: 9px 12px; font-size: 13px; letter-spacing: .5px; }
}

@media (max-width: 380px) {
  .nav { gap: 10px; padding: 8px 8px 8px 14px; }
}
