/* ---------------------------------------------------------------
   卡夫卡Kavka · 摄影作品集
   固定左侧导航 / 右侧内容区 / 细字排版 / 双主题（暗房·明室）
--------------------------------------------------------------- */
:root {
  /* 默认深色（关灯）= 胶片暗房：炭棕底 + 微弱安全红光，低对比、柔和不刺眼 */
  --bg: #17130f;
  --bg-panel: #1d1813;
  --ink: #ded4c4;
  --dim: #9c9081;
  --faint: #6e6256;
  --line: #332b23;
  --pic-bg: #221c17;
  /* 暗房安全灯：像从一扇窗透进来 —— 主光窗在内容区偏上，
     另外两处弱光斑叠出不规则的强弱，右缘与中部继续漫射到空白区。
     多层 fixed 背景：灯固定在视口、不随滚动移动；不用纯红，
     叠在炭棕上仍是「显影时的暗红余晖」，不压文字也不刺眼。 */
  /* 统一光场：侧栏与内容区共用 body 的 fixed 背景，不再各画一层 ——
     两层独立背景会在 #menu 右边界（212px）出现数值跳变，形成竖直接缝。
     侧栏边缘光用像素定位在 212px、横向半径只 72px，跨过边界向两侧连续衰减；
     头像标题那片（x<140）仍在光斑之外，保持纯炭棕。 */
  --glow:
    radial-gradient(ellipse 72px 300px at 212px 160px, rgba(180,64,40,.15) 0%, rgba(142,48,32,.05) 42%, transparent 78%),
    radial-gradient(ellipse 56% 64% at 50% 2%, rgba(186,68,42,.18) 0%, rgba(148,52,34,.09) 40%, rgba(96,36,24,.025) 70%, transparent 88%),
    radial-gradient(ellipse 44% 52% at 27% 43%, rgba(162,56,36,.09) 0%, rgba(120,42,28,.035) 48%, transparent 76%),
    radial-gradient(ellipse 44% 66% at 97% 52%, rgba(172,62,40,.085) 0%, rgba(122,44,30,.03) 48%, transparent 82%);
  --menu-w: 212px;
  --pad-top: 22px;
}
body.light {
  /* 开灯 = 走出暗房：相纸米色，但饱和度降到六成——保留暖意，不再明显发黄。
     2026-11-24：整组色相(H)与亮度(L)不动，只把 S×0.6，明暗关系完全不变。 */
  --bg: #f1eee7;         /* 原 #f5efe3，S 47%→28% */
  --bg-panel: #ebe7de;   /* 原 #efe8da */
  --ink: #292622;        /* 暖黑影像，比纯黑柔和，像相纸上的银盐 */
  --dim: #807970;
  --faint: #aea79f;
  --line: #d9d3c9;
  --pic-bg: #e8e3db;
  /* 极淡暖阳从上方斜进，只给方向感，不脏米色；光色同步去黄 */
  --glow: radial-gradient(ellipse 115% 80% at 60% 4%, rgba(203,182,141,.09) 0%, rgba(203,182,141,0) 62%);
  --menu-glow: radial-gradient(ellipse 120% 55% at 50% 0%, rgba(203,182,141,.06) 0%, rgba(203,182,141,0) 66%);
}

* { box-sizing: border-box; }

/* 思源黑体子集（全站中文，139KB；由全量字库按站内用字裁剪生成；文件名带哈希，缓存自动失效）。
   unicode-range 只接管 CJK 与中文标点：拉丁/数字仍走 Helvetica，不改标题字形。
   子集缺失的字会按 unicode-range 落回系统字体栈，不报错——新增文案后须重跑
   _tools/build_font_subset.py（脚本已修好 .mjs 漏扫），否则新字会静默变回系统字体。 */
@font-face {
  font-family: 'Noto Sans SC Subset';
  src: url('../fonts/noto-sans-sc.b9f7c6e5.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;   /* 先显示系统字体，字体到了再替换，弱网不留白 */
  unicode-range: U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF;
}

html, body { margin: 0; padding: 0; }

body {
  /* 两层背景：安全红光晕固定视口（滚动时「灯」不动），下垫炭棕实色 */
  background: var(--glow), var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 12px/1.75 "Helvetica Neue", Helvetica, Arial, "Noto Sans SC Subset", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .3s ease, color .3s ease;
}

img { border: 0; }

a { color: var(--dim); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--ink); }

