/* AI 杀人游戏竞技场 — 深夜推理综艺（D34/D35/D37）
   D37 定位（功能出发）：观战页 = 深夜点播影院（UI 退场，颜色只来自卡司与事件）；
                        工坊页 = 糖果卡牌后台（你在捏一张实体选手卡）。
   设计系统三条纪律：
   1. 字体三层职责制：display（得意黑）= 标题/名牌/揭榜/CTA；body = 台词与说明；mono = 一切数据
   2. 8pt 间距栅格：所有 padding/margin/gap 只取 --s-* 档位
   3. 硬阴影只给可点击或正在发生的事；层级靠背景三档明度 + 重阴影（暗场里浅阴影是隐形的） */
* { margin: 0; padding: 0; box-sizing: border-box; }

@font-face {
  font-family: "DisplayCN"; /* 得意黑 Smiley Sans 子集（tts/subset-font.mjs 生成，OFL 可商用）——D43 换：黄油体中文可读性差 */
  src: url(fonts/display.woff2) format("woff2");
  font-display: swap;
}

:root {
  /* 色板（D39 重调：舞台压黑、紫味只留一丝——中间亮度的紫灰会把糖果色泡死） */
  --bg: #121016;         /* 墨黑舞台（带一丝紫，不用纯黑） */
  --bg-panel: #191521;
  --bg-card: #1f1a28;
  --line: #38304a;
  --ink: #0e0b14;        /* 糖果色块上的深色字 / 硬阴影 / 顶栏与播放条 */
  --paper: #f6f1e6;      /* 台词纸：说出口的话上实色纸块（心里话留在阴影里） */
  --paper-dim: #6b6478;  /* 纸上的次要字 */
  --text: #f0ecf9;
  --text-dim: #aaa2c0; /* 注解层：暗底上要读得清（D38 提亮） */
  --accent: #ffc900;     /* 奶黄：法官 / 高亮 */
  --cta: #ff90e8;        /* 全站唯一主 CTA 粉 */
  --mint: #23a094;
  --coral: #ff6b5b;
  --sky: #7bd3f7;
  --killer: #ff6b5b;
  --killer-bg: #2a151c;
  --police: #7bd3f7;
  --police-bg: #142031;
  --good: #23a094;
  --night: #1c1830;
  /* 字体 */
  --display: "DisplayCN", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, Consolas, "Cascadia Mono", monospace;
  /* 8pt 栅格 */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  /* 圆角与阴影 */
  --r-card: 12px;
  --r-pill: 999px;
  --pop: 3px 3px 0 var(--ink);
  --pop-lg: 4px 4px 0 var(--ink);
  --float: 0 8px 24px rgba(0, 0, 0, 0.5); /* 浮层重阴影：抽屉/弹层/字幕盒 */
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.7;
}
#app { display: flex; flex-direction: column; height: 100dvh; }
.hidden { display: none !important; }

/* ============ 顶栏 ============ */
#topbar {
  display: flex; align-items: center; gap: var(--s-4);
  height: 56px; flex-shrink: 0;
  background: var(--ink);
  padding: 0 var(--s-5);
}
#topbar h1 { font-family: var(--display); font-size: 18px; font-weight: 400; letter-spacing: 2px; }
#now-title {
  font-family: var(--mono); font-size: 12px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
#btn-guide { flex-shrink: 0; }
.studio-link {
  margin-left: auto; flex-shrink: 0;
  color: var(--accent); text-decoration: none; font-size: 13px;
  padding: var(--s-1) var(--s-4); border: 1px solid var(--line); border-radius: var(--r-pill);
  transition: border-color .12s;
}
.studio-link:hover { border-color: var(--accent); }

