/* =========================================================
 * MoFlow 墨流 —— 三段式编辑部
 * 布局参考 blog.roysgensokyo.space（左图标条 / 中栏 / 右栏，留白分条）
 * 动画参考 blogs.mtcacg.top（首屏双层幕布、标题区错峰浮现）
 * 换页 wipe 参考 finnblog（@property + mask）
 * ========================================================= */

/* ---------- Token：浅色奶油（默认，data-scheme 会覆盖） ---------- */
:root {
  /* 桌面（页面底）比纸面深一档，再用静态暖光 + 纸纹噪点避免死平色 */
  --bg-desk: #f0e9de;
  --bg: #faf7f0;
  /* 页脚渐变末端：浅色主题往深走（暖米色），深色主题往浅走（2.8.10） */
  --foot-end: #e6d8c0;
  --bg-soft: #f1ebe1;
  --bg-elev: #fffdf8;
  --bg-blur: rgba(250, 247, 240, .91);
  --desk-glow-1: rgba(214, 197, 175, .42);
  --desk-glow-2: rgba(255, 255, 255, .5);
  --desk-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.032'/%3E%3C/svg%3E");
  --fg: #1c1916;
  --fg-2: #5f584d;
  --fg-3: #655c50;
  --prose: #322c26;
  --hover-wash: rgba(107, 79, 48, .055);
  --shadow-bar: 0 10px 24px -20px rgba(54, 41, 29, .45);
  --line: rgba(28, 25, 22, .12);
  --line-2: rgba(28, 25, 22, .22);
  --line-ui: #91887b;
  --line-soft: rgba(28, 25, 22, .075);
  --accent: #c8422c;
  --accent-hi: #a83220;
  --accent-soft: rgba(200, 66, 44, .1);
  --accent-ink: #fff8f4;
  --shadow-card: 0 1px 2px rgba(28, 25, 22, .05), 0 10px 28px -14px rgba(28, 25, 22, .18);
  --shadow-pop: 0 18px 50px -12px rgba(28, 25, 22, .3);

  --font-serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", "SimSun", Georgia, serif;
  --font-sans: "Noto Sans SC", -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, Consolas, "Courier New", "Noto Sans SC", "PingFang SC", "Microsoft YaHei UI", monospace;

  /* 5 档收敛字号阶梯（12 / 14 / 16 / 20 / 22-26） */
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-lg: 20px;
  --fs-xl: clamp(22px, 1.8vw, 26px);

  --rail-w: 80px;
  --side-w: 25%;
  --container: 1160px;
  --gutter: clamp(14px, 1.6vw, 22px);
  --main-inset: clamp(20px, 2.4vw, 32px);
  --topbar-h: 62px;
  --radius: 8px;
  --radius-lg: 14px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: 140ms ease;
  --t-med: .3s ease;

  color-scheme: light;
}

/* ---------- Token：深色编辑部（默认主题） ---------- */
[data-scheme="dark"] {
  --bg-desk: #0b0a08;
  --bg: #151310;
  /* 页脚渐变末端：深色主题比纸面亮一档（暖光），浅色主题见上（2.8.10） */
  --foot-end: #2c251d;
  --bg-soft: #1d1a16;
  --bg-elev: #221f1a;
  --bg-blur: rgba(21, 19, 16, .89);
  --desk-glow-1: rgba(224, 82, 60, .07);
  --desk-glow-2: rgba(120, 140, 180, .035);
  --desk-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.022'/%3E%3C/svg%3E");
  --fg: #ede8df;
  --fg-2: #cac2b6;
  --fg-3: #b3aa9d;
  --prose: #d9d1c5;
  --hover-wash: rgba(236, 221, 201, .048);
  --shadow-bar: 0 10px 24px -17px rgba(0, 0, 0, .68);
  --line: rgba(232, 227, 218, .12);
  --line-2: rgba(232, 227, 218, .24);
  --line-ui: #6e665b;
  --line-soft: rgba(232, 227, 218, .075);
  --accent: #e0523c;
  --accent-hi: #ff6d52;
  --accent-soft: rgba(224, 82, 60, .15);
  /* 深色 accent 更亮，accent 底上的文字加深一档才过 AA（~4.8:1） */
  --accent-ink: #0c0908;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .32), 0 12px 30px -14px rgba(0, 0, 0, .55);
  --shadow-pop: 0 20px 54px -12px rgba(0, 0, 0, .62);

  color-scheme: dark;
}

/* 容器与根字号照 roysgen 逐级放大（原站 1200→1160 / 1400→1340 / 1800→1520）
   大屏再放宽一档，减少两侧死白；右栏在超宽屏用像素上限，避免吃掉中栏。 */
@media (min-width: 1400px) {
  :root { --container: 1340px; --rail-w: 228px; }
}
@media (min-width: 1800px) {
  :root { --container: 1600px; --side-w: min(25%, 380px); }
}
@media (min-width: 2200px) {
  :root { --container: 1720px; }
}