/* ------------------------------ 侧栏 ------------------------------ */
#menu {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--menu-w);
  height: 100vh;
  padding: 0 12px 24px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  /* 透明：侧栏与内容区共用 body 的同一个 fixed 光场。
     过去这里另画一层 var(--menu-glow)，和 body 的 --glow 是两套渐变，
     在 x=var(--menu-w) 边界数值对不上，出现竖直接缝。
     同层背景连续绘制，接缝从根上消失；body 背景 fixed，滚动时灯仍不动。 */
  background: transparent;
  z-index: 30;
  -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column;
}
#menu::-webkit-scrollbar { width: 4px; height: 0; }
#menu::-webkit-scrollbar-thumb { background: var(--line); }
#menu::-webkit-scrollbar-track { background: transparent; }

.logo { display: block; margin: var(--pad-top) auto 0 auto; width: 56px; }
.logo img { display: block; width: 56px; height: 57px; background: var(--pic-bg); object-fit: cover; margin: 0 auto; }
/* 头像随明暗主题切换：默认（关灯/深色）用 logo-dark 黑乌鸦，
   body.light（开灯/浅色）用 logo-light 白乌鸦。两个 picture 叠在同一位置，
   用 display 二选一，纯 CSS 无 JS，切换瞬间无闪烁、无二次请求。 */
.logo .logo-light { display: none; }
body.light .logo .logo-dark { display: none; }
body.light .logo .logo-light { display: block; }

/* 桌面端：头像与标题纵向堆叠、居中 */
.menu-head { display: flex; flex-direction: column; align-items: center; }

.title {
  margin: 10px 0 0 0;
  font-size: 21px; line-height: 1.25; color: var(--ink); letter-spacing: .01em;
  font-weight: 500; text-align: center;
}
.title a { color: var(--ink); }
.title small {
  display: block; margin-top: 5px;
  font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); font-weight: 400;
}

/* 侧栏内的作品标题 + 导语（首页专用） */
.side-head { margin-top: 26px; text-align: center; }
.side-head .side-title {
  /* 两行居中：第一行作品名，第二行「作品 N 幅」。
     侧栏内容区仅 188px（212px 减去左右各 12px padding）。
     标题单独渲染 1 行塞得进 188px；旧版把「· 作品 N 幅」拼在同一行会到 216px、
     溢出 28px 被裁。2026-11-22 拆成两行，两行都继承 .side-head 的 text-align:center。
     2026-11-22 改为 Hommage à Franz Kafka：去掉 uppercase，保留原样大小写。 */
  font-size: 10px; letter-spacing: .01em; text-transform: none; color: var(--ink);
  line-height: 1.6; white-space: nowrap;
}
.side-head .side-title .side-count {
  display: block;                 /* 独立第二行 */
  color: var(--dim); font-weight: 400;
  font-size: 10px; letter-spacing: 0; text-transform: none;
  margin-top: 1px;
}
.side-head .side-sub { color: var(--dim); font-size: 11px; letter-spacing: .04em; margin-top: 2px; }
/* 首页导语：桌面 7 行左对齐（每行缩进两字），移动端 4 行居中（两套 DOM 按断点切换）。
   桌面把长句拆成短行，每行都在 188px 侧栏里单行放得下；
   缩进占 2em≈21px，剩余 167px 仍够最长行。 */
.side-head .side-intro { margin-top: 14px; color: var(--dim); font-size: 10.5px; line-height: 1.9; text-align: left; }
.side-head .side-intro p { margin: 0; }
.side-head .side-intro .intro-pc p { padding-left: 2em; }   /* 两个中文字宽 */
.side-head .side-intro .intro-mobile { display: none; }

#menu .container { padding: 30px 0 0 0; margin-top: auto; width: 100%; }
#menu ul { list-style: none; margin: 0 0 26px 0; padding: 0; }
#menu li { padding-left: 10px; font-size: 12px; }
#menu li.section-title {
  padding-left: 10px; margin-bottom: 8px;
  font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--faint);
}
#menu li a { display: block; padding: 3px 0; color: var(--ink); opacity: .58; }
#menu li a:hover { opacity: 1; }
#menu li.active a { opacity: 1; font-weight: 600; }
#menu li a .n { color: var(--faint); margin-right: 8px; font-variant-numeric: tabular-nums; }
#menu .foot { padding-left: 0; font-size: 11px; color: var(--dim); text-align: center; width: 100%; }
#menu .foot p { margin: 0 0 4px; }

/* ------------------------------ 内容 ------------------------------ */
#content {
  margin-left: var(--menu-w);
  padding: var(--pad-top) 44px 30px 0;
  min-height: 100vh;
}
.container-inner { max-width: 1040px; margin: 0 auto; }

.page-head { margin: 0 0 22px; }
.page-head h1 {
  margin: 0; font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
}
.page-head .sub { color: var(--dim); font-size: 11px; letter-spacing: .04em; margin-top: 3px; }

