/* 信号尽头 · V4.0 —— 表世界「清爽日常」白底风 + 后期腐化「病历纸」反差
 *
 * 设计意图：
 *  - 表世界(stage 0)：纯白 #FFFFFF / 极浅米灰 #F8F9FA 背景，正文深灰 #333，
 *    超链接互联网蓝 #0066CC、visited 紫红 #551A8B。UI 组件带早期 OS 质感
 *    （浅灰内阴影 + 1px 实线边框，近似 XP/7/IE7 时代网页）。
 *  - 后期腐化(stage 1→3)：白底逐渐变「惨白病历纸」、蓝链接渗「暗红」、排版「留白错位」。
 *    用「正常感」反衬恐怖，制造强烈反差。
 *
 * 双轨制色彩系统：仍由 html[data-corruption="0|1|2|3"] 驱动（JS 实时写入）。
 * 表世界(0)=清爽白；里世界随污染度逐步渗入病历纸黄 / 暗红 / 错位。
 */

:root {
  /* —— 纸张/屏幕层次感：主背景米白(非纯白)，卡片纯白浮起，分割线 #E5E5E5 —— */
  --bg: #F9F9F7;              /* 带一点暖黄的米白，模拟旧纸张 / 老屏幕，消除刺眼感 */
  --bg-soft: #F2F1EC;
  --panel: #FFFFFF;           /* 卡片/内容区纯白，配极淡阴影「浮」在背景上 */
  --panel2: #FFFFFF;
  --text: #1a1a1a;           /* 深近黑，宋体在白底上阅读如旧报纸/旧档案 */
  --muted: #555555;
  --line: #E5E5E5;            /* 早期网页表格边框灰，摒弃实色黑线 */
  --line-soft: #ECECEC;

  /* 信号色：沉静青绿点缀（不复用为全局主色） */
  --signal: #1f8a7a;
  --signal-dim: #8fbdb4;
  --danger: #c0392b;
  --amber: #b8860b;

  /* 经典超链接语义：恢复 2000 年代初浏览器默认（蓝 + 下划线，visited 紫红） */
  --accent: #0000EE;
  --link: #0000EE;
  --link-visited: #551A8B;
  --link-hover: #0000EE;
  --link-active: #FF0000;
  --url-green: #008000;       /* 搜索结果 URL 经典绿 */
  --paper: #F4F1E6;           /* 病历纸底色（腐化用） */

  --divider: #d7dce1;         /* 卡片内分隔线（清晰可见，浅色主题用） */
  --chroma: 0px;              /* 色差强度（里世界开启） */

  /* 全局/终端 CRT 叠层强度（受「显示⚙」no-crt 关闭；渐进式随污染等级增强） */
  --crt: 0.3;

  /* 早期 OS 质感：浅灰内阴影 + 1px 实线边框 */
  --os-border: 1px solid var(--line);
  --os-shadow: 0 1px 3px rgba(0,0,0,.06);   /* 极淡阴影，内容轻轻浮起 */

  /* 字体时代感：标题=点阵/像素字体(Zpix 优先，回退宋体)；正文=宋体/明体；等宽=终端感 */
  --font-serif: "Zpix", "WenQuanYi Bitmap Song", "SimSun", "宋体", "Songti SC", monospace;
  --font-sans:  "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-mono:  "JetBrains Mono", "Courier New", Consolas, monospace;
}

/* 点阵/像素字体（在线拉取，失败则静默回退到宋体，不影响离线运行） */
@font-face {
  font-family: "Zpix";
  src: url("https://cdn.jsdelivr.net/gh/SolidZORO/zpix-pixel-font/dist/Zpix.woff2") format("woff2"),
       url("https://cdn.jsdelivr.net/gh/SolidZORO/zpix-pixel-font/dist/Zpix.ttf") format("truetype");
  font-display: swap;
}

/* ============ 双轨制色彩系统：里世界分级（白→病历纸） ============ */
html[data-corruption="1"] {
  --bg: #F7F6F1; --bg-soft: #F0EEE6; --panel: #FFFFFF; --panel2: #FCFBF7;
  --text: #1a1a1a; --muted: #5a564c; --line: #E2DCCB; --line-soft: #ECE7DA;
  --signal: #2c8a78; --signal-dim: #9bbcb3; --accent: #0000EE; --link: #0000EE; --link-visited: #551A8B;
  --danger: #c0392b; --amber: #b8860b; --chroma: 0px;
}
html[data-corruption="2"] {
  --bg: #F4F1E6; --bg-soft: #EDE9DB; --panel: #FBFAF4; --panel2: #F1EDE0;
  --text: #3a3327; --muted: #7a6f57; --line: #C9BFA0; --line-soft: #D8CFB8;
  --signal: #9c3b2e; --signal-dim: #b3896f; --accent: #9c3b2e; --link: #9c3b2e; --link-visited: #6e1f5e;
  --danger: #a32a1d; --amber: #9c6f12; --chroma: 0px;
}
html[data-corruption="3"] {
  --bg: #ECE6D6; --bg-soft: #E3DCC8; --panel: #F6F1E4; --panel2: #E8E1CD;
  --text: #4a4332; --muted: #86744f; --line: #C2B58f; --line-soft: #CFC3a0;
  --signal: #a8442f; --signal-dim: #b58a72; --accent: #8B0000; --link: #8B0000; --link-visited: #5e0b4f;
  --danger: #8B0000; --amber: #8a5d0e; --chroma: .5px;
}

/* 里世界：链接转为暗红 + 文字边缘极轻色差 */
html[data-corruption="2"] a { color: var(--link); }
html[data-corruption="3"] a { color: var(--link); text-shadow: 0 0 6px rgba(139,0,0,.28); }
html[data-corruption="2"] h1, html[data-corruption="2"] h2,
html[data-corruption="3"] h1, html[data-corruption="3"] h2,
html[data-corruption="2"] .tb-logo, html[data-corruption="3"] .tb-logo {
  text-shadow: var(--chroma) 0 rgba(139,0,0,.45), calc(var(--chroma) * -1) 0 rgba(0,80,120,.3);
}

/* ============ 原教旨黑主题（html.theme-dark）：还原最初黑底绿字 CRT 终端 ============
 * 由舒适度初始选择驱动：选「原汁原味/原教旨黑」→ 整站黑底；选「清爽白」→ 明亮日常风。
 * 持久化在 localStorage（signal_end_comfort.theme），并可在「显示⚙」面板随时切换。
 */
html.theme-dark {
  --bg: #060807; --bg-soft: #0a0d0b; --panel: #0e120f; --panel2: #0b0e0c;
  --text: #cdf5e8; --muted: #6f9a8c; --line: #1c2820; --line-soft: #16201a;
  --signal: #2fe6c4; --signal-dim: #1c8e78; --danger: #ff4d4d; --amber: #ffb020;
  --accent: #54e0c4; --link: #46d0ff; --link-visited: #b07bff; --link-hover: #8af0ff;
  --link-active: #ff6b6b; --url-green: #5fe08a; --paper: #0e120f; --divider: #233029;
  --crt: 0.42;
  --os-border: 1px solid var(--line);
  --os-shadow: 0 1px 8px rgba(0,0,0,.5);
}
/* 里世界分级：黑底之上仍按污染度向血红渗入（不退回病历纸黄） */
html.theme-dark[data-corruption="1"] {
  --bg: #070a09; --bg-soft: #0b0f0d; --panel: #0f130f; --panel2: #0b0e0c;
  --text: #cdf5e8; --muted: #6f9a8c; --line: #1d2a22; --line-soft: #172219;
  --signal: #36c9ab; --signal-dim: #1f9480; --danger: #ff5a5a; --amber: #ffb020;
}
html.theme-dark[data-corruption="2"] {
  --bg: #0c0a08; --bg-soft: #110d0a; --panel: #160f0c; --panel2: #110c0a;
  --text: #e7cabb; --muted: #a07e6a; --line: #2e201a; --line-soft: #241812;
  --signal: #e0623e; --signal-dim: #a8452c; --danger: #ff4d4d; --amber: #ffb020;
  --link: #ff7a5a; --link-visited: #c25bd6; --accent: #e0623e;
}
html.theme-dark[data-corruption="3"] {
  --bg: #100806; --bg-soft: #160c09; --panel: #1b0e0b; --panel2: #140b09;
  --text: #f0c3b2; --muted: #a87a68; --line: #33150f; --line-soft: #281109;
  --signal: #ff5b3a; --signal-dim: #b8432a; --danger: #ff2d2d; --amber: #ffae1f;
  --link: #ff3b3b; --link-visited: #ff5bb0; --accent: #ff3b3b; --chroma: .5px;
}

/* —— 通用文字/标题 —— */
html.theme-dark h1, html.theme-dark h2, html.theme-dark h3, html.theme-dark h4,
html.theme-dark .tb-logo, html.theme-dark .hero h1, html.theme-dark .clue-cat h4 { color: var(--text); }