/* ============ 节目单抽屉 ============ */
#guide {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(10, 8, 16, 0.72);
  display: none;
}
#guide.open { display: block; }
#guide-panel {
  width: min(480px, 94vw); height: 100%;
  background: var(--bg-panel);
  box-shadow: var(--float);
  padding: var(--s-5) var(--s-5) var(--s-6);
  overflow-y: auto;
  animation: guideIn .22s ease;
}
@keyframes guideIn {
  from { transform: translateX(-24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
#guide-head { display: flex; align-items: center; justify-content: space-between; }
#guide-head h2 { font-family: var(--display); font-size: 20px; font-weight: 400; letter-spacing: 2px; }
#guide .tagline { color: var(--text-dim); font-size: 12px; margin: var(--s-1) 0 var(--s-5); }

/* 节目卡：海报化——标题 + 阵容脸排 + 日期与胜负角标 */
.match-item {
  padding: var(--s-4) var(--s-4); margin-bottom: var(--s-3);
  background: var(--bg-card); border-radius: var(--r-card);
  cursor: pointer; border: 2px solid transparent;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.match-item:hover { transform: translate(-2px, -2px); box-shadow: var(--pop); }
.match-item.active { border-color: var(--cta); box-shadow: var(--pop); }
.match-item .m-title { font-family: var(--display); font-size: 15px; font-weight: 400; letter-spacing: 1px; }
.match-item .m-faces { display: flex; gap: var(--s-1); margin: var(--s-2) 0 var(--s-2); }
.m-face {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: 50% 14%;
  border: 2px solid var(--plate, var(--line)); background: var(--bg);
}
.m-face-n {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--ink); background: var(--plate, var(--text-dim)); border: none;
}
.match-item .m-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.match-item .m-sub { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.w-killers, .w-good {
  display: inline-block; padding: 1px 10px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700; color: var(--ink);
}
.w-killers { background: var(--coral); }
.w-good { background: var(--mint); }

/* ============ 主舞台 ============ */
#stage { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }

#advance-hint {
  position: absolute; right: var(--s-6); bottom: var(--s-4); z-index: 5;
  color: var(--accent); font-size: 17px; pointer-events: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  animation: hintBlink 1.1s ease-in-out infinite;
}
@keyframes hintBlink {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(3px); }
}

/* 剧场：影院暗场，字幕盒靠重阴影浮起（不描边） */
#theater {
  flex: 1; min-height: 0;
  position: relative; /* D51：演员层脱离文档流，台词框长高时盖住演员而不是压缩舞台 */
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  background: linear-gradient(rgba(18, 16, 22, 0.5), rgba(18, 16, 22, 0.82)),
    url(assets/cover.jpg) center / cover no-repeat;
  padding: var(--s-5) var(--s-4) var(--s-5);
}
/* 演员占满整个舞台（大小恒定），台词框浮在其上层 */
#th-figure { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
#th-vrm { position: absolute; inset: 0; width: 100%; height: 100%; }
#th-vrm.hidden { display: none; }
#th-portrait {
  max-height: min(44vh, 400px); max-width: 80vw;
  border-radius: var(--r-card);
  box-shadow: 0 14px 56px rgba(0, 0, 0, 0.55);
}
#th-face { font-size: 100px; line-height: 1; filter: drop-shadow(0 8px 24px rgba(0,0,0,.5)); }
#th-box {
  width: min(760px, 96%); margin-top: var(--s-4);
  position: relative; z-index: 2; /* 浮在演员层之上（D51） */
  background: rgba(16, 13, 22, 0.94);
  border-radius: var(--r-card);
  box-shadow: var(--float);
  padding: var(--s-4) var(--s-5) var(--s-4); min-height: 116px;
}
#th-nameline { display: flex; align-items: center; gap: var(--s-4); margin-bottom: var(--s-2); }
/* 签名件：综艺字幕名牌——应援色色块 + 黄油体 + 硬阴影 + 微倾（本页唯一倾斜元素） */
#th-name {
  font-family: var(--display); font-size: 15px; font-weight: 400; letter-spacing: 1px;
  color: var(--ink); background: var(--plate, var(--accent));
  padding: 3px 16px; border-radius: var(--r-pill);
  transform: rotate(-1.2deg); transform-origin: left center;
  box-shadow: var(--pop);
}
#th-name:empty { display: none; }
#th-name.plate-in { animation: plateIn .28s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes plateIn {
  from { transform: rotate(-1.2deg) scale(.85); opacity: 0; }
  to { transform: rotate(-1.2deg) scale(1); opacity: 1; }
}
#th-sub { color: var(--text-dim); font-size: 12px; }
#th-think {
  font-size: 12.5px; color: var(--text-dim); font-style: italic;
  margin-bottom: var(--s-2); white-space: pre-wrap;
  border-left: 2px solid var(--line); padding-left: var(--s-3);
}
.th-think-in { animation: thinkIn 0.8s ease; }
@keyframes thinkIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
body.hide-thinking #th-think { display: none; }
#th-dialog { font-size: 15.5px; line-height: 1.85; white-space: pre-wrap; min-height: 56px; }
#th-extra { max-height: 42vh; overflow-y: auto; }
#th-extra .vote-card { margin: var(--s-1) auto var(--s-2); background: transparent; border: none; padding: var(--s-1) 0; }
#th-extra .banner { margin: var(--s-2) auto; }

/* ============ 座位条（OB 席）：舞台下方一排，说话人点亮 ============ */
#roster {
  display: flex; justify-content: center; gap: var(--s-4);
  padding: var(--s-2) var(--s-4);
  background: rgba(14, 11, 20, 0.72);
  flex-shrink: 0;
}
#roster:empty { display: none; }
.seat-chip {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-1);
  width: 64px; padding-top: var(--s-2);
  transition: transform .15s, opacity .15s;
  cursor: pointer; /* D104：点头像看选手装备卡 */
}
.seat-chip:hover { transform: translateY(-2px); }
.seat-chip .chip-name { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; max-width: 64px; }
.seat-chip.dead { opacity: .35; }
.seat-chip.dead .cast-avatar { filter: grayscale(1) brightness(0.6); }
.seat-chip.talking { transform: translateY(-3px); }
.seat-chip.talking .cast-avatar, .seat-chip.talking > .avatar { box-shadow: var(--pop); }
.seat-chip.talking .chip-name { color: var(--plate, var(--text)); font-weight: 700; }
.cast-wrap { position: relative; flex-shrink: 0; }
.cast-avatar {
  width: 44px; height: 44px; border-radius: var(--r-card); display: block;
  object-fit: cover; object-position: 50% 14%;
  border: 2px solid var(--plate, var(--line)); background: var(--bg);
}
.cast-seat {
  position: absolute; bottom: -3px; left: -3px;
  width: 17px; height: 17px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  color: var(--ink); background: var(--plate, var(--text-dim));
  border: 1px solid var(--ink);
}
.role-badge { font-size: 12px; }