.intro { max-width: 540px; color: var(--dim); font-size: 12px; line-height: 2; margin: 0 0 34px; }
.rule { height: 1px; background: var(--line); margin: 0 0 26px; max-width: 1040px; }

/* ------------------------------ 首页照片墙 ------------------------------ */
/* 4 列真瀑布流：生成器按最短列分配，每列顶部对齐、底部自然不齐 */
.wall { display: flex; align-items: flex-start; gap: 18px; max-width: 1040px; margin: 0 auto; }
.wall-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
/* 列数按宽度分档：≤860 两列 / 861–1099 三列（iPad 竖屏）/ ≥1100 四列。
   HTML 恒定生成 4 个列容器（最短列填充），多出来的容器由 main.js 重排后隐藏。
   html.col-N 这个类是 head 内联脚本在解析 <body> 之前就打上的，
   所以首帧就是最终列数，不会先画 4 列再跳成 3 列。 */
html.col-2 .wall-col:nth-child(n + 3) { display: none; }
html.col-3 .wall-col:nth-child(n + 4) { display: none; }
.wall-item {
  display: block; position: relative; overflow: hidden;
  background: var(--pic-bg); line-height: 0;
}
.wall-item .pic { display: block; position: relative; overflow: hidden; background: var(--pic-bg); line-height: 0; }
.wall-item .pic picture { display: block; width: 100%; height: 100%; position: relative; z-index: 1; }

/* ---- 照片墙：最小模糊图占位 → 清晰（blur-up） ----
   参数：blur(14px) / scale(1.06) / filter 走 .7s。
   默认态是「清晰正常显示」，只有 <head> 内联脚本给 html 加上 .blur-up
   才启用模糊态 —— JS 被禁用或中途挂掉时，从根上不会留下 104 张永久糊图。 */
.wall-item .lqip { display: none; }
.wall-item .pic img {
  display: block; width: 100%; height: auto; opacity: 1;
  transition: transform .7s cubic-bezier(.19,.72,.22,1);
}
.wall-item:hover .pic img { transform: scale(1.02); }

/* ---- PC 端跟随鼠标的对焦框光标 ----
   一个固定定位的 DOM 元素跟随鼠标：38×38 的四角 L 形框（4 个 span）+ 中心 4px 圆点。
   JS 用 rAF 做 0.7 平滑缓动，hover 到可点击元素（链接/按钮/墙图）时加 .locked：
   框缩到 .68、圆点变绿，给出对焦锁定反馈。
   只在精确指针设备启用（触屏不挂）；不隐藏系统指针，两者并存。 */
