/* 金玉满堂 / Arena Noir · v7 双主题。v11（specs/008 T003/FR-001）：素材以文档相对 url(assets/v6|v7/…) 引用，
   由服务端 STATIC_ROUTES 允许清单逐文件服务（immutable + sha-ETag）；dist 构建时由 build-standalone 内联回 data URL。 */
:root {
  --v6-ambient-a: url(assets/v6/ambient-a.jpg);
  --v6-ambient-b: url(assets/v6/ambient-b.jpg);
  --v6-entry-hero: url(assets/v6/entry-hero.jpg);
  --v6-empty-score: url(assets/v6/empty-score.png);
  --v6-empty-history: url(assets/v6/empty-history.png);
  --v6-report-bg: url(assets/v6/report-bg.jpg);
  --v6-ornament-a: url(assets/v6/ornament-a.jpg);
  --v6-ornament-b: url(assets/v6/ornament-b.jpg);
  --v6-icons: url(assets/v6/icons.svg);
  --v7-ambient-jinyu: url(assets/v7/ambient-jinyu.jpg);
  --v7-entry-jinyu: url(assets/v7/entry-jinyu.jpg);
  --v7-empty-score: url(assets/v7/empty-score.png);
  --v7-empty-history: url(assets/v7/empty-history.png);
  --v7-report-jinyu: url(assets/v7/report-jinyu.jpg);
  --v7-festive-sprite: url(assets/v7/festive-sprite.svg);
  --v7-icons: url(assets/v7/icons.svg);
  --bg: #FFF8E7;
  --surface: #FFFCF4;
  --surface-raised: #F8EDCF;
  --surface-bright: #F8EDCF;
  --accent: #A61B1B;
  --accent-rgb: 166,27,27;
  --coral: #7F1D1D;
  --on-accent: #FFFCF4;
  --text-primary: #2B1B12;
  --text-secondary: #6B5142;
  --text-tertiary: #6B5142;
  --score-positive: #A61B1B;
  --score-negative: #40564F;
  --warning: #8A5A00;
  --gold: #D6A42D;
  --gold-text: #8A5A00;
  --gold-soft: #F3D27A;
  --border: #E6D5B4;
  --border-strong: #D6A42D;
  --accent-soft: rgba(243,210,122,.32);
  --overlay: rgba(43,27,18,.72);
  --input-bg: #FFFCF4;
  --font-body: -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  --font-score: -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-sheet: 28px;
  --page-max: min(100%,560px);
  --toast-bottom: 192px;
  --motion: 160ms;
}
html[data-theme="arena-noir"] {
  --bg: #080B12;
  --surface: #111827;
  --surface-raised: #182234;
  --surface-bright: #202C40;
  --accent: #37E6D4;
  --accent-rgb: 55,230,212;
  --coral: #FF6B6B;
  --on-accent: #061311;
  --text-primary: #F5F7FA;
  --text-secondary: #AAB4C5;
  --text-tertiary: #8996AA;
  --score-positive: #63EAD9;
  --score-negative: #FF9292;
  --warning: #F4C97D;
  --gold: #F4C97D;
  --gold-text: #F4C97D;
  --gold-soft: #202C40;
  --border: rgba(245,247,250,.12);
  --border-strong: rgba(245,247,250,.22);
  --accent-soft: rgba(55,230,212,.10);
  --overlay: rgba(2,5,10,.78);
  --input-bg: #0C1320;
  --font-score: "DIN Alternate","Arial Narrow",ui-monospace,"SF Mono",monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html,body { margin: 0; min-height: 100%; max-width: 100%; }
html { background: var(--bg); color-scheme: light; }
html[data-theme="arena-noir"] { color-scheme: dark; }
body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  overscroll-behavior-y: contain;
}
/* v11 FR-004b（specs/008 T006b）tex-ready 纹理延迟门控：ambient 环境底图与装饰类纹理仅在
   body.tex-ready（首帧后由 app JS 添加）下应用——构造性移出 FCP 窗口，双口径资源集恒等；
   默认纯色兜底（--bg 双写不删），noscript/JS 失败 = 无环境底图（opacity .08 点缀层，可接受降级）。
   hero 主视觉（.entry-hero-visual）保持即时加载（LCP 锚点不延迟，见 :171 段）。 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: none;
  opacity: .08;
}
body.tex-ready::before { background: var(--v7-ambient-jinyu) center/cover no-repeat; }
html[data-theme="arena-noir"] body.tex-ready::before { background-image: var(--v6-ambient-a); opacity: .10; }
body.modal-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
button,input,select,textarea { font: inherit; }
button { color: inherit; }
button,select { cursor: pointer; }
button:disabled { cursor: not-allowed; border-style: dashed; opacity: .45; } /* v11 FR-019：禁用态真视觉（opacity .45）；原因文字由按钮内嵌 <span class="btn-reason"> 呈现，title 仅补充 */
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1,h2,h3,h4,p { overflow-wrap: anywhere; }

/* v10 瘦身几何令牌（specs/007 FR-004 / plan §2 可行配方；2/3/18px 未入 v7 字阶/间距令牌表，
   故以 CSS 变量承载——check-v7-visual 对 var() 引用不静态判定，数值在此集中登记可审计）：
   顶栏 = 2+44+2 = 48（.tb-icon-btn 44×44 命中盒完全不动；v12〔specs/009 FR-001/FR-002〕房间页顶栏
   字形 20→18 + 去盒化 ghost + 盒间 gap 4→2，一律经 #topbar 作用域承载——基类与落地页帮助钮零改动）；
   底栏 = v12 单行 1+3+48+3 = 55 ≤56（specs/009 FR-004；v10 两行 3+44+3+44+3+1=98 配方随行 B 移除废止）；
   交互元素矩形 ≥44 零缩小（触控断言按 getBoundingClientRect 逐元素测量，不可缩水）。 */
:root {
  --v10-topbar-pad-y: 2px;
  --v10-meta-space: 2px;
  --v10-bar-pad-y: 3px;
  --v10-bar-space: 3px;
  --v10-record-font: 18px;
}
.noscript { padding: 32px; text-align: center; }
.view { min-height: 100dvh; }
.small,.sheet-hint,.data-definition { color: var(--text-secondary); font-size: 14px; }
.link-btn { min-height: 44px; border: 0; background: transparent; color: var(--text-secondary); padding: 8px; text-decoration: underline; }