/* ---------- 基底 ---------- */
* { box-sizing: border-box; }
/* 仅输入控件保留输入光标，防止浏览器开启光标浏览(F7)时在按钮/目录等非输入文字旁出现竖线 */
:root { caret-color: transparent; }
input, textarea, select, [contenteditable], [contenteditable] * { caret-color: auto; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(16px, 1.25vw, 18px);
  line-height: 1.8;
  font-feature-settings: "kern" 1, "liga" 1;
  color: var(--fg);
  /* 桌面：底色 + 两层静态暖光 + 纸纹噪点。fixed 让光钉在视口，滚动时纸面滑过。 */
  background-color: var(--bg-desk);
  background-image:
    radial-gradient(ellipse 70% 55% at 88% 0%, var(--desk-glow-1), transparent 62%),
    radial-gradient(ellipse 60% 50% at 8% 100%, var(--desk-glow-2), transparent 64%),
    var(--desk-noise);
  background-repeat: no-repeat, no-repeat, repeat;
  background-size: auto, auto, 160px 160px;
  background-attachment: fixed, fixed, fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
a, button, input, summary, [role="button"] { -webkit-tap-highlight-color: transparent; }
button, .icon-btn, .player-play, .player-skip, .player-list-toggle, .rail-link, .drawer-link { touch-action: manipulation; }
img { max-width: 100%; }
em { font-style: normal; }
::selection { background: var(--accent); color: var(--accent-ink); text-shadow: none; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
/* pjax 后接收焦点的中栏与 lightbox 图片是程序焦点，不画轮廓 */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible { outline: none; }

/* 视觉隐藏（只给读屏）：首页信息流没有 h1，补一个 */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

/* 共用按压位移，保留原有导航 inset 与各按钮底色；圆形图标/播放钮用轻量缩压代替下移。 */
:where(.btn, .page-num, .pagination-inner a, .code-copy, .player-list-toggle, .player-track-button):active {
  transform: translateY(1px);
}
:where(.icon-btn, .player-play, .player-skip):active {
  transform: scale(.93);
}

/* ---------- 页面切换：内容区 mask 横扫（照搬 finnblog 的 pvs-navigation） ----------
 * 原站配置：contentSelector: "main.content"，transitionDuration: .6
 * 新旧快照各跑一段 270deg 的 mask 渐变，横扫从右往左——看起来就是列表被一道扫过。
 *
 * 快照必须落在 root（恒等于视口）上，不能给 main.content 命名：文章页与首页
 * 高度差很大，具名元素的旧快照会被浏览器按新元素的矩形重定位、拉伸，
 * 换页恢复滚动位置时会"抖"一下（2.8.9 修）。root 快照尺寸/位置恒定，
 * 用横向 mask 把它限制在中栏内，左栏/侧栏/播放器保持原位。
 * --vt-clip-* 由 app.js 按 .main-col 实测宽度写入。
 */
::view-transition-image-pair(root) {
  isolation: auto;
  /* 顶部 2px 细缝：快照对整体裁掉 2px，露出下面真实页面的顶栏，
     横扫看起来像一道扫过，而不是整张纸被换掉 */
  clip-path: inset(2px 0 0 0);
}

@property --moflow-wipe {
  syntax: '<number>';
  initial-value: 0;
  inherits: false;
}
@keyframes moflow-wipe {
  0% { --moflow-wipe: 0; }
  100% { --moflow-wipe: 1; }
}

/* 中栏必须有不透明底色：换页时新快照要能盖住旧快照，
   否则空白处会透出上一页，mask 横扫就变成整页叠影 */
main.content {
  background: var(--bg);
}

::view-transition-old(root),
::view-transition-new(root) {
  /* 横扫坐标对准中栏宽度：w=0 时边界在中栏右缘、w=1 时到左缘，
     柔边 18% 中栏宽；否则按整屏算，前 1/5 动画时间空跑在右栏里看不出变化 */
  --vt-w: calc(100% - var(--vt-clip-left, 0px) - var(--vt-clip-right, 0px));
  --vt-x: calc(var(--vt-clip-left, 0px) + (1 - var(--moflow-wipe)) * var(--vt-w));
  --vt-soft: calc(0.18 * var(--vt-w));
  animation-name: moflow-wipe;
  animation-duration: .5s;
  animation-delay: 0s;
  animation-timing-function: cubic-bezier(.35, 0, .4, 1);
  animation-fill-mode: both;
  /* UA 默认给快照上 plus-lighter，两层叠在一起会发亮；这里改回普通混合 */
  mix-blend-mode: normal;
  backface-visibility: hidden;
  display: block;
}

/* 旧快照：只在中栏窗口内可见（横扫与窗口取交集）。
   中栏外一律透明——那里交给新快照的常显部分，见下。 */
::view-transition-old(root) {
  mask-image:
    linear-gradient(90deg, #000 0, #000 calc(var(--vt-x) - var(--vt-soft)), transparent var(--vt-x)),
    linear-gradient(90deg,
      transparent 0,
      transparent var(--vt-clip-left, 0px),
      #000 var(--vt-clip-left, 0px),
      #000 calc(100% - var(--vt-clip-right, 0px)),
      transparent calc(100% - var(--vt-clip-right, 0px)));
  mask-composite: add, intersect;
  -webkit-mask-image:
    linear-gradient(90deg, #000 0, #000 calc(var(--vt-x) - var(--vt-soft)), transparent var(--vt-x)),
    linear-gradient(90deg,
      transparent 0,
      transparent var(--vt-clip-left, 0px),
      #000 var(--vt-clip-left, 0px),
      #000 calc(100% - var(--vt-clip-right, 0px)),
      transparent calc(100% - var(--vt-clip-right, 0px)));
  -webkit-mask-composite: source-over, source-in;
}
/* 新快照：中栏外常显（终点状态，左栏/侧栏/播放器与动画结束后完全一致，
   收尾无跳变），中栏内由横扫揭示；第二层横向 mask 与横扫相加。 */
::view-transition-new(root) {
  mask-image:
    linear-gradient(90deg, transparent 0, transparent calc(var(--vt-x) - var(--vt-soft)), #000 var(--vt-x)),
    linear-gradient(90deg,
      #000 0,
      #000 var(--vt-clip-left, 0px),
      transparent var(--vt-clip-left, 0px),
      transparent calc(100% - var(--vt-clip-right, 0px)),
      #000 calc(100% - var(--vt-clip-right, 0px)));
  mask-composite: add;
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0, transparent calc(var(--vt-x) - var(--vt-soft)), #000 var(--vt-x)),
    linear-gradient(90deg,
      #000 0,
      #000 var(--vt-clip-left, 0px),
      transparent var(--vt-clip-left, 0px),
      transparent calc(100% - var(--vt-clip-right, 0px)),
      #000 calc(100% - var(--vt-clip-right, 0px)));
  -webkit-mask-composite: source-over;
}

/* 深浅色「墨染」切换：与后退 wipe 彻底隔离（由 app.js 临时挂 data-vt="theme"） */
html[data-vt="theme"]::view-transition-image-pair(root) {
  clip-path: none;
  isolation: auto;
}
html[data-vt="theme"]::view-transition-old(root),
html[data-vt="theme"]::view-transition-new(root) {
  animation: none;
  mask-image: none;
  -webkit-mask-image: none;
  mix-blend-mode: normal;
}
html[data-vt="theme"]::view-transition-old(root) { z-index: 1; }
html[data-vt="theme"]::view-transition-new(root) { z-index: 2; }
html.is-theming :is(body, .rail, .main-col, .sidebar-column, .topbar, .footer, .player-float) {
  transition: background-color .28s ease, color .28s ease, border-color .28s ease;
}

/* ---------- 顶部进度条 ---------- */
.loader {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px; z-index: 1100;
  pointer-events: none; opacity: 0;
  transition: opacity .4s ease;
}
.loader.is-loading { opacity: 1; }
.loader-bar {
  display: block; height: 100%; width: 0;
  background: var(--accent);
}

/* ---------- 首屏转场（mtcacg：双层幕布 + 站名逐字） ---------- */
.intro { display: none; position: fixed; inset: 0; z-index: 9000; overflow: hidden; }
.js:not(.no-intro) .intro { display: block; }
.intro-sweep { position: absolute; inset: 0; will-change: transform; }
.intro-sweep-accent { background: var(--accent); z-index: 1; }
.intro-sweep-base {
  background: var(--bg-desk); z-index: 2;
  display: grid; place-items: center;
}
.intro-name {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline;
  max-width: 100%;
  padding-inline: 6vw;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.4rem, 11vw, 9rem);
  letter-spacing: -.04em;
  color: var(--fg);
  line-height: 1.1;
}
.intro-name .il { display: inline-block; opacity: 0; transform: translateY(.5em); }
.intro-name .il-dot { color: var(--accent); }
.intro-skip {
  position: absolute; bottom: 2rem; left: 0; right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: .7rem; letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--fg-3);
}

/* ---------- 三段式布局（roysgen：左栏图标条 + 中栏 + 25% 右栏，无外框线） ---------- */
.layout {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--side-w);
  align-items: start;
  min-height: 100vh;
}
/* min-height：文章少/页面短时中栏纸面也要铺满一屏，否则 footer 下方会露出桌面色（生产短页实测） */
.main-col { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.content {
  padding: clamp(24px, 2.6vw, 34px) var(--main-inset) 80px;
  min-width: 0;
}

/* ---------- 左图标导航条（roysgen：80px 收起，悬停向右展开显示文字） ---------- */
.rail {
  position: sticky; top: 0;
  width: var(--rail-w);
  height: 100vh; max-height: 100vh;
  display: flex; flex-direction: column;
  padding: 18px 0 20px 15px;
  background: var(--bg-desk);
  border-right: 1px solid var(--line-soft);
  overflow: hidden;
  /* 展开时要盖住中栏（含顶栏），所以必须高于 .topbar 的 100 */
  z-index: 120;
  transition: width .26s var(--ease-out), box-shadow .26s ease;
}
@media (min-width: 900px) {
  .rail:hover,
  .rail:focus-within,
  .rail.is-open {
    width: 240px;
    box-shadow: 0 0 1.5rem rgba(0, 0, 0, .14);
  }
  .rail:hover .rail-label,
  .rail:focus-within .rail-label,
  .rail.is-open .rail-label { opacity: 1; }
}
@media (min-width: 1400px) {
  .rail,
  .rail:hover,
  .rail:focus-within { width: 100%; box-shadow: none; }
  .rail .rail-label { opacity: 1; }
}
/* 900–1399 是收起态（只有图标）：视觉上的左栏从视口左缘算起（gutter 与 rail 同为
   桌面色，看不出分界），图标要在「左缘 → 栏右缘」之间居中；只按 rail 自身居中
   会让左边多出半个 gutter，看起来左宽右窄。15px 是图标在 80px 栏内居中所需的
   padding，减掉 gutter 的一半即把这段空白对半分给两侧。 */
@media (min-width: 900px) and (max-width: 1399.98px) {
  .rail { padding-left: calc(15px - var(--gutter) / 2); }
  /* 展开态是完整侧栏（图标 + 文字），内容回到常规 15px 左留白 */
  .rail:hover,
  .rail:focus-within,
  .rail.is-open { padding-left: 15px; }
}

.rail-brand,
.rail-link {
  display: flex; align-items: center;
  width: 100%;
  height: 50px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg-2);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.rail-brand { height: auto; min-height: 50px; padding: 2px 16px 2px 0; margin-bottom: 14px; flex-shrink: 0; }

.rail-ico {
  position: relative;
  flex: 0 0 50px;
  display: flex; align-items: center; justify-content: center;
  width: 50px; height: 50px;
  border-radius: var(--radius);
  color: var(--fg-3);
  transition: background var(--t-fast), color var(--t-fast);
}
.rail-link.is-active .rail-ico::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 2.5px;
  border-radius: 2px;
  background: var(--accent);
}
.rail-brand-mark {
  flex: 0 0 42px;
  width: 42px; height: 42px;
  margin-inline: 4px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  color: var(--accent);
}
.rail-brand-mark img { width: 100%; height: 100%; object-fit: cover; }

.rail-label {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: .55rem;
  opacity: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--fs-base);
  color: var(--fg-2);
  transition: opacity .18s ease .04s, color var(--t-fast);
}
.rail-brand-text { display: flex; flex-direction: row; align-items: baseline; gap: 7px; padding-left: 10px; line-height: 1.3; }
.rail-brand-name {
  font-family: var(--font-serif);
  font-size: var(--fs-lg); font-weight: 600; line-height: 1.3;
  letter-spacing: .02em;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

.rail-link:hover .rail-ico,
.rail-link:focus-visible .rail-ico,
.rail-link.is-active .rail-ico {
  background: var(--accent-soft);
  color: var(--accent);
}
.rail-link:hover .rail-label,
.rail-link.is-active .rail-label,
.rail-brand:hover .rail-brand-name { color: var(--accent); }
.rail-brand:hover .brand-dot { background: var(--accent-hi); }

/* ≥1400px 左栏常开：隐藏单字方标，放大并居中「站名 + 朱砂点」 */
@media (min-width: 1400px) {
  .rail-brand { padding: 4px 16px 4px 0; justify-content: center; }
  .rail-brand-mark { display: none; }
  .rail-brand-text { justify-content: center; padding-left: 0; }
  .rail-brand-name { font-size: var(--fs-lg); letter-spacing: .03em; }
}

.rail-nav {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
}
.rail-nav::-webkit-scrollbar { display: none; }
.rail-divider {
  height: 1px;
  margin: 10px 16px 8px 0;
  background: var(--line-soft);
  flex-shrink: 0;
}
.rail-link.is-sub { height: 42px; flex-shrink: 0; }
.rail-link.is-sub .rail-ico { width: 50px; height: 42px; flex: 0 0 50px; }
.rail-link.is-sub .rail-label { font-size: var(--fs-base); }
.rail-foot { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }

/* ---------- 顶栏（位于中栏顶部，sticky；roysgen 的毛玻璃：半透明 + backdrop blur） ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h);
  flex-shrink: 0;
  padding-inline: var(--main-inset);
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast);
}
.topbar.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-bar);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar.is-scrolled {
    background: var(--bg-blur);
    backdrop-filter: blur(20px) saturate(1.25);
    -webkit-backdrop-filter: blur(20px) saturate(1.25);
  }
}
.topbar .brand { display: none; }
.topbar.is-scrolled .brand { text-shadow: 0 0 20px var(--accent-soft); }
.topnav {
  display: flex; align-items: center; gap: 2px;
  flex: 1; min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav::-webkit-scrollbar { display: none; }
/* 顶栏导航：平滑展开的底部朱砂细线 + 极轻底色回馈 */
.topnav-link {
  position: relative;
  flex-shrink: 0;
  padding: 9px 10px;
  border-radius: 4px;
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--fg-2);
  white-space: nowrap;
  transition: color var(--t-fast), background-color var(--t-fast), transform var(--t-fast);
}
.topnav-link::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .22s var(--ease-out), opacity .18s ease;
}
.topnav-link:hover,
.topnav-link:focus-visible,
.topnav-link.is-active {
  color: var(--accent-hi);
}
.topnav-link:hover::after,
.topnav-link:focus-visible::after,
.topnav-link.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}
.topnav-link.is-active {
  background: var(--accent-soft);
}
.topnav-link:focus-visible,
.rail-link:focus-visible { outline-offset: -2px; }
.topbar-actions { display: flex; flex: none; align-items: center; gap: 8px; margin-left: auto; }
.js-scheme .i-moon { display: none; }
[data-scheme="dark"] .js-scheme .i-moon { display: block; }
[data-scheme="dark"] .js-scheme .i-sun { display: none; }

.icon-btn {
  display: inline-flex; flex: none; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent; color: var(--fg-2);
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
@media (hover: hover) {
  .icon-btn:hover { color: var(--accent-hi); border-color: var(--line); background: var(--accent-soft); transform: scale(1.06); }
}
.icon-btn:focus-visible,
.icon-btn[aria-expanded="true"] { color: var(--accent-hi); border-color: var(--line); background: var(--accent-soft); }
.icon-btn:active { color: var(--accent-hi); background: var(--accent-soft); }

/* 移动端专属按钮：桌面交给左栏，必须写在 .icon-btn 之后 */
.topbar .topbar-burger,
.topbar .topbar-scheme { display: none; }

.brand {
  display: inline-flex; align-items: baseline; gap: 7px;
  font-family: var(--font-serif);
  font-size: var(--fs-lg); font-weight: 600;
  letter-spacing: .03em;
  color: var(--fg);
  flex-shrink: 0;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.brand-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  transform: translateY(-2px);
  flex-shrink: 0;
  animation: dot-breathe 3.4s ease-in-out infinite;
}
@keyframes dot-breathe {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50% { box-shadow: 0 0 0 5px transparent; }
}
.brand:hover .brand-dot { background: var(--accent-hi); }

/* 搜索面板停靠在顶栏下，不推动内容和吸顶位置。 */
.search-panel {
  position: absolute;
  inset: calc(100% + 6px) var(--main-inset) auto;
  z-index: 140;
  padding: 10px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line-ui);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}
.search-form {
  display: flex; align-items: center; gap: 10px;
  color: var(--fg-3);
}
.search-form > svg { flex: none; }
.search-form input {
  flex: 1;
  min-width: 0;
  padding: 6px 4px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  font: inherit;
  font-size: var(--fs-base);
  color: var(--fg);
}
.search-form input::placeholder { color: var(--fg-3); font-size: var(--fs-sm); }
.search-hint {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-3);
  white-space: nowrap;
}
.search-hint kbd {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-soft);
  font-family: inherit;
  font-size: var(--fs-xs);
}
@media (max-width: 640px) { .search-hint { display: none; } }