@media (hover: hover) and (pointer: fine) {
  .wall-item { cursor: crosshair; }
  .cursor-fx {
    position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none;
    opacity: 0; transition: opacity .25s ease; will-change: transform;
  }
  .cursor-fx.on { opacity: 1; }
  .cursor-fx .frame {
    position: absolute; left: -19px; top: -19px; width: 38px; height: 38px;
    transition: transform .18s cubic-bezier(.16,1,.3,1);
  }
  .cursor-fx .frame span {
    position: absolute; width: 9px; height: 9px; border-color: #c9a558e6;
    border-style: solid; border-width: 0;
  }
  .cursor-fx .frame span:nth-child(1) { left: 0; top: 0; border-left-width: 1.5px; border-top-width: 1.5px; }
  .cursor-fx .frame span:nth-child(2) { right: 0; top: 0; border-right-width: 1.5px; border-top-width: 1.5px; }
  .cursor-fx .frame span:nth-child(3) { left: 0; bottom: 0; border-left-width: 1.5px; border-bottom-width: 1.5px; }
  .cursor-fx .frame span:nth-child(4) { right: 0; bottom: 0; border-right-width: 1.5px; border-bottom-width: 1.5px; }
  .cursor-fx .dot {
    position: absolute; left: -2px; top: -2px; width: 4px; height: 4px; border-radius: 999px;
    background: #c9a558f2; transition: background .15s ease, transform .15s ease;
  }
  .cursor-fx.locked .frame { transform: scale(.68); }
  .cursor-fx.locked .dot { background: #7ee787; transform: scale(1.35); }

  /* 图片上的对角框（:before / :after 两个伪元素）：hover 墙图时，
     左上 + 右下两个 L 角淡入收拢，贴在图的内边角；与跟随鼠标的光标并存。
     金色与光标统一；画在 .wall-item（position:relative）上，z-index:3 不随 img 缩放。 */
  .wall-item:before, .wall-item:after {
    content: ""; position: absolute; width: 20px; height: 20px; opacity: 0;
    transition: opacity .45s ease, transform .45s cubic-bezier(.16,1,.3,1);
    pointer-events: none; z-index: 3;
  }
  .wall-item:before {
    top: 10px; left: 10px;
    border-top: 1.5px solid #c9a558e6; border-left: 1.5px solid #c9a558e6;
    transform: translate(4px, 4px);
  }
  .wall-item:after {
    bottom: 10px; right: 10px;
    border-bottom: 1.5px solid #c9a558e6; border-right: 1.5px solid #c9a558e6;
    transform: translate(-4px, -4px);
  }
  .wall-item:hover:before, .wall-item:hover:after { opacity: 1; transform: translate(0); }
}

html.blur-up .wall-item .lqip {
  display: block; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  filter: blur(12px); transform: scale(1.08);   /* 微放大盖住 blur 在边缘的透色 */
  transition: opacity .9s ease;   /* 与高清显影同步，避免底先消失露纯色 */
  transition-delay: var(--dev-delay, 0ms);   /* 暗房显影液扩散：与高清同步错开，避免露纯色底 */
}
/* 暗房冲洗显影：0.9s 柔和凝实，不弹不闪。
   contrast .92→1 极轻抬一点，像影像缓缓定影；起始 blur 保持 14px 不加大
   （再大会在 scale(1.06) 边缘透出底色）。
   液态柔弱：filter 走黏滞曲线 cubic-bezier(.28,.08,.45,1)（慢起→柔收），
   不做 blur 数值回弹（回弹会像抖动，不像药液）；逐图叠加 --dev-delay
   （到墙左上角的距离，峰值 140ms）形成极弱的显影液扩散，无方向性扫光。 */
html.blur-up .wall-item .pic img {
  opacity: 0; filter: blur(14px) contrast(.92); transform: scale(1.06);
  transition: opacity .9s ease, filter .9s cubic-bezier(.28,.08,.45,1), transform .9s ease;
  transition-delay: var(--dev-delay, 0ms);
}
html.blur-up .wall-item .pic img.is-hd { opacity: 1; filter: none; transform: scale(1); }
html.blur-up .wall-item:hover .pic img.is-hd { transform: scale(1.02); }
html.blur-up .wall-item.is-hd .lqip { opacity: 0; }
html.blur-up .wall-item.is-done .lqip { display: none; }   /* 揭晓完移除合成层，省 GPU */
html.blur-up .wall-item.is-error .lqip { filter: blur(3px); transform: none; }  /* 高清失败：留可辨认的淡糊图 */

/* 暗房药液光泽：极淡暗红随显影从左侧漫过，淡入淡出、不留残影。
   · 只在暗房 body:not(.light) + 显影中 .is-hd 播放一次；明室侧这条伪元素不存在。
   · 背景是渐变非纯色、峰值 alpha≤.17，叠上动画 opacity≤.9，实际最浓约 .15，不显脏。
   · animation-delay 复用 --dev-delay，与 filter 显影节奏完全同步。
   · pointer-events:none 不拦点击；z-index:2 盖在 picture(1) 之上、对角框(3) 之下。 */
html.blur-up body:not(.light) .wall-item .pic::after {
  content: "";
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  opacity: 0;
  background: linear-gradient(105deg,
    rgba(143,46,34,.17) 0%,
    rgba(168,58,38,.10) 32%,
    rgba(168,58,38,.03) 55%,
    transparent 75%);
}
html.blur-up body:not(.light) .wall-item.is-hd .pic::after {
  animation: dev-sheen 1s cubic-bezier(.28,.08,.45,1) var(--dev-delay, 0ms) 1;
}
@keyframes dev-sheen {
  0%   { opacity: 0;   transform: translateX(-14%); }
  30%  { opacity: .9; }
  100% { opacity: 0;   transform: translateX(12%); }
}

/* ---- 明室：「相纸浮现」加载 ----
   暗房是药液里慢慢显影（blur 14px → 0，0.9s + 350ms 停留）；
   明室是相纸从暗到亮浮出来。占位是 24px 极小图
   直接放大（像素糊，零 CSS 滤镜），不是高斯模糊；高清图同样不带 blur，
   而是 opacity 0→1 + grayscale 18%→0 + brightness .94→1 +
   contrast .97→1 + scale 1.012→1，0.7s ease-out。
   扫过感压到极弱：明暗幅度降到原来的 1/3 左右，列错开改 25ms 阶梯
   （150 / 175 / 200 / 225ms），只留几乎察觉不到的自然层次，无方向性扫光。
   只作用于 body.light，暗房规则完全不受影响。 */
html.blur-up body.light .wall-item .lqip {
  filter: none;              /* 极小图占位为零滤镜；暗房仍走 blur(12px) */
  transform: none;           /* 不放大盖边——极小图本身有实边，放大反而糊 */
  transition: opacity .7s ease-out;
  transition-delay: var(--reveal-delay, 0ms);
}
html.blur-up body.light .wall-item .pic img {
  opacity: 0;
  filter: grayscale(.18) brightness(.94) contrast(.97);
  transform: scale(1.012);
  transition: opacity .7s ease-out, filter .7s ease-out, transform .7s ease-out;
  transition-delay: var(--reveal-delay, 0ms);
}
html.blur-up body.light .wall-item .pic img.is-hd {
  opacity: 1; filter: none; transform: scale(1);
}
html.blur-up body.light .wall-item:hover .pic img.is-hd { transform: scale(1.02); }
html.blur-up body.light .wall-item.is-error .lqip { filter: blur(3px); transform: none; }

/* 保险丝：main.js 未能启动时 10s 后强制显示清晰图，绝不静默卡在模糊态 */
html.blur-up-failsafe .wall-item .pic img { opacity: 1; filter: none; transform: scale(1); }
html.blur-up-failsafe .wall-item .lqip { opacity: 0; }
/* 明室的延迟变量不能盖过保险丝 */
html.blur-up-failsafe body.light .wall-item .pic img { opacity: 1; filter: none; transform: scale(1); transition-delay: 0s; }
html.blur-up-failsafe body.light .wall-item .lqip { opacity: 0; transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) {
  html.blur-up .wall-item .lqip, html.blur-up .wall-item .pic img { transition-duration: 0s; transition-delay: 0s; }
  html.blur-up body.light .wall-item .lqip,
  html.blur-up body.light .wall-item .pic img { transition-duration: 0s; transition-delay: 0s; }
  html.blur-up body:not(.light) .wall-item.is-hd .pic::after { animation: none; }  /* 药液光泽：尊重减少动效 */
}

/* ---- 图片保护：禁选中 / 禁拖拽 / 禁 iOS 长按弹「存储图像」 ----
   只防普通用户操作，挡不住开发者工具、直接访问 images/ 地址、截图与抓包。 */
img, picture, .lqip, .wall-item .pic, #fs .fs-stage, .viewer .stage {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
img { -webkit-user-drag: none; -khtml-user-drag: none; }

/* 返回顶部按钮：固定在照片墙右侧 */
#to-top {
  position: fixed; right: 22px; bottom: 28px; z-index: 150;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-panel);
  color: var(--dim); font-size: 20px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 1; pointer-events: auto;
  transition: border-color .2s ease, color .2s ease, background .2s ease, opacity .35s ease;
}
#to-top:hover { border-color: var(--faint); color: var(--ink); }
/* 3 秒无操作后淡出；pointer-events:none 保证透明按钮不抢右下角照片的点击 */
#to-top.hide { opacity: 0; pointer-events: none; }

