/* ============================================================
   深夜便利店 · 原型样式
   零美术资产：扁平色块 + 几何图形 + 中文排版
   动效预算（硬约束）：① 整屏色调缓变 ② 图标抖动/呼吸 ③ 单行日志滚动 ④ 克制触控反馈
   ============================================================ */

/* ── 三态色板 ───────────────────────────────────────────── */
:root {
  --bg-base: #0A1020;
  --surface-1: #121A2C;
  --surface-2: #1A2438;
  --surface-3: #233048;
  --border: #2C3A54;
  --border-sel: #42557A;

  --text-1: #EAF2FF;
  --text-2: #B9C7DC;
  --text-3: #8FA3BF;
  --text-4: #6E8BB0;

  --warm-hot: #FF8A3D;
  --warm-cash: #FFC24B;
  --warm-2: #FF6B35;

  --ok: #4ADE80;
  --bad: #FF5A5F;
  --warn: #FFA726;

  --lamp: 1;            /* 灯箱条亮度系数 */
  --mood-ms: 1500ms;    /* 整屏色调缓变时长 */

  /* ── 纵向空间分配（设计稿 375×667，与 design/02-设计令牌.json 的 A/B/C 区对齐）────
       这一组变量是整屏纵向布局的唯一真相源：改这里，全屏随之移动。
       不要在任何规则里再写死这些数值（除 --floor-y 已含 667 基准）。

       A 区   0 –  92   只读 HUD：夜钟/现金/口碑（0–64）+ 库存水位条（88–92，兼 A/B 分隔线）
       B 区  92 – 527   店内场景区（本区三层，从后到前）：
              ├  64–310   背景陈设（store.png 画面内容；img 顶对齐于 y=64，内容高 246）
              ├ 310–527   近景地板（CSS 绘制，压在底图黑边/水印之上）
              ├ 脚底线 430 店员 / 收银台 / 顾客队列共用同一条脚底线（"脚踩地板"）
              └ 451–499   日志带（距屏底 168–216，规格不变，叠在近景地板上）
       C 区 527 – 667   货架拇指热区（140 = 令牌 C 区上限，2×3 格仍远超 44dp 命中线）
       ────────────────────────────────────────────────────────────────────── */
  --scene-top: 92px;        /* B 区上边界（A/B 分隔线 = 库存条下沿） */
  --scene-bottom: 140px;    /* B 区下边界 = 货架热区高度 */
  --shelf-h: 140px;         /* C 区高度 */
  --store-top: 64px;        /* 背景陈设 img 的顶边（压在库存条之下，避免顶部接缝） */
  --img-h: calc(667px - var(--floor-y) - var(--store-top));
                            /* 底图可见高度：从场景顶(y=64)铺到脚线(y=430)，木地板正好落在角色脚下 */
  --floor-y: 237px;         /* 场景脚底线距屏底 = 667 − 430；#clerk/#counter 直接用 */
  --log-h: 48px;            /* 日志带高（2 行 ×24） */
  --log-bottom: 168px;      /* 日志带底边距屏底（令牌 topFromBottom 168） */
  --counter-h: 30px;        /* 收银台台体高（自脚底线向上，实心到地） */
}

/* 醉潮：bg → #1A0B12（1.5s），text → #FFEDF1，accent/red #FF4D5E，灯箱 60% */
#stage[data-mood="drunk"] {
  --bg-base: #1A0B12;
  --surface-1: #24101C;
  --surface-2: #2E1526;
  --surface-3: #3A1B31;
  --border: #46202F;
  --border-sel: #6B2F42;
  --text-1: #FFEDF1;
  --text-2: #E3B9C4;
  --text-3: #B98392;
  --text-4: #8E5A68;
  --bad: #FF4D5E;
  --lamp: 0.6;
  --mood-ms: 1500ms;
}

/* 凌晨静：bg → #080A0E（2.0s），暖色与功能色全禁，唯一色彩 #6E8BB0 */
#stage[data-mood="hush"] {
  --bg-base: #080A0E;
  --surface-1: #0E1219;
  --surface-2: #141A24;
  --surface-3: #1B2331;
  --border: #1E2735;
  --border-sel: #33404F;
  --text-1: #C7D2E0;
  --text-2: #8FA3BF;
  --text-3: #6E8BB0;
  --text-4: #56687F;
  --warm-hot: #6E8BB0;
  --warm-cash: #6E8BB0;
  --warm-2: #6E8BB0;
  --ok: #6E8BB0;
  --bad: #6E8BB0;
  --warn: #6E8BB0;
  --lamp: 0.35;
  --mood-ms: 2000ms;
}