/* ---------- 移动端抽屉 ---------- */
.drawer {
  --drawer-pad: clamp(12px, 4vw, 22px);
  position: fixed;
  inset: 0 auto 0 0;
  width: min(84vw, 330px);
  padding: calc(12px + env(safe-area-inset-top)) var(--drawer-pad)
           calc(14px + env(safe-area-inset-bottom)) max(var(--drawer-pad), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  overflow-y: auto; /* 极矮的横屏允许整个抽屉滚动 */
  overscroll-behavior: contain;
  background: var(--bg);
  border-right: 1px solid var(--line-2);
  box-shadow: var(--shadow-pop);
  z-index: 300;
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex: none;
  padding-bottom: 8px;
}
.drawer-title {
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  font-weight: 600;
}
.drawer-scroll {
  flex: 1;
  min-height: 42px;
  padding-right: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.drawer-player {
  flex: none;
  position: relative;
  z-index: 1;
  padding-top: 10px;
}
.drawer-section {
  margin: 12px 0 4px;
  font-size: var(--fs-xs); letter-spacing: .12em;
  color: var(--fg-3);
}
.drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.drawer-link {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px;
  padding: 6px 8px 6px 10px;
  border-radius: var(--radius);
  font-size: var(--fs-base);
  color: var(--fg-2);
  transition: color var(--t-fast), background var(--t-fast);
}
.drawer-link.is-active {
  color: var(--accent-hi);
  background: var(--accent-soft);
  font-weight: 500;
}
.drawer-link.is-active::before {
  content: "";
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 2.5px;
  border-radius: 2px;
  background: var(--accent);
}
@media (hover: hover) {
  .drawer-link:hover { color: var(--accent-hi); background: var(--accent-soft); }
  .drawer-link:hover .drawer-ico { color: var(--accent-hi); }
  .drawer-link:hover .drawer-ext {
    color: var(--accent-hi);
    transform: translate(1px, -1px);
  }
}
.drawer-link:focus-visible { color: var(--accent-hi); background: var(--accent-soft); outline-offset: -2px; }
.drawer-link:focus-visible .drawer-ico,
.drawer-link.is-active .drawer-ico { color: var(--accent-hi); }
.drawer-link-main {
  display: inline-flex; align-items: center; gap: 11px;
  min-width: 0;
}
.drawer-ico {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
  width: 20px; height: 20px;
  color: var(--fg-3);
  transition: color var(--t-fast);
}
.drawer-link-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-count {
  min-width: 18px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--fg-3);
}
.drawer-link.is-active .drawer-count { color: var(--accent-hi); }
.drawer-ext {
  flex: none;
  margin-right: 1px;
  color: var(--fg-3);
  transition: transform var(--t-fast), color var(--t-fast);
}
.drawer-mask {
  position: fixed; inset: 0;
  background: rgba(24, 19, 15, .48);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 200;
}
[data-scheme="dark"] .drawer-mask { background: rgba(0, 0, 0, .68); }

/* hidden 由脚本在离场完成后设置，关闭态优先于打开态。 */
:is(.drawer, .drawer-mask, .search-panel, .player-list)[hidden] { display: none; }
:is(.drawer, .drawer-mask, .search-panel, .player-list).is-closing { pointer-events: none; }
:is(.drawer, .drawer-mask, .search-panel, .player-list):not(.is-open, .is-closing) { visibility: hidden; }
.drawer.is-open:not(.is-closing) { animation: drawer-enter 260ms var(--ease-out) both; }
.drawer.is-closing { animation: drawer-leave 240ms ease-in both; }
.drawer-mask.is-open:not(.is-closing) { animation: mask-enter 240ms ease-out both; }
.drawer-mask.is-closing { animation: mask-leave 240ms ease-in both; }
:is(.search-panel, .player-list).is-open:not(.is-closing) {
  animation: pop-enter 180ms var(--ease-out) both;
}
:is(.search-panel, .player-list).is-closing { animation: pop-leave 160ms ease-in both; }

@keyframes drawer-enter {
  from { transform: translateX(-102%); }
  to { transform: none; }
}
@keyframes drawer-leave {
  from { transform: none; }
  to { transform: translateX(-102%); }
}
@keyframes mask-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes mask-leave { from { opacity: 1; } to { opacity: 0; } }
@keyframes pop-enter {
  from { opacity: 0; transform: translateY(var(--pop-offset, -6px)); }
  to { opacity: 1; transform: none; }
}
@keyframes pop-leave {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(var(--pop-offset, -6px)); }
}

