/* ============================================================
   NANATATA 个人网站 —— 样式
   §1 色板与主题   §2 基础与像素字   §3 场景与颗粒   §4 开场
   §5 桌面与窗口   §6 窗口里的东西   §7 图卡与花纹     §8 响应式与动效开关

   整体是一张“桌面”：背后是 scene.js 画的蓝色低多边形城市，
   前面漂着像素风的窗口。像素字只在整数倍字号（12 / 24 / 48）下才清楚，
   所以全站只用这几档（Silkscreen 用 8 的倍数）。
   ============================================================ */

/* ───────── §1 色板与主题 ─────────
   data-theme 由 <head> 里那段脚本在首帧前算好（读者选过就用选的，没选过跟系统），
   所以这里只需要一套深色覆盖，不用再写一遍 prefers-color-scheme。 */
:root {
  --sky-1: #d6f1ff;
  --sky-2: #f4fbff;
  --ink: #0b2b7a;
  --mute: #3d69ad;
  --faint: #7298c8;
  --bar: #79d3fa;
  --bar-ink: #0b2b7a;
  --edge: #79d3fa;
  --glass: rgba(238, 250, 255, .9);
  --cell: #f6fcff;
  --cell-hi: #c4ebfd;
  --rule: #86cff6;
  --sep: #cbeefc;
  --accent: #1f5fe0;
  --chroma: #22c3ff;
  --red: #e04a3f;
  --gold: #b9832a;
  --gold-deep: #8a5a12;
  --gold-hi: #f2cf73;
  --halo: rgba(242, 207, 115, .45);
  --shadow: #0b2b7a;

  /* 观片台那张图 */
  --film: #10235e;
  --hole: #eefaff;
  --lamp-a: #fdfeff;
  --lamp-b: #cdeefd;
  --fr-a: #a9dcf8;
  --fr-b: #7cc1f3;
  --fr-c: #c6e9fc;
  --fr-m: #2f6fd8;
  --fr-d: #13348f;
  --fr-w: #ffffff;

  --px: "Fusion Pixel 12px Proportional Simplified Chinese", "Silkscreen", ui-monospace, monospace;
  --display: "Silkscreen", var(--px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --sky-1: #030a28;
  --sky-2: #12297e;
  --ink: #e2f6ff;
  --mute: #9cccf2;
  --faint: #6f9ad6;
  --bar: #1f56cf;
  --bar-ink: #e2f6ff;
  --edge: #3d8fe8;
  --glass: rgba(7, 20, 74, .88);
  --cell: #0b1e62;
  --cell-hi: #1d48b8;
  --rule: #3577dc;
  --sep: #17398f;
  --accent: #66d2ff;
  --chroma: #66d2ff;
  --red: #ff6a5e;
  --gold: #f2c96c;
  --gold-deep: #b9832a;
  --gold-hi: #ffe7a3;
  --halo: rgba(255, 220, 140, .55);
  --shadow: #01061f;

  --film: #040a26;
  --hole: #9fdcff;
  --lamp-a: #3a72e6;
  --lamp-b: #173c9f;
  --fr-a: #2f63d8;
  --fr-b: #2453c4;
  --fr-c: #3d78e8;
  --fr-m: #12318f;
  --fr-d: #071a5a;
  --fr-w: #cfefff;
  color-scheme: dark;
}

/* ───────── §2 基础与像素字 ───────── */
* { box-sizing: border-box; margin: 0; padding: 0 }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100% }

body {
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--px);
  font-size: 12px;
  line-height: 18px;
  color: var(--ink);
  /* 没有 WebGL 时这层天空就是全部背景 */
  background: linear-gradient(var(--sky-1), var(--sky-2) 70%) fixed;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

a { color: inherit; text-decoration: none }
ul { list-style: none }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer }
svg { display: block }
::selection { background: var(--chroma); color: #fff }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px }

.skip { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 4px 10px; background: var(--ink); color: var(--cell) }
.skip:focus { top: 12px }

/* ───────── §3 场景与颗粒 ───────── */
#gl {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  /* 场景按 1 倍像素画，高分屏上由这里放大成硬边像素 */
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity .6s steps(4);
}
.gl-on #gl { opacity: 1 }

