/* ============================================================
   TOWER 茶水间 · 年度个体档案 —— 观众版 / 菲比版共用样式
   版式出处：官方设定图「TOWER Human Resource Profile」
   （系统窗口 + 页签 + 灰底字段 + 像素字段名 + 肥体衬线标题 + 条码）
   配色：站点 Espresso Noir 的深咖 / 奶油 / 金，外加设定图三个部门点色。
   规则：窗口投影是硬边偏移，不用光晕；数字不用金色斜体；
         英文只出现设定图原有的字段名，其余一律中文。
   ============================================================ */

/* Abril / Pixel / ZunSong 用站内按 unicode-range 切好的分片，声明在同目录 faces.css */
/* 模板签名用的手写体（均 OFL），只有选「输入名字」时才会被请求下载。
   中文主字体荷塘月色手写体（GB2312 6,763 字，含拉丁字母）；缺字由霞鹜文楷补（子集 = 全站访客昵称里马善政缺的字，报告只给这批人看，够用） */
@font-face { font-family: 'SigHan'; src: url('../fonts/HeTangYueSe.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'SigFill'; src: url('../fonts/WenKaiFill.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'SigLatin'; src: url('../fonts/HerrVonMuellerhoff.woff2') format('woff2'); font-display: swap; }

:root {
  --desk: #0f0a06;
  --desk-2: #1a120b;
  --paper: #ebe3d3;
  --paper-2: #e2d8c5;
  --panel: #d2c7b2;
  --field: #bdb09a;
  --ink: #17100a;
  --ink-2: #5a4c3d;
  --ink-3: #8b7b68;
  --gold: #c8a165;
  --cream: #f3ebdc;
  --milk: #a89684;
  --c-seer: #2c76ad;
  --c-scav: #c5352b;
  --c-myc: #a87a10;
  --stamp: #a43a1e;
  --hard: 5px 5px 0 rgba(0, 0, 0, 0.42);
  /* 像素体只在 12 的整数倍物理像素上是清晰的：2x 屏用 18，3x 屏用 16 */
  --px-s: 12px;
  --px-m: 18px;
  --px-l: 24px;
  --col: 468px;
}
@media (min-resolution: 2.5dppx) { :root { --px-m: 16px; } }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--desk);
  color: var(--cream);
  font-family: 'Pixel', 'PingFang SC', monospace;
  font-size: var(--px-s);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: none;
}
/* 桌面底：站点同款暖色纵深 + 细网格（系统桌面），不放辉光 */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(rgba(200, 161, 101, 0.045) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(200, 161, 101, 0.045) 1px, transparent 1px) 0 0 / 24px 24px,
    radial-gradient(120% 80% at 50% 0%, #2a1c10 0%, var(--desk-2) 45%, var(--desk) 100%);
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.px { font-family: 'Pixel', monospace; }
.zs { font-family: 'ZunSong', 'Songti SC', serif; -webkit-font-smoothing: antialiased; }
.ab { font-family: 'Abril', 'ZunSong', serif; -webkit-font-smoothing: antialiased; }

/* ---------- 顶 / 底黑条（设定图上下沿） ---------- */
.bar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  height: 30px; padding: 0 12px;
  background: #000; color: var(--cream);
  font-size: var(--px-s); letter-spacing: 0.5px; white-space: nowrap;
}
.bar .star { flex: none; }
.bar .path { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.bar .steps { display: flex; gap: 10px; color: var(--ink-3); }
.bar .steps .on { color: var(--cream); }
.star { width: 12px; height: 12px; display: inline-block; background: currentColor;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }

/* ---------- 主栏 ---------- */
.col { width: 100%; max-width: var(--col); margin: 0 auto; padding: 48px 12px 80px; }
.sheet {
  position: relative; color: var(--ink);
  background: var(--paper);
  box-shadow: var(--hard);
}
/* 纸面：噪点 + 两道折痕。折痕是设定图那张纸本来就有的 */
.sheet::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply; opacity: 0.55;
  background:
    linear-gradient(180deg, transparent 33.2%, rgba(23, 16, 10, 0.1) 33.3%, transparent 33.6%),
    linear-gradient(180deg, transparent 66.5%, rgba(23, 16, 10, 0.08) 66.6%, transparent 66.9%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .14 0 0 0 0 .08 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}
.sheet > * { position: relative; }

/* ---------- 档案头 ---------- */
.head { padding: 26px 16px 14px; display: grid; grid-template-columns: 1fr 104px; gap: 12px; align-items: start; }
.head .dots { display: flex; gap: 5px; margin-bottom: 8px; }
.head .dots i { width: 6px; height: 6px; border-radius: 50%; }
.head .dots i:nth-child(1) { background: var(--c-scav); }
.head .dots i:nth-child(2) { background: var(--c-seer); }
.head .dots i:nth-child(3) { background: var(--c-myc); }
.head h1 { font-family: 'Abril', serif; font-weight: 400; font-size: 54px; line-height: 0.9; letter-spacing: 1px; -webkit-font-smoothing: antialiased; }
.head h1.hrp { font-size: 34px; line-height: 0.96; letter-spacing: 0.3px; }   /* 不写 TOWER：设定图的 Human Resource Profile 提为主标题 */
.head h2 { font-family: 'Abril', serif; font-weight: 400; font-size: 19px; line-height: 1.1; margin-top: 6px; -webkit-font-smoothing: antialiased; }
.head .zh { font-family: 'ZunSong', serif; font-size: 15px; margin-top: 8px; letter-spacing: 2px; -webkit-font-smoothing: antialiased; }
.crumb { margin-top: 10px; color: var(--ink-2); font-size: var(--px-s); }
.idphoto { position: relative; width: 104px; height: 132px; background: var(--field); overflow: hidden; }
.idphoto canvas, .idphoto img { width: 100%; height: 100%; display: block; object-fit: cover; image-rendering: pixelated; }
.idphoto .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 4px; background: #000; color: var(--cream); font-size: var(--px-s); line-height: 16px; }
.idphoto .glyph { position: absolute; inset: 0; display: grid; place-items: center; font-family: 'ZunSong', serif; font-size: 64px; color: var(--paper); mix-blend-mode: normal; }

/* ---------- 页签 + 窗口 ---------- */
.tabs { display: flex; gap: 6px; padding: 0 12px; align-items: flex-end; }
.tab {
  flex: 1 1 0; min-width: 0; height: 44px; padding: 0 6px;
  background: var(--paper-2); color: var(--ink);
  border: 1px solid rgba(23, 16, 10, 0.28); border-bottom: 0; border-radius: 12px 12px 0 0;
  font-family: 'ZunSong', serif; font-size: 22px; letter-spacing: 2px; white-space: nowrap; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.tab i { font-style: italic; margin-right: 1px; }
.tab:nth-child(1) i { color: var(--c-seer); }
.tab:nth-child(2) i { color: var(--c-scav); }
.tab:nth-child(3) i { color: var(--c-myc); }
.tab[aria-selected='true'] { background: var(--panel); height: 50px; border-color: transparent; }
.tab.en { font-family: 'Abril', serif; font-size: 15px; letter-spacing: 0; }

.win { position: relative; margin: 0 12px; background: var(--panel); padding: 12px; }
.win + .win, .win.gap { margin-top: 14px; }
.win .x { position: absolute; top: 6px; right: 8px; width: 16px; height: 16px; font-size: 16px; line-height: 16px; color: var(--ink); }
.win .x::before { content: '×'; font-family: 'Pixel'; font-size: 24px; line-height: 14px; }
.win .next { display: block; margin: 8px 0 0 auto; color: var(--ink-2); font-size: var(--px-s); }
.win .next:hover { color: var(--ink); }
.cap3 { display: flex; align-items: center; gap: 4px; margin: 0 0 8px; color: var(--ink); }
.cap3::before { content: ''; border: 5px solid transparent; border-top: 8px solid var(--ink); border-bottom: 0; }
.cap3 span { color: var(--ink-2); }

/* 字段：像素字段名 + 大号值 */
.fields { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.f { grid-column: span 3; background: var(--field); padding: 5px 8px 6px; min-height: 52px; min-width: 0; }
.f.w6 { grid-column: span 6; } .f.w2 { grid-column: span 2; } .f.w4 { grid-column: span 4; }
.f .k { display: block; font-size: var(--px-s); color: var(--ink); opacity: 0.85; }
.f .v { display: block; font-size: var(--px-l); line-height: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f .v.zs { font-size: 22px; }
.f .v small { font-size: var(--px-s); color: var(--ink-2); margin-left: 4px; }
.f .why { display: block; font-size: var(--px-s); color: var(--ink-2); line-height: 15px; margin-top: 2px; white-space: normal; }
.f .meter { display: flex; gap: 2px; margin-top: 4px; }
.f .meter i { flex: 1; height: 5px; background: rgba(23, 16, 10, 0.16); }
.f .meter i.on { background: var(--ink); }
.f .meter i.ref { box-shadow: 0 3px 0 -1px var(--c-scav); }

.sec { font-family: 'Abril', 'ZunSong', serif; font-size: 26px; line-height: 1; margin: 16px 0 8px; -webkit-font-smoothing: antialiased; }
.sec.zh { font-family: 'ZunSong', serif; letter-spacing: 1px; }

/* NOTE */
.notehead { display: inline-block; margin: 18px 0 0 12px; padding: 9px 26px 6px; background: var(--panel); border-radius: 14px 14px 0 0; font-family: 'Abril', serif; font-size: 22px; -webkit-font-smoothing: antialiased; }
.note li { list-style: none; font-size: var(--px-m); line-height: 1.55; padding-left: 16px; text-indent: -16px; margin: 6px 0; }
.note li::before { content: '- '; }
.note li em { font-style: normal; background: linear-gradient(transparent 62%, rgba(196, 149, 28, 0.42) 0); }
.note li.rev { color: var(--stamp); }
.note li.rev::before { content: '> '; }
.note li s { text-decoration-thickness: 2px; text-decoration-color: var(--stamp); color: var(--ink-2); }

/* 签名 + 印章 */
.signrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 12px 6px; align-items: end; }
.signrow .lab2 { font-family: 'Abril', serif; font-size: 20px; -webkit-font-smoothing: antialiased; }
.sigpad { position: relative; height: 84px; border-bottom: 2px solid var(--ink); touch-action: none; }
.sigpad canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sigpad .hint2 { position: absolute; left: 0; bottom: 6px; font-family: 'Abril', serif; font-style: italic; color: rgba(23, 16, 10, 0.22); font-size: 15px; pointer-events: none; -webkit-font-smoothing: antialiased; }
.sigpad.signed .hint2 { display: none; }
.stampbox { position: relative; height: 96px; }
.stamp { position: absolute; right: 2px; bottom: 0; width: 96px; height: 96px; transform: translate(var(--sx, 0), var(--sy, 0)) rotate(var(--rot, -9deg)); opacity: var(--ink, 1); mix-blend-mode: multiply; }
.stamp img { width: 100%; height: 100%; object-fit: contain; }

/* 条码：每根线是一天 */
.barcode { padding: 10px 12px 16px; }
.barcode canvas { display: block; width: 100%; height: 46px; image-rendering: pixelated; }
.barcode .lg { display: flex; justify-content: space-between; margin-top: 4px; color: var(--ink-2); font-size: var(--px-s); }
.barcode .code { letter-spacing: 3px; color: var(--ink); }

/* ---------- 附件（档案纸之后的一叠窗口） ---------- */
.attach { margin-top: 22px; }
.att {
  position: relative; margin-top: 22px; background: var(--paper); color: var(--ink); box-shadow: var(--hard);
}
.att > header { display: flex; align-items: center; justify-content: space-between; height: 28px; padding: 0 8px 0 10px; background: var(--ink); color: var(--paper); font-size: var(--px-s); }
.att > header .no { color: var(--gold); margin-right: 8px; }
.att > header .x::before { content: '×'; font-size: 24px; line-height: 12px; }
.att .body { padding: 16px 14px 14px; }
.att .lead { font-family: 'ZunSong', serif; font-size: 25px; line-height: 1.34; letter-spacing: 0.5px; -webkit-font-smoothing: antialiased; }
.att .lead b { font-weight: 400; background: var(--ink); color: var(--paper); padding: 0 5px; }
.att .lead .n { font-family: 'Abril', serif; font-size: 1.5em; line-height: 1; }
.att p.sub { margin-top: 10px; color: var(--ink-2); font-size: var(--px-m); line-height: 1.6; }
.att .big { font-family: 'Abril', serif; font-size: 92px; line-height: 0.86; letter-spacing: -1px; -webkit-font-smoothing: antialiased; }
.att .big small { font-family: 'ZunSong', serif; font-size: 20px; letter-spacing: 0; margin-left: 6px; }
.att .next { display: block; margin: 12px 0 0 auto; color: var(--ink-2); }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.kv > div { background: var(--panel); padding: 6px 8px; min-width: 0; }
.kv .k { color: var(--ink-2); display: block; }
.kv .v { font-size: var(--px-l); line-height: 28px; display: block; white-space: nowrap; }
.kv .v small { font-size: var(--px-s); margin-left: 2px; }

/* 原话：系统截取的弹幕行 */
.log { margin-top: 12px; border-top: 1px solid var(--ink); }
.log li { list-style: none; display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px dashed rgba(23, 16, 10, 0.3); font-size: var(--px-m); line-height: 1.45; }
.log li time { color: var(--ink-2); font-size: var(--px-s); padding-top: 3px; }
.quote { margin-top: 12px; padding: 12px; background: var(--ink); color: var(--paper); font-family: 'ZunSong', serif; font-size: 30px; line-height: 1.25; -webkit-font-smoothing: antialiased; word-break: break-all; }
.quote small { display: block; margin-top: 8px; font-family: 'Pixel'; font-size: var(--px-s); color: var(--milk); -webkit-font-smoothing: none; }

/* 年度出入：两行条码对齐（她 / 你） */
.twin { margin-top: 14px; }
.twin .row { display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: 6px; }
.twin .row + .row { margin-top: 3px; }
.twin canvas { display: block; width: 100%; height: 34px; image-rendering: pixelated; }
.twin .months { display: grid; grid-template-columns: repeat(12, 1fr); margin: 3px 0 0 28px; color: var(--ink-2); }
.twin .who { font-family: 'ZunSong', serif; font-size: 16px; -webkit-font-smoothing: antialiased; }

/* 7×24 点阵 */
.grid724 { margin-top: 12px; display: grid; grid-template-columns: 18px repeat(24, 1fr); gap: 2px; align-items: center; }
.grid724 i { aspect-ratio: 1; background: rgba(23, 16, 10, 0.1); }
.grid724 span { color: var(--ink-2); }
.grid724 .hx { grid-column: span 6; margin-top: 2px; color: var(--ink-2); }

/* 高频词表 */
.words { margin-top: 12px; }
.words li { list-style: none; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; padding: 3px 0; font-size: var(--px-m); position: relative; }
.words li::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: var(--w, 0%); background: var(--ink); }
.words li::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(23, 16, 10, 0.14); }
.words li span:last-child { color: var(--ink-2); font-size: var(--px-s); }

/* 在场证明 */
.proofs { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.proof { background: var(--panel); padding: 7px 8px 8px; min-height: 92px; position: relative; }
.proof time { color: var(--ink-2); display: block; }
.proof h4 { font-family: 'ZunSong', serif; font-weight: 400; font-size: 17px; line-height: 1.2; margin: 2px 0 4px; -webkit-font-smoothing: antialiased; }
.proof q { quotes: none; font-size: var(--px-s); line-height: 1.4; display: block; }
.proof.no { background: transparent; outline: 1px dashed rgba(23, 16, 10, 0.4); outline-offset: -1px; color: var(--ink-3); }
.proof .mk { position: absolute; top: 6px; right: 7px; width: 10px; height: 10px; background: var(--ink); }
.proof.no .mk { background: none; border: 1px solid var(--ink-3); }

/* 分布：你在哪 */
.hist { margin-top: 14px; }
.hist canvas { display: block; width: 100%; height: 120px; }
.hist .ax { display: flex; justify-content: space-between; color: var(--ink-2); margin-top: 3px; }

/* 对照卡 */
.vs { margin-top: 12px; }
.vs .r { display: grid; grid-template-columns: 96px 1fr 34px; align-items: center; gap: 8px; padding: 4px 0; }
.vs .t { position: relative; height: 14px; background: repeating-linear-gradient(90deg, rgba(23, 16, 10, 0.18) 0 1px, transparent 1px 10%); border-left: 1px solid var(--ink); border-right: 1px solid var(--ink); }
.vs .t i { position: absolute; top: 2px; height: 10px; left: 0; background: var(--ink); }
.vs .t u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--c-scav); text-decoration: none; }
.vs .r b { font-weight: normal; font-size: var(--px-l); line-height: 24px; text-align: right; }
.legend { display: flex; gap: 14px; margin-top: 8px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 4px; vertical-align: -1px; background: var(--ink); }
.legend i.red { width: 2px; background: var(--c-scav); }