/* ============ 号码牌（应援色由 JS 注入 --plate，旧局回落座位色） ============ */
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  color: var(--ink); flex-shrink: 0;
  background: var(--plate, var(--text-dim));
}
.av-1 { --plate: #ffd9a0; } .av-2 { --plate: #7bd3f7; }
.av-3 { --plate: #ff90e8; } .av-4 { --plate: #7fb069; }
.av-5 { --plate: #e8564b; } .av-6 { --plate: #9caf88; }
.av-7 { --plate: #c77dff; } .av-8 { --plate: #d4a24c; }

/* ============ 列表视图 ============ */
#feed { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s-6) 8%; scroll-behavior: smooth; }
#feed {
  background: linear-gradient(rgba(18, 16, 22, 0.88), rgba(18, 16, 22, 0.95)),
    url(assets/cover.jpg) center / cover no-repeat;
}
#feed.empty {
  background: linear-gradient(rgba(18, 16, 22, 0.15), rgba(18, 16, 22, 0.7)),
    url(assets/cover.jpg) center / cover no-repeat;
}
.empty-hint { color: var(--text); text-align: center; margin-top: 40vh; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); }

/* 阶段分隔条 */
.banner {
  text-align: center; margin: var(--s-6) auto var(--s-5); padding: var(--s-2) var(--s-5);
  border-radius: var(--r-pill); font-size: 14px; letter-spacing: 2px;
  width: fit-content;
}
.banner.night { background: #2b2452; color: #cfc9ff; }
.banner.day { background: var(--accent); color: var(--ink); }
.banner.death { background: var(--coral); color: var(--ink); }
/* 终局 = 揭榜 */
.banner.result {
  background: var(--mint); color: var(--ink);
  font-family: var(--display); font-size: 19px; letter-spacing: 3px;
  padding: var(--s-3) var(--s-6); box-shadow: var(--pop-lg);
}
.banner.result.killers-win { background: var(--coral); color: var(--ink); }
.banner.info { color: var(--text-dim); }

/* 消息气泡 */
.msg { display: flex; gap: var(--s-3); margin-bottom: var(--s-5); max-width: 760px; }
.msg .bubble-wrap { min-width: 0; }
.msg .who { font-size: 12px; color: var(--text-dim); margin-bottom: var(--s-1); }
.msg .who .model-tag { margin-left: var(--s-2); font-family: var(--mono); font-size: 10px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--line); }
/* 台词纸：说出口的话 = 灯下的实色纸块（Gumroad 式墨字色块）；心里话留在阴影里 */
.bubble {
  background: var(--paper); color: var(--ink);
  border-radius: 4px var(--r-card) var(--r-card) var(--r-card); padding: var(--s-3) var(--s-4);
  white-space: pre-wrap; word-break: break-word;
  box-shadow: var(--pop);
}
.bubble.lastwords { background: #efe3c4; }
.thinking {
  margin-top: var(--s-2); padding: var(--s-2) var(--s-3); font-size: 12.5px;
  color: var(--text-dim); font-style: italic;
  background: rgba(90, 96, 140, 0.08); border-left: 2px solid var(--line);
  border-radius: 0 var(--s-2) var(--s-2) 0; white-space: pre-wrap;
}
.thinking::before { content: "💭 "; font-style: normal; }
body.hide-thinking .thinking { display: none; }

/* 队内频道 */
.channel {
  margin: var(--s-4) auto var(--s-5); max-width: 700px;
  border-radius: var(--r-card); padding: var(--s-3) var(--s-4); font-size: 13.5px;
}
.channel.killers { background: var(--killer-bg); border-left: 3px solid var(--killer); }
.channel.police { background: var(--police-bg); border-left: 3px solid var(--police); }
/* 频道标签 = 阵营色实底小旗 */
.channel .ch-label {
  display: inline-block; font-family: var(--display); font-size: 12px; font-weight: 400;
  letter-spacing: 2px; margin-bottom: var(--s-2);
  color: var(--ink); padding: 1px 12px; border-radius: var(--r-pill);
}
.channel.killers .ch-label { background: var(--killer); }
.channel.police .ch-label { background: var(--police); }
.channel .action-line { color: var(--text-dim); font-size: 12.5px; }
.channel .say-line { white-space: pre-wrap; }

/* 票型：计分板 */
.vote-card {
  margin: var(--s-4) auto; max-width: 700px;
  background: var(--bg-card); border-radius: var(--r-card);
  padding: var(--s-4) var(--s-4);
}
.vote-card .v-title { font-family: var(--display); font-size: 12px; font-weight: 400; color: var(--text-dim); letter-spacing: 2px; margin-bottom: var(--s-3); }
.vote-grid { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.vote-pair {
  display: flex; align-items: center; gap: var(--s-1);
  background: var(--bg-panel); border-radius: var(--r-pill); padding: var(--s-1) var(--s-3);
  font-family: var(--mono); font-size: 13px;
}
.vote-pair .arrow { color: var(--text-dim); }

.rules-card .rules-text { white-space: pre-wrap; font-size: 12.5px; color: var(--text-dim); line-height: 1.8; }

/* ============ tester 视角（仅本地） ============ */
.trace-btn {
  border: none; background: none; padding: 0 2px; font-size: 12px;
  cursor: pointer; opacity: .5; vertical-align: baseline;
}
.trace-btn:hover { opacity: 1; border-color: transparent; }
#trace-modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10, 8, 16, 0.72);
  display: flex; align-items: center; justify-content: center;
}
#trace-modal.hidden { display: none; }
#trace-panel {
  width: min(880px, 92vw); max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--bg-panel); border-radius: var(--r-card);
  box-shadow: var(--float);
}
#trace-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line);
  font-family: var(--display); font-size: 13px; color: var(--accent); letter-spacing: 1px;
}
#trace-close { font-size: 13px; padding: 3px 10px; }
#trace-body { overflow-y: auto; padding: var(--s-4) var(--s-4); }
.trace-sec { margin-bottom: var(--s-4); }
.trace-sec-title { font-family: var(--display); font-size: 12px; font-weight: 400; color: var(--text-dim); letter-spacing: 2px; margin-bottom: var(--s-2); }
.trace-sec pre {
  white-space: pre-wrap; word-break: break-word;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: var(--s-3) var(--s-4); font-size: 12.5px; line-height: 1.7;
  font-family: var(--mono);
}

/* ============ 播放条：影院底部操作台 ============ */
#controls {
  background: var(--ink);
  padding: var(--s-3) var(--s-5);
  flex-shrink: 0;
}
#controls.hidden { display: none; }
.ctrl-row { display: flex; align-items: center; gap: var(--s-4); }
.ctrl-row.options { margin-top: var(--s-2); font-size: 12.5px; color: var(--text-dim); flex-wrap: wrap; gap: var(--s-5); }
.ctrl-row label { display: flex; align-items: center; gap: var(--s-2); }

