/* ========== 主题变量 ========== */
:root {
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SF Mono", "Courier New", monospace;
  --radius: 6px;
}
body[data-theme="archive"] {
  --desk: #4a8075; --desk2: #22443d; --paper: #fbf7ee; --paper2: #f1eadb;
  --ink: #24312d; --ink-soft: #6d7a74; --accent: #ef6f5a; --accent-ink: #fff;
  --hl: #ffd36e; --line: rgba(36, 49, 45, .14); --glow: rgba(255, 211, 110, .6);
  --top: rgba(28, 54, 48, .88); --top-ink: #f6f1e4; --hud-track: rgba(36, 49, 45, .12);
}
body[data-theme="neon"] {
  --desk: #0e0b1d; --desk2: #06040f; --paper: #1c1836; --paper2: #24204a;
  --ink: #ece9ff; --ink-soft: #9a94c9; --accent: #ff3d7f; --accent-ink: #fff;
  --hl: #39ffd5; --line: rgba(160, 150, 255, .22); --glow: rgba(57, 255, 213, .55);
  --top: rgba(8, 6, 20, .85); --top-ink: #ece9ff;
  --hud-track: rgba(255,255,255,.12);
}
body[data-theme="vermilion"] {
  --desk: #2b1210; --desk2: #1a0907; --paper: #f2e2cb; --paper2: #e6d0b0;
  --ink: #3a1c12; --ink-soft: #7c5a46; --accent: #b3221a; --accent-ink: #fff;
  --hl: #ffd166; --line: rgba(58, 28, 18, .2); --glow: rgba(255, 209, 102, .6);
  --top: rgba(30, 10, 8, .85); --top-ink: #f6e7d2;
  --hud-track: rgba(58,28,18,.12);
}
body[data-theme="fog"] {
  --desk: #101d29; --desk2: #08121b; --paper: #e3ebf0; --paper2: #cfdbe3;
  --ink: #142533; --ink-soft: #55697a; --accent: #2f7fb5; --accent-ink: #fff;
  --hl: #9effa8; --line: rgba(20, 37, 51, .18); --glow: rgba(158, 255, 168, .55);
  --top: rgba(6, 14, 22, .85); --top-ink: #e3ebf0;
  --hud-track: rgba(20,37,51,.12);
}

/* 透明轨道，5px 操作区域内保留 3px 圆角滑块；全站统一半透明深紫色。 */
html { --scrollbar-ink: #4b2d66; }
* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--scrollbar-ink) 50%, transparent) transparent;
}
*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-track, *::-webkit-scrollbar-corner { background: transparent; }
*::-webkit-scrollbar-thumb {
  min-width: 28px;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--scrollbar-ink) 50%, transparent);
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--scrollbar-ink) 70%, transparent); }
*::-webkit-scrollbar-thumb:active { background-color: color-mix(in srgb, var(--scrollbar-ink) 85%, transparent); }
*::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
/* 支持伪元素时交给精确宽度样式，避免标准属性覆盖细节；Firefox 使用 thin。 */
@supports selector(::-webkit-scrollbar) {
  * { scrollbar-width: auto; scrollbar-color: auto; }
}
@media (forced-colors: active) {
  * { scrollbar-color: auto; }
  *::-webkit-scrollbar-thumb { background-color: CanvasText; }
}
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans); color: var(--ink);
  background:
    radial-gradient(1200px 700px at 50% 30%, var(--desk), var(--desk2) 75%),
    var(--desk2);
  min-height: 100vh; overflow-x: hidden;
  transition: background .6s;
}
#bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#bg svg { width: 100%; height: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
h1, h2, h3, h4 { font-family: var(--serif); margin: 0; }

