/* 《来路不明》NO QUESTIONS ASKED · 柜台设备 UI
 *
 * 精细像素风赛博朋克柜台设备：深灰面板、细边框、标题栏、螺丝点缀。
 * 全部直角或 1 像素阶梯角，硬阴影不带模糊，只有屏幕发光用柔光。
 * 像素单位 P = 3px（小组件 2px），边框与间距都按 P 的倍数。
 * 字号只用 16px 的整数倍（GNU Unifont 16x16 点阵）。
 */

/* ---------------------------------------------------------------- 基础 */
:root {
  --bg:        #0d1114;
  --panel:     #1e2529;
  --panel-hi:  #2a3338;
  --line:      #4a5c63;
  --dim-text:  #7fa9b0;
  --text:      #d9e2e0;
  --orange:    #ff9a3c;
  --rust:      #a8432f;
  --pink:      #e25fbf;
  --led:       #6dff8a;
  --crt:       #ffc53d;
  --stamp:     #c8302a;
  --paper:     #d8cfb4;
  --paper-dk:  #2a2620;
  --P: 3px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  background: #06090b;
  overflow: hidden;
  font-family: 'NQA Unifont', 'Courier New', monospace;
  font-size: 16px;
  line-height: 1.25;
  color: var(--text);
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

img { image-rendering: pixelated; image-rendering: crisp-edges; }

/* 舞台：7:4 等比居中，外围纯深色 */
.stage {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(100vw, calc(100vh * 7 / 4));
  height: min(100vh, calc(100vw * 4 / 7));
  background: #06090b;
  overflow: hidden;
}

/* ------------------------------------------------------------ 媒体层 */
.title-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.55;
  filter: saturate(0.75) brightness(0.85);
}
.media { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.layer {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transform-origin: 50% 50%;
  will-change: opacity, transform;
  background: #06090b;
}
.layer.on { opacity: 1; }
.layer.fading { transition: opacity 300ms linear; }
.layer.zooming { transition: transform 800ms cubic-bezier(0.16, 1, 0.3, 1); }
.layer.zoom-fast { transition: transform 300ms linear; }

/* --------------------------------------------------------- 叠加特效层 */
.vignette {
  position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 120px 24px rgba(0, 0, 0, 0.55);
}
.dim {
  position: absolute; inset: 0; pointer-events: none;
  background: #05080a; opacity: 0;
  transition: opacity 500ms linear;
}
.dim.fast { transition: opacity 120ms linear; }
.fail-tint {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 50%, rgba(168, 67, 47, 0.20) 0%, rgba(120, 20, 12, 0.72) 100%);
  opacity: 0; transition: opacity 400ms linear;
}
.neon-glow {
  position: absolute; left: 0; right: 0; top: 0; height: 26%;
  pointer-events: none; opacity: 0;
  background: radial-gradient(80% 100% at 50% 0%, rgba(255, 154, 60, 0.75) 0%, rgba(255, 154, 60, 0) 72%);
  mix-blend-mode: screen;
}

/* 占位标签（避开右上角的 HUD 按钮） */
.ph-tag {
  position: absolute; right: 18px; top: 72px;
  padding: 6px 9px;
  background: rgba(13, 17, 20, 0.86);
  border: 3px solid var(--rust);
  color: var(--orange);
  font-size: 16px; letter-spacing: 1px;
  display: none;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
  z-index: 5;
}
.ph-tag.on { display: block; }

/* 倒带特效 */
.rewind-fx {
  position: absolute; inset: 0; pointer-events: none;
  opacity: 0; transition: opacity 160ms linear;
  overflow: hidden;
}
.rewind-fx.on { opacity: 1; }
.rw-scan {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(to bottom,
      rgba(255, 255, 255, 0.10) 0 2px,
      rgba(0, 0, 0, 0.28) 2px 5px);
  animation: rwroll 220ms linear infinite;
}
@keyframes rwroll { from { background-position-y: 0; } to { background-position-y: 5px; } }
.rw-text {
  position: absolute; left: 0; right: 0; top: 46%;
  text-align: center;
  font-size: 48px; color: var(--text);
  text-shadow: 3px 0 0 var(--rust), -3px 0 0 #2ad4d4, 0 3px 0 #000;
  animation: rwblink 300ms steps(2) infinite;
}
@keyframes rwblink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.55; } }