/* —— 滚动条 —— */
html.theme-dark * { scrollbar-color: #2a3a30 #0a0d0b; }
html.theme-dark ::-webkit-scrollbar-track { background: #0a0d0b; }
html.theme-dark ::-webkit-scrollbar-thumb { background: #2a3a30; border-color: #0e1410; }
html.theme-dark ::-webkit-scrollbar-thumb:hover { background: #365046; }

/* —— 顶部 HUD —— */
html.theme-dark .tb-chip { background: var(--panel); }
html.theme-dark .tb-chip .chip-k { color: var(--muted); }
html.theme-dark .tb-btn { background: var(--panel); color: var(--text); }
html.theme-dark .tb-btn:hover { background: var(--panel2); color: var(--link); }
html.theme-dark .chrome { background: linear-gradient(180deg,#10140f,#0a0d0b); }
html.theme-dark .nav-btn { background: var(--panel); border-color: var(--line); color: var(--text); }
html.theme-dark .nav-btn:hover { background: var(--panel2); border-color: var(--signal-dim); color: var(--text); }
html.theme-dark .nav-btn:disabled { color: var(--muted); border-color: var(--line); }
html.theme-dark .addr { background: var(--panel); border-color: var(--line); color: var(--text); }
html.theme-dark .addr-lock { color: var(--muted); }
html.theme-dark .bm-link { background: var(--bg-soft); color: var(--text); }
html.theme-dark .bm-link:hover { background: var(--panel); color: var(--link); }

/* —— 通用按钮（Win98 凸起）→ 暗色金属 —— */
html.theme-dark .tb-btn, html.theme-dark .btn-primary, html.theme-dark .nav-btn,
html.theme-dark .pager-btn, html.theme-dark .keep-btn, html.theme-dark .modal-actions button,
html.theme-dark .link-btn, html.theme-dark .hint, html.theme-dark .drawer-x, html.theme-dark .modal-head button {
  background: var(--panel2); color: var(--text); border-color: var(--line);
}
html.theme-dark .tb-btn:hover, html.theme-dark .btn-primary:hover, html.theme-dark .nav-btn:hover,
html.theme-dark .pager-btn:hover:not(:disabled), html.theme-dark .keep-btn:hover,
html.theme-dark .modal-actions button:hover, html.theme-dark .link-btn:hover, html.theme-dark .hint:hover,
html.theme-dark .drawer-x:hover { background: var(--panel); color: var(--link); }
html.theme-dark .tb-btn:active, html.theme-dark .btn-primary:active, html.theme-dark .nav-btn:active,
html.theme-dark .pager-btn:active:not(:disabled), html.theme-dark .keep-btn:active,
html.theme-dark .modal-actions button:active, html.theme-dark .link-btn:active,
html.theme-dark .hint:active, html.theme-dark .drawer-x:active { background: var(--bg-soft); }
html.theme-dark .pager-btn:disabled { color: var(--muted); background: var(--panel2); }

/* —— 输入框 —— */
html.theme-dark .search-box input, html.theme-dark .codename-row input,
html.theme-dark .term-cmd, html.theme-dark .modal textarea, html.theme-dark textarea {
  background: var(--panel); color: var(--text); border-color: var(--line);
}
html.theme-dark .search-box input:focus { box-shadow: inset 0 0 0 2px rgba(47,230,196,.4); }
html.theme-dark .search-box input::placeholder, html.theme-dark .codename-row input::placeholder { color: var(--muted); }
html.theme-dark .btn-primary { background: linear-gradient(180deg, var(--signal), var(--signal-dim)); color: #05201b; border-color: transparent; box-shadow: 0 2px 8px rgba(47,230,196,.22); }
html.theme-dark .btn-primary:hover { background: linear-gradient(180deg, #45e9c9, var(--signal)); color: #042; box-shadow: 0 4px 14px rgba(47,230,196,.3); }
html.theme-dark .hint:hover { background: var(--panel2); }
html.theme-dark .search-tab { background: var(--panel); color: var(--text); }
html.theme-dark .search-tab.active { background: var(--panel2); color: var(--link); }
html.theme-dark .search-panel { background: var(--panel); }

/* —— 卡片 / 抽屉 / 弹窗 —— */
html.theme-dark .drawer { background: var(--bg-soft); }
html.theme-dark .clue-item { background: var(--panel); }
html.theme-dark .modal { background: var(--panel); }
html.theme-dark .modal textarea { background: var(--panel2); color: var(--text); border-color: var(--line); }
html.theme-dark .modal-actions button { background: var(--panel2); color: var(--text); }
html.theme-dark .radar { background: var(--panel); }
html.theme-dark .exif { background: var(--panel); }
html.theme-dark .codename-wrap { background: var(--panel); }

/* —— 搜索页（真实引擎观感，暗色化） —— */
html.theme-dark .search-page .sp-sub { color: var(--muted); }
html.theme-dark .search-input-row { background: var(--panel); border-color: #2b7de9; box-shadow: 0 2px 14px rgba(43,125,233,.18); }
html.theme-dark .search-input-row #q { color: var(--text); }
html.theme-dark .hotsearch { background: var(--panel); border-color: var(--line); }
html.theme-dark .hotsearch h4 { border-bottom-color: var(--line); }
html.theme-dark .hot-row { border-bottom-color: var(--divider); cursor: default; }
html.theme-dark .hot-row:hover { background: var(--panel2); }
html.theme-dark .hot-rank { color: var(--muted); }
html.theme-dark .hot-term { color: var(--text); }
html.theme-dark .hot-title { color: var(--muted); }
html.theme-dark .hot-snip { color: var(--muted); }
html.theme-dark .hot-heat { color: var(--muted); }
html.theme-dark .result-stats { color: var(--link); }
html.theme-dark .pager-btn { background: var(--panel); border-color: var(--line); color: var(--link); }
html.theme-dark .pager-btn:hover { background: var(--panel2); }
html.theme-dark .serp-comments { background: var(--panel2); border-left-color: var(--line); }
html.theme-dark .cmt { color: var(--muted); }
html.theme-dark .serp-jump { color: var(--link); }
html.theme-dark .serp-note { background: rgba(47,230,196,.08); border-color: var(--signal-dim); color: var(--signal); }
html.theme-dark .serp-note.warn { background: rgba(255,77,77,.08); border-color: var(--danger); color: var(--danger); }
html.theme-dark .bookmarks-block h3 { color: var(--text); }

/* —— CRT 叠层：黑底上改用淡绿扫描线 + 暗角（避免黑线在黑底不可见） —— */
html.theme-dark body::before {
  background:
    repeating-linear-gradient(0deg, rgba(120,255,210, calc(var(--crt, .42) * .07)) 0 1px, transparent 1px 3px),
    radial-gradient(120% 120% at 50% 45%, transparent 52%, rgba(0,0,0,.72) 100%);
}

/* —— 血色闪烁：黑底改用深红渗染 —— */
html.theme-dark body.blood-flash { background: #160404 !important; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .6s ease, color .6s ease;
}

/* ============ V4.5 复古白：圆角 + 经典滚动条 + 原生组件 ============ */
/* 经典细滚动条（隐藏现代宽圆角条） */
* { scrollbar-width: thin; scrollbar-color: #c4c4c4 #f2f2f2; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #f2f2f2; }
::-webkit-scrollbar-thumb { background: #c4c4c4; border: 1px solid #aaaaaa; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* 经典超链接：蓝 + 下划线；访问后紫红；激活时正红（不用圆角按钮/胶囊标签替代链接） */
a { color: var(--link); text-decoration: underline; }
a:visited { color: var(--link-visited); }
a:hover { color: var(--link-hover); text-decoration: underline; }
a:active { color: var(--link-active); }

/* ============ 病历纸横向纹理（腐化阶段 3 让白底浮现「纸上横线」） ============ */
html[data-corruption="3"] body {
  background-image: repeating-linear-gradient(0deg, rgba(120,90,40,.05) 0 1px, transparent 1px 26px);
}

/* CRT 叠加层：极轻扫描线 + 暗角（强度随 --crt，受 no-crt / reduced-motion 控制） */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9000;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0, calc(var(--crt, .3) * .10)) 0 1px, transparent 1px 3px),
    radial-gradient(120% 120% at 50% 45%, transparent 60%, rgba(0,0,0, calc(var(--crt, .3) * .18)) 100%);
  animation: flicker 7s infinite;
}
/* CRT 叠加层：胶片噪点（强度随 --crt） */
body::after {
  content: ""; position: fixed; inset: -50%; pointer-events: none; z-index: 9001;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: calc(var(--crt, .3) * .14); animation: grain 1.1s steps(4) infinite;
}

/* 基础超链接样式见上文「经典超链接」块（去圆角/复古区） */

/* 统一线性图标 */
.ic {
  width: 15px; height: 15px; vertical-align: -2px; margin-right: 5px;
  stroke: currentColor; fill: none; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; flex: none;
}

h1, h2, h3, h4 { font-weight: 600; letter-spacing: .02em; color: #1f1f1f; }

/* ============ 顶部 HUD 状态栏（轻量化，浅灰描边） ============ */
#topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.tb-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tb-logo {
  font-family: var(--font-serif); font-weight: 700; letter-spacing: .18em;
  font-size: 17px; color: #1f1f1f; white-space: nowrap;
}
.tb-meter { display: flex; align-items: center; gap: 8px; }
.tb-sub { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: .12em; }
.tb-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-chip {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  background: #fff;
}
.tb-chip .chip-k { color: #9aa0a5; }
.tb-signal { color: var(--signal); border-color: var(--signal-dim); }

/* 信号强度条 */
.sig-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.sig-bars i { width: 3px; background: var(--signal); display: block; border-radius: 1px; animation: sig 1.5s ease-in-out infinite; }
.sig-bars i:nth-child(1){ height: 4px;  animation-delay: 0s; }
.sig-bars i:nth-child(2){ height: 7px;  animation-delay: .15s; }
.sig-bars i:nth-child(3){ height: 10px; animation-delay: .3s; }
.sig-bars i:nth-child(4){ height: 7px;  animation-delay: .45s; opacity: .4; }
.sig-bars i:nth-child(5){ height: 4px;  animation-delay: .6s;  opacity: .25; }

.tb-btn {
  display: inline-flex; align-items: center;
  font-size: 13px; cursor: pointer; font-family: var(--font-sans);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 12px; color: #333; background: #fff;
  transition: border-color .15s, color .15s, box-shadow .15s, background .15s;
}
.tb-btn:hover { border-color: var(--link); color: var(--link); background: #f3f8ff; }

/* ============ 伪浏览器外壳（V3 S1.2 + V4.0 轻量化） ============ */
/* V4.0：浅灰标签页 / 白底地址栏黑字 / 浅灰锁形图标 */
#topbar { flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
#topbar .hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 16px; }
.chrome {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: linear-gradient(180deg, #eef0f2, #e3e6e9);
  border-bottom: 1px solid var(--line);
}
.nav-btns { display: flex; gap: 4px; flex: none; }
.nav-btn {
  width: 30px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  background: #f6f7f8; border: 1px solid #d4d7da; border-radius: 6px; color: #444;
  cursor: pointer; font-size: 16px; line-height: 1; transition: .15s; font-family: var(--font-mono);
}
.nav-btn:hover { border-color: #aeb2b6; background: #fff; color: #222; }
.nav-btn:active { transform: translateY(1px); }
.nav-btn:disabled { opacity: .4; cursor: default; border-color: #d4d7da; color: #aaa; }
.addr {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; height: 28px;
  background: #ffffff; border: 1px solid #d4d7da; border-radius: 6px; padding: 0 10px;
  font-family: var(--font-mono); font-size: 12px; color: #222; overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
}
.addr-lock { color: #9aa0a5; flex: none; }
.addr-url { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addr.flash { animation: addrflash .5s ease; }
@keyframes addrflash { 0% { box-shadow: inset 0 0 0 1px var(--link); } 100% { box-shadow: inset 0 1px 2px rgba(0,0,0,.06); } }
/* 书签栏 = 浅灰标签页 */
.bookmark-bar { display: flex; gap: 6px; padding: 6px 12px; border-bottom: 1px solid var(--line-soft); overflow-x: auto; background: var(--bg-soft); }
.bm-link {
  flex: none; font-family: var(--font-sans); font-size: 12.5px; color: #555;
  border: 1px solid var(--line); border-bottom: none; border-radius: 7px 7px 0 0; padding: 5px 14px;
  white-space: nowrap; transition: .15s; cursor: pointer; background: #f3f4f5; text-decoration: none;
}
.bm-link:hover { color: var(--link); border-color: #b9bdc0; background: #ffffff; text-decoration: none; }

/* ============ 容器 / 卡片（早期 OS 质感：浅灰内阴影 + 实线边框） ============ */
.wrap { max-width: 900px; margin: 0 auto; padding: 34px 20px 90px; position: relative; z-index: 1; }
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px; padding: 22px 24px; margin: 16px 0;
  box-shadow: var(--os-shadow);
}
.muted { color: var(--muted); }

/* ============ 原生组件降级：凹陷输入框 + Win98/XP 凸起按钮 ============ */
input[type="text"], input[type="search"], input:not([type]), textarea, select {
  font-family: var(--font-sans);
}
/* 输入框：保留浏览器默认 inset 边框，无圆角、无蓝色聚焦光晕 */
.search-box input, .codename-row input, .term-cmd, .modal textarea, textarea {
  border: 2px inset #dcdcdc; border-top: none; border-radius: 0 0 8px 8px;
  box-shadow: none; outline: none; background: #fff; color: #000;
}
.search-box input:focus, .codename-row input:focus, .modal textarea:focus, textarea:focus {
  border-color: #adadad; box-shadow: none;
}
/* 按钮：清爽统一风格（去除 Win98 凸起；圆角 + 细边框 + 柔和阴影 + 焦点环） */
.tb-btn, .btn-primary, .nav-btn, .pager-btn, .keep-btn,
.modal-actions button, .hint, .drawer-x, .modal-head button {
  font-family: var(--font-sans);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--text);
  box-shadow: 0 1px 2px rgba(16,24,40,.06); text-decoration: none;
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s, color .15s, transform .1s;
}
.tb-btn:hover, .btn-primary:hover, .nav-btn:hover, .pager-btn:hover,
.keep-btn:hover, .modal-actions button:hover, .hint:hover, .drawer-x:hover {
  border-color: var(--link); color: var(--link); background: var(--panel2); text-decoration: none;
}
.tb-btn:active, .btn-primary:active, .nav-btn:active, .pager-btn:active,
.keep-btn:active, .modal-actions button:active, .hint:active, .drawer-x:active {
  transform: translateY(1px);
}
/* 主操作：蓝色强调按钮（白字，醒目但不刺眼） */
.btn-primary { color: #fff; font-weight: 600; border-color: transparent;
  background: linear-gradient(180deg, #2b8cff, #1a73e8); box-shadow: 0 2px 8px rgba(26,115,232,.28); }
.btn-primary:hover { color: #fff; border-color: transparent; background: linear-gradient(180deg, #3b97ff, #1f7df0); box-shadow: 0 4px 14px rgba(26,115,232,.34); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: default; box-shadow: none; }
.pager-btn.current { background: var(--link); color: #fff; border-color: var(--link); }
.pager-btn:disabled { color: #9a9a9a; background: #f4f5f6; border-color: var(--line); cursor: default; box-shadow: none; }
.tag {
  display: inline-flex; align-items: center; font-family: var(--font-mono);
  font-size: 11px; color: var(--signal); letter-spacing: .08em;
  border: 1px solid var(--signal-dim); border-radius: 4px; padding: 2px 9px; margin-right: 6px;
  background: rgba(31,138,122,.06);
}

/* 线索板语义色：绿=已验证事实 / 黄=玩家猜想 / 红=矛盾危险 */
.b-fact   { border-left-color: #1f8a7a !important; }
.b-guess  { border-left-color: #c9a227 !important; }
.b-danger { border-left-color: var(--danger) !important; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin: 8px 0 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.legend .lf { background: #1f8a7a; } .legend .lg { background: #c9a227; } .legend .ld { background: var(--danger); }

/* ============ 故障 / 危险文本 ============ */
.glitch { color: var(--danger); }
.title-glitch { position: relative; }
.title-glitch::before, .title-glitch::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%;
  overflow: hidden; clip-path: inset(0 0 0 0);
}
.title-glitch::before { color: rgba(31,138,122,.7); transform: translate(-1px,0); animation: gl1 4.5s infinite steps(2); }
.title-glitch::after  { color: rgba(192,57,43,.6);  transform: translate(1px,0);  animation: gl2 3.7s infinite steps(2); }

/* ============ 搜索中枢（查询控制台） ============ */
.console-head {
  font-family: var(--font-mono); font-size: 12px; color: var(--signal);
  border: 1px solid var(--line); border-radius: 8px 8px 0 0; padding: 8px 12px;
  background: rgba(31,138,122,.05); letter-spacing: .05em;
}
.console-head .blink { animation: blink 1.1s steps(1) infinite; }
.search-box { display: flex; gap: 10px; margin: 0 0 14px; }
.search-box input {
  flex: 1; padding: 13px 16px; font-size: 15px; font-family: var(--font-sans);
  background: #ffffff; border: 1px solid var(--line); border-radius: 0 0 8px 8px;
  border-top: none; color: #222; outline: none; letter-spacing: .02em;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.05);
}
.search-box input:focus { box-shadow: inset 0 0 0 2px rgba(0,102,204,.35); }
.search-box input::placeholder { color: #9aa0a5; }
.btn-primary {
  display: inline-flex; align-items: center;
  padding: 12px 22px; font-size: 15px; cursor: pointer; border: 1px solid #bcd0e8; border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #eef4fb); color: var(--link); font-weight: 600;
  box-shadow: var(--os-shadow); transition: filter .15s, transform .05s, background .15s;
}
.btn-primary:hover { filter: brightness(.98); background: linear-gradient(180deg, #ffffff, #e3eefb); }
.btn-primary:active { transform: translateY(1px); }
.hints { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.hint {
  font-family: var(--font-mono); font-size: 12.5px; cursor: pointer; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 6px; padding: 4px 11px; transition: .15s;
}
.hint:hover { color: var(--link); border-color: var(--signal-dim); background: #f3f8ff; }
.result { margin-top: 18px; }

/* 搜索结果条目（主题性叙事结果，保留信号强度条） */
.result-item {
  background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--signal-dim);
  border-radius: 8px; padding: 13px 15px; margin: 10px 0; font-family: var(--font-mono); font-size: 13.5px;
  animation: reveal .35s ease;
}
.result-item .kw { color: var(--link); font-weight: 600; }
.result-item.glitch { border-left-color: var(--danger); }

.bookmarks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.bookmark {
  display: block; padding: 11px 15px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); color: var(--text); transition: .15s;
  text-decoration: none;
}
.bookmark:hover { border-color: var(--link); color: var(--link); box-shadow: 0 0 0 1px rgba(0,102,204,.2); text-decoration: none; }
.bookmark .bm-layer { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 3px; }

/* S3.1：CRT 检索扫描动画 */
.crt-scan {
  position: relative; display: flex; align-items: center; gap: 10px;
  height: 36px; margin: 0 0 14px; padding: 0 14px; overflow: hidden;
  border: 1px solid var(--signal-dim); border-radius: 8px;
  background: rgba(31,138,122,.05);
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .08em;
  color: var(--signal); white-space: nowrap;
}
.crt-scan[hidden] { display: none; }
.crt-scan::after { content: "▌ 正在扫描信号残骸…"; position: relative; z-index: 2; }
.crt-scan::before {
  content: ""; position: absolute; top: 0; left: -45%; width: 45%; height: 100%; z-index: 1;
  background: linear-gradient(90deg, transparent, rgba(31,138,122,.18), transparent);
  animation: scanmove .9s linear infinite;
}
@keyframes scanmove { 0% { left: -45%; } 100% { left: 100%; } }

/* 搜索工作台：历史 / 推荐词 标签页（V3 S1.3 + V4.0「所见即所点」） */
.search-tabs { display: flex; gap: 6px; margin: 6px 0 8px; }
.search-tab {
  background: #f3f4f5; border: 1px solid var(--line); border-bottom: none;
  border-radius: 7px 7px 0 0; color: var(--muted); font-family: var(--font-sans);
  font-size: 13px; padding: 7px 16px; cursor: pointer; transition: .15s;
}
.search-tab:hover { color: var(--link); background: #ffffff; }
.search-tab:active { transform: translateY(1px); }
.search-tab.active { color: var(--link); border-color: #aebfc9; background: #ffffff; font-weight: 600; }
.search-panel { border: 1px solid var(--line); border-radius: 0 8px 8px 8px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.search-panel[hidden] { display: none; }

/* 历史/热搜 chip：hover 浅蓝底 + 下划线；active 按压深蓝 + 0.1s 缩放（咔哒反馈在 JS） */
/* 大家都在搜 / 相关搜索 / 历史：恢复为经典超链接（蓝色下划线，不用胶囊标签替代链接） */
.hist-chip, .trend-chip, .related-tag, .bm-link-search {
  display: inline; font-family: var(--font-sans); font-size: 13px; color: var(--link);
  border: none; border-radius: 0; padding: 0; margin: 0 8px 0 0;
  cursor: pointer; background: none; text-decoration: underline;
}
.hist-chip:hover, .trend-chip:hover, .related-tag:hover, .bm-link-search:hover {
  color: var(--link-hover); text-decoration: underline;
}
.hist-chip:active, .trend-chip:active, .related-tag:active, .bm-link-search:active {
  color: var(--link-active);
}

/* 档案卡片（叙事性结果，保留信号强度条） */
.arch-card {
  background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--signal-dim);
  border-radius: 8px; padding: 12px 14px; margin: 10px 0; animation: reveal .35s ease;
}
.arch-card.glitch { border-left-color: var(--danger); }
.ac-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-family: var(--font-mono); font-size: 12px; }
.ac-icon { color: var(--signal); }
.ac-title { color: #1f1f1f; font-weight: 600; }
.ac-src { margin-left: auto; color: var(--muted); font-size: 11px; }
.ac-sum { font-size: 13.5px; line-height: 1.6; color: var(--text); }
.ac-sum .kw { color: var(--link); font-weight: 600; }
.ac-bar { height: 4px; background: var(--line-soft); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.ac-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--signal-dim), var(--signal)); }
.arch-card.glitch .ac-bar span { background: linear-gradient(90deg, #b9766b, var(--danger)); }

/* V4.0 搜索引擎结果页（SERP）卡片式：蓝标题大字号 / 绿 URL / 灰摘要两行省略 */
.serp-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px 16px;
  margin-bottom: 14px;            /* 卡片间距：清晰分隔 */
  background: var(--panel);
  box-shadow: var(--os-shadow);
  line-height: 1.6;
  animation: reveal .35s ease;
}
.serp-item:last-child { margin-bottom: 0; }
.serp-title {
  display: inline-block; margin: 0 0 2px; cursor: pointer;
  font-family: var(--font-serif); font-size: 17px; font-weight: 600; color: var(--link);
  border: none; padding: 0; background: none; text-decoration: underline;
}
.serp-title:hover { color: var(--link-hover); text-decoration: underline; }
.serp-title:visited { color: var(--link-visited); }
.serp-url { font-family: var(--font-mono); font-size: 12px; color: var(--url-green); margin: 1px 0 4px; }
.serp-snippet { font-size: 13.5px; color: #444; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.serp-snippet .kw { color: var(--link); font-weight: 600; }
.serp-cite { float: right; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* 大家都在搜 / 相关搜索 / 分页 */
.trending { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.trending h4, .related h4, .pager-wrap h4 {
  font-family: var(--font-sans); font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .04em; margin: 0 0 8px;
}
.trend-list { display: flex; flex-direction: column; gap: 2px; }
.trend-item { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 4px 0; }
.trend-rank { font-family: var(--font-mono); font-size: 12px; color: var(--amber); width: 18px; text-align: right; flex: none; }
.trend-item a, .trend-item .trend-chip { color: var(--link); cursor: pointer; text-decoration: none; }
.trend-item a:hover, .trend-item .trend-chip:hover { text-decoration: underline; color: var(--link-hover); }
.related-cloud { display: flex; flex-wrap: wrap; gap: 0; margin-top: 4px; }
.pager-wrap { margin-top: 28px; display: flex; justify-content: center; }
.pager { display: inline-flex; align-items: center; gap: 6px; }
.pager-btn {
  min-width: 34px; height: 34px; padding: 0 10px; font-family: var(--font-sans); font-size: 13px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--link); cursor: pointer; transition: .12s;
}
.pager-btn:hover:not(:disabled) { background: #eaf2ff; border-color: #aebfc9; }
.pager-btn:active:not(:disabled) { transform: scale(.96); }
.pager-btn.current { background: var(--link); color: #fff; border-color: var(--link); cursor: default; }
.pager-btn:disabled { color: #bbb; cursor: default; background: #f6f7f8; }

/* 空状态：雷达扫描 → 节点断开 / 信号干扰 */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 0; }
.radar { position: relative; width: 64px; height: 64px; border: 1px solid var(--signal-dim); border-radius: 50%; background: #fff; }
.radar::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(31,138,122,.5), transparent 40%); animation: spin 1.1s linear infinite; }
.radar::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; background: var(--signal); border-radius: 50%; transform: translate(-50%,-50%); }
@keyframes spin { to { transform: rotate(360deg); } }
.es-msg { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); letter-spacing: .04em; text-align: center; }

/* ============ 论坛（残帖） ============ */
.board-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 4px;
}
.board-head .b-name { font-family: var(--font-serif); font-size: 18px; color: #1f1f1f; }
.board-head .b-sub { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.thread { border-top: 1px solid var(--line-soft); padding: 16px 0; }
.thread .meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.thread h3.t-title { font-family: var(--font-serif); font-size: 17px; margin: 0 0 8px; }
.floor {
  border-left: 2px solid var(--line); padding: 10px 0 10px 14px; margin: 12px 0;
  background: linear-gradient(90deg, rgba(0,0,0,.015), transparent 60%);
}
.floor .fmeta { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.floor .avatar {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--signal-dim); margin-right: 6px; vertical-align: middle;
}
.floor.online { border-left-color: var(--danger); }
.floor.online .fmeta { color: var(--danger); }
.floor.online .avatar { background: var(--danger); box-shadow: 0 0 8px var(--danger); animation: pulse 1.8s infinite; }

/* S3.3 论坛伪实时：在线标签 + 活回复楼层 */
.forum-live { font-family: var(--font-mono); font-size: 12.5px; color: var(--signal); margin: 2px 0 16px; letter-spacing: .4px; }
.forum-live::first-letter { color: var(--danger); }
.live-thread { margin-top: 6px; }
.live-floor { border-left-color: var(--link); animation: liveIn .45s ease both; }
.live-floor.flash-in { box-shadow: 0 0 0 1px rgba(192,57,43,.3); }
@keyframes liveIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ 新闻 / 档案（终端） ============ */
.terminal {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff;
  box-shadow: var(--os-shadow);
}
.terminal-bar {
  font-family: var(--font-mono); font-size: 11px; color: var(--signal);
  padding: 8px 12px; border-bottom: 1px solid var(--line); background: rgba(31,138,122,.05);
  letter-spacing: .05em;
}
.terminal-body { padding: 6px 4px; }
.term-tabs { display: flex; border-bottom: 1px solid var(--line); }
.term-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); font-family: var(--font-mono); font-size: 13px;
  padding: 9px 16px; cursor: pointer; transition: .15s;
}
.term-tab:hover { color: var(--text); }
.term-tab.active { color: var(--link); border-bottom-color: var(--link); }
/* 我的足迹（终端历史） */
.foot-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-family: var(--font-mono); font-size: 13px; }
.foot-row:first-child { border-top: none; }
.foot-k { color: var(--muted); flex: 0 0 auto; }
.foot-v { color: var(--text); text-align: right; }
.foot-list { color: var(--link); font-size: 12.5px; line-height: 1.7; }

/* 动态线索板（数字考古工作台） */
.board {
  position: relative; min-height: 480px; border: 1px solid var(--line); border-radius: 10px;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(31,138,122,.04), transparent 60%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.02) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.02) 0 1px, transparent 1px 28px),
    #fafafa;
  overflow: hidden; touch-action: none;
}
#boardSvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
#boardSvg line.hold { stroke: var(--danger); stroke-width: 2; filter: drop-shadow(0 0 4px rgba(192,57,43,.4)); }
#boardSvg line.ghost { stroke: rgba(120,130,135,.4); stroke-width: 1.5; stroke-dasharray: 4 5; }
.clue-card {
  position: absolute; z-index: 2; width: 200px; max-width: 60vw;
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--signal-dim);
  border-radius: 8px; padding: 10px 12px 11px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5;
  color: var(--text); cursor: grab; user-select: none; transition: box-shadow .15s, border-color .15s;
  box-shadow: var(--os-shadow);
}
.clue-card:active { cursor: grabbing; }
.clue-card.sel { border-color: var(--link); box-shadow: 0 0 0 1px var(--link), 0 0 16px rgba(0,102,204,.18); }
.clue-card.linked { border-left-color: var(--danger); }
.clue-card .pin { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 12px; height: 12px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 6px rgba(192,57,43,.5); }
.clue-card .cat { font-size: 10.5px; color: var(--muted); margin-bottom: 4px; letter-spacing: .04em; }
.board-help { color: var(--muted); font-family: var(--font-mono); font-size: 12.5px; min-height: 1.3em; margin: 12px 0 0; }
.board-help.ok { color: var(--signal); }
.deduce-panel { margin-top: 16px; }
.deduce-item { border-left: 3px solid var(--danger); background: rgba(192,57,43,.06); border-radius: 0 8px 8px 0; padding: 10px 14px; margin: 8px 0; font-size: 13.5px; animation: reveal .35s ease; }
.deduce-item b { color: var(--link); }

/* 坐标等单宽字段 */
.mono-coord { font-family: var(--font-mono); font-size: 11.5px; color: var(--signal-dim); letter-spacing: .02em; }

/* 终端控制台（隐藏指令 / 历史） */
.term-console { border-top: 1px solid var(--line); padding: 10px 14px; font-family: var(--font-mono); font-size: 13px; background: rgba(0,0,0,.02); }
.term-out { max-height: 170px; overflow-y: auto; margin-bottom: 8px; line-height: 1.65; }
.term-line { white-space: pre-wrap; word-break: break-word; }
.term-prompt { color: var(--signal); }
.term-cmd { width: 100%; background: transparent; border: none; border-top: 1px dashed var(--line); padding: 8px 0 0; color: var(--text); font-family: var(--font-mono); font-size: 13px; outline: none; }
.term-cmd::placeholder { color: #9aa0a5; }

/* 信号污染度：终端腐化三级（第一幕→第二幕桥梁） */
.card.terminal.corrupt-1 { animation: cglitch 2.4s infinite; }
.card.terminal.corrupt-2 { animation: cglitch 1.4s infinite; }
.card.terminal.corrupt-3 { animation: cglitch .7s infinite; }
@keyframes cglitch {
  0% { filter: none; } 47% { filter: none; }
  49% { filter: hue-rotate(18deg) contrast(1.08); transform: translateX(.5px); }
  51% { filter: none; } 100% { filter: none; }
}
.card.terminal.corrupt-2 .terminal-bar,
.card.terminal.corrupt-3 .terminal-bar { color: var(--danger); }

/* 农家乐照片 + EXIF 元信息 */
.photo-card { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.photo-frame { width: 200px; height: 132px; border: 1px solid var(--line); border-radius: 8px;
  background: repeating-linear-gradient(135deg, #f0f1f2 0 8px, #e9eaec 8px 16px);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 10px; cursor: pointer; transition: .15s; }
.photo-frame:hover, .photo-frame.open { border-color: var(--link); box-shadow: 0 0 0 1px rgba(0,102,204,.25); }
.photo-ph { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.photo-hint { font-size: 11px; color: var(--signal); margin-top: 4px; }
.exif { flex: 1 1 240px; min-width: 240px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-family: var(--font-mono); font-size: 12.5px; background: #fff; }
.exif-row { display: flex; gap: 10px; padding: 4px 0; border-top: 1px solid var(--line-soft); }
.exif-row:first-child { border-top: none; }
.exif-row span { color: var(--muted); flex: 0 0 42px; }
.exif-note { display: block; }
.exif-note span { flex-basis: auto; }

/* 方案 C：照片冲洗故障——悬停闪过脸（difference 混合），reduced-motion 关闭该闪脸 */
.photo-glitch { position: relative; overflow: hidden; }
.photo-glitch::before { content: ""; position: absolute; inset: 0; background-image: url("../assets/img/jumpscare-face.webp"); background-size: cover; background-position: center; mix-blend-mode: difference; opacity: 0; transition: opacity .08s ease; pointer-events: none; }
.photo-glitch:hover::before, .photo-glitch:focus::before { opacity: .92; }
.photo-glitch.developed-broken { border-color: #8a1f17; }
.photo-glitch .glitch { color: #8a1f17; letter-spacing: 2px; }
@media (prefers-reduced-motion: reduce) { .photo-glitch::before { display: none; } }
table.arch { width: 100%; border-collapse: collapse; font-size: 14px; }
table.arch th, table.arch td { border-bottom: 1px solid var(--line-soft); padding: 10px 12px; text-align: left; }
table.arch th { font-family: var(--font-mono); font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .05em; }
table.arch td { font-family: var(--font-mono); font-size: 13px; color: var(--text); }
.row-link { cursor: pointer; transition: background .12s; }
.row-link:hover { background: #eef4fb; }
.terminal-caret { font-family: var(--font-mono); font-size: 12px; color: var(--signal); padding: 8px 12px; }
.terminal-caret .blink { animation: blink 1.1s steps(1) infinite; }
#detail { font-family: var(--font-mono); font-size: 13px; line-height: 1.7; }

/* —— 第二幕·伪终端 增强样式（彩色 ls / Tab 补全 / 打字延迟 / 防卡关提示） —— */
.term-ls { display: flex; flex-wrap: wrap; gap: 6px 20px; font-family: var(--font-mono); font-size: 13px; line-height: 1.9; }
.term-ls .ls-item { white-space: nowrap; }
.term-ls .ls-read { color: var(--signal); }
.term-ls .ls-exec { color: var(--link); }
.term-ls .ls-enc  { color: var(--danger); }
.term-ls .ls-dir  { color: #7a5cff; font-weight: 600; }
.term-hint { color: var(--muted); font-size: 12px; margin-top: 10px; border-left: 2px solid var(--signal-dim); padding-left: 8px; }
.term-hint b { color: var(--signal); }
.term-typing::after { content: "▍"; color: var(--signal); animation: blink 1.1s steps(1) infinite; }
.term-completion { color: var(--muted); font-size: 12px; }
.term-completion .comp-match { color: var(--link); background: rgba(31,102,204,.08); }
/* 终端错误/引导反馈：柔和的琥珀色（非吓人红），绝不配合突脸或污染 */
.term-line.term-err { color: #b8862f; border-left: 2px solid rgba(184,134,47,.5); padding-left: 8px; }
.term-line.term-err::before { content: "› "; opacity: .7; }

/* —— 第二幕·第二章 名册查看器 —— */
.sub { font-family: var(--font-mono); font-size: 13px; color: var(--signal); letter-spacing: .08em; margin: 6px 0 0; opacity: .9; }
.roster-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.roster-row {
  display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 6px 14px;
  width: 100%; text-align: left; cursor: pointer;
  background: rgba(31,138,122,.04); border: 1px solid var(--line); border-left: 3px solid var(--signal-dim);
  border-radius: 8px; padding: 11px 14px; font-family: var(--font-mono); font-size: 13px; color: var(--text);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.roster-row:hover { background: rgba(31,138,122,.09); border-color: var(--signal); box-shadow: 0 0 0 1px rgba(31,138,122,.25); }
.roster-row .rr-id { color: var(--signal); font-weight: 600; }
.roster-row .rr-name { color: var(--text); }
.roster-row .rr-note { grid-column: 2 / 3; color: var(--muted); font-size: 11.5px; }
.roster-row .rr-action { color: var(--link); font-size: 12px; white-space: nowrap; }
.roster-row.opened { border-left-color: var(--signal); }
.roster-row.opened .rr-action { color: var(--signal); }
.roster-row.self { border-left-color: var(--danger); background: rgba(192,57,43,.05); }
.roster-row.self .rr-id { color: var(--danger); }
.roster-row.self .rr-code { grid-column: 2 / 3; color: var(--muted); font-size: 12px; }
.roster-row.self .rr-code b { color: var(--text); letter-spacing: .04em; }
.roster-row.self .rr-action.claimed { color: var(--signal); }
/* 音频前置缓冲：解码中脉冲 + 解码提示（避免突发音效造成不适） */
.roster-row.decoding { animation: rdec .9s ease-in-out infinite; }
@keyframes rdec { 0%,100% { box-shadow: 0 0 0 0 rgba(31,138,122,0); } 50% { box-shadow: 0 0 0 2px rgba(31,138,122,.35); } }
.lm-decoding { color: var(--signal); }
.lm-decoding::after { content: "▍"; animation: blink 1.1s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) { .roster-row.decoding { animation: none; } }
@media (max-width: 560px) {
  .roster-row { grid-template-columns: 78px 1fr; }
  .roster-row .rr-action { grid-column: 1 / 3; justify-self: start; }
  .roster-row .rr-note, .roster-row.self .rr-code { grid-column: 1 / 3; }
}

/* —— 第二幕·第三章 排班查看器 —— */
.sched-ref {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--signal);
  border: 1px solid var(--signal-dim); border-left: 3px solid var(--signal);
  border-radius: 8px; padding: 9px 12px; margin: 4px 0 14px; background: rgba(31,138,122,.05);
}
.sched-ref b { color: var(--danger); letter-spacing: .03em; }
.sched-table { display: flex; flex-direction: column; gap: 8px; }
.sched-row {
  display: grid; grid-template-columns: 96px 1fr 96px; align-items: center; gap: 6px 14px;
  width: 100%; text-align: left; cursor: pointer;
  background: rgba(31,138,122,.04); border: 1px solid var(--line); border-left: 3px solid var(--signal-dim);
  border-radius: 8px; padding: 11px 14px; font-family: var(--font-mono); font-size: 13px; color: var(--text);
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}
.sched-row:hover { background: rgba(31,138,122,.09); border-color: var(--signal); box-shadow: 0 0 0 1px rgba(31,138,122,.25); }
.sched-row .sr-id { color: var(--signal); font-weight: 600; }
.sched-row .sr-name { color: var(--text); }
.sched-row .sr-evt { color: var(--muted); font-size: 11.5px; grid-column: 2 / 3; }
.sched-row .sr-date { color: var(--text); text-align: right; letter-spacing: .02em; }
.sched-row .sr-note { grid-column: 1 / 4; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.sched-row.selected { border-color: var(--link); box-shadow: 0 0 0 1px var(--link), 0 0 14px rgba(0,102,204,.18); background: rgba(0,102,204,.06); }
/* 选中后右侧出现的「标记」操作 */
.sched-row .sr-mark { grid-column: 1 / 4; color: var(--link); font-size: 12px; margin-top: 2px; }
/* 连续错误≥3 自动纠正：异常行反色 + 闪烁（柔和不刺眼） */
.sched-row.autocorrect { animation: sautoc .9s steps(2) infinite; border-left-color: var(--link); }
@keyframes sautoc {
  0%,100% { background: #1f6f57; color: #eafff6; border-color: #2c9b78; }
  50%     { background: #0b0f0c; color: #54e0c4; border-color: #54e0c4; }
}
.sched-row.autocorrect .sr-id,
.sched-row.autocorrect .sr-name,
.sched-row.autocorrect .sr-date,
.sched-row.autocorrect .sr-evt,
.sched-row.autocorrect .sr-note { color: inherit; }
.sched-row.autocorrect .sr-tag { color: #ffd36b; }
/* 正确锁定：异常行确认态 */
.sched-row.found { background: rgba(31,138,122,.12); border-color: var(--signal); border-left-color: var(--signal); box-shadow: 0 0 0 1px rgba(31,138,122,.35); }
.sched-row.found .sr-id { color: var(--signal); }
.sched-row .sr-tag { grid-column: 1 / 4; color: var(--danger); font-size: 11.5px; margin-top: 2px; }
/* 终端 [WARN] 温和反馈（琥珀，绝不 jumpScare） */
.term-line.term-warn { color: #b8862f; border-left: 2px solid rgba(184,134,47,.5); padding-left: 8px; }
.term-line.term-warn::before { content: "[WARN] "; opacity: .8; }
.term-line.term-ok { color: var(--signal); border-left: 2px solid rgba(31,138,122,.5); padding-left: 8px; }
.term-line.term-ok::before { content: "[OK] "; opacity: .8; }
/* 系统时间实时刷新块 */
.sched-reveal { margin-top: 12px; border: 1px solid var(--signal); border-radius: 8px; padding: 12px 14px; background: rgba(31,138,122,.06); font-family: var(--font-mono); font-size: 13px; line-height: 1.8; animation: reveal .35s ease; }
.sched-reveal .sr-k { color: var(--muted); }
.sched-reveal .sr-v { color: var(--text); }
.sched-reveal .sr-sys { color: var(--danger); }
@media (prefers-reduced-motion: reduce) {
  .sched-row.autocorrect { animation: none; background: #1f6f57; color: #eafff6; border-color: #2c9b78; }
}
@media (max-width: 560px) {
  .sched-row { grid-template-columns: 78px 1fr; }
  .sched-row .sr-date { grid-column: 1 / 3; text-align: left; }
  .sched-row .sr-evt, .sched-row .sr-note, .sched-row .sr-tag, .sched-row .sr-mark { grid-column: 1 / 3; }
}

/* —— 第二幕·第四章 缝隙彼端（seam.txt 回声验证） —— */
.seam-prompt { color: var(--muted); font-size: 13px; line-height: 1.85; border-left: 2px solid var(--signal-dim); padding-left: 8px; margin: 0 0 14px; }
.seam-opts { display: flex; flex-wrap: wrap; gap: 10px; }
.seam-opt {
  flex: 1 1 200px; text-align: left; cursor: pointer;
  background: rgba(31,138,122,.05); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; font-family: var(--font-mono); font-size: 13.5px; color: var(--text);
  transition: .15s;
}
.seam-opt:hover { border-color: var(--signal); box-shadow: 0 0 0 1px rgba(31,138,122,.25); transform: translateY(-1px); }
.seam-opt .so-label { color: var(--signal); }
.seam-opt.disabled { opacity: .5; pointer-events: none; }
.seam-opt.done .so-label::after { content: " ✓"; color: var(--signal); }
.seam-echo {
  display: block; white-space: pre-wrap; word-break: break-word;
  color: var(--text); border-left: 2px solid var(--signal); padding-left: 10px; margin: 2px 0;
}
.seam-log {
  display: block; color: var(--signal-dim); font-family: var(--font-mono); font-size: 12.5px;
  border-left: 2px solid rgba(31,138,122,.4); padding-left: 10px; margin: 2px 0;
}
.seam-record { display: block; color: var(--muted); font-size: 12px; margin: 2px 0 0; }
.seam-pending { display: block; color: var(--muted); font-family: var(--font-mono); font-size: 12.5px; animation: blink 1.1s steps(2) infinite; }
.seam-hidden {
  display: block; white-space: pre-wrap; word-break: break-word; margin-top: 10px;
  color: var(--danger); border: 1px solid rgba(192,57,43,.45); border-radius: 8px;
  padding: 12px 14px; background: rgba(192,57,43,.05); font-size: 13px; line-height: 1.85;
  animation: reveal .35s ease;
}
@keyframes blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) {
  .seam-pending { animation: none; }
  .seam-hidden { animation: none; }
}
@media (max-width: 560px) { .seam-opt { flex-basis: 100%; } }

/* —— 第二幕·第五章 认领（claim.txt 终局抉择） —— */
.claim-opts { display: flex; flex-wrap: wrap; gap: 10px; }
.claim-opt {
  flex: 1 1 200px; text-align: left; cursor: pointer;
  background: rgba(31,138,122,.05); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; font-family: var(--font-mono); font-size: 13.5px; color: var(--text);
  transition: .15s;
}
.claim-opt:hover { border-color: var(--signal); box-shadow: 0 0 0 1px rgba(31,138,122,.25); transform: translateY(-1px); }
.claim-opt .co-label { color: var(--signal); }
.claim-opt.disabled { opacity: .5; pointer-events: none; }
.claim-meta { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.claim-meta .cm-hint { color: var(--danger); font-size: 12px; margin-bottom: 8px; font-family: var(--font-mono); }
.claim-meta-cmd {
  display: inline-block; margin: 0 8px 8px 0; cursor: pointer;
  background: transparent; border: 1px solid rgba(192,57,43,.5); border-radius: 6px;
  padding: 7px 12px; font-family: var(--font-mono); font-size: 12.5px; color: var(--danger); transition: .15s;
}
.claim-meta-cmd:hover { background: rgba(192,57,43,.08); box-shadow: 0 0 0 1px rgba(192,57,43,.25); }
.claim-meta-cmd.disabled { opacity: .5; pointer-events: none; }
.claim-ending { display: block; white-space: pre-wrap; word-break: break-word; color: var(--text); border-left: 2px solid var(--signal); padding-left: 10px; margin: 2px 0; line-height: 1.9; }
.claim-ending.seam-hidden { border-left-color: rgba(192,57,43,.5); }
.claim-tag { color: var(--signal); font-family: var(--font-mono); font-size: 12px; }

/* —— 第二幕结算：终端风格交接文档（绿/琥珀单色，深色） —— */
.report-terminal { font-family: var(--font-mono); background: #0b0f0c; color: #9fe6c4; border-radius: 10px; padding: 18px 20px; line-height: 1.95; font-size: 13.5px; box-shadow: var(--os-shadow); }
.report-terminal .rt-h { color: #54e0c4; font-weight: 700; letter-spacing: .05em; }
.report-terminal .rt-amber { color: #ffb347; }
.report-terminal .rt-danger { color: #ff6a6a; }
.report-terminal .rt-dim { color: #5f7a6c; }
.report-terminal .rt-line { white-space: pre-wrap; word-break: break-word; }
.report-terminal a { color: #54e0c4; text-decoration: underline; }
@media (max-width: 560px) { .report-terminal { font-size: 12.5px; } }

/* —— 第二幕共享：章节导航（terminal-echo / roster 等子页统一外观） —— */
.chapter-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
.chapter-nav .nav-h { flex-basis: 100%; color: var(--muted); font-size: 12px; font-family: var(--font-mono); margin: 0 0 2px; }
.nav-link {
  display: inline-block; padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--link); font-family: var(--font-mono); font-size: 13px;
  text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .12s;
}
.nav-link:hover { border-color: var(--signal); box-shadow: 0 0 0 1px rgba(31,138,122,.25); transform: translateY(-1px); }
.nav-link:active { transform: translateY(0); }

/* ============ 失踪登记（档案册） ============ */
.registry-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 4px;
}
.registry-head .r-name { font-family: var(--font-serif); font-size: 18px; }
.registry-head .r-sub { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.redacted { color: #b9bdc0; background: #eef0f1; user-select: none; transition: color .2s, background .2s; cursor: help; border-radius: 3px; padding: 0 3px; }
.redacted:hover { color: #333; background: #e2e4e6; }

/* ============ 线索册抽屉 / 整页 ============ */
.drawer {
  position: fixed; top: 0; right: -400px; width: 380px; max-width: 92vw; height: 100%;
  background: var(--bg-soft); border-left: 1px solid var(--line);
  z-index: 80; transition: right .28s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column;
  box-shadow: -16px 0 40px rgba(0,0,0,.12);
}
.drawer.open { right: 0; }
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 18px; border-bottom: 1px solid var(--line); font-family: var(--font-serif); font-size: 16px;
}
.drawer-x { background: none; border: none; color: var(--muted); cursor: pointer; display: inline-flex; padding: 4px; border-radius: 6px; }
.drawer-x:hover { color: var(--danger); background: rgba(192,57,43,.08); }
.drawer-x .ic { width: 18px; height: 18px; margin: 0; }
.drawer-body { padding: 16px 18px; overflow-y: auto; }
.clue-cat { margin-bottom: 20px; }
.clue-cat h4 { margin: 0 0 9px; color: #1f1f1f; font-size: 13px; font-family: var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.clue-cat .cnt { color: var(--signal); font-weight: 400; }
.clue-item {
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--signal-dim);
  border-radius: 6px; padding: 9px 11px; margin: 6px 0; font-size: 13.5px; font-family: var(--font-mono);
}
.empty { color: var(--muted); font-size: 13px; }
.cb-cat { margin: 20px 0; }
.cb-cat h3 { border-bottom: 1px solid var(--line); padding-bottom: 7px; font-family: var(--font-mono); font-size: 14px; letter-spacing: .05em; }

/* 系统回收站（V3 S2.2） */
.rb-status { font-family: var(--font-mono); font-size: 12.5px; color: var(--amber); margin: 10px 0 0; min-height: 1.2em; }
.recycle-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--signal-dim);
  border-radius: 6px; padding: 9px 11px; margin: 6px 0; font-size: 13.5px; font-family: var(--font-mono);
}
.recycle-item.purged { border-left-color: var(--danger); color: var(--muted); text-decoration: line-through; opacity: .7; animation: flicker 3s infinite; }
.recycle-item.kept { border-left-color: var(--signal); color: var(--text); text-decoration: none; opacity: 1; }
.recycle-item .ri-text { flex: 1; }
.keep-btn {
  flex: none; font-family: var(--font-mono); font-size: 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 12px;
  background: rgba(31,138,122,.06); color: var(--signal); transition: .15s;
}
.keep-btn:hover { border-color: var(--signal); box-shadow: 0 0 8px rgba(31,138,122,.18); }
.keep-btn:disabled { opacity: .5; cursor: default; color: var(--muted); }

/* ============ 存档弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(40,44,48,.35); backdrop-filter: blur(2px); z-index: 100;
  display: none; align-items: center; justify-content: center;
}
.modal-mask.open { display: flex; }
.modal {
  width: 480px; max-width: 92vw; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,.2);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-serif); font-size: 16px; }
.modal-head button { background: none; border: none; color: var(--muted); cursor: pointer; display: inline-flex; padding: 4px; border-radius: 6px; }
.modal-head button:hover { color: var(--danger); background: rgba(192,57,43,.08); }
.modal-head .ic { width: 16px; height: 16px; margin: 0; }
.modal-tip { font-size: 13px; color: var(--muted); }
.modal textarea {
  width: 100%; height: 120px; resize: vertical; margin: 12px 0;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 11px; font-family: var(--font-mono); font-size: 12px;
}
.modal-actions { display: flex; gap: 10px; }
.modal-actions button {
  padding: 9px 16px; border-radius: 6px; border: 1px solid var(--line);
  background: #f6f7f8; color: var(--text); cursor: pointer; font-size: 14px; transition: .15s;
}
.modal-actions button:hover { border-color: var(--link); color: var(--link); }
.modal-actions .danger:hover { border-color: var(--danger); color: var(--danger); }
.modal-msg { font-size: 13px; color: var(--amber); margin-top: 8px; min-height: 18px; font-family: var(--font-mono); }

/* ============ 首页 / 信号接收 ============ */
.hero { text-align: center; padding: 30px 0 6px; position: relative; }
.hero .freq {
  font-family: var(--font-mono); color: var(--signal); font-size: 13px; letter-spacing: .35em;
}
.hero h1 {
  font-family: var(--font-serif); font-size: 40px; letter-spacing: .22em; margin: 14px 0 6px;
  color: #1f1f1f;
}
.hero .tagline { color: var(--muted); letter-spacing: .1em; font-family: var(--font-mono); font-size: 12px; }
.wave { display: block; margin: 22px auto 6px; width: 240px; height: 60px; opacity: .8; }
.wave path { stroke-dasharray: 5 7; animation: dashflow 1.4s linear infinite; }
.wave .wf2 { animation-duration: 2.2s; opacity: .3; }
@keyframes dashflow { to { stroke-dashoffset: -24; } }
.codename-row { display: flex; gap: 10px; justify-content: center; margin: 22px 0; flex-wrap: wrap; }
.codename-wrap { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; box-shadow: var(--os-shadow); }
.codename-wrap .prompt { font-family: var(--font-mono); color: var(--signal); padding: 0 12px; font-size: 14px; }
.codename-row input {
  padding: 12px 14px; font-size: 15px; background: transparent; border: none; outline: none;
  color: var(--text); width: 220px; font-family: var(--font-mono);
}
.codename-row input::placeholder { color: #9aa0a5; }
.center { text-align: center; }
.note { font-size: 13px; color: var(--muted); }
.rift-line { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* 打字机 */
.typewriter { font-family: var(--font-mono); color: var(--text); min-height: 1.7em; }
.typewriter .caret { color: var(--signal); animation: blink 1.1s steps(1) infinite; }
/* 开场跳过 */
.tw-skip { margin: 4px 0 16px; }
.link-btn {
  background: none; border: 1px solid var(--line); color: var(--muted);
  font-family: var(--font-mono); font-size: 12.5px; padding: 6px 14px; border-radius: 6px;
  cursor: pointer; transition: .15s;
}
.link-btn:hover { color: var(--link); border-color: var(--signal-dim); }

/* ============ 返回链接 ============ */
.back { display: inline-flex; align-items: center; margin-top: 20px; font-family: var(--font-mono); font-size: 13px; color: var(--link); }
.back .ic { margin-right: 4px; }
.back:hover { text-decoration: none; color: var(--link-hover); }

/* ============ 动画 ============ */
@keyframes grain { 0%{transform:translate(0,0)} 25%{transform:translate(-3%,2%)} 50%{transform:translate(2%,-3%)} 75%{transform:translate(-2%,-2%)} 100%{transform:translate(0,0)} }
@keyframes flicker { 0%,100%{opacity:1} 47%{opacity:1} 48%{opacity:.9} 49%{opacity:1} 92%{opacity:1} 93%{opacity:.95} 94%{opacity:1} }
@keyframes blink { 0%,50%{opacity:1} 50.01%,100%{opacity:0} }
@keyframes sig { 0%,100%{transform:scaleY(.6)} 50%{transform:scaleY(1)} }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
@keyframes reveal { from{opacity:0; transform:translateY(6px)} to{opacity:1; transform:none} }
@keyframes gl1 { 0%,92%,100%{clip-path:inset(0 0 100% 0); opacity:0} 93%{clip-path:inset(0 0 40% 0); opacity:.8} 96%{clip-path:inset(60% 0 0 0); opacity:.8} }
@keyframes gl2 { 0%,90%,100%{clip-path:inset(100% 0 0 0); opacity:0} 91%{clip-path:inset(30% 0 30% 0); opacity:.7} 95%{clip-path:inset(0 0 70% 0); opacity:.7} }

/* 抽屉遮罩层 */
.overlay {
  position: fixed; inset: 0; z-index: 79; display: none;
  background: rgba(40,44,48,.28);
}
.overlay.show { display: block; }

/* 全局轻提示（存档异常等） */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  z-index: 200; max-width: 86vw; padding: 11px 18px; border-radius: 8px;
  background: #fff; border: 1px solid var(--danger); color: #8a1f17;
  font-family: var(--font-mono); font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 渐进提示 */
.hint-tip { color: var(--amber); font-family: var(--font-mono); font-size: 13px; min-height: 1.2em; margin: 8px 0 0; }

/* ============ 移动端适配（P1，≤768px） ============ */
@media (max-width: 768px) {
  .wrap { padding: 22px 14px 84px; }
  .card { padding: 18px 15px; }
  .console-head { font-size: 12px; word-break: break-all; }
  .search-box { flex-direction: column; gap: 8px; }
  .search-box input { border-radius: 0 0 8px 8px; font-size: 16px; }
  .search-box .btn-primary { width: 100%; justify-content: center; min-height: 44px; }
  .btn-primary, .hint, .bookmark, .tb-btn, .back { min-height: 44px; display: inline-flex; align-items: center; }
  .hint { padding: 8px 13px; }
  .bookmarks { gap: 8px; }
  .bookmark { flex: 1 1 100%; }
  .terminal-body, pre, code, .code-block, .sig-log { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .terminal-body { font-size: 13px; }
  .board-head { flex-direction: column; gap: 4px; }
  .chrome { flex-wrap: wrap; }
  .addr { flex: 1 1 100%; order: 3; }
  .nav-btn { width: 34px; height: 32px; }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 30px; }
  .tb-sub { display: none; }
  .tb-signal .sig-bars { display: none; }
  .tb-right .tb-chip:nth-of-type(2) { display: none; }
  .tb-right { gap: 6px; }
  .wrap { padding: 24px 14px 80px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ 恐怖层视觉（V4.0 白底再校准） ============ */
/* 搜索框故障闪烁（E01） */
.search-glitch {
  animation: sglitch .12s steps(2) 6;
  box-shadow: inset 0 0 0 1px var(--danger) !important;
}
@keyframes sglitch {
  0% { transform: translateX(0); filter: none; }
  50% { transform: translateX(-2px); filter: hue-rotate(40deg); }
  100% { transform: translateX(2px); filter: none; }
}

/* 背景血色闪烁（E08）：白底下让红色从边缘渗染，而非黑屏 */
body.blood-flash { background: #fff !important; }
body.blood-flash::before {
  background: radial-gradient(120% 120% at 50% 45%, transparent 38%, rgba(150,0,0,.45) 100%) !important;
  opacity: 1 !important;
}

/* 低理智：内容轻微模糊 + 错字感（E09） */
body.horror-sanity-low .wrap { filter: blur(.3px); }
body.horror-sanity-low .card { text-shadow: 0 0 1px rgba(60,60,60,.4); }

/* 恐慌：整页轻微抖动（Sanity<20） */
body.horror-panic .wrap { animation: panic .2s infinite; }
@keyframes panic {
  0% { transform: translate(0,0); }
  25% { transform: translate(-1px, 1px); }
  50% { transform: translate(1px, -1px); }
  75% { transform: translate(-1px, -1px); }
  100% { transform: translate(1px, 1px); }
}

/* 导演 AI：干扰级（污染≥15）——链接色闪 + 地址栏轻抖 */
.dir-linkshift .tb-btn,
.dir-linkshift .bm-link,
.dir-linkshift .title-glitch { animation: dirLinkShift 1.3s steps(3) 1; }
@keyframes dirLinkShift {
  0%,100% { color: var(--link); text-shadow: none; }
  33% { color: var(--danger); text-shadow: 0 0 6px rgba(192,57,43,.4); }
  66% { color: var(--muted); }
}
.dir-addrjitter { animation: dirAddrJitter .9s steps(4) 1; }
@keyframes dirAddrJitter {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-1px); }
}

/* 导演 AI：惊悚级（污染≥50）——全屏故障叠层（白底校准：浅条纹 + 蓝红相渗） */
.dir-fullglitch {
  position: fixed; inset: 0; z-index: 200; pointer-events: none; opacity: 0;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px),
    linear-gradient(90deg, rgba(0,102,204,.12), rgba(150,40,30,.18));
  mix-blend-mode: multiply;
  transition: opacity .12s ease;
}
.dir-fullglitch.on { opacity: 1; animation: dirGlitch .5s steps(6) 1; }
@keyframes dirGlitch {
  0%   { transform: translate(0,0); filter: none; }
  20%  { transform: translate(-4px,2px) skewX(-3deg); filter: hue-rotate(40deg); }
  40%  { transform: translate(4px,-2px) skewX(2deg); }
  60%  { transform: translate(-3px,1px); filter: invert(.08); }
  80%  { transform: translate(3px,-1px); }
  100% { transform: translate(0,0); filter: none; }
}

/* 导演 AI：惊悚级（污染≥70）——突脸 jump scare：全屏鬼脸突然占据（恐怖高潮）
 * 黑底 + 内联 SVG 鬼脸（feTurbulence 扭曲）+ 尖锐尖啸 + 屏幕急抖；约 0.8s 后退出。
 * z-index 高于全屏故障(200)/暗角(60,70)，盖过一切。prefers-reduced-motion 时 JS 不创建该层。 */
.dir-jumpscare {
  position: fixed; inset: 0; z-index: 9990; background: #000;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0;
  animation: jsIn .09s ease-out forwards;
}
.dir-jumpscare.out { animation: jsOut .5s ease-in forwards; }
.dir-jumpscare .js-face { width: 94vmin; height: 94vmin; transform-origin: 50% 50%; animation: jsShake .12s steps(2) infinite; }
.dir-jumpscare svg { width: 100%; height: 100%; display: block; }
/* #93 AI 生成的恐怖脸图：覆盖在 SVG 鬼脸之上，填满突脸层；加载失败则 onerror 隐藏，露出 SVG */
.dir-jumpscare .js-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.dir-jumpscare .js-face svg { position: relative; z-index: 0; }
@keyframes jsIn  { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: scale(1.08); } }
@keyframes jsOut { from { opacity: 1; transform: scale(1.12); } to { opacity: 0; transform: scale(1.28); } }
@keyframes jsShake {
  0%   { transform: translate(-7px,5px) rotate(-1.2deg); }
  25%  { transform: translate(6px,-6px) rotate(1deg); }
  50%  { transform: translate(-5px,-4px) rotate(-.8deg); }
  75%  { transform: translate(7px,4px) rotate(1.4deg); }
  100% { transform: translate(-6px,6px) rotate(-1deg); }
}

/* 方案 A：全屏强制覆盖 Bad Ending（reduced-motion 降级暗场 + 文字，不做剧烈闪烁） */
.forced-death-rm { position: fixed; inset: 0; z-index: 9991; background: #05060a; display: flex; align-items: center; justify-content: center; }
.forced-death-rm .fd-text { color: #c0271d; font-family: var(--font-mono); font-size: clamp(20px, 5vw, 38px); letter-spacing: .08em; text-align: center; padding: 0 20px; }
@media (prefers-reduced-motion: reduce) { .forced-death-rm .fd-text { animation: none; } }

/* 方案 B：伪系统弹窗（心理恐怖）——模拟 Windows 错误框，内容是一张脸 */
.syserr-mask { position: fixed; inset: 0; z-index: 9980; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.syserr-box { width: min(360px, 100%); background: #f4f4f4; color: #222; border: 1px solid #b9b9b9; border-radius: 6px; box-shadow: 0 18px 50px rgba(0,0,0,.5); overflow: hidden; font-family: var(--font-sans); }
.syserr-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: linear-gradient(#3a3f4a, #2b2f38); color: #fff; font-size: 13px; font-weight: 600; }
.syserr-ic { width: 16px; height: 16px; flex: none; fill: none; stroke: #ff5b5b; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.syserr-body { display: flex; align-items: center; gap: 14px; padding: 18px 16px; }
.syserr-face { width: 76px; height: 76px; flex: none; object-fit: cover; border: 1px solid #999; background: #222; border-radius: 4px; }
.syserr-msg { margin: 0; font-size: 13.5px; line-height: 1.7; color: #2a2a2a; }
.syserr-actions { display: flex; justify-content: flex-end; padding: 10px 14px 14px; }
.syserr-ok { font-size: 13px; padding: 7px 22px; border: 1px solid #adadad; border-radius: 4px; background: #e9e9e9; color: #1c1c1c; cursor: pointer; }
.syserr-ok:hover { background: #dcdcdc; }
.syserr-flick { animation: syserrFlick .42s steps(2) 1; transform-origin: 50% 50%; }
@keyframes syserrFlick { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(2.6); opacity: .25; } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .syserr-flick { animation: none; } }

/* ============ P2-1 光敏性癫痫 / 闪烁警告（强制展示，不可跳过） ============
 * 在游戏任何闪烁/突脸逻辑之前弹出，玩家必须二选一点击确认后才放行。
 * 黑底白字、高对比，且无动画（连 reduced-motion 下也必须完整可读）。
 * 提供「降低动效」入口，点击即把全局 reduceMotion 置真，从源头压制闪烁。
 */
.psa-mask {
  position: fixed; inset: 0; z-index: 10000;
  background: #000; color: #fff;
  display: flex; align-items: center; justify-content: center; padding: 22px;
  font-family: var(--font-sans, system-ui, sans-serif);
}
.psa-box {
  width: min(560px, 100%); max-height: 92vh; overflow: auto;
  background: #0b0b0b; border: 2px solid #ffd400; border-radius: 8px;
  padding: 26px 28px; box-shadow: 0 0 0 4px rgba(0,0,0,.6), 0 20px 60px rgba(0,0,0,.8);
}
.psa-title {
  margin: 0 0 14px; font-size: 19px; font-weight: 800; letter-spacing: .02em;
  color: #ffd400; display: flex; align-items: center; gap: 10px;
}
.psa-title .psa-bang {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: #ffd400; color: #000; font-weight: 900; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
}
.psa-list { margin: 0 0 18px; padding-left: 20px; font-size: 14.5px; line-height: 1.85; color: #f2f2f2; }
.psa-list li { margin: 4px 0; }
.psa-warn { margin: 0 0 18px; font-size: 13.5px; line-height: 1.8; color: #ff9a9a; }
.psa-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.psa-btn {
  flex: 1 1 200px; min-width: 200px; cursor: pointer;
  font-size: 14.5px; font-weight: 700; padding: 13px 16px; border-radius: 6px;
  border: 2px solid #ffd400; background: #1a1a1a; color: #fff;
  transition: background .15s, transform .1s;
}
.psa-btn:hover { background: #2a2a2a; }
.psa-btn:active { transform: translateY(1px); }
.psa-btn.psa-recommend { background: #ffd400; color: #000; border-color: #ffd400; }
.psa-btn.psa-recommend:hover { background: #ffe14d; }
.psa-note { margin: 16px 0 0; font-size: 12px; line-height: 1.7; color: #9a9a9a; text-align: center; }

/* ============ S3.2 网页腐化滤镜（基于污染度，与双色系统联动） ============
 * 由 html[data-corruption="0|1|2|3"] 驱动；JS 实时写入该属性。
 * 白底下复用 html::after（与 body::after 噪点分层）：阶段越高，病历纸黄/暗红越浓。
 */
html::after {
  content: ""; position: fixed; inset: 0; z-index: 70; pointer-events: none; opacity: 0;
  transition: opacity .6s ease;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.02) 0 1px, transparent 1px 3px);
}
/* 阶段1（污染 15-39）：极轻颗粒 + 微暖色 */
html[data-corruption="1"]::after {
  opacity: .18;
  background:
    repeating-linear-gradient(0deg, rgba(120,110,90,.04) 0 1px, transparent 1px 3px),
    radial-gradient(120% 120% at 50% 50%, transparent 60%, rgba(120,110,90,.12) 100%);
}
/* 阶段2（污染 40-69）：可见横纹 + 加重暖角 */
html[data-corruption="2"]::after {
  opacity: .42;
  background:
    repeating-linear-gradient(0deg, rgba(120,100,70,.06) 0 1px, transparent 1px 2px),
    radial-gradient(120% 120% at 50% 50%, transparent 45%, rgba(150,120,80,.22) 100%);
  animation: grain 1.2s steps(3) infinite;
}
/* 阶段3（污染 ≥70）：病历纸强横纹 + 暗红渗染 + 周期脉冲 */
html[data-corruption="3"]::after {
  opacity: .72;
  background:
    repeating-linear-gradient(0deg, rgba(150,40,30,.07) 0 1px, transparent 1px 2px),
    radial-gradient(120% 120% at 50% 50%, transparent 30%, rgba(150,40,30,.35) 100%);
  animation: grain .6s steps(2) infinite, corruptPulse 4s ease-in-out infinite;
}
/* 阶段3：正文整体色偏暖旧 + 轻微失真，强化「网页正在腐烂」观感 */
html[data-corruption="3"] .wrap { filter: sepia(.18) saturate(1.05) contrast(1.03); }
html[data-corruption="3"] .card {
  box-shadow: inset 0 0 26px rgba(120,60,20,.20), inset 0 0 8px rgba(60,30,10,.16),
              0 0 0 1px rgba(139,0,0,.2), 0 10px 34px rgba(0,0,0,.12);
}

/* 留白错位：腐化阶段 2/3 让部分卡片出现轻微位移，制造「排版在松动」的不安 */
html[data-corruption="2"] .arch-card:nth-of-type(3n) { margin-left: 12px; }
html[data-corruption="2"] .serp-item:nth-of-type(2n) { margin-left: 16px; }
html[data-corruption="3"] .arch-card { transform: translateX(2px) rotate(-.15deg); }
html[data-corruption="3"] .serp-item:nth-of-type(2n) { transform: translateX(-5px); }
html[data-corruption="3"] .serp-item:nth-of-type(3n) { margin-right: 10px; }

@keyframes corruptPulse { 0%,100% { opacity: .6; } 50% { opacity: .9; } }

/* ============ V4.5 腐化「视觉污染」（叠加层，而非单纯换色） ============ */
/* 1) 霉斑/水渍遮罩：在纯白卡片上叠加半透明污渍，模拟「干净白界面正在被侵蚀」 */
html[data-corruption="2"] .card::after,
html[data-corruption="3"] .card::after,
html[data-corruption="3"] .serp-item::after {  /* mold-stain */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.02 0.035' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.32 0 0 0 0 0.24 0 0 0 0 0.12 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E");
  background-size: 180px 180px; opacity: .4; mix-blend-mode: multiply;
}
html[data-corruption="2"] .card, html[data-corruption="3"] .card { position: relative; }
html[data-corruption="3"] .serp-item { position: relative; }

/* 2) 文字层错乱（由 ui.js 给部分文本节点套用这些类：删除线 / 排版抖动 / 渗红） */
.chaos-strike { text-decoration: line-through; text-decoration-color: rgba(139,0,0,.55); }
.chaos-jit { display: inline-block; }
.chaos-red { color: #8B0000; }

/* 3) 悬停时下划线偶发闪烁/偏移（里世界） */
html[data-corruption="2"] a:hover, html[data-corruption="3"] a:hover { animation: ulFlicker .5s steps(2) 1; }
@keyframes ulFlicker {
  0% { text-decoration-color: transparent; transform: translateX(0); }
  45% { text-decoration-color: var(--link); transform: translateX(1px); }
  70% { text-decoration-color: rgba(139,0,0,.5); }
  100% { text-decoration-color: var(--link); transform: translateX(0); }
}

/* 4) 点击按钮 5% 概率轻微抖动（由 ui.js 触发） */
.shake { animation: shake .35s steps(3) 1; }
@keyframes shake {
  0% { transform: translate(0,0); } 25% { transform: translate(-1px,1px) rotate(-.3deg); }
  50% { transform: translate(1px,-1px); } 75% { transform: translate(-1px,0); } 100% { transform: translate(0,0); }
}

/* S4.1 动态结算报告（act1-complete） */
.report-meter { display: flex; align-items: center; gap: 12px; margin: 6px 0 18px; }
.report-meter .rm-label { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); flex: none; }
.report-meter .rm-bar { flex: 1; height: 10px; border-radius: 6px; background: var(--line-soft); overflow: hidden; }
.report-meter .rm-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--signal), var(--danger)); transition: width .8s ease; }
.report-meter .rm-val { font-family: var(--font-mono); font-size: 12.5px; color: var(--signal); flex: none; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin-bottom: 14px; }
.ms-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.ms-row .ms-mark { font-family: var(--font-mono); width: 16px; text-align: center; }
.ms-ok { color: var(--text); }
.ms-ok .ms-mark { color: var(--signal); }
.ms-miss { opacity: .55; }
.ms-miss .ms-mark { color: var(--muted); }
.report-close { font-size: 13.5px; line-height: 1.8; color: var(--text); margin: 0; padding-top: 12px; border-top: 1px solid var(--line-soft); }
@media (max-width: 560px) { .report-grid { grid-template-columns: 1fr; } }

/* 存在感下降：视野收窄（E10） */
body.horror-existence-low .wrap { clip-path: inset(5% 3% 5% 3%); transition: clip-path .8s ease; }

/* 信号条随状态变色（HUD 间接暗示） */
#topbar[data-sig="low"] .sig-bars i { background: var(--amber); }
#topbar[data-sig="crit"] .sig-bars i { background: var(--danger); animation-duration: .4s; }
#topbar[data-sig="weak"] .sig-bars i { opacity: .3; }
#topbar[data-sig="weak"] .tb-signal { color: var(--amber); border-color: var(--amber); }

/* 新闻"实时更新"行（E13） */
table.arch tr.glitch-row td { color: var(--danger); }

/* ================= 第二幕·视觉舒适度 / 光敏安全 ================= */
/* CRT 叠层（扫描线 + 噪点）：强度由 --crt 控制，默认 0.3（渐进式，随污染等级增强） */
.card.terminal { position: relative; }
.card.terminal::before {  /* 高频噪点 */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 4; mix-blend-mode: multiply;
  opacity: calc(var(--crt, .3) * .55);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}
.card.terminal::after {  /* 扫描线 */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5; mix-blend-mode: multiply;
  opacity: var(--crt, .3);
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.10) 0 1px, transparent 1px 3px);
}
.card.terminal.corrupt-1 { --crt: .5; }
.card.terminal.corrupt-2 { --crt: .75; }
.card.terminal.corrupt-3 { --crt: 1; }
html.no-crt .card.terminal::before,
html.no-crt .card.terminal::after,
html.no-crt body::before,
html.no-crt body::after { display: none; }

/* 舒适：柔化终端绿与背景（仅作用于第二幕终端，不影响全站） */
html.soft-contrast .card.terminal .term-prompt,
html.soft-contrast .card.terminal .ls-read,
html.soft-contrast .card.terminal .term-hint b,
html.soft-contrast .card.terminal .term-typing::after,
html.soft-contrast .card.terminal .typewriter .caret,
html.soft-contrast .card.terminal .term-completion .comp-match { color: #4a6b48 !important; }
html.soft-contrast .card.terminal { background: #f0efe8 !important; }

/* 舒适：光标闪烁 慢速 / 常亮不闪（仅作用于第二幕终端） */
html.cursor-slow .card.terminal .blink,
html.cursor-slow .card.terminal .caret,
html.cursor-slow .card.terminal .term-typing::after,
html.cursor-slow .card.terminal .lm-decoding::after { animation-duration: 2s; }
html.cursor-steady .card.terminal .blink,
html.cursor-steady .card.terminal .caret,
html.cursor-steady .card.terminal .term-typing::after,
html.cursor-steady .card.terminal .lm-decoding::after { animation: none !important; opacity: 1 !important; }

/* ============ 第二幕·终端残影：黑底绿字 CRT「设备」外观 ============
 * 设计意图：.card.terminal 是一台 1999 年 CRT 终端（沉浸设备），
 * 默认恒为黑底绿字，不随全站主题翻转；仅「柔化模式」(soft-contrast) 转为浅色纸感。
 * 修复：此前终端背景沿用 .terminal 的 #fff，在默认黑主题下变成「白卡 + 浅绿字」，
 * 导致残影日志 / 提示 / 章节导航几乎不可见，输入框孤悬一块黑框——即用户看到的「阴 + bug 很多」。
 */
html:not(.soft-contrast) .card.terminal {
  background: #05080a;
  border-color: #11241c;
  box-shadow: 0 0 0 1px rgba(47,230,196,.07), 0 16px 46px rgba(0,0,0,.6);
}
html:not(.soft-contrast) .card.terminal .terminal-bar {
  background: rgba(47,230,196,.07);
  color: #2fe6c4;
  border-bottom-color: #11241c;
}
html:not(.soft-contrast) .card.terminal .terminal-body,
html:not(.soft-contrast) .card.terminal .term-console,
html:not(.soft-contrast) .card.terminal .term-out { color: #b9f4e6; }
html:not(.soft-contrast) .card.terminal .term-console { background: transparent; }
html:not(.soft-contrast) .card.terminal .terminal-body { color: #b9f4e6; }
html:not(.soft-contrast) .card.terminal .typewriter { color: #b9f4e6; min-height: 1.7em; }
html:not(.soft-contrast) .card.terminal .typewriter .caret { color: #2fe6c4; }
html:not(.soft-contrast) .card.terminal .term-prompt { color: #2fe6c4; }
html:not(.soft-contrast) .card.terminal .term-line { color: #b9f4e6; }
html:not(.soft-contrast) .card.terminal .term-line.term-err { color: #ff8a5a; border-left-color: rgba(255,107,90,.5); }
html:not(.soft-contrast) .card.terminal .term-hint { color: #6f9a8c; border-left-color: rgba(47,230,196,.4); }
html:not(.soft-contrast) .card.terminal .term-hint b { color: #2fe6c4; }
html:not(.soft-contrast) .card.terminal .term-ls .ls-read { color: #2fe6c4; }
html:not(.soft-contrast) .card.terminal .term-ls .ls-enc  { color: #ff6b6b; }
html:not(.soft-contrast) .card.terminal .term-ls .ls-dir  { color: #9a7bff; }
html:not(.soft-contrast) .card.terminal .term-completion { color: #6f9a8c; }
html:not(.soft-contrast) .card.terminal .term-completion .comp-match { color: #46d0ff; background: rgba(70,208,255,.12); }
html:not(.soft-contrast) .card.terminal .chapter-nav .nav-h { color: #6f9a8c; }
html:not(.soft-contrast) .card.terminal .nav-link { color: #46d0ff; border-color: rgba(70,208,255,.35); background: rgba(70,208,255,.05); }
html:not(.soft-contrast) .card.terminal .nav-link:hover { border-color: #2fe6c4; box-shadow: 0 0 0 1px rgba(47,230,196,.3); color: #8af0ff; }
html:not(.soft-contrast) .card.terminal .term-cmd { color: #b9f4e6; border-top-color: rgba(47,230,196,.35); }
html:not(.soft-contrast) .card.terminal .term-cmd::placeholder { color: #5a7a70; }
/* 设备入场：轻微上浮 + 辉光（尊重 reduced-motion） */
@keyframes termBoot { from { opacity: 0; transform: translateY(10px); box-shadow: 0 0 0 1px rgba(47,230,196,.07), 0 0 0 rgba(0,0,0,0); } to { opacity: 1; transform: none; } }
html:not(.soft-contrast) .card.terminal { animation: termBoot .5s ease both; }

/* 其它通用 .terminal（档案/新闻页）在黑主题下也翻成深色，避免同样的「白卡浅字」问题 */
html.theme-dark .terminal {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: var(--os-shadow);
}
html.theme-dark .terminal .terminal-bar { background: rgba(47,230,196,.07); border-bottom-color: var(--line); color: var(--signal); }

@media (prefers-reduced-motion: reduce) {
  html:not(.soft-contrast) .card.terminal { animation: none; }
}

/* 视觉舒适度：遮罩 / 安全警告 / 校准仪式 / 设置面板 / gear */
.comfort-overlay {
  position: fixed; inset: 0; z-index: 9500; display: flex; align-items: center; justify-content: center;
  background: rgba(8,10,9,.72); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); padding: 20px;
}
.comfort-modal {
  width: min(440px, 92vw); background: #0b0f0c; color: #9fe6c4; border: 1px solid #1d2a24; border-radius: 12px;
  padding: 22px 24px; font-family: var(--font-mono); box-shadow: 0 20px 60px rgba(0,0,0,.5); max-height: 90vh; overflow-y: auto;
}
.safety-modal { box-shadow: 0 0 0 1px rgba(255,107,107,.28), 0 20px 60px rgba(0,0,0,.5); }
.safety-modal .cs-title { color: #ff8c66; }
.cs-title { color: #54e0c4; font-size: 16px; margin: 0 0 12px; letter-spacing: .04em; }
.cs-text { color: #9fe6c4; font-size: 13px; line-height: 1.7; margin: 8px 0; }
.cs-list { color: #cfe9dd; font-size: 13px; line-height: 1.9; margin: 8px 0; padding-left: 18px; }
.cs-actions { display: flex; gap: 10px; margin-top: 16px; }
.cs-btn {
  flex: 1; padding: 10px 14px; border: 1px solid #2c4038; background: #11201a; color: #9fe6c4;
  border-radius: 8px; font-family: var(--font-mono); font-size: 13px; cursor: pointer; transition: .15s;
}
.cs-btn:hover { border-color: #54e0c4; background: #163025; }
.cs-btn.cs-primary { background: #1f6f57; border-color: #2c9b78; color: #eafff6; }
.cs-btn.cs-primary:hover { background: #258063; }
.cs-note { color: #5f7a6c; font-size: 11.5px; line-height: 1.7; margin: 12px 0 0; }
.cs-row { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 13px 0; border-top: 1px solid #1d2a24; }
.cs-row:first-of-type { border-top: none; }
.cs-label { color: #9fe6c4; font-size: 13px; }
.cs-desc { color: #5f7a6c; font-size: 11.5px; line-height: 1.6; }
.cs-seg { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-start; }
.cs-seg-btn {
  padding: 7px 11px; border: 1px solid #2c4038; background: #11201a; color: #9fe6c4;
  border-radius: 7px; font-family: var(--font-mono); font-size: 12px; cursor: pointer; transition: .15s;
}
.cs-seg-btn:hover { border-color: #54e0c4; }
.cs-seg-btn.active { background: #1f6f57; border-color: #2c9b78; color: #eafff6; }

/* 开局光敏警告：舒适度双选卡片（每个选项下方含文字描述） */
.cs-choices { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.cs-choice {
  position: relative; text-align: left; display: flex; flex-direction: column; gap: 6px;
  padding: 16px 46px 15px 18px;
  border: 1px solid #2c4038; background: linear-gradient(180deg, #11201a, #0c1611); color: #9fe6c4;
  border-radius: 13px; font-family: var(--font-mono); cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
  animation: csRise .42s cubic-bezier(.2,.7,.3,1) both;
}
.cs-choice:nth-child(1) { animation-delay: .06s; }
.cs-choice:nth-child(2) { animation-delay: .16s; }
.cs-choice::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px;
  background: #2c4038; transition: background .18s ease; }
.cs-choice:hover { transform: translateY(-2px); border-color: #54e0c4; background: linear-gradient(180deg, #163025, #0f1f18);
  box-shadow: 0 10px 26px rgba(0,0,0,.45), 0 0 0 1px rgba(84,224,196,.25); }
.cs-choice:hover::before { background: #54e0c4; }
.cs-choice:active { transform: translateY(0) scale(.992); }
.cs-choice:focus-visible { outline: 2px solid #54e0c4; outline-offset: 2px; }
.cs-choice-comfort { border-color: #2c9b78; }
.cs-choice-comfort::before { background: #2c9b78; }
.cs-choice-comfort:hover { background: linear-gradient(180deg, #16302a, #0e1f1b);
  box-shadow: 0 10px 26px rgba(0,0,0,.45), 0 0 0 1px rgba(44,155,120,.3); }
.cs-choice-title { font-size: 14.5px; color: #eafff6; letter-spacing: .03em; display: flex; align-items: center; gap: 8px; }
.cs-ic { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; color: #54e0c4; }
.cs-choice-desc { font-size: 12px; line-height: 1.72; color: #9fe6c4; opacity: .82; }
.cs-choice-arrow { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 24px; line-height: 1;
  color: #54e0c4; opacity: .45; transition: transform .18s ease, opacity .18s ease; }
.cs-choice:hover .cs-choice-arrow { transform: translateY(-50%) translateX(3px); opacity: 1; }
.cs-choice-badge { position: absolute; top: -9px; left: 15px; font-size: 10.5px; padding: 2px 9px; border-radius: 999px;
  letter-spacing: .06em; background: #0a0d0b; border: 1px solid #2c4038; color: #54e0c4; }
.cs-choice-comfort .cs-choice-badge { color: #5fd6a8; border-color: #2c9b78; }
@keyframes csRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* 校准仪式（启动自检） */
.boot-modal { width: min(380px, 92vw); }
.boot-title { color: #54e0c4; font-size: 14px; margin-bottom: 12px; letter-spacing: .06em; }
.boot-log { min-height: 64px; font-size: 12.5px; line-height: 1.9; color: #9fe6c4; }
.boot-line { opacity: 0; animation: bootIn .3s ease forwards; }
@keyframes bootIn { to { opacity: 1; } }
.boot-bar { height: 6px; background: #11201a; border-radius: 4px; overflow: hidden; margin-top: 10px; }
.boot-fill { height: 100%; width: 0; background: linear-gradient(90deg, #2c9b78, #54e0c4); transition: width .3s ease; }
.boot-skip { text-align: right; color: #5f7a6c; font-size: 11.5px; margin-top: 10px; cursor: pointer; }

/* 终端标题栏的「显示 ⚙」按钮（由 comfort.js 自动注入） */
.comfort-gear {
  margin-left: auto; background: transparent; border: 1px solid currentColor; color: inherit;
  border-radius: 6px; font-family: var(--font-mono); font-size: 11px; padding: 2px 8px; cursor: pointer; opacity: .82;
}
.comfort-gear:hover { opacity: 1; }

@media (max-width: 520px) {
  .cs-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .cs-seg { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .boot-line { animation: none; opacity: 1; }
  body::before, body::after { animation: none; }
}

/* =====================================================================
   V5.0 界面优化与体验打磨（依据《信号尽头》打磨文档）
   分组：视觉微调 / 交互UX / 恐怖氛围 / 性能可访问性 / 发布前
   ===================================================================== */

/* ---------- 一·2 字体：Zpix 关抗锯齿（像素字体需硬边，禁用灰度平滑） ---------- */
.tb-logo, .hero h1 { -webkit-font-smoothing: none; -moz-osx-font-smoothing: unset; }

/* Noto Serif SC 跨平台兜底（已在 --font-sans / --font-serif 链式兜底；此处显式增强） */
@font-face {
  font-family: "Noto Serif SC";
  src: local("Noto Serif SC"), local("Songti SC"), local("SimSun");
  font-display: swap;
}

/* ---------- 一·1 伪浏览器外壳拟真：地址栏锁图标闪烁/破损（腐化 2/3） ---------- */
.addr-lock { position: relative; transition: color .3s; }
@keyframes lockFlicker { 0%,100%{opacity:1} 47%{opacity:1} 48%{opacity:.35} 49%{opacity:1} 92%{opacity:1} 93%{opacity:.5} 94%{opacity:1} }
html[data-corruption="2"] .addr-lock { color: var(--amber); animation: lockFlicker 1.2s steps(2) infinite; }
html[data-corruption="3"] .addr-lock { color: var(--danger); filter: drop-shadow(0 0 3px rgba(139,0,0,.6)); animation: lockFlicker 2.4s steps(1) infinite; }
html[data-corruption="3"] .addr-lock::after {
  content: ""; position: absolute; left: 1px; top: 7px; width: 13px; height: 2px;
  background: var(--danger); transform: rotate(38deg); opacity: .85; box-shadow: 0 0 4px rgba(139,0,0,.7);
}

/* 一·1 nav-btn 禁用态强化：腐化阶段下呈危险虚线 + 失能感 */
html[data-corruption="2"] .nav-btn:disabled,
html[data-corruption="3"] .nav-btn:disabled {
  opacity: .55; border-style: dashed; border-color: rgba(139,0,0,.45); color: #9c3b2e;
}

/* 一·3 滚动条 thumb 暗红联动（腐化 2/3 渗血） */
html[data-corruption="2"] { scrollbar-color: #9c3b2e #efe9da; }
html[data-corruption="2"] ::-webkit-scrollbar-thumb { background: #9c3b2e; border-color: #7a2f24; }
html[data-corruption="3"] { scrollbar-color: #8B0000 #e6ddc8; }
html[data-corruption="3"] ::-webkit-scrollbar-thumb { background: #8B0000; border-color: #5e0000; }

/* ---------- 二·1 搜索中枢：.crt-scan skewX 抖动 + 琥珀闪烁（腐化 2/3） ---------- */
@keyframes crtJitter {
  0%,100% { transform: translateX(0) skewX(0); }
  25%     { transform: translateX(-1px) skewX(-2deg); }
  50%     { transform: translateX(1px) skewX(1.6deg); }
  75%     { transform: translateX(-1px) skewX(-1deg); }
}
html[data-corruption="2"] .crt-scan { animation: crtJitter .36s steps(2) infinite; color: var(--amber); border-color: var(--amber); }
html[data-corruption="3"] .crt-scan { animation: crtJitter .2s steps(2) infinite; color: #ff5a3c; border-color: #8B0000; background: rgba(139,0,0,.06); }

/* 二·1 空状态雷达随腐化变异（青→琥珀→暗红，里世界加速） */
html[data-corruption="2"] .radar { border-color: var(--amber); }
html[data-corruption="2"] .radar::before { background: conic-gradient(from 0deg, rgba(184,134,11,.55), transparent 40%); }
html[data-corruption="3"] .radar { border-color: var(--danger); }
html[data-corruption="3"] .radar::before { background: conic-gradient(from 0deg, rgba(139,0,0,.65), transparent 35%); animation-duration: .5s; }
html[data-corruption="3"] .radar::after { background: var(--danger); box-shadow: 0 0 8px rgba(139,0,0,.7); }

/* ---------- 二·2 线索册：新线索红点/NEW 角标 + 分类折叠 + 呼吸 ---------- */
.clue-cat-h { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 6px; }
.clue-cat-h .cat-arrow { font-size: 11px; color: var(--muted); transition: transform .2s; flex: none; }
.clue-cat.collapsed .cat-arrow { transform: rotate(-90deg); }
.clue-cat.collapsed .clue-list { display: none; }
.new-badge {
  display: inline-block; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
  color: #fff; background: var(--danger); border-radius: 3px; padding: 1px 5px; margin-right: 6px;
  vertical-align: 1px; animation: newPulse 1.6s ease-in-out infinite;
}
@keyframes newPulse { 0%,100%{ box-shadow: 0 0 0 0 rgba(192,57,43,.5); } 50%{ box-shadow: 0 0 0 4px rgba(192,57,43,0); } }
.clue-item.flash-in {
  border-left-color: var(--danger); background: rgba(192,57,43,.05);
  animation: clueBreath 1.5s ease-in-out infinite;
}
@keyframes clueBreath {
  0%,100% { box-shadow: 0 0 0 0 rgba(192,57,43,0); }
  50%     { box-shadow: 0 0 0 3px rgba(192,57,43,.22); }
}

/* ---------- 二·3 移动端外壳折叠汉堡 + 底部 mini 导航（≤768px） ---------- */
#nav-mobile { display: none; }
.mb-nav { display: none; }
@media (max-width: 768px) {
  #nav-mobile { display: inline-flex; }
  .bookmark-bar { display: none; }
  #topbar.mobile-open .bookmark-bar { display: flex; flex-direction: column; }
  .mb-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: var(--bg-soft); border-top: 1px solid var(--line);
    padding: 4px env(safe-area-inset-bottom, 0); box-shadow: 0 -6px 18px rgba(0,0,0,.08);
  }
  .mb-link {
    flex: 1; text-align: center; padding: 11px 4px; font-size: 13px; color: var(--link);
    background: none; border: none; text-decoration: none; font-family: var(--font-sans); cursor: pointer;
  }
  .mb-link.mb-btn { color: var(--signal); }
  .mb-link:active { background: rgba(0,102,204,.08); }
}

/* ---------- 三·1 存在度<30 的「被遗忘」：HUD 代号变淡 + 书签文字空白仍可点 ---------- */
body.horror-existence-low .tb-right .tb-chip:first-child { opacity: .12; filter: blur(1.2px); }
body.horror-existence-low .bookmark-bar .bm-link { color: transparent !important; text-shadow: none; }
body.horror-existence-low .bookmark-bar .bm-link:hover { color: transparent !important; }
body.horror-existence-low .bookmark-bar .bm-link { border-color: rgba(150,150,150,.28); }

/* 三·1 ::selection 血迹色 */
::selection { background: rgba(139,0,0,.34); color: #fff; }
::-moz-selection { background: rgba(139,0,0,.34); color: #fff; }

/* ---------- 四·1 性能：CRT 覆盖层 GPU 加速（合成层，减少重排） ---------- */
body::before, body::after { will-change: transform, opacity; transform: translateZ(0); }
html.no-crt body::before, html.no-crt body::after { will-change: auto; transform: none; }
.card.terminal::before, .card.terminal::after { will-change: transform, opacity; transform: translateZ(0); }

/* 四·1 移动端 / reduced-motion 降级：SVG 噪点 → 静态 CSS 条纹（降低 GPU/重绘压力） */
@media (prefers-reduced-motion: reduce) {
  body::after {
    background-image: repeating-linear-gradient(0deg, rgba(0,0,0,.06) 0 1px, transparent 1px 4px) !important;
    opacity: .5 !important; animation: none !important;
  }
}

/* 三·3 第四面墙：Stage 3 鼠标轨迹暗红拖影（由 horror.js 注入 .mouse-trail-dot） */
.mouse-trail-dot {
  position: fixed; width: 7px; height: 7px; border-radius: 50%; pointer-events: none; z-index: 60;
  background: radial-gradient(circle, rgba(139,0,0,.55), rgba(139,0,0,0)); transform: translate(-50%,-50%);
  animation: trailFade .72s ease-out forwards;
}
@keyframes trailFade {
  from { opacity: .75; transform: translate(-50%,-50%) scale(1); }
  to   { opacity: 0;   transform: translate(-50%,-50%) scale(2.6); }
}

/* ---------- 四·2 可访问性：全局 :focus-visible 焦点环（键盘可达） ---------- */
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
.nav-btn:focus-visible, .bm-link:focus-visible, .tb-btn:focus-visible, .seam-opt:focus-visible,
.claim-opt:focus-visible, .cs-seg-btn:focus-visible, .pager-btn:focus-visible, .hint:focus-visible,
.roster-row:focus-visible, .sched-row:focus-visible, .drawer-x:focus-visible, .comfort-gear:focus-visible {
  outline: 2px solid var(--link); outline-offset: 2px;
}

/* ---------- 五 极端分辨率：超窄屏（<360px）兜底 ---------- */
@media (max-width: 360px) {
  .wrap { padding: 18px 10px 84px; }
  .card { padding: 14px 12px; }
  .tb-chip { font-size: 10.5px; padding: 2px 7px; }
  .hero h1 { font-size: 26px; letter-spacing: .14em; }
  .mb-link { font-size: 11.5px; padding: 10px 2px; }
  .chapter-nav .nav-link { flex: 1 1 100%; text-align: center; }
}

/* ============ 动效升级 V5.1（整体顺滑化 + 入场编排） ============ */
/* 卡片 / 书签 / 线索项 / 弹窗：统一过渡，悬停轻微浮起 */
.card, .serp-item, .bookmark, .clue-item, .exif, .modal, .modal-mask .modal {
  transition: transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.card:hover, .serp-item:hover, .bookmark:hover, .clue-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0,0,0,.12);
}
html.theme-dark .card:hover, html.theme-dark .serp-item:hover, html.theme-dark .bookmark:hover, html.theme-dark .clue-item:hover {
  box-shadow: 0 10px 26px rgba(0,0,0,.6);
}
/* 卡片入场：淡入上移 */
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.card { animation: cardIn .45s cubic-bezier(.2,.7,.3,1) both; }
/* 热搜卡片逐条错峰入场 */
.hot-row { animation: cardIn .4s ease both; }
.hot-list .hot-row:nth-child(1){ animation-delay:.00s; }
.hot-list .hot-row:nth-child(2){ animation-delay:.04s; }
.hot-list .hot-row:nth-child(3){ animation-delay:.08s; }
.hot-list .hot-row:nth-child(4){ animation-delay:.12s; }
.hot-list .hot-row:nth-child(5){ animation-delay:.16s; }
.hot-list .hot-row:nth-child(6){ animation-delay:.20s; }
.hot-list .hot-row:nth-child(7){ animation-delay:.24s; }
.hot-list .hot-row:nth-child(8){ animation-delay:.28s; }
.hot-list .hot-row:nth-child(9){ animation-delay:.32s; }

/* ============ 手机端专门适配 V5.1（每款手机：流式字号 + 多断点） ============ */
/* 流式标题：随屏幕缩放，避免小屏溢出 */
.hero h1 { font-size: clamp(26px, 8vw, 40px); }
.hero .tagline, .sp-sub { font-size: clamp(11px, 3.4vw, 13px); }

@media (max-width: 768px) {
  .search-page { padding: 18px 6px 72px; }
  .sp-logo { font-size: 24px; }
  .hot-row { padding: 12px 6px; gap: 9px; }
  .hot-heat { font-size: 11px; }
  .serp-item { padding: 13px; }
  .result { margin-top: 14px; }
  .tb-logo { font-size: 15px; letter-spacing: .12em; }
}
@media (max-width: 600px) {
  .search-page { padding: 16px 5px 66px; }
  .sp-header { gap: 6px; }
  .hot-rank { width: 20px; flex: 0 0 20px; font-size: 14px; }
  .hot-term { font-size: 14px; }
  .hot-title { font-size: 12.5px; }
  .hot-snip { font-size: 12px; }
  .search-input-row #q { font-size: 15px; padding: 12px 14px; }
  .btn-search { padding: 0 16px; font-size: 14px; }
  .serp-title { font-size: 16px; }
}
@media (max-width: 480px) {
  .search-page { padding: 14px 4px 64px; }
  .hot-rank { width: 18px; flex: 0 0 18px; font-size: 13px; }
  .hot-term { font-size: 13.5px; }
  .hot-title { font-size: 12px; }
  .hot-snip { font-size: 11.5px; -webkit-line-clamp: 2; }
  .hot-heat { font-size: 10.5px; }
  .search-input-row #q { font-size: 14px; padding: 11px 12px; }
  .btn-search { padding: 0 13px; font-size: 14px; }
  .serp-title { font-size: 15px; }
  .tb-right .tb-chip { display: none; }   /* 超小屏隐藏次要芯片，保留关键按钮 */
}
@media (max-width: 380px) {
  .hot-row { padding: 10px 2px; gap: 6px; }
  .hot-rank { width: 16px; flex: 0 0 16px; }
  .hot-term { font-size: 13px; }
  .search-input-row { border-radius: 20px; }
  .btn-search { padding: 0 10px; font-size: 13px; }
  .sp-logo { font-size: 21px; }
  .serp-item { padding: 11px; }
}
@media (max-width: 320px) {
  .wrap { padding: 14px 8px 80px; }
  .search-page { padding: 12px 2px 60px; }
  .hot-term { font-size: 12.5px; }
  .hot-heat { font-size: 10px; }
  .sp-logo { font-size: 19px; }
}

/* ============================================================
   #113 归档扫描件（医院页） & 登记证件照（失踪人口页）
   两份病历扫描件并排对照；证件照嵌在登记详情面板内。
   全部走主题变量，浅色 / 腐化 / 暗色主题自动适配。
   ============================================================ */
.scan-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 10px;
}
.scan {
  margin: 0;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 10px 10px 9px;
  box-shadow: var(--os-shadow);
}
.scan img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  filter: sepia(.1) contrast(1.04) saturate(.96);
}
.scan figcaption {
  margin-top: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
}
.scan figcaption b { color: var(--text); font-weight: 600; letter-spacing: .02em; }
.scan figcaption .muted { color: var(--muted); }

/* 腐化加深时扫描件轻微错位，呼应「两份不可能同时成立」 */
html[data-corruption="2"] .scan:nth-child(2) { transform: translateY(3px) rotate(.2deg); }
html[data-corruption="3"] .scan:nth-child(1) { transform: translateY(-3px) rotate(-.25deg); }
html[data-corruption="3"] .scan:nth-child(2) { transform: translateY(4px) rotate(.3deg); }

/* 失踪人口登记 · 详情面板内的证件照 */
.id-detail { display: flex; gap: 14px; align-items: flex-start; }
.id-card {
  flex: 0 0 auto;
  margin: 0;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px;
  box-shadow: var(--os-shadow);
}
.id-card .id-photo {
  display: block;
  width: 118px;
  height: auto;
  border-radius: 2px;
  filter: grayscale(.15) sepia(.08) contrast(1.06);
}
.id-card figcaption {
  margin-top: 6px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--muted);
}
.id-body { flex: 1 1 auto; min-width: 0; }
.id-body p { margin: 8px 0 0; }

@media (max-width: 560px) {
  .scan-pair { grid-template-columns: 1fr; gap: 12px; }
  .id-card .id-photo { width: 96px; }
  .id-detail { gap: 11px; }
}
