/* 蘑菇森林 · 视觉系统
   取值来源：.claude/skills/redesign-existing-projects/SKILL.md → Design values（本项目版）
   全部资源随站部署：系统中文字体、内联 SVG 图标与纹理，不加载任何外部资源。 */

:root {
  --bg: #F6F1E7; --surface: #FFFCF6; --sunken: #EFE7D8; --line: #E3D8C5;
  --ink: #33281F; --ink-2: #6E5F50; --ink-3: #9A8B79;
  --accent: #3F7D58; --accent-hover: #33684A; --accent-tint: #E4EEE3;
  --danger: #B4483A; --danger-tint: #F7E4DF; --caution: #A86E12; --caution-tint: #F8EDD3;
  --shadow: 0 1px 2px rgba(92, 64, 32, .06), 0 8px 24px rgba(92, 64, 32, .07);
  --shadow-lg: 0 12px 40px rgba(92, 64, 32, .16);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r-card: 24px; --r-inner: 8px; --r-ctl: 12px; --r-chip: 6px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* z 轴层级 */
  --z-bar: 10; --z-trial: 20; --z-sheet: 40; --z-toast: 50;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100dvh; background-color: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 24px; font-weight: 400;
  -webkit-font-smoothing: antialiased;
  /* 3% 纸张颗粒 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .25 0 0 0 0 .12 0 0 0 .03 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: var(--accent); text-underline-offset: 3px; transition: color .3s var(--ease); }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 700; text-wrap: balance; }
h1 { font-size: 30px; line-height: 36px; letter-spacing: -.02em; }
h2 { font-size: 24px; line-height: 32px; letter-spacing: -.015em; }
h3 { font-size: 18px; line-height: 28px; font-weight: 600; }
h4 { font-size: 16px; line-height: 24px; font-weight: 600; margin-top: 16px; }
h2 small, h3 small { font-size: 14px; line-height: 20px; font-weight: 400; color: var(--ink-3); margin-left: 8px; }
p { margin: 4px 0 8px; text-wrap: pretty; }
em, i { font-style: normal; }
b, strong { font-weight: 600; }
.muted { color: var(--ink-2); } .tiny { font-size: 14px; line-height: 20px; } .nowrap { white-space: nowrap; }
.ok-text { color: var(--accent); font-weight: 600; } .err-text { color: var(--danger); font-weight: 600; }
.big-num { font-size: 24px; line-height: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wrap { margin: 0 auto; padding: 16px 16px 48px; }
.wrap.narrow { max-width: 600px; } .wrap.wide { max-width: 1280px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.row label { display: inline-flex; gap: 8px; align-items: center; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
ol, ul { padding-left: 24px; margin: 8px 0; }
.icon { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: -4px; }
.icon.lg { width: 24px; height: 24px; vertical-align: -6px; }
.skip { position: absolute; left: 16px; top: -48px; background: var(--ink); color: #fff; padding: 8px 16px; border-radius: var(--r-ctl); z-index: var(--z-toast); }
.skip:focus { top: 8px; }

/* ---------- 卡片：仅用表面色与柔和阴影区分层级 ---------- */
.card { background: var(--surface); border-radius: var(--r-card); padding: 16px; margin: 16px 0; box-shadow: var(--shadow); }
@media (min-width: 900px) { .host .card { padding: 24px; } }
.card .card { box-shadow: none; background: var(--sunken); border-radius: var(--r-inner); }
details > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 28px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(-45deg); transition: transform .3s var(--ease); flex: none; margin-right: 4px; }
details[open] > summary::before { transform: rotate(45deg); }
details.card[open] > summary { margin-bottom: 12px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--r-ctl);
  font: inherit; font-size: 16px; line-height: 24px; font-weight: 600; cursor: pointer; text-decoration: none;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease), transform .2s var(--ease), box-shadow .3s var(--ease);
}
.btn:hover { background: var(--sunken); color: var(--ink); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(51, 104, 74, .25); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.ok { background: var(--accent-tint); border-color: transparent; color: var(--accent); }
.btn.ok:hover { background: #d6e7d5; }
.btn.danger { background: var(--danger-tint); border-color: transparent; color: var(--danger); }
.btn.danger:hover { background: #f1d3cc; color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sunken); color: var(--ink); }
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: 14px; line-height: 20px; border-radius: var(--r-inner); }
.btn.big { min-height: 52px; padding: 12px 24px; font-size: 18px; line-height: 28px; }
.btn.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--accent); font-weight: 500; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:focus-visible { outline-offset: 3px; }

/* ---------- 输入 ---------- */
input, select, textarea {
  font: inherit; font-size: 16px; line-height: 24px; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 8px 12px; min-height: 44px; max-width: 100%;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
select { padding-right: 32px; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239A8B79' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 18px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
input[type=checkbox], input[type=radio] { min-height: 0; width: 18px; height: 18px; accent-color: var(--accent); }
textarea { width: 100%; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: 12px; line-height: 16px; }
.field { display: block; margin: 16px 0; }
.field > span { display: block; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.field input { width: 100%; }
.field-err { color: var(--danger); font-size: 14px; line-height: 20px; margin-top: 8px; display: flex; gap: 4px; align-items: center; }
.field.has-err input { border-color: var(--danger); }
.toggle { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; line-height: 20px; cursor: pointer; color: var(--ink-2); }

/* ---------- 品牌 ---------- */
.brand { display: flex; gap: 12px; align-items: center; }
.brand h1 { margin: 0; }
.brand p { margin: 0; color: var(--ink-2); }
.brand .mush.logo { width: 48px; height: 52px; }
.brand.sm .mush.logo { width: 32px; height: 36px; }
.brand.sm b { display: block; font-size: 16px; line-height: 24px; } .brand.sm small { color: var(--ink-3); font-size: 12px; line-height: 16px; }
.grad { background: linear-gradient(90deg, #33281F, #6E5F50); -webkit-background-clip: text; background-clip: text; color: transparent; }
.trial-flag { display: inline-flex; align-items: center; gap: 4px; background: var(--caution-tint); color: var(--caution); font-weight: 600; border-radius: var(--r-chip); padding: 2px 8px; font-size: 14px; line-height: 20px; white-space: nowrap; }
.trial-flag.sm { font-size: 12px; line-height: 16px; padding: 2px 6px; }

/* 小组标签：方角色块（不是胶囊徽章） */
.gtag { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; line-height: 20px; color: var(--ink); white-space: nowrap; }
.gtag::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--gc); flex: none; }
.op-badge { font-style: normal; font-size: 12px; line-height: 16px; background: var(--caution-tint); color: var(--caution); border-radius: var(--r-chip); padding: 2px 6px; font-weight: 600; vertical-align: 1px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #D4C8B2; margin-right: 6px; vertical-align: 1px; }
.dot.ok { background: #4F9E6A; box-shadow: 0 0 0 3px rgba(79, 158, 106, .18); } .dot.bad { background: var(--danger); }

/* ---------- 首页 ---------- */
.home { max-width: 1040px; margin: 0 auto; padding: 32px 16px 64px; }
.home-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; padding: 16px 0 32px; }
.home-hero h1 { font-size: 36px; line-height: 40px; max-width: 680px; }
.eyebrow { font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: .04em; color: var(--accent); margin: 0 0 8px; }
.home-hero .lead { font-size: 18px; line-height: 28px; color: var(--ink-2); max-width: 30em; }
.home-hero .art { display: flex; gap: 8px; align-items: flex-end; justify-content: center; padding: 24px; background: var(--sunken); border-radius: var(--r-card); }
.home-hero .art .mush { width: 64px; height: 70px; }
.home-hero .art .mush:nth-child(2) { width: 88px; height: 96px; }
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 24px; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.home-grid .card { margin: 0; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.steps li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.steps li > span:first-child { width: 32px; height: 32px; border-radius: var(--r-inner); background: var(--accent-tint); color: var(--accent); font-weight: 700; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.steps b { display: block; } .steps small { color: var(--ink-2); font-size: 14px; line-height: 20px; }
.note-soft { display: flex; gap: 8px; background: var(--sunken); border-radius: var(--r-inner); padding: 12px; font-size: 14px; line-height: 20px; color: var(--ink-2); margin: 12px 0; }
.note-soft .icon { color: var(--accent); margin-top: 0; }
@media (max-width: 760px) {
  .home { padding-top: 16px; }
  .home-hero { grid-template-columns: 1fr; gap: 16px; padding-bottom: 16px; }
  .home-hero h1 { font-size: 30px; line-height: 36px; }
  .home-hero .art { order: -1; padding: 16px; } .home-hero .art .mush { width: 48px; height: 52px; } .home-hero .art .mush:nth-child(2) { width: 64px; height: 70px; }
  .home-grid { grid-template-columns: 1fr; }
}
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 加入页 ---------- */
.join { margin-top: 24px; }
.join .brand { margin-bottom: 16px; }
.room-code { font-size: 14px; line-height: 20px; color: var(--ink-2); }
.room-code b { font-size: 20px; line-height: 28px; letter-spacing: .12em; color: var(--ink); font-variant-numeric: tabular-nums; margin-left: 4px; }
.gpick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gbtn { position: relative; border: 1px solid var(--line); background: #fff; border-radius: var(--r-ctl); padding: 12px; cursor: pointer; font: inherit; color: var(--ink); text-align: left; touch-action: manipulation; min-height: 64px; transition: border-color .3s var(--ease), background-color .3s var(--ease), box-shadow .3s var(--ease); }
.gbtn b { display: flex; align-items: center; gap: 8px; font-size: 18px; line-height: 28px; font-weight: 600; }
.gbtn b::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--gc); }
.gbtn small { color: var(--ink-3); font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }
.gbtn:hover { background: var(--surface); }
.gbtn.sel { border-color: var(--accent); background: var(--accent-tint); box-shadow: 0 0 0 1px var(--accent); }
.gbtn.sel::after { content: ""; position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center/14px no-repeat; }
.gbtn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- 小组端顶部（悬浮条） ---------- */
.topbar { position: sticky; top: 8px; z-index: var(--z-bar); display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 8px 0; padding: 8px 12px; border-radius: 16px;
  background: rgba(255, 252, 246, .86); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); box-shadow: var(--shadow); }
.play .topbar { max-width: 584px; }
@media (min-width: 600px) { .play .topbar { margin: 8px auto 0; } }
.tb-l, .tb-r { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 20px; }
.pts, .candy { display: inline-flex; align-items: baseline; gap: 2px; font-variant-numeric: tabular-nums; font-weight: 700; }
.pts { font-size: 20px; line-height: 28px; color: var(--accent); } .candy { font-size: 18px; line-height: 28px; color: #B5612A; }
.pts small, .candy small { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-3); }
.stagebar { display: flex; gap: 8px; align-items: center; justify-content: space-between; max-width: 600px; margin: 8px auto 0; padding: 0 24px; font-size: 14px; line-height: 20px; }
.stagebar > span:first-of-type { font-weight: 600; color: var(--ink); }
.stagebar .muted { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.paused-banner { display: flex; gap: 8px; align-items: center; justify-content: center; max-width: 600px; margin: 8px auto 0; padding: 8px 16px; border-radius: var(--r-ctl); background: var(--caution-tint); color: var(--caution); font-weight: 600; font-size: 14px; line-height: 20px; }
.host .paused-banner { max-width: 1248px; }
.hero h2 { color: var(--ink); }
.flow { padding-left: 24px; } .flow li { margin: 4px 0; }
.role { display: flex; gap: 8px; align-items: flex-start; background: var(--sunken); border-radius: var(--r-inner); padding: 12px; margin: 12px 0; font-size: 14px; line-height: 20px; color: var(--ink-2); }
.role.me { background: var(--accent-tint); color: var(--ink); }
.phase { display: flex; gap: 8px; align-items: center; font-weight: 600; color: var(--accent); margin-top: 12px; }
.practice-box { background: var(--sunken); border-radius: var(--r-inner); padding: 12px; margin-top: 12px; }
.pf { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-i { display: inline-flex; align-items: center; gap: 4px; background: #fff; border-radius: var(--r-chip); padding: 2px 8px; font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }
.pf-i.good { color: var(--accent); } .pf-i.bad { color: var(--danger); }

/* ---------- 规则与图例 ---------- */
.rules h3 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rules ul { padding-left: 20px; margin: 8px 0; color: var(--ink-2); } .rules li { margin: 4px 0; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.legend-item { display: flex; align-items: center; gap: 8px; background: var(--sunken); border-radius: var(--r-ctl); padding: 8px 12px 8px 8px; }
.legend-item b { display: block; font-size: 14px; line-height: 20px; }
.legend-item span { display: block; font-size: 12px; line-height: 16px; color: var(--ink-3); }
.legend-item em { display: block; font-size: 14px; line-height: 20px; font-weight: 700; color: var(--accent); }
.mush { display: block; } .mush.sm { width: 44px; height: 48px; flex: none; } .mush.xs { width: 20px; height: 22px; display: inline-block; vertical-align: middle; }

/* ---------- 九宫格（显示与消失不加过渡，避免影响反应计时） ---------- */
.gamecard { padding: 12px; }
.l1grid { position: relative; max-width: 440px; margin: 0 auto; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.host-grid .l1grid { max-width: 480px; }
.grid9 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: #C9DBB6; padding: 8px; border-radius: 16px; }
.cell { position: relative; padding-bottom: 100%; border-radius: var(--r-inner); background: #F1F4E6; box-shadow: inset 0 -3px 0 rgba(80, 110, 60, .12); cursor: pointer; }
.cell .slot { position: absolute; top: 8%; left: 8%; right: 8%; bottom: 8%; display: flex; align-items: center; justify-content: center; }
.cell .slot .mush { width: 100%; height: 100%; }
.tapfx { position: absolute; top: 4px; right: 8px; font-weight: 700; color: var(--ink); opacity: 0; font-size: 16px; line-height: 24px; pointer-events: none; font-variant-numeric: tabular-nums; }
.tapfx.go { animation: tapfx .4s var(--ease); }
@keyframes tapfx { 0% { opacity: 1; transform: scale(1.25); } 100% { opacity: 0; transform: scale(1); } }
.grid-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: rgba(255, 252, 246, .8); border-radius: 16px; pointer-events: none; }
.grid-overlay .cdn { font-size: 72px; line-height: 1; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.grid-overlay .cdl, .grid-overlay .msg { font-size: 18px; line-height: 28px; font-weight: 600; color: var(--ink-2); }
.grid-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); display: none; background: var(--ink); color: #fff; font-size: 12px; line-height: 16px; font-weight: 600; border-radius: var(--r-chip); padding: 4px 8px; pointer-events: none; }
.qrow { display: flex; flex-wrap: wrap; gap: 4px; }
.qcell { min-width: 36px; text-align: center; border-radius: var(--r-chip); padding: 4px; background: var(--sunken); font-weight: 600; font-size: 14px; line-height: 20px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.qcell.good { background: var(--accent-tint); color: var(--accent); } .qcell.bad { background: var(--danger-tint); color: var(--danger); } .qcell.zero { color: var(--ink-3); }
.minis, .scoreboard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.mini, .sb { background: var(--surface); border-radius: var(--r-ctl); padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; box-shadow: var(--shadow); }
.card .mini { background: var(--sunken); box-shadow: none; }
.mini.me, .sb.me { box-shadow: 0 0 0 2px var(--accent); }
.mini b, .sb b { font-size: 20px; line-height: 28px; font-variant-numeric: tabular-nums; }
.sb small { font-size: 12px; line-height: 16px; color: var(--ink-3); }
@media (max-width: 420px) { .minis, .scoreboard { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 表格 ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { color: var(--ink-3); font-weight: 500; font-size: 12px; line-height: 16px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.sum td { font-weight: 700; }
.tbl tr.me td { background: var(--accent-tint); }
.tbl td.pos { color: var(--accent); font-weight: 600; white-space: nowrap; } .tbl td.neg { color: var(--danger); font-weight: 600; white-space: nowrap; }
.l1tbl td, .l1tbl th { text-align: center; padding: 4px; }
.l1tbl td small { display: block; font-size: 12px; line-height: 16px; color: var(--ink-3); font-weight: 400; }
.l1tbl td.good { background: #EEF5EC; color: var(--accent); font-weight: 600; } .l1tbl td.bad { background: #FBEDEA; color: var(--danger); font-weight: 600; } .l1tbl td.zero { color: var(--ink-3); }
.rank-tbl td { font-size: 18px; line-height: 28px; } .rank-tbl.big td { font-size: 20px; line-height: 28px; padding: 12px 8px; }
.rank { font-weight: 700; font-size: 20px; line-height: 28px; }
.rank.r1 { color: #B58500; } .rank.r2 { color: #7C8792; } .rank.r3 { color: #A8642E; }
.ledger td:last-child { min-width: 180px; }

/* ---------- 第二关 ---------- */
.timerbox { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--sunken); border-radius: var(--r-inner); padding: 8px 16px; margin: 0 0 16px; }
.timerbox .lbl { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-2); display: inline-flex; gap: 8px; align-items: center; }
.timerbox .cd { font-size: 30px; line-height: 36px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); transition: color .3s var(--ease); }
.timerbox.big .cd { font-size: 48px; line-height: 1; }
.cd.cd-low { color: var(--caution) !important; } .cd.cd-zero { color: var(--danger) !important; }
.public { background: var(--sunken); border-radius: var(--r-inner); padding: 12px; margin: 12px 0; }
.public p { margin: 0; } .public p + p { margin-top: 8px; }
.suspects { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.suspects span { background: #fff; border: 1px solid var(--line); border-radius: var(--r-inner); padding: 4px 12px; font-size: 14px; line-height: 20px; color: var(--ink-2); max-width: 100%; }
.suspects b { color: var(--ink); font-size: 16px; margin-right: 4px; }
.clue { background: #FFF6DE; border-radius: var(--r-ctl); padding: 16px; margin: 16px 0; box-shadow: inset 0 0 0 1px #EBD9A6; }
.clue-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; line-height: 20px; color: #7D5A12; }
.clue-h small { color: var(--ink-3); }
.clue p { font-size: 18px; line-height: 28px; margin: 8px 0; }
.clue.long p { font-size: 16px; line-height: 26px; margin: 12px 0; }
.clue p.src { font-size: 14px; line-height: 20px; font-weight: 700; color: #7D5A12; margin: 12px 0 0; }
.rules-list { padding-left: 20px; color: var(--ink-2); }
.radios { display: flex; gap: 8px; flex-wrap: wrap; }
.radio { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: var(--r-ctl); padding: 8px 16px; min-height: 44px; cursor: pointer; font-size: 18px; line-height: 28px; transition: border-color .3s var(--ease), background-color .3s var(--ease); }
.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.l2-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 900px) { .l2-grid { grid-template-columns: 1fr; } }
.l2g { margin: 0; }
.l2g-h { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.reasons { padding-left: 20px; }
.review { display: flex; flex-direction: column; gap: 8px; background: var(--sunken); border-radius: var(--r-inner); padding: 12px; margin: 8px 0; }
.review label { display: flex; gap: 8px; align-items: center; }
.answer { background: var(--danger-tint); border-radius: var(--r-inner); padding: 12px; margin-top: 12px; font-size: 14px; line-height: 20px; }
.mini-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; } .mini-form input { flex: 1; min-width: 120px; }

/* ---------- 补点 & 拍卖 ---------- */
.choice { display: flex; flex-wrap: wrap; gap: 8px; } .choice .btn { flex: 1; min-width: 140px; }
.songcard { background: #35304A; color: #fff; border-radius: var(--r-ctl); padding: 24px 16px; text-align: center; margin: 12px 0; }
.songcard b { display: block; font-size: 30px; line-height: 36px; margin: 8px 0; }
.songcard small { color: rgba(255, 255, 255, .72); font-size: 14px; line-height: 20px; }
.round.live { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.pill { display: inline-block; font-size: 12px; line-height: 16px; font-weight: 600; background: var(--sunken); color: var(--ink-2); border-radius: var(--r-chip); padding: 2px 8px; vertical-align: 3px; }
.round.live .pill { background: var(--accent); color: #fff; }
.highbid { background: #FFF6DE; border-radius: var(--r-inner); padding: 12px 16px; margin: 12px 0; font-size: 18px; line-height: 28px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.highbid b { font-size: 24px; line-height: 32px; color: #9A4F16; font-variant-numeric: tabular-nums; }
.highbid small { flex-basis: 100%; color: var(--ink-2); font-size: 14px; line-height: 20px; }
.highbid.big { font-size: 20px; } .highbid.big b { font-size: 36px; line-height: 40px; }
.bidrow input { flex: 1; min-width: 100px; } .quick { display: flex; gap: 8px; flex-wrap: wrap; }
.bids { padding-left: 24px; font-size: 14px; line-height: 20px; max-height: 220px; overflow: auto; font-variant-numeric: tabular-nums; }
.result { background: var(--accent-tint); border-radius: var(--r-inner); padding: 12px 16px; margin-top: 12px; }
.weigh { display: flex; gap: 8px; align-items: center; justify-content: center; background: #E7EEF6; color: #2F5D88; border-radius: var(--r-ctl); padding: 12px; font-weight: 600; margin: 16px 0; }
.bid-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 900px) { .bid-grid { grid-template-columns: repeat(2, 1fr); } }
.bidder { background: var(--sunken); border-radius: var(--r-inner); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.bidder small { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bidder input { width: 100%; }
.members { list-style: none; padding: 0; margin: 0; } .members li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.members li:last-child { border-bottom: 0; }

/* ---------- 主持端 ---------- */
.htop { position: sticky; top: 8px; z-index: var(--z-bar); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; max-width: 1248px; margin: 8px auto 0; padding: 8px 16px; border-radius: 16px;
  background: rgba(255, 252, 246, .86); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); box-shadow: var(--shadow); }
.htop-r { display: flex; gap: 8px; align-items: center; }
.conn { display: inline-flex; align-items: center; font-size: 12px; line-height: 16px; color: var(--ink-3); }
.stages { display: flex; align-items: center; gap: 4px; overflow-x: auto; max-width: 1280px; margin: 16px auto 0; padding: 0 16px; scrollbar-width: none; }
.stages::-webkit-scrollbar { display: none; }
.stg { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 8px 12px; border-radius: var(--r-ctl); font: inherit; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: background-color .3s var(--ease), color .3s var(--ease); }
.stg:hover { background: var(--sunken); color: var(--ink); }
.stg i { font-style: normal; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: var(--r-chip); background: var(--sunken); font-size: 12px; line-height: 16px; }
.stg.cur { background: var(--ink); color: #fff; } .stg.cur i { background: rgba(255, 255, 255, .16); color: #fff; }
.arrow { color: var(--line); }
.host-sb { max-width: 1280px; margin: 12px auto 0; padding: 0 16px; }
.host-sb .sb { align-items: flex-start; text-align: left; padding: 12px 16px; gap: 4px; }
.host-sb .sb b { font-size: 30px; line-height: 36px; color: var(--ink); font-weight: 700; } .host-sb .sb b small { font-size: 14px; color: var(--ink-3); font-weight: 500; margin-left: 2px; }
.candy-n { display: inline-flex; gap: 4px; align-items: center; font-weight: 600; color: #B5612A; font-variant-numeric: tabular-nums; }
.tabs { max-width: 1280px; margin: 16px auto 0; padding: 0 16px; display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tab { position: relative; border: 0; background: none; padding: 8px 12px 12px; font: inherit; font-size: 14px; line-height: 20px; font-weight: 600; cursor: pointer; color: var(--ink-3); transition: color .3s var(--ease); }
.tab:hover { color: var(--ink); }
.tab.cur { color: var(--ink); }
.tab.cur::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--sunken); border-radius: var(--r-chip); padding: 4px 12px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink-2); }
.chip.cur { background: var(--ink); color: #fff; } .chip.done { background: var(--accent-tint); color: var(--accent); }
.l1-head { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; margin-top: 16px; }
@media (max-width: 900px) { .l1-head { grid-template-columns: 1fr; } }
.host .l1-head .rules { font-size: 18px; line-height: 28px; }
.host .mush.sm { width: 56px; height: 60px; }
.ctl { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.card > .ctl { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.phase-run { font-size: 20px; line-height: 28px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.sim-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; } .sim-row label { display: inline-flex; gap: 8px; align-items: center; }
.notice { display: flex; gap: 8px; align-items: flex-start; background: var(--caution-tint); color: #6E4A0C; border-radius: var(--r-ctl); padding: 12px 16px; margin: 16px 0; font-size: 14px; line-height: 20px; }
.notice .btn { margin-top: 8px; }
.lobby-grid { display: grid; grid-template-columns: minmax(280px, 1fr) 2fr; gap: 16px; align-items: start; }
.lobby-grid .card { margin: 0; }
@media (max-width: 900px) { .lobby-grid { grid-template-columns: 1fr; } }
.qr-main { text-align: center; }
.qr-main img { width: 100%; max-width: 280px; border-radius: var(--r-ctl); background: #fff; padding: 12px; box-shadow: var(--shadow); margin: 8px auto 12px; display: block; }
.link { word-break: break-all; font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--ink-3); }
.qr-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 700px) { .qr-row { grid-template-columns: repeat(2, 1fr); } }
.qr-card { background: var(--sunken); border-radius: var(--r-inner); padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.qr-card img { width: 100%; max-width: 160px; background: #fff; border-radius: var(--r-chip); padding: 6px; }
.qr-card small { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.mem-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 1000px) { .mem-grid { grid-template-columns: 1fr; } }
.mem-grid .card { margin: 0; }
.tbl.mem select { padding: 4px 28px 4px 8px; min-height: 32px; font-size: 14px; background-position: right 4px center; }
.logs { max-height: 260px; overflow: auto; padding-left: 20px; color: var(--ink-2); }
.final h2 { font-size: 36px; line-height: 40px; text-align: left; display: flex; gap: 12px; align-items: center; }
.debrief { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.debrief > div { background: var(--sunken); border-radius: var(--r-inner); padding: 12px 16px; }
.debrief b { display: block; margin-bottom: 4px; }
.debrief p { font-size: 14px; line-height: 20px; color: var(--ink-2); margin: 0; }
.hint { margin-top: 12px; }
.hint > summary { font-size: 14px; line-height: 20px; color: var(--ink-2); }

/* ---------- 骨架屏 ---------- */
.skel { display: block; background: var(--sunken); border-radius: var(--r-inner); animation: skel 1.4s var(--ease) infinite alternate; }
.skel.line { height: 16px; margin: 8px 0; } .skel.title { height: 28px; width: 60%; margin-bottom: 16px; } .skel.block { height: 120px; margin-top: 16px; }
@keyframes skel { from { opacity: 1; } to { opacity: .45; } }

/* ---------- 确认面板 ---------- */
.sheet-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: var(--z-sheet); background: rgba(51, 40, 31, .32); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .3s var(--ease); }
.sheet-mask.in { opacity: 1; }
.sheet { width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--r-card) var(--r-card) 0 0; padding: 24px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); transform: translateY(24px); transition: transform .5s var(--ease); }
.sheet-mask.in .sheet { transform: none; }
.sheet h3 { margin-bottom: 8px; }
.sheet p { color: var(--ink-2); white-space: pre-line; }
.sheet .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
@media (min-width: 600px) { .sheet-mask { align-items: center; } .sheet { border-radius: var(--r-card); padding: 24px; } }

/* ---------- 提示 ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); max-width: 440px; }
.toast { display: flex; gap: 8px; align-items: center; background: var(--ink); color: #fff; border-radius: var(--r-ctl); padding: 12px 16px; font-size: 14px; line-height: 20px; box-shadow: var(--shadow-lg); transition: opacity .3s var(--ease), transform .3s var(--ease); animation: toastIn .5s var(--ease); }
.toast.err { background: var(--danger); } .toast.ok { background: var(--accent); } .toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 试运行外壳 ---------- */
.tbar { position: sticky; top: 0; z-index: var(--z-trial); display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--caution-tint); overflow-x: auto; white-space: nowrap; scrollbar-width: none; box-shadow: 0 1px 0 #EBD9A6; }
.tbar::-webkit-scrollbar { display: none; }
.tbar .seg { display: inline-flex; background: rgba(255, 255, 255, .6); border-radius: var(--r-ctl); padding: 2px; gap: 2px; }
.tbar .vbtn { border: 0; background: transparent; border-radius: 10px; padding: 4px 12px; min-height: 32px; font: inherit; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background-color .3s var(--ease), color .3s var(--ease); }
.tbar .vbtn.cur { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.tbar .sp { flex: 1; }
.tbar .toggle { color: var(--ink-2); }
.split { display: grid; grid-template-columns: 1.5fr 1fr; }
.split > div { min-width: 0; height: calc(100dvh - 48px); overflow: auto; }
.split > div + div { background: var(--sunken); box-shadow: inset 1px 0 0 var(--line); }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } .split > div { height: auto; } }
.split .topbar, .split .htop { position: static; }

/* ---------- 404 ---------- */
.nf { max-width: 480px; margin: 64px auto; padding: 0 16px; }
.nf .mush { width: 88px; height: 96px; margin-bottom: 16px; }

/* ---------- 打印卡片 ---------- */
.pcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; margin: 16px 0; page-break-inside: avoid; break-inside: avoid; }
.pcard h2 { margin-top: 8px; }
.pcard .clue p { font-size: 20px; line-height: 28px; }
.pcard .clue.long p { font-size: 17px; line-height: 28px; }
.pcard .clue p.src { font-size: 14px; line-height: 20px; }
.pcard .meta { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-3); font-size: 12px; line-height: 16px; }

@media print {
  body { background: #fff; } .noprint { display: none !important; }
  .pcard { page-break-after: always; break-after: page; border-color: #999; }
  .wrap { padding: 0; }
}

/* ---------- 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-property: opacity, color, background-color !important; transition-duration: .2s !important; scroll-behavior: auto !important; }
  .reveal { transform: none; } .sheet { transform: none; }
}