/* 一层会抖的颗粒 + 四角压暗，让平涂的色块像印出来的 */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .55;
  mix-blend-mode: multiply;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(11, 43, 122, .14)),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .45  0 0 0 0 .8  0 0 0 2.4 -1.35'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  animation: grain .5s steps(3) infinite;
}
:root[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: .3 }
@keyframes grain {
  0%, 100% { background-position: 0 0, 0 0 }
  33%      { background-position: 0 0, -60px 40px }
  66%      { background-position: 0 0, 50px -30px }
}

/* ───────── §4 开场 ───────── */
.prefs { position: fixed; top: 32px; right: 32px; z-index: 20; display: flex; gap: 8px }

/* 圆形小钮：语言、深浅色、关于我那排链接都是它 */
.k {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--edge);
  background: var(--glass);
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
  transition: background-color .15s steps(2), color .15s steps(2), border-color .15s steps(2);
}
.k svg { width: 16px; height: 16px }
.k:hover { background: var(--ink); border-color: var(--ink); color: var(--cell) }

#theme .sun { display: none }
:root[data-theme="dark"] #theme .sun { display: block }
:root[data-theme="dark"] #theme .moon { display: none }

.hero {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 56px 32px 72px;
  text-align: center;
}
.hero-text { position: relative; margin-top: 46px; display: grid; justify-items: center } /* 让开玫瑰窗外圈 34px 的齿饰环 */

/* 标题：像素哥特体，烫金，一道光从左往右扫过 */
.title {
  font-family: "Jacquard 24", var(--display);
  font-weight: 400;
  font-size: 96px;
  line-height: 96px;
  letter-spacing: 2px;
  background: linear-gradient(100deg, var(--gold-deep) 0 30%, var(--gold-hi) 45%, #fff8dc 50%, var(--gold-hi) 55%, var(--gold-deep) 70% 100%) 0 0 / 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(3px 3px 0 var(--shadow)) drop-shadow(0 0 18px var(--halo));
  animation: gilt 6s linear infinite;
}
@keyframes gilt { from { background-position: 100% 0 } to { background-position: 0 0 } }

.tagline {
  margin-top: 8px;
  font-size: 24px;
  line-height: 30px;
  text-shadow: 2px 2px 0 var(--glass);
  animation: fadeIn .6s steps(3) 1.2s both;
}
@keyframes fadeIn { from { opacity: 0 } }

.cue {
  position: absolute;
  left: 50%;
  bottom: 24px;
  margin-left: -18px;
  color: var(--ink);
  animation: bob 1.2s steps(2) infinite;
}
.cue svg { width: 36px; height: 36px }
@keyframes bob { 50% { transform: translateY(6px) } }

/* ───────── §5 桌面与窗口 ─────────
   12 栏网格，每扇窗自己说占哪几栏（--c）、离上一行多远（--mt）。
   两扇窗左右放得下时网格会把它们排进同一行，右边那扇再用 --mt 往下错一截 ——
   桌面上那种错落就是这么来的。 */
#desk {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 40px 40vh;
}

.win {
  position: relative;
  grid-column: var(--c, 1 / span 6);
  margin-top: var(--mt, 12vh);
  scroll-margin-top: 64px;
  border: 2px solid var(--edge);
  /* 窗底压一层极淡的菱格暗纹，像手抄本的底子；外面再描一道金线 */
  background: var(--diaper) 0 0 / 32px 32px, var(--glass);
  outline: 1px solid var(--gold);
  outline-offset: 3px;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.win:first-child { margin-top: 0 }
.win.ov { box-shadow: 8px 8px 0 var(--shadow) }

.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 3px 10px 3px;
  /* 标题栏底下一排尖拱窗花 */
  background: var(--tracery) 0 100% / 48px 24px repeat-x, var(--bar);
  border-bottom: 2px solid var(--gold);
  color: var(--bar-ink);
}
.bar h2 { flex: 1; min-width: 0; font-size: 12px; font-weight: 400; line-height: 18px }
.bar .tag { flex: none; opacity: .75 }