/* ------------------------------ 看图器 ------------------------------ */
body.album #content {
  display: flex; flex-direction: column;
  height: 100vh; padding-bottom: 18px; overflow: hidden;
}
body.album .page-head { flex: 0 0 auto; }
.viewer {
  position: relative;
  display: flex; flex-direction: column;
  flex: 1 1 auto; min-height: 0;
}
.stage {
  position: relative; flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}
.stage.loading-all::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--line); border-top-color: var(--faint);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.layer { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; }
.layer picture { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.layer img {
  display: block; max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; background: transparent;
  opacity: 0; transition: opacity .5s ease;
}
.layer img.in { opacity: 1; }

.nz { position: absolute; top: 0; bottom: 0; width: 24%; cursor: pointer; z-index: 2; }
.nz.prev { left: 0; cursor: w-resize; }
.nz.next { right: 0; cursor: e-resize; }
@media (hover: hover) {
  .nz.prev:hover ~ .arrow.left, .nz.next:hover ~ .arrow.right { opacity: 1; }
}
.arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 3; opacity: 0; transition: opacity .25s ease;
  width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: var(--bg-panel); color: var(--ink); font-size: 17px; line-height: 38px; text-align: center;
  cursor: pointer; box-shadow: 0 1px 10px rgba(0,0,0,.25);
  border: 1px solid var(--line);
}
.arrow:hover { opacity: 1; }
.arrow.left { left: 10px; }
.arrow.right { right: 10px; }