/* 按钮层级：默认幽灵；▶ 与快速开局是全站仅有的粉色主角 */
button {
  background: transparent; color: var(--text); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 5px 16px; cursor: pointer; font-size: 14px;
  font-family: inherit;
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
button:hover { border-color: var(--text-dim); transform: translate(-1px, -1px); box-shadow: var(--pop); }
button:disabled { opacity: .45; cursor: default; }
button:disabled:hover { border-color: var(--line); transform: none; box-shadow: none; }
.trace-btn:hover { transform: none; box-shadow: none; }
/* ▶：圆形主播放键 */
button.big {
  width: 44px; height: 44px; padding: 0; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; border-radius: 50%;
  background: var(--cta); color: var(--ink); border: none; font-weight: 700;
  box-shadow: var(--pop);
}
button.big:hover { transform: translate(-1px, -1px); box-shadow: var(--pop-lg); }
#btn-prev-key, #btn-next-key {
  width: 34px; height: 34px; padding: 0; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 13px;
}
select {
  background: var(--bg-card); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--s-2); padding: 3px 8px; font-size: 12.5px; font-family: inherit;
}
#progress { flex: 1; accent-color: var(--cta); }
#progress-text { font-family: var(--mono); font-size: 12px; color: var(--text-dim); min-width: 54px; text-align: right; }

/* ============ 选手工坊 ============ */
body.studio { overflow-y: auto; height: auto; }
#studio-wrap { max-width: 1100px; margin: 0 auto; padding: var(--s-5) var(--s-5) 96px; }
/* 返回大厅：图标按钮（D44） */
.back-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  color: var(--text); font-size: 16px; text-decoration: none;
  border: 1px solid var(--line);
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.back-link:hover { border-color: var(--text-dim); transform: translate(-1px, -1px); box-shadow: var(--pop); }

/* 两栏：左轨选手卡实体（跟随滚动），右侧操作流 */
#studio-cols { display: grid; grid-template-columns: 300px 1fr; gap: var(--s-6); align-items: start; margin-top: var(--s-5); }
#studio-main { min-width: 0; }
#studio-card { position: sticky; top: var(--s-5); }

/* 选手卡实体：应援色卡框 + 半身照 + 名牌（本页唯一倾斜元素） */
.pcard {
  border: 3px solid var(--tile, var(--cta));
  border-radius: var(--r-card); overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--pop-lg);
}
.pcard img { width: 100%; aspect-ratio: 420 / 400; object-fit: cover; object-position: 50% 10%; display: block; background: var(--bg); }
/* 卡底 = 台词纸：照片 + 纸面墨字，像一张实体卡 */
.pc-body { padding: var(--s-4) var(--s-4) var(--s-4); background: var(--paper); }
.pc-name {
  display: inline-block;
  font-family: var(--display); font-size: 17px; font-weight: 400; letter-spacing: 1px;
  color: var(--ink); background: var(--tile, var(--cta));
  padding: 2px 14px; border-radius: var(--r-pill);
  transform: rotate(-1.2deg); transform-origin: left center;
  box-shadow: var(--pop);
  margin: -28px 0 var(--s-2); position: relative;
}
.pc-cast { font-size: 12px; color: var(--paper-dim); margin-bottom: var(--s-3); }
.pc-strat { display: flex; align-items: baseline; gap: var(--s-2); margin-bottom: var(--s-2); }
.pc-strat .st-num { font-family: var(--mono); font-size: 10.5px; color: var(--paper-dim); }
.pc-strat b { font-family: var(--display); font-size: 15px; font-weight: 400; color: var(--ink); }
.pc-meta { font-family: var(--mono); font-size: 11px; color: var(--paper-dim); }

/* 左轨选手库：大卡下方，最多 3 张 */
#rail-lib { margin-top: var(--s-4); }
#rail-lib .agent-row { padding: var(--s-2) var(--s-3); font-size: 12.5px; gap: var(--s-2); }
#rail-lib .agent-row .model-tag { display: none; }
/* 新建选手：＋ 圆形图标钮（D44），居中在卡槽下 */
#btn-new-agent {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  font-size: 17px; margin: var(--s-2) auto 0;
}

.studio-sec { margin-top: var(--s-7); }
#studio-main > .studio-sec:first-child { margin-top: 0; }
.studio-sec h2 { font-family: var(--display); font-size: 17px; font-weight: 400; margin-bottom: var(--s-4); color: var(--accent); letter-spacing: 2px; }
.studio-sec .hint { font-size: 12.5px; color: var(--text-dim); margin-bottom: var(--s-3); }
.studio-sec .sub-h { font-family: var(--display); font-size: 14px; font-weight: 400; margin: var(--s-5) 0 var(--s-3); color: var(--text); letter-spacing: 1px; }
details.studio-sec summary { cursor: pointer; font-family: var(--display); font-size: 15px; font-weight: 400; color: var(--accent); letter-spacing: 2px; margin-bottom: var(--s-4); }
details.adv > summary { cursor: pointer; color: var(--text-dim); font-size: 13.5px; padding: var(--s-2) 0; }
details.adv[open] > summary { color: var(--accent); }

.studio-toolbar { display: flex; align-items: center; gap: var(--s-5); flex-wrap: wrap; font-size: 13px; row-gap: var(--s-3); }
.studio-toolbar label { display: flex; align-items: center; gap: var(--s-2); }
.studio-toolbar input[type="text"] {
  background: var(--bg-card); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--s-2); padding: 5px 10px; font-size: 13px; width: 150px; font-family: inherit;
}
.studio-toolbar input[type="number"] {
  background: var(--bg-card); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--s-2); padding: 5px 10px; font-size: 13px; width: 140px; font-family: var(--mono);
}

.locked-block, .edit-block { margin-bottom: var(--s-4); }
.block-label {
  font-size: 12px; color: var(--text-dim); letter-spacing: 1px; margin-bottom: var(--s-2);
  display: flex; align-items: center; gap: var(--s-3);
}
.locked-block pre {
  white-space: pre-wrap; word-break: break-word;
  background: var(--bg-panel); border: 1px dashed var(--line); border-radius: var(--r-card);
  padding: var(--s-3) var(--s-4); font-size: 12.5px; line-height: 1.75; color: var(--text-dim);
  font-family: var(--mono);
}
.edit-block textarea {
  width: 100%; resize: vertical;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--accent); border-radius: var(--r-card);
  padding: var(--s-3) var(--s-4); font-size: 13.5px; line-height: 1.75;
  font-family: inherit;
}
.edit-block textarea:focus { outline: none; box-shadow: 0 0 0 1px var(--accent); }
#roleplan-count.over { color: var(--killer); }
#config-json { user-select: all; }