/* ── 基础 ──────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #05070E;
  font-family: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text-1);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

#viewport { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }

#stage {
  position: relative;
  width: 375px;            /* 设计基准 375×667 */
  height: 667px;
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--bg-base);
  color: var(--text-1);
  transform-origin: center center;
  transition: background-color var(--mood-ms) ease, color var(--mood-ms) ease;
}

/* ── HUD（只读上半屏） ──────────────────────────────────── */
#hud { position: absolute; top: 0; left: 0; right: 0; height: 64px; padding: 10px 14px 0; z-index: 60; }
.hud-row { display: flex; align-items: flex-start; gap: 10px; }
.metric { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.metric-label { font-size: 10px; letter-spacing: .08em; color: var(--text-4); }
.metric-value { font-size: 19px; font-weight: 600; line-height: 22px; color: var(--text-1); }
#v-cash { color: var(--warm-cash); }
#v-rep { color: var(--text-1); }
.metric-clock { text-align: right; }
.metric-clock .metric-value { color: var(--text-2); }
.metric-value.flash-up { animation: bump 260ms ease; }
.metric-value.flash-down { animation: bump 260ms ease; }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.13); } 100% { transform: scale(1); } }

.rep-track { margin-top: 8px; height: 3px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.rep-track > i { display: block; height: 100%; width: 50%; background: var(--ok); transition: width 400ms ease, background-color var(--mood-ms) ease; }

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ── 侧视场景：顾客作为像素立绘站在店里 ───────────────── */
/* #queue 的「下边界」就是地面线：.cust 以 bottom:0 站在这里，脚踩地板。
   这样队列容器与店员/收银台共用同一条 --floor-y 脚底线，不再各写一套魔数。 */
#queue { position: absolute; top: var(--scene-top); left: 0; right: 0; bottom: var(--floor-y); z-index: 10; pointer-events: none; }

.cust {
  position: absolute; width: 64px; height: 92px; bottom: 0;
  transform-origin: bottom center;
  transform: scale(var(--s, 1));
  transition: left 260ms cubic-bezier(.22,.61,.36,1), bottom 260ms cubic-bezier(.22,.61,.36,1),
              opacity 260ms ease, transform 260ms ease, border-color 200ms ease;
  will-change: left, transform, opacity;
}
.cust .sprite {
  width: 100%; height: 100%; display: block; object-fit: contain;
  image-rendering: pixelated; image-rendering: crisp-edges;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,.35));
  transition: filter 200ms ease;
}
.cust.at-counter .sprite { filter: drop-shadow(0 0 7px rgba(255,194,75,.95)); }
.cust.is-target .sprite { outline: 2px solid var(--ok); outline-offset: 2px; border-radius: 4px; }
.cust.leaving { transform: translateY(26px) scale(var(--s,1)); opacity: 0; }
.cust.leaving .sprite { filter: grayscale(1) drop-shadow(0 3px 0 rgba(0,0,0,.35)); }
.cust.done { animation: served 260ms ease; }
@keyframes served { 0% { transform: scale(var(--s,1)); } 40% { transform: scale(calc(var(--s,1) * 1.05)); } 100% { transform: scale(var(--s,1)); } }
.cust.shake { animation: shake 220ms ease; }
@keyframes shake { 0%,100% { transform: translateX(0) scale(var(--s,1)); } 25% { transform: translateX(-4px) scale(var(--s,1)); } 75% { transform: translateX(4px) scale(var(--s,1)); } }