/* 按钮：系统窗口按钮，不是胶囊 */
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.btn { height: 40px; background: var(--ink); color: var(--paper); font-size: var(--px-m); box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35); }
.btn.ghost { background: var(--panel); color: var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35); }
.codein { display: grid; grid-template-columns: 1fr 88px; gap: 6px; margin-top: 10px; }
.codein input { height: 40px; padding: 0 10px; border: 0; background: var(--field); font: inherit; font-size: var(--px-m); color: var(--ink); letter-spacing: 2px; outline: none; min-width: 0; }
.codein input:focus { box-shadow: inset 0 0 0 2px var(--ink); }

/* 名单（菲比版片尾） */
.roll { margin-top: 12px; columns: 2; column-gap: 14px; font-size: var(--px-m); line-height: 1.7; }
.roll li { list-style: none; break-inside: avoid; min-width: 0; padding: 0.18em 0; line-height: 1.35; }
.roll li span { overflow-wrap: anywhere; }   /* 名字一律写全不加省略号；名字和场数顺排，放不下时场数换行，名字不被拆开 */
.roll li small { display: inline-block; margin-left: 4px; white-space: nowrap; color: var(--ink-2); font-size: var(--px-s); }

/* 时间线（菲比版） */
.tl { margin-top: 12px; border-left: 2px solid var(--ink); padding-left: 12px; }
.tl li { list-style: none; position: relative; padding: 0 0 12px; }
.tl li::before { content: ''; position: absolute; left: -17px; top: 5px; width: 8px; height: 8px; background: var(--ink); }
.tl time { color: var(--ink-2); display: block; }
.tl h4 { font-family: 'ZunSong', serif; font-weight: 400; font-size: 19px; line-height: 1.3; -webkit-font-smoothing: antialiased; }
.tl p { font-size: var(--px-s); color: var(--ink-2); line-height: 1.5; margin-top: 2px; }