.body { padding: 12px 14px 14px }
.body > * + * { margin-top: 12px }

/* 窗口进场：内容一直在，标题栏上扫过一道金光，像刚被点亮 */
.bar { position: relative; overflow: hidden }
.bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 244, 205, .85) 50%, transparent 65%);
  transform: translateX(-110%);
  pointer-events: none;
}
.win.is-in .bar::after { animation: sheen 1.3s steps(12) .1s }
@keyframes sheen { to { transform: translateX(110%) } }

/* ───────── §6 窗口里的东西 ───────── */
.who { font-size: 24px; line-height: 30px }
.who span { margin-left: 6px; font-size: 12px; color: var(--mute) }
.lead { font-size: 24px; line-height: 30px }
.body p { max-width: 70ch }

.keys { display: flex; gap: 8px }

/* 列表行：作品目录、联系方式 */
.list li + li { border-top: 2px solid var(--sep) }
.row { display: flex; align-items: center; gap: 12px; padding: 8px 6px }
.row:hover { background: var(--cell-hi) }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px }
.row-main b { font-size: 24px; font-weight: 400; line-height: 30px; overflow-wrap: anywhere }
.row-main small { font-size: 12px; color: var(--mute) }
.list.plain .row-main b { font-size: 12px; line-height: 18px }
.meta { flex: none; color: var(--mute) }