/* 头顶需求气泡 + 耐心条（不拦截拖拽命中） */
.cust .bubble {
  position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%);
  margin-bottom: 4px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  pointer-events: none;
}
.bubble-need {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 2px 7px; box-shadow: 0 2px 6px rgba(0,0,0,.45);
}
.bubble-icon {
  width: 18px; height: 18px; flex: 0 0 18px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #0A1020; background: var(--c);
}
.bubble-name { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.patience { width: 46px; height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.patience > i { display: block; height: 100%; width: 100%; background: #4ADE80; transition: background-color 200ms linear; }
.patience-sec { display: none; }

/* ── 店内背景：AI 生成像素风便利店剖面（侧视场景底图） ── */
/* store-scene.png（430×462）＝原底图裁掉右侧"烤死的收银机"与底部暗边后的左半幅。
   img 用 cover + 底部对齐：从场景顶铺到脚线（--img-h=366），横向裁掉少量天花板，
   图里自带的木地板正好收在角色脚线（y=430）上；其下由 ::after 接一段同色木纹近景。 */
#store { position: absolute; top: var(--store-top); left: 0; right: 0; bottom: var(--scene-bottom); z-index: 1; pointer-events: none; overflow: hidden; }
.store-bg {
  position: absolute; top: 0; left: 0; width: 100%; height: var(--img-h);
  object-fit: cover; object-position: center bottom; display: block;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
/* 近景地板：从脚线铺到 B 区底（y=527，约 97px）。
   不再手绘渐变（与像素底图质感断裂）：用底图自身地板条做的镜像平铺贴片
   assets/floor-near.png（375×97，首行=底图最后一行，接缝无痕），
   上面只叠 ① 贴缝接触阴影 ② 向下压暗的纵深渐变。 */
#store::after {
  content: ''; position: absolute; left: 0; right: 0;
  top: var(--img-h); bottom: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(28,17,10,.30) 0, rgba(28,17,10,0) 22%),
    linear-gradient(to bottom, rgba(24,15,9,0) 40%, rgba(24,15,9,.42) 100%),
    url('../assets/floor-near.png') top center / 100% 100% no-repeat;
}

/* ── 店员（你）常驻收银台 ───────────────────────────── */
/* 与顾客、收银台共用 --floor-y 脚底线；收银台（z9）压在店员（z8）身前下半身，
   于是"店员站在台后、只露上半身"——正是收银位的读法。 */
#clerk { position: absolute; left: 14px; bottom: var(--floor-y); width: 70px; z-index: 8; pointer-events: none; transform-origin: bottom left; transition: transform 2000ms ease, opacity 2000ms ease; }
.clerk-sprite { width: 100%; height: auto; display: block; image-rendering: pixelated; image-rendering: crisp-edges; filter: drop-shadow(0 3px 0 rgba(0,0,0,.35)); }
#clerk.lean { transform: rotate(-9deg) translateX(-6px); opacity: .6; }
/* "你"角标：挪到头顶（原来在脚下会被收银台和近景地板吃掉） */
.clerk-badge {
  position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); margin-bottom: 2px;
  padding: 1px 6px; border-radius: 999px; white-space: nowrap;
  background: rgba(10,16,32,.78); border: 1px solid var(--border);
  font-size: 10px; line-height: 14px; color: var(--warm-cash);
}

/* 收银台：实心台体，自脚底线向上、一直落到地板（店员站台后，台体挡住其下半身）。
   高度 = 30（约店员身高 30%），既读得出"台面"，又让店员露出七成身子。 */
#counter {
  position: absolute; left: 4px; bottom: var(--floor-y); width: 100px; height: var(--counter-h);
  z-index: 9; pointer-events: none; border-radius: 2px 2px 3px 3px;
  background:
    linear-gradient(to bottom, #C08F5C 0 1px, #8A6034 1px 5px, rgba(138,96,52,0) 5px),    /* 木质台面 */
    linear-gradient(to bottom, #46331F 0%, #33251A 44%, #1E1720 100%);
  border: 1px solid #241B16;
  box-shadow: 0 9px 18px rgba(0,0,0,.62), 0 0 0 1px rgba(255,196,140,.16) inset;
}

/* ── 四态染色叠加层（生成图不参与 CSS 变量色变，用叠层统一染色） ── */
#mood-wash { position: absolute; inset: 0; z-index: 15; pointer-events: none; mix-blend-mode: multiply; opacity: 0; background: transparent; transition: background-color var(--mood-ms) ease, opacity var(--mood-ms) ease; }
#stage[data-mood="drunk"] #mood-wash { background: #FF3B30; opacity: .42; }
#stage[data-mood="hush"]  #mood-wash { background: #0A1430; opacity: .60; }
#stage[data-mood="normal"] #mood-wash { opacity: 0; }

/* ── 日志行（距屏底 168–216dp） ────────────────────────── */
#loglines { position: absolute; left: 14px; right: 14px; bottom: var(--log-bottom); height: var(--log-h); overflow: hidden; z-index: 40; }
.logline {
  position: absolute; left: 0; right: 0; height: 24px;
  display: flex; align-items: center; gap: 6px;
  font-size: 16px; line-height: 24px; color: var(--text-2);
  white-space: nowrap;
}
.logline .ts { font-size: 11px; color: var(--text-4); flex: 0 0 auto; }
.logline .ico { width: 12px; height: 12px; flex: 0 0 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; line-height: 1; }
.logline .txt { font-size: 16px; line-height: 24px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.logline.ok .ico { color: var(--ok); }
.logline.bad .ico { color: var(--bad); }
.logline.warn .ico { color: var(--warn); }
.logline.info .ico { color: var(--text-4); }
.logline.cash .ico { color: var(--warm-cash); }

/* ── 货架（拇指热区，屏幕下 1/3） ─────────────────────── */
/* C 区高 140（设计令牌 [96,140] 上限）：2 行 × 55 + 8 gap + 上下内边距 = 140。
   每格 109×55，仍远超 44dp 命中线；行高收紧后内容按 20/2 紧凑排布。 */
#shelf { position: absolute; left: 0; right: 0; bottom: 0; height: var(--shelf-h); padding: 8px 14px 14px; background: linear-gradient(to bottom, transparent, var(--surface-1) 26%); z-index: 50; }
.shelf-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 55px; gap: 8px; height: 100%; }
/* C 区 gondola 化（美术 E4）：格子尺寸/网格/data-cat/指针事件一律不变，只改格子内部，
   拖拽命中依赖 .shelf-item 的 getBoundingClientRect，故此处绝不改尺寸与外边距。 */
.shelf-item {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 2px; padding: 4px 0 0;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2);
  overflow: hidden;
  transition: transform 120ms ease, border-color 160ms ease, background-color var(--mood-ms) ease;
  cursor: grab;
}
/* ① 商品簇 44×24：纯 CSS 占位（色块组 + 底部投影 + 顶部高光），等 prod-*.png 生成后替换 */
.shelf-item .goods {
  width: 44px; height: 24px; border-radius: 2px; flex: none;
  background: repeating-linear-gradient(90deg, var(--c) 0 9px, rgba(0,0,0,.30) 9px 11px);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.34), inset 0 2px 0 rgba(255,255,255,.20);
}
/* ② 价签行：● 品类色点 8px + 名称 + 数量签（有货黄签 / 缺货灰签「空」）
   单行铁律：名称过长（如「热食关东煮」）省略号截断，绝不换行——
   换行会把 55px 的格子撑爆、被 overflow:hidden 裁掉半截。 */