.bar {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 12px 0 0; color: var(--dim); font-size: 11px; letter-spacing: .1em;
}
.bar .num { min-width: 92px; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: .12em; color: var(--ink); }
.bar .sep { width: 1px; height: 12px; background: var(--line); margin: 0 10px; }
.icon-btn {
  background: none; border: 0; padding: 3px 7px; cursor: pointer;
  color: var(--dim); font-size: 11px; letter-spacing: .1em; font-family: inherit;
}
.icon-btn:hover { color: var(--ink); }
.icon-btn.on { color: var(--ink); }
.bar .cap { margin-left: auto; color: var(--faint); letter-spacing: .04em; text-align: right; }
.bar .cap.hide { display: none; }

/* ------------------------------ 全屏看图 ------------------------------ */
#fs {
  position: fixed; inset: 0; z-index: 200;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  background: var(--glow), var(--bg);
  /* 整个浮层都是手势区（照片上下留白也能滑），系统原生手势全部交给 JS */
  touch-action: none; overscroll-behavior: contain;
}
#fs.on { display: flex; }

/* 舞台：裁掉翻页时露出的左右两格；下滑退场的位移/缩放也作用在这一层 */
#fs .fs-stage {
  position: relative; flex: 1 1 auto; min-height: 0; width: 100%;
  overflow: hidden; will-change: transform;
}
/* 横向轨道：跟手由 JS 1:1 写 scrollLeft（合成层承载，不用 transform 逐帧抖动）。
   刻意不用 scroll-snap —— 原生吸附的时长/缓动由系统决定，iOS 上是硬吸，没有减速。 */
#fs .fs-scroller {
  position: absolute; inset: 0;
  display: flex; flex-flow: row nowrap;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: none;
  scrollbar-width: none;
}
#fs .fs-scroller::-webkit-scrollbar { display: none; }
#fs .fs-track { display: flex; flex: 0 0 300%; width: 300%; height: 100%; }
#fs .fs-slide {
  flex: 0 0 33.3333%; width: 33.3333%; height: 100%;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
#fs .fs-pic {
  display: block; max-width: calc(100vw - 120px); max-height: 100%;
  width: auto; height: auto; object-fit: contain;
  opacity: 0; transition: opacity .34s ease;
  -webkit-user-drag: none; user-select: none;
}
#fs .fs-pic.in { opacity: 1; }
/* seed 占位：从墙点进全屏的瞬间，中格先用墙上那张已解码的 w 档 640px 图顶上。
   640px 按 width:auto 只会显示 640px 宽（占不满屏），而最终 f 档会撑到 max 限幅后的
   满屏尺寸 —— 于是视觉上「先小图后大图」跳一下。给 seed 图设 width:100%，
   让它在与 f 档相同的 max-width/max-height 盒子里用 object-fit:contain 渲染；
   w/m/f 宽高比相同，seed 的图像内容会与最终结果像素级重合，跳变消失。
   lo/f 解码到位后由 JS 移除本 class，回到自然尺寸渲染。 */
#fs .fs-pic.seed { width: 100%; }

/* 上面那 120px 是给左右翻页箭头留的横向余量。但箭头只在 :hover 时才显现，
   触摸设备（iPad 等 hover:none）永远触发不了 :hover —— 箭头 opacity 恒为 0，
   这 120px 就纯粹是把照片缩小了：iPad Pro 13 竖屏 1024×1366 实测照片被压到
   904×603，左右各空 60px、上下各空 382px（照片只占屏幕面积 39%）。
   所以按「能不能 hover」而不是按屏宽决定要不要留这 120px。 */
@media (hover: none) {
  #fs .fs-pic { max-width: 100vw; }
}

/* 顶部信息条：左上角页码（3 秒后自动隐藏） */
#fs .fs-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 210;
  display: flex; align-items: center; justify-content: flex-start;
  padding: 16px 20px; pointer-events: none;
  transition: opacity .3s ease;
}
#fs .fs-top.hide { opacity: 0; }
#fs .fs-num { color: var(--dim); font-size: 12px; letter-spacing: .08em; font-variant-numeric: tabular-nums; }

/* 关闭按钮（X）：独立元素，但和顶部信息条共用 3 秒隐藏计时器（showTop）。
   层级高于开关灯；隐藏时 pointer-events:none，不会拦住右上角照片的点击。 */
#fs .fs-close {
  position: absolute; top: 16px; right: 20px; z-index: 310;
  width: 34px; height: 34px; line-height: 34px; text-align: center;
  border: 0; background: none; color: var(--dim); font-size: 20px; cursor: pointer;
  border-radius: 50%; pointer-events: auto;
  transition: background .2s ease, color .2s ease, opacity .3s ease;
}
#fs .fs-close:hover { background: rgba(128,128,128,.15); color: var(--ink); }
#fs .fs-close.hide { opacity: 0; pointer-events: none; }