/* ---------- 标题区错峰浮现（mtcacg head-up） ---------- */
@media (prefers-reduced-motion: no-preference) {
  .anim-head {
    animation: head-up .6s var(--ease-out) both;
    animation-delay: var(--d, 0ms);
  }
}
@keyframes head-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 归档 / 搜索页头（首页不再有 hero，直接进信息流） ---------- */
.page-head {
  padding: 6px 0 18px;
}
.page-kicker {
  display: flex; align-items: center; gap: 12px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs); font-weight: 500;
  letter-spacing: .2em;
  color: var(--fg-3);
  text-transform: uppercase;
}
.kicker-rule { width: 32px; height: 1px; background: var(--accent); flex-shrink: 0; }
.page-title {
  margin: 12px 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 2.8vw, 38px);
  font-weight: 600;
  line-height: 1.26;
  letter-spacing: -.01em;
}
.page-desc {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm); letter-spacing: .02em;
  color: var(--fg-3);
}
.page-count { color: var(--accent); }
.page-note::before { content: "/"; margin-right: 10px; opacity: .45; }

/* ---------- 信息流（roysgen：卡片无分割线，单图 200×133 贴右贴底） ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "main thumb";
  gap: 12px 24px;
  align-items: end;
  padding: 26px 0;
  /* 条目之间只留白，不画线；悬停只让标题加深，不加任何块级效果。 */
}
.feed-item:first-child { padding-top: 10px; }
.feed-item-plain { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main"; }
.feed-item-gallery { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "gallery" "meta"; gap: 0; align-items: start; }

.feed-main { grid-area: main; min-width: 0; }
.feed-title {
  margin: 0 0 7px;
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .005em;
  color: var(--fg);
  text-wrap: pretty;
}
.feed-title a { transition: color var(--t-fast); }
.feed-item:hover .feed-title a { color: var(--accent-hi); }

.feed-excerpt {
  max-width: 68ch;
  margin: 0;
  font-size: var(--fs-base);
  line-height: 1.85;
  text-autospace: normal;
  color: var(--fg-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.feed-item-plain .feed-excerpt { -webkit-line-clamp: 3; }
.feed-meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 7px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  line-height: 1.6;
  letter-spacing: .015em;
  color: var(--fg-3);
}
.feed-item-gallery .feed-meta { grid-area: meta; margin-top: 10px; }
.meta-cat {
  /* 分类名用衬线体，和正文 sans 拉开；透明热区扩展至 32px+ 高，保证移动端不误触 */
  display: inline-block;
  padding: 6px 4px;
  margin: -6px -4px;
  font-family: var(--font-serif);
  font-size: 1.04em;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--accent);
  transition: color var(--t-fast);
}
.meta-cat:hover { color: var(--accent-hi); }
.meta-sep { opacity: .8; }
.meta-item { color: var(--fg-3); }
.meta-extra { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.feed-empty {
  margin: 28px 0;
  font-size: var(--fs-sm);
  color: var(--fg-3);
}

.feed-thumb {
  position: relative;
  grid-area: thumb;
  display: block;
  width: 200px;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--bg-soft);
  /* 缩略图描边：保留外边 + 内高光环，暗部照片也分明 */
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.feed-thumb img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease-out);
}
.feed-item:hover .feed-thumb img { transform: scale(1.03); }

/* 多图：roysgen 的 thumbnail-grid，文字下方 3 列 3:2，只显示前 3 张 */
.feed-gallery {
  grid-area: gallery;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.feed-gallery-item {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
:is(.feed-thumb, .feed-gallery-item)::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(28, 25, 22, .06);
  pointer-events: none;
}
[data-scheme="dark"] :is(.feed-thumb, .feed-gallery-item)::after {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.feed-gallery-item:nth-child(n + 4) { display: none; }
.feed-gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease-out);
}
.feed-gallery-item:hover img { transform: scale(1.02); }