.shelf-item .tag { display: flex; align-items: center; gap: 4px; max-width: 100%; white-space: nowrap; }
.shelf-item .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--c); flex: none; }
.shelf-item .nm { font-size: 11px; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.shelf-item .st {
  font-size: 10px; font-weight: 600; padding: 0 4px; border-radius: 3px; flex: none;
  background: var(--warm-cash); color: #0A1020;
}
/* ③ 层板：格底 6dp 木色 + 顶边 1dp 亮线 */
.shelf-item .board {
  position: absolute; left: 2px; right: 2px; bottom: 2px; height: 6px; border-radius: 2px;
  background: linear-gradient(to bottom, #5E4A38, #4A3B2E);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
}
.shelf-item.pressed { transform: scale(.94); border-color: var(--border-sel); }
/* 缺货不再整格变淡：改由「商品簇变淡 + 数量签转灰签」表达，可读性更好 */
.shelf-item.out .goods { opacity: .38; }
.shelf-item.out .st { background: var(--border); color: var(--text-4); }
/* 缺货提醒的呼吸动画改挂商品簇（原挂整格） */
.shelf-item.breath .goods { animation: breath 2.4s ease-in-out infinite; }
@keyframes breath { 0%,100% { opacity: 1; } 50% { opacity: .72; } }

/* ── 拖拽 ghost ──────────────────────────────────────── */
#drag-layer { position: absolute; inset: 0; pointer-events: none; z-index: 70; }
.ghost {
  position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-radius: 8px; background: var(--c); color: #0A1020;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  box-shadow: 0 0 0 2px rgba(255,255,255,.18);
  opacity: .95;
}

/* ── 覆盖层：事件卡 / 结算 / 回来时卡 ──────────────────── */
#overlay { position: absolute; inset: 0; z-index: 80; display: none; }
#overlay.on { display: block; }
.scrim { position: absolute; inset: 0; background: rgba(5,8,16,.72); animation: fadein 200ms ease; }

.panel {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; max-height: 560px; overflow: auto;
  animation: rise 240ms cubic-bezier(.22,.61,.36,1);
}
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.panel h2 { font-size: 16px; line-height: 22px; color: var(--text-1); font-weight: 600; }
.panel .body { margin-top: 6px; font-size: 13px; line-height: 20px; color: var(--text-2); white-space: pre-line; }
.panel .sub { margin-top: 8px; font-size: 11px; color: var(--text-4); }
.opts { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.opt {
  text-align: left; width: 100%; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-3);
  color: var(--text-1); font-size: 13px; line-height: 18px; font-family: inherit;
  transition: transform 110ms ease, border-color 140ms ease;
}
.opt:active { transform: scale(.98); border-color: var(--border-sel); }
.opt .opt-eff { display: block; margin-top: 3px; font-size: 11px; color: var(--text-4); }

.stat-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 10px; padding: 3px 7px; border-radius: 4px; border: 1px solid var(--border); color: var(--text-3); }
.tag.hot { color: var(--warm-hot); border-color: var(--warm-hot); }

/* 结算三段式 */
.bill { margin-top: 10px; }
.bill-row { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--border); }
.bill-row .k { font-size: 12px; color: var(--text-3); }
.bill-row .v { font-size: 16px; font-weight: 600; }
.bill-row .v.up { color: var(--ok); }
.bill-row .v.down { color: var(--bad); }
.bill-row.net .v { font-size: 21px; color: var(--warm-cash); }