/* Controls */
.btn {
  min-height: 48px; min-width: 0; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface-raised); color: var(--text-primary); font-weight: 650; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  transition: border-color var(--motion),transform var(--motion);
}
.btn:active:not(:disabled) { transform: translateY(1px); border-color: var(--accent); }
.btn.primary { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
html[data-theme="jin-yu"] .btn.primary { border-color: var(--gold); }
html[data-theme="jin-yu"] .record-action span { color: var(--gold-soft); }
.btn.secondary { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--coral); background: var(--surface); border-color: var(--coral); }
.btn.xl { min-height: 56px; font-size: 20px; }
.btn.small { min-height: 44px; padding: 8px 12px; font-size: 14px; }
.btn.block { display: flex; width: 100%; }
.icon-btn,.tb-btn {
  width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%; background: var(--surface-raised); color: var(--text-secondary); font-size: 24px;
}
.tb-btn { width: auto; border-radius: var(--radius-md); padding: 0 12px; font-size: 14px; }
.text-input,.nick-input,.sheet textarea {
  width: 100%; min-width: 0; max-width: 100%; min-height: 48px; padding: 12px; border-radius: var(--radius-md);
  border: 1px solid var(--border-strong); background: var(--input-bg); color: var(--text-primary); font-size: 16px; outline: none;
}
.text-input:focus,.sheet textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.code-input { font-family: var(--font-score); letter-spacing: 4px; text-transform: uppercase; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-label { color: var(--text-secondary); font-size: 14px; font-weight: 550; }
.set-err,.sheet-err,.entry-error,.avatar-err { margin: 0; color: var(--coral); font-size: 14px; white-space: pre-line; }
.sheet-warn { margin: 0; color: var(--warning); font-size: 14px; }

/* Entry */
.entry-shell {
  width: var(--page-max); min-height: 100dvh; margin: 0 auto; padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 24px; position: relative;
}
.entry-hero-block { position: relative; min-width: 0; }
.entry-kicker,.section-kicker,.sheet-eyebrow { color: var(--gold-text); font-size: 12px; font-weight: 700; letter-spacing: .12em; }
html[data-theme="arena-noir"] .entry-kicker,html[data-theme="arena-noir"] .section-kicker,html[data-theme="arena-noir"] .sheet-eyebrow { color: var(--accent); }
.festive-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--gold); }
.entry-hero-block h1 { margin: 16px 0 12px; max-width: 100%; font-size: 40px; line-height: 1.2; letter-spacing: 0; font-weight: 760; }
.entry-hero-block h1 em { color: var(--accent); font-style: normal; }
.entry-hero-block > p { margin: 0; color: var(--text-secondary); font-size: 16px; }
.entry-hero-visual { height: 160px; margin-top: 16px; border-radius: var(--radius-lg); background: var(--v7-entry-jinyu) center/cover no-repeat,var(--surface-raised); }
html[data-theme="arena-noir"] .entry-hero-visual { background-image: var(--v6-entry-hero); }
.entry-actions { display: flex; flex-direction: column; gap: 12px; }
.entry-actions > .btn { justify-content: space-between; text-align: left; }
.entry-actions > .btn small { font-size: 12px; font-weight: 500; }
.continue-card { min-height: 64px; width: 100%; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; text-align: left; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); }
.continue-card span { display: flex; flex-direction: column; }
.continue-card small { color: var(--text-secondary); }
.continue-card b { color: var(--accent); font-size: 24px; }
.invite-intent { margin: 0; color: var(--warning); font-size: 14px; }
.entry-utilities { display: grid; grid-template-columns: minmax(0,1fr); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.entry-utilities button { min-width: 0; min-height: 44px; padding: 8px 4px; border: 0; background: transparent; color: var(--text-secondary); font-size: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.entry-utilities button + button { border-left: 1px solid var(--border); }
.entry-utilities button > span:first-child { color: var(--accent); font-size: 20px; }
.entry-local-note { margin: auto 0 0; color: var(--text-tertiary); font-size: 12px; text-align: center; }
.api-entry { font-size: 12px; overflow-wrap: anywhere; }

/* Shared panels and headers */
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.section-head { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head > div { min-width: 0; }
.section-head h2 { margin: 0; font-size: 24px; line-height: 1.25; }
.section-head h2 b { color: var(--accent); font-family: var(--font-score); font-size: 20px; }
.section-head h2 small { color: var(--text-secondary); font-size: 12px; }
.head-note { color: var(--text-tertiary); font-size: 12px; font-weight: 400; }

/* Room top: the first content after it is the global list. */
.top-wrap { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--border); }
.topbar { width: var(--page-max); min-height: calc(48px + env(safe-area-inset-top)); margin: 0 auto; padding: calc(var(--v10-topbar-pad-y) + env(safe-area-inset-top)) 12px var(--v10-topbar-pad-y); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar-info { min-width: 0; flex: 1; }
.room-title-line,.room-meta-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.room-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; font-weight: 700; line-height: 1.2; }
.room-round { flex: none; padding: 0 4px; color: var(--accent); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; }
.room-meta-line { margin-top: var(--v10-meta-space); color: var(--text-tertiary); font-size: 12px; }
.room-code { letter-spacing: .08em; }
.top-life { margin-left: auto; white-space: nowrap; }
.top-life b { color: var(--text-secondary); font-family: var(--font-score); font-weight: 600; }
.top-life b.urgent { color: var(--warning); }
.tb-btns { display: flex; gap: 8px; }
.manage-btn { min-width: 64px; min-height: 44px; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.manage-btn span { color: var(--accent); letter-spacing: 2px; }
.offline-bar { width: var(--page-max); margin: auto; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface-raised); color: var(--warning); font-size: 12px; }
.room-main { width: var(--page-max); margin: 0 auto; padding: 8px 16px 32px; display: flex; flex-direction: column; gap: 24px; }
.room-destination { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.destination-heading { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* US2-12/FR-037 标题行 ≤52px：kicker(12×1.2=14.4) + h1(32×1.15=36.8) = 51.2 */
.destination-heading h1 { margin: 0; font-size: 32px; letter-spacing: 0; line-height: 1.15; }
.destination-heading .section-kicker { display: block; line-height: 1.2; }

/* Global scores and fixed self badge */
.members-card { padding: 16px; }
.scores-head { min-height: 44px; }
.scores-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: none; }
.table-notice-slot { height: 20px; min-width: 0; position: relative; display: flex; align-items: center; }
.sync-line { min-width: 0; color: var(--text-tertiary); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-line.stale { color: var(--warning); }
.table-notice { position: absolute; inset: 0; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; font-size: 12px; font-weight: 650; background: var(--surface); }
.table-notice-slot.has-notice .sync-line { visibility: hidden; }
.moment-notice { color: var(--gold-text); }
.message-notice { color: var(--accent); }
.member-list { min-width: 0; }
.member-row { min-width: 0; height: 52px; display: grid; grid-template-columns: 32px 44px minmax(0,1fr) auto; align-items: center; gap: 8px; position: relative; }
.member-row + .member-row { border-top: 1px solid var(--border); }
.member-row.flash,.history-item.flash { animation: signal-flash 320ms ease-out 1; }
@keyframes signal-flash { from { background: var(--gold-soft); } to { background: transparent; } }
.rank-badge { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-tertiary); font-size: 14px; font-weight: 700; text-align: center; border-radius: 50%; }
.rank-1,.rank-2,.rank-3 { color: var(--text-primary); background: var(--gold-soft); border: 1px solid var(--gold); }
.avatar { width: 48px; height: 48px; flex: none; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-raised); }
.avatar img,.avatar svg,.av-opt img,.av-opt svg { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit; }
.av24 { width: 24px; height: 24px; }.av32 { width: 32px; height: 32px; }.av40 { width: 40px; height: 40px; }.av48 { width: 48px; height: 48px; }.av60 { width: 60px; height: 60px; }.av72 { width: 72px; height: 72px; }
.member-avatar { width: 44px; height: 44px; padding: 0; position: relative; }
.member-name { min-width: 0; display: flex; align-items: center; gap: 4px; font-size: 14px; }
.member-name .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-badge,.tag { flex: none; padding: 0 4px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.member-score { flex: none; max-width: 100%; overflow-wrap: anywhere; text-align: right; font-family: var(--font-score); font-size: 32px; font-weight: 750; line-height: 1.1; }
.member-score.sz-m { font-size: 24px; }.member-score.sz-s { font-size: 20px; }.member-score.sz-xs { font-size: 16px; }
.score-pos { color: var(--score-positive); }.score-neg { color: var(--score-negative); }.score-zero { color: var(--text-primary); }
/* v10 去重①②③（FR-007）：direct-hint/zero-sum-note/room-foot 规则随节点一并移除（零和说明唯一入口
   = scores-head scoresHeadNote；到期时刻唯一入口 = 顶栏）。
   v12（specs/009 FR-005/FR-012/FR-016）：actionHint（CP-12）、self-badge/行 B、message-action、
   record-secondary 规则随节点一并注销——喊话双入口 = 视图头按钮；单人引导唯一入口 = 主按钮内嵌原因。 */
.action-bar { position: fixed; z-index: 35; bottom: 0; left: 50%; transform: translateX(-50%); width: var(--page-max); padding: var(--v10-bar-pad-y) 16px calc(var(--v10-bar-pad-y) + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: var(--v10-bar-space); background: var(--surface); border-top: 1px solid var(--border-strong); box-shadow: 0 -12px 32px rgba(43,27,18,.12); }
html[data-theme="arena-noir"] .action-bar { box-shadow: 0 -12px 32px rgba(0,0,0,.24); }
/* v12 单行底栏（specs/009 US2，FR-004/FR-004a）：唯一一行 = [＋记一笔 主按钮（flex）] [快捷 chip 64]
   [比分|动态|数据 导航 3×50]——行高 48（导航 icon 18 + label 12×1.1 垂直排布且触控 ≥44 不裁切）；
   总高 = 1 + 3 + 48 + 3 = 55 ≤56（border-top 1px + --v10-bar-pad-y 3px ×2；不含 env(safe-area-inset-bottom)，
   spec 验收统一定义口径）。.action-bar padding/gap 令牌沿 v10 零改动；layoutRoomBottom() 按实测
   offsetHeight 自动跟随（零函数改动）。多人/单人两态同高同配方（差 0 断言）。 */
.action-primary-row { display: flex; align-items: stretch; gap: 4px; min-height: 48px; }
/* 水平 padding 16→8（v12 实测修订，gate-migration 批注 4）：375 视口主按钮实得 113px < 单行
   「＋ 记一笔」所需 ~116px（20 字形 + gap 8 + 3 字 ×18 + padding 32 + border 2），文本折行致底栏
   71px 越线（≤56 契约）；8px 后最小宽 ~100px，双视口单行余量 13px+。plan §3.3「primary ≥104」
   预算低于单行实需，以此实测为准。 */
.record-action { flex: 1; min-height: 48px; padding: 4px 8px; font-size: var(--v10-record-font); }
.record-action span { font-size: 20px; line-height: 1.2; }
/* v12 单人态 solo ghost（specs/009 US3，FR-008/FR-008a；plan §3.2 四条配方缺一不可——评审第二轮探针
   四档实测 65/63/63/55px）：①flex-direction: column（.btn 基类 inline-flex 默认 row）②column 下 gap 归零
   （基类 gap:8px 在 column 同样生效）③.btn-line/.btn-reason 显式字号颜色（防 .record-action span 的 20px
   与 jin-yu gold-soft 连带——未覆盖时第一行 20px + 对比度 1.43 近乎不可见）④第一行「＋ 记一笔」包成单一
   元素 .btn-line（裸「<span>＋</span>记一笔」在 column 下裂成三行）。虚线边框/透明底/无 accent 实心 +
   显式 opacity:1（覆盖全局 button:disabled{opacity:.45} 滤镜——滤镜会把内嵌原因有效对比度压至 1.26，
   劣于 v11 基线 2.09，故弃用；真禁用视觉由虚线 + 无实心 + 非交互样式承载）。 */
.record-action.record-solo:disabled { opacity: 1; flex-direction: column; gap: 0; background: transparent; border: 1px dashed var(--border-strong); color: var(--text-secondary); }
.record-action.record-solo .btn-line { font-size: 16px; line-height: 1.2; color: var(--text-secondary); }
.record-action.record-solo .btn-reason { display: block; font-size: 12px; line-height: 1.2; color: var(--text-secondary); white-space: nowrap; overflow: visible; }
/* v9 快捷面板：chip 内嵌行 A（不增底栏高 ≤56）、浮层 absolute 于底栏上缘（≤56、不进文档流、CLS≤0.1）。
 * 几何口径（FR-006/FR-019，390px 视口）：浮层垂直 = 按钮行 44 + 算式行 12 = 56（panel 零内边距零边框，
 * 否则两行之和必超 56 被 overflow:hidden 裁切算式行）；水平 = 输入 44 + 7 钮 ×44 + 6 间隔 ×2 = 366
 * ≤ 374 可用宽（panel 左右边距 4×2、行左右内边距 4×2），全部触控 ≥44×44 且无行内溢出。
 * v12（specs/009 FR-015/M21）：chip 88→64 收窄（可见文案固定「快捷」，包名移入 aria/title——单行预算见
 * plan §3.3），min-height 44→48 对齐单行行高。 */
.qp-chip-slot { flex: none; display: flex; }
.qp-chip { width: 64px; max-width: 64px; min-height: 48px; padding: 4px 6px; display: flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); color: var(--text-primary); font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; }
.qp-chip[disabled] { opacity: .55; }
.qp-chip .qp-chip-icon { flex: none; font-size: 16px; line-height: 1; }
.qp-chip .qp-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.qp-panel { position: absolute; left: 4px; right: 4px; bottom: calc(100% + 4px); z-index: 36; max-height: 56px; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-md); box-shadow: 0 -8px 24px rgba(43,27,18,.16); overflow: hidden; }
html[data-theme="arena-noir"] .qp-panel { box-shadow: 0 -8px 24px rgba(0,0,0,.32); }
.qp-row { flex: none; min-width: 0; display: flex; align-items: stretch; gap: 2px; padding: 0 4px; }
.qp-btn { flex: 1 1 0; min-width: 44px; min-height: 44px; padding: 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--text-primary); font-size: 14px; font-weight: 650; line-height: 1.2; white-space: nowrap; overflow: hidden; }
.qp-btn small { max-width: 100%; color: var(--text-tertiary); font-size: 10px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qp-btn[disabled] { opacity: .5; }
.qp-btn.qp-switch { flex: 0 0 44px; color: var(--accent); }
.qp-expr { flex: none; height: 12px; margin: 0; padding: 0 4px; color: var(--text-secondary); font-size: 10px; line-height: 12px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qp-expr.qp-overflow { color: var(--coral); }
.qp-base-input { flex: 0 0 44px; min-width: 44px; min-height: 44px; padding: 2px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--input-bg); color: var(--text-primary); font-family: var(--font-score); font-size: 14px; }
/* 收藏管理薄表单（CP-28）：行级编辑 + 行级错误，不整表拒绝。 */
.fav-row { min-width: 0; display: grid; grid-template-columns: minmax(72px,1fr) minmax(96px,1.2fr) minmax(72px,1fr) 44px; gap: 6px; align-items: start; }
.fav-row .text-input { min-width: 0; padding: 8px; font-size: 14px; }
.fav-row .fav-del { width: 44px; min-height: 44px; padding: 4px; }
.fav-err { margin: 2px 0 0; color: var(--coral); font-size: 12px; }
.fav-note { margin: 0; color: var(--text-tertiary); font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .qp-panel { transition: none; } }
/* v12 导航钮（specs/009 US5，FR-015）：横排 3×50 ghost 钮并入单行——垂直排布 icon 18 + label 12px
   （spec 口径 11-12px；12 在 v7 字阶令牌表内，check-v7-visual 不开新例外），active = accent 色 +
   既有底部 1px 短线；aria-label 与可见标签同源、aria-current 活动态延续（wxml/HTML 面承载）。 */
.room-nav { display: flex; gap: 4px; flex: none; }
.room-nav button { flex: none; width: 50px; height: 48px; min-height: 48px; padding: var(--v10-bar-pad-y) var(--v10-meta-space); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--v10-meta-space); border: 0; background: transparent; color: var(--text-tertiary); position: relative; }
.room-nav button .tb-icon { width: 18px; height: 18px; }
.nav-label { font-size: 12px; line-height: 1.1; color: var(--text-secondary); }
.room-nav button.active { color: var(--accent); }
.room-nav button.active .nav-label { color: var(--accent); }
.room-nav button.active::after { content: ""; position: absolute; bottom: 0; width: 24px; height: 1px; background: var(--accent); }

/* History and table messages */
.history-card,.table-messages-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.history-item { min-width: 0; min-height: 48px; display: flex; flex-wrap: wrap; align-items: center; }
.history-item + .history-item { border-top: 1px solid var(--border); }
.history-main { height: 48px; min-width: 0; flex: 1; display: flex; align-items: center; gap: 8px; }
.h-avatars { display: flex; align-items: center; gap: 4px; flex: none; }.h-arrow { color: var(--text-tertiary); }
.history-text { min-width: 0; flex: 1; color: var(--text-secondary); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-time { flex: none; color: var(--text-tertiary); font-family: var(--font-score); font-size: 12px; }
.undone-tag { flex: none; color: var(--warning); font-size: 12px; }
.history-item.undone .history-text { text-decoration: line-through; }
.zimo-row { cursor: pointer; }.zimo-detail { width: 100%; display: none; padding: 0 4px 8px; }.history-item.open .zimo-detail { display: block; }
.zimo-line { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 12px; padding: 4px 0; }
.empty { margin: 0; padding: 24px 8px 12px; color: var(--text-tertiary); text-align: center; font-size: 14px; }
.empty-history,.history-full-list > .empty { min-height: 120px; padding-top: 80px; background: var(--v7-empty-history) top center/64px 64px no-repeat; }
.empty-score { min-height: 160px; padding-top: 112px; background: var(--v7-empty-score) top center/96px 96px no-repeat; }
html[data-theme="arena-noir"] .empty-history,html[data-theme="arena-noir"] .history-full-list > .empty { background-image: var(--v6-empty-history); }
html[data-theme="arena-noir"] .empty-score { background-image: var(--v6-empty-score); }
.history-full-list { display: flex; flex-direction: column; }
.history-pagination { align-items: center; }.history-pagination > * { flex: 1; }.history-pagination span { text-align: center; color: var(--text-secondary); font-size: 12px; }
.archive-scores,.restart-summary,.aa-shares { padding: 12px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-md); }
.archive-scores > div,.restart-summary > div,.aa-shares > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.archive-scores h4,.restart-summary h4,.aa-shares h4 { margin: 0 0 8px; }
.message-history-list { min-width: 0; }
.message-history-item { min-height: 52px; display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 8px; }
.message-history-item + .message-history-item { border-top: 1px solid var(--border); }
.message-history-main { min-width: 0; display: flex; flex-direction: column; }
.message-sender { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); font-size: 12px; }
.message-content { min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.message-history-item > small { color: var(--text-tertiary); font-size: 12px; white-space: nowrap; }
.message-graphic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; color: var(--gold-text); }
.message-choice-group h4 { margin: 0 0 8px; font-size: 16px; }
.message-choice-group + .message-choice-group { margin-top: 24px; }
.message-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.message-choice-group:last-child .message-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.message-choice { min-width: 0; min-height: 56px; padding: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); color: var(--text-primary); font-size: 14px; }
.message-choice:active:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.phrase-mark { color: var(--gold-text); font-size: 24px; }