/* ---------- 首页头图（roysgen：24:9 淡入轮播 + 底部细条段指示器） ---------- */
.banner {
  position: relative;
  flex: none;
  aspect-ratio: 24 / 9;
  max-height: 300px;
  margin: clamp(14px, 2vw, 24px) var(--main-inset) 6px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  isolation: isolate;
}
.banner-slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .8s ease;
}
.banner-slide.is-active { opacity: 1; }
/* 头图左右切换轻按钮 */
.banner-nav {
  position: absolute; top: 50%; z-index: 3;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 50%;
  background: rgba(18, 16, 14, .42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, .92);
  opacity: 0;
  cursor: pointer;
  transition: opacity .2s ease, background var(--t-fast), transform var(--t-fast);
}
.banner-prev { left: 12px; }
.banner-next { right: 12px; }
.banner:hover .banner-nav,
.banner:focus-within .banner-nav { opacity: 1; }
.banner-nav:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: translateY(-50%) scale(1.06); }
@media (hover: none) { .banner-nav { display: none; } }
/* 细条贴底，底轨用深色内阴影，保证亮色图上也有对比；当前项呈 Story 8s 进度填充 */
.banner-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: flex-end; column-gap: 2px;
  height: 28px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .35));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .28);
}
.banner-seg {
  position: relative;
  flex: 1 1 0;
  height: 100%;
  padding: 0; border: 0;
  background: transparent;
  cursor: pointer;
}
.banner-seg::before,
.banner-seg::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px;
}
.banner-seg::before {
  background: rgba(255, 255, 255, .36);
  transition: background var(--t-fast), transform var(--t-fast);
  transform-origin: bottom;
}
.banner-seg::after {
  background: #fff;
  transform-origin: left center;
  transform: scaleX(0);
  opacity: 0;
}
.banner-seg:hover::before { background: rgba(255, 255, 255, .72); }
.banner-seg:active::before { transform: scaleY(1.45); }
.banner-seg.is-active::after {
  opacity: 1;
  animation: banner-fill var(--banner-dur, 8000ms) linear forwards;
}
.banner.is-paused .banner-seg.is-active::after { animation-play-state: paused; }
@keyframes banner-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
  .banner-seg.is-active::after { animation: none; transform: scaleX(1); }
}
.banner-seg:focus-visible { outline-color: #fff; outline-offset: -4px; box-shadow: inset 0 0 0 2px #201b16; }

/* ---------- 分页（roysgen：淡底圆角块，当前页只换色不填实；兼容 Typecho ol/li 输出） ---------- */
.pagination { margin-top: 32px; }
.pagination:empty { display: none; }
.pagination-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px;
  margin: 0; padding: 0;
  list-style: none;
}
.pagination-inner li {
  margin: 0; padding: 0;
  list-style: none;
}
.pagination-inner :is(a, span),
.page-num {
  min-width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  padding-inline: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--fg-2);
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.pagination-inner li:not(.is-current) > span {
  min-width: 24px;
  padding-inline: 4px;
  background: transparent;
  border-color: transparent;
  color: var(--fg-3);
}
.pagination-inner a:hover,
.page-num:hover { color: var(--accent-hi); border-color: var(--line); background: var(--accent-soft); transform: translateY(-2px); }
.pagination-inner li.is-current :is(a, span),
.page-num.is-current { background: var(--accent-soft); border-color: var(--line); color: var(--accent-hi); font-weight: 600; }

/* ---------- 侧栏（roysgen：图标小标题 + 留白分块，不画分割线） ---------- */
.sidebar-column {
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  border-left: 1px solid var(--line-soft);
  padding: clamp(24px, 2.6vw, 34px) 28px 24px clamp(16px, 1.6vw, 24px);
  min-width: 0;
}
/* 右下角播放器常驻：始终把内容容器 .sidebar-body 严格限制在播放器上沿上方 16px，
   常规屏幕一屏完整呈现无需滚动；仅在极矮窗口时由 .sidebar-body 在安全区内单独滚动，
   绝不让评论或标签伸进播放器底下被压住。 */
@media (min-width: 900px) {
  body.has-player .sidebar-column {
    padding-bottom: var(--player-space, 176px);
  }
}
.sidebar-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-body::-webkit-scrollbar { display: none; }
.sidebar-body.is-overflow {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
}
/* 侧栏模块不再用卡片：无底色、无边框，纯留白分组；线条只留给版面结构。 */
.side-block {
  margin-bottom: 20px;
  padding: 0;
  background: none;
  border: 0;
}
.side-block:last-child { margin-bottom: 0; }

.side-title {
  display: flex; align-items: center; gap: .55rem;
  margin: 0 0 12px;
  font-size: 18px; font-weight: 600;
  letter-spacing: .02em;
  color: var(--fg);
}
.side-ico {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-3);
}
.side-ico svg { width: 16px; height: 16px; }

.side-author-row { display: flex; gap: 14px; align-items: center; }
.side-avatar {
  width: 56px; height: 56px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-soft);
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  color: var(--accent);
}
.side-avatar img { width: 100%; height: 100%; object-fit: cover; }
.side-author-info { min-width: 0; }
.side-author-name {
  margin: 0 0 5px;
  font-family: var(--font-serif);
  font-size: var(--fs-lg); font-weight: 600;
  color: var(--fg);
}
.side-author-bio {
  margin: 0;
  font-size: var(--fs-base); line-height: 1.65;
  color: var(--fg-2);
}
.side-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0 0;
}
.side-stats div { display: flex; flex-direction: column; gap: 5px; }
.side-stats dt {
  font-family: var(--font-serif);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xl); line-height: 1;
  color: var(--fg);
}
.side-stats dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs); letter-spacing: .1em;
  color: var(--fg-3);
}
.side-socials {
  display: flex; align-items: center; gap: 15px;
  margin-top: 18px;
  color: var(--fg-3);
}
.side-socials a { display: inline-flex; transition: color var(--t-fast), transform var(--t-fast); }
.side-socials a:hover { color: var(--accent); transform: translateY(-2px); }

.side-hot { list-style: none; margin: 0; padding: 0; }
.side-hot-item {
  display: flex; align-items: baseline; gap: 10px;
  min-height: 30px;
  padding: 6px 0;
}
.side-hot-rank {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  color: var(--fg-3);
}
.side-hot-link {
  flex: 1; min-width: 0;
  font-size: 17px; line-height: 1.68;
  color: var(--fg-2);
  white-space: normal;
  transition: color var(--t-fast);
}
.side-hot-link:hover { color: var(--fg); }
.side-hot-views {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  color: var(--fg-3);
}
.side-empty {
  padding: 8px 0;
  font-size: var(--fs-sm); color: var(--fg-3);
  list-style: none;
}

.side-comments { list-style: none; margin: 0; padding: 0; }
.side-comment { min-height: 30px; padding: 6px 0; }
.side-comment-link { display: flex; flex-direction: column; gap: 2px; }
.side-comment-author {
  font-family: var(--font-mono);
  font-size: var(--fs-sm); letter-spacing: .02em;
  font-weight: 600;
  color: var(--fg);
}
.side-comment-text {
  font-size: var(--fs-base); line-height: 1.6; color: var(--fg-2);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
  transition: color var(--t-fast);
}
.side-comment-link:hover .side-comment-text { color: var(--fg); }

.side-tags { display: flex; flex-wrap: wrap; gap: 9px 16px; }
.side-tag {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--fg-2);
  transition: color var(--t-fast);
}
.side-tag:hover { color: var(--accent); }

/* ---------- 播放器（右下角常驻条 / 移动抽屉；UI 片段 player.php 渲染两份） ---------- */
/* 右下角常驻迷你播放器（≥900px 显示）：卡片样式与抽屉份同构，列表从卡片正上方弹出。
   right/width 的精确值由 app.js 按 sidebar 列内容盒实测设置（fixed 无法引用 grid 列宽），
   下面是 JS 未跑时的兜底：右缘对齐列内容盒右缘（layout 右缘 - 列 4px 右内边距） */
.player-float {
  position: fixed;
  right: max(var(--gutter), calc((100% - var(--container)) / 2 + var(--gutter) + 4px));
  bottom: 18px;
  z-index: 120;
  width: 300px;
  max-width: calc(100vw - 32px);
  padding: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}