/* 选手库 */
.agent-row {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); margin-bottom: var(--s-2); cursor: pointer;
  background: var(--bg-card); border: 2px solid transparent; border-radius: var(--r-card);
  font-size: 13.5px;
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
.agent-row:hover { border-color: var(--line); }
.agent-row.active { border-color: var(--cta); box-shadow: var(--pop); }
.agent-row .agent-face { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: 50% 14%; }
.agent-row .model-tag { font-family: var(--mono); font-size: 11px; color: var(--text-dim); background: var(--bg-panel); padding: 1px 10px; border-radius: var(--r-pill); }
.agent-row .agent-ops { margin-left: auto; display: flex; gap: var(--s-2); }
.agent-row .agent-ops button { font-size: 12px; padding: 2px 10px; }

/* 造型九宫格：每张卡常驻应援色卡框（独立个体感，D42），选中 = 浮起 + 硬阴影 */
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: var(--s-4); margin-bottom: var(--s-4); }
.skin-tile {
  border: 2px solid var(--tile, var(--line)); border-radius: var(--r-card); overflow: hidden; cursor: pointer;
  background: var(--bg-card); transition: transform .12s, box-shadow .12s;
}
.skin-tile:hover { transform: translate(-1px, -1px); box-shadow: var(--pop); }
.skin-tile.sel { transform: translate(-2px, -2px); box-shadow: var(--pop-lg); }
.skin-tile img { width: 100%; aspect-ratio: 420 / 520; object-fit: cover; display: block; }
.skin-tile .sk-name { font-size: 11px; padding: var(--s-2) var(--s-1); text-align: center; color: var(--text-dim); line-height: 1.5; }
.skin-tile .sk-name b { font-family: var(--display); font-size: 13px; font-weight: 400; }
.skin-tile.sel .sk-name { color: var(--text); }
.skin-tile.sel .sk-name b { color: var(--tile, var(--cta)); }

/* 策略技能卡：常驻明边（独立个体感，D42），选中 = CTA 粉描边 + 浮起 */
.strat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s-4); margin-bottom: var(--s-4); }
.strat-tile {
  border: 2px solid #574c72; border-radius: var(--r-card); padding: var(--s-3) var(--s-4); cursor: pointer;
  background: var(--bg-card); transition: transform .12s, border-color .12s, box-shadow .12s;
}
.strat-tile:hover { transform: translate(-1px, -1px); box-shadow: var(--pop); }
.strat-tile.sel { border-color: var(--cta); transform: translate(-2px, -2px); box-shadow: var(--pop-lg); }
.strat-tile .st-num { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); display: block; margin-bottom: var(--s-1); }
.strat-tile b { display: block; margin-bottom: var(--s-1); font-family: var(--display); font-size: 14.5px; font-weight: 400; }
.strat-tile.sel b { color: var(--cta); }
.strat-tile .st-brief { font-size: 12px; color: var(--text-dim); line-height: 1.55; }

/* 快速开局：与 ▶ 同族的粉色药丸 */
button.cta {
  background: var(--cta); color: var(--ink); font-weight: 700;
  border: none; border-radius: var(--r-pill); padding: var(--s-3) var(--s-6); font-size: 15px;
  cursor: pointer; letter-spacing: 1px; font-family: var(--display);
  box-shadow: var(--pop);
}
button.cta:hover { transform: translate(-1px, -1px); box-shadow: var(--pop-lg); }

#seat-picks { row-gap: var(--s-3); }

/* ============ 操控面板（D43）：正在发生的事——台词纸 + 硬阴影 ============ */
#turn-panel {
  position: absolute; left: 50%; bottom: var(--s-5); transform: translateX(-50%);
  z-index: 6; width: min(560px, 92%);
  background: var(--paper); color: var(--ink);
  border-radius: var(--r-card); box-shadow: var(--pop-lg);
  padding: var(--s-4) var(--s-5);
  animation: turnIn .25s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes turnIn {
  from { transform: translateX(-50%) translateY(16px); opacity: 0; }
  to { transform: translateX(-50%); opacity: 1; }
}
.tp-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.tp-head b { font-family: var(--display); font-size: 16px; font-weight: 400; letter-spacing: 1px; }
#tp-count { font-family: var(--mono); font-size: 15px; font-weight: 700; }
#tp-count.tp-urgent { color: var(--coral); }
#tp-vote { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.tp-target {
  background: #fff; color: var(--ink); border: 1px solid var(--ink);
  font-size: 13.5px; padding: var(--s-2) var(--s-4);
}
#tp-say { display: flex; align-items: center; gap: var(--s-4); }
.tp-hint { font-size: 12.5px; color: var(--paper-dim); }