/* Replay */
.replay-panel { padding: 16px; display: flex; flex-direction: column; gap: 12px; border-color: var(--border-strong); }
.readonly-banner { margin: 0; padding: 8px 12px; background: var(--accent-soft); border-left: 1px solid var(--accent); color: var(--accent); font-size: 12px; }
.replay-status { display: flex; justify-content: space-between; color: var(--text-secondary); font-size: 12px; }
.replay-members { display: flex; flex-direction: column; }
.replay-member { min-height: 44px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.replay-member .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replay-member strong { font-family: var(--font-score); font-size: 20px; }.replay-member small { color: var(--text-tertiary); }
.replay-event { min-height: 72px; padding: 12px; background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-secondary); font-size: 14px; }
.replay-event strong { display: block; color: var(--text-primary); margin-bottom: 4px; }
.replay-range { width: 100%; min-height: 44px; accent-color: var(--accent); }
.replay-controls { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }.replay-controls .btn { padding: 8px 4px; font-size: 12px; }

/* Insights */
.insight-panel { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.insight-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.insight-stat { padding: 12px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-md); }
.insight-stat small { display: block; color: var(--text-secondary); font-size: 12px; }.insight-stat strong { display: block; color: var(--accent); font-family: var(--font-score); font-size: 32px; }
.insight-chart { min-height: 192px; padding: 16px 8px 8px; display: flex; align-items: stretch; gap: 4px; background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.insight-column { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; position: relative; }
.insight-column .point-value { min-height: 20px; color: var(--text-secondary); font-family: var(--font-score); font-size: 12px; overflow-wrap: anywhere; }
.insight-bar-track { height: 112px; width: 100%; max-width: 32px; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; }
.insight-bar-track::before { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; height: 1px; background: var(--border-strong); }
.insight-bar { width: 8px; min-height: 4px; max-height: 52px; background: var(--accent); border-radius: var(--radius-sm); position: relative; z-index: 1; }
.insight-bar.negative { background: var(--coral); }.insight-bar.zero { height: 4px; background: var(--text-tertiary); }
.insight-column.not-joined .insight-bar { height: 12px; width: 12px; background: transparent; border: 1px dashed var(--text-tertiary); transform: rotate(45deg); }
.insight-column.current .insight-bar { background: var(--accent); border: 1px solid var(--accent); }
.insight-round { color: var(--text-tertiary); font-size: 12px; white-space: nowrap; }.insight-column.current .insight-round { color: var(--accent); }
.insight-table-wrap { min-width: 0; }
.insight-table-wrap summary { min-height: 44px; color: var(--text-secondary); font-size: 14px; cursor: pointer; }
.insight-row { min-width: 0; min-height: 44px; display: grid; grid-template-columns: minmax(70px,1fr) minmax(70px,1fr) auto; gap: 8px; align-items: center; border-top: 1px solid var(--border); font-size: 12px; }
.insight-row strong { font-family: var(--font-score); font-size: 16px; }.insight-row small { color: var(--text-tertiary); }
.data-definition { margin: 0 4px; line-height: 1.6; }

/* Management */
.manage-sheet .sheet-body { gap: 24px; }
.manage-group { display: flex; flex-direction: column; gap: 8px; }
.manage-group h3 { margin: 0 0 4px; color: var(--text-tertiary); font-size: 12px; letter-spacing: .08em; }
.manage-row,.manage-life { width: 100%; min-width: 0; min-height: 60px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); }
.manage-row > span,.manage-life > span { min-width: 0; display: flex; flex-direction: column; font-weight: 650; }
.manage-row small,.manage-life small { color: var(--text-secondary); font-size: 12px; font-weight: 400; }
.manage-row > b { color: var(--accent); font-size: 24px; }.manage-row.danger-row > b { color: var(--coral); }
.manage-life .btn { flex: none; }