.highlights { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.hl { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-3); }
.hl .hl-ico { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; background: var(--surface-1); }
.hl .hl-txt { font-size: 13px; line-height: 18px; color: var(--text-2); }

.monologue { margin-top: 12px; padding: 10px; border-left: 2px solid var(--border-sel); font-size: 13px; line-height: 20px; color: var(--text-2); }
.hook { margin-top: 8px; font-size: 11px; color: var(--text-4); }

.btn-primary {
  margin-top: 14px; width: 100%; min-height: 48px;
  border: 0; border-radius: 8px; background: var(--warm-cash); color: #0A1020;
  font-size: 14px; font-weight: 600; font-family: inherit;
  transition: transform 110ms ease;
}
.btn-primary:active { transform: scale(.98); }
.btn-ghost {
  margin-top: 8px; width: 100%; min-height: 40px;
  border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text-3);
  font-size: 12px; font-family: inherit;
}

/* 回来时卡 */
.snapshot { margin-top: 10px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.snap-cell { padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-3); }
.snap-cell .k { font-size: 10px; color: var(--text-4); }
.snap-cell .v { font-size: 15px; font-weight: 600; margin-top: 2px; }

/* 补货面板（方案 B：每夜开店前分配补货金） */
.rk-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.rk-row {
  display: grid; grid-template-columns: 20px 1fr auto auto auto;
  align-items: center; gap: 8px;
  padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
}
.rk-ico {
  width: 20px; height: 20px; border-radius: 4px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: #0A1020; background: var(--c, var(--border-sel));
}
.rk-name { font-size: 12px; color: var(--text-1); }
.rk-stock { font-size: 11px; color: var(--text-3); }
.rk-stock .cur { font-style: normal; font-weight: 600; color: var(--text-2); }
.rk-cost { font-size: 11px; color: var(--text-4); }
.rk-step { display: flex; align-items: center; gap: 6px; }
.rk-btn {
  width: 22px; height: 22px; line-height: 1;
  border: 1px solid var(--border); border-radius: 5px;
  background: var(--surface-3); color: var(--text-2);
  font-size: 13px; font-family: inherit; cursor: pointer;
}
.rk-btn:active { transform: scale(.94); }
.rk-btn:disabled { opacity: .35; cursor: default; }
.rk-n { min-width: 18px; text-align: center; font-size: 13px; font-weight: 600; color: var(--text-1); }

/* ── 调试面板（常驻） ─────────────────────────────────── */
#debug {
  position: absolute; right: 8px; top: 72px; z-index: 90;
  max-width: 190px;
  font-size: 10px; line-height: 14px; color: var(--text-3);
  background: rgba(10,16,32,.82); border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 8px; font-variant-numeric: tabular-nums;
}
#debug.collapsed #debug-body { display: none; }
#debug .dbg-head { display: flex; justify-content: space-between; gap: 8px; cursor: pointer; color: var(--text-4); }
#debug .dbg-row { display: flex; justify-content: space-between; gap: 10px; }
#debug .dbg-row b { font-weight: 600; color: var(--text-2); }
#debug .dbg-btns { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
#debug button { font-size: 10px; padding: 3px 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-3); border-radius: 4px; font-family: inherit; cursor: pointer; }

/* ── 无障碍 / 降级 ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
