/* 明场 · 第七号湿片
 * style.css —— 界面。底子是明场的白视野：亮底、材质本色、靠阴影与染色拉开层次。
 * 所有动效由 JS 的补间登记表驱动；这里只写「长什么样」，不写「怎么动」。
 */

:root {
  --paper:    #FBF7EE;
  --slide:    #EFE7D8;
  --slide-2:  #E3D9C6;
  --ink:      #2A2320;
  --ink-2:    #6B5F56;
  --ink-3:    #9A8C80;
  --dye:      #7A4B9E;
  --dye-soft: rgba(122, 75, 158, 0.14);
  --blue:     #3F6E86;
  --fix:      #3A8A7C;
  --amber:    #B98A2E;
  --danger:   #B33A2E;
  --line:     rgba(42, 35, 32, 0.16);
  --line-2:   rgba(42, 35, 32, 0.08);
  --shadow:   0 1px 0 rgba(255,255,255,0.7), 0 6px 18px rgba(60,48,38,0.13);
  --shadow-sm:0 1px 0 rgba(255,255,255,0.6), 0 2px 6px rgba(60,48,38,0.10);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* hidden 必须真的藏住 —— 否则 display:flex 会把 hidden 顶掉 */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--slide);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.5;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
  -webkit-text-size-adjust: 100%;
}

body { position: fixed; inset: 0; }

#stage { position: absolute; inset: 0; overflow: hidden; }

#view { position: absolute; inset: 0; display: block; touch-action: none; }

/* 数字一律等宽，读起来像仪表 */
.gauge-num, #barFundNum, #collectNum, #clockNum, .gear-cost, .ach-reward, .mono {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
}