/* Sheets and dialogs */
.mask { position: fixed; inset: 0; z-index: 80; max-width: 100vw; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; background: var(--overlay); overscroll-behavior: contain; }
.mask.center { align-items: center; padding: 16px; z-index: 90; }
.sheet { width: min(100%,560px); max-width: 100%; max-height: 92dvh; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border-strong); border-bottom: 0; border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; box-shadow: 0 -20px 60px rgba(43,27,18,.24); }
.mask:not([hidden]) .sheet { animation: sheet-in 240ms cubic-bezier(.2,.8,.2,1) 1; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.mask.center .sheet { width: min(100%,410px); max-height: 86dvh; padding: 16px; border-bottom: 1px solid var(--border-strong); border-radius: var(--radius-lg); }
.sheet-head { flex: none; min-width: 0; min-height: 68px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.sheet-head > div { min-width: 0; }.sheet-head h2,.sheet-head h3 { margin: 4px 0 0; font-size: 20px; }
.sheet-title-group { min-width: 0; flex: 1; display: flex; align-items: center; gap: 8px; }.sheet-title-group > div { min-width: 0; }
.sheet-step { color: var(--accent); font-family: var(--font-score); font-size: 12px; }
.sheet-body { min-width: 0; min-height: 0; flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-body > h2 { margin: 0; font-size: 24px; }
.sheet-foot { min-width: 0; flex: none; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--border); background: var(--surface); }
.sheet-foot > .btn { flex: 1; }.sheet-foot.vertical { flex-direction: column; }.sheet-foot.vertical > * { width: 100%; }
.sheet-foot .block { flex-basis: 100%; }
.entry-note { margin: 0; color: var(--text-tertiary); font-size: 12px; text-align: center; }
.entry-code-line { margin: 0; color: var(--text-secondary); }.entry-code-line b { color: var(--accent); font-family: var(--font-score); font-size: 20px; letter-spacing: 4px; }
.dialog h3 { margin: 0 0 12px; text-align: center; }.dialog p { font-size: 14px; }.dialog-btns { display: flex; gap: 12px; margin-top: 16px; }.dialog-btns > * { flex: 1; }
#corruptRaw { min-height: 100px; margin-top: 12px; font-family: ui-monospace,monospace; font-size: 12px; }

/* Profile, avatars, themes and local snapshots */
.profile-avatar-row { display: flex; align-items: center; gap: 16px; }.avatar-current { display: flex; }
.avatar-picker { width: 100%; display: grid; grid-template-columns: repeat(4,minmax(48px,1fr)); gap: 8px; }
.avatar-fallback { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: inherit; font-weight: 600; color: var(--on-accent, #FFFDF7); background: linear-gradient(135deg, var(--accent, #C8963E), var(--accent-soft, #E8B54D)); }
.av-opt { min-width: 0; aspect-ratio: 1; padding: 0; position: relative; overflow: hidden; border: 1px solid transparent; border-radius: 50%; background: var(--surface-raised); }
.av-opt[aria-pressed="true"] { border-color: var(--accent); outline: 1px solid var(--accent); }
.check { position: absolute; top: 4px; right: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 12px; line-height: 16px; text-align: center; }
.theme-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.theme-opt { min-width: 0; min-height: 128px; padding: 12px; position: relative; display: flex; flex-direction: column; gap: 8px; text-align: left; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); }
.theme-opt.active { border-color: var(--accent); outline: 1px solid var(--accent); }.theme-opt .swatch { height: 56px; border-radius: var(--radius-sm); background-position: center; background-size: cover; position: relative; }
/* 主题缩略图同走 tex-ready 门控（v11 FR-004b：装饰类纹理 FCP 后才请求；主题 sheet 打开时类已就绪，同图同缓存） */
.sw-jin-yu,.sw-arena-noir { background-image: none; }
body.tex-ready .sw-jin-yu { background-image: var(--v7-ambient-jinyu); }
body.tex-ready .sw-arena-noir { background-image: var(--v6-ambient-a); }
.theme-opt .swatch::after { content: ""; position: absolute; left: 12px; bottom: 8px; width: 32px; height: 4px; background: var(--accent); }
.tname { font-size: 14px; }.theme-local { color: var(--text-tertiary); font-size: 12px; }
.continue-list { display: flex; flex-direction: column; gap: 12px; }.continue-room { min-height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); }.continue-room b { font-family: var(--font-score); letter-spacing: 2px; color: var(--accent); }
.snapshot-list { display: flex; flex-direction: column; gap: 24px; }
.snapshot-card { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-raised); }
.snapshot-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.snapshot-card h3 { margin: 0; font-size: 20px; }
.snapshot-card p { margin: 4px 0 12px; color: var(--text-secondary); font-size: 12px; }
.snapshot-members { border-top: 1px solid var(--border); }
.snapshot-member { min-height: 44px; display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 8px; }
.snapshot-member + .snapshot-member { border-top: 1px solid var(--border); }
.snapshot-member .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.snapshot-member strong { font-family: var(--font-score); font-size: 20px; }
.snapshot-card-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
.snapshot-save-note { margin: 0; text-align: center; }

/* Transfer workbench and advanced tools */
.pgrid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.pj { min-width: 0; min-height: 96px; padding: 12px 8px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); }
.pj.active { border-color: var(--accent); outline: 1px solid var(--accent); background: var(--accent-soft); }.pj.no-perm { border-style: dashed; }.pj .nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }.pj .sub { color: var(--text-tertiary); font-size: 12px; }
.step-summary { display: flex; align-items: center; justify-content: center; gap: 12px; }.step-summary .who { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }.step-summary .who .nm { max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.step-summary .arrow { color: var(--accent); }
.zimo-head { display: flex; align-items: center; gap: 12px; }.zimo-payers { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }.zimo-preview,.settle-score { padding: 12px; background: var(--surface-raised); border-radius: var(--radius-md); text-align: center; color: var(--text-secondary); }
.settle-score { display: flex; justify-content: space-between; align-items: center; }.settle-score strong { font-family: var(--font-score); font-size: 32px; }
.amt-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.amt-btn { min-width: 0; min-height: 56px; padding: 8px 4px; position: relative; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface-raised); font-family: var(--font-score); font-size: 16px; font-weight: 700; }
.amt-btn.active { border-color: var(--accent); outline: 1px solid var(--accent); background: var(--accent-soft); }.amt-custom-row { display: flex; align-items: center; gap: 8px; }.amt-custom-row .btn { flex: none; }
.quick-direction { display: flex; align-items: center; justify-content: center; gap: 12px; }.quick-direction .who { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }.quick-direction .who .nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.quick-direction .who small { color: var(--text-tertiary); }.quick-arrow { color: var(--accent); font-size: 24px; }
.quick-custom-wrap { width: 100%; min-width: 0; display: flex; gap: 8px; }.quick-custom-wrap .text-input { width: 0; flex: 1; margin: 0; }.quick-custom-wrap .btn { flex: none; }
.tool-list { display: flex; flex-direction: column; gap: 8px; }
.tool-card { width: 100%; min-width: 0; min-height: 64px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-md); }
.tool-card > span { min-width: 0; display: flex; flex-direction: column; }.tool-card small { color: var(--text-secondary); font-size: 12px; }.tool-card > b { color: var(--accent); font-size: 24px; }
.tool-member-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }.tool-member { min-width: 0; min-height: 56px; padding: 8px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); }.tool-member > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.tool-member.active { border-color: var(--accent); outline: 1px solid var(--accent); background: var(--accent-soft); }
.seg { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }.seg button { min-width: 0; min-height: 48px; position: relative; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); }.seg button.active { border-color: var(--accent); outline: 1px solid var(--accent); background: var(--accent-soft); }
.tool-mode-seg { grid-template-columns: repeat(2,minmax(0,1fr)); }.individual-amounts { display: flex; flex-direction: column; gap: 8px; }.individual-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(100px,42%); align-items: center; gap: 8px; }.individual-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-preview { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); }.tool-preview h4 { margin: 0 0 8px; }.preview-line { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; font-size: 14px; }.preview-line + .preview-line { border-top: 1px solid var(--border); }.preview-line span { min-width: 0; }.preview-line strong { flex: none; }
.quick-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }.quick-grid input { width: 100%; min-width: 0; min-height: 48px; padding: 8px; text-align: center; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--input-bg); color: var(--text-primary); font-family: var(--font-score); font-size: 16px; font-weight: 700; }
.set-group { display: flex; flex-direction: column; gap: 8px; }