/* 拍摄参数：浮在照片下方居中，3 秒后隐藏 */
#fs .fs-caption {
  position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%);
  z-index: 212; max-width: 92%; white-space: normal; overflow: visible; text-overflow: clip;
  text-align: center; line-height: 1.5;
  color: var(--dim); font-size: 11px; letter-spacing: .06em;
  background: rgba(0,0,0,.42); color: #ddd; padding: 6px 16px; border-radius: 999px;
  opacity: 1; transition: opacity .35s ease;
  pointer-events: none;
}
body.light #fs .fs-caption { background: rgba(0,0,0,.06); color: #666; }
#fs .fs-caption.hide { opacity: 0; }

/* 左右翻页箭头（PC 端）
   原来由 #fs:hover 驱动：鼠标只要停在页面上（等于一直 hover）就永远亮着。
   现在默认可见，交给 showTop() 与页码 / EXIF / X / 开灯胶囊同一条 3 秒计时，
   鼠标一动、翻页、点按都重新计时。 */
#fs .fs-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 56px; height: 72px; z-index: 209;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: none; cursor: pointer;
  opacity: 1; transition: opacity .25s ease;
}
#fs .fs-nav.hide { opacity: 0; pointer-events: none; }
#fs .fs-nav.l { left: 14px; }
#fs .fs-nav.r { right: 14px; }
#fs .fs-nav .t {
  font-size: 44px; line-height: 1; color: var(--dim); font-weight: 300;
  transition: transform .2s ease;
}
#fs .fs-nav:hover .t { transform: scale(1.15); color: var(--ink); }

/* 触摸设备不显示翻页箭头（靠滑动/键盘）。
   原先 opacity:0 只是「看不见」，点击区仍在，容易误触；改成直接不渲染。
   用 hover:none 而不是 any-pointer:coarse —— iPad 接了鼠标/妙控板时
   hover 变 hover:hover，这时箭头该显示、也能点。 */
@media (hover: none) {
  #fs .fs-nav { display: none; }
}

/* 移动端隐藏左右箭头（触摸屏靠滑动/点按） */
@media (max-width: 860px) {
  #fs .fs-nav { display: none; }
  #fs .fs-pic { max-width: 100vw; max-height: 100%; }
  #fs .fs-top { padding: 12px 14px; }
}

/* 拍摄参数：照片下方的普通文字，不再悬浮 / 不压在照片上。
   舞台高度由 JS 按当前照片比例收紧（fitStage），让文字紧贴照片下沿。

   判据是「窄屏 **或** 存在粗指针（触摸屏）」，不是只看屏宽：
   iPad Pro 13 竖屏 1024px 走的是桌面布局，若只按屏宽判断，EXIF 会被
   position:absolute + bottom:40px 钉在屏幕最底部，跟照片比例无关；
   而 iPad mini 竖屏 768px 走移动端分支，EXIF 随照片下沿移动 —— 同一款
   产品两种行为。

   用 any-pointer:coarse 而不是 (hover:none) and (pointer:coarse)：
   iPad 接了妙控鼠标/触控板后 hover 会变成 hover:hover、pointer 变成 fine，
   但触摸屏这个「粗指针」始终存在，any-pointer:coarse 恒为真，判据不会跳变。
   无触摸的台式/笔记本不命中，仍保持悬浮在底部。 */
@media (max-width: 860px), (any-pointer: coarse) {
  #fs .fs-caption {
    position: static; left: auto; bottom: auto; transform: none;
    z-index: auto; max-width: 90%;
    flex: 0 0 auto; margin: 10px 12px 12px;
    white-space: normal; overflow: visible; text-overflow: clip;
    background: none; padding: 0; border-radius: 0;
    color: var(--dim); font-size: 11px; letter-spacing: .06em;
    line-height: 1.6; text-align: center;
  }
  body.light #fs .fs-caption { background: none; color: var(--dim); }
}

/* ------------------------------ 全局开关灯按钮 ------------------------------ */
#light-toggle {
  position: fixed; top: 16px; right: 22px; z-index: 300;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-panel);
  color: var(--dim); font-size: 12px; letter-spacing: .05em; cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease, opacity .3s ease;
}
#light-toggle:hover { border-color: var(--faint); color: var(--ink); }
/* 圆点是「灯」本身：暗房=安全红灯，明室=相纸见到的暖阳。
   光晕用 box-shadow 而非滤镜，6px 点上只散一圈微光，不抢文字。 */