/* ============================ 顶栏 ============================ */
.bar {
  position: absolute; z-index: 30;
  top: 0; left: 0; right: 0;
  padding: calc(var(--safe-t) + 8px) calc(10px + var(--safe-r)) 8px calc(10px + var(--safe-l));
  display: flex; align-items: center; gap: 8px;
  transition: none;
}
.bar-back, .bar-sound, .bar-fund {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.66);
  border-radius: 999px;
  min-height: 34px;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 0 10px;
}
.bar-back { cursor: pointer; font-size: 12px; letter-spacing: 0.02em; }
.bar-back-ico {
  width: 9px; height: 9px; border-left: 1.6px solid var(--ink); border-bottom: 1.6px solid var(--ink);
  transform: rotate(45deg); margin-left: 2px; border-radius: 1px;
}
.bar-mid { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.bar-piece { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.bar-sep { width: 1px; height: 12px; background: var(--line); }
.bar-focus { font-size: 12px; color: var(--dye); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-right { display: flex; align-items: center; gap: 6px; }
.bar-fund { font-size: 12px; gap: 5px; }
.bar-fund em { font-style: normal; color: var(--ink-3); font-size: 11px; }
.fund-mark {
  width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #FFE9B0, #C79A3C);
  box-shadow: inset 0 0 0 1px rgba(90,64,24,0.4);
}
.bar-sound { width: 34px; justify-content: center; cursor: pointer; padding: 0; }
.snd-on, .snd-off { width: 12px; height: 12px; position: relative; display: block; }
.snd-on::before {
  content: ''; position: absolute; left: 0; top: 3px; width: 3px; height: 6px;
  background: var(--ink); border-radius: 1px;
}
.snd-on::after {
  content: ''; position: absolute; left: 3px; top: 1px;
  border-left: 5px solid var(--ink); border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
.bar-sound.is-off .snd-on::before { background: var(--ink-3); }
.bar-sound.is-off .snd-on::after { border-left-color: var(--ink-3); }
.bar-sound.is-off::after {
  content: ''; position: absolute; width: 16px; height: 1.5px; background: var(--danger);
  transform: rotate(-45deg); border-radius: 2px;
}
.bar-sound { position: relative; }

/* ============================ 页面 ============================ */
/* 页面容器不吃触摸：由「当前这一页」自己决定哪里可点。
   下面的画布要能接住手指 —— 它才是载玻片。 */
#pages { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.page {
  position: absolute; inset: 0;
  padding: calc(var(--safe-t) + 54px) calc(16px + var(--safe-r)) calc(14px + var(--safe-b)) calc(16px + var(--safe-l));
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; pointer-events: none;
  will-change: transform, opacity;
}
.page.is-live { opacity: 1; visibility: visible; pointer-events: auto; }

.page-title {
  font-size: 19px; letter-spacing: 0.04em; margin: 2px 0 2px;
  font-weight: 600;
}
.page-lede { font-size: 12.5px; color: var(--ink-2); margin: 0 0 12px; }

/* -------------------------- ① 工作台 -------------------------- */
.bench-head { margin-bottom: 10px; }
.bench-title {
  font-size: 25px; line-height: 1.15; margin: 0 0 4px; font-weight: 600; letter-spacing: 0.06em;
}
.bench-title em { font-style: normal; color: var(--dye); padding: 0 2px; }
.bench-sub { font-size: 12.5px; color: var(--ink-2); margin: 0; }

.rack-strip {
  display: flex; gap: 5px; align-items: flex-end;
  padding: 10px 0 8px;
  overflow: visible;
}
.slide-chip {
  flex: 1 1 0; min-width: 0;
  position: relative;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: 4px 4px 6px 6px;
  background: linear-gradient(155deg, rgba(255,255,255,0.92), rgba(238,230,214,0.86));
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  padding: 4px 2px 3px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  transform-origin: 50% 100%;
}
.slide-chip.is-locked { cursor: default; opacity: 0.5; filter: saturate(0.5); }
.slide-chip.is-current { border-color: var(--dye); box-shadow: 0 0 0 1px var(--dye), var(--shadow); }
.slide-chip-num { font-size: 10px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
/* 片子上真实的染色痕：做过几星，就染到什么程度 */
.slide-stain {
  position: absolute; left: 12%; right: 12%; top: 22%; bottom: 30%;
  border-radius: 50% 42% 48% 44%;
  background: radial-gradient(circle at 38% 34%, rgba(122,75,158,0.5), rgba(122,75,158,0.18) 62%, rgba(122,75,158,0) 100%);
  opacity: 0;
}
.slide-chip[data-stars="1"] .slide-stain { opacity: 0.42; }
.slide-chip[data-stars="2"] .slide-stain { opacity: 0.7; }
.slide-chip[data-stars="3"] .slide-stain { opacity: 1; }
.slide-chip .stars { display: flex; gap: 1px; margin-bottom: 3px; }
.slide-chip .stars i {
  width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); opacity: 0.35;
}
.slide-chip .stars i.on { background: var(--amber); opacity: 1; }
.slide-chip.is-current .chip-ring {
  position: absolute; inset: -4px; border-radius: 8px;
  border: 1px dashed rgba(122,75,158,0.5);
}

.bench-card {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.72);
  box-shadow: var(--shadow);
  padding: 12px 13px 13px;
}
.bench-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.piece-name { font-size: 16px; font-weight: 600; letter-spacing: 0.03em; }
.piece-stars { display: flex; gap: 3px; }
.piece-stars i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--slide-2); box-shadow: inset 0 0 0 1px var(--line);
}
.piece-stars i.on { background: radial-gradient(circle at 34% 30%, #FFE9B0, #C79A3C); }
.piece-note { font-size: 12.5px; color: var(--ink-2); margin: 6px 0 11px; }
.bench-card-btns { display: flex; gap: 8px; }

.knob {
  appearance: none; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(238,232,220,0.9));
  color: var(--ink);
  border-radius: 11px;
  min-height: 48px; min-width: 48px;
  padding: 0 16px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.04em;
  box-shadow: var(--shadow-sm);
  cursor: pointer; position: relative;
  font-family: inherit;
}
.knob:active { transform: translateY(1px); }
.knob-lg { flex: 1.4; background: linear-gradient(180deg, #FFFFFF, #F0E7F4 70%, #E4D6EC); border-color: rgba(122,75,158,0.45); }
.knob-ghost { flex: 1; color: var(--ink-2); }
.knob-sm { min-height: 42px; font-size: 12.5px; padding: 0 13px; }
.knob-buy { min-height: 44px; padding: 0 14px; font-size: 13px; }
.knob-on { background: linear-gradient(180deg, #6C9152, #4E7038); color: #FFFDF6; border-color: rgba(40,60,25,0.4); }
.knob[disabled] { opacity: 0.45; cursor: default; }
.knob-free { border-color: rgba(58,138,124,0.55); background: linear-gradient(180deg, #FFFFFF, #E6F2EE); }
.knob-ad { border-color: var(--line); background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(240,235,226,0.88)); color: var(--ink-2); }
.knob-ad .ad-tag { color: var(--ink-3); font-size: 11px; font-weight: 400; margin-left: 4px; }

.bench-event {
  margin-top: 9px; display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--dye);
  border: 1px dashed rgba(122,75,158,0.45);
  background: rgba(122,75,158,0.06);
  border-radius: 10px; padding: 7px 10px;
}
.ev-mark { width: 7px; height: 7px; border-radius: 50%; background: var(--dye); flex: 0 0 auto; }

.bench-nav { margin-top: auto; display: flex; gap: 8px; padding-top: 12px; }
.nav-item {
  flex: 1; min-height: 62px;
  border: 1px solid var(--line); border-radius: 13px;
  background: rgba(255,255,255,0.6);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  font-size: 12px; color: var(--ink-2); cursor: pointer; font-family: inherit;
}
.nav-item:active { transform: translateY(1px); }
.ni { width: 16px; height: 16px; position: relative; }
.ni-rack::before {
  content: ''; position: absolute; inset: 3px 0 1px;
  border: 1.5px solid var(--dye); border-radius: 2px;
  box-shadow: inset 0 -4px 0 -2.4px var(--dye);
}
.ni-ledger::before {
  content: ''; position: absolute; inset: 1px 1px 0 1px;
  border: 1.5px solid var(--blue); border-radius: 2px 4px 2px 2px;
}
.ni-ledger::after {
  content: ''; position: absolute; left: 4px; right: 4px; top: 5px; height: 1.3px;
  background: var(--blue); box-shadow: 0 3px 0 var(--blue), 0 6px 0 var(--blue);
}
.ni-manual::before {
  content: ''; position: absolute; inset: 0 2px; border: 1.5px solid var(--ink-2); border-radius: 2px;
}
.ni-manual::after {
  content: ''; position: absolute; left: 5px; right: 5px; top: 6px; height: 1.3px;
  background: var(--ink-2); box-shadow: 0 3.5px 0 var(--ink-2);
}

/* -------------------------- ② 观察页 -------------------------- */
.page-slide { padding-left: 0; padding-right: 0; justify-content: flex-start; }
/* 观察页是「仪表盘」：整页不吃触摸，只有仪表吃。
   画面本身在那块画布上 —— 手指点在片子上，应当是滴到片子上。 */
.page-slide.is-live { pointer-events: none; }
.page-slide .hud-top,
.page-slide .hud-collect,
.page-slide .hud-clock,
.page-slide .focus-rail,
.page-slide .hud-bottom { pointer-events: auto; }

.hud-top {
  display: flex; gap: 8px;
  padding: 2px calc(52px + var(--safe-r)) 0 calc(14px + var(--safe-l));
}
.gauge {
  flex: 1;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.7);
  border-radius: 10px;
  padding: 6px 8px 7px;
  box-shadow: var(--shadow-sm);
}
.gauge-label { font-size: 10px; color: var(--ink-3); display: block; letter-spacing: 0.06em; }
.gauge-body {
  height: 7px; border-radius: 4px; margin: 4px 0 3px;
  background: rgba(42,35,32,0.10);
  overflow: hidden; position: relative;
}
.gauge-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 100%;
  background: linear-gradient(90deg, #8E5FB2, #6A3F8C);
  border-radius: 4px;
}
.gauge-fill-hp { background: linear-gradient(90deg, #C9553F, #96301F); }
.gauge-num { font-size: 12px; color: var(--ink); }

.hud-collect {
  align-self: center; margin-top: 12px;
  display: inline-flex; align-items: baseline; gap: 2px;
  font-size: 22px; color: var(--ink);
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 14px 4px;
}
.hud-collect em { font-style: normal; font-size: 13px; color: var(--ink-3); }
.collect-tag { font-size: 11px; color: var(--ink-3); margin-left: 6px; letter-spacing: 0.06em; }

.hud-clock {
  align-self: center; margin-top: 6px;
  font-size: 15px; color: var(--danger); font-variant-numeric: tabular-nums;
}
.hud-clock em { font-style: normal; font-size: 10px; color: var(--ink-3); }

/* 焦距环：本作的第二个操作 */
.focus-rail {
  position: absolute; top: 50%; right: calc(6px + var(--safe-r));
  transform: translateY(-50%);
  width: 44px; height: 46vh; min-height: 190px;
  display: flex; flex-direction: column; align-items: center;
  z-index: 24; cursor: pointer;
}
.fr-track {
  position: relative; flex: 1; width: 16px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.75), rgba(232,224,210,0.7));
  border: 1px solid var(--line);
  box-shadow: inset 0 0 6px rgba(42,35,32,0.08);
}
.fr-knob {
  position: absolute; left: 50%; top: 15%;
  width: 40px; height: 22px; margin-left: -20px; margin-top: -11px;
  border-radius: 6px;
  background: linear-gradient(180deg, #FDFBF6, #DCD2C0);
  border: 1px solid rgba(42,35,32,0.35);
  box-shadow: 0 2px 5px rgba(60,48,38,0.25), inset 0 1px 0 rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center;
}
.fr-knob i { width: 22px; height: 2px; background: rgba(42,35,32,0.4); border-radius: 2px; box-shadow: 0 4px 0 rgba(42,35,32,0.22); }
.fr-ticks { display: flex; flex-direction: column; justify-content: space-between; height: 100%; position: absolute; left: 0; right: 0; pointer-events: none; }
.fr-ticks span {
  position: absolute; top: var(--z);
  transform: translateY(-50%);
  font-size: 9px; color: var(--ink-3); writing-mode: vertical-rl; letter-spacing: 0.1em;
  right: -2px;
}
.page-slide.is-oneplane .focus-rail { display: none; }

.hud-bottom {
  margin-top: auto; padding: 0 calc(58px + var(--safe-r)) calc(12px + var(--safe-b)) calc(14px + var(--safe-l));
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.hud-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hud-btns .knob-free { border-color: rgba(58,138,124,0.55); }

.hint {
  margin: 0; font-size: 12px; color: var(--ink-2); line-height: 1.5;
  background: rgba(255,255,255,0.62);
  border-left: 2px solid var(--dye);
  border-radius: 0 8px 8px 0;
  padding: 6px 9px;
  max-width: 100%;
}

/* 调试/自检角标：只在开发模式出现 */
.selfcheck {
  position: absolute; left: 10px; bottom: calc(6px + var(--safe-b));
  font-size: 9.5px; line-height: 1.45; color: var(--ink-3);
  background: rgba(255,255,255,0.66); border: 1px solid var(--line-2);
  border-radius: 6px; padding: 4px 6px; z-index: 26; max-width: 62vw;
}
.selfcheck b { color: var(--dye); font-weight: 600; }
.selfcheck .warn { color: var(--danger); font-weight: 600; }

/* -------------------------- ③ 器材柜 -------------------------- */
.gear-list { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.gear {
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,0.7);
  box-shadow: var(--shadow-sm);
  padding: 10px 11px 11px; margin-bottom: 8px;
}
.gear-top { display: flex; align-items: center; gap: 8px; }
.gear-name { font-size: 14px; font-weight: 600; }
.gear-pips { display: flex; gap: 3px; margin-left: auto; }
.gear-pips i { width: 12px; height: 5px; border-radius: 3px; background: rgba(42,35,32,0.14); }
.gear-pips i.on { background: var(--dye); }
.gear-note { font-size: 12px; color: var(--ink-2); margin: 5px 0 8px; }
.gear-bottom { display: flex; align-items: center; gap: 8px; }
.gear-val { font-size: 11.5px; color: var(--ink-3); margin-right: auto; }
.gear-val b { color: var(--dye); font-weight: 600; }
.gear-maxed { font-size: 11.5px; color: var(--fix); margin-right: auto; }

.gear-ad {
  border: 1px dashed var(--line); border-radius: 12px;
  padding: 10px 11px; margin-top: 4px;
  display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,0.45);
}
.gear-ad-txt { font-size: 12px; color: var(--ink-2); flex: 1; }
.gear-ad-txt b { color: var(--amber); font-weight: 600; }
.gear-ad-txt em { display: block; font-style: normal; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.gear-ad-alt { font-size: 11.5px; color: var(--ink-3); margin: 8px 0 0; }

/* -------------------------- ④ 记录册 -------------------------- */
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tab {
  flex: 1; min-height: 40px; border-radius: 9px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.5);
  color: var(--ink-2); font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.tab.is-on { background: rgba(122,75,158,0.12); border-color: rgba(122,75,158,0.5); color: var(--dye); font-weight: 600; }

.ach-list, .adlog-list { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
.ach {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line-2); border-radius: 11px;
  background: rgba(255,255,255,0.55);
  padding: 9px 10px; margin-bottom: 7px;
}
.ach.is-locked { opacity: 0.62; }
.ach.seal {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  border: 1.4px solid var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--ink-3); letter-spacing: 0.04em;
}
.ach.is-unlocked .seal {
  border-color: var(--dye); color: var(--dye);
  background: radial-gradient(circle at 34% 30%, rgba(122,75,158,0.22), rgba(122,75,158,0.05));
}
.ach-body { flex: 1; min-width: 0; }
.ach-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ach-tier { font-size: 10px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-weight: 400; }
.ach-hint { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }
.ach-reward { font-size: 11.5px; color: var(--amber); white-space: nowrap; }

.adlog-row {
  border-bottom: 1px solid var(--line-2); padding: 7px 2px;
  display: flex; gap: 8px; align-items: baseline; font-size: 11.5px;
}
.adlog-time { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.adlog-verdict { color: var(--ink); flex: 1; }
.adlog-verdict.no { color: var(--ink-2); }
.adlog-rt { color: var(--ink-3); font-size: 10.5px; }
.adlog-empty { font-size: 12px; color: var(--ink-3); padding: 10px 2px; }

/* -------------------------- ⑤ 手册 -------------------------- */
.manual-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 20px; }
.manual-body h3 {
  font-size: 14px; margin: 16px 0 6px; letter-spacing: 0.04em;
  padding-bottom: 4px; border-bottom: 1px solid var(--line-2);
}
.manual-body h3:first-child { margin-top: 2px; }
.manual-body p { font-size: 12.5px; color: var(--ink-2); margin: 0 0 8px; }
.manual-body p b { color: var(--ink); }
.manual-body ul { margin: 0 0 10px; padding-left: 16px; }
.manual-body li { font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; }
.manual-body .kv {
  display: flex; gap: 8px; font-size: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line-2);
}
.manual-body .kv span:first-child { color: var(--ink-3); flex: 0 0 74px; }
.manual-body .kv span:last-child { color: var(--ink-2); flex: 1; }
.manual-note {
  font-size: 11.5px; color: var(--ink-3); border-left: 2px solid var(--line);
  padding-left: 8px; margin: 10px 0;
}
.warn-red { color: var(--danger); font-weight: 600; }
.manual-body .red-line {
  border: 1px solid rgba(179,58,46,0.5); background: rgba(179,58,46,0.07);
  color: var(--danger); border-radius: 8px; padding: 7px 9px;
  font-size: 12px; margin: 10px 0;
}

/* ============================ 浮层 ============================ */
.overlays { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.sheet-wrap {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center;
  pointer-events: auto;
}
.sheet-scrim {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(42,35,32,0.16), rgba(42,35,32,0.42));
  backdrop-filter: blur(1.3px);
}
.sheet {
  position: relative; width: 100%; max-width: 520px;
  background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(244,238,228,0.98));
  border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 34px rgba(50,40,30,0.22);
  padding: 15px 16px calc(16px + var(--safe-b));
  will-change: transform, opacity;
}
.sheet-mid { align-items: center; }
.sheet-mid .sheet { border-radius: 16px; margin: 0 14px; border: 1px solid var(--line); }
.sheet-title { font-size: 17px; font-weight: 600; letter-spacing: 0.04em; margin: 0 0 3px; }
.sheet-sub { font-size: 12.5px; color: var(--ink-2); margin: 0 0 12px; }
.sheet-stars { display: flex; gap: 6px; margin: 2px 0 10px; }
.sheet-stars i {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--slide-2); box-shadow: inset 0 0 0 1px var(--line);
}
.sheet-stars i.on { background: radial-gradient(circle at 34% 30%, #FFE9B0, #C79A3C); }
.sheet-rows { margin: 0 0 12px; }
.sheet-row {
  display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2);
  padding: 5px 0; border-bottom: 1px dashed var(--line-2);
}
.sheet-row b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.sheet-row.sum { border-bottom: none; padding-top: 8px; font-size: 13.5px; color: var(--ink); }
.sheet-row.sum b { color: var(--dye); font-size: 15px; }
.sheet-btns { display: flex; flex-direction: column; gap: 8px; }
/* 免费出路一定在左 / 在上，且更醒目 */
.sheet-btns .knob { width: 100%; }
.ad-hint { font-size: 11px; color: var(--ink-3); margin: 2px 0 0; line-height: 1.45; }
.ad-hint b { color: var(--ink-2); font-weight: 500; }
.sheet-close {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255,255,255,0.8);
  color: var(--ink-2); font-size: 15px; cursor: pointer; font-family: inherit;
}

/* 占位演示：本地跑真实路径时要一眼看明白「这不是真广告」 */
.demo-box {
  border: 1px solid rgba(179,58,46,0.55); border-radius: 10px;
  background: rgba(179,58,46,0.06); padding: 10px 11px; margin-bottom: 10px;
}
.demo-box .warn-red { display: block; font-size: 12px; margin-bottom: 4px; }
.demo-box p { font-size: 11.5px; color: var(--ink-2); margin: 0; }
.demo-bar { height: 6px; border-radius: 3px; background: rgba(42,35,32,0.1); overflow: hidden; margin-top: 9px; }
.demo-bar i { display: block; height: 100%; width: 0; background: var(--danger); border-radius: 3px; }

/* 机制说明浮层：不夺焦、可一键收起、排队出现 */
.coach {
  position: absolute; z-index: 44;
  left: calc(14px + var(--safe-l)); right: calc(14px + var(--safe-r));
  top: calc(var(--safe-t) + 96px);
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(122,75,158,0.4);
  border-radius: 12px; box-shadow: var(--shadow);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.coach p { margin: 0; font-size: 12.5px; color: var(--ink); line-height: 1.55; }
.coach button {
  align-self: flex-end; min-height: 34px; min-width: 66px;
  border-radius: 8px; border: 1px solid rgba(122,75,158,0.45);
  background: rgba(122,75,158,0.1); color: var(--dye);
  font-size: 12px; cursor: pointer; font-family: inherit;
}
/* 成就横幅：一条一条排，不叠 */
.toast-stack {
  position: absolute; z-index: 46;
  left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r));
  bottom: calc(16px + var(--safe-b));
  display: flex; flex-direction: column; gap: 6px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(185,138,46,0.5);
  border-radius: 10px; box-shadow: var(--shadow);
  padding: 8px 11px;
  font-size: 12.5px; color: var(--ink);
  will-change: transform, opacity;
}
.toast b { color: var(--amber); font-weight: 600; }

/* ============================ 加载页 ============================ */
.boot {
  position: absolute; inset: 0; z-index: 60;
  background: var(--slide);
  display: flex; align-items: center; justify-content: center;
}
.boot canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.boot-txt {
  position: absolute; left: 0; right: 0; bottom: 12%;
  text-align: center;
}
.boot-txt b { display: block; font-size: 17px; letter-spacing: 0.14em; font-weight: 600; }
.boot-txt span { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 5px; letter-spacing: 0.1em; }

/* 横屏时把视野收窄，保持竖屏体验 */
@media (orientation: landscape) and (max-height: 520px) {
  #stage { max-width: 62vh; margin: 0 auto; box-shadow: 0 0 0 1px var(--line); }
  .page { max-width: 62vh; left: 50%; transform: translateX(-50%); }
}