/* Invite */
.invite-body { align-items: center; text-align: center; }.qr-wrap { max-width: 100%; padding: 16px; background: #FFFCF4; border-radius: var(--radius-md); }.qr-wrap canvas { display: block; max-width: 100%; height: auto !important; }.qr-fallback { color: var(--warning); }.invite-code { color: var(--accent); font-family: var(--font-score); font-size: 32px; font-weight: 700; letter-spacing: 4px; }.invite-url { max-width: 100%; color: var(--text-tertiary); font-size: 12px; word-break: break-all; }.warn-note { color: var(--warning); font-size: 12px; }

/* Report */
.privacy-options { display: flex; flex-direction: column; gap: 8px; }.privacy-options label { min-height: 44px; display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 14px; }.privacy-options input { width: 20px; height: 20px; accent-color: var(--accent); }
.report-preview { min-width: 0; padding: 16px 16px; background: linear-gradient(rgba(255,252,244,.96),rgba(255,252,244,.96)),var(--v7-report-jinyu) top/cover; border: 1px solid var(--border-strong); border-radius: var(--radius-md); }
html[data-theme="arena-noir"] .report-preview { background: linear-gradient(rgba(17,24,39,.96),rgba(17,24,39,.96)),var(--v6-report-bg) top/cover; }
.report-preview h3 { margin: 0 0 4px; color: var(--accent); font-size: 20px; }.report-preview .report-room { margin: 0; color: var(--text-primary); }.report-preview .report-meta { margin: 0 0 16px; color: var(--text-secondary); font-size: 12px; }.report-line { min-width: 0; min-height: 40px; display: grid; grid-template-columns: 52px minmax(0,1fr) auto; align-items: center; gap: 8px; border-top: 1px solid var(--border); font-size: 12px; }.report-line .nm { min-width: 0; overflow-wrap: anywhere; }.report-line strong { font-family: var(--font-score); font-size: 20px; }.report-line.not-joined { grid-template-columns: 52px minmax(0,1fr); color: var(--text-tertiary); }.report-privacy { margin: 12px 0 0; color: var(--text-tertiary); font-size: 12px; }.report-line-text { padding: 4px 0; font-size: 14px; }.report-text-fallback { min-height: 172px; resize: vertical; font-size: 12px; }

/* Templates */
.template-list { display: flex; flex-direction: column; gap: 12px; }.template-card { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); }.template-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }.template-card h3 { margin: 0; font-size: 16px; }.template-card p { margin: 4px 0 12px; color: var(--text-secondary); font-size: 12px; }.template-card-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }.template-card-actions .btn { min-height: 44px; padding: 8px; font-size: 12px; }.template-order { display: flex; gap: 4px; }.template-order .btn { min-width: 44px; padding: 4px; }
.template-diff { padding: 12px; border: 1px solid var(--accent); border-radius: var(--radius-md); background: var(--accent-soft); }.template-diff h3 { margin: 0 0 8px; }.template-diff p { margin: 4px 0; font-size: 14px; }