/* ============ 开局选择框（D43）：版型大卡 ============ */
#start-modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10, 8, 16, 0.72);
  display: flex; align-items: center; justify-content: center;
}
#start-modal.hidden { display: none; }
#start-panel {
  width: min(560px, 92vw);
  background: var(--bg-panel); border-radius: var(--r-card);
  box-shadow: var(--float);
  padding: var(--s-5) var(--s-6) var(--s-6);
}
#start-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-5); }
#start-head h3 { font-family: var(--display); font-size: 19px; font-weight: 400; letter-spacing: 2px; }
.rs-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); }
.rs-card {
  background: var(--bg-card); border: 2px solid var(--line); border-radius: var(--r-card);
  padding: var(--s-5) var(--s-4); text-align: center; cursor: pointer;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.rs-card:hover { border-color: var(--cta); transform: translate(-2px, -2px); box-shadow: var(--pop); }
.rs-card .rs-icon { font-size: 40px; line-height: 1; margin-bottom: var(--s-3); }
.rs-card b { display: block; font-family: var(--display); font-size: 18px; font-weight: 400; letter-spacing: 2px; margin-bottom: var(--s-2); }
.rs-card .rs-sub { font-size: 12px; color: var(--text-dim); line-height: 1.7; }
#ctl-block { margin-top: var(--s-5); }
#ctl-block .ctl-row { display: flex; gap: var(--s-5); flex-wrap: wrap; font-size: 13.5px; margin-bottom: var(--s-2); }
#ctl-block label { display: flex; align-items: center; gap: var(--s-2); cursor: pointer; }

/* ============ 入场闸（D48）：候场→就位→开演 ============ */
#enter-gate {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10, 8, 16, 0.82);
  display: flex; align-items: center; justify-content: center;
}
#enter-gate.hidden { display: none; }
#gate-panel {
  width: min(640px, 94vw);
  background: var(--bg-panel); border-radius: var(--r-card);
  box-shadow: var(--float);
  padding: var(--s-5) var(--s-6) var(--s-6);
  text-align: center;
}
#gate-title { font-family: var(--display); font-size: 19px; font-weight: 400; letter-spacing: 3px; margin-bottom: var(--s-5); }
#gate-cast { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-4); margin-bottom: var(--s-6); }
.gate-card {
  width: 72px;
  display: flex; flex-direction: column; align-items: center; gap: var(--s-1);
  opacity: .38; filter: grayscale(.7);
  transition: opacity .25s, filter .25s, transform .25s;
}
.gate-card.ready { opacity: 1; filter: none; transform: translateY(-2px); }
.gate-card img, .gate-card .gate-num {
  width: 64px; height: 78px; object-fit: cover;
  border-radius: var(--r-card); border: 2px solid var(--plate, var(--line));
  background: var(--bg-card);
}
.gate-card .gate-num { display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 20px; color: var(--text-dim); }
.gate-card b { font-size: 11.5px; font-weight: 700; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gate-card .gate-state { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); }
.gate-card.ready .gate-state { color: var(--mint); }
#gate-go { min-width: 200px; }

/* 语音发言三段式（D55）：电平表 + 识别文字回显 + 发布按钮 */
#tp-meter {
  display: inline-block; width: 90px; height: 8px; vertical-align: middle;
  background: var(--bg-card); border-radius: var(--r-pill); overflow: hidden;
}
#tp-meter.hidden { display: none; }
#tp-meter i { display: block; height: 100%; width: 0; background: var(--mint); transition: width .08s linear; }
#tp-preview {
  margin-top: var(--s-3);
  background: var(--paper); color: var(--ink);
  border-radius: var(--r-card); box-shadow: var(--pop);
  padding: var(--s-3) var(--s-4);
  font-size: 14.5px; line-height: 1.7; text-align: left;
}
#tp-preview.hidden { display: none; }
#tp-confirm { margin-top: var(--s-3); background: var(--mint); color: var(--ink); font-weight: 700; }
#tp-confirm.hidden { display: none; }

/* ============ 开票板（D60）：开奖时刻——逐张翻票 + 得票条实时长 ============ */
#vote-board {
  position: absolute; inset: 0; z-index: 7;
  display: flex; align-items: center; justify-content: center;
  background: rgba(14, 11, 20, .8); backdrop-filter: blur(3px);
  cursor: pointer;
}
#vote-board.hidden { display: none; }
#vb-panel {
  width: min(660px, 94%); max-height: 86%; overflow-y: auto;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--pop-lg);
  padding: var(--s-5) var(--s-6);
  animation: vbIn .3s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes vbIn { from { transform: scale(.94) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
#vb-title { font-family: var(--display); font-weight: 400; letter-spacing: 2px; font-size: 19px; color: var(--accent); margin-bottom: var(--s-4); }
#vb-main { display: grid; grid-template-columns: 1fr auto; gap: var(--s-6); align-items: start; }
#vb-rows { display: flex; flex-direction: column; gap: var(--s-2); }
.vb-row { display: flex; align-items: center; gap: var(--s-2); opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }
.vb-row.show { opacity: 1; transform: none; }
.vb-row .arrow { color: var(--text-dim); }
.vb-name { font-size: 13px; color: var(--text-dim); max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb-abstain { font-size: 13px; color: var(--paper-dim); border: 1px dashed var(--line); border-radius: 999px; padding: 2px 10px; }
#vb-tally { display: flex; flex-direction: column; gap: var(--s-3); min-width: 168px; padding-top: var(--s-1); }
.vb-t { display: flex; align-items: center; gap: var(--s-2); }
.vb-bar { height: 10px; border-radius: 5px; background: var(--mint); transition: width .35s; }
.vb-t.top .vb-bar { background: var(--coral); }
.vb-t.top .vb-count { color: var(--coral); }
.vb-count { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--text); }
#vb-hint { margin-top: var(--s-4); text-align: center; color: var(--text-dim); font-size: 12.5px; }
@media (max-width: 760px) {
  #vb-main { grid-template-columns: 1fr; }
  #vb-panel { padding: var(--s-4); }
}

/* ============ 赛后评价互动（D62）：送花/砸蛋 + 演员回应 ============ */
.react-sec { margin-top: var(--s-4); border-top: 1px dashed var(--line); padding-top: var(--s-3); }
.react-hint { font-size: 12.5px; color: var(--text-dim); margin-bottom: var(--s-3); }
.react-row { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-1) 0; }
.react-name { flex: 1; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.react-btns { display: flex; gap: var(--s-2); }
.react-btn {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 999px;
  font-size: 15px; padding: 2px 12px; cursor: pointer; transition: transform .12s;
}
.react-btn:hover { transform: translateY(-2px); border-color: var(--cta); }
.react-btn:disabled { opacity: .35; cursor: default; transform: none; }
#react-menu {
  position: absolute; inset: 0; z-index: 8;
  display: flex; align-items: center; justify-content: center;
  background: rgba(14, 11, 20, .7); backdrop-filter: blur(2px);
}
#react-menu.hidden { display: none; }
#rm-panel {
  width: min(420px, 92%); background: var(--paper); color: var(--ink);
  border-radius: var(--r-card); box-shadow: var(--pop-lg); padding: var(--s-4) var(--s-5);
  animation: vbIn .25s cubic-bezier(.34, 1.56, .64, 1);
}
#rm-title { font-family: var(--display); font-size: 15px; letter-spacing: 1px; margin-bottom: var(--s-3); }
#rm-lines { display: flex; flex-direction: column; gap: var(--s-2); }
.rm-line {
  text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--ink);
  font-size: 13.5px; padding: var(--s-2) var(--s-3); cursor: pointer;
}
.rm-line:hover { background: var(--cta); }
/* 语音留言（D77）：录音入口虚线区隔；状态行与识别回显 */
.rm-voice { border-style: dashed; }
.rm-state { font-size: 12.5px; color: var(--ink); opacity: .65; }
.rm-preview { border: 1px dashed var(--ink); padding: var(--s-2) var(--s-3); font-size: 14px; }
#rm-cancel { margin-top: var(--s-3); background: none; border: none; color: var(--paper-dim); font-size: 12.5px; cursor: pointer; }
/* 特效层：爱心/花瓣/鸡蛋粒子 + 挨蛋屏抖 */
#fx-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.fx-p {
  position: absolute; bottom: 12%; font-size: 22px; opacity: 0;
  animation: fxFloat 1.7s ease-out forwards;
}
@keyframes fxFloat {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-58vh) scale(1.25) rotate(14deg); opacity: 0; }
}
.fx-shake { animation: fxShake .5s; }
@keyframes fxShake {
  0%, 100% { transform: none; }
  20% { transform: translate(-7px, 2px); } 40% { transform: translate(6px, -3px); }
  60% { transform: translate(-5px, 2px); } 80% { transform: translate(4px, -1px); }
}

