/* 布局：顶部一条工具栏（模式 + 画风），下方要么是可滚动的角色展示，要么是铺满的场景画布。
   单一深色主题：夜林底色让三套画风的画面成为唯一的亮色。 */
:root {
  --bg: #14211d; --panel: #1c2d27; --panel-2: #24382f; --line: #33503f;
  --fg: #eef4e4; --dim: #a3b8a4; --ember: #ffc94a; --ember-ink: #2a1c05;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
html { padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); background: var(--bg); }
body { background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font); overflow: hidden; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
button:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
#app { height: 100%; display: flex; flex-direction: column; }

/* ---------- 工具栏 ---------- */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px)); background: #101a17; border-bottom: 1px solid var(--line); flex: none; }
.brand { display: flex; align-items: center; gap: 6px; font-weight: 700; letter-spacing: .08em; margin-right: auto; white-space: nowrap; }
.brand svg { width: 16px; height: 16px; fill: var(--ember); }
.brand em { font-style: normal; font-weight: 400; font-size: 11px; color: var(--dim); letter-spacing: .04em; }
.seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { padding: 4px 12px; border-radius: 7px; color: var(--dim); white-space: nowrap; min-height: 28px; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--ember); color: var(--ember-ink); font-weight: 700; }
.seg button b { font-weight: 700; margin-right: 4px; opacity: .75; }
.styles button .star { margin-left: 3px; font-size: 10px; }
@media (max-width: 560px) { .brand em { display: none; } .styles { flex: 1 1 100%; } .styles button { flex: 1; padding-inline: 4px; } }
@media (max-height: 430px) and (orientation: landscape) { .bar { padding-block: 3px; flex-wrap: nowrap; } .seg button { min-height: 26px; padding-inline: 10px; } .brand span { display: none; } }

/* ---------- 角色展示 ---------- */
.show { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-content: start; max-width: 1120px; width: 100%; margin-inline: auto; }
.intro { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.intro h1 { font-size: 20px; margin: 0; letter-spacing: .06em; text-wrap: balance; }
.intro p { margin: 0; color: var(--dim); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; flex: 1 1 100%; }
.chips li { font-size: 12px; color: var(--dim); border: 1px solid var(--line); border-radius: 99px; padding: 1px 10px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.panel h2 { font-size: 13px; margin: 0; font-weight: 600; color: var(--dim); letter-spacing: .08em; }
.phead { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.note { font-size: 12px; color: var(--dim); }
.cv { width: 100%; display: block; border-radius: 9px; touch-action: pan-y; }
.who { align-self: stretch; } .who button { flex: 1; }
@media (min-width: 760px) {
  .show { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .intro { grid-column: 1 / -1; } .p-real { grid-column: 1 / -1; }
}

/* ---------- 场景 / 试玩 ---------- */
.stage { flex: 1; position: relative; min-height: 0; overflow: hidden; background: #0c1512; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud > * { pointer-events: auto; position: absolute; }
.rb { top: 10px; right: max(12px, env(safe-area-inset-right, 0px)); height: 38px; min-width: 38px; padding: 0 9px; border-radius: 19px; background: rgba(16, 26, 23, .72); border: 1px solid rgba(255, 255, 255, .22); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.rb svg, .atk svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.joy { left: max(22px, calc(env(safe-area-inset-left, 0px) + 8px)); bottom: 22px; width: 112px; height: 112px; border-radius: 50%; background: rgba(16, 26, 23, .34); border: 1.5px solid rgba(255, 255, 255, .34); }
.joy i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px; border-radius: 50%; background: rgba(255, 255, 255, .82); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.atk { right: max(26px, calc(env(safe-area-inset-right, 0px) + 12px)); bottom: 34px; width: 70px; height: 70px; border-radius: 50%; background: rgba(255, 201, 74, .9); color: var(--ember-ink); display: grid; place-items: center; border: 2px solid rgba(255, 255, 255, .6); box-shadow: 0 3px 10px rgba(0, 0, 0, .3); }
.atk svg { width: 30px; height: 30px; } .atk:active { transform: scale(.93); }
.hint { left: 50%; top: 10px; transform: translateX(-50%); font-size: 12px; padding: 4px 12px; border-radius: 99px; background: rgba(16, 26, 23, .72); color: var(--fg); white-space: nowrap; transition: opacity .6s; pointer-events: none; }
.hint:empty, .hint.off { opacity: 0; }
#app[data-mode="scene"] .joy, #app[data-mode="scene"] .atk, #app[data-mode="scene"] #btnWho, #app[data-mode="play"] #btnFit { display: none; }
@media (prefers-reduced-motion: reduce) { .hint { transition: none; } }