/* ---------------------------------------------------------------- 字幕 */
.subs {
  position: absolute; left: 6%; right: 6%; bottom: 13%;
  text-align: center; pointer-events: none;
}
.subs-text {
  display: inline-block;
  max-width: 100%;
  font-size: 32px;
  color: #f2f6f4;
  padding: 3px 12px;
  background: rgba(8, 11, 13, 0.62);
  text-shadow:
     2px 0 0 #0a0d0f, -2px 0 0 #0a0d0f, 0 2px 0 #0a0d0f, 0 -2px 0 #0a0d0f,
     2px 2px 0 #0a0d0f, -2px 2px 0 #0a0d0f, 2px -2px 0 #0a0d0f, -2px -2px 0 #0a0d0f;
  white-space: nowrap;
}
.subs-text.fx-distort {
  text-shadow:
     2px 0 0 #23d6d6, -2px 0 0 var(--pink),
     0 2px 0 #0a0d0f, 0 -2px 0 #0a0d0f;
  animation: distort 1.1s steps(1) infinite;
}
@keyframes distort {
  0%, 88% { transform: translateX(0); }
  90% { transform: translateX(-2px); }
  93% { transform: translateX(2px); }
  96% { transform: translateX(0); }
}
.subs.hide { display: none; }

/* ----------------------------------------------------------------- HUD */
.hud { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 500ms linear; }
.hud.on { opacity: 1; }

.dev {
  position: relative;
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: 0 0 0 3px #0a0e10, 4px 4px 0 rgba(0, 0, 0, 0.55);
  padding: 6px;
}
.dev::before, .dev::after {
  content: ''; position: absolute; width: 4px; height: 4px;
  background: var(--line); box-shadow: inset 1px 1px 0 #6d8188;
}
.dev::before { left: 2px; top: 2px; }
.dev::after  { right: 2px; top: 2px; }

.hud-tl { position: absolute; left: 18px; top: 18px; display: flex; gap: 12px; align-items: flex-start; }

.led-screen { min-width: 168px; }
.dev-label { font-size: 16px; color: var(--dim-text); letter-spacing: 2px; }
.led-value {
  font-size: 32px; color: var(--led);
  text-shadow: 0 0 8px rgba(109, 255, 138, 0.75), 0 0 2px rgba(109, 255, 138, 0.9);
  letter-spacing: 1px;
}
.led-value .cent { font-size: 16px; margin-left: 3px; }
.scan {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0.22) 0 1px, rgba(0,0,0,0) 1px 3px);
}
.cash-float {
  position: absolute; left: 100%; top: 18px; margin-left: 9px;
  font-size: 32px; white-space: nowrap;
  opacity: 0; transform: translateY(0);
}
.cash-float.go { animation: floatup 1400ms ease-out forwards; }
.cash-float.plus  { color: var(--led); text-shadow: 0 0 8px rgba(109,255,138,0.7); }
.cash-float.minus { color: var(--rust); text-shadow: 0 0 8px rgba(168,67,47,0.8); }
@keyframes floatup {
  0%   { opacity: 0; transform: translateY(10px); }
  18%  { opacity: 1; transform: translateY(0); }
  72%  { opacity: 1; transform: translateY(-6px); }
  100% { opacity: 0; transform: translateY(-16px); }
}

.crt-screen { min-width: 264px; }
.crt-line1 { font-size: 16px; color: var(--crt); text-shadow: 0 0 6px rgba(255,197,61,0.55); }
.crt-line2 { font-size: 32px; color: var(--crt); text-shadow: 0 0 8px rgba(255,197,61,0.6); letter-spacing: 2px; }

.hud-tr { position: absolute; right: 18px; top: 18px; display: flex; gap: 9px; pointer-events: auto; }
.icon-btn {
  width: 42px; height: 42px;
  background: var(--panel); color: var(--dim-text);
  border: 3px solid var(--line);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.55);
  font-family: inherit; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.icon-btn:hover { background: var(--panel-hi); color: var(--orange); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(0,0,0,0.55); }