/* ========== 顶栏 ========== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 22px; background: var(--top); color: var(--top-ink);
  backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 900; font-size: 22px;
  background: var(--accent); color: var(--accent-ink); border-radius: 4px;
  transform: rotate(-4deg); box-shadow: 2px 2px 0 rgba(0,0,0,.35);
}
.brand-name { font-family: var(--serif); font-weight: 900; font-size: 18px; letter-spacing: 2px; }
.brand-sub { font-family: var(--mono); font-size: 10px; opacity: .55; letter-spacing: 2px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.chip {
  padding: 7px 14px; border-radius: 999px; font-size: 13px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  transition: transform .15s, background .2s;
}
.chip:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.chip-hot { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.chip-hot:hover { background: var(--accent); filter: brightness(1.1); }
.chip.done { opacity: .5; }
.chip.dot { position: relative; }
.chip.dot::after {
  content: ""; position: absolute; top: 2px; right: 4px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--hl); box-shadow: 0 0 8px var(--hl);
}
.crystals::before { content: "◆ "; color: var(--hl); }
.has-gem .crystals::before { content: ""; display: inline-block; width: 18px; height: 18px; margin-right: 4px; vertical-align: -4px; background: var(--gem-img) center / contain no-repeat; }
.profile { display: flex; align-items: center; gap: 10px; }
.profile .meta { font-size: 12px; line-height: 1.3; }
.profile .meta b { font-family: var(--serif); font-size: 13px; }
.xpbar { width: 110px; height: 4px; background: rgba(255,255,255,.15); border-radius: 2px; overflow: hidden; margin-top: 3px; }
.xpbar i { display: block; height: 100%; background: var(--hl); }

/* 头像与头像框 */
.avatar {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #333); display: grid; place-items: center;
  font-family: var(--serif); font-weight: 900; color: #fff;
}
.avatar.f-gear { box-shadow: 0 0 0 3px #b08d57, 0 0 0 5px #5c4526; }
.avatar.f-gear::after {
  content: "⚙"; position: absolute; right: -8px; bottom: -6px; font-size: 16px; color: #d4a75e;
  animation: spin 6s linear infinite;
}
.avatar.f-gold { box-shadow: 0 0 0 3px #f2c94c, 0 0 14px #f2c94c; }
.avatar.f-seal::after {
  content: "结"; position: absolute; right: -10px; top: -8px; font-size: 11px; padding: 1px 3px;
  border: 1.5px solid #d03b2b; color: #d03b2b; background: #fff8; transform: rotate(14deg); border-radius: 2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

main#view { position: relative; z-index: 1; }

/* ========== 纸张通用 ========== */
.paper {
  background:
    linear-gradient(transparent 0 0),
    var(--paper);
  color: var(--ink); border-radius: var(--radius);
  box-shadow: 0 6px 0 rgba(0,0,0,.12), 0 14px 28px rgba(0,0,0,.12);
  position: relative;
}
.tape {
  position: absolute; top: -10px; left: 50%; width: 90px; height: 22px; transform: translateX(-50%) rotate(-2deg);
  background: rgba(255, 245, 200, .55); box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.label { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--ink-soft); text-transform: uppercase; }
.hl { background: linear-gradient(transparent 55%, var(--hl) 55%); padding: 0 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 4px; font-weight: 700; letter-spacing: 1px;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 3px 0 rgba(0,0,0,.3); transition: transform .12s, filter .2s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.btn.big { padding: 16px 34px; font-size: 18px; font-family: var(--serif); }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* ========== 封面 ========== */
.cover { max-width: 1180px; margin: 0 auto; padding: 48px 24px 60px; display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: start; }
.folder {
  padding: 44px 46px 40px; transform: rotate(-1.2deg);
  background:
    repeating-linear-gradient(transparent 0 31px, var(--line) 31px 32px),
    var(--paper);
}
.folder .stamp {
  position: absolute; right: 34px; top: 34px; font-family: var(--serif); font-weight: 900; font-size: 22px;
  color: var(--accent); border: 3px solid var(--accent); padding: 4px 12px; transform: rotate(12deg);
  opacity: .85; letter-spacing: 4px; mix-blend-mode: multiply;
}
.folder h1 { font-size: 52px; line-height: 1.15; margin: 12px 0 8px; letter-spacing: 2px; }
.folder .case-no { font-family: var(--mono); color: var(--ink-soft); }
.folder .intro p { font-family: var(--serif); font-size: 16px; line-height: 1.9; margin: 0; }
.folder .intro { margin: 22px 0 28px; }
.folder .row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.memory-note {
  margin-top: 20px; padding: 10px 14px; border-left: 3px solid var(--accent);
  background: rgba(200, 64, 47, .07); font-size: 13px; font-family: var(--serif);
}
.side-col { display: flex; flex-direction: column; gap: 22px; }
.season {
  padding: 22px 24px; color: #fff; border-radius: var(--radius); overflow: hidden; position: relative;
  background: linear-gradient(135deg, #12304a, #0a1520 60%), #0a1520;
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
}
.season::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(158,255,168,.35), transparent 65%);
  animation: beam 4s ease-in-out infinite;
}
@keyframes beam { 50% { transform: translate(-30px, 20px); opacity: .5; } }
.season h3 { font-size: 22px; margin: 6px 0; }
.season p { font-size: 13px; opacity: .8; margin: 0 0 14px; line-height: 1.7; }
.season .label { color: #9effa8; }
.echo-wall { padding: 20px 22px; }
.echo-wall h3 { font-size: 18px; margin-bottom: 12px; }
.echo { display: flex; gap: 10px; padding: 10px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.echo:first-of-type { border-top: none; }
.echo .who { font-weight: 700; white-space: nowrap; }
.echo .who small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 11px; }
.echo .txt { min-width: 0; overflow-wrap: anywhere; font-family: var(--serif); line-height: 1.6; }
.echo.mine .txt { background: linear-gradient(transparent 60%, var(--hl) 60%); }

/* ========== 案件桌 ========== */
.table {
  max-width: 1440px; margin: 0 auto; padding: 18px 20px 28px;
  display: grid; grid-template-columns: 270px 1fr 320px; gap: 18px; min-height: calc(100vh - 60px);
}
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel { padding: 16px; }
.panel h3 { font-size: 16px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }

.npc {
  display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 6px; cursor: pointer;
  border: 1.5px solid transparent; transition: background .2s, border-color .2s, transform .15s;
  margin-bottom: 6px;
}
.npc:hover { background: rgba(0,0,0,.05); border-color: var(--line); transform: translateX(3px); }
.npc .portrait { width: 58px; height: 58px; flex: none; }
.npc .name { font-family: var(--serif); font-weight: 900; font-size: 17px; }
.npc .role { font-size: 12px; color: var(--ink-soft); }
.npc .tags { margin-top: 4px; display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: 10px; padding: 1px 6px; border-radius: 3px; background: var(--paper2); color: var(--ink-soft); }
.tag.red { background: var(--accent); color: var(--accent-ink); }
.portrait { border-radius: 6px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.portrait svg { display: block; width: 100%; height: 100%; }

.casehead { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; }
.casehead h2 { font-size: 24px; letter-spacing: 1px; }
.casehead .sub { font-size: 12px; color: var(--ink-soft); font-family: var(--mono); letter-spacing: 1px; }
.dial { display: flex; align-items: center; gap: 10px; }
.dial svg { width: 56px; height: 56px; }
.dial .t { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); line-height: 1.4; text-align: right; }
.dial .t b { display: block; font-size: 20px; color: var(--ink); }
.dial.low .t b { color: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.map {
  padding: 22px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 14px; min-height: 300px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--paper);
}
.room {
  position: relative; border: 2px solid var(--ink); border-radius: 3px; padding: 14px 16px; cursor: pointer;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  transition: transform .18s, box-shadow .2s, background .2s; overflow: hidden;
}
.room:hover { transform: translateY(-3px); box-shadow: 6px 6px 0 var(--ink); }
.room .ico { font-size: 28px; }
.room .rn { font-family: var(--serif); font-weight: 900; font-size: 18px; margin-top: 4px; }
.room .rd { font-size: 12px; color: var(--ink-soft); margin-top: 4px; line-height: 1.5; }
.room .prog { position: absolute; right: 12px; top: 12px; font-family: var(--mono); font-size: 11px; }
.room.locked { border-style: dashed; opacity: .65; }
.room.locked::after { content: "🔒"; position: absolute; right: 12px; bottom: 10px; font-size: 20px; }
.room.cleared { background: color-mix(in srgb, var(--hl) 18%, var(--paper)); }
.room.new { animation: unlock .9s ease; }
@keyframes unlock { 0% { box-shadow: 0 0 0 0 var(--glow); } 60% { box-shadow: 0 0 0 14px transparent; } }

.log { padding: 16px 20px; flex: 1; min-height: 160px; max-height: 260px; overflow-y: auto; font-family: var(--serif); }
.log .entry { padding: 6px 0; line-height: 1.75; font-size: 14px; border-bottom: 1px dashed var(--line); animation: fadein .4s; }
.log .entry:last-child { border-bottom: none; }
.log .entry.sys { color: var(--ink-soft); font-family: var(--sans); font-size: 12px; }
.log .entry.hit { color: var(--accent); font-weight: 700; }
.log .entry .who { font-weight: 900; margin-right: 6px; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.board { padding: 16px; flex: 1; }
.evgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ev {
  position: relative; padding: 10px 10px 8px; border-radius: 4px; background: #fffdf6; color: #222;
  box-shadow: 0 3px 8px rgba(0,0,0,.18); cursor: pointer; transition: transform .15s;
  font-size: 12px; min-height: 76px;
}
body[data-theme="neon"] .ev { background: #2b2656; color: #ece9ff; }
.ev:nth-child(odd) { transform: rotate(-1.2deg); }
.ev:nth-child(even) { transform: rotate(1deg); }
.ev:hover { transform: rotate(0) scale(1.04); z-index: 2; }
.ev::before {
  content: ""; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 2px 2px rgba(0,0,0,.4); transform: translateX(-50%);
}
.ev .ei { font-size: 22px; }
.ev .en { font-weight: 700; font-family: var(--serif); font-size: 13px; margin-top: 2px; }
.ev.slot { background: transparent; border: 1.5px dashed var(--line); box-shadow: none; color: var(--ink-soft); display: grid; place-items: center; cursor: default; }
.ev.slot::before { display: none; }
.ev.fresh { animation: evin .7s ease; }
@keyframes evin { from { transform: scale(.4) rotate(-20deg); opacity: 0; } }
body.fx-scan .ev.fresh::after {
  content: ""; position: absolute; inset: 0; border-radius: 4px;
  background: linear-gradient(100deg, transparent 30%, var(--glow) 50%, transparent 70%);
  background-size: 250% 100%; animation: scan 1.1s ease forwards;
}
@keyframes scan { from { background-position: 120% 0; } to { background-position: -120% 0; } }
body.fx-ink .ev.fresh { animation: inkin 1s ease; }
@keyframes inkin { from { filter: blur(8px) contrast(2); opacity: 0; } }

.breaks { display: flex; gap: 6px; margin: 4px 0 14px; align-items: center; font-size: 12px; color: var(--ink-soft); }
.breaks i { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); display: inline-grid; place-items: center; font-style: normal; font-size: 10px; }
.breaks i.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.deduce-btn { width: 100%; margin-top: 14px; }

/* ========== 弹窗 ========== */
.modal-mask {
  position: fixed; inset: 0; z-index: 50; background: rgba(5, 10, 8, .62); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px; animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(760px, 100%); max-height: 88vh; overflow-y: auto; padding: 28px 30px;
  animation: pop .28s cubic-bezier(.2, 1.3, .5, 1);
}
.modal.wide { width: min(1000px, 100%); }
@keyframes pop { from { transform: translateY(20px) scale(.96); opacity: 0; } }
.modal .x { position: absolute; right: 14px; top: 10px; font-size: 24px; color: var(--ink-soft); }
.modal h2 { font-size: 24px; margin-bottom: 4px; }
.modal .lead { color: var(--ink-soft); font-size: 13px; margin-bottom: 18px; font-family: var(--serif); }

.hotspots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hotspot {
  padding: 18px; border: 1.5px solid var(--line); border-radius: 6px; text-align: left; transition: all .2s;
  background: var(--paper2);
}
.hotspot:hover { border-color: var(--accent); transform: translateY(-2px); }
.hotspot .hn { font-family: var(--serif); font-weight: 900; font-size: 16px; }
.hotspot .hc { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.hotspot.done { opacity: .75; cursor: default; background: transparent; }
.hotspot.done:hover { transform: none; border-color: var(--line); }

.talk { display: grid; grid-template-columns: 180px 1fr; gap: 22px; }
.talk .portrait { width: 180px; height: 220px; }
.talk .intro { font-family: var(--serif); font-size: 13px; color: var(--ink-soft); margin: 10px 0 0; line-height: 1.7; }
.bubble {
  padding: 14px 16px; background: var(--paper2); border-radius: 4px 14px 14px 14px; font-family: var(--serif);
  line-height: 1.8; min-height: 64px; margin-bottom: 14px; position: relative;
}
.bubble.claim { border-left: 4px solid var(--accent); }
.bubble.break { background: var(--accent); color: #fff; }
.bubble .flag { position: absolute; right: 10px; top: -10px; font-size: 11px; background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 3px; }
.qs { display: flex; flex-direction: column; gap: 6px; }
.q {
  text-align: left; padding: 10px 14px; border-radius: 4px; border: 1.5px solid var(--line); font-size: 14px;
  transition: all .15s;
}
.q:hover { border-color: var(--ink); background: rgba(0,0,0,.04); }
.q.asked { color: var(--ink-soft); }
.q.asked::after { content: " ✓"; }
.present-row { margin-top: 14px; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.picker .ev { transform: none; }
.picker .ev.sel { outline: 3px solid var(--accent); outline-offset: 2px; }

.ded-step { margin-bottom: 22px; }
.ded-step h4 { font-size: 15px; margin-bottom: 10px; }
.ded-step h4 span { font-family: var(--mono); color: var(--accent); margin-right: 8px; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.opt { padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 4px; text-align: left; font-size: 14px; transition: all .15s; display: flex; gap: 10px; align-items: center; }
.opt:hover { border-color: var(--ink); }
.opt.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: 0 0 0 1px var(--accent); }
.opt .portrait { width: 40px; height: 40px; }

/* ========== 结局 ========== */
.ending { max-width: 860px; margin: 0 auto; padding: 50px 24px 70px; }
.ending .scene { padding: 40px 46px; }
.ending .scene h2 { font-size: 30px; margin-bottom: 20px; }
.ending .scene p { font-family: var(--serif); font-size: 17px; line-height: 2; margin: 0 0 6px; opacity: 0; animation: fadein .8s forwards; }
.ending .rating {
  position: absolute; right: 30px; top: 24px; font-family: var(--serif); font-weight: 900; font-size: 64px; color: var(--accent);
  transform: rotate(-10deg); border: 4px solid var(--accent); width: 96px; height: 96px; display: grid; place-items: center;
  border-radius: 50%; animation: stampin .5s cubic-bezier(.2, 1.6, .5, 1) 1.2s both; mix-blend-mode: multiply;
}
@keyframes stampin { from { transform: scale(3) rotate(-30deg); opacity: 0; } }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
.score-list { padding: 22px 24px; font-size: 14px; }
.score-list div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.score-list .tot { font-family: var(--serif); font-weight: 900; font-size: 18px; border: none; }
.reward { padding: 22px 24px; }
.reward .big { font-family: var(--serif); font-size: 26px; font-weight: 900; color: var(--accent); }
.ach { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-size: 13px; }
.ach .medal { width: 26px; height: 26px; border-radius: 50%; background: var(--hl); display: grid; place-items: center; font-size: 13px; box-shadow: 0 0 10px var(--glow); }
.actions-row { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }

/* 分享卡 */
.share-card {
  width: 360px; margin: 0 auto; padding: 26px; border-radius: 8px; color: #f3eee3; position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--desk), var(--desk2));
  box-shadow: 0 20px 40px rgba(0,0,0,.4);
}
.share-card .sc-title { font-family: var(--serif); font-weight: 900; font-size: 22px; margin: 6px 0 14px; }
.share-card .sc-route { font-size: 12px; line-height: 1.9; opacity: .85; }
.share-card .sc-rate { position: absolute; right: 20px; top: 18px; font-family: var(--serif); font-size: 46px; font-weight: 900; color: var(--hl); }
.share-card .sc-code { margin-top: 16px; font-family: var(--mono); font-size: 13px; padding: 8px 10px; background: rgba(255,255,255,.08); border-radius: 4px; display: flex; justify-content: space-between; }
.echo-input { width: 100%; margin-top: 10px; padding: 12px; border-radius: 4px; border: 1.5px solid var(--line); background: var(--paper2); color: var(--ink); font-family: var(--serif); font-size: 14px; }

/* 衍生剧情（视觉小说） */
.vn { max-width: 900px; margin: 0 auto; padding: 60px 24px; }
.vn .stage {
  min-height: 300px; padding: 40px; border-radius: 8px; color: #e9f1f5; position: relative; overflow: hidden;
  background: radial-gradient(600px 300px at 80% 0%, rgba(158,255,168,.18), transparent), linear-gradient(180deg, #0b1822, #050b10);
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.vn .stage .lighthouse { position: absolute; right: 40px; bottom: 0; width: 60px; height: 160px; opacity: .5; }
.vn .stage p { font-family: var(--serif); font-size: 17px; line-height: 2; margin: 0; opacity: 0; animation: fadein .9s forwards; max-width: 680px; }
.vn .stage .voice { color: #9effa8; font-style: italic; }
.vn .choices { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.vn .choice { padding: 16px 20px; text-align: left; font-family: var(--serif); font-size: 16px; background: var(--paper); color: var(--ink); border-radius: 4px; border-left: 4px solid var(--accent); transition: transform .15s; }
.vn .choice:hover { transform: translateX(6px); }
.teaser { margin-top: 26px; padding: 26px 28px; text-align: center; }
.teaser h3 { font-size: 24px; margin: 6px 0 10px; }
.teaser .pass-extra { margin-top: 14px; padding: 14px; font-family: var(--serif); background: rgba(47,127,181,.1); border-left: 3px solid #2f7fb5; text-align: left; line-height: 1.8; }

/* 商城 */
.shop-tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1.5px solid var(--line); }
.shop-tab { padding: 10px 16px; font-weight: 700; color: var(--ink-soft); border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
.shop-tab.on { color: var(--ink); border-color: var(--accent); }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.item { padding: 16px; border: 1.5px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; gap: 8px; background: var(--paper2); }
.item .sw { display: flex; height: 54px; border-radius: 4px; overflow: hidden; }
.item .sw i { flex: 1; }
.item .in { font-family: var(--serif); font-weight: 900; font-size: 16px; }
.item .id { font-size: 12px; color: var(--ink-soft); flex: 1; }
.item .btn { padding: 8px 12px; font-size: 13px; }
.item.owned .btn.ghost { color: var(--ink-soft); }
.pass-hero {
  padding: 26px; border-radius: 8px; color: #fff; margin-bottom: 18px; display: flex; justify-content: space-between; gap: 20px; align-items: center;
  background: linear-gradient(120deg, #12304a, #0a1520);
}
.pass-hero h3 { font-size: 22px; }
.pass-hero ul { margin: 10px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.9; opacity: .9; }
.pack { padding: 18px; text-align: center; border: 1.5px solid var(--line); border-radius: 6px; position: relative; background: var(--paper2); }
.pack .amt { font-family: var(--serif); font-weight: 900; font-size: 26px; color: var(--accent); }
.pack .amt::before { content: "◆ "; font-size: 16px; }
.has-gem .pack .amt::before { content: ""; display: inline-block; width: 22px; height: 22px; margin-right: 4px; vertical-align: -3px; background: var(--gem-img) center / contain no-repeat; }
.pack .bonus { font-size: 12px; color: var(--ink-soft); min-height: 18px; }
.pack .tagx { position: absolute; top: -9px; right: 10px; background: var(--accent); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 3px; }
.demo-note { font-size: 12px; color: var(--ink-soft); margin-top: 16px; text-align: center; }

/* 档案馆 */
.arch-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.stat { padding: 14px; background: var(--paper2); border-radius: 6px; text-align: center; }
.stat b { display: block; font-family: var(--serif); font-size: 24px; }
.stat span { font-size: 12px; color: var(--ink-soft); }
.collect .ev.lockd { filter: grayscale(1); opacity: .35; }
.achs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.achs .ach { padding: 10px; background: var(--paper2); border-radius: 6px; }
.achs .ach.off { opacity: .4; }
.achs .ach.off .medal { background: var(--line); box-shadow: none; }

/* toast */
#toast-root { position: fixed; top: 74px; right: 22px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 16px; background: var(--paper); color: var(--ink); border-radius: 6px; border-left: 4px solid var(--accent);
  box-shadow: 0 10px 24px rgba(0,0,0,.35); font-size: 14px; animation: slidein .3s; max-width: 320px;
}
.toast.gold { border-color: var(--hl); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }

/* ========== 低多边形 / 扁平 HUD ========== */
.small { font-size: 12px; color: var(--ink-soft); line-height: 1.8; margin: 0; }
.hint-card p { margin: 0; }
.hud {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 12px 18px; border-radius: 14px; background: var(--paper); color: var(--ink);
  box-shadow: 0 6px 0 rgba(0,0,0,.12);
}
.hud-title h2 { font-size: 22px; letter-spacing: 1px; }
.hud-stats { display: flex; align-items: center; gap: 10px; }
.hud-pill {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 64px; padding: 6px 12px;
  border-radius: 12px; background: var(--paper2); line-height: 1.15;
}
.hud-pill span { font-size: 11px; color: var(--ink-soft); }
.hud-pill b { font-family: var(--serif); font-size: 22px; }
.hud-pill small { font-size: 12px; color: var(--ink-soft); font-weight: 400; }
.panel, .board, .log, .map, .mp-card, .echo-wall, .folder, .lobby-card { border-radius: 14px; }

.room { padding: 0; border: none; border-radius: 12px; background: var(--paper); box-shadow: 0 5px 0 rgba(0,0,0,.14); display: flex; flex-direction: column; }
.room:hover { box-shadow: 0 9px 0 rgba(0,0,0,.14); transform: translateY(-4px); }
.room-art { position: relative; height: 74px; overflow: hidden; }
.room-art svg { width: 100%; height: 100%; display: block; }
.room-art .ico { position: absolute; left: 14px; bottom: -6px; font-size: 34px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.18)); }
.room-body { padding: 12px 16px 14px; }
.room .prog { top: 10px; right: 10px; background: rgba(255,255,255,.85); color: #24312d; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.room.locked { border: none; opacity: 1; }
.room.locked .room-art { filter: grayscale(.9) brightness(.8); }
.room.locked::after { bottom: auto; top: 22px; right: 14px; }
.room.cleared .room-body { background: color-mix(in srgb, var(--hl) 22%, transparent); }
.room-banner { position: relative; height: 96px; margin: -28px -30px 16px; overflow: hidden; border-radius: 14px 14px 0 0; }
.room-banner svg { width: 100%; height: 100%; display: block; }
.room-banner span { position: absolute; left: 24px; bottom: 6px; font-size: 44px; }
.portrait { border-radius: 12px; }
.npc { border-radius: 12px; }
.ev { border-radius: 10px; }
.ev::before { display: none; }
.ev { border-top: 5px solid var(--accent); }
.modal { border-radius: 18px; }
.log .entry .by { display: inline-block; font-size: 11px; font-family: var(--sans); padding: 0 6px; margin-right: 6px; border-radius: 999px; background: var(--paper2); color: var(--ink-soft); }

/* 识破动画 */
.objection {
  position: fixed; left: 50%; top: 42%; z-index: 90; transform: translate(-50%, -50%) rotate(-8deg);
  font-family: var(--serif); font-weight: 900; font-size: clamp(48px, 12vw, 120px); color: #fff;
  background: var(--accent); padding: 10px 40px; border-radius: 16px; box-shadow: 0 10px 0 rgba(0,0,0,.2);
  animation: objection 1.1s cubic-bezier(.2, 1.5, .4, 1) forwards; pointer-events: none;
}
@keyframes objection {
  0% { transform: translate(-50%, -50%) scale(3) rotate(-20deg); opacity: 0; }
  25% { transform: translate(-50%, -50%) scale(1) rotate(-8deg); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translate(-50%, -60%) scale(.9) rotate(-8deg); opacity: 0; }
}

/* 封面多人卡片 */
.mp-card { padding: 0 22px 20px; overflow: hidden; }
.mp-art { height: 56px; margin: 0 -22px 14px; }
.mp-art svg { width: 100%; height: 100%; display: block; }
.mp-card h3 { font-size: 20px; margin: 4px 0 6px; }
.mp-card .lead { margin-bottom: 12px; font-size: 13px; color: var(--ink-soft); font-family: var(--serif); line-height: 1.7; }
.mp-row { display: flex; gap: 8px; margin-top: 8px; }
.field {
  flex: 1; min-width: 0; padding: 11px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--paper2);
  color: var(--ink); font: inherit; font-size: 15px; outline: none; transition: border-color .2s;
}
.field:focus { border-color: var(--accent); }
.field.code { max-width: 110px; text-align: center; font-family: var(--mono); font-size: 18px; letter-spacing: 4px; }
.mp-off { font-size: 12px; color: var(--ink-soft); background: var(--paper2); padding: 10px; border-radius: 10px; }

/* 大厅 */
.lobby { max-width: 860px; margin: 0 auto; padding: 40px 20px 120px; }
.lobby-card { padding: 30px; }
.code-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 10px 0 8px; }
.room-code { display: flex; gap: 8px; }
.room-code span {
  width: 58px; height: 70px; display: grid; place-items: center; font-family: var(--mono); font-size: 38px; font-weight: 900;
  background: var(--ink); color: var(--paper); border-radius: 12px; box-shadow: 0 5px 0 var(--accent);
}
.seats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 20px 0; }
.seat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 12px; background: var(--paper2); text-align: center; animation: fadein .4s; }
.seat b { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat small { font-size: 11px; color: var(--ink-soft); }
.seat.off { opacity: .5; }
.seat.empty { background: transparent; border: 2px dashed var(--line); }
.seat.empty .avatar { background: var(--line); color: var(--ink-soft); }
.avatar.lg { width: 54px; height: 54px; font-size: 22px; }
.avatar.sm { width: 26px; height: 26px; font-size: 12px; }
.avatar.sm.f-gear::after, .avatar.sm.f-seal::after { display: none; }
.case-mini { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 12px; background: var(--paper2); }
.case-mini h3 { font-size: 18px; }
.cm-art { width: 90px; height: 60px; border-radius: 8px; overflow: hidden; flex: none; }
.cm-art svg { width: 100%; height: 100%; display: block; }
.waiting-dots { font-family: var(--serif); color: var(--ink-soft); padding: 12px; }
.waiting-dots span { animation: pulse 1.2s infinite; }
.waiting-dots span:nth-child(2) { animation-delay: .2s; }
.waiting-dots span:nth-child(3) { animation-delay: .4s; }

/* 房间聊天坞 */
.dock {
  position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 320px; border-radius: 16px; overflow: hidden;
  background: var(--paper); color: var(--ink); box-shadow: 0 8px 0 rgba(0,0,0,.15), 0 20px 40px rgba(0,0,0,.25);
}
.dock[hidden] { display: none; }
.dock-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; background: var(--ink); color: var(--paper); cursor: pointer; font-size: 13px; }
.dock-head #dockCount { opacity: .7; font-size: 12px; }
.dock-head .caret { margin-left: auto; transition: transform .2s; }
.dock.collapsed .caret { transform: rotate(180deg); }
.dock.collapsed .dock-body { display: none; }
.live { width: 8px; height: 8px; border-radius: 50%; background: #5ee08f; box-shadow: 0 0 8px #5ee08f; animation: pulse 1.6s infinite; }
.dock-players { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 12px 4px; }
.dp { display: flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 8px 3px 3px; border-radius: 999px; background: var(--paper2); }
.dp.off { opacity: .45; }
.dock-chat { height: 200px; overflow-y: auto; padding: 6px 12px; font-size: 13px; }
.msg { padding: 4px 0; line-height: 1.5; word-break: break-word; }
.msg b { margin-right: 6px; }
.msg.me b { color: var(--accent); }
.msg.sys { font-size: 11px; color: var(--ink-soft); text-align: center; }
.emote-bar { display: flex; gap: 4px; padding: 6px 10px; overflow-x: auto; border-top: 1px solid var(--line); }
.emo { font-size: 20px; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--paper2); position: relative; transition: transform .12s; }
.emo:hover { transform: scale(1.15); }
.emo.lock { filter: grayscale(1); opacity: .6; }
.emo.lock i { position: absolute; right: -2px; bottom: -2px; font-size: 10px; font-style: normal; filter: none; }
.dock-form { display: flex; gap: 6px; padding: 8px 10px 10px; }
.dock-form input { flex: 1; min-width: 0; padding: 9px 10px; border-radius: 10px; border: 2px solid var(--line); background: var(--paper2); color: var(--ink); font: inherit; font-size: 14px; outline: none; }
.dock-form .btn { padding: 8px 12px; font-size: 13px; }
.float-emo {
  position: fixed; bottom: 90px; z-index: 85; pointer-events: none; display: flex; flex-direction: column; align-items: center;
  animation: floatup 2.4s ease-out forwards;
}
.float-emo span { font-size: 46px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.15)); }
.float-emo small { font-size: 11px; background: var(--paper); color: var(--ink); padding: 1px 8px; border-radius: 999px; }
@keyframes floatup { 0% { transform: translateY(40px) scale(.4); opacity: 0; } 15% { transform: translateY(0) scale(1.1); opacity: 1; } 100% { transform: translateY(-50vh) scale(1); opacity: 0; } }

/* 投票结果 */
.vote-panel { margin-top: 18px; padding: 22px 24px; }
.vote-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 12px; }
.vote-col { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border-radius: 12px; background: var(--paper2); position: relative; }
.vote-col.truth { box-shadow: 0 0 0 3px var(--accent); }
.vote-col .portrait { width: 64px; height: 76px; }
.vote-col em { position: absolute; top: -10px; right: -6px; background: var(--accent); color: #fff; font-style: normal; font-size: 12px; padding: 2px 8px; border-radius: 6px; transform: rotate(8deg); }
.vote-bar { width: 22px; height: 70px; border-radius: 6px; background: var(--hud-track); display: flex; align-items: flex-end; overflow: hidden; }
.vote-bar i { display: block; width: 100%; background: var(--accent); transition: height 1s; }
.voters { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; font-size: 11px; }

/* 商城预览 */
.item-prev, .emo-prev, .name-prev { align-items: center; justify-content: center; background: var(--paper); }
.emo-prev { gap: 4px; font-size: 22px; }
.name-prev b { font-size: 18px; font-family: var(--serif); }
.shop-tabs { overflow-x: auto; scrollbar-width: none; }
.shop-tab { white-space: nowrap; }

/* ========== 响应式：平板 / 手机 ========== */
@media (max-width: 1180px) {
  .table { grid-template-columns: 240px 1fr; }
  .table > .col:last-child { grid-column: 1 / -1; }
  .cover { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .topbar { padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
  .brand-sub, .profile .meta { display: none; }
  .brand-name { font-size: 15px; }
  .brand-mark { width: 32px; height: 32px; font-size: 18px; }
  .top-right { gap: 6px; }
  .chip { padding: 6px 10px; font-size: 12px; }
  .top-right [data-act="archive"] { display: none; }
  .profile .avatar { width: 30px; height: 30px; font-size: 14px; }

  .cover { padding: 20px 14px 40px; gap: 18px; }
  .folder { padding: 30px 22px 26px; transform: none; }
  .folder h1 { font-size: 32px; }
  .folder .stamp { font-size: 15px; right: 16px; top: 16px; }
  .folder .intro p { font-size: 15px; }
  .btn.big { padding: 14px 22px; font-size: 16px; }

  .table { grid-template-columns: 1fr; padding: 10px 10px 90px; gap: 12px; }
  .table > .col { display: contents; }
  .hud { order: 1; position: sticky; top: 52px; z-index: 10; padding: 8px 12px; border-radius: 12px; }
  .hud-title .label { display: none; }
  .hud-title h2 { font-size: 16px; }
  .hud-pill { min-width: 48px; padding: 4px 8px; }
  .hud-pill b { font-size: 17px; }
  .dial svg { width: 44px; height: 44px; }
  .dial .t b { font-size: 17px; }
  .map { order: 2; padding: 12px; gap: 10px; min-height: 0; }
  .board { order: 3; }
  .table > .col:first-child > .panel:first-child { order: 4; }
  .log { order: 5; max-height: 220px; }
  .hint-card { order: 6; }
  .room-art { height: 52px; }
  .room-art .ico { font-size: 26px; }
  .room-body { padding: 8px 10px 10px; }
  .room .rn { font-size: 15px; }
  .room .rd { font-size: 11px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .evgrid { grid-template-columns: repeat(3, 1fr); }

  .modal-mask { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); animation: sheet .3s ease; }
  @keyframes sheet { from { transform: translateY(40%); } }
  .room-banner { margin: -22px -16px 14px; }
  .talk { grid-template-columns: 1fr; gap: 12px; }
  .talk > div:first-child { display: flex; align-items: center; gap: 12px; }
  .talk > div:first-child h2 { margin-top: 0 !important; }
  .talk .portrait { width: 72px; height: 86px; flex: none; }
  .hotspots, .result-grid, .achs { grid-template-columns: 1fr; }
  .opts { grid-template-columns: 1fr; }
  .picker { grid-template-columns: repeat(3, 1fr); }
  .arch-stats { grid-template-columns: repeat(2, 1fr); }
  .items { grid-template-columns: 1fr 1fr; }
  .pass-hero { flex-direction: column; align-items: flex-start; }

  .ending { padding: 20px 12px 100px; }
  .ending .scene { padding: 28px 20px; }
  .ending .scene h2 { font-size: 22px; padding-right: 70px; }
  .ending .scene p { font-size: 15px; }
  .ending .rating { width: 66px; height: 66px; font-size: 40px; right: 14px; top: 14px; }
  .vn { padding: 24px 12px 100px; }
  .vn .stage { padding: 26px 20px; }
  .vn .stage p { font-size: 15px; }
  .share-card { width: 100%; }

  .lobby { padding: 16px 10px 120px; }
  .lobby-card { padding: 22px 16px; }
  .room-code span { width: 50px; height: 60px; font-size: 32px; }
  .seats { grid-template-columns: repeat(3, 1fr); }
  .vote-row { gap: 8px; }

  .dock { left: 0; right: 0; bottom: 0; width: auto; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .dock-chat { height: 160px; }
  #toast-root { left: 12px; right: 12px; top: 60px; }
  .toast { max-width: none; }
}
@media (hover: none) {
  .room:hover, .npc:hover, .ev:hover, .btn:hover { transform: none; }
}

/* ========== 多案件 ========== */
.main-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.case-tabs { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 8px; }
.case-tab {
  flex: 1 0 170px; text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--paper); color: var(--ink);
  box-shadow: 0 5px 0 rgba(0,0,0,.14); display: flex; flex-direction: column; gap: 3px; transition: transform .15s;
}
.case-tab:hover { transform: translateY(-2px); }
.case-tab.on { background: var(--accent); color: var(--accent-ink); }
.case-tab.on small, .case-tab.on .ct-no { color: inherit; opacity: .85; }
.case-tab.lock { opacity: .55; cursor: not-allowed; background: var(--paper2); }
.case-tab.lock:hover { transform: none; }
.case-tab.soon { border: 2px dashed var(--line); box-shadow: none; }
.case-tab .ct-no { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); letter-spacing: 1px; }
.case-tab b { font-family: var(--serif); font-size: 15px; }
.case-tab small { font-size: 11px; color: var(--ink-soft); }
.case-tab .new { font-style: normal; background: var(--hl); color: #3a2c00; padding: 0 6px; border-radius: 4px; font-weight: 700; }
.memory-note.carry { border-left-color: #3f7f93; background: rgba(63, 127, 147, .1); }
.memory-note.carry small { color: var(--ink-soft); line-height: 1.7; }
.carry-mini { display: block; margin-top: 4px; color: #3f7f93; font-weight: 600; }
.lobby .case-tabs { margin-bottom: 12px; }
.hotspot.secret { border-style: dashed; border-color: #3f7f93; background: rgba(63, 127, 147, .08); }
.hotspot.secret .hn::after { content: " · 时间线专属"; font-size: 11px; font-family: var(--sans); color: #3f7f93; }
@media (max-width: 760px) {
  .case-tab { flex-basis: 150px; padding: 10px 12px; }
}

/* 生成美术（tools/gen-art.js） */
.art-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-art { margin: -44px -46px 22px; height: 220px; overflow: hidden; border-radius: 14px 14px 0 0; }
@media (max-width: 760px) { .cover-art { margin: -30px -22px 18px; height: 150px; } }

/* ========== 剧本杀 ========== */
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 6px; }
.mode-tabs button { text-align: left; padding: 14px; border-radius: 14px; background: var(--paper2); font-weight: 700; font-size: 16px; display: flex; flex-direction: column; gap: 4px; border: 2px solid transparent; }
.mode-tabs button small { font-weight: 400; font-size: 12px; color: var(--ink-soft); }
.mode-tabs button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--paper)); }
.seat.bot { background: color-mix(in srgb, #3f7f93 12%, var(--paper2)); }
.seat.bot .avatar { background: linear-gradient(135deg, #3f7f93, #24445a); font-size: 15px; }
.script-card { display: flex; gap: 0; border-radius: 14px; overflow: hidden; background: var(--paper2); margin-bottom: 12px; }
.script-card .sc-art { width: 120px; flex: none; }
.script-card .sc-art svg { width: 100%; height: 100%; display: block; }
.script-card .sc-body { padding: 14px 16px; }
.script-card h3 { font-size: 20px; margin: 2px 0 6px; }
.script-card p { margin: 0 0 6px; font-family: var(--serif); font-size: 13px; line-height: 1.7; }
.script-card small { color: var(--ink-soft); font-size: 12px; }
.bot-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: var(--paper2); margin-bottom: 12px; font-size: 14px; }
.bot-row b { font-size: 18px; min-width: 20px; text-align: center; }
.bot-row small { color: var(--ink-soft); font-size: 12px; }
.btn.sm { padding: 6px 12px; font-size: 13px; letter-spacing: 0; }
.script-shelf { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.shelf-item { padding: 8px 12px; border-radius: 10px; background: var(--paper2); font-family: var(--serif); font-weight: 700; font-size: 13px; display: flex; flex-direction: column; }
.shelf-item small { font-family: var(--sans); font-weight: 400; font-size: 11px; color: var(--ink-soft); }
.shelf-item.on { box-shadow: 0 0 0 2px var(--accent); }
.shelf-item.lock { opacity: .55; }

.mm { max-width: 1440px; margin: 0 auto; padding: 16px 20px 120px; display: flex; flex-direction: column; gap: 16px; }
.mm-hud { display: flex; align-items: center; gap: 18px; padding: 14px 20px; flex-wrap: wrap; border-radius: 14px; }
.mm-title h2 { font-size: 20px; }
.stepper { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.stepper li { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.stepper li i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; background: var(--hud-track); }
.stepper li.done i { background: var(--ink-soft); color: var(--paper); }
.stepper li.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.stepper li.on i { background: rgba(255,255,255,.3); }
.mm-hud-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.mm-hud-right small { font-size: 11px; color: var(--ink-soft); }
.mm-timer { font-family: var(--mono); font-size: 24px; font-weight: 700; }
.mm-timer.over { color: var(--accent); animation: pulse 1s infinite; }

.mm-grid { display: grid; grid-template-columns: 320px 1fr 330px; gap: 16px; align-items: start; }
.mm-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.role-card { padding: 16px; position: sticky; top: 76px; border-radius: 14px; }
.role-card.culprit { box-shadow: 0 0 0 3px var(--accent), 0 6px 0 rgba(0,0,0,.12); }
.rc-top { display: flex; gap: 12px; align-items: center; }
.rc-top .portrait { width: 76px; height: 92px; flex: none; }
.rc-top h3 { font-size: 22px; }
.rc-top small { font-size: 12px; color: var(--ink-soft); }
.rc-tabs { display: flex; gap: 6px; margin: 14px 0 10px; }
.rc-tabs button { flex: 1; padding: 8px; border-radius: 10px; background: var(--paper2); font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.rc-tabs button.on { background: var(--ink); color: var(--paper); }
.rc-body { max-height: calc(100vh - 330px); overflow-y: auto; padding-right: 4px; }
.rc-body p { font-family: var(--serif); font-size: 14px; line-height: 1.85; margin: 0 0 8px; }
.rc-body h4 { font-size: 14px; margin: 14px 0 6px; color: var(--accent); }
.secret-box { padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, var(--paper)); border-left: 4px solid var(--accent); margin-bottom: 12px; }
.goal { padding: 10px 14px; border-radius: 12px; background: var(--paper2); margin-bottom: 12px; }
.goal.tips { background: color-mix(in srgb, var(--hl) 25%, var(--paper)); }
.tasks { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 6px; }
.tasks li { padding: 8px 12px; border-radius: 10px; background: var(--paper2); font-size: 13px; display: flex; flex-direction: column; gap: 2px; border-left: 4px solid #5eb37f; }
.tasks li.bad { border-left-color: var(--accent); }
.tasks li small { font-size: 11px; color: var(--ink-soft); }
.prologue p { font-family: var(--serif); font-size: 15px; line-height: 1.9; margin: 0; }

.language-toggle { flex: none; min-width: 56px; font-weight: 700; }
html[lang="en"] body { font-family: Inter, "Avenir Next", "Segoe UI", sans-serif; }
html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3,
html[lang="en"] .label, html[lang="en"] .case-no { font-family: Georgia, "Times New Roman", serif; letter-spacing: 0; }
html[lang="en"] .top-right { min-width: 0; }
html[lang="en"] .hero-modes, html[lang="en"] .hero-join { min-width: 0; }
@media (max-width: 760px) {
  .language-toggle { min-width: 48px; padding: 7px 9px; }
  html[lang="en"] .top-right { gap: 5px; }
}

.mm-locs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.mm-loc { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: var(--paper2); text-align: left; box-shadow: 0 4px 0 rgba(0,0,0,.12); transition: transform .15s; }
.mm-loc:not([disabled]):hover { transform: translateY(-3px); }
.mm-loc[disabled] { cursor: default; filter: saturate(.5); opacity: .7; box-shadow: none; }
.mm-loc .room-art { height: 54px; }
.mm-loc .room-art .ico { font-size: 26px; }
.mm-loc b { font-family: var(--serif); padding: 8px 10px 0; font-size: 15px; }
.mm-loc small { padding: 2px 10px 10px; font-size: 11px; color: var(--ink-soft); line-height: 1.5; }
.mm-loc:not([disabled]) { box-shadow: 0 4px 0 rgba(0,0,0,.12), 0 0 0 2px var(--hl); }

.clue-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.clue { padding: 12px 14px; border-radius: 12px; background: #fffdf6; color: #24312d; border-top: 5px solid var(--hl); box-shadow: 0 3px 0 rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 6px; animation: evin .5s ease; }
body[data-theme="neon"] .clue { background: #2b2656; color: #ece9ff; }
.clue.pub { border-top-color: #5eb37f; }
.clue-loc { font-size: 11px; color: #7a857f; }
.clue b { font-family: var(--serif); font-size: 15px; }
.clue p { margin: 0; font-family: var(--serif); font-size: 13px; line-height: 1.7; }
.clue .btn { align-self: flex-start; }
.clue .tag { align-self: flex-start; }
.tag.gold { background: var(--hl); color: #3a2c00; }

.cast { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: start; padding: 10px; border-radius: 12px; margin-bottom: 8px; background: var(--paper2); }
.cast.me { box-shadow: 0 0 0 2px var(--ink); }
.cast.voted { box-shadow: 0 0 0 3px var(--accent); }
.cast .portrait { width: 52px; height: 62px; }
.cast-info b { font-family: var(--serif); font-size: 16px; }
.cast-info small { font-size: 11px; color: var(--ink-soft); }
.cast-player { font-size: 12px; margin: 2px 0 4px; }
.cast-info p { margin: 0; font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.cast-act { display: flex; flex-direction: column; gap: 6px; }

.mm-reveal { display: flex; flex-direction: column; gap: 16px; max-width: 1000px; width: 100%; margin: 0 auto; }
.verdict { padding: 24px; text-align: center; border-radius: 16px; }
.verdict h2 { font-size: 40px; margin: 6px 0 16px; }
.verdict.caught h2 { color: #3f8f63; }
.verdict.escaped h2 { color: var(--accent); }
.mm-votes { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.truth { padding: 24px 28px; border-radius: 16px; }
.truth h3, .secrets-panel h3 { font-size: 20px; margin-bottom: 12px; }
.truth p { font-family: var(--serif); font-size: 16px; line-height: 1.95; margin: 0 0 4px; opacity: 0; animation: fadein .8s forwards; }
.truth .ending-line { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--paper2); font-style: italic; }
.secrets-panel { padding: 22px 24px; border-radius: 16px; }
.secrets { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.secret-card { display: grid; grid-template-columns: 60px 1fr; gap: 12px; padding: 14px; border-radius: 14px; background: var(--paper2); border-left: 5px solid #5eb37f; }
.secret-card.lose { border-left-color: var(--accent); }
.secret-card.mvp { box-shadow: 0 0 0 3px var(--hl), 0 0 18px var(--glow); }
.secret-card .portrait { width: 60px; height: 72px; }
.secret-card b { font-family: var(--serif); font-size: 16px; }
.secret-card p { font-family: var(--serif); font-size: 13px; line-height: 1.7; margin: 6px 0; }
.secret-card .tag { margin-left: 4px; }
.secret-card > div > small { font-size: 12px; color: var(--ink-soft); }

.msg.dm { background: color-mix(in srgb, var(--hl) 22%, transparent); padding: 6px 8px; border-radius: 8px; margin: 4px 0; }
.msg.whisper { background: rgba(63, 127, 147, .12); padding: 4px 8px; border-radius: 8px; }
.msg.whisper i { display: block; font-size: 11px; font-style: normal; color: #3f7f93; }
.msg.bot b { color: #3f7f93; }
#dockTo { max-width: 92px; border-radius: 10px; border: 2px solid var(--line); background: var(--paper2); color: var(--ink); font: inherit; font-size: 12px; padding: 0 4px; }

@media (max-width: 1180px) {
  .mm-grid { grid-template-columns: 300px 1fr; }
  .mm-grid > .mm-col:last-child { grid-column: 1 / -1; }
  .mm-locs { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .mm { padding: 10px 10px 120px; gap: 12px; }
  .mm-hud { position: sticky; top: 52px; z-index: 10; padding: 10px 12px; gap: 8px; }
  .mm-title { display: none; }
  .stepper { order: 2; flex-basis: 100%; }
  .stepper li span { display: none; }
  .stepper li.on span { display: inline; }
  .mm-hud-right { flex: 1; justify-content: space-between; }
  .mm-timer { font-size: 20px; }
  .mm-grid { grid-template-columns: 1fr; }
  .role-card { position: static; }
  .rc-body { max-height: 45vh; }
  .mm-locs { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .mm-loc .room-art { height: 40px; }
  .clue-list { grid-template-columns: 1fr; }
  .mode-tabs { grid-template-columns: 1fr; }
  .script-card .sc-art { width: 70px; }
  .verdict h2 { font-size: 30px; }
  .truth { padding: 20px 18px; }
}

/* 突发事件 / 聚光灯 / 差点暴露 */
.btn.solo { width: 100%; margin-top: 10px; padding: 14px; font-size: 15px; background: linear-gradient(120deg, var(--accent), #e8945a); }
.twist-pop { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 20px; background: rgba(8, 12, 10, .55); backdrop-filter: blur(3px); animation: fade .25s; cursor: pointer; }
.tp-card { width: min(460px, 100%); padding: 26px 28px; border-radius: 20px; background: var(--paper); color: var(--ink); text-align: center; box-shadow: 0 10px 0 rgba(0,0,0,.2); animation: twistIn .55s cubic-bezier(.2, 1.5, .4, 1); border-top: 8px solid var(--hl); }
@keyframes twistIn { from { transform: scale(.5) rotate(-6deg); opacity: 0; } }
.tp-card h2 { font-size: 30px; margin: 6px 0 10px; }
.tp-card > p { font-family: var(--serif); line-height: 1.8; margin: 0 0 14px; }
.tp-clue { text-align: left; padding: 12px 14px; border-radius: 12px; background: var(--paper2); display: flex; flex-direction: column; gap: 4px; }
.tp-clue small { color: var(--ink-soft); font-size: 12px; }
.tp-clue b { font-family: var(--serif); font-size: 16px; }
.tp-clue p { margin: 0; font-family: var(--serif); font-size: 13px; line-height: 1.7; }
.tp-clue.note { background: color-mix(in srgb, var(--hl) 30%, var(--paper)); }
.tp-tap { display: block; margin-top: 14px; font-size: 11px; color: var(--ink-soft); }
.twist-hint { color: var(--accent) !important; font-weight: 700; }

.spotlight { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px; color: #fff;
  background: radial-gradient(260px 160px at 12% 30%, rgba(255, 230, 140, .45), transparent 70%), linear-gradient(120deg, #2a2f3a, #171a22); box-shadow: 0 6px 0 rgba(0,0,0,.18); animation: fadein .5s; }
.spotlight.me { box-shadow: 0 0 0 3px var(--hl), 0 6px 0 rgba(0,0,0,.18); }
.spotlight .portrait { width: 64px; height: 76px; box-shadow: 0 0 24px rgba(255, 230, 140, .6); }
.spotlight .label { color: #ffe68c; }
.spotlight b { font-family: var(--serif); font-size: 18px; }
.spotlight small { opacity: .75; font-size: 12px; }
.spotlight p { margin: 4px 0; font-family: var(--serif); font-size: 15px; line-height: 1.7; }
.spotlight .sp-state { opacity: 1; color: #ffe68c; }

.clue.dmclue { border-top-color: #e8945a; }
.clue.peek { border-top-color: #7a6fd0; background: color-mix(in srgb, #7a6fd0 8%, #fffdf6); }
.clue.note { border-top-color: var(--accent); background: color-mix(in srgb, var(--hl) 22%, #fffdf6); }
.near-miss { padding: 18px 22px; border-radius: 16px; border-left: 6px solid var(--hl); animation: fadein .6s; }
.near-miss p { margin: 4px 0 0; font-family: var(--serif); font-size: 17px; line-height: 1.8; }
.near-miss.mine { border-left-color: var(--accent); }
.close-line { margin-top: 6px; font-size: 12px; line-height: 1.6; padding: 6px 10px; border-radius: 8px; background: rgba(0,0,0,.04); }
.close-line.close { background: color-mix(in srgb, var(--hl) 25%, transparent); font-weight: 600; }
.msg.dm.twist { background: color-mix(in srgb, #e8945a 25%, transparent); }
.msg.dm.spot { background: rgba(42, 47, 58, .12); }
@media (max-width: 760px) {
  .spotlight { grid-template-columns: 52px 1fr; }
  .spotlight .portrait { width: 52px; height: 62px; }
  .spotlight .btn { grid-column: 1 / -1; }
  .tp-card h2 { font-size: 24px; }
}

/* ========== 剧本杀 · 可视化操作 ========== */
.view-tabs { display: flex; gap: 8px; }
.view-tabs button { flex: 1; padding: 12px 10px; border-radius: 14px 14px 0 0; background: rgba(255,255,255,.12); color: var(--top-ink); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.view-tabs button.on { background: var(--paper); color: var(--ink); }
.view-tabs i { font-style: normal; font-size: 11px; background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 7px; }
.view-body { border-radius: 0 0 14px 14px !important; margin-top: -14px; }
.hint-line { text-align: center; color: var(--top-ink); opacity: .8; }

/* 现场 */
.loc-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 10px; }
.loc-tabs button { white-space: nowrap; padding: 8px 12px; border-radius: 999px; background: var(--paper2); font-size: 13px; font-weight: 600; position: relative; }
.loc-tabs button.on { background: var(--ink); color: var(--paper); }
.loc-tabs i { font-style: normal; margin-left: 6px; background: var(--hl); color: #3a2c00; border-radius: 999px; padding: 0 6px; font-size: 11px; }
.mm-scene { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #222; }
.scene-bg, .scene-bg svg, .scene-bg img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.mm-scene::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.35)); pointer-events: none; }
.scene-cap { position: absolute; left: 12px; bottom: 10px; z-index: 2; max-width: 70%; padding: 6px 10px; border-radius: 8px; background: rgba(0,0,0,.45); color: #fff; font-family: var(--serif); font-size: 12px; }
.hs { position: absolute; z-index: 3; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hs-dot { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: rgba(255,255,255,.92); box-shadow: 0 4px 0 rgba(0,0,0,.25); transition: transform .15s; }
.hs-label { padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; white-space: nowrap; }
.mm-scene.can-search .hs.free .hs-dot { box-shadow: 0 4px 0 rgba(0,0,0,.25), 0 0 0 0 var(--glow); animation: hsPulse 1.6s infinite; }
@keyframes hsPulse { 0% { box-shadow: 0 4px 0 rgba(0,0,0,.25), 0 0 0 0 var(--glow); } 70% { box-shadow: 0 4px 0 rgba(0,0,0,.25), 0 0 0 16px transparent; } }
.hs:not([disabled]):hover .hs-dot { transform: scale(1.15); }
.hs.searching .hs-dot { animation: spin .8s linear infinite; }
.hs.taken { opacity: .6; }
.hs.taken .hs-dot { background: rgba(120,120,120,.85); color: #fff; font-size: 18px; }
.hs.mine .hs-dot { background: var(--hl); box-shadow: 0 4px 0 rgba(0,0,0,.25), 0 0 0 3px #fff; }
.hs.new .hs-label::after { content: " NEW"; color: var(--hl); font-weight: 700; }
.hs[disabled] { cursor: default; }
.scene-foot { margin-top: 10px; text-align: center; font-size: 14px; color: var(--ink-soft); }
.scene-foot .lens { letter-spacing: 2px; }

/* 线索卡 */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.ccard { position: relative; display: flex; flex-direction: column; text-align: left; border-radius: 14px; overflow: hidden; background: #fffdf6; color: #24312d; box-shadow: 0 4px 0 rgba(0,0,0,.1); transition: transform .15s; }
body[data-theme="neon"] .ccard { background: #2b2656; color: #ece9ff; }
.ccard:hover { transform: translateY(-3px); }
.cc-art { height: 86px; display: grid; place-items: center; background: linear-gradient(135deg, #f6e9c9, #e8d2a6); overflow: hidden; }
.ccard.private .cc-art { background: linear-gradient(135deg, #dfe8f6, #b9c9e2); }
.ccard.peek .cc-art { background: linear-gradient(135deg, #e5defa, #c2b5ef); }
.ccard.note .cc-art { background: linear-gradient(135deg, #fff1b8, #ffd36e); }
.ccard.hit { box-shadow: 0 0 0 3px var(--accent), 0 4px 0 rgba(0,0,0,.1); }
.cc-emoji { font-size: 40px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.15)); }
.cc-art img { width: 100%; height: 100%; object-fit: cover; }
.cc-body { padding: 8px 10px 10px; }
.cc-body b { font-family: var(--serif); font-size: 14px; display: block; }
.cc-body p { margin: 4px 0 0; font-size: 12px; line-height: 1.5; color: #5d6b64; }
.time { position: absolute; top: 6px; left: 6px; font-style: normal; font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: rgba(0,0,0,.65); color: #fff; }
.cc-badge { position: absolute; top: 6px; right: 6px; font-size: 10px; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.9); color: #24312d; }
.cc-badge.ok { background: #5eb37f; color: #fff; }
.cc-badge.red { background: var(--accent); color: #fff; }

/* 线索详情 */
.cd { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
.cd-art { height: 200px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, #f6e9c9, #e8d2a6); }
.cd-art .cc-emoji { font-size: 84px; }
.cd-art img { width: 100%; height: 100%; object-fit: cover; }
.cd-short { font-family: var(--serif); font-size: 18px; font-weight: 700; margin: 8px 0; }
.cd-text { font-family: var(--serif); font-size: 14px; line-height: 1.85; color: var(--ink-soft); margin: 0 0 12px; }
.cd-found { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, var(--paper)); margin-bottom: 12px; font-size: 13px; }
.cd-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cd-actions small { color: var(--ink-soft); font-size: 12px; }
.cd-roles { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.cd-role { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; text-align: left; padding: 8px; border-radius: 12px; background: var(--paper2); border: 2px solid transparent; }
.cd-role:hover:not([disabled]) { border-color: var(--accent); }
.cd-role[disabled] { opacity: .45; }
.cd-role .portrait { width: 44px; height: 52px; }
.cd-role small { display: block; font-size: 11px; color: var(--ink-soft); line-height: 1.5; }

/* 翻卡 */
.clue-pop { position: fixed; inset: 0; z-index: 92; display: grid; place-items: center; background: rgba(8,12,10,.4); cursor: pointer; animation: fade .2s; perspective: 900px; }
.cp-card { width: 230px; height: 300px; position: relative; transform-style: preserve-3d; animation: flip .7s .15s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes flip { from { transform: rotateY(180deg) scale(.7); } to { transform: rotateY(0) scale(1); } }
.cp-front, .cp-back { position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden; box-shadow: 0 10px 0 rgba(0,0,0,.2); }
.cp-front { display: grid; place-items: center; font-size: 60px; background: var(--ink); transform: rotateY(180deg); }
.cp-back { background: #fffdf6; color: #24312d; padding: 14px; display: flex; flex-direction: column; gap: 8px; text-align: center; }
.cp-back .cd-art { height: 140px; }
.cp-back .cd-art .cc-emoji { font-size: 64px; }
.cp-back b { font-family: var(--serif); font-size: 18px; }
.cp-back p { margin: 0; font-size: 13px; line-height: 1.6; }
.cp-back .time { position: static; align-self: center; }

/* 时间线 */
.tl-wrap { min-width: 0; }
.tl { min-width: 0; }
.tl-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: start; gap: 8px; min-height: 52px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.tl-name { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.tl-name b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tl-name .portrait { width: 30px; height: 36px; flex: none; border-radius: 8px; }
.tl-name i { font-style: normal; font-size: 11px; color: #fff; background: var(--accent); border-radius: 999px; padding: 0 6px; }
.tl-body { min-width: 0; }
.tl-tooltip { position: fixed; z-index: 1000; width: max-content; max-width: min(360px, calc(100vw - 24px)); padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--ink); color: var(--paper); box-shadow: 0 4px 16px rgba(0,0,0,.2); font-size: 13px; line-height: 1.6; font-weight: 400; white-space: normal; overflow-wrap: anywhere; pointer-events: none; }
.tl-bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tl-track { position: relative; height: 32px; }
.tl-head { min-height: 32px; padding-bottom: 0; }
.tl-head .tl-track { height: 24px; }
.tl-head span { position: absolute; transform: translateX(-50%); font-family: var(--mono); font-size: 11px; color: var(--ink-soft); }
.tl-head span:first-child { transform: none; }
.tl-head span:last-child { transform: translateX(-100%); }
.tl-ev .tl-track { height: 70px; margin-bottom: 6px; background: color-mix(in srgb, var(--hl) 10%, transparent); border-radius: 8px; }
.tl-anchor { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--accent); }
.tl-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
.tl-events li { min-width: 0; overflow-wrap: anywhere; }
.tl-events time, .tl-echo time { display: inline-block; margin-right: 6px; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.tl-ev .tl-events time { color: var(--accent); }
.tl-published { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tl-published .chip-clue { max-width: 100%; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.tl-published time { font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.tl-line { position: absolute; top: 0; bottom: 0; border-left: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); }
.tl-pin { position: absolute; transform: translateX(-50%); width: 30px; height: 30px; border-radius: 50%; background: #fffdf6; box-shadow: 0 3px 0 rgba(0,0,0,.2); font-size: 16px; display: grid; place-items: center; transition: transform .15s; }
.tl-pin:hover { transform: translateX(-50%) scale(1.2); z-index: 2; }
.tl-pin.hit { box-shadow: 0 0 0 3px var(--accent), 0 3px 0 rgba(0,0,0,.2); }
.tl-bar { position: absolute; top: 10px; height: 12px; border-radius: 4px; background: var(--paper2); border: 1.5px solid var(--line); }
.tl-row.broken .tl-bar { border-color: var(--accent); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--paper)) 0 6px, var(--paper) 6px 12px); }
.tl-hit { position: absolute; top: 6px; transform: translateX(-50%); z-index: 2; padding: 2px 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; animation: pop .4s; }
.tl-untimed { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.chip-clue { padding: 5px 10px; border-radius: 999px; background: var(--paper2); font-size: 12px; }
.chip-clue.hit { box-shadow: 0 0 0 2px var(--accent); }
.tl-help { font-size: 12px; color: var(--ink-soft); line-height: 1.7; margin: 12px 0 0; }
@media (max-width: 640px) {
  .tl-row { grid-template-columns: 104px minmax(0, 1fr); }
  .tl-name { font-size: 12px; }
  .tl-head span:nth-child(even) { display: none; }
  .tl-head span { font-size: 10px; }
}

/* 角色卡瘦身 */
.brief { margin: 0 0 12px; padding: 0; list-style: none; counter-reset: b; display: flex; flex-direction: column; gap: 6px; }
.brief li { counter-increment: b; position: relative; padding: 8px 10px 8px 36px; border-radius: 10px; background: var(--paper2); font-size: 13px; line-height: 1.55; }
.brief li::before { content: counter(b); position: absolute; left: 10px; top: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center; }
.my-tl { list-style: none; margin: 6px 0 12px; padding: 0 0 0 10px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.my-tl li { position: relative; font-size: 13px; line-height: 1.5; }
.my-tl li::before { content: ""; position: absolute; left: -16px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.my-tl i { font-style: normal; font-family: var(--mono); font-weight: 700; margin-right: 6px; color: var(--accent); }
.full-script summary { cursor: pointer; font-size: 12px; color: var(--ink-soft); }
.full-script p { font-family: var(--serif); font-size: 13px; line-height: 1.8; margin: 8px 0 0; }

/* 嫌疑度 */
.sus { height: 6px; border-radius: 3px; background: var(--hud-track); overflow: hidden; margin-top: 4px; }
.sus i { display: block; height: 100%; background: linear-gradient(90deg, #ffb35c, var(--accent)); transition: width .6s; }
.sus-t { font-size: 11px !important; }
.cast.lit { box-shadow: 0 0 0 3px #ffe68c, 0 0 18px rgba(255,230,140,.6); }

@media (max-width: 760px) {
  .view-tabs button { font-size: 13px; padding: 10px 6px; }
  .hs-dot { width: 38px; height: 38px; font-size: 18px; }
  .hs-label { font-size: 10px; }
  .scene-cap { display: none; }
  .cgrid { grid-template-columns: repeat(2, 1fr); }
  .cd { grid-template-columns: 1fr; }
  .cd-art { height: 150px; }
}
@media (max-width: 760px) {
  .mm-hud { position: static; }
  .mm-hud-right .btn { padding: 9px 14px; font-size: 14px; }
}

/* 项目图标 */
img.brand-mark { display: block; object-fit: cover; border-radius: 10px; transform: rotate(-4deg); background: none; }

/* ========== 生成美术：图标与插图 ========== */
.gem { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -.18em; font-style: normal; }
.gem::before { content: "◆"; }
.has-gem .gem { background: var(--gem-img) center / contain no-repeat; }
.has-gem .gem::before { content: ""; }

/* 等级头像 */
.avatar:has(.rank-img) { background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%); }
.rank-img { width: 118%; height: 118%; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.rank-ladder { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 18px; }
.rung { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: 14px; background: var(--paper2); opacity: .5; filter: grayscale(.7); }
.rung.past { opacity: .8; filter: none; }
.rung.on { opacity: 1; filter: none; box-shadow: 0 0 0 3px var(--hl), 0 0 18px var(--glow); }
.rung-img { width: 76px; height: 76px; object-fit: contain; }
.rung > span { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-family: var(--serif); font-size: 28px; }
.rung b { font-family: var(--serif); font-size: 14px; }
.rung small { font-size: 11px; color: var(--ink-soft); }

/* Logo */
.game-logo { display: block; width: min(440px, 80%); margin: -8px auto -4px; filter: drop-shadow(0 6px 0 rgba(0,0,0,.18)); }
.sc-logo { display: block; width: 150px; margin: -6px 0 2px -6px; }

/* 季票 */
.season[style*="--pass-img"], .pass-hero[style*="--pass-img"] { background: linear-gradient(90deg, rgba(6,16,26,.94) 25%, rgba(6,16,26,.35)), var(--pass-img) center / cover; }
.season[style*="--pass-img"] { min-height: 190px; }
.season[style*="--pass-img"]::after { display: none; }
.pass-hero[style*="--pass-img"] { min-height: 220px; }

/* 房间表情 */
.emo-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.emo:has(.emo-img) { padding: 2px; background: transparent; width: 40px; height: 40px; }
.float-emo span:has(.emo-img) { width: 76px; height: 76px; display: block; }
.emo-prev span:has(.emo-img) { width: 34px; height: 34px; display: inline-block; }
.lead .emo-img { width: 22px; height: 22px; display: inline-block; vertical-align: -6px; }

/* 成就徽章 */
.medal:has(.medal-img) { width: 40px; height: 40px; background: none; box-shadow: none; }
.medal-img { width: 100%; height: 100%; object-fit: contain; }
.toast-ic { width: 26px; height: 26px; object-fit: contain; vertical-align: -8px; }

/* 充值档位 */
.pack-img { display: block; width: 84px; height: 84px; object-fit: contain; margin: 0 auto 4px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.12)); }

/* 案件证物 */
.ev .ei:has(.ei-img) { height: 54px; margin: -4px -4px 2px; }
.ei-img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; }
.ev-art { height: 200px; margin: -28px -30px 16px; border-radius: 18px 18px 0 0; overflow: hidden; }

/* 结局与剧情插图 */
.ending-art { height: 260px; margin: -40px -46px 22px; border-radius: 14px 14px 0 0; overflow: hidden; }
.verdict-art { height: 220px; margin: -24px -24px 16px; border-radius: 16px 16px 0 0; overflow: hidden; }
.stage.has-art { padding-top: 0; }
.stage-art { height: 240px; margin: 0 -40px 24px; overflow: hidden; }
.stage-art img { mask-image: linear-gradient(#000 60%, transparent); }

/* 剧本封面 */
.script-card .sc-art { width: 130px; }
.script-card .sc-art img { width: 100%; height: 100%; object-fit: cover; }
.shelf-item:has(.shelf-img) { flex-direction: row; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; }
.shelf-img { width: 34px; height: 48px; object-fit: cover; border-radius: 4px; }

@media (max-width: 760px) {
  .ending-art { height: 170px; margin: -28px -20px 18px; }
  .verdict-art { height: 150px; }
  .stage-art { height: 170px; margin: 0 -20px 18px; }
  .ev-art { margin: -22px -16px 14px; height: 160px; }
  .game-logo { width: 78%; }
  .rung-img, .rung > span { width: 58px; height: 58px; }
}

/* 页面背景大图 */
#bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
#bg.has-art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 35%, color-mix(in srgb, var(--desk) 45%, transparent), color-mix(in srgb, var(--desk2) 88%, transparent) 80%); }
.mp-art img, .sc-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-art { height: 96px; }

/* 突发事件插图 */
.tp-card { overflow: hidden; }
.tp-art { display: block; width: calc(100% + 56px); height: 170px; object-fit: cover; margin: -26px -28px 14px; }

/* 头像框贴图：替换原来的 CSS 描边 */
.has-frame-gear .avatar.f-gear, .has-frame-gold .avatar.f-gold, .has-frame-seal .avatar.f-seal { box-shadow: none; }
.has-frame-gear .avatar.f-gear::after, .has-frame-seal .avatar.f-seal::after { display: none; }
.has-frame-gear .avatar.f-gear::before, .has-frame-gold .avatar.f-gold::before, .has-frame-seal .avatar.f-seal::before {
  content: ""; position: absolute; inset: -26%; pointer-events: none; z-index: 2; background: center / contain no-repeat;
}
.has-frame-gear .avatar.f-gear::before { background-image: var(--frame-gear); animation: spin 18s linear infinite; }
.has-frame-gold .avatar.f-gold::before { background-image: var(--frame-gold); }
.has-frame-seal .avatar.f-seal::before { background-image: var(--frame-seal); }

/* ========== 首页（重新排版） ========== */
.home { max-width: 1240px; margin: 0 auto; padding: 24px 24px 60px; display: flex; flex-direction: column; gap: 22px; }
.hero {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 28px; align-items: center; padding: 28px 32px; border-radius: 22px; color: #f6f1e4;
  background: linear-gradient(120deg, rgba(10, 24, 22, .88), rgba(10, 24, 22, .55)); box-shadow: 0 10px 0 rgba(0,0,0,.18); backdrop-filter: blur(2px);
}
.hero .game-logo { width: min(400px, 100%); margin: -10px 0 0 -10px; }
.hero-title { font-size: 52px; letter-spacing: 6px; }
.english-wordmark { display: none; }
html[lang="en"] .hero .game-logo, html[lang="en"] .pg-logo { display: none; }
html[lang="en"] .english-wordmark { display: block; color: #fae6bc; }
.tagline { font-family: var(--serif); font-size: 18px; margin: 4px 0 18px; opacity: .9; }
.hero-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 16px; background: var(--paper); color: var(--ink); box-shadow: 0 5px 0 rgba(0,0,0,.18); }
.mode-card.mm { background: linear-gradient(135deg, #fff3e6, var(--paper)); box-shadow: 0 5px 0 rgba(0,0,0,.18), 0 0 0 3px var(--accent); }
.mode-card b { font-family: var(--serif); font-size: 18px; }
.mode-card small { font-size: 12px; color: var(--ink-soft); line-height: 1.6; flex: 1; }
.mode-card .btn { margin-top: 6px; }
.mode-card .btn.ghost { color: var(--ink); }
.hero-join { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.08); }
.hero-join .label { color: #f6f1e4; opacity: .7; white-space: nowrap; }
.hero-join .field { background: rgba(255,255,255,.92); border-color: transparent; padding: 9px 10px; }
.hero-join .field.code { max-width: 92px; font-size: 16px; }
.hero-join .btn { padding: 9px 14px; white-space: nowrap; }
.hero-join .btn.ghost { color: #f6f1e4; border-color: rgba(255,255,255,.35); }
.hero-right { display: flex; justify-content: center; }
.hero-book { position: relative; width: min(300px, 100%); aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; transform: rotate(3deg); box-shadow: 0 14px 0 rgba(0,0,0,.25), 0 20px 40px rgba(0,0,0,.35); }
.hero-book img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-book span { position: absolute; left: 0; right: 0; top: 0; padding: 18px 14px 40px; text-align: center; font-family: var(--serif); font-weight: 900; font-size: 20px; letter-spacing: 2px; background: linear-gradient(rgba(0,0,0,.65), transparent); }
.hero-book.plain { aspect-ratio: 3 / 2; }

.home-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.case-panel { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.case-file { display: grid; grid-template-columns: 38% 1fr; overflow: hidden; border-radius: 18px; padding: 0; }
.case-file:not(:has(.cf-art)) { grid-template-columns: 1fr; }
.cf-art { position: relative; min-height: 100%; }
.cf-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cf-body { position: relative; padding: 26px 28px; background: repeating-linear-gradient(transparent 0 31px, var(--line) 31px 32px), var(--paper); }
.case-file .stamp { position: absolute; right: 16px; top: 16px; font-family: var(--serif); font-weight: 900; font-size: 18px; color: var(--accent); border: 3px solid var(--accent); padding: 3px 10px; transform: rotate(10deg); letter-spacing: 3px; background: rgba(255,255,255,.75); border-radius: 4px; }
.case-file .case-no { font-family: var(--mono); color: var(--ink-soft); font-size: 12px; }
.case-file h2 { font-size: 34px; margin: 8px 0 10px; letter-spacing: 1px; }
.case-file .intro p { font-family: var(--serif); font-size: 15px; line-height: 1.9; margin: 0; }
.case-file .intro { margin-bottom: 18px; }
.case-file .row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.home-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .hero-right { display: none; }
  .home-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .home { padding: 12px 10px 40px; gap: 14px; }
  .hero { padding: 18px 16px; border-radius: 18px; }
  .hero .game-logo { width: 86%; margin: -6px auto 0; }
  .tagline { text-align: center; font-size: 15px; }
  .hero-modes { grid-template-columns: 1fr; }
  .hero-join { flex-wrap: wrap; }
  .hero-join .label { flex-basis: 100%; }
  .hero-join #nick { flex-basis: 100%; }
  .case-file { grid-template-columns: 1fr; }
  .cf-art { height: 170px; }
  .cf-body { padding: 20px 18px; }
  .case-file h2 { font-size: 26px; }
}
.hero { padding: 24px 32px; }
.hero .game-logo { width: min(420px, 100%); margin: 0 0 4px -6px; }
.hero-book { width: min(250px, 100%); }
.item-prev .avatar { width: 64px; height: 64px; font-size: 24px; }
.emo-prev { flex-wrap: wrap; gap: 2px; height: auto; min-height: 54px; padding: 4px; }
.emo-prev span:has(.emo-img) { width: 46px; height: 46px; }
.ending .rating { z-index: 3; background: rgba(251, 247, 238, .85); }
.chip { white-space: nowrap; }
@media (max-width: 760px) {
  .brand-name { display: none; }
  .top-right { gap: 5px; }
  .chip { padding: 6px 9px; }
}

/* ========== 回声回放 ========== */
.rec-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: rgba(214, 64, 64, .14); color: var(--top-ink); font-size: 13px; border: 1px solid rgba(214, 64, 64, .45); }
.rec-bar b { color: #ff8a7a; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 10px #ff4d4d; animation: pulse 1.2s infinite; flex: none; }
.echo-strip { padding: 12px 14px; border-radius: 16px; }
.echo-list { display: flex; gap: 10px; overflow-x: auto; padding: 8px 2px 4px; }
.echo-q { flex: 0 0 230px; display: grid; grid-template-columns: 44px 1fr; gap: 10px; text-align: left; padding: 10px; border-radius: 14px; background: var(--paper2); position: relative; transition: transform .15s; }
.echo-q:hover { transform: translateY(-2px); }
.echo-q::before { content: ""; position: absolute; left: 22px; top: -6px; width: 12px; height: 12px; background: var(--paper2); transform: rotate(45deg); }
.echo-q .portrait { width: 44px; height: 52px; }
.eq-b b { font-family: var(--serif); font-size: 14px; }
.eq-b .time { position: static; margin-left: 6px; }
.eq-b p { margin: 4px 0 0; font-family: var(--serif); font-size: 13px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.echo-q.mine { box-shadow: 0 0 0 2px var(--line); }
.echo-q.broken { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--paper)) 0 6px, var(--paper) 6px 12px); }
.echo-q.broken p { text-decoration: line-through; text-decoration-color: var(--accent); }
.eq-st { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 6px; padding: 1px 6px; }
.silent { color: var(--ink-soft); font-style: normal; }
.tl-echo { display: block; max-width: 100%; margin-top: 6px; padding: 4px 8px; border-radius: 10px 10px 10px 2px; background: #fff7d6; color: #3a2c00; font-size: 12px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; text-align: left; box-shadow: 0 2px 0 rgba(0,0,0,.15); border: 1.5px solid #e2b33c; }
.tl-echo.broken { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: line-through; }
.echo-pop .tp-card { width: min(560px, 100%); text-align: left; border-top-color: #ff6b6b; }
.ep-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.ep-row { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--paper2); animation: fadein .5s both; }
.ep-row:nth-child(2) { animation-delay: .25s; } .ep-row:nth-child(3) { animation-delay: .5s; } .ep-row:nth-child(4) { animation-delay: .75s; } .ep-row:nth-child(5) { animation-delay: 1s; } .ep-row:nth-child(6) { animation-delay: 1.25s; }
.ep-row .portrait { width: 40px; height: 48px; }
.ep-row p { margin: 2px 0 0; font-family: var(--serif); font-size: 14px; }
.ep-row .time { position: static; margin-left: 6px; }
.ed-quote { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; margin: 12px 0; padding: 14px; border-radius: 14px; background: #fff7d6; color: #3a2c00; }
.ed-quote .portrait { width: 64px; height: 76px; }
.ed-quote p { margin: 0; font-family: var(--serif); font-size: 18px; line-height: 1.7; }
.ed-clues { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip-img { width: 18px; height: 18px; object-fit: cover; border-radius: 4px; vertical-align: -4px; }

/* ========== 红线推理板 ========== */
.board { position: relative; border-radius: 14px; padding: 16px 12px 12px;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.12) 0 2px, transparent 3px) 0 0 / 18px 18px, radial-gradient(circle at 70% 60%, rgba(0,0,0,.08) 0 2px, transparent 3px) 0 0 / 22px 22px, linear-gradient(135deg, #c79a64, #a87a48); }
.board-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.board-svg path { fill: none; stroke: #c8102e; stroke-width: 2.5; stroke-linecap: round; filter: drop-shadow(0 2px 1px rgba(0,0,0,.35)); }
.board-cols { display: grid; gap: 8px; }
.bcol { display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 150px; padding: 6px 4px 10px; border-radius: 12px; transition: background .15s; }
.bcol.armed { background: rgba(255,255,255,.12); cursor: pointer; }
.bcol.over, .tray.over { background: rgba(255, 230, 140, .35); }
.bpin { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px 8px; background: #fffdf6; border-radius: 4px; box-shadow: 0 4px 6px rgba(0,0,0,.3); transform: rotate(-2deg); width: 100%; max-width: 110px; cursor: pointer; }
.bcol:nth-child(even) .bpin { transform: rotate(2deg); }
.bpin .pin { position: absolute; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff6b6b, #a30d24); box-shadow: 0 2px 2px rgba(0,0,0,.4); z-index: 3; }
.bpin .portrait { width: 64px; height: 76px; }
.bpin b { font-family: var(--serif); font-size: 14px; color: #24312d; }
.bcount { position: absolute; top: 6px; right: 6px; min-width: 20px; height: 20px; border-radius: 10px; background: #c8102e; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.bstack { display: flex; flex-direction: column; gap: 6px; width: 100%; align-items: center; margin-top: 18px; }
.bchip { position: relative; z-index: 3; display: flex; align-items: center; gap: 6px; width: 100%; max-width: 150px; padding: 6px 8px; border-radius: 6px; background: #fffdf6; color: #24312d; box-shadow: 0 3px 4px rgba(0,0,0,.25); font-size: 12px; cursor: grab; user-select: none; transition: transform .12s; }
.bchip:hover { transform: translateY(-2px); }
.bchip.sel { box-shadow: 0 0 0 3px #ffe68c, 0 3px 4px rgba(0,0,0,.25); transform: scale(1.04); }
.bchip.dragging { opacity: .5; }
.bc-ic { width: 26px; height: 26px; flex: none; display: grid; place-items: center; font-size: 16px; border-radius: 4px; overflow: hidden; }
.bc-ic .chip-img { width: 26px; height: 26px; }
.bc-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-weight: 700; }
.bc-x { width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.08); font-size: 13px; line-height: 1; flex: none; }
.bc-x:hover { background: #c8102e; color: #fff; }
.tray { position: relative; z-index: 3; margin-top: 12px; padding: 10px; border-radius: 12px; background: rgba(36, 26, 14, .35); transition: background .15s; }
.tray .label { color: #fff3dd; }
.tray-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tray-chips .bchip { width: auto; max-width: 180px; }
.board-sum { position: relative; z-index: 3; margin-top: 10px; text-align: center; color: #fff8ea; font-size: 13px; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.board-sum b { color: #ffe68c; font-size: 15px; }
.board-result { position: relative; padding: 20px 24px; border-radius: 16px; }
.board-result h3 { font-size: 20px; margin-bottom: 6px; }
.br-grade { position: absolute; right: 20px; top: 14px; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-weight: 900; font-size: 36px; border: 4px solid currentColor; transform: rotate(-10deg); color: var(--ink-soft); }
.br-grade.g-S { color: #d4a017; } .br-grade.g-A { color: #3f8f63; } .br-grade.g-B { color: #3f7f93; } .br-grade.g-C { color: var(--accent); }
.br-marks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.br-marks span { font-size: 12px; padding: 3px 8px; border-radius: 8px; background: var(--paper2); }
.br-marks .ok { background: color-mix(in srgb, #5eb37f 22%, var(--paper)); }
.br-marks .bad { background: color-mix(in srgb, var(--accent) 18%, var(--paper)); }
@media (max-width: 760px) {
  .view-tabs button { font-size: 12px; padding: 9px 4px; }
  .board { padding: 12px 6px 10px; }
  .board-cols { gap: 4px; }
  .bpin { padding: 8px 4px 6px; }
  .bpin .portrait { width: 44px; height: 52px; }
  .bpin b { font-size: 12px; }
  .bchip { padding: 4px 5px; font-size: 11px; gap: 4px; }
  .bc-ic, .bc-ic .chip-img { width: 20px; height: 20px; }
  .echo-q { flex-basis: 200px; }
}
.bpin { z-index: 3; }

/* ========== 多分辨率排版 ========== */
/* 大屏（≥1700）：内容加宽，房间聊天固定成右侧一栏，不再浮在游戏上 */
@media (min-width: 1700px) {
  .home { max-width: 1400px; }
  .hero-book { width: min(290px, 100%); }
  .mm { max-width: 1560px; }
  .mm-grid { grid-template-columns: 330px minmax(0, 1fr) 350px; }
  body.in-room #view { margin-right: 356px; }
  body.in-room .dock { top: 72px; bottom: 16px; right: 16px; width: 330px; display: flex; flex-direction: column; }
  body.in-room .dock .dock-body, body.in-room .dock.collapsed .dock-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  body.in-room .dock .dock-chat { flex: 1; height: auto; }
  body.in-room .dock .caret { display: none; }
  body.in-room .dock-head { cursor: default; }
  body.in-room #toast-root { right: 366px; }
}
/* 中屏（1181–1699）：三栏，侧栏略窄，给中间的现场 / 推理板更多空间 */
@media (min-width: 1181px) and (max-width: 1440px) {
  .mm-grid { grid-template-columns: 280px minmax(0, 1fr) 300px; }
  .mm { padding-left: 14px; padding-right: 14px; }
}
/* 平板（761–1180）：角色卡 + 主区两栏，登场角色放到下面横排 */
@media (min-width: 761px) and (max-width: 1180px) {
  .mm-grid { grid-template-columns: 260px minmax(0, 1fr); }
  .mm-grid > .mm-col:last-child .panel { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
  .mm-grid > .mm-col:last-child .panel > h3, .mm-grid > .mm-col:last-child .panel > p { grid-column: 1 / -1; }
  .mm-grid > .mm-col:last-child .cast { margin-bottom: 0; }
  .mm-hud { gap: 10px; }
  .stepper { order: 3; flex-basis: 100%; }
  .dock:not(.collapsed) { max-height: 60vh; }
  .home-grid { grid-template-columns: 1fr; }
  .home-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .home-side > * { min-width: 0; }
}
/* 手机：推理板的嫌疑人每行 3 个 */
@media (max-width: 760px) {
  .board-cols { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; row-gap: 14px; }
  .bcol { min-height: 0; }
  .echo-strip { padding: 10px; }
  .home-side { display: flex; }
}
@media (max-width: 400px) {
  .hero-join .btn { padding: 8px 10px; font-size: 13px; }
  .view-tabs { gap: 4px; }
  .view-tabs button i { display: none; }
}
@media (max-width: 760px) { .bstack .bc-t { white-space: normal; line-height: 1.25; font-size: 11px; } .bstack .bc-x { width: 16px; height: 16px; font-size: 11px; } }

/* 商城关闭时：隐藏商城按钮，墨晶只做展示 */
body.no-shop .topbar .chip-hot[data-act="shop"] { display: none; }
body.no-shop #crystals { cursor: default; pointer-events: none; }

/* 兑换所：称号与任务解锁 */
.titles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.title-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; background: var(--paper2); border: 2px solid transparent; }
.title-card b { font-family: var(--serif); font-size: 17px; }
.title-card small { font-size: 12px; color: var(--ink-soft); line-height: 1.5; flex: 1; }
.title-card .btn, .title-card .tag { align-self: flex-start; }
.title-card.on { border-color: var(--hl); box-shadow: 0 0 14px var(--glow); }
.title-card.locked { opacity: .55; }
.lockbtn { font-size: 12px !important; white-space: normal; line-height: 1.4; }
.seat-title { font-style: normal; font-size: 11px; color: #b8860b; background: color-mix(in srgb, var(--hl) 25%, transparent); padding: 1px 6px; border-radius: 6px; }
/* 多人游玩区：操作入口固定在内容顶部，案件背景按需打开。 */
.mm-playbar { display: flex; align-items: stretch; gap: 10px; padding: 8px; border-radius: 14px; position: sticky; top: 76px; z-index: 7; }
.mm-playbar .view-tabs { flex: 1; min-width: 0; }
.mm-playbar .view-tabs button { border-radius: 10px; }
.case-background-btn { flex: 0 0 auto; min-width: 112px; white-space: nowrap; }
.case-background-modal { max-width: 780px; }
.case-background-modal h2 { margin: 5px 0 14px; }
.case-background-modal p { font-family: var(--serif); font-size: 15px; line-height: 1.9; margin: 0 0 8px; }
.case-background-modal .illustrated-story { margin-top: 18px; }
@media (max-width: 760px) {
  .mm-playbar { top: 104px; padding: 6px; gap: 6px; overflow-x: auto; }
  .case-background-btn { min-width: 96px; padding: 9px 10px; font-size: 12px; }
  .mm-playbar .view-tabs { min-width: 470px; }
}
/* 首页主入口卡片提高文字对比度，保证背景插画上也能清楚阅读。 */
.mode-card .label { color: #53615c; font-weight: 800; opacity: 1; }
.mode-card small { color: #33433d; font-size: 13px; line-height: 1.7; }
.mode-card b { color: #182a25; }
.mode-card .btn { min-height: 44px; font-size: 14px; }
.hero-join .label { opacity: 1; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.45); }
@media (max-width: 760px) {
  .mode-card { padding: 15px; }
  .mode-card small { font-size: 13px; }
}
/* 游玩区快捷栏在纸面背景上使用高对比文字，非当前页也清晰可见。 */
.mm-playbar { background: var(--paper); border: 1px solid var(--line); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.mm-playbar .view-tabs button { color: var(--ink); background: var(--paper2); }
.mm-playbar .view-tabs button.on { color: var(--accent-ink); background: var(--accent); }
.mm-playbar .view-tabs button:hover { color: var(--ink); background: color-mix(in srgb, var(--hl) 35%, var(--paper)); }
.mm-playbar .view-tabs button.on:hover { color: var(--accent-ink); background: var(--accent); }

/* 首页响应式与柔和主题覆盖：桌面、iPad、手机分别保持稳定的内容宽度。 */
.home { width: min(100% - 32px, 1180px); padding: 20px 0 52px; }
.hero { grid-template-columns: minmax(0, 1.2fr) minmax(230px, .8fr); gap: 24px; padding: 26px 28px; }
.hero-left { min-width: 0; }
.hero-modes {
  align-items: stretch;
  --mode-action: color-mix(in srgb, var(--ink) 88%, var(--desk) 12%);
  --mode-action-hover: color-mix(in srgb, var(--mode-action) 90%, var(--paper) 10%);
}
.mode-card {
  min-width: 0; min-height: 228px;
  background: color-mix(in srgb, var(--paper) 88%, var(--desk) 12%);
  border: 1px solid color-mix(in srgb, var(--ink) 22%, var(--paper) 78%);
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
}
.mode-card.mm {
  background: var(--paper2);
  border-color: color-mix(in srgb, var(--ink) 22%, var(--paper) 78%);
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
}
.mode-card .label { color: color-mix(in srgb, var(--ink) 76%, var(--paper) 24%); }
.mode-card b { color: var(--ink); }
.mode-card small { color: color-mix(in srgb, var(--ink) 80%, var(--paper) 20%); }
.mode-card .btn { width: 100%; border: 1.5px solid transparent; box-shadow: none; }
.mode-card .btn:not(.ghost), .mode-card #toCase {
  background: var(--mode-action);
  color: var(--paper);
  border-color: var(--mode-action);
}
.mode-card .btn.ghost { background: transparent; color: var(--mode-action); border-color: color-mix(in srgb, var(--mode-action) 55%, var(--paper) 45%); }
.mode-card .btn:hover { filter: none; }
.mode-card .btn:not(.ghost):hover, .mode-card #toCase:hover { background: var(--mode-action-hover); border-color: var(--mode-action-hover); }
.mode-card .btn.ghost:hover { background: color-mix(in srgb, var(--mode-action) 8%, transparent); }
.mode-card .btn:focus-visible { outline: 2px solid var(--mode-action); outline-offset: 3px; }
.mode-card .btn:active { box-shadow: none; }
.hero-join {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(72px, 92px) auto;
  align-items: center;
}
.hero-join #nick { min-width: 0; width: 100%; }
.hero-join .field.code { width: 100%; }

/* 预览弹窗控制在舒适阅读宽度，内部滚动条保持纤细。 */
.modal { width: min(680px, calc(100vw - 32px)); max-height: 82vh; padding: 24px 26px; }
.modal.wide { width: min(860px, calc(100vw - 32px)); }
.case-background-modal { max-width: 680px; }
.modal figure > img { max-height: 44vh; object-fit: contain; }
.modal:has(.echo-explore), .modal:has(.case-background-modal) {
  width: min(760px, calc(100vw - 28px));
  max-height: 78vh;
  padding: 20px 22px;
}

@media (min-width: 761px) and (max-width: 1100px) {
  .home { width: min(100% - 28px, 960px); padding-top: 16px; }
  .hero { gap: 18px; padding: 22px; }
  .hero-modes { gap: 10px; }
  .mode-card { padding: 14px; min-height: 220px; }
  .mode-card b { font-size: 17px; }
  .hero-book { width: min(220px, 100%); }
  .home-grid { grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr); gap: 16px; }
}

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .hero-right { display: none; }
  .home-grid { grid-template-columns: 1fr; }
  .topbar { padding-inline: 12px; gap: 8px; }
  .top-right { min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .top-right::-webkit-scrollbar { display: none; }
  .top-right .chip { flex: 0 0 auto; }
}

@media (max-width: 760px) {
  .home { width: min(100% - 20px, 620px); padding: 12px 0 40px; gap: 16px; }
  .hero { gap: 16px; padding: 18px 16px; }
  .hero-modes { grid-template-columns: 1fr; gap: 10px; }
  .mode-card { min-height: 220px; padding: 15px; }
  .hero-join { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-join .label, .hero-join #nick { grid-column: 1 / -1; }
  .hero-join .label { white-space: normal; }
  .hero-join .btn { min-width: 0; padding: 9px 10px; }
  .hero-join #mkRoom { grid-column: 1; }
  .hero-join #roomCode { grid-column: 1; }
  .hero-join #jnRoom { grid-column: 2; grid-row: 3; }
  .home-grid { grid-template-columns: 1fr; gap: 14px; }
  .modal, .modal.wide { width: calc(100vw - 20px); max-height: 86vh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .modal:has(.echo-explore), .modal:has(.case-background-modal) { width: calc(100vw - 28px); max-height: 74vh; padding: 18px 16px; }
  .case-background-modal { max-width: none; }
}

@media (max-width: 420px) {
  .home { width: calc(100% - 16px); }
  .hero { padding: 16px 13px; }
  .hero-join { grid-template-columns: 1fr; }
  .hero-join .field.code, .hero-join .btn { width: 100%; }
  .hero-join .label, .hero-join #nick, .hero-join .field.code, .hero-join .btn { grid-column: 1; }
}

/* PC 主线桌面：缩短首屏纵向长度，同时保留中间现场区的可见性。 */
@media (min-width: 1101px) {
  .table { grid-template-columns: 240px minmax(0, 1fr) 270px; gap: 14px; padding: 14px 18px 22px; }
  .table > .col { gap: 10px; }
  .table > .col:last-child { align-self: start; }
  .table > .col:first-child .panel { padding: 13px; }
  .table > .col:last-child .board { position: sticky; top: 76px; max-height: calc(100vh - 150px); overflow-y: auto; flex: none; }
  .map { min-height: 248px; padding: 14px; gap: 10px; }
  .room { padding: 10px 12px; }
  .room .ico { font-size: 23px; }
  .room .rn { font-size: 16px; }
  .room .rd { font-size: 11px; line-height: 1.4; }
  .log { min-height: 112px; max-height: 178px; padding: 10px 14px; }
  .log .entry { padding: 5px 0; font-size: 13px; line-height: 1.55; }
  .board { padding: 12px; }
  .board h3 { margin-bottom: 7px; }
  .evgrid { gap: 7px; }
  .ev { min-height: 62px; padding: 8px; }
  .hint-card { padding: 0 !important; }
}

.hint-card summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; font-weight: 700; }
.hint-card summary::-webkit-details-marker { display: none; }
.hint-card summary::after { content: "＋"; color: var(--ink-soft); font-size: 16px; }
.hint-card[open] summary::after { content: "－"; }
.hint-card summary .label { letter-spacing: 0; text-transform: none; font-size: 10px; margin-left: auto; }
.hint-card > p { padding: 10px 13px 13px; }

@media (min-width: 761px) and (max-width: 1100px) {
  .table { grid-template-columns: 230px minmax(0, 1fr); gap: 12px; padding: 12px 14px 22px; }
  .table > .col:last-child { grid-column: 1 / -1; }
  .map { min-height: 250px; padding: 14px; gap: 10px; }
  .log { min-height: 120px; max-height: 190px; }
  .board { padding: 12px; }
}