/* 折线（粉丝数） */
.line canvas { display: block; width: 100%; height: 150px; margin-top: 12px; }

/* 样本切换（仅原型用）、桌面侧栏 */
.proto { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; gap: 1px; background: #000; padding: 1px 0 0; }
.proto[hidden] { display: none; }
.proto button { flex: 1; height: 34px; background: var(--desk-2); color: var(--milk); font-size: var(--px-s); }
.proto button[aria-pressed='true'] { background: var(--gold); color: #000; }
.side { display: none; opacity: 0; pointer-events: none; transition: opacity 0.4s; z-index: 4; }
.filed .side { opacity: 1; pointer-events: auto; }
@media (min-width: 980px) {
  .side { display: block; position: fixed; top: 60px; left: calc(50% - var(--col) / 2 - 220px); width: 190px; color: var(--milk); }
  .side h5 { font-weight: normal; font-size: var(--px-s); color: var(--gold); margin-bottom: 8px; }
  .side a { display: block; color: inherit; text-decoration: none; padding: 2px 0; }
  .side a::before { content: '├ '; color: #5c3b22; }
  .side a:last-child::before { content: '└ '; }
  .side a:hover, .side a.on { color: var(--cream); }
  .side.r { left: auto; right: calc(50% - var(--col) / 2 - 220px); line-height: 1.7; }
  .side.r b { font-weight: normal; color: var(--cream); }
}

/* 入场：字段从灰块「载入」成字，窗口自上而下落位 */
.ld .f .v, .ld .f .k, .ld .note li, .ld .tab { color: transparent !important; }
.ld .f .v *, .ld .tab * { color: transparent !important; }
.f, .tab, .note li { transition: color 0.01s; }
.att { opacity: 0; transform: translateY(18px); transition: opacity 0.4s, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.att.in { opacity: 1; transform: none; }
.stamp { transition: transform 0.28s cubic-bezier(0.3, 1.6, 0.5, 1), opacity 0.1s; }
.ld .stamp { opacity: 0; transform: translate(var(--sx, 0), var(--sy, 0)) rotate(var(--rot, -9deg)) scale(2.2); }

@media (prefers-reduced-motion: reduce) {
  .att { opacity: 1; transform: none; transition: none; }
  .stamp { transition: none; }
}
@media (max-width: 359px) {
  .head h1 { font-size: 46px; }
  .att .big { font-size: 76px; }
  .tab { font-size: 16px; }
}

/* 字段载入前的状态：只见灰块，不见字 */
.f.wait .k, .f.wait .v, .f.wait .why, .f.wait .v *, .tab.wait, .tab.wait *, .note li.wait, .note li.wait * { color: transparent !important; }
.f.wait .meter { visibility: hidden; }

/* ============================================================
   观测屏：点阵叙事（引擎见 dots.js，改自 v7）
   屏是深咖底、米白点，金色只表示「你」或当前被点名的那一组；
   档案纸露头后屏熄掉，露出桌面。
   ============================================================ */
#gl { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; height: 100lvh; display: block; z-index: 0; opacity: 0; transition: opacity 1.2s ease; }
.ready #gl { opacity: 1; }
#ov { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 1; pointer-events: none; overflow: hidden; transition: opacity 0.5s; }
#ov svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
#ov .ln { stroke: var(--milk); stroke-width: 1; fill: none; stroke-opacity: 0.55; }
#ov .grid { stroke: var(--cream); stroke-opacity: 0.07; stroke-width: 1; }
#ov .dash { stroke: var(--milk); stroke-opacity: 0.6; stroke-dasharray: 3 5; fill: none; }
.o { opacity: 0; transition: opacity 0.6s ease; }
.o.on { opacity: 1; }
div.o { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; }
.lab { font-size: 12px; line-height: 1.5; color: var(--milk); }
.lab b { font-weight: 400; color: var(--cream); }
.lab.you { color: var(--gold); }
.lab.num { color: var(--cream); }
.lab.q { color: var(--cream); white-space: normal; width: max-content; max-width: min(300px, 62vw); background: rgba(15, 10, 6, 0.86); padding: 1px 5px; }
.lab.q time { color: var(--milk); margin-right: 0.7em; }
.lab.ax { color: #6e5e4e; }
#scrim { position: fixed; left: 0; right: 0; bottom: 0; height: 52vh; z-index: 2; pointer-events: none; display: none; transition: opacity 0.5s;
  background: linear-gradient(to bottom, rgba(15, 10, 6, 0), rgba(15, 10, 6, 0.9) 32%, rgba(15, 10, 6, 0.96)); }
.filed #gl, .filed #ov, .filed #scrim { opacity: 0; }
#story { position: relative; z-index: 3; }
.step { min-height: 100vh; display: flex; align-items: center; padding: 0 0 0 6vw; pointer-events: none; position: relative; }
.card { width: min(380px, 30vw); pointer-events: auto; will-change: opacity; color: var(--cream); }
.card .tag { color: var(--gold); margin-bottom: 10px; }
.card h1 { font-family: 'ZunSong', serif; font-weight: 400; font-size: 42px; line-height: 1.25; -webkit-font-smoothing: antialiased; }
.card p { font-family: 'ZunSong', serif; font-size: 21px; line-height: 1.62; letter-spacing: 0.5px; -webkit-font-smoothing: antialiased; }
.card p + p { margin-top: 0.6em; }
.card p.sub { font-family: 'Pixel', monospace; font-size: 12px; line-height: 1.85; letter-spacing: 0; color: var(--milk); -webkit-font-smoothing: none; }
.card em { font-style: normal; font-family: 'Abril', 'ZunSong', serif; font-size: 1.32em; line-height: 1; }
.card .y { color: var(--gold); }
.hint { position: absolute; left: 0; right: 0; bottom: 56px; text-align: center; color: var(--milk); letter-spacing: 3px; transition: opacity 0.5s; }
.hint.gone { opacity: 0; }
ol.nights { margin-top: 10px; columns: 2; column-gap: 16px; font-size: 12px; line-height: 2; color: var(--cream); }
ol.nights li { list-style: none; display: flex; gap: 8px; break-inside: avoid; white-space: nowrap; }
ol.nights li i { font-style: normal; color: var(--gold); width: 14px; text-align: right; }
ol.nights li.no { color: #6e5e4e; }
ol.nights li.no i { color: #6e5e4e; }
#tip { position: fixed; left: 0; top: 0; z-index: 45; pointer-events: none; background: var(--paper); color: var(--ink); font-size: 12px; line-height: 1.6; padding: 6px 10px 7px; max-width: 250px; opacity: 0; transition: opacity 0.15s; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5); }
#tip.on { opacity: 1; }
#tip small { display: block; color: var(--ink-2); }
#dossier { position: relative; z-index: 3; padding-top: 12vh; }
/* 桌面：左侧说明卡放大（卡片宽度与 dots.js geom() 的 tw 联动，改一处要改两处） */
@media (min-width: 760px) {
  .card { width: min(440px, 32vw); }
  .card .tag { font-size: var(--px-m); margin-bottom: 14px; }
  .card h1 { font-size: 48px; }
  .card p { font-size: 24px; }
  .card p.sub { font-size: var(--px-m); line-height: 1.75; margin-top: 0.7em; }
  ol.nights { font-size: var(--px-m); line-height: 1.9; column-gap: 20px; }
  ol.nights li i { width: 20px; }
}
@media (max-width: 759px) {
  #scrim { display: block; }
  .step { align-items: flex-end; padding: 0 18px calc(8vh + 40px); }
  .card { width: 100%; }
  .card p { font-size: 19px; }
  .card h1 { font-size: 34px; }
}

/* ============================================================
   动效与手机端
   手机是主体：一屏一段、拇指区操作、安全区留白、触控目标不小于 44px。
   html.still（reduced-motion 或截图）时所有过渡归零，直接是终态。
   ============================================================ */
html { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
body { touch-action: manipulation; }
#gl { touch-action: pan-y; }
html.paging body, html.paging #gl { touch-action: none; }   /* 观测屏翻页区：手指不带动页面，只由 dots.js 整页切换 */
.bar { height: calc(30px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
.bar::after { content: ''; position: absolute; left: 0; bottom: -2px; height: 2px; width: calc(var(--prog, 0) * 100%); background: var(--gold); }
.step { min-height: 100svh; }

/* 观测屏：卡片逐行上浮；切段时扫一道线；点选有拾取圈 */
.card > * { opacity: 0; transform: translateY(16px); transition: opacity 0.5s, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.card.live > * { opacity: 1; transform: none; }
.card.live > :nth-child(2) { transition-delay: 0.12s; }
.card.live > :nth-child(3) { transition-delay: 0.26s; }
.card.live > :nth-child(4) { transition-delay: 0.4s; }
.card.live ol.nights li { animation: rise 0.5s both; animation-delay: calc(0.4s + var(--i, 0) * 0.06s); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
#scan { position: fixed; left: 0; right: 0; z-index: 1; pointer-events: none; opacity: 0; }
#scan::before { content: ''; position: absolute; left: 12px; right: 12px; top: 0; height: 1px; background: var(--gold); box-shadow: 0 0 0 0 transparent; }
#scan.run { animation: scanA 1s linear; }
#scan.run::before { animation: scanB 1s cubic-bezier(0.5, 0, 0.3, 1); }
@keyframes scanA { 0%, 100% { opacity: 0; } 12%, 80% { opacity: 0.7; } }
@keyframes scanB { from { top: 0; } to { top: 100%; } }
#pick { position: fixed; left: -11px; top: -11px; width: 22px; height: 22px; z-index: 2; pointer-events: none; border: 1px solid var(--gold); border-radius: 50%; opacity: 0; }
#pick.on { opacity: 1; animation: ping 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes ping { from { scale: 2.4; opacity: 0; } }
#tip { transform-origin: 0 100%; transition: opacity 0.15s, scale 0.2s cubic-bezier(0.3, 1.5, 0.5, 1); scale: 0.9; }
#tip.on { scale: 1; }
/* 可点选提示：图表右上角一枚小签，左边一个在跳的拾取圈，和点选时的 #pick 同一个样子 */
.hhint { position: fixed; left: 0; top: 0; z-index: 2; pointer-events: none; display: flex; align-items: center; gap: 7px; padding: 3px 8px 3px 6px; background: rgba(15, 10, 6, 0.82); box-shadow: inset 0 0 0 1px rgba(200, 161, 101, 0.45); color: var(--cream); font-size: 12px; line-height: 18px; white-space: nowrap; opacity: 0; transition: opacity 0.3s; }
.hhint.on { opacity: 1; transition: opacity 0.5s 1.1s; }
.hhint i { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.hhint i::after { content: ''; position: absolute; inset: -4px; border: 1px solid var(--gold); border-radius: 50%; animation: hping 1.6s cubic-bezier(0.16, 1, 0.3, 1) infinite; }
@keyframes hping { from { transform: scale(0.6); opacity: 1; } to { transform: scale(2); opacity: 0; } }
.filed .hhint { opacity: 0 !important; }
.pulse { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px; border: 1px solid var(--gold); border-radius: 50%; animation: pulse 2.6s ease-out infinite; }
.pulse.d2 { animation-delay: 1.3s; }
@keyframes pulse { from { scale: 1; opacity: 0.9; } to { scale: 7; opacity: 0; } }
.hint::after { content: ''; display: block; width: 7px; height: 7px; margin: 8px auto 0; border-right: 1px solid var(--milk); border-bottom: 1px solid var(--milk); rotate: 45deg; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { translate: 0 6px; } }

/* 档案纸：从下面推上来，字段逐格载入，分值逐格点亮，NOTE 一行行刷出，章落下时纸震一下 */
#dossier .sheet { opacity: 0; translate: 0 56px; transition: opacity 0.5s, translate 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.filed #dossier .sheet { opacity: 1; translate: 0 0; }
.f .meter i { transition: background 0.25s; transition-delay: calc(var(--i, 0) * 45ms); }
.f.wait .meter { visibility: visible; }
.f.wait .meter i.on { background: rgba(23, 16, 10, 0.16); transition: none; }
.f { transition: background 0.3s; }
.f.wait { background: rgba(189, 176, 154, 0.55); }
.note li { clip-path: inset(0 0 0 0); transition: clip-path 0.7s steps(28); }
.note li.wait { clip-path: inset(0 100% 0 0); transition: none; }
.note li em { background-size: 100% 100%; background-repeat: no-repeat; transition: background-size 0.6s 0.5s; }
.note li.wait em { background-size: 0 100%; }
.idphoto canvas, .idphoto img { clip-path: inset(0 0 0 0); transition: clip-path 1.1s steps(22) 0.2s; }
.ld .idphoto canvas, .ld .idphoto img { clip-path: inset(0 0 100% 0); transition: none; }
.sheet.thud { animation: thud 0.32s; }
@keyframes thud { 25% { transform: translateY(4px) rotate(-0.25deg); } 60% { transform: translateY(-1px); } }
.win.flip .cap3, .win.flip .fields:first-of-type { animation: flip 0.32s; }
@keyframes flip { from { opacity: 0.15; transform: translateY(5px); } }
.tab { transition: height 0.2s, background 0.2s; }

/* 附件窗口：标题栏先到，正文像窗口一样展开；里面的条、卡、行依次出现 */
.att .body { clip-path: inset(0 0 100% 0); transition: clip-path 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.18s; }
.att.in .body { clip-path: inset(0 0 0 0); }
.att .words li::after { width: 0; transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.45s; }
.att.in .words li::after { width: var(--w, 0%); }
.att .proof, .att .log li, .att .said li, .att .tl li, .att .roll li, .att .kv > div { opacity: 0; translate: 0 10px; transition: opacity 0.4s, translate 0.5s cubic-bezier(0.16, 1, 0.3, 1); transition-delay: calc(0.35s + var(--i, 0) * 60ms); }
.att.in .proof, .att.in .log li, .att.in .said li, .att.in .tl li, .att.in .roll li, .att.in .kv > div { opacity: 1; translate: 0 0; }
.att :is(.proof, .log li, .said li, .tl li, .kv > div):nth-child(2) { --i: 1; } .att :is(.proof, .log li, .said li, .tl li, .kv > div):nth-child(3) { --i: 2; }
.att :is(.proof, .log li, .said li, .tl li):nth-child(4) { --i: 3; } .att :is(.proof, .log li, .said li, .tl li):nth-child(5) { --i: 4; }
.att :is(.proof, .log li, .said li, .tl li):nth-child(6) { --i: 5; } .att :is(.proof, .log li, .said li, .tl li):nth-child(7) { --i: 6; }
.att :is(.proof, .log li, .said li, .tl li):nth-child(n + 8) { --i: 7; }
.att .roll li { transition-delay: calc(0.3s + var(--i, 0) * 28ms); }
.att .quote { clip-path: inset(0 100% 0 0); transition: clip-path 0.6s steps(18) 0.5s; }
.att.in .quote { clip-path: inset(0 0 0 0); }
.att .twin canvas, .att .bars i { clip-path: inset(0 100% 0 0); transition: clip-path 1.3s steps(52) 0.4s; }
.att .twin .row + .row canvas { transition-delay: 0.9s; }
.att.in .twin canvas { clip-path: inset(0 0 0 0); }
.att .bars i { clip-path: inset(100% 0 0 0); transition: clip-path 0.7s cubic-bezier(0.16, 1, 0.3, 1); transition-delay: calc(0.3s + var(--i, 0) * 45ms); }
.att.in .bars i { clip-path: inset(-20px 0 0 0); }
.att .vs .t i { transform-origin: 0 50%; transform: scaleX(0); transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s; }
.att.in .vs .t i { transform: none; }
.att .vs .t u { opacity: 0; translate: 0 -8px; transition: opacity 0.2s 1.1s, translate 0.3s cubic-bezier(0.3, 1.6, 0.5, 1) 1.1s; }
.att.in .vs .t u { opacity: 1; translate: 0 0; }
.att .grid724 i, .att .cats i { opacity: 0; transition: opacity 0.5s 0.5s; }
.att.in .grid724 i, .att.in .cats i { opacity: 1; }
.att .hist canvas, .att .line canvas { clip-path: inset(0 100% 0 0); transition: clip-path 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.4s; }
.att.in .hist canvas, .att.in .line canvas { clip-path: inset(0 0 0 0); }

/* 触控目标 */
.btn, .codein input { height: 46px; }
.win .x::after, .att > header .x::after { content: ''; position: absolute; inset: -14px; }
.att > header .x { position: relative; }
.att .next, .win .next { padding: 12px 0 4px 24px; }

/* 手机底栏：档案出来后，把最常用的三件事放在拇指够得着的地方 */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 46; display: none; grid-template-columns: 1.5fr 1fr 1fr; gap: 1px; background: #000; padding: 1px 0 env(safe-area-inset-bottom); translate: 0 110%; transition: translate 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
.dock button { height: 46px; background: var(--desk-2); color: var(--cream); font-size: var(--px-s); }
.dock button:first-child { color: var(--gold); letter-spacing: 1px; }
.dock button:active { background: var(--gold); color: #000; }
.filed .dock { translate: 0 0; }
.proto { padding-bottom: env(safe-area-inset-bottom); transition: translate 0.35s; }
html:not(.at0) .proto { translate: 0 110%; }
@media (max-width: 759px) {
  .dock { display: grid; }
  .col { padding-bottom: 110px; }
  .lab.q { max-width: 66vw; }
}

/* ---------- 封面：证件照显影（原型 cover-lab/design1） ----------
   所有类名带 cv- 前缀并限定在 .cover 内，避免和档案纸的 .note / .sheet / .body 等撞名。
   状态挂在 .cover 上：is-go 字图就绪 → is-play 入场 → is-ready 可操作 → is-leaving 退场 → is-gone 底色淡出。 */
html.gated, html.gated body { overflow: hidden; }
.cover { --gut: 18px; --t: clamp(44px, 14.1vw, 60px); --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px); --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
  position: fixed; inset: 0; z-index: 300; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  background: var(--desk); color: var(--cream); font-size: 12px; line-height: 18px; transition: background-color 0.6s linear; }
.cover.is-gone { background-color: transparent; pointer-events: none; }
.cv-main { visibility: hidden; position: relative; display: flex; flex-direction: column; height: 100vh; height: 100svh; }
.is-go .cv-main { visibility: visible; }
.cv-photo { position: relative; flex: 1 1 auto; min-height: 280px; overflow: hidden; margin: 0; }
.cv-photo canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* 顶栏：与正文观测屏的系统栏同高同底（黑、30px + 安全区），封面揭开时原地换成正文那条，照片从它下面开始 */
.cv-main { padding-top: calc(30px + var(--st)); }
.cv-bar { position: fixed; z-index: 3; top: 0; left: 0; right: 0; height: calc(30px + var(--st)); padding: var(--st) calc(12px + var(--sr)) 0 calc(12px + var(--sl)); display: flex; align-items: center; gap: 10px; background: #000; color: var(--cream); white-space: nowrap; pointer-events: none; }
.cv-bar .star { flex: none; }
.cv-path { flex: 1; min-width: 0; overflow: hidden; color: var(--milk); }
.cv-dots { flex: none; display: flex; gap: 5px; }
.cv-dots i { width: 6px; height: 6px; border-radius: 50%; }
.cv-dots i:nth-child(1) { background: var(--c-scav); } .cv-dots i:nth-child(2) { background: var(--c-seer); } .cv-dots i:nth-child(3) { background: var(--c-myc); }

/* 扫描读数：跟着扫描头下行，到底后变成设定图的 ID PHOTO 标签 */
.cv-readout { position: absolute; z-index: 2; right: calc(var(--gut) + var(--sr)); top: 0; height: 18px; padding: 0 6px; background: var(--c-scav); color: var(--cream); white-space: nowrap; will-change: transform; opacity: 0; }
.cv-readout.is-on { opacity: 1; }
.cv-readout.is-id { background: #000; }

/* 标题：两行，第一行压住照片下缘，每行是一块深色底的切口，从遮罩里升起 */
.cv-body { position: relative; z-index: 2; margin-top: calc(var(--t) * -0.66); padding: 0 calc(var(--gut) + var(--sr)) calc(16px + var(--sb)) calc(var(--gut) + var(--sl)); }
.cv-title { font-family: 'ZunSong', serif; font-weight: normal; font-size: var(--t); line-height: 1.08; letter-spacing: 0.02em; -webkit-font-smoothing: antialiased; }
.cv-ln { display: block; overflow: hidden; margin-left: calc(-1 * var(--gut) - var(--sl)); }
.cv-in { display: inline-block; white-space: nowrap; background: var(--desk); padding: 0.07em 0.14em 0.01em calc(var(--gut) + var(--sl)); }
.cv-meta { display: grid; grid-template-columns: auto 1fr; column-gap: 28px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(168, 150, 132, 0.32); }
.cv-meta dt { color: var(--milk); }
.cv-meta dd { font-size: 18px; line-height: 24px; white-space: nowrap; }
.cv-rec { grid-column: 1 / -1; margin-top: 8px; }   /* 数据总数单独一行 */
.cv-recn { font-variant-numeric: tabular-nums; }
.cv-note { margin-top: 12px; color: var(--milk); max-width: 30em; }
.cv-ops { margin-top: 6px; pointer-events: none; }
.is-ready .cv-ops { pointer-events: auto; }
.cv-agree { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; user-select: none; }
.cv-agree input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.cv-box { flex: none; width: 18px; height: 18px; border: 2px solid var(--cream); display: grid; place-items: center; transition: background-color 0.15s, border-color 0.15s; }
.cv-box svg { width: 12px; height: 12px; opacity: 0; transition: opacity 0.12s; }
.cv-agree input:checked + .cv-box { background: var(--cream); }
.cv-agree input:checked + .cv-box svg { opacity: 1; }
.cv-agree input:focus-visible + .cv-box { outline: 2px solid var(--gold); outline-offset: 3px; }
.cv-doc { color: var(--gold); padding: 13px 0; margin: -13px 0; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.cv-agree.is-warn .cv-box { border-color: var(--c-scav); animation: cvShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97); }

/* 入口：右侧一支像素箭头，按住时往前推；载入中是空框加闪动光标 */
.cv-enter { margin-top: 6px; width: 100%; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; background: var(--cream); color: var(--ink); transition: background-color 0.15s, color 0.15s, transform 0.15s; }
.cv-lb { font-family: 'ZunSong', serif; font-size: 20px; line-height: 1; letter-spacing: 0.06em; -webkit-font-smoothing: antialiased; }
.cv-ar { position: relative; width: 22px; height: 2px; background: currentColor; transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.cv-ar::after { content: ''; position: absolute; right: 1px; top: -3px; width: 8px; height: 8px; box-sizing: border-box; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); }
.cv-enter:hover .cv-ar, .cv-enter:active .cv-ar { width: 34px; }
.cv-enter:hover { background: var(--paper); }
.cv-enter:active { transform: translateY(1px); }
.cv-enter.is-warn { background: var(--panel); }
.cv-enter[data-state='load'] { background: transparent; color: var(--milk); box-shadow: inset 0 0 0 1px rgba(243, 235, 220, 0.24); cursor: default; }
.cv-enter[data-state='load'] .cv-ar { width: 9px; height: 16px; animation: cvBlink 0.9s steps(2) infinite; }
.cv-enter[data-state='load'] .cv-ar::after { display: none; }
.cv-enter:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

@media (min-width: 960px) {
  .cover { --gut: 56px; --t: clamp(64px, 6.3vw, 104px); }
  .cv-main { flex-direction: row; height: 100vh; min-height: 640px; }
  .cv-photo { flex: 0 0 46%; min-height: 0; }
  .cv-readout { right: 24px; }
  .cv-body { flex: 1 1 auto; margin-top: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: max(120px, 20vh) var(--gut) 56px var(--gut); }
  /* 第一行伸进照片里形成错位，第二行回到栏线 */
  .cv-ln { margin-left: calc(-1 * var(--gut)); }
  .cv-ln:first-child { margin-left: calc(-1 * var(--gut) - 1.25em); }
  .cv-ln:first-child .cv-in { padding-left: 0.2em; }
  .cv-in { padding-left: var(--gut); }
  .cv-title { margin-top: 0; }
  .cv-meta { margin-top: 28px; padding-top: 14px; max-width: 620px; column-gap: 56px; }
  .cv-meta dd { font-size: 24px; line-height: 32px; }
  .cv-note { margin-top: auto; max-width: 34em; }
  .cv-ops { margin-top: 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: 620px; flex-wrap: wrap; }
  .cv-enter { width: 300px; margin-top: 0; }
}
@media (max-width: 359px) { .cv-meta dd { font-size: 12px; line-height: 18px; } .cv-path { visibility: hidden; } }
@media (max-width: 959px) and (max-height: 700px) { .cv-main { height: auto; } .cv-photo { flex: none; height: max(300px, 52svh); } }

/* 开场：数据总数载入（pre.js，方向 C「汇聚」）。容器铺满封面，顶栏压在它上面 */
.cover .cv-bar { visibility: visible; z-index: 6; }   /* 顶栏从开场起就在，封面阶段不再突然出现 */
.has-pre .cv-bar * { animation: none !important; }
.cv-pre { position: absolute; inset: 0; z-index: 5; }
/* ---------- 开场本体（全部 pre- 前缀） ---------- */
.pre-root { position: absolute; inset: 0; overflow: hidden; background: var(--desk); }
.pre-cv { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.pre-static { opacity: 0; transition: opacity 0.4s; }
.pre-root.is-on .pre-static { opacity: 1; }

.pre-t { position: absolute; margin: 0; white-space: nowrap; opacity: 0; translate: 0 6px; transition: opacity 0.4s, translate 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.pre-root.is-on .pre-t { opacity: 1; translate: 0 0; }
.pre-root.is-on .pre-say { transition-delay: 0.08s; }
.pre-root.is-on .pre-numrow { transition-delay: 0.14s; }
.pre-cap { display: flex; justify-content: space-between; font: 12px/14px 'Pixel', monospace; color: var(--milk); }
.pre-say { font-family: 'ZunSong', 'Songti SC', serif; color: var(--cream); }
.pre-numrow { display: flex; align-items: baseline; gap: 8px; }
.pre-num { display: inline-block; text-align: right; font-family: 'Abril', 'ZunSong', serif; line-height: 0.92; color: var(--cream); font-variant-numeric: lining-nums; }
.pre-unit { font-family: 'ZunSong', 'Songti SC', serif; color: var(--cream); }

/* 收场：文字与标签先退，点阵压扁成线 */
.pre-root.is-out .pre-t { opacity: 0; translate: 0 0; transition: opacity 0.2s; }
.pre-line { position: absolute; left: 0; top: calc(30px + env(safe-area-inset-top, 0px)); width: 100%; height: 2px; background: #c5352b; transform-origin: 0 0; visibility: hidden; will-change: transform; }
@media (min-width: 960px) { .pre-line { width: 46%; } }


/* 入场（与 JS 时间轴同一时钟） */
.is-play .cv-in { animation: cvRise 0.78s cubic-bezier(0.16, 0.84, 0.12, 1) both; }
.is-play .cv-ln:nth-child(1) .cv-in { animation-delay: 1.52s; }
.is-play .cv-ln:nth-child(2) .cv-in { animation-delay: 1.66s; }
.is-play .cv-meta { animation: cvRule 0.6s cubic-bezier(0.2, 0.7, 0, 1) 1.95s both; }
.is-play .cv-meta dt { animation: cvFade 0.3s linear 2s both; }
.is-play .cv-note { animation: cvFadeUp 0.5s cubic-bezier(0.2, 0.7, 0, 1) 2.5s both; }
.is-play .cv-agree { animation: cvFadeUp 0.5s cubic-bezier(0.2, 0.7, 0, 1) 2.6s both; }
.is-play .cv-enter { animation: cvFadeUp 0.5s cubic-bezier(0.2, 0.7, 0, 1) 2.7s both; }
.is-play .cv-bar .star { animation: cvFade 0.01s steps(1) 0.25s both; }
.is-play .cv-dots i { animation: cvFade 0.01s steps(1) both; }
.is-play .cv-dots i:nth-child(1) { animation-delay: 0.95s; } .is-play .cv-dots i:nth-child(2) { animation-delay: 1.05s; } .is-play .cv-dots i:nth-child(3) { animation-delay: 1.15s; }
@keyframes cvRise { from { transform: translateY(108%); } to { transform: none; } }
@keyframes cvRule { from { border-top-color: transparent; clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes cvFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cvFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cvShake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }
@keyframes cvBlink { 50% { opacity: 0.15; } }

/* 退场：入场动画用了 fill: both，必须用 animation 覆盖才能改透明度 */
.cover.is-leaving .cv-ops, .cover.is-leaving .cv-note, .cover.is-leaving .cv-meta, .cover.is-leaving .cv-bar, .cover.is-leaving .cv-readout, .cover.is-leaving .cv-agree, .cover.is-leaving .cv-enter { animation: cvOut 0.26s linear both !important; }
.cover.is-leaving .cv-in { animation: cvSink 0.42s cubic-bezier(0.6, 0, 0.84, 0.3) both !important; }
.cover.is-leaving .cv-ln:nth-child(2) .cv-in { animation-delay: 0.05s !important; }
@keyframes cvOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes cvSink { from { transform: none; } to { transform: translateY(108%); } }
.cv-fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 301; display: none; }

/* 协议抽屉（版式取自档案「附件」窗口：深色标题栏 + ×） */
.cv-sheet { position: fixed; inset: 0; z-index: 30; visibility: hidden; }
.cv-sheet.is-open { visibility: visible; }
.cv-mask { position: absolute; inset: 0; background: rgba(5, 3, 2, 0.66); opacity: 0; transition: opacity 0.25s linear; }
.cv-sheet.is-open .cv-mask { opacity: 1; }
.cv-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 84svh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); transform: translateY(100%); transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.1, 1); }
.cv-sheet.is-open .cv-panel { transform: none; }
.cv-sbar { position: relative; flex: none; display: flex; align-items: center; justify-content: space-between; height: 44px; padding-left: var(--gut); background: var(--ink); color: var(--cream); }
.cv-sbar span em { font-style: normal; color: var(--gold); margin-right: 8px; }
.cv-x { width: 48px; height: 44px; font-size: 18px; line-height: 44px; }
.cv-rprog { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: 0 50%; }   /* 阅读进度 */
.cv-sbody { overflow-y: auto; padding: 18px var(--gut) 8px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.cv-sbody h2 { font-family: 'ZunSong', serif; font-weight: normal; font-size: 26px; line-height: 1.2; margin-bottom: 6px; -webkit-font-smoothing: antialiased; }
.cv-sbody ol { list-style: none; }
.cv-sbody li { display: grid; grid-template-columns: 28px 1fr; padding: 12px 0; border-top: 1px dashed rgba(23, 16, 10, 0.25); }
.cv-sbody li b { font-weight: normal; color: var(--ink-2); }
.cv-sbody h3 { font-family: 'ZunSong', serif; font-weight: normal; font-size: 17px; line-height: 22px; margin-bottom: 2px; -webkit-font-smoothing: antialiased; }
.cv-sbody p { color: var(--ink-2); }
.cv-sfoot { flex: none; display: flex; gap: 10px; padding: 12px var(--gut) calc(14px + var(--sb)); background: var(--paper); border-top: 1px solid rgba(23, 16, 10, 0.15); }
.cv-sfoot button { height: 48px; flex: 1; font-family: 'ZunSong', serif; font-size: 18px; }
.cv-ghost { background: var(--panel); color: var(--ink); flex: 0 0 34% !important; }
.cv-ok { background: var(--ink); color: var(--cream); transition: opacity 0.2s; }
.cv-ok[aria-disabled='true'] { opacity: 0.42; cursor: default; }
.cv-ok.is-warn { animation: cvShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
.cv-sbody:focus { outline: none; }
@media (min-width: 960px) {
  .cv-panel { left: auto; right: 56px; bottom: 56px; width: 520px; max-height: calc(100vh - 112px); box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.5); transform: translateY(24px); opacity: 0; transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.1, 1), opacity 0.2s linear; }
  .cv-sheet.is-open .cv-panel { opacity: 1; }
  .cv-sbar, .cv-sbody, .cv-sfoot { padding-left: 24px; }
  .cv-sbody, .cv-sfoot { padding-right: 24px; }
}
.is-final .cv-in, .is-final .cv-meta, .is-final .cv-meta dt, .is-final .cv-note, .is-final .cv-agree, .is-final .cv-enter, .is-final .cv-bar .star, .is-final .cv-dots i { animation: none !important; }


html.still *, html.still *::before, html.still *::after { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.dock[hidden] { display: none !important; }
.f.wait .why { visibility: hidden; }

/* 分享图预览：最后一页「评估人评语」 */
.cardimg { display: block; width: 100%; aspect-ratio: 3 / 4; margin-top: 14px; background: var(--panel); box-shadow: var(--hard); -webkit-touch-callout: default; }
.anon { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 8px; font-size: var(--px-s); color: var(--ink-2); }
.anon input { appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin: 0; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); display: grid; place-items: center; cursor: pointer; }
.anon input::after { content: ''; width: 10px; height: 10px; background: var(--ink); transform: scale(0); transition: transform 0.12s steps(2); }
.anon input:checked::after { transform: scale(1); }
.anon input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* 签名：手写 / 输入名字两种方式，确认后附件开放 */
.sigpad.locked canvas { pointer-events: none; }
.sigctl { margin: 6px 12px 0; }
.seg { display: inline-flex; border: 2px solid var(--ink); }
.seg button { min-height: 44px; padding: 0 14px; font-size: var(--px-s); color: var(--ink); background: transparent; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
.sigctl .typed { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sigctl .typed[hidden] { display: none; }
.sigctl input { flex: 1 1 160px; min-width: 0; height: 48px; padding: 0 10px; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); font: 16px 'ZunSong', serif; }
.sigctl .btns { margin-top: 10px; }
.sigmsg { margin-top: 8px; font-size: var(--px-s); line-height: 1.6; color: var(--stamp); }
.sigctl.done .seg, .sigctl.done .typed, .sigctl.done #sigOk { display: none; }
.sigctl.done .btns { grid-template-columns: 1fr; }
.sigctl.done .sigmsg { color: var(--ink-2); }
.attach.locked { display: none; }
.lock { margin-top: 22px; background: var(--paper); color: var(--ink); box-shadow: var(--hard); }
.lock[hidden] { display: none; }
.lock > header { display: flex; align-items: center; height: 28px; padding: 0 10px; background: var(--ink); color: var(--paper); font-size: var(--px-s); }
.lock > header .no { color: var(--gold); margin-right: 8px; }
.lock .body { padding: 16px 14px 14px; }
.lock .lead { font-family: 'ZunSong', serif; font-size: 25px; line-height: 1.34; -webkit-font-smoothing: antialiased; }
.lock p.sub { margin-top: 10px; color: var(--ink-2); font-size: var(--px-m); line-height: 1.6; }


/* ============================================================
   上线版：数据载入中（不出文字，只有一条读取线）与取不到报告时的说明页
   ============================================================ */
html.booting body > :not(.boot-wait):not(script) { visibility: hidden; }
.boot-wait { display: none; }
html.booting .boot-wait { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; background: var(--desk); }
.boot-wait i { position: relative; width: min(240px, 60vw); height: 2px; background: rgba(243, 235, 220, 0.12); overflow: hidden; }
.boot-wait i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 34%; background: #c5352b; animation: bootWait 1.1s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate; }
@keyframes bootWait { to { transform: translateX(194%); } }
@media (prefers-reduced-motion: reduce) { .boot-wait i::after { animation: none; } }
.boot-msg { position: fixed; inset: 0; z-index: 600; display: flex; flex-direction: column; justify-content: center; gap: 14px;
  padding: calc(56px + env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: var(--desk); color: var(--cream); max-width: 560px; margin: 0 auto; }
.boot-msg .bm-bar { position: fixed; top: 0; left: 0; right: 0; height: calc(30px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0;
  display: flex; align-items: center; gap: 8px; background: #000; color: var(--milk); font-size: var(--px-s); }
.boot-msg h1 { font-family: 'ZunSong', 'Songti SC', serif; font-weight: 400; font-size: clamp(32px, 9vw, 44px); line-height: 1.2; -webkit-font-smoothing: antialiased; }
.boot-msg p { color: var(--milk); font-size: var(--px-m); line-height: 1.7; }
.boot-msg a { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; align-self: flex-start; text-decoration: none; font-size: var(--px-m); }
.boot-msg .bm-go { margin-top: 10px; background: var(--paper); color: var(--ink); box-shadow: 4px 4px 0 rgba(200, 161, 101, 0.5); }
.boot-msg .bm-back { color: var(--milk); padding: 0; }