/* 缩略图固定用浅色板，像嵌在窗里的一块小屏 */
.shot { flex: none; border: 2px solid var(--edge); background: #eefaff }
.thumb { width: 64px; height: 64px }
.thumb .ta { fill: #79d3fa }
.thumb .tw { fill: #ffffff }
.thumb .tm { fill: #3faef0 }
.thumb .td { fill: #0b2b7a }

.more { display: flex; justify-content: flex-end }
.more a { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 2px solid var(--edge); background: var(--cell) }
.more a:hover { background: var(--ink); border-color: var(--ink); color: var(--cell) }
.more svg { width: 14px; height: 14px }

/* 事实条目：左边一个词，右边一句话 */
.rows li { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 2px 16px; padding: 6px 0; border-top: 2px solid var(--sep) }
.rows b { font-weight: 400 }
.rows span { color: var(--mute) }

.acts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding-top: 12px; border-top: 2px solid var(--sep) }
.acts .meta { margin-left: auto }

/* 按钮：带硬投影，按下去就把影子吃掉 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 2px solid var(--ink);
  background: var(--bar);
  color: var(--bar-ink);
  box-shadow: 3px 3px 0 var(--shadow);
}
.btn svg { width: 16px; height: 16px }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow) }
.btn:active { transform: translate(3px, 3px); box-shadow: none }

.foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 8px 24px;
  border-top: 2px solid var(--edge);
  background: var(--glass);
  color: var(--mute);
}

/* ───────── §7 图卡与花纹 ─────────
   金色只给“神圣”的那一层用：十字、拱窗的金边、罗马数字、花纹分隔线。
   花纹都是像素小图做成的遮罩（mask），颜色跟着 --gold 走，深浅色各一套。 */
:root {
  --cross: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 7'><path d='M2 0h1v7H2zM0 2h5v1H0z'/></svg>");
  --corner: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M0 0h1v12H0zM0 11h12v1H0zM3 6h1v3H3zM2 7h3v1H2zM6 9h1v1H6zM2 3h1v1H2z'/></svg>");
  --vine: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 9'><path d='M0 4h40v1H0zM80 4h40v1H80zM42 3h1v3h-1zM44 2h1v5h-1zM46 4h6v1h-6zM68 4h6v1h-6zM75 2h1v5h-1zM77 3h1v3h-1zM59 0h2v9h-2zM56 2h8v2h-8zM54 6h1v1h-1zM65 6h1v1h-1z'/></svg>");
}

/* 标题栏左边一枚金十字 */
.bar::before {
  content: "";
  flex: none;
  width: 10px;
  height: 14px;
  background: var(--gold);
  -webkit-mask: var(--cross) center / contain no-repeat;
  mask: var(--cross) center / contain no-repeat;
}
.bar .tag { font-family: var(--display); color: var(--gold); opacity: 1 }

/* 窗口下面两个角：像素卷草角花，右边那个镜像 */
.win::before, .win::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 24px;
  height: 24px;
  background: var(--gold);
  -webkit-mask: var(--corner) center / contain no-repeat;
  mask: var(--corner) center / contain no-repeat;
  pointer-events: none;
}
.win::before { left: 4px }
.win::after { right: 4px; transform: scaleX(-1) }

/* 花纹分隔线：两侧细线，中间十字和菱点 */
.orn {
  height: 18px;
  max-width: 240px;
  margin-left: auto;
  margin-right: auto;
  background: var(--gold);
  -webkit-mask: var(--vine) center / contain no-repeat;
  mask: var(--vine) center / contain no-repeat;
}
.orn.left { margin: 16px 0 0 }

.inscr {
  margin-bottom: 6px;
  font-family: "Jacquarda Bastarda 9", var(--display);
  font-size: 27px;
  line-height: 27px;
  letter-spacing: 2px;
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--glass);
  animation: fadeIn .6s steps(3) both;
}
.sdg { font-family: var(--display); letter-spacing: 3px; color: var(--gold) }

/* 拱窗：截图顶上一道弧，外面一圈金边，像教堂的彩窗 */
.arch {
  margin: 4px;
  overflow: hidden;
  border-radius: 50% 50% 0 0 / 26% 26% 0 0;
  box-shadow: 0 0 0 2px var(--cell), 0 0 0 4px var(--gold);
  background: var(--cell);
}
.arch img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 3; object-fit: cover }

.feature { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: center }
.feature > * + * { margin-top: 0 }
.pitch > * + * { margin-top: 12px }
.kicker { color: var(--gold) }
.big { font-size: 36px; line-height: 44px; max-width: 9em }
.center { text-align: center; margin-left: auto; margin-right: auto }

.chips { display: flex; flex-wrap: wrap; gap: 6px }
.chips li { padding: 0 8px; border: 2px solid var(--edge); background: var(--cell) }

.btn.ghost { background: var(--cell); color: var(--ink) }


kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  font: inherit;
  border: 2px solid var(--gold);
  background: var(--cell);
  color: var(--ink);
}

/* 大数字 */
.nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px }
.nums li { padding: 10px 12px; border: 2px solid var(--sep); background: var(--cell) }
.nums b { display: block; font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 36px; color: var(--accent) }
.nums span { color: var(--mute) }

/* 冲印四站：罗马数字 I–IV */
.stations { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; list-style: none }
.stations li { position: relative; display: flex; flex-direction: column; gap: 4px; padding-top: 4px }
.stations i { font-family: var(--display); font-style: normal; font-size: 24px; line-height: 24px; color: var(--gold) }
.stations span { color: var(--mute) }
.stations li + li::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 14px;
  width: 8px;
  height: 2px;
  background: var(--gold);
}

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center }
.split > div > * + * { margin-top: 12px }

/* 安卓那几条卖点 */
.hooks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px }
.hooks li { padding: 10px 12px 12px; border: 2px solid var(--sep); border-top-color: var(--gold); background: var(--cell) }
.hooks b { display: block; font-weight: 400; margin-bottom: 4px }
.hooks span { color: var(--mute) }

.shot img { display: block; width: 64px; height: 64px; object-fit: cover; image-rendering: pixelated }
.shot.glyph { display: grid; place-items: center; width: 68px; height: 68px; background: var(--cell); color: var(--accent) }
.shot.glyph svg { width: 48px; height: 48px }