/* 抽屉里的播放器与导航隔开，但不加重阴影；隐藏音量块并压紧上下高度。 */
.drawer .mo-player {
  padding: 10px 11px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.drawer .player-main { gap: 10px; }
.drawer .player-cover {
  flex-basis: 44px;
  width: 44px; height: 44px;
}
.drawer .player-bar {
  height: 20px;
  margin-top: 4px;
}
.drawer .player-ctrl {
  flex-wrap: nowrap;
  gap: 2px;
  margin-top: 2px;
}
.drawer .player-vol { display: none; }

.mo-player { position: relative; }
.player-main { display: flex; align-items: center; gap: 11px; }
.player-cover {
  position: relative;
  flex: 0 0 54px;
  width: 54px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  background: var(--bg-soft) center / cover no-repeat;
  color: var(--fg-3);
  overflow: hidden;
}
.player-cover::after {
  content: "♪";
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  line-height: 1;
}
.player-cover.has-img::after { display: none; }
.player-meta {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.player-title-row {
  display: flex; align-items: center; gap: 6px;
  min-width: 0;
}
.player-title {
  flex: 0 1 auto; min-width: 0;
  font-size: var(--fs-sm); font-weight: 500; color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-eq {
  display: inline-flex; align-items: flex-end; gap: 2px;
  height: 10px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .2s ease;
}
.player-eq i {
  display: block; width: 2px; height: 3px;
  border-radius: 1px;
  background: var(--accent);
}
.mo-player.is-playing .player-eq { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .mo-player.is-playing .player-eq i { animation: mo-eq .75s ease-in-out infinite alternate; }
  .mo-player.is-playing .player-eq i:nth-child(2) { animation-delay: .22s; }
  .mo-player.is-playing .player-eq i:nth-child(3) { animation-delay: .42s; }
}
@keyframes mo-eq {
  from { height: 3px; }
  to { height: 10px; }
}
.player-cover, .player-meta { transition: opacity .16s ease, transform .18s var(--ease-out); }
.mo-player.is-switching .player-cover { opacity: .65; transform: scale(.94); }
.mo-player.is-switching .player-meta { opacity: .45; transform: translateX(4px); }
.player-artist {
  font-size: var(--fs-xs); color: var(--fg-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-play {
  flex: 0 0 34px;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
@media (hover: hover) {
  .player-play:hover { background: var(--accent); color: var(--accent-ink); }
}
.player-play:active { background: var(--accent); color: var(--accent-ink); }
.player-play .i-pause { display: none; }
.player-play.is-playing .i-play { display: none; }
.player-play.is-playing .i-pause { display: block; }

.player-bar {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%; height: 26px;
  margin: 6px 0 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}
.player-bar:disabled { opacity: .5; cursor: default; }
.player-bar::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, currentColor var(--player-progress, 0%), var(--line-ui) var(--player-progress, 0%));
  transition: height var(--t-fast);
}
.player-bar:not(:disabled):hover::-webkit-slider-runnable-track { height: 5px; }
.player-bar::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-ui); }
.player-bar::-moz-range-progress { height: 4px; border-radius: 2px; background: currentColor; }
.player-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px; height: 11px;
  margin-top: -3.5px;
  border: 0;
  border-radius: 50%;
  background: currentColor;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.player-bar:not(:disabled):is(:hover, :active)::-webkit-slider-thumb {
  transform: scale(1.22);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.player-bar::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: currentColor; }
@media (forced-colors: active) {
  .player-bar { appearance: auto; -webkit-appearance: auto; }
}
.player-ctrl {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-3);
}
.player-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.player-skip,
.player-mute {
  display: inline-flex; flex: none; align-items: center; justify-content: center;
  width: 24px; height: 28px;
  padding: 0; border: 0; border-radius: var(--radius);
  background: transparent;
  color: var(--fg-3);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
@media (hover: hover) {
  .player-skip:hover,
  .player-mute:hover { color: var(--accent-hi); background: var(--accent-soft); }
}
.player-skip:active,
.player-mute:active { color: var(--accent-hi); background: var(--accent-soft); }
.player-vol {
  position: relative;
  display: inline-flex; align-items: center;
}
.player-mute .i-mute { display: none; }
.player-mute.is-muted { color: var(--accent); }
.player-mute.is-muted .i-vol { display: none; }
.player-mute.is-muted .i-mute { display: block; }
/* 音量条改为向上悬浮胶囊，悬停/聚焦时不挤占控制栏宽度，杜绝换行与高度跳变 */
.player-vol-bar {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% - 2px);
  transform: translateX(calc(-50% + var(--vol-shift, 0px))) translateY(4px);
  width: 82px; height: 26px;
  margin: 0; padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  box-shadow: var(--shadow-card);
  color: var(--accent);
  cursor: pointer;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s var(--ease-out);
}
.player-vol:hover .player-vol-bar,
.player-vol:focus-within .player-vol-bar {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(calc(-50% + var(--vol-shift, 0px))) translateY(0);
}
.player-vol-bar::-webkit-slider-runnable-track {
  height: 3px; border-radius: 2px;
  background: linear-gradient(to right, currentColor var(--vol-progress, 80%), var(--line-2) var(--vol-progress, 80%));
}
.player-vol-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 9px; height: 9px; margin-top: -3px;
  border: 0; border-radius: 50%; background: currentColor;
}
.player-vol-bar::-moz-range-track { height: 3px; border-radius: 2px; background: var(--line-2); }
.player-vol-bar::-moz-range-progress { height: 3px; border-radius: 2px; background: currentColor; }
.player-vol-bar::-moz-range-thumb { width: 9px; height: 9px; border: 0; border-radius: 50%; background: currentColor; }