/* Ads and toast */
.ad-slot { width: min(100%,320px); height: 50px; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--text-tertiary); background: var(--surface); font-size: 12px; }
.ad-slot-entry { align-self: center; flex: none; }.ad-slot-room { position: static; width: 100%; pointer-events: none; }
#toast { position: fixed; z-index: 120; left: 50%; bottom: calc(var(--toast-bottom) + env(safe-area-inset-bottom)); transform: translate(-50%,8px); max-width: min(88vw,480px); padding: 12px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface-bright); color: var(--text-primary); box-shadow: 0 12px 32px rgba(43,27,18,.20); font-size: 14px; text-align: center; opacity: 0; pointer-events: none; transition: opacity var(--motion),transform var(--motion); }
#toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width:390px) {
  .entry-shell { padding-left: 16px; padding-right: 16px; gap: 24px; }
  .entry-hero-block h1 { font-size: 40px; }
  .sheet-head,.sheet-body,.sheet-foot { padding-left: 16px; padding-right: 16px; }
  .amt-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .destination-heading .btn { padding-left: 12px; padding-right: 12px; }
  .scores-head .head-note { display: none; }
}
@media (max-width:340px) {
  .entry-actions > .btn small { display: none; }
  .member-row { gap: 4px; grid-template-columns: 32px 44px minmax(0,1fr) auto; }
  .member-score { font-size: 24px; }
  /* v12：self-badge/message-action 窄屏规则随节点注销（specs/009 FR-012/FR-016） */
  .pgrid,.tool-member-grid { grid-template-columns: 1fr; }
  .privacy-options { font-size: 12px; }
}
@media (min-width:700px) { .entry-shell { padding-top: 32px; }.room-main { padding-top: 24px; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* v8 poster backdrop: assets/v8/manifest.json poster-jinyu（jin-yu 主题）。v11 外置为文档相对引用
   （poster-jinyu.jpg）；战报海报经 report-card posterBackgroundUrl() 消费（相对文档解析），
   dist 由 build-standalone 内联回 data URL。 */
:root {
  --v8-poster-jinyu: url(assets/v8/poster-jinyu.jpg);
}

/* ===== v8 reflow: 顶栏图标（基类）/ 得分多视图 / 两级帮助 / 新功能 =====
   v12（specs/009 US2/US4）：bar-bottom-row/self-badge/avatar.av28 规则随底栏行 B 节点一并注销。 */
.tb-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tb-icon-btn { width: 44px; height: 44px; min-width: 44px; padding: 8px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); color: var(--text-secondary); }
.tb-icon-btn:active:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.tb-btns { gap: 4px; }

/* ===== v12 顶栏精致化（specs/009 US1，FR-001/FR-002；作用域铁律：仅 #topbar——.tb-icon-btn 基类与
   落地页 entryHelpBtn〔h5/index.html〕共享，基类零改动，落地页形态零变化＝回归断言面）=====
   字形 20→18（单枚面积 −19%）、去盒化 ghost（常态零背景零边框，仅 :active accent 反馈）、盒间 gap 4→2
   （经既有 v10 令牌 var(--v10-meta-space) 承载，v7 间距令牌表纪律）；触控命中盒 44×44 不变（v10 契约）。
   自洽几何锚：盒列 5×44+4×2=228 ≤228（现状 236；4 枚态 ≤180）；首末字形外缘距 228−2×13=202 ≤210
   （现状 212——字形在 44 盒内由 flex 光学居中，盒中心距恒 44+gap，与 padding 取值无涉；故 padding 用 0
   而非 13——13 未入 v7 间距令牌表，flex 居中几何等价）；.topbar-info = 视口宽−264 的派生量
   （390 视口 ≥126 / 375 视口 ≥111——固定 126 在 375 字面不可达，几何断言仅 390×844 执行）。 */
#topbar .tb-icon-btn { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; color: var(--text-secondary); }
#topbar .tb-icon-btn:active:not(:disabled) { color: var(--accent); }
#topbar .tb-icon { width: 18px; height: 18px; }
#topbar .tb-btns { gap: var(--v10-meta-space); }

/* 得分模块：视图分段 + 三甲奖牌卡 + 紧凑行 + 平铺网格 */
.scores-head { min-height: 40px; }
.view-seg { display: flex; gap: 4px; }
.view-seg button { min-width: 0; min-height: 44px; margin: -4px 0; padding: 4px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--text-secondary); font-size: 12px; }
.view-seg button.active { border-color: var(--accent); outline: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); }
.members-card { display: flex; flex-direction: column; gap: 4px; padding: 12px; }
.podium-row { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
/* 水平 padding 8→4：内容宽 87.3→95.3px，粗体 9 字符@16px（±11999988，8 笔 999999 真实可达）方可单行放下（FR-005 极值降档） */
.podium-card { min-width: 0; height: 132px; padding: 12px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 20px; position: relative; }
/* 奖牌改角标浮层（与「我」tag 同模式）：腾出流内 28px，昵称才有机会在固定 132px 卡内可见 */
.podium-card .medal { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; }
/* 触控 44×44（FR-011）：命中区扩到 44，负边距补偿使卡片排版几何不变（US2 首屏全员/完整行契约） */
.podium-card .avatar { width: 44px; height: 44px; margin: -2px; flex: none; }
/* 昵称修复（验收 blocking）：固定高 flex 列卡里 name 是唯一 overflow:hidden 子项，自动最小高为 0，
 * 内容超高时吸收全部收缩被压至 0 高——flex:none + 固定行高保住可见行盒 */
.podium-name { flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 18px; }
.podium-rank { color: var(--text-tertiary); font-size: 12px; line-height: 18px; }
.podium-score { max-width: 100%; overflow-wrap: anywhere; text-align: center; font-family: var(--font-score); font-size: 24px; font-weight: 750; line-height: 1.1; }
.podium-score.sz-m { font-size: 20px; } /* 7 字符（±999999）降档：卡内容宽 ~87px，24px 会折行溢出卡高 */
.podium-score.sz-s { font-size: 20px; }
.podium-score.sz-xs { font-size: 16px; }
.podium-card.self { background: var(--accent-soft); border-color: var(--accent); }
.podium-card .tag { position: absolute; top: 4px; right: 4px; padding: 0 4px; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); font-size: 12px; }
.member-list { display: flex; flex-direction: column; }
.member-row.self-row { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.member-list.grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.grid-card { min-width: 0; height: 104px; padding: 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-md); position: relative; }
.grid-card .avatar { width: 44px; height: 44px; margin: -6px; flex: none; } /* -6 补偿：昵称可见后卡内容超高，流高 32 命中区仍 44 */
/* 同 podium-name：flex:none 防 0 高收缩 */
.grid-name { flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 18px; }
.grid-rank { color: var(--text-tertiary); font-size: 12px; line-height: 18px; }
.grid-score { max-width: 100%; overflow-wrap: anywhere; font-family: var(--font-score); font-size: 20px; font-weight: 750; line-height: 1.1; }
.grid-score.sz-s { font-size: 16px; }
.grid-score.sz-xs { font-size: 16px; } /* ≥8 字符降档下限 16px（FR-006 极值下限，此前缺规则回落 20px 折行） */
.grid-card.self { background: var(--accent-soft); border-color: var(--accent); }
.grid-card .tag { position: absolute; top: 4px; left: 4px; padding: 0 4px; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); font-size: 12px; }