/* ============ 积分榜（D63）：本局得分徽章 + 双轨排行榜 ============ */
.pts { font-family: var(--mono); font-size: 12px; color: var(--mint); margin-left: 4px; }
#btn-board { font-size: 12.5px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; }
#btn-board.hidden { display: none; }
/* 锦囊胶囊标签（D94/D105 共享：手册页 + 装备卡）*/
.chip { font-family: var(--display); font-size: 12.5px; line-height: 1; padding: 5px 10px 6px; border-radius: var(--r-pill); white-space: nowrap; }
.chip.rs    { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); border: 1px solid var(--line); }
.chip.role  { color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.chip.role.police   { background: var(--police); }
.chip.role.killer   { background: var(--killer); }
.chip.role.civilian { background: var(--mint); }
.chip.kind  { background: var(--accent); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.chip.cond  { color: var(--text-dim); border: 1px solid var(--line); background: var(--bg-panel); }
.chip.always { color: var(--text-dim); border: 1px dashed var(--line); }

/* 装备卡里的锦囊折叠区（D105） */
.pc2-notes { margin-top: var(--s-3); }
.pc2-notes summary { cursor: pointer; list-style: none; font-family: var(--display); font-size: 13.5px; color: var(--accent); letter-spacing: .5px; }
.pc2-notes summary::before { content: "▸ "; }
.pc2-notes[open] summary::before { content: "▾ "; }
.pc2-notes summary:hover { filter: brightness(1.2); }
.pc2-note { margin-top: var(--s-3); padding: var(--s-3); background: var(--bg-card); border: 1px solid var(--line); border-radius: 8px; }
.pc2-note-t { font-family: var(--display); font-size: 14px; margin-bottom: var(--s-2); }
.pc2-note-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-2); }
.pc2-note-x { font-size: 12.5px; line-height: 1.7; color: var(--text-dim); }