/* 「播放列表」按钮：列表默认收起，点它在播放器卡片外侧弹出浮层 */
.player-list-toggle {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 28px;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  white-space: nowrap;
  color: var(--fg-3);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
@media (hover: hover) {
  .player-list-toggle:hover { color: var(--accent-hi); background: var(--accent-soft); }
}
.player-list-toggle[aria-expanded="true"],
.player-list-toggle:active { color: var(--accent-hi); background: var(--accent-soft); }
.player-count { color: var(--fg-2); }

/* 列表浮层：不撑开播放器卡片 */
.player-list {
  position: absolute;
  left: 0; right: 0;
  z-index: 4;
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: clamp(0px, var(--player-list-max, 220px), 280px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}
/* 两份 UI 的列表统一从卡片正上方弹出、与卡片外框等宽对齐：
   抽屉外框挂在 .mo-player（1px border）；常驻条外框挂在 .player-float（12px padding + 1px border） */
.drawer .player-list {
  left: -1px; right: -1px;
  bottom: calc(100% + 8px);
  --pop-offset: 6px;
}
.player-float .player-list {
  left: -13px; right: -13px;
  bottom: calc(100% + 21px);
  top: auto;
  --pop-offset: 6px;
}
.player-track-button {
  display: flex; align-items: baseline; gap: 8px;
  width: 100%; min-height: 32px;
  padding: 6px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  font: inherit;
  font-size: var(--fs-sm);
  text-align: left;
  color: var(--fg-2);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.player-track-button:hover { color: var(--fg); background: var(--bg-soft); }
.player-track-button:focus-visible { outline-offset: -2px; }
.player-item.is-current .player-track-button { color: var(--accent-hi); background: var(--accent-soft); }
.player-item-idx {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-3);
}
.player-item-title {
  min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- TOC ---------- */
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-item {
  position: relative;
  padding: 6px 0 6px 13px;
  font-size: var(--fs-sm); line-height: 1.6;
  color: var(--fg-3);
  border-left: 1px solid var(--line);
  transition: color var(--t-fast), border-color var(--t-fast);
}
.toc-item.is-h3 { padding-left: 25px; }
.toc-item:hover { color: var(--fg); }
.toc-item.is-active { color: var(--accent); border-left-color: var(--accent); }
.toc-empty { font-size: var(--fs-sm); color: var(--fg-3); }

/* ---------- 文章页（roysgen：标题区无底线，上下篇用淡色块） ---------- */
.post { padding-top: 4px; }
.post-head { margin-bottom: clamp(28px, 4vw, 46px); }
.post-kicker {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm); letter-spacing: .03em;
  color: var(--fg-3);
}
.post-title {
  margin: 14px 0 20px;
  font-family: var(--font-serif);
  font-size: clamp(27px, 2.9vw, 38px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--fg);
  text-wrap: balance;
}
.post-byline {
  display: flex; align-items: center; flex-wrap: wrap; gap: 9px;
  font-family: var(--font-mono);
  font-size: var(--fs-sm); letter-spacing: .02em;
  color: var(--fg-3);
}
.byline-avatar {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: var(--fs-sm);
  color: var(--accent);
  background: var(--bg-soft);
}
.byline-avatar img { width: 100%; height: 100%; object-fit: cover; }
.byline-name { color: var(--fg-2); }
.byline-sep { opacity: .4; }

.post-content { max-width: 760px; }
.post-foot { margin-top: 44px; }
.post-tags {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  padding: 12px 0 20px;
}
.post-tag {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--fg-2);
  transition: color var(--t-fast);
}
.post-tag:hover { color: var(--accent); }

.post-nav {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0 18px;
  margin-top: 6px;
  padding: 2px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--hover-wash);
}
.post-nav-cell {
  display: flex; flex-direction: column; gap: 7px;
  padding: 16px 0;
  min-width: 0;
}
.post-nav-next { text-align: right; }
.post-nav-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs); letter-spacing: .12em;
  color: var(--fg-3);
}
.post-nav-cell a {
  font-family: var(--font-serif);
  font-size: var(--fs-base); line-height: 1.5;
  color: var(--fg);
  transition: color var(--t-fast);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-nav-cell a:hover { color: var(--accent); }
.post-nav-empty { font-size: var(--fs-sm); color: var(--fg-3); }

/* ---------- 评论区（减少装饰线：标题上下不再各压一条线） ---------- */
.comments {
  margin-top: 64px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.comments-title {
  display: flex; align-items: baseline; gap: 12px;
  margin: 0 0 22px;
  font-family: var(--font-serif);
  font-size: var(--fs-lg); font-weight: 600;
  color: var(--fg);
}
.comment-list, .comment-children .comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list ol, .comment-children ol { list-style: none; }
.comment { position: relative; display: flex; gap: 14px; padding: 16px 0; }
.comment + .comment { border-top: 1px solid var(--line-soft); }
.comment-children { margin-top: 6px; padding-left: 12px; border-left: 1px solid var(--line-soft); }
.comment-children .comment { padding-block: 10px; }
.comment-avatar img {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-soft);
  filter: saturate(.85);
}
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.fn {
  font-style: normal;
  font-family: var(--font-serif);
  font-size: var(--fs-base); font-weight: 600;
  color: var(--fg);
}
.comment-by-author .fn { color: var(--accent); }
.comment-by-author .fn::after {
  content: "作者";
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  vertical-align: 1px;
}
.comment-date {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-3);
  transition: color var(--t-fast);
}
.comment-date:hover { color: var(--accent); }
.comment-pending { font-size: var(--fs-sm); color: var(--accent); }
.comment-content {
  margin-top: 6px;
  font-size: var(--fs-base); line-height: 1.8;
  color: var(--fg-2);
  overflow-wrap: break-word;
}
.comment-content p { margin: 0 0 6px; }
.comment-content p:last-child { margin: 0; }
.comment-reply { align-self: flex-start; }
.comment-reply a {
  font-family: var(--font-mono);
  font-size: var(--fs-xs); letter-spacing: .03em;
  color: var(--fg-3);
  padding: 4px 9px;
  border: 1px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.comment-reply a:hover { color: var(--accent); border-color: var(--accent); }
.comments-closed { font-size: var(--fs-sm); color: var(--fg-3); }

.respond {
  margin-top: 38px;
  padding-top: 0;
  border-top: 0;
}
.respond-title {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  color: var(--fg);
}
.respond-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 16px;
}
@media (max-width: 640px) { .respond-grid { grid-template-columns: 1fr; } }
.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-ui);
  border-radius: var(--radius);
  background: var(--bg-elev);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  color: var(--fg);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder { color: var(--fg-3); opacity: .85; }
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
/* 固定高度：focus 时若改变高度，点「提交评论」会因 textarea 失焦回缩把按钮从指针下顶走，
   第一下点击必然落空。所以高度恒定、只允许手动纵向拉伸；右下角自绘斜线代替浏览器默认抓手 */
.respond-text {
  resize: vertical;
  min-height: 140px;
  margin-bottom: 16px;
  padding-right: 14px;
  padding-bottom: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M11 1L1 11M11 5L5 11M11 9L9 11' stroke='%23948b7e' stroke-width='1.2' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px bottom 6px;
  background-size: 12px 12px;
}
.respond-text::-webkit-resizer { background: transparent; }
.cancel-comment-reply a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hi);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  transition: background var(--t-fast), color var(--t-fast);
}
.cancel-comment-reply a:hover { background: var(--accent); color: var(--accent-ink); }
.respond-identity {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 16px;
  font-size: var(--fs-sm); color: var(--fg-3);
}
.respond-identity a { color: var(--accent); }
.respond-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.respond-hint {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-3);
}
.respond-hint kbd {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-soft);
  font-family: inherit;
  font-size: var(--fs-xs);
}
@media (max-width: 640px) {
  .respond-hint { display: none; }
  .respond-actions { justify-content: flex-end; }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px;
  padding: 10px 26px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-sans);
  font-size: var(--fs-sm); font-weight: 500;
  letter-spacing: .06em;
  cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.btn:hover { background: var(--accent-hi); border-color: var(--accent-hi); box-shadow: 0 0 0 4px var(--accent-soft); }
.btn-ghost {
  background: transparent;
  color: var(--fg-2);
  border-color: var(--line-2);
}
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-hi); border-color: var(--accent); }

/* ---------- 回到顶部（移动端浮层；桌面用左栏按钮） ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 24px;
  width: 46px; height: 46px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: var(--bg-elev);
  box-shadow: var(--shadow-card);
  color: var(--fg);
  cursor: pointer;
  visibility: hidden;
  opacity: 0; transform: translateY(10px);
  transition: opacity var(--t-med), transform .3s var(--ease-out), color var(--t-fast), background var(--t-fast), visibility 0s .3s;
  z-index: 120;
}
.to-top.is-visible { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
@media (hover: hover) {
  .to-top:hover { color: var(--accent-hi); }
}
.to-top:active { transform: scale(.93); color: var(--accent-hi); }
.to-top-ring {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}
.to-top-ring-bg, .to-top-ring-bar { fill: none; stroke-width: 1.75; }
.to-top-ring-bg { stroke: var(--line-2); }
.to-top-ring-bar {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 138.2;
  stroke-dashoffset: calc(138.2px * (1 - var(--scroll-progress, 0)));
}
.to-top-arrow { display: block; pointer-events: none; }

/* ---------- 404 ---------- */
.notfound { display: flex; align-items: center; justify-content: center; min-height: 62vh; }
.notfound-card { text-align: center; padding: clamp(30px, 6vw, 60px) 0; }
.notfound-code {
  font-family: var(--font-serif);
  font-size: clamp(76px, 13vw, 128px);
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -.02em;
}
.notfound-title {
  margin: 18px 0 8px;
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  color: var(--fg);
}
.notfound-desc { margin: 0 0 26px; font-size: var(--fs-base); color: var(--fg-2); }
.notfound-actions { display: flex; justify-content: center; gap: 12px; }