/* 动态目的地：互动卡空态折叠为一行入口 */
.message-peek { width: 100%; min-height: 48px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; border: 1px dashed var(--border); border-radius: var(--radius-md); background: transparent; color: var(--text-tertiary); font-size: 14px; }
.message-peek b { color: var(--accent); }

/* 两级帮助：页面级 help sheet 分组 + 业务 sheet 行内说明 */
.help-group h3 { margin: 0 0 8px; color: var(--gold-text); font-size: 14px; }
.help-group p { margin: 0 0 8px; color: var(--text-secondary); font-size: 14px; }
.help-group + .help-group { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.inline-help-btn { width: 44px; height: 44px; min-height: 44px; padding: 4px; align-self: flex-start; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-raised); color: var(--text-secondary); }
.inline-help p { margin: 0 0 8px; color: var(--text-secondary); font-size: 14px; }
.entry-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* 落地页模板直达卡（最近 ≤2，核心入口之后） */
.recent-templates { display: flex; flex-direction: column; gap: 8px; }
.recent-template-card { min-width: 0; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); }
.recent-template-card > span { min-width: 0; display: flex; flex-direction: column; }
.recent-template-card strong { font-size: 14px; }
.recent-template-card small { color: var(--text-secondary); font-size: 12px; }
.recent-template-card .btn { flex: none; }

/* 结算快照 + 战绩分段 */
.snapshot-tabs { align-self: center; }
.stats-scope { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
.stats-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.stats-summary .insight-stat strong { font-size: 24px; }
.stats-list { display: flex; flex-direction: column; }
.stats-row { min-width: 0; min-height: 48px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); }
.stats-row + .stats-row { margin-top: 8px; }
.stats-row.focus { border-color: var(--accent); outline: 1px solid var(--accent); background: var(--accent-soft); }
.stats-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.stats-row .meta { color: var(--text-tertiary); font-size: 12px; }
.stats-row .net { font-family: var(--font-score); font-size: 20px; }
.trend-bars { display: flex; align-items: flex-end; gap: 4px; height: 20px; margin-top: 4px; }
.trend-bars i { width: 6px; min-height: 2px; border-radius: 8px; background: var(--gold); }
.trend-bars i.neg { background: var(--text-tertiary); }

/* ===== v10 主界面焕新（specs/007-ai-universal-redesign：两视图深度区分 / AI 层 / 抽奖 / 分账包） ===== */

/* ---- 排行榜「鎏金榜单 · 竞逐」：单列行式列表（52px 紧凑行）+ 名次徽章/三甲奖牌（复用 v8 medal）
 *  + 分隔线行 + 榜首金线强调；分数 ≥28px（既有 32px 档）右对齐为列表主信息。同名次口径不变。 ---- */