#light-toggle .light-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #8f2e22;                              /* 暗房：显影安全灯的暗红 */
  box-shadow: 0 0 7px 1px rgba(168,58,38,.45);
}
body.light #light-toggle .light-dot {
  background: #c4a56a;                              /* 明室：暖金/黄铜，呼应见光 */
  box-shadow: 0 0 7px 1px rgba(201,165,106,.38);
}

/* 全屏看图时隐藏开关灯胶囊：用户要求全屏下不显示灯按钮。
   X 关闭按钮仍在 right:20px，位置不变（原本灯按钮左移只是为了给它腾位，现已无需）。 */
body.fs-open #light-toggle { display: none; }
#light-toggle.hide { opacity: 0; pointer-events: none; }

/* ------------------------------ 文本页 ------------------------------ */
.text h2 { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin: 26px 0 6px; font-weight: 500; }
.text p { margin: 0 0 14px; }
.text ul { margin: 0 0 14px; padding-left: 16px; }
.text a { color: var(--ink); border-bottom: 1px solid var(--line); }
.text a:hover { border-color: var(--ink); }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 4px 14px; margin: 0 0 22px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; color: var(--ink); }

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 860px) {
  /* 移动端侧栏是顶部横条、没有 x=212px 的竖边界，
     去掉那条像素定位的边缘光斑（否则会在屏幕中间留一根竖光带）。 */
  :root {
    --glow:
      radial-gradient(ellipse 80% 52% at 46% 2%, rgba(186,68,42,.17) 0%, rgba(148,52,34,.085) 42%, rgba(96,36,24,.02) 72%, transparent 88%),
      radial-gradient(ellipse 44% 52% at 24% 44%, rgba(162,56,36,.085) 0%, rgba(120,42,28,.03) 48%, transparent 76%),
      radial-gradient(ellipse 46% 62% at 97% 54%, rgba(172,62,40,.08) 0%, rgba(122,44,30,.028) 48%, transparent 82%);
  }
  /* 移动端：开灯胶囊放在页面顶部右上角，随文档一起滚走，
     不再 fixed 悬浮在下滑后的照片上（桌面端保持原样）。
     body 提供定位上下文，保证 top/right 是相对文档顶部而不是视口。
     全屏看图时隐藏灯按钮（用户要求 PC/移动端一致），桌面同款规则在上方。 */
  body { position: relative; }
  #light-toggle { position: absolute; top: 14px; right: 16px; }
  body.fs-open #light-toggle { display: none; }

  #menu {
    position: static; width: auto; height: auto;
    padding: 14px 16px 12px; border-bottom: 1px solid var(--line);
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 18px;
  }
  /* 移动端：头像与标题左右排列、垂直居中 */
  .menu-head {
    flex-direction: row; align-items: center; gap: 12px;
    width: 100%;
  }
  .logo { margin: 0; flex: 0 0 auto; }
  .logo img { width: 44px; height: 45px; }
  .title { font-size: 17px; margin: 0; text-align: left; }
  .title small { margin-top: 2px; letter-spacing: .14em; }
  #menu .container { flex: 1 0 100%; padding: 8px 0 0; }
  #menu ul { display: flex; flex-wrap: nowrap; gap: 0 18px; margin: 0; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  #menu ul::-webkit-scrollbar { display: none; }
  #menu li { padding-left: 0; white-space: nowrap; font-size: 11.5px; }
  #menu li.section-title { display: none; }
  #menu .foot { display: none; }
  /* 移动端：侧栏作品标题 + 导语居中 */
  .side-head { margin-top: 14px; width: 100%; text-align: center; }
  .side-head .side-title { white-space: normal; }
  .side-head .side-intro { text-align: center; }
  .side-head .side-intro .intro-pc { display: none; }
  .side-head .side-intro .intro-mobile { display: block; }
  #content { margin-left: 0; padding: 16px 16px 24px; }
  body.album #content { height: auto; overflow: visible; }
  body.album .viewer { flex: 0 0 auto; height: 52vh; min-height: 240px; }
  /* 手机：真正的 2 列。
     原来 4 个列容器各占 46% 会折成「2 行 × 2 列」——上半页两列、下半页另两列，
     整页被拉到 ~18200px，要滚 9000px 才看到第 52 张。改成不折行：
     main.js 在 ≤860px 时把 191 张按序号重新分到前 2 个容器，其余 .is-extra 隐藏。 */
  .wall { gap: 12px; flex-wrap: nowrap; }
  .wall-col { gap: 12px; }
  .wall-col.is-extra { display: none; }
  .arrow { opacity: .9; }
  .bar .cap { display: none; }
}