/* ---------- 页脚（2.7.1 起在中栏列内；2.9.0 B1 方案：纯纸面 + 极简尾花 + 版权主次对比） ---------- */
.footer {
  /* 短页面（文章少）时把页脚推到一屏底部，避免它在纸面中段吊着 */
  margin-top: auto;
  padding: 36px var(--main-inset) 44px;
  border: 0;
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: var(--fs-sm); letter-spacing: .02em;
  color: var(--fg-2);
  text-align: center;
}
.footer-inner { max-width: 560px; margin-inline: auto; }
.footer-mark {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0 auto 18px;
}
.footer-mark span { width: 18px; height: 1px; background: var(--line); }
.footer-mark i {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); opacity: .78;
}
.footer-line { margin: 5px 0; line-height: 1.65; color: var(--fg-2); }
.footer-line a { color: var(--fg-2); transition: color var(--t-fast); }
.footer-line a:hover { color: var(--accent); }
.footer-line:first-of-type a { font-family: var(--font-serif); font-weight: 600; }
.footer-running:not(:empty)::before { content: " · "; color: var(--fg-3); font-weight: 400; }
.footer-power {
  font-family: var(--font-mono);
  font-size: var(--fs-xs); letter-spacing: .08em;
  color: var(--fg-3);
}

/* ---------- 代码复制 / 图片查看 ---------- */
/* post.js 把 pre 包进 .code-block，按钮挂 wrapper 上：
   基准脱离 pre 后横向滚动不再把按钮带出视野 */
.code-block { position: relative; }
.code-lang {
  position: absolute; top: 10px; right: 14px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs); letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(222, 216, 205, .48);
  pointer-events: none;
  transition: opacity var(--t-fast);
}
.code-block:hover .code-lang,
.code-block:focus-within .code-lang { opacity: 0; }
.code-copy {
  position: absolute; top: 10px; right: 10px;
  padding: 4px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  opacity: 0;
  cursor: pointer;
  transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.code-block:hover .code-copy,
.code-copy:focus-visible { opacity: 1; }
.code-copy:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.code-copy.is-copied { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); opacity: 1; }
@media (hover: none) {
  .code-copy { opacity: 1; }
  .code-lang { display: none; }
}

.lightbox {
  position: fixed; inset: 0;
  z-index: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 24px;
  background: rgba(8, 7, 6, .88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none;
  visibility: hidden;
  transition: opacity var(--t-med), visibility var(--t-med);
}
.lightbox.is-open { opacity: 1; pointer-events: auto; visibility: visible; }
.lightbox img {
  max-width: 92vw; max-height: 84vh;
  border-radius: 4px;
  transform: scale(.97);
  transition: transform .3s var(--ease-out);
}
.lightbox img:focus { outline: none; }
.lightbox.is-open img { transform: none; }
.lightbox-close {
  position: absolute; top: max(16px, env(safe-area-inset-top)); right: max(18px, env(safe-area-inset-right));
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  background: rgba(21, 19, 16, .65);
  color: rgba(237, 232, 223, .88);
  font-size: var(--fs-lg); line-height: 1;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.lightbox-close:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lightbox-cap {
  max-width: 78vw;
  font-family: var(--font-mono);
  font-size: var(--fs-xs); letter-spacing: .03em;
  color: rgba(237, 232, 223, .75);
  text-align: center;
}
.lightbox-cap:empty { display: none; }

/* 中栏偏窄时（900–1050）缩略图挤占文字，收到 160，meta 只留「分类 · 日期」 */
@media (max-width: 1050px) {
  .feed-meta .meta-extra { display: none; }
  .feed-thumb { width: 160px; }
}

/* ---------- 响应式：从三段式收成单栏（900 以下；roysgen 用 lg=992，这里再放宽一档） ---------- */
@media (width < 900px) {
  :root { --main-inset: 4px; --topbar-h: calc(56px + env(safe-area-inset-top)); }
  /* 移动端单栏：整页同色平铺，不露出桌面色边 */
  body {
    background-color: var(--bg);
    background-image: none;
  }
  .intro-sweep-base { background: var(--bg); }
  .layout {
    grid-template-columns: minmax(0, 1fr);
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
  }
  .rail, .sidebar-column { display: none; }
  /* roysgen 在 <lg 时整条隐藏单图缩略图（卡片上的 d-none d-lg-block） */
  .feed-thumb { display: none; }
  .feed-item { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main"; }
  .feed-item-gallery { grid-template-areas: "main" "gallery" "meta"; }
  .pagination-inner :is(a, span), .page-num { min-width: 44px; height: 44px; font-size: var(--fs-sm); }
  .topbar { padding-top: env(safe-area-inset-top); gap: 6px; }
  .topbar-actions { gap: 2px; }
  .topbar .icon-btn, .drawer-head .icon-btn { width: 44px; height: 44px; }
  .topbar .topbar-burger { display: inline-flex; }
  .topbar .brand { display: inline-flex; flex-shrink: 1; font-size: var(--fs-lg); }
  .brand-text { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
  .topbar .brand:focus-visible { outline-offset: -2px; }
  .topnav { display: none; }
  .topbar .topbar-scheme { display: inline-flex; }
  /* 移动端播放器收进抽屉，右下角常驻条隐藏 */
  .player-float { display: none; }
  /* 抽屉里的播放器触控目标保持充足点击区，同时压低卡片总高 */
  .drawer .player-play { width: 40px; height: 40px; flex-basis: 40px; }
  .drawer .player-skip { width: 38px; height: 38px; }
  .drawer .player-list-toggle { min-height: 36px; padding: 4px 8px; }
  /* 复制按钮悬浮在代码上，44px 会遮两行代码，折中 36px */
  .code-copy { min-height: 36px; padding: 4px 14px; }
  .banner {
    aspect-ratio: 21 / 9;
    max-height: none;
    margin: calc(8px + env(safe-area-inset-top)) var(--main-inset) 8px;
  }
  .to-top { display: flex; right: max(16px, env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom)); }
}

@media (min-width: 900px) {
  .drawer, .drawer-mask, .to-top { display: none; }
}

@media (max-width: 860px) {
  .page-head { padding: 2px 0 16px; }
}

@media (max-width: 720px) {
  /* 手机屏窄，2.8 的放大只保留在桌面；正文/摘要兜底 >=16px 保证移动端可读性 */
  body { font-size: var(--fs-base); }
  /* 条目靠留白分界：上下各 26px（相邻条目 52px）。
     内部节奏对齐参考站：标题/摘要/meta 之间 8px，摘要 16px / 行高 1.65 / 最多两行，
     图组离 meta 10px、图间 8px。 */
  .feed-item { padding-block: 26px; gap: 6px; }
  .feed-item-gallery { gap: 0; }
  .feed-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
  .feed-gallery-item:nth-child(n + 3) { display: none; }
  .feed-title { font-size: var(--fs-lg); line-height: 1.42; margin-bottom: 8px; }
  .feed-excerpt { font-size: var(--fs-base); line-height: 1.65; }
  .feed-item-plain .feed-excerpt { -webkit-line-clamp: 2; }
  .feed-meta { font-size: var(--fs-xs); margin-top: 8px; }
  .feed-item-gallery .feed-meta { margin-top: 9px; }
  .post-title { font-size: clamp(26px, 7.4vw, 34px); }
  /* 单列堆叠时两格保持对角呼应：「上一篇」居左、「下一篇」居右；字号同步按移动正文收小 */
  .post-nav { grid-template-columns: 1fr; padding: 2px 14px; }
  .post-nav-cell { padding: 13px 0; gap: 5px; }
  .post-nav-label { font-size: var(--fs-xs); }
  .post-nav-cell a { font-size: var(--fs-base); line-height: 1.48; }
  .footer {
    padding-block: 28px 36px;
    font-size: var(--fs-xs);
  }
  .footer-power { font-size: var(--fs-xs); }
}

/* 超宽屏：中栏内容右缩一点点，给中栏/右栏分界线留呼吸；缩略图放大，压缩图文空档 */
@media (min-width: 1800px) {
  .content { padding-right: 56px; }
  .feed-thumb { width: 220px; }
}

/* ---------- 动效可达性 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
  html { scroll-behavior: auto; }
  .feed-item { opacity: 1; }
  .intro { display: none !important; }
}