/* 选手装备卡（D104）：点选手席头像弹出 */
#card-modal {
  position: fixed; inset: 0; z-index: 42;
  display: flex; align-items: center; justify-content: center;
  background: rgba(14, 11, 20, .8); backdrop-filter: blur(3px);
}
#card-modal.hidden { display: none; }
#card-panel {
  width: min(460px, 94%); max-height: 82vh; overflow-y: auto;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--pop-lg);
  padding: var(--s-4) var(--s-5) var(--s-5);
}
#card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-3); }
#card-head h3 { font-family: var(--display); font-weight: 400; letter-spacing: 2px; color: var(--accent); font-size: 16px; }
#card-close { background: none; border: none; color: var(--text-dim); font-size: 16px; cursor: pointer; }
#card-close:hover { color: var(--text); }
.pc2-head { display: flex; gap: var(--s-4); align-items: center; margin-bottom: var(--s-4); }
.pc2-face { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; border: 2px solid var(--plate, var(--line)); box-shadow: var(--pop); }
.pc2-face-fb { width: 56px; height: 56px; font-size: 22px; }
.pc2-name { font-family: var(--display); font-size: 20px; letter-spacing: 1px; }
.pc2-role { font-size: 13px; color: var(--text-dim); margin-left: var(--s-1); }
.pc2-title { color: var(--plate, var(--text-dim)); font-size: 12.5px; margin-top: 2px; }
.pc2-meta { font-family: var(--mono); font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.pc2-sec { margin-top: var(--s-3); }
.pc2-label { font-family: var(--display); font-size: 13.5px; color: var(--accent); margin-bottom: var(--s-2); letter-spacing: .5px; }
.pc2-hint { font-family: var(--mono); font-size: 10.5px; color: var(--paper-dim); letter-spacing: 0; margin-left: var(--s-1); }
.pc2-paper { background: var(--paper); color: var(--ink); border-radius: 8px; padding: var(--s-3) var(--s-4); font-size: 13px; line-height: 1.7; box-shadow: var(--pop); }
.pc2-plan { color: var(--text-dim); font-size: 12.5px; line-height: 1.75; border-left: 2px solid var(--line); padding-left: var(--s-3); }

#board-modal {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: rgba(14, 11, 20, .8); backdrop-filter: blur(3px);
}
#board-modal.hidden { display: none; }
#bd-panel {
  width: min(720px, 94%); max-height: 86vh; overflow-y: auto;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--pop-lg);
  padding: var(--s-5) var(--s-6);
  animation: vbIn .3s cubic-bezier(.34, 1.56, .64, 1);
}
#bd-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-4); }
#bd-head h3 { font-family: var(--display); font-weight: 400; letter-spacing: 2px; color: var(--accent); }
#bd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6); }
.bd-col h4 { font-size: 14px; margin-bottom: var(--s-1); }
.bd-note { font-size: 11.5px; color: var(--text-dim); margin-bottom: var(--s-3); }
.bd-row { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) 0; border-bottom: 1px dashed var(--line); }
.bd-rank { font-family: var(--mono); font-size: 13px; width: 1.6em; color: var(--text-dim); }
.bd-row:first-of-type .bd-rank { color: var(--accent); }
.bd-face { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.bd-name { flex: 1; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-sub { font-size: 11px; color: var(--text-dim); }
.bd-pts { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--mint); }
.bd-empty { color: var(--text-dim); font-size: 12.5px; padding: var(--s-3) 0; }
@media (max-width: 760px) { #bd-cols { grid-template-columns: 1fr; } }

#credits { font-size: 11px; color: var(--paper-dim); padding: var(--s-3) 0 var(--s-2); text-align: center; }

/* ============ 动效保底 ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .match-item:hover, button.big:hover, button.cta:hover { transform: none; }
}

/* ============ 手机适配 ============ */
@media (max-width: 760px) {
  #topbar { padding: 0 var(--s-3); gap: var(--s-2); }
  #topbar h1 { font-size: 15px; }
  #now-title { display: none; }
  #guide-panel { width: 100vw; }
  #roster { gap: var(--s-2); overflow-x: auto; justify-content: flex-start; }
  #feed { padding: var(--s-4) var(--s-3); }
  #controls { padding: var(--s-2) var(--s-3); }
  #studio-wrap { padding: var(--s-5) var(--s-4) var(--s-7); }
  #studio-cols { grid-template-columns: 1fr; }
  #studio-card { position: static; max-width: 300px; margin: 0 auto; }
  .studio-sec { margin-top: var(--s-6); }
}

/* ---------- 幕间画面（D133）：跟播模式局终展示 ---------- */
#intermission {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #1c1724 0%, var(--bg) 72%);
}
#intermission.hidden { display: none; }
#im-panel { width: min(520px, 92vw); text-align: center; }
#im-brand { font-family: var(--display); font-size: 15px; letter-spacing: 4px; color: var(--text-dim); }
#im-title { font-family: var(--display); font-size: 30px; font-weight: 400; letter-spacing: 8px; margin: 10px 0 20px; }
#im-board { text-align: left; max-height: 54vh; overflow: hidden; }
#im-next {
  margin-top: 20px; font-family: var(--mono); font-size: 13px; letter-spacing: 1px;
  color: var(--cta); animation: im-pulse 2.4s ease-in-out infinite;
}
@keyframes im-pulse { 50% { opacity: .4; } }
/* 跟播模式（?follow=1）：OBS 画面里不出现任何交互件 */
body.follow #controls, body.follow #guide, body.follow #advance-hint { display: none !important; }
body.follow { cursor: none; }

/* ---------- 宣传条（D134）：仅跟播模式显示 ---------- */
#promo-bar { display: none; }
body.follow #promo-bar {
  display: block; position: fixed; right: 14px; bottom: 10px; z-index: 80;
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
  color: var(--text-dim); opacity: .75; pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
}

/* ---------- 账户（D136）：登录入口 + 邮箱登录弹窗 ---------- */
#btn-auth {
  flex-shrink: 0; font: inherit; font-size: 13px; cursor: pointer;
  color: var(--accent); background: none;
  padding: var(--s-1) var(--s-4); border: 1px solid var(--line); border-radius: var(--r-pill);
  transition: border-color .12s;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#btn-auth:hover { border-color: var(--accent); }
body.follow #btn-auth { display: none; }
#auth-modal {
  position: fixed; inset: 0; z-index: 44;
  display: flex; align-items: center; justify-content: center;
  background: rgba(14, 11, 20, .8); backdrop-filter: blur(3px);
}
#auth-modal.hidden { display: none; }
#au-panel {
  width: min(420px, 94%);
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--pop-lg);
  padding: var(--s-4) var(--s-5) var(--s-5);
}
#au-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-3); }
#au-head h3 { font-family: var(--display); font-size: 17px; font-weight: 400; letter-spacing: 2px; }
#au-close { background: none; border: none; color: var(--text-dim); font-size: 15px; cursor: pointer; }
.au-hint { font-size: 12.5px; color: var(--text-dim); line-height: 1.7; margin-bottom: var(--s-3); }
#au-row { display: flex; gap: var(--s-2); }
#au-email {
  flex: 1; min-width: 0; font: inherit; font-size: 13px;
  color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--s-2); padding: var(--s-2) var(--s-3);
}
#au-email:focus { outline: none; border-color: var(--accent); }
#au-send { flex-shrink: 0; }
#au-msg { min-height: 18px; font-size: 12px; color: var(--accent); margin-top: var(--s-2); }
#au-me p { font-size: 13.5px; margin-bottom: var(--s-3); }
#au-logout {
  font: inherit; font-size: 12.5px; cursor: pointer;
  color: var(--text-dim); background: none;
  padding: var(--s-1) var(--s-3); border: 1px solid var(--line); border-radius: var(--r-pill);
}
#au-logout:hover { border-color: var(--text-dim); }
#login-toast {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 90;
  font-size: 13px; color: var(--bg); background: var(--accent);
  padding: var(--s-2) var(--s-5); border-radius: var(--r-pill); box-shadow: var(--pop);
  animation: toast-in .25s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(-8px); } }