/* ── 开场的玫瑰窗 ──
   画布只有 128×128，CSS 放大成硬边像素；外面三道：齿饰金环、细金线、慢慢转的一圈光芒。 */
.sanctum {
  position: relative;
  width: min(54vh, 76vw, 520px);
  aspect-ratio: 1;
  max-width: 100%;
  border-radius: 50%;
  box-shadow: 0 0 0 6px var(--gold-deep), 0 0 0 10px var(--cell), 0 0 0 13px var(--gold), 0 0 90px 30px var(--halo);
}
.sanctum::before, .sanctum::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none }
.sanctum::before {
  inset: -34px;
  background: repeating-conic-gradient(var(--gold) 0 4deg, transparent 4deg 10deg);
  -webkit-mask: radial-gradient(circle, transparent calc(50% - 16px), #000 calc(50% - 15px), #000 calc(50% - 4px), transparent calc(50% - 3px));
  mask: radial-gradient(circle, transparent calc(50% - 16px), #000 calc(50% - 15px), #000 calc(50% - 4px), transparent calc(50% - 3px));
}
.sanctum::after {
  inset: -90px;
  background: repeating-conic-gradient(from 3deg, var(--gold) 0 .6deg, transparent .6deg 7.5deg);
  -webkit-mask: radial-gradient(circle, transparent calc(50% - 56px), #000 calc(50% - 54px), transparent 50%);
  mask: radial-gradient(circle, transparent calc(50% - 56px), #000 calc(50% - 54px), transparent 50%);
  opacity: .55;
  animation: turn 180s linear infinite;
}
@keyframes turn { to { transform: rotate(1turn) } }
#rose { display: block; width: 100%; height: 100%; border-radius: 50%; image-rendering: pixelated }

/* 从玫瑰窗洒下来的天光和金尘 */
#glory { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none }

/* 指针走到哪里，哪里就亮一点 */
.halo {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 30%), var(--halo), transparent 70%);
  mix-blend-mode: soft-light;
}

/* ── 手抄本金框：两道金线，四边一排四叶饰，四角各一枚角花 ── */
.frame { position: fixed; inset: 0; z-index: 3; pointer-events: none }
.frame::before, .frame::after { content: ""; position: absolute; border: 2px solid var(--gold) }
.frame::before { inset: 6px }
.frame::after { inset: 26px; border-width: 1px; opacity: .6 }
.frame i, .frame b { position: absolute; background: var(--gold) }
.frame i { -webkit-mask: var(--qf) 0 0 / 16px 16px; mask: var(--qf) 0 0 / 16px 16px; opacity: .8 }
.frame .t, .frame .b { left: 44px; right: 44px; height: 16px; -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x }
.frame .l, .frame .r { top: 44px; bottom: 44px; width: 16px; -webkit-mask-repeat: repeat-y; mask-repeat: repeat-y }
.frame .t { top: 9px }
.frame .b { bottom: 9px }
.frame .l { left: 9px }
.frame .r { right: 9px }
.frame b { width: 36px; height: 36px; -webkit-mask: var(--fleuron) center / contain no-repeat; mask: var(--fleuron) center / contain no-repeat }
.frame .c1 { top: 6px; left: 6px }
.frame .c2 { top: 6px; right: 6px; transform: scaleX(-1) }
.frame .c3 { bottom: 6px; left: 6px; transform: scaleY(-1) }
.frame .c4 { bottom: 6px; right: 6px; transform: scale(-1) }

/* ── 烫金首字：每段大字的第一个字装进一格金框，底下压菱格暗纹 ── */
.big::first-letter {
  float: left;
  margin: 4px 10px 0 0;
  padding: 6px 8px 4px;
  font-family: "Jacquard 24", var(--px);
  font-size: 72px;
  line-height: 72px;
  color: var(--gold);
  background: var(--diaper) 0 0 / 16px 16px, var(--cell);
  border: 3px double var(--gold);
  text-shadow: 3px 3px 0 var(--shadow);
}
.big { min-height: 96px }

/* 拱窗顶上一枚金十字，像窗楣上的拱心石 */
.arch { position: relative }
.arch::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 10px;
  height: 14px;
  margin-left: -5px;
  background: var(--gold);
  -webkit-mask: var(--cross) center / contain no-repeat;
  mask: var(--cross) center / contain no-repeat;
  filter: drop-shadow(0 0 4px var(--halo));
}

/* ── 暗房 ── */
.lab { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start }
.lab > * + * { margin-top: 0 }
.lab-wrap {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  cursor: ew-resize;
  touch-action: none;
  border: 2px solid var(--gold);
  outline: 2px solid var(--cell);
  outline-offset: -6px;
  background: var(--film);
}
#labCanvas { display: block; width: 100%; height: 100% }
.wipe { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; pointer-events: none }
.wipe i { position: absolute; inset: 0 -1px; background: var(--gold-hi); box-shadow: 0 0 10px var(--halo) }
.wipe b {
  position: absolute;
  top: 50%;
  left: -18px;
  width: 36px;
  height: 36px;
  margin-top: -18px;
  display: grid;
  place-items: center;
  font-weight: 400;
  color: var(--ink);
  background: var(--cell);
  border: 2px solid var(--gold);
  border-radius: 50%;
}
.lab-tag { position: absolute; top: 10px; padding: 1px 8px; background: var(--glass); border: 2px solid var(--gold); pointer-events: none }
.lab-tag.a { left: 10px }
.lab-tag.b { right: 10px }
.lab-photos { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px }
.lab-hint { margin-top: 6px; color: var(--mute) }
.lab-photos button { padding: 0; border: 2px solid var(--sep) }
.lab-photos button.is-on { border-color: var(--gold) }
.lab-photos button { flex: none }
.lab-photos img { display: block; width: 72px; height: 48px; object-fit: cover }
.lab-panel > * + * { margin-top: 12px }
.looks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px }
.look { display: grid; gap: 2px; padding: 6px 8px; text-align: left; border: 2px solid var(--sep); background: var(--cell) }
.look b { font-weight: 400 }
.look small { color: var(--mute) }
.look:hover { border-color: var(--edge) }
.look.is-on { border-color: var(--gold); background: var(--cell-hi); box-shadow: 3px 3px 0 var(--shadow) }
.lab-strength { display: flex; align-items: center; gap: 10px }
.lab-strength input { flex: 1; accent-color: var(--gold) }
.lab-strength output { min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums }
.lab-note { color: var(--faint) }
#lab.no-gl .lab-stage, #lab.no-gl .looks, #lab.no-gl .lab-strength { display: none }