.hud-bl {
  position: absolute; left: 18px; bottom: 18px;
  display: flex; gap: 9px;
  transition: bottom 320ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.stage.panel-open .hud-bl { bottom: calc(var(--panel-h, 320px) + 15px); }
.slot {
  position: relative;
  width: 60px; height: 60px;
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: 0 0 0 3px #0a0e10, 3px 3px 0 rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
}
.slot-ico { width: 32px; height: 32px; opacity: 0; }
.slot-ico svg { width: 32px; height: 32px; display: block; }
.slot.has .slot-ico { opacity: 1; }
.slot.flash { animation: slotflash 700ms steps(1) 2; }
@keyframes slotflash {
  0%, 49% { border-color: var(--orange); background: #3a3020; }
  50%, 100% { border-color: var(--line); background: var(--panel); }
}
/* 物品移出（E2 的 ECHO 芯片放进托盘时）：红光一闪 -> 缩小上浮 -> 消失 */
.slot.leaving { animation: slotout 420ms cubic-bezier(0.4, 0, 0.9, 0.6) forwards; }
@keyframes slotout {
  0%   { transform: none; opacity: 1; border-color: var(--line); }
  18%  { transform: scale(1.12); opacity: 1; border-color: #ff4a3a; background: #3a1a16; }
  100% { transform: translateY(-26px) scale(0.35); opacity: 0; border-color: #ff4a3a; }
}
.slot.leaving .slot-ico { animation: slotoutico 420ms linear forwards; }
@keyframes slotoutico {
  0%   { opacity: 1; }
  18%  { opacity: 1; }
  100% { opacity: 0; }
}
.slot-tip {
  position: absolute; left: 0; bottom: 66px;
  padding: 3px 6px; white-space: nowrap;
  background: #0a0e10; border: 2px solid var(--line);
  color: var(--text); font-size: 16px;
  display: none;
}
.slot.has:hover .slot-tip { display: block; }

.toast {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%);
  padding: 6px 12px;
  background: rgba(13, 17, 20, 0.92);
  border: 3px solid var(--orange);
  color: var(--orange); font-size: 16px;
  opacity: 0; transition: opacity 260ms linear;
  white-space: nowrap;
}
.toast.on { opacity: 1; }

/* ------------------------------------------------------------- 鉴定镜 */
.loupe {
  position: absolute; width: 168px; height: 168px;
  margin: -84px 0 0 -84px;
  pointer-events: none; display: none; z-index: 40;
}
.loupe.on { display: block; }
.loupe-glass {
  position: absolute; inset: 0;
  border: 9px solid #b98a3c;
  border-radius: 50%;
  box-shadow:
    0 0 0 3px #6b4d1c,
    0 0 0 6px #2a2118,
    inset 0 0 0 3px #e0b463,
    6px 6px 0 rgba(0,0,0,0.5);
  overflow: hidden;
  background: #06090b;
}
.loupe-glass img {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 0;
  image-rendering: pixelated;
}
.loupe::after {
  content: ''; position: absolute; right: -18px; bottom: -18px;
  width: 42px; height: 15px;
  background: #b98a3c;
  border: 3px solid #6b4d1c;
  transform: rotate(45deg);
}
.clue-bar {
  position: absolute; left: 8%; right: 8%; bottom: 78px;
  text-align: center; font-size: 32px; color: var(--orange);
  text-shadow: 2px 2px 0 #0a0d0f, 0 0 10px rgba(255,154,60,0.35);
  opacity: 0; transition: opacity 140ms linear;
  pointer-events: none;
  z-index: 31;
}
.stage.panel-open .clue-bar { bottom: calc(var(--panel-h, 320px) + 24px); }
.clue-bar.on { opacity: 1; }

/* ------------------------------------------------------------- 决定面板 */
.panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--panel);
  border-top: 6px solid var(--line);
  box-shadow: 0 -6px 0 rgba(0,0,0,0.5), inset 0 3px 0 var(--panel-hi);
  transform: translateY(102%);
  transition: transform 320ms cubic-bezier(0.2, 0.9, 0.3, 1);
  z-index: 30;
}
.panel.on { transform: translateY(0); }
.panel.slim { transform: translateY(calc(100% - 45px)); }
.panel.slim .panel-body { opacity: 0; pointer-events: none; }

.panel-bar {
  position: relative;
  height: 45px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 15px;
  background: var(--panel-hi);
  border-bottom: 3px solid var(--line);
}
.panel-title { font-size: 16px; color: var(--orange); letter-spacing: 3px; }
.panel-timer {
  flex: 1; height: 12px;
  background: #12181b; border: 2px solid var(--line);
  opacity: 0;
}
.panel-timer.on { opacity: 1; }
.panel-timer-fill { height: 100%; width: 100%; background: var(--orange); }
.panel-timer.urgent .panel-timer-fill { background: var(--rust); animation: urgent 320ms steps(2) infinite; }
@keyframes urgent { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.35; } }
.bar-btn {
  font-family: inherit; font-size: 16px;
  padding: 3px 12px;
  background: var(--panel); color: var(--dim-text);
  border: 3px solid var(--line);
  cursor: pointer;
  flex: none;
}
.bar-btn:hover { color: var(--orange); background: #262f33; }
.bar-btn.active { color: #0d1114; background: var(--orange); border-color: var(--orange); }

.panel-body { padding: 18px 24px 21px; transition: opacity 200ms linear; }

/* 压缩面板：末帧主体偏下的段（M 的维克多近景）用，避免遮住脸和合约板 */
.panel.compact .panel-bar { height: 38px; }
.panel.compact .panel-body { padding: 10px 24px 12px; }
.panel.compact .panel-q { min-height: 0; margin-bottom: 8px; }
.panel.compact .tags { padding-top: 16px; gap: 18px; }
.panel.compact .tag { padding: 16px 15px 10px; width: 264px; }
.panel.compact .notes { margin-top: 8px; }
.panel.compact .panel-hint { margin-top: 6px; }
.panel-q {
  font-size: 32px; color: var(--text);
  min-height: 40px; margin-bottom: 15px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.6);
}
.panel-q .caret { color: var(--orange); animation: caret 400ms steps(2) infinite; }
@keyframes caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.tags { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; overflow: visible; padding-top: 24px; }

/* 价签：挂在细绳上的纸价签 */
.tag {
  position: relative;
  width: 288px;
  padding: 21px 15px 15px;
  background: var(--paper);
  color: var(--paper-dk);
  border: 3px solid #8d8467;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.55);
  cursor: pointer;
  transform: translateY(0);
  transition: transform 120ms ease-out, box-shadow 120ms ease-out;
  text-align: left;
  font-family: inherit;
  overflow: visible;
}
.tag::before {   /* 打孔 */
  content: ''; position: absolute; left: 50%; top: 7px;
  width: 12px; height: 12px; margin-left: -6px;
  background: var(--panel); border: 2px solid #8d8467; border-radius: 50%;
}
.tag::after {    /* 细绳 */
  content: ''; position: absolute; left: 50%; top: -24px;
  width: 3px; height: 24px; margin-left: -1px;
  background: var(--line);
}
.tag:hover { transform: translateY(-6px); box-shadow: 4px 10px 0 rgba(0,0,0,0.55); }
.tag-num {
  position: absolute; left: 9px; top: 6px;
  font-size: 16px; color: #6d6551;
}
.tag-ico { position: absolute; right: 9px; top: 6px; width: 16px; height: 16px; }
.tag-ico svg { width: 16px; height: 16px; display: block; }
.tag-name { font-size: 32px; line-height: 1.1; margin-bottom: 6px; }
.tag-hint { font-size: 16px; color: #55503f; }
.tag-cash {
  display: inline-block; margin-top: 9px;
  font-size: 16px; padding: 1px 6px;
  border: 2px solid currentColor;
}
.tag-cash.plus { color: #1c6b2c; }
.tag-cash.minus { color: #96301f; }
.tag.locked { background: #6f6d64; color: #3a382f; border-color: #55534c; cursor: not-allowed; }
.tag.locked:hover { transform: none; box-shadow: 4px 4px 0 rgba(0,0,0,0.55); }
.tag-lock { font-size: 16px; color: #2f2d27; margin-top: 9px; display: flex; align-items: center; gap: 6px; }
.lock-ico { width: 16px; height: 16px; display: inline-block; flex: none; }
.lock-ico svg { width: 16px; height: 16px; display: block; }
.tag .stamp {
  position: absolute; right: 12px; bottom: 12px;
  font-size: 48px; color: var(--stamp);
  border: 6px solid var(--stamp);
  padding: 0 9px;
  transform: rotate(-14deg) scale(2.4);
  opacity: 0;
  pointer-events: none;
}
.tag.stamped .stamp { animation: stampin 260ms cubic-bezier(0.2, 1.4, 0.4, 1) forwards; }
@keyframes stampin {
  0%   { opacity: 0; transform: rotate(-14deg) scale(2.4); }
  60%  { opacity: 0.95; transform: rotate(-14deg) scale(0.92); }
  100% { opacity: 0.95; transform: rotate(-14deg) scale(1); }
}

.notes { display: flex; gap: 12px; margin-top: 15px; flex-wrap: wrap; }
.note-btn {
  font-family: inherit; font-size: 16px;
  padding: 6px 12px;
  background: #262f33; color: var(--dim-text);
  border: 3px solid var(--line);
  cursor: pointer;
}
.note-btn:hover { color: var(--orange); border-color: var(--orange); }
.note-btn.active { color: #0d1114; background: var(--orange); border-color: var(--orange); }

.panel-hint { margin-top: 12px; font-size: 16px; color: var(--dim-text); }

/* ------------------------------------------------------------- 失败卡 */
.fail-card {
  position: absolute; left: 10%; right: 10%; top: 22%;
  text-align: center; display: none; z-index: 35;
}
.fail-card.on { display: block; }
.fail-en { font-size: 32px; color: var(--rust); letter-spacing: 6px; }
.fail-en.big { font-size: 48px; color: #f0e6df; letter-spacing: 8px;
  text-shadow: 3px 3px 0 var(--rust), 0 0 18px rgba(168,67,47,0.6); margin-bottom: 18px; }
.fail-zh { font-size: 48px; color: #f0e6df; text-shadow: 3px 3px 0 var(--rust), 0 0 18px rgba(168,67,47,0.6); margin: 6px 0 18px; }
.fail-text {
  font-size: 32px; color: var(--text); line-height: 1.4;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.7);
  max-width: 90%; margin: 0 auto;
}
.fail-continue { margin-top: 24px; font-size: 16px; color: var(--dim-text); }

/* ----------------------------------------------------------- 夜班账本 */
.ledger {
  position: absolute; inset: 0; z-index: 38;
  background: rgba(6, 9, 11, 0.88);
  display: none; align-items: center; justify-content: center;
}
.ledger.on { display: flex; }
/* 规格 8.7：左右两栏。左栏 = 标题 / 流水 / 结局 / 已收集结局和按钮；右栏 = 流程图。
   账本整体不出现滚动条，流水行数多时只在 .ledger-rows 内部滚动。 */
.ledger-book {
  width: 94%; max-width: 1760px; height: 94%;
  overflow: hidden;
  display: flex; align-items: stretch; gap: 22px;
  background: #20211c;
  border: 6px solid #4a4231;
  box-shadow: 0 0 0 3px #0a0e10, 8px 8px 0 rgba(0,0,0,0.6);
  padding: 15px 24px 15px;
  background-image:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0.10) 0 1px, rgba(0,0,0,0) 1px 4px);
}
.ledger-left {
  flex: 0 0 58%; min-width: 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.ledger-head { display: flex; align-items: center; gap: 15px; margin-bottom: 12px; flex: 0 0 auto; }
.ledger-title { font-size: 32px; color: var(--orange); letter-spacing: 4px; }
.ledger-rule { flex: 1; height: 3px; background: #4a4231; }
.ledger-cols { font-size: 16px; color: #8a7f63; border-bottom: 2px solid #4a4231; padding-bottom: 6px; flex: 0 0 auto; }
/* 流水区：占左栏剩余高度，超出只在这里面滚动 */
.ledger-rows { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 6px 0 12px; }
.lrow {
  display: grid; grid-template-columns: 56px 168px minmax(0, 1fr) 88px 88px;
  gap: 9px; font-size: 16px; color: #cfc6a8; padding: 1px 0;
  border-bottom: 1px solid rgba(74, 66, 49, 0.5);
}
.lrow > span { min-width: 0; overflow-wrap: anywhere; }
/* 失败行：划线只加在选项名上，「重来 / retry」放在划线之外，
   16px 位图字体的小字形被删除线穿过会糊成一团 */
.lrow.failed { color: #6e6552; }
.lrow.failed s { text-decoration: line-through; }
.lrow .retry {
  font-style: normal; margin-left: 8px; padding: 0 5px;
  border: 1px solid #4a4231; color: #8a7f63; white-space: nowrap;
}
.lrow .amt.plus { color: var(--led); }
.lrow .amt.minus { color: var(--rust); }
.ledger-end { border-top: 3px solid #4a4231; padding-top: 12px; margin-bottom: 12px; flex: 0 0 auto; }
.end-name { font-size: 32px; color: var(--crt); text-shadow: 0 0 10px rgba(255,197,61,0.35); }
.end-text { font-size: 16px; color: #d6cdb0; line-height: 1.5; margin-top: 6px; }
.end-extra { font-size: 16px; color: var(--orange); line-height: 1.5; margin-top: 6px; }
.end-extra:empty { display: none; }

/* 右栏：流程图按可用高度整体缩放，preserveAspectRatio=meet 保证 23 个节点完整可见 */
.ledger-graph {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; overflow: hidden;
  border-left: 3px solid #4a4231; padding-left: 20px;
}
.graph-head { display: flex; align-items: center; gap: 15px; font-size: 16px; color: #8a7f63; margin-bottom: 6px; flex: 0 0 auto; flex-wrap: wrap; }
.legend { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.legend b { font-weight: normal; color: #8a7f63; margin-right: 9px; }
.lg { width: 12px; height: 12px; display: inline-block; border: 2px solid #4a4231; }
.lg-now { background: var(--orange); border-color: var(--orange); }
.lg-past { background: #3d5257; border-color: #4a5c63; }
.lg-lock { background: #23241f; border-color: #4a4231; }
.graph-svg { flex: 1 1 auto; min-height: 0; width: 100%; height: 100%; display: block; }

.ledger-foot { border-top: 3px solid #4a4231; padding-top: 12px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; flex: 0 0 auto; }
.endings { display: flex; gap: 12px; align-items: center; font-size: 16px; color: #8a7f63; flex-wrap: wrap; }
.eslot { padding: 3px 9px; border: 2px solid #4a4231; color: #6e6552; }
.eslot.got { border-color: var(--orange); color: var(--orange); }
.btn-row { display: flex; gap: 15px; margin-left: auto; }

/* 窄视口（1366 / 1280）：把账本里的字号和按钮压一档，保证结局文案和按钮整行放得下 */
@media (max-width: 1500px), (max-height: 800px) {
  .ledger-book { gap: 16px; padding: 12px 16px; }
  .ledger-left { flex: 0 0 57%; }
  .ledger-graph { padding-left: 14px; }
  .ledger-title { font-size: 26px; letter-spacing: 2px; }
  .end-name { font-size: 26px; }
  .end-text, .end-extra { font-size: 15px; line-height: 1.4; }
  .ledger-cols { font-size: 14px; }
  .lrow { font-size: 15px; grid-template-columns: 52px 150px minmax(0, 1fr) 80px 80px; gap: 7px; }
  .graph-head { font-size: 14px; }
  .endings { font-size: 14px; gap: 9px; }
  .eslot { padding: 2px 7px; }
  .ledger-foot { gap: 12px; padding-top: 9px; }
  .ledger-foot .dev-btn { font-size: 22px; padding: 6px 14px; }
}
@media (max-width: 1360px) {
  .lrow { font-size: 14px; grid-template-columns: 48px 132px minmax(0, 1fr) 72px 72px; gap: 6px; }
  .ledger-foot .dev-btn { font-size: 20px; padding: 5px 11px; }
  .end-name { font-size: 24px; }
}

/* ------------------------------------------------------------- 通用按钮 */
.dev-btn {
  font-family: inherit; font-size: 32px;
  padding: 9px 24px;
  background: var(--panel); color: var(--text);
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.55);
  cursor: pointer;
}
.dev-btn:hover { background: var(--panel-hi); color: var(--orange); border-color: var(--orange); }
.dev-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(0,0,0,0.55); }
.dev-btn.major { color: var(--orange); border-color: var(--orange); }
.dev-btn.small { font-size: 16px; padding: 6px 12px; }

/* --------------------------------------------------------------- 覆盖层 */
.overlay {
  position: absolute; inset: 0; z-index: 45;
  display: none; align-items: center; justify-content: center;
  background: rgba(6, 9, 11, 0.92);
}
.overlay.show { display: flex; }
.overlay.title { background: rgba(6, 9, 11, 0.72); }

.title-wrap { text-align: center; }
.neon-sign { position: relative; width: 96px; height: 72px; margin: 0 auto 18px; }
.ns-gear {
  position: absolute; left: 24px; top: 24px; width: 48px; height: 48px;
  border: 6px solid var(--orange); border-radius: 50%;
  box-shadow: 0 0 14px rgba(255,154,60,0.75), inset 0 0 10px rgba(255,154,60,0.5);
  animation: neonflick 5s steps(1) infinite;
}
.ns-hand {
  position: absolute; left: 6px; top: 42px; width: 84px; height: 24px;
  border: 6px solid var(--orange); border-top: none;
  border-radius: 0 0 42px 42px;
  box-shadow: 0 0 14px rgba(255,154,60,0.6);
  animation: neonflick 5s steps(1) infinite;
}
@keyframes neonflick {
  0%, 42%, 46%, 100% { opacity: 1; }
  44%, 45% { opacity: 0.35; }
}
.game-title {
  font-size: 48px; font-weight: normal; letter-spacing: 12px;
  color: #f0f4f2;
  text-shadow: 0 0 18px rgba(226, 95, 191, 0.35), 4px 4px 0 #0a0e10;
}
.game-sub { font-size: 16px; color: var(--dim-text); letter-spacing: 3px; margin-top: 9px; }
.title-orn { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 24px 0; }
.title-orn i { width: 96px; height: 3px; background: var(--line); }
.title-orn b { width: 12px; height: 12px; background: var(--orange); transform: rotate(45deg); }
.title-enter { font-size: 16px; color: var(--dim-text); margin-top: 15px; }
.title-foot { margin-top: 30px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.title-endings { font-size: 16px; color: var(--crt); }

.pause-box {
  width: 480px;
  background: var(--panel);
  border: 6px solid var(--line);
  box-shadow: 0 0 0 3px #0a0e10, 8px 8px 0 rgba(0,0,0,0.6);
}
.pause-body { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.pause-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.pause-label { font-size: 16px; color: var(--dim-text); letter-spacing: 2px; }
.vol { width: 180px; accent-color: var(--orange); }

/* ------------------------------------------------------------- 调试条 */
.debug-bar {
  position: absolute; left: 0; right: 0; top: 0; z-index: 60;
  display: none; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 6px 9px;
  background: rgba(6, 9, 11, 0.9);
  border-bottom: 2px solid var(--pink);
  font-size: 16px; color: var(--pink);
}
.debug-bar.on { display: flex; }
.dbg-title { letter-spacing: 2px; }
.dbg-sel, .dbg-num {
  font-family: inherit; font-size: 16px;
  background: #12181b; color: var(--text);
  border: 2px solid var(--line); padding: 1px 3px;
}
.dbg-num { width: 84px; }
.dbg-btn {
  font-family: inherit; font-size: 16px;
  background: var(--panel); color: var(--pink);
  border: 2px solid var(--pink); padding: 1px 9px; cursor: pointer;
}
.dbg-btn:hover { background: var(--pink); color: #0d1114; }
.dbg-sep { width: 2px; height: 18px; background: var(--line); }
.dbg-state { color: var(--dim-text); margin-left: auto; }

/* 隐藏系统光标（观察模式用自绘鉴定镜） */
.stage.inspecting, .stage.inspecting * { cursor: none !important; }