.podium-card.rank-top-line { border-top: 4px solid var(--gold); box-shadow: 0 4px 16px rgba(214,164,45,.22); }
.member-row .member-score { letter-spacing: 0; }
.rank-badge.rank-1 { background: var(--gold); border-color: var(--gold-text); color: var(--surface); }

/* ---- 平铺「满堂圆桌 · 围坐」：≥2 列网格 + ≥56px 卡内居中大头像（本房间最大头像层级）+ ≤24px 居中
 *  分数 + 独立圆角彩块卡（浅底/描边/阴影 + 金玉角饰 SVG，tile-corner-a/b 对角布置）+ 无徽章无奖牌
 *  （顺序仍按名次但不标号）+ 卡整体 = 转移热区（≥44）。与排行榜 ≥5 计算样式维度差异（FR-008）：
 *  ①布局 display（grid vs flex 单列）②头像 56 vs 行 44 ③名次徽章有无 ④卡形态（圆角/阴影彩块 vs 分隔线行）
 *  ⑤分数字号 20 vs 32。 ---- */
.avatar.av56 { width: 56px; height: 56px; }
.member-list.grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.grid-card { min-width: 0; min-height: 116px; height: auto; padding: 8px 4px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); position: relative; overflow: hidden; box-shadow: 0 4px 12px rgba(43,27,18,.10); text-align: center; cursor: pointer; background: var(--surface-raised); }
.grid-card .avatar { width: 56px; height: 56px; margin: 0; flex: none; }
.grid-card.self { outline: 2px solid var(--accent); outline-offset: -2px; }
.grid-card[disabled] { cursor: not-allowed; }
.grid-card .tag { top: 4px; right: 4px; left: auto; }
/* 圆桌彩块：六个浅底 tint 轮换（金玉主题令牌派生；arena-noir 下同为派生深色块），双主题各自成立 */
.grid-card.tint-0 { background: rgba(214,164,45,.14); }
.grid-card.tint-1 { background: rgba(var(--accent-rgb),.10); }
.grid-card.tint-2 { background: rgba(64,86,79,.12); }
.grid-card.tint-3 { background: rgba(214,164,45,.22); }
.grid-card.tint-4 { background: rgba(var(--accent-rgb),.16); }
.grid-card.tint-5 { background: rgba(138,90,0,.12); }
html[data-theme="arena-noir"] .grid-card.tint-0,
html[data-theme="arena-noir"] .grid-card.tint-3 { background: rgba(244,201,125,.10); }
html[data-theme="arena-noir"] .grid-card.tint-2,
html[data-theme="arena-noir"] .grid-card.tint-5 { background: rgba(139,150,170,.12); }
/* 金玉角饰（assets/v10 icons tile-corner-a/b）：轻装饰、aria-hidden，不与头像/分数争层级（≤44px 建议） */
.tile-corner { position: absolute; width: 20px; height: 20px; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .8; pointer-events: none; }
.tile-corner.c-tl { top: 2px; left: 2px; }
.tile-corner.c-br { bottom: 2px; right: 2px; }

/* ---- v10 AI 记一层 / 告知 / 战报点评 / 随机抽奖 ---- */
.ai-text-input { width: 100%; min-height: 72px; resize: none; }
.ai-char-count { margin: 0; color: var(--text-tertiary); font-size: 12px; text-align: right; }
.ai-clarify { padding: 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--surface-raised); }
.ai-clarify h4 { margin: 0 0 8px; font-size: 14px; }
.ai-clarify-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-clarify-row .btn { min-height: 44px; }
.ai-tool-card { border-color: var(--gold); background: var(--gold-soft); }
html[data-theme="arena-noir"] .ai-tool-card { background: var(--surface-bright); }
.ai-tool-card .ai-tool-eyebrow { color: var(--gold-text); font-size: 12px; font-weight: 700; }
.ai-tool-card strong { display: inline-flex; align-items: center; gap: 4px; }
.ai-tool-card .ai-spark-icon { width: 20px; height: 20px; fill: none; stroke: var(--gold-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ai-comment { margin: 0; border: 1px solid var(--gold); border-radius: var(--radius-md); background: var(--gold-soft); }
html[data-theme="arena-noir"] .ai-comment { background: var(--surface-bright); }
.ai-comment summary { padding: 8px 12px; color: var(--gold-text); font-size: 14px; font-weight: 650; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.ai-comment p { margin: 0; padding: 0 12px 8px; color: var(--text-primary); font-size: 14px; overflow-wrap: anywhere; }
.ai-comment-busy { color: var(--text-secondary); font-size: 12px; }
.draw-pool { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.draw-chip { min-width: 0; min-height: 64px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); color: var(--text-primary); font-size: 12px; }
.draw-chip .nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draw-chip.drawn { opacity: .45; border-style: dashed; }
.draw-chip.winner { border-color: var(--gold); outline: 1px solid var(--gold); animation: draw-win 240ms ease-out 1; }
@keyframes draw-win { from { background: var(--gold-soft); transform: scale(1.04); } to { background: transparent; transform: scale(1); } }
.draw-exclude { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text-secondary); font-size: 14px; }
.draw-result { min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); color: var(--text-secondary); font-size: 14px; }
.draw-result .nm { font-weight: 700; color: var(--gold-text); font-size: 20px; }

/* ===== v11 审视修复轮（specs/008-audit-fix-round）：工具菜单 / 承接页 / 单人 CTA / toast 归位 ===== */

/* T025（FR-014）：落地页无底栏，toast 贴底 24px 口径（房间页 192px/动态值不动）。
   #toast 为 body 子节点、不在 #viewEntry 内，故以 body.view-entry 视图类作用域（app JS showView 维护）。 */
body.view-entry #toast { bottom: calc(24px + env(safe-area-inset-bottom)); }

/* T027（FR-016）：落地页单一「本机工具」入口（原四按钮 nav 折并；触控 ≥44、全宽行） */
.entry-utilities button#entryToolsBtn { min-height: 48px; flex-direction: row; gap: 8px; font-size: 14px; }
/* 图标字号回落基础规则 .entry-utilities button > span:first-child 的 20px 令牌（v11 修复轮：原 18px override 未登记令牌，且与工具菜单图标 20px 口径不一） */

/* 工具菜单：1 击展开的 sheet 菜单（四项次序不变，id 原样保留挂载点内） */
.entry-tools-menu { display: flex; flex-direction: column; gap: 8px; }
.entry-tools-menu button { min-height: 56px; padding: 8px 12px; display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); color: var(--text-primary); font-size: 16px; font-weight: 650; }
.entry-tools-menu button > span:first-child { color: var(--accent); font-size: 20px; flex: none; }
.entry-tools-menu button small { margin-left: auto; color: var(--text-secondary); font-size: 12px; font-weight: 400; }

/* T033（FR-021）：「这局已结束」承接视图（纯前端视图态，非路由） */
.entry-expired-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); }
.entry-expired-card h2 { margin: 0; font-size: 24px; }
.expired-desc { margin: 0; color: var(--text-secondary); font-size: 14px; }
.expired-reuse { padding: 8px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text-secondary); font-size: 12px; }
.entry-expired-actions { display: flex; flex-direction: column; gap: 8px; }

/* T030（FR-019）v11 次级禁用入口 .record-secondary 规则随节点移除（v12 specs/009 §2 去留表 #2：
   原因「至少 2 人才能记账」（CP-40）由主按钮 .btn-reason 两行 stack 内嵌逐字沿用，M20）。 */