/* ── 观片台：灯箱台面、胶片格、放大镜、底下一排快捷键 ── */
.lt > * + * { margin-top: 12px }
.lt-stage {
  position: relative;
  height: clamp(340px, 58vh, 560px);
  overflow: hidden;
  touch-action: none;
  outline: none;
  border: 2px solid var(--gold);
  background: radial-gradient(ellipse at 50% 38%, #fffdf4, #ece8dc 62%, #d9d4c5);
  box-shadow: inset 0 0 60px rgba(255, 246, 214, .7);
  transition: background .5s steps(5), box-shadow .5s steps(5);
}
.lt-stage:focus-visible { outline: 2px solid var(--red); outline-offset: 2px }
.lt-stage.lights-off { background: radial-gradient(ellipse at 50% 40%, #2c2e35, #17181c 70%); box-shadow: inset 0 0 40px rgba(0, 0, 0, .6) }
.lt-stage[data-mode="g"] { cursor: grab }
.lt-frame {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0 3%;
  background: #121212;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .28);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), width .5s cubic-bezier(.2, .8, .2, 1), height .5s cubic-bezier(.2, .8, .2, 1), opacity .35s, filter .5s;
}
/* 上下两条齿孔带 */
.lt-frame::before, .lt-frame::after {
  content: "";
  position: absolute;
  left: 3%;
  right: 3%;
  height: 12%;
  background: repeating-linear-gradient(90deg, transparent 0 4px, #efe9d6 4px 10px, transparent 10px 15px) 0 50% / 15px 40% repeat-x;
}
.lt-frame::before { top: 0 }
.lt-frame::after { bottom: 0 }
.lt-frame img { position: absolute; top: 12%; bottom: 12%; left: 3%; width: 94%; height: 76%; object-fit: cover; pointer-events: none }
.lt-frame.is-held { transition: none; cursor: grabbing; outline: 2px solid var(--gold-hi); box-shadow: 0 16px 30px rgba(0, 0, 0, .35) }
.lt-stage[data-mode="c"] .lt-frame { transition: none; box-shadow: none }
.lt-stage.lights-off .lt-frame { filter: brightness(.42) }

.lt-loupe {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 100;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 4px var(--gold-deep), 0 0 0 6px var(--gold-hi), 0 18px 40px rgba(0, 0, 0, .35), inset 0 0 30px rgba(255, 255, 255, .35);
}
.lt-loupe[hidden] { display: none }
.lt-loupe canvas { width: 100%; height: 100%; border-radius: 50% }
.lt-loupe span { position: absolute; bottom: -26px; left: 50%; transform: translateX(-50%); padding: 0 6px; background: var(--glass); border: 2px solid var(--gold) }

.lt-dock { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px }
.lt-dock i { width: 2px; height: 24px; margin: 0 4px; background: var(--gold) }
.lt-dock button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 2px solid var(--sep); background: var(--cell) }
.lt-dock button:hover { border-color: var(--edge) }
.lt-dock button.is-on { border-color: var(--gold); background: var(--cell-hi); box-shadow: 3px 3px 0 var(--shadow) }
.lt-hint { text-align: center; color: var(--mute) }

/* 沉浸：台面铺满整屏，按 I 或 Esc 退出 */
.lt.is-immersive { position: fixed; inset: 0; z-index: 60; margin: 0; padding: 16px; background: var(--glass); display: grid; grid-template-rows: 1fr auto; gap: 12px }
.lt.is-immersive .lt-stage { height: auto }
.lt.is-immersive .lt-hint { display: none }
/* 窗口的 backdrop-filter 会把 fixed 困在窗口里，沉浸时先关掉 */
.win:has(.lt.is-immersive) { -webkit-backdrop-filter: none; backdrop-filter: none; z-index: 60 }

/* ───────── §8 响应式与动效开关 ───────── */
@media (max-width: 1100px) {
  .win.wide { grid-column: 1 / -1 }
  .cards, .hooks { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}

@media (max-width: 860px) {
  #desk { column-gap: 0; padding: 0 12px 30vh }
  .win { grid-column: 1 / -1; margin-top: 28px }
  .win:first-child { margin-top: 0 }
  .win.ov { box-shadow: 6px 6px 0 var(--shadow) }
  .hero { padding: 24px 16px }
  .title { font-size: 48px; line-height: 48px }
  .frame { display: none }
  .prefs { top: 12px; right: 12px }
  .sanctum { width: min(76vw, 52vh) }
  .sanctum::after { inset: -48px }
  .big::first-letter { font-size: 48px; line-height: 48px }
  .big { min-height: 72px }
  .feature, .split, .lab { grid-template-columns: minmax(0, 1fr) }
  .cards, .hooks, .stations { grid-template-columns: minmax(0, 1fr) }
  .nums { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .stations li + li::before { display: none }
  .big { font-size: 24px; line-height: 30px }
  .rows li { grid-template-columns: minmax(0, 1fr) }
  .acts .meta { margin-left: 0; flex-basis: 100% }
  .foot { padding: 8px 12px }
}

/* 系统里关掉了动效：窗口直接摊开，数据点和胶卷都不动，城市停在开场那个角度（见 scene.js） */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  *, *::before, *::after { animation: none !important; transition: none !important }
}
