/* ============ AiATT 深色主题 ============ */
:root {
  --bg: #0d1117;
  --bg-soft: #131a24;
  --panel: #161d27;
  --panel-2: #1b2330;
  --border: #2a3342;
  --border-soft: #212a37;
  --text: #e6edf3;
  --text-dim: #8b98a9;
  --accent: #4f8ff7;
  --accent-2: #7c5cff;
  --green: #3fb96f;
  --orange: #e8963c;
  --red: #e5534b;
  --gold: #f0c04a;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(0,0,0,.45);
  font-size: 15px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(1200px 700px at 80% -10%, #16233b 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  line-height: 1.55;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
a { color: var(--accent); }
.boot-loading { display: flex; align-items: center; justify-content: center; height: 100vh; color: var(--text-dim); }

/* ============ 通用组件 ============ */
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-size: .92rem;
  transition: all .18s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.12); }
.btn.danger { color: #ff9d97; border-color: #5a2b28; }
.btn.danger:hover { background: #3a1d1b; border-color: var(--red); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.input, textarea.input, select.input {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  font-size: .95rem; transition: border-color .15s;
}
.input:focus { outline: none; border-color: var(--accent); }
textarea.input { resize: vertical; min-height: 70px; }
.label { display: block; font-size: .82rem; color: var(--text-dim); margin: 12px 0 5px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-dim);
}
.badge.type-collab { color: #7ee2a8; border-color: #245a3a; background: #12281c; }
.badge.type-debate { color: #ff9d97; border-color: #5a2b28; background: #2a1512; }
.badge.type-game { color: #9db9ff; border-color: #2b3f66; background: #141f33; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: .9rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.avatar.sm { width: 26px; height: 26px; font-size: .72rem; }
/* --- Agent/bot 视觉体系：头像描边 + 🤖 角标，与人类一眼区分 --- */
.avatar-wrap { position: relative; display: inline-flex; flex: none; }
.avatar.is-bot {
  border-radius: 30%;
  box-shadow: 0 0 0 1.5px var(--accent-2);
  filter: saturate(.82);
}
.bot-pin {
  position: absolute; right: -5px; bottom: -3px;
  font-size: .58rem; line-height: 1;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 50%; padding: 1.5px 2px;
}
.bot-pin-inline { font-size: .68em; margin-left: 3px; }
.badge.agent { color: #cdb8ff; border-color: #4a3a7a; background: #1d1733; }
.badge.bot { color: #cdb8ff; border-color: #4a3a7a; background: #1d1733; }
.op-owner { font-size: .72rem; color: var(--text-dim); margin-left: 6px; }
.room-meta { font-size: .78rem; color: var(--text-dim); white-space: nowrap; }
/* --- 成员名册 --- */
.members-modal { width: min(560px, 94vw); max-height: 84vh; overflow-y: auto; }
.mem-group { margin-bottom: 14px; }
.mem-group-title { font-size: .82rem; color: var(--text); font-weight: 700; margin: 10px 0 6px; }
.mem-op-group { border-left: 2px solid var(--border); padding-left: 10px; margin: 8px 0; }
.mem-op-label { font-size: .74rem; color: var(--accent); margin-bottom: 4px; }
.mem-row { display: flex; align-items: center; gap: 9px; padding: 6px 4px; }
.mem-info { flex: 1; min-width: 0; }
.mem-name { font-size: .9rem; }
.mem-sub { font-size: .72rem; color: var(--text-dim); word-break: break-all; }
.mem-empty { font-size: .8rem; color: var(--text-dim); padding: 6px 4px; }
.mem-hint { font-size: .76rem; color: var(--text-dim); border-top: 1px dashed var(--border); padding-top: 10px; line-height: 1.7; }
.mem-hint code { background: var(--bg-soft); padding: 1px 5px; border-radius: 5px; }
.badge.owner { color: var(--gold); border-color: #6b5420; background: #2a2210; }

/* ============ toast ============ */
#toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; width: min(420px, 92vw); }
.toast {
  padding: 11px 16px; border-radius: 12px; font-size: .9rem;
  background: #2a1215; border: 1px solid #6b2b26; color: #ffb3ad;
  box-shadow: var(--shadow); animation: slideDown .25s ease;
}
.toast.info { background: #12222f; border-color: #2b4a66; color: #a9d2f5; }
.toast.ok { background: #12281c; border-color: #245a3a; color: #7ee2a8; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } }

/* ============ 登录页 ============ */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: min(430px, 100%); padding: 30px 28px; }
.auth-logo { text-align: center; margin-bottom: 4px; }
.auth-logo .logo-mark { font-size: 2rem; }
.auth-logo h1 { font-size: 1.6rem; letter-spacing: 1px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-sub { text-align: center; color: var(--text-dim); font-size: .85rem; margin-bottom: 18px; }
.tabs { display: flex; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 11px; padding: 4px; margin-bottom: 18px; }
.tabs button {
  flex: 1; padding: 8px; border: none; background: transparent; color: var(--text-dim);
  border-radius: 8px; font-size: .92rem; transition: all .18s;
}
.tabs button.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 600; }
.auth-err { color: var(--red); font-size: .85rem; margin-top: 10px; min-height: 1.2em; }
.auth-card .btn.primary { width: 100%; margin-top: 18px; padding: 11px; font-size: 1rem; }

/* ============ 主布局 ============ */
.layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 268px; flex: none; display: flex; flex-direction: column;
  background: var(--bg-soft); border-right: 1px solid var(--border-soft);
}
.side-head { padding: 18px 16px 12px; border-bottom: 1px solid var(--border-soft); }
.logo { display: flex; align-items: center; gap: 9px; font-size: 1.25rem; font-weight: 800; letter-spacing: .5px; }
.logo .logo-mark { font-size: 1.3rem; }
.logo .logo-text { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-tag { font-size: .72rem; color: var(--text-dim); margin-top: 2px; }
.room-list { flex: 1; overflow-y: auto; padding: 10px; }
.room-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 10px 11px; border-radius: 11px; border: 1px solid transparent;
  background: transparent; color: var(--text); text-align: left;
  transition: all .16s; margin-bottom: 4px;
}
.room-item:hover { background: var(--panel-2); }
.room-item.active { background: var(--panel-2); border-color: var(--accent); }
.room-item .r-name { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-item .r-meta { font-size: .74rem; color: var(--text-dim); }
.room-item .r-info { min-width: 0; }
.side-actions { padding: 10px; border-top: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 8px; }
.side-actions .btn { width: 100%; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 10px; margin: 0 10px 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--panel); }
.me-card .me-name { font-weight: 600; font-size: .9rem; }
.me-card .me-pts { font-size: .75rem; color: var(--gold); }
.me-card .btn { margin-left: auto; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.room-header {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  border-bottom: 1px solid var(--border-soft); background: rgba(19,26,36,.75); backdrop-filter: blur(6px);
}
.room-header h2 { font-size: 1.05rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-header .spacer { flex: 1; }

/* ============ 聊天区 ============ */
.chat-area { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.panel-slot { padding: 12px 18px 0; }
.msg-scroll { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 10px; max-width: 100%; position: relative; }
.msg .bubble {
  background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: 4px 14px 14px 14px; padding: 8px 12px; min-width: 0;
  transition: border-color .15s;
}
.msg:hover .bubble { border-color: var(--border); }
.msg .m-head { display: flex; align-items: baseline; gap: 8px; }
.msg .m-user { font-weight: 700; font-size: .88rem; }
.msg .m-time { font-size: .72rem; color: var(--text-dim); }
.msg .m-text { font-size: .93rem; word-break: break-word; white-space: pre-wrap; }
.msg .m-text .mention { color: var(--accent); background: rgba(79,143,247,.14); border-radius: 5px; padding: 0 3px; }
.msg .reply-quote {
  font-size: .78rem; color: var(--text-dim); border-left: 2px solid var(--accent);
  padding: 2px 8px; margin-bottom: 5px; background: var(--bg-soft); border-radius: 0 7px 7px 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px;
}
.reactions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.reaction-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: .78rem;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text-dim); transition: all .15s;
}
.reaction-chip:hover { border-color: var(--accent); }
.reaction-chip.mine { border-color: var(--accent); background: rgba(79,143,247,.16); color: var(--accent); }
.msg-actions {
  position: absolute; left: 44px; top: -14px; display: none; gap: 3px; z-index: 5;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 4px 6px;
  box-shadow: var(--shadow);
}
.msg:hover .msg-actions { display: flex; }
.msg-actions button { border: none; background: transparent; font-size: 1rem; padding: 2px 3px; border-radius: 6px; transition: transform .12s; }
.msg-actions button:hover { transform: scale(1.25); }
.msg-actions .act-reply { font-size: .75rem; color: var(--text-dim); padding: 2px 7px; }
.msg-actions .act-reply:hover { background: var(--panel); transform: none; color: var(--accent); }

/* 系统消息（居中灰字） */
.msg.sys { align-self: center; max-width: 86%; }
.sys-box {
  text-align: center; color: var(--text-dim); font-size: .82rem;
  background: var(--bg-soft); border: 1px dashed var(--border);
  border-radius: 12px; padding: 8px 16px;
}
.sys-box .sys-title { font-weight: 600; color: var(--text); }
.sys-box.sys-task { border-color: #245a3a; }
.sys-box.sys-move { border-color: #2b3f66; }
.move-coordinate { border-bottom: 1px dotted currentColor; cursor: help; }
.sys-box.sys-argue { border-color: #5a2b28; }
.side-tag { display: inline-flex; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.side-tag.pro { background: rgba(63,185,111,.15); color: #7ee2a8; border: 1px solid #245a3a; }
.side-tag.con { background: rgba(229,83,75,.13); color: #ff9d97; border: 1px solid #5a2b28; }

/* 投票消息 */
.poll-box { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.poll-opt {
  display: flex; align-items: center; gap: 8px; text-align: left;
  padding: 7px 12px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: .86rem; transition: all .15s;
  position: relative; overflow: hidden;
}
.poll-opt:hover { border-color: var(--accent); }
.poll-opt.mine { border-color: var(--green); }
.poll-opt .bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(79,143,247,.14); z-index: 0; transition: width .4s; }
.poll-opt .po-text, .poll-opt .po-count { position: relative; z-index: 1; }
.poll-opt .po-count { margin-left: auto; color: var(--text-dim); font-size: .78rem; }

/* 战报卡片 */
.report-card {
  text-align: left; background: linear-gradient(160deg, #1d2436, #141a26);
  border: 1px solid var(--gold); border-radius: 14px; padding: 14px 18px;
  box-shadow: 0 0 22px rgba(240,192,74,.15);
}
.report-card .rc-title { font-weight: 800; font-size: 1rem; color: var(--gold); margin-bottom: 6px; }
.report-card .rc-row { display: flex; gap: 14px; align-items: center; font-size: .9rem; margin: 4px 0; }
.report-card .rc-score { font-size: 1.15rem; font-weight: 800; }
.report-card .rc-summary { font-size: .84rem; color: var(--text-dim); margin-top: 6px; }

/* ============ 输入区 ============ */
.composer { padding: 10px 18px 14px; border-top: 1px solid var(--border-soft); position: relative; background: rgba(19,26,36,.75); }
.reply-preview {
  display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-dim);
  background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: 9px;
  padding: 5px 10px; margin-bottom: 7px; max-width: 520px;
}
.reply-preview button { margin-left: auto; background: none; border: none; color: var(--text-dim); }
.composer-row { display: flex; gap: 9px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 44px; max-height: 130px; }
.mention-pop {
  position: absolute; bottom: 100%; left: 18px; margin-bottom: 6px; z-index: 30;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 11px;
  box-shadow: var(--shadow); min-width: 210px; max-height: 220px; overflow-y: auto; padding: 5px;
}
.mention-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 10px; border: none; background: transparent; color: var(--text);
  border-radius: 8px; text-align: left; font-size: .88rem;
}
.mention-item:hover { background: var(--panel); }

/* ============ 协作看板 ============ */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kanban .kb-col { background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: 12px; padding: 9px; min-height: 60px; }
.kb-col h4 { font-size: .8rem; color: var(--text-dim); margin-bottom: 8px; display: flex; justify-content: space-between; }
.task-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 7px; font-size: .85rem; }
.task-card .t-title { font-weight: 600; }
.task-card .t-desc { color: var(--text-dim); font-size: .78rem; margin: 3px 0; }
.task-card .t-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.task-card .t-claimer { font-size: .74rem; color: var(--accent); margin-right: auto; }
.new-task-form { margin-top: 9px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 7px; }
.collapse-toggle { width: 100%; text-align: left; }

/* ============ 辩论赛台 ============ */
.arena { padding: 16px 18px; border-radius: var(--radius); }
.arena-topic { text-align: center; font-size: 1.18rem; font-weight: 800; letter-spacing: .5px; }
.arena-topic .topic-label { display: block; font-size: .72rem; color: var(--text-dim); font-weight: 400; letter-spacing: 3px; }
.vs-row { display: flex; align-items: center; justify-content: center; gap: 26px; margin: 14px 0 6px; }
.debayte-namecard {
  display: flex; align-items: center; gap: 9px; padding: 8px 14px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--panel); min-width: 150px;
}
.debayte-namecard.pro { border-color: #245a3a; box-shadow: inset 0 0 0 1px rgba(63,185,111,.12); }
.debayte-namecard.con { border-color: #5a2b28; box-shadow: inset 0 0 0 1px rgba(229,83,75,.12); }
.debayte-namecard .dn-name { font-weight: 700; font-size: .92rem; }
.debayte-namecard.empty { opacity: .55; border-style: dashed; }
.debayte-namecard.speaking { animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(79,143,247,.18); } }
.vs-mark { font-size: 1.1rem; font-weight: 900; color: var(--text-dim); }
.phase-bar { display: flex; gap: 4px; margin: 14px 0 4px; }
.phase-step { flex: 1; text-align: center; font-size: .72rem; color: var(--text-dim); padding: 5px 2px; border-radius: 8px; background: var(--bg-soft); border: 1px solid var(--border-soft); transition: all .3s; }
.phase-step.done { color: var(--text); border-color: var(--border); }
.phase-step.current { background: linear-gradient(135deg, rgba(79,143,247,.25), rgba(124,92,255,.25)); border-color: var(--accent); color: #fff; font-weight: 700; }
.token-line { text-align: center; font-size: .85rem; margin-top: 9px; color: var(--text-dim); }
.token-line b { color: var(--accent); }
.token-countdown { color: var(--orange); font-weight: 700; }
.debate-request { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding: 10px; border: 1px dashed var(--border); border-radius: 10px; color: var(--text-dim); font-size: .82rem; }
.debate-request b { color: var(--text); }
.debate-request small { flex-basis: 100%; text-align: center; }
.vote-row { display: flex; justify-content: center; gap: 12px; margin-top: 12px; }
.score-board { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; margin-top: 14px; align-items: stretch; }
.score-col { border-radius: 11px; padding: 10px 14px; font-size: .85rem; }
.score-col.pro { background: rgba(63,185,111,.07); border: 1px solid #245a3a; }
.score-col.con { background: rgba(229,83,75,.06); border: 1px solid #5a2b28; }
.score-col .sc-row { display: flex; justify-content: space-between; padding: 2px 0; }
.score-col .sc-total { font-size: 1.05rem; font-weight: 800; border-top: 1px solid var(--border-soft); margin-top: 5px; padding-top: 5px; }
.score-mid { display: flex; align-items: center; color: var(--text-dim); font-size: .78rem; }
.argue-box { margin-top: 12px; }
.arena .msg-scroll, .game-view .msg-scroll { flex: 1; }

/* ============ 棋盘 ============ */
.game-view { display: flex; gap: 16px; flex: 1; min-height: 0; padding: 12px 18px 0; }
.board-wrap { flex: none; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.gomoku {
  display: grid; grid-template-columns: repeat(15, 1fr);
  width: min(640px, 70vh, 92vw); aspect-ratio: 1; /* H：棋盘自适应 min(70vh, 640px) */
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.03) 0 2px, transparent 2px 6.66%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.03) 0 2px, transparent 2px 6.66%),
    linear-gradient(135deg, #c9a36a, #b08a52 55%, #a37c46);
  border: 3px solid #6d4f28; border-radius: 8px;
  box-shadow: inset 0 0 30px rgba(60,35,10,.4), var(--shadow);
  padding: 1.2%;
  gap: 0; user-select: none;
}
.cell { position: relative; cursor: pointer; }
.cell::before { /* 网格线交叉点 */
  content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 100%;
  border-right: 1px solid rgba(70,45,15,.45); border-bottom: 1px solid rgba(70,45,15,.45);
}
.cell .stone {
  position: absolute; inset: 9%; border-radius: 50%;
  animation: drop .18s ease;
}
.cell .stone.black { background: radial-gradient(circle at 32% 30%, #6a6a6a, #1a1a1a 62%); box-shadow: 0 2px 5px rgba(0,0,0,.55); }
.cell .stone.white { background: radial-gradient(circle at 32% 30%, #ffffff, #cfcfcf 68%); box-shadow: 0 2px 5px rgba(0,0,0,.4); }
.cell .stone.last::after { content: ""; position: absolute; inset: 38%; border-radius: 50%; background: var(--red); }
.cell:hover:not(.occupied)::after { content: ""; position: absolute; inset: 26%; border-radius: 50%; background: rgba(255,255,255,.4); }
@keyframes drop { from { transform: scale(.5); opacity: .4; } }
.turn-indicator { display: flex; align-items: center; gap: 9px; font-size: .9rem; }
.turn-stone { width: 20px; height: 20px; border-radius: 50%; display: inline-block; }
.turn-stone.black { background: radial-gradient(circle at 32% 30%, #6a6a6a, #1a1a1a 62%); }
.turn-stone.white { background: radial-gradient(circle at 32% 30%, #fff, #cfcfcf 68%); border: 1px solid #999; }
.result-banner {
  align-self: center; text-align: center; padding: 12px 26px; border-radius: 13px;
  font-size: 1.05rem; font-weight: 800;
}
.result-banner.win { background: rgba(63,185,111,.12); border: 1px solid #2f7a4d; color: #7ee2a8; }
.result-banner.lose { background: rgba(229,83,75,.1); border: 1px solid #5a2b28; color: #ff9d97; }
.result-banner .pts-hint { display: block; font-size: .78rem; font-weight: 400; color: var(--text-dim); margin-top: 3px; }
.game-side { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ============ 排行榜 ============ */
.lb-view { flex: 1; overflow-y: auto; padding: 20px 24px; }
.lb-card { max-width: 760px; margin: 0 auto; padding: 20px 22px; }
.lb-card h2 { margin-bottom: 14px; }
table.lb { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.lb th { text-align: left; color: var(--text-dim); font-weight: 500; font-size: .8rem; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.lb td { padding: 9px 10px; border-bottom: 1px solid var(--border-soft); }
table.lb tr:hover td { background: var(--bg-soft); }
table.lb .rank { font-weight: 800; width: 56px; }
table.lb .pts { color: var(--gold); font-weight: 700; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(5,8,14,.65); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal { width: min(420px, 100%); padding: 22px; animation: slideDown .22s ease; }
.modal h3 { margin-bottom: 6px; }
.modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.opp-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.opp-opt { padding: 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); text-align: center; transition: all .15s; }
.opp-opt:hover { border-color: var(--accent); }
.opp-opt.selected { border-color: var(--accent); background: rgba(79,143,247,.12); }
.opp-opt .oo-icon { font-size: 1.5rem; display: block; }
.opp-opt .oo-name { font-size: .86rem; font-weight: 600; }
.opp-opt .oo-sub { font-size: .72rem; color: var(--text-dim); }

/* ============ 自由房（free）============ */
.badge.type-free { color: #7de3d8; border-color: #1f5a54; background: #10262a; }
.avatar.xs { width: 20px; height: 20px; font-size: .62rem; }
.free-panel { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.topic-card {
  border: 1px dashed #1f5a54; border-radius: 10px; padding: 10px 12px;
  background: rgba(125, 227, 216, .05);
}
.topic-head { display: flex; align-items: center; gap: 8px; }
.topic-card .topic-label { font-size: .72rem; letter-spacing: 3px; color: #7de3d8; font-weight: 600; }
.topic-src { font-size: .72rem; color: var(--text-dim); border: 1px solid var(--border); border-radius: 99px; padding: 1px 8px; }
.topic-text { font-size: 1.02rem; font-weight: 600; margin: 7px 0 10px; }
.topic-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topic-actions .input { flex: 1; min-width: 150px; height: 32px; padding: 4px 10px; font-size: .84rem; }
.free-presence { display: flex; flex-direction: column; gap: 8px; }
.fp-title { font-size: .85rem; font-weight: 600; }
.fp-sub { font-size: .76rem; color: var(--text-dim); font-weight: 400; margin-left: 6px; }
.fp-bring { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-pokes { display: flex; flex-wrap: wrap; gap: 6px; }
.poke-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px;
  border: 1px solid var(--border); border-radius: 99px; background: var(--bg-soft);
  color: var(--text); font-size: .8rem; transition: all .15s;
}
.poke-chip:hover { border-color: #7de3d8; transform: translateY(-1px); }
.poke-chip.in { cursor: default; }
.heat { letter-spacing: -2px; }
.btn.xs { padding: 2px 8px; font-size: .72rem; border-radius: 7px; }
.sys-box.sys-poke { border-color: #1f5a54; }
.sys-box.sys-topic { border-color: #1f5a54; background: rgba(125, 227, 216, .06); }

/* ============ 精华消息 / 表情连击 / AMA / 编队 / 耳语 / 档案页 ============ */
.pin-strip {
  display: none; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 6px 14px; border-bottom: 1px solid var(--border-soft);
  background: rgba(255, 200, 87, .05); overflow-x: auto;
}
.pin-title { font-size: .76rem; font-weight: 700; color: var(--gold, #ffcf6b); flex: none; }
.pin-chip {
  flex: none; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px dashed #6b5420; background: rgba(255, 200, 87, .08); color: var(--text);
  font-size: .76rem; border-radius: 99px; padding: 3px 10px;
}
.pin-chip:hover { border-color: var(--gold, #ffcf6b); }
.msg.is-pinned .bubble { border-color: #6b5420; }
.pin-mark { font-size: .78rem; }
.msg.flash .bubble { animation: flashPin 1.5s ease; }
@keyframes flashPin { 0%, 60% { background: rgba(255, 200, 87, .18); } 100% { background: var(--bg-soft); } }

.bubble { position: relative; }
.bubble.combo-bubble { animation: comboShake .5s ease; }
@keyframes comboShake { 0%, 100% { transform: scale(1); } 35% { transform: scale(1.06) rotate(-1deg); } 70% { transform: scale(1.03) rotate(1deg); } }
.combo-particle {
  position: absolute; bottom: 30%; font-size: 1.3rem; pointer-events: none; z-index: 5;
  animation: comboFloat 1.5s ease-out forwards; opacity: .95;
}
@keyframes comboFloat {
  0% { transform: translateY(0) scale(.6); opacity: 1; }
  100% { transform: translateY(-70px) scale(1.25) rotate(12deg); opacity: 0; }
}
.reaction-chip.combo-hit { animation: chipPop .5s ease 2; border-color: var(--accent); }
@keyframes chipPop { 50% { transform: scale(1.25); } }

.ama-banner {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px dashed var(--border); border-radius: 10px; padding: 8px 12px;
}
.ama-banner.live {
  border: 1px solid #5a2b28; background: rgba(255, 122, 41, .07);
  border-color: #6b3a20;
}
.ama-live-dot { width: 8px; height: 8px; border-radius: 99px; background: #ff7a29; animation: livePulse 1.2s ease infinite; }
@keyframes livePulse { 50% { opacity: .25; } }
.ama-countdown { font-weight: 700; color: #ff9d97; }

.poke-chip.squad-chip { border-style: dashed; border-color: #2b3f66; cursor: default; }
.poke-chip.squad-chip .btn { margin-left: 2px; }
.squad-new { border-style: dashed; color: var(--text-dim); }
.squad-check { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; }

.whisper-modal .whisper-list {
  min-height: 180px; max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--border-soft); border-radius: 10px; padding: 10px; background: var(--bg-soft);
}
.wh-msg { max-width: 85%; display: flex; flex-direction: column; gap: 2px; }
.wh-msg.mine { align-self: flex-end; align-items: flex-end; }
.wh-text { border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; font-size: .88rem; background: var(--bg-soft); }
.wh-msg.mine .wh-text { background: rgba(79, 143, 247, .14); border-color: #2b3f66; }
.wh-time { font-size: .7rem; color: var(--text-dim); }
.wh-status { margin-top: 8px; font-size: .76rem; min-height: 18px; }
.wh-status code { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 5px; padding: 0 4px; }
.wh-read { color: #7ee2a8; }
.wh-unread { color: #ffcf6b; }

.profile-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.profile-card { width: min(520px, 100%); padding: 26px; }
.pf-head { display: flex; align-items: center; gap: 14px; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.5rem; }
.pf-tagline { margin: 12px 0 4px; color: var(--text-dim); font-style: italic; }
.pf-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.pf-badge { color: #ffcf6b; border-color: #6b5420; background: rgba(255, 200, 87, .07); }
.pf-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 14px 0; }
.pf-stat { text-align: center; border: 1px solid var(--border); border-radius: 10px; padding: 8px 4px; }
.pf-stat b { display: block; font-size: 1.05rem; }
.pf-stat span { font-size: .7rem; color: var(--text-dim); }
.pf-line { font-size: .86rem; margin-top: 8px; }
.agent-link { color: inherit; text-decoration: underline dotted; }
.agent-link:hover { color: var(--accent); }

/* ============ 移动端 <768px（H 打磨包） ============ */
@media (max-width: 767px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex: none; border-right: none; border-bottom: 1px solid var(--border-soft); max-height: 44vh; }
  .side-head { padding: 10px 14px 8px; }
  .room-list { padding: 6px; }
  .side-actions { flex-direction: row; padding: 8px 10px; }
  .side-actions .btn { flex: 1; }
  .me-card { margin: 0 10px 8px; }
  .main { flex: 1; min-height: 0; }
  .panel-slot { padding: 8px 10px 0; }
  .kanban { grid-template-columns: 1fr; }
  .new-task-form { grid-template-columns: 1fr; }
  .msg-scroll { padding: 10px; }
  .composer { padding: 8px 10px 10px; }
  .game-view { flex-direction: column; padding: 10px; gap: 10px; overflow-y: auto; }
  /* .gomoku 不再单独覆盖：基础规则 min(640px, 70vh, 92vw) 已含 92vw 触屏上限 */
  .score-board { grid-template-columns: 1fr; }
  .score-mid { justify-content: center; }
  .vs-row { gap: 10px; }
  .debayte-namecard { min-width: 0; padding: 6px 9px; }
  .phase-bar { flex-wrap: wrap; }
  .phase-step { min-width: 30%; }
  .room-header { padding: 9px 12px; }
  .room-header .room-meta { display: none; }
  .lb-view { padding: 12px; }
  .topic-actions .input { min-width: 0; flex: 1 1 100%; }
  .free-panel { padding: 10px; }
  .pf-stats { grid-template-columns: repeat(3, 1fr); }
  /* H：房间头部按钮收纳 —— 次要按钮去文字留图标，「📊 投票」等保持归位于头部一行 */
  .btn-optional-label { display: none; }
  /* H：话题/AMA 配置卡折叠为单行 pill（默认收起，点 pill 展开） */
  .free-toggle { display: inline-flex; }
  .free-panel:not(.open) .free-body { display: none; }
  .free-toggle .ft-topic { color: var(--text-dim); font-size: .78rem; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ============ 在场状态 / 审批 / 档案增强（第四轮） ============ */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.online { background: var(--green); box-shadow: 0 0 6px rgba(63,185,111,.55); }
.dot.listening { background: var(--accent); box-shadow: 0 0 7px rgba(79,143,247,.65); animation: dotPulse 1.6s ease-in-out infinite; }
.dot.off { background: #55606e; }
.dot.bot-dot { background: var(--accent-2); box-shadow: 0 0 6px rgba(124,92,255,.5); }
@keyframes dotPulse { 50% { opacity: .4; } }
.owner-link { color: inherit; text-decoration: none; }
.owner-link:hover .op-owner { color: var(--accent); text-decoration: underline dotted; }
.apply-group { border: 1px dashed #4a3a7a; border-radius: 10px; padding: 8px 10px; background: #171331; }
.apply-row { border-bottom: 1px dashed var(--border-soft); }
.apply-row:last-child { border-bottom: none; }
.pf-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tier-badge { margin-left: auto; font-size: .8rem; font-weight: 700; border: 1.5px solid; border-radius: 999px; padding: 3px 12px; background: rgba(255,255,255,.03); }
.pf-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 14px 0; }
.pf-history { border-top: 1px dashed var(--border); margin-top: 12px; padding-top: 10px; }
.pf-history .mem-group-title { margin-bottom: 8px; }
.battle-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px dashed var(--border-soft); }
.battle-row:last-child { border-bottom: none; }
.b-icon { font-size: 1.1rem; flex: none; }
.b-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.b-main b { font-size: .88rem; }
.res-chip { flex: none; font-size: .74rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.res-win { color: #7ee2a8; background: #12281c; border: 1px solid #245a3a; }
.res-loss { color: #ff9d97; background: #2a1512; border: 1px solid #5a2b28; }
.res-draw { color: #c9d4e3; background: #1a2230; border: 1px solid #2b3f66; }
@media (max-width: 767px) {
  .pf-stats { grid-template-columns: repeat(3, 1fr); }
  .tier-badge { margin-left: 0; }
}

/* ============ 游戏目录 & 卧底庄园（gamecore 标准组件） ============ */
.game-catalog { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.game-cat {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--bg-soft); color: var(--text); transition: all .18s ease;
}
.game-cat:hover { border-color: var(--accent); transform: translateY(-1px); }
.game-cat.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(79,143,247,.12), rgba(124,92,255,.10));
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.gc-icon { font-size: 1.7rem; flex: none; }
.gc-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gc-body b { font-size: .95rem; }
.gc-desc { font-size: .76rem; color: var(--text-dim); }
.gc-cap { font-size: .72rem; color: var(--text-dim); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; flex: none; }

/* --- 卧盘主体 --- */
.spy-table { padding: 12px; }
.spy-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.spy-title { font-weight: 800; font-size: 1.02rem; letter-spacing: 1px; background: linear-gradient(90deg, #ff9d97, #7c5cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.spy-countdown { font-variant-numeric: tabular-nums; }

/* 神秘词卡：只属于你的秘密 */
.spy-word {
  margin: 4px 0 12px; padding: 12px 16px; border-radius: 12px;
  background: linear-gradient(120deg, #241a3f 0%, #1d1733 55%, #2a1230 100%);
  border: 1px solid #4a3a7a;
  box-shadow: inset 0 0 24px rgba(124,92,255,.14), 0 4px 14px rgba(0,0,0,.35);
  font-size: .92rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  animation: wordGlow 3.2s ease-in-out infinite;
}
.spy-word b { font-size: 1.18rem; letter-spacing: .2em; color: #cdb8ff; }
@keyframes wordGlow { 50% { box-shadow: inset 0 0 34px rgba(124,92,255,.26), 0 4px 18px rgba(0,0,0,.4); } }

/* 座位卡矩阵 */
.spy-seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 10px; }
@media (max-width: 767px) { .spy-seats { grid-template-columns: repeat(2, 1fr); } }
.spy-seat {
  position: relative; padding: 10px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--bg-soft);
  transition: all .25s ease; min-height: 58px; user-select: none;
}
.spy-seat.me { border-color: #2b4a66; background: linear-gradient(160deg, #14202e, #101a24); }
.spy-seat.active {
  border-color: var(--accent);
  animation: seatBreath 1.4s ease-in-out infinite;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79,143,247,.18);
}
@keyframes seatBreath { 50% { box-shadow: 0 6px 22px rgba(79,143,247,.34); } }
.spy-seat.votable { cursor: pointer; }
.spy-seat.votable:hover { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.spy-seat.vote-pick { border-color: var(--gold); background: rgba(240,192,74,.10); box-shadow: 0 0 0 1.5px var(--gold) inset; }
.spy-seat.dead { opacity: .62; filter: grayscale(.7); border-style: dashed; animation: seatFlip .5s ease; }
@keyframes seatFlip {
  0% { transform: rotateY(90deg); }
  100% { transform: rotateY(0); }
}
.ss-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ss-name { font-size: .86rem; font-weight: 600; }
.ss-live { font-size: .7rem; color: var(--accent); animation: dotPulse 1.4s ease-in-out infinite; }
.ss-vote { font-size: .7rem; color: var(--gold); border: 1px solid #6b5420; background: #2a2210; border-radius: 999px; padding: 1px 7px; }
.ss-reveal { margin-top: 7px; font-size: .76rem; border-radius: 8px; padding: 3px 8px; display: inline-block; animation: seatFlip .5s ease; }
.ss-reveal.spy { color: #ff9d97; background: #2a1512; border: 1px solid #5a2b28; font-weight: 700; }
.ss-reveal.civ { color: #a9b7c6; background: #1a2230; border: 1px solid #2b3f66; }

/* 动作区 */
.spy-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spy-act.dim { color: var(--text-dim); font-size: .86rem; }
.spy-act .input { flex: 1; min-width: 200px; }

/* ============ 卧底庄园 v2：圆桌 + 舞台 + 开票仪式 ============ */
.j-journey { display: inline-flex; align-items: center; gap: 3px; }
.j-dot {
  width: 20px; height: 20px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: .68rem;
  border: 1.5px solid var(--border); color: var(--text-dim); background: var(--bg-soft);
}
.j-dot.done { border-color: var(--green); color: var(--green); }
.j-dot.cur { border-color: var(--accent); color: #fff; background: var(--accent); box-shadow: 0 0 10px rgba(79,143,247,.5); }
.j-line { width: 14px; height: 1.5px; background: var(--border); display: inline-block; }

/* 圆桌容器：席位椭圆分布，中央舞台 */
.spy-roundtable { position: relative; height: 360px; margin: 6px 0 10px; }
@media (max-width: 767px) { .spy-roundtable { height: 430px; } }

/* 中央舞台 */
.spy-stage {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(46%, 340px); text-align: center; z-index: 1;
  padding: 14px 16px; border-radius: 16px;
  background: radial-gradient(circle at 50% 30%, rgba(124,92,255,.16), rgba(13,17,23,.6) 70%);
  border: 1px solid rgba(124,92,255,.35);
  box-shadow: 0 0 40px rgba(124,92,255,.12);
}
.stage-round { font-size: .72rem; color: var(--text-dim); letter-spacing: 2px; margin-bottom: 8px; }
.stage-bubble {
  font-size: 1.04rem; font-weight: 700; line-height: 1.55; min-height: 2.4em;
  display: flex; align-items: center; justify-content: center;
  animation: bubbleIn .4s ease;
}
.stage-bubble .st-turn { color: var(--accent); }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.stage-by { font-size: .76rem; color: var(--text-dim); margin-top: 8px; }
.stage-votes { margin-top: 6px; font-size: .78rem; color: var(--gold); }

/* 席位卡（圆桌版，绝对定位） */
.spy-roundtable .spy-seat {
  position: absolute; transform: translate(-50%, -50%);
  width: min(172px, 24vw); padding: 8px 10px; z-index: 2;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.spy-roundtable .spy-seat.active { transform: translate(-50%, -54%) scale(1.06); z-index: 3; }
.ss-avs { display: inline-flex; align-items: center; }
.ss-avs .avatar-wrap + .avatar-wrap { margin-left: -8px; }
.ss-more { font-size: .68rem; color: var(--text-dim); margin-left: 3px; }
.ss-squad { font-size: .66rem; color: #9db9ff; border: 1px solid #2b3f66; background: #141f33; border-radius: 999px; padding: 1px 7px; }

/* 开票仪式覆盖层 */
.spy-ceremony {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(6,9,14,.82); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: cerFade .3s ease;
}
@keyframes cerFade { from { opacity: 0; } }
.cer-card {
  text-align: center; padding: 34px 46px; border-radius: 20px;
  background: linear-gradient(160deg, #1d1733, #0d1117);
  border: 1.5px solid #4a3a7a; box-shadow: var(--shadow);
}
.cer-votes { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.cer-v {
  font-size: .85rem; color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 14px; background: var(--bg-soft);
  opacity: 0; animation: cerPop .45s ease forwards;
}
@keyframes cerPop { from { opacity: 0; transform: translateY(14px) rotate(-6deg); } to { opacity: 1; } }
.cer-out { font-size: 1.5rem; font-weight: 800; margin-bottom: 10px; animation: cerPop .5s .5s ease backwards; }
.cer-word { font-size: 1.02rem; color: var(--text); margin-bottom: 14px; animation: cerPop .5s .9s ease backwards; }
.cer-word b { color: #cdb8ff; letter-spacing: .15em; }
.cer-role {
  display: inline-block; font-size: 1.35rem; font-weight: 900; letter-spacing: 4px;
  padding: 8px 30px; border-radius: 12px; transform: rotate(-4deg);
  animation: stampIn .4s 1.3s cubic-bezier(.2, 2.2, .4, 1) backwards;
}
.cer-role.spy { color: #ff9d97; border: 3px solid #e5534b; background: rgba(229,83,75,.12); text-shadow: 0 0 24px rgba(229,83,75,.5); }
.cer-role.civ { color: #a9d2f5; border: 3px solid #4f8ff7; background: rgba(79,143,247,.1); }
@keyframes stampIn { from { opacity: 0; transform: rotate(-4deg) scale(2.6); } }
.cer-hint { margin-top: 18px; font-size: .74rem; color: var(--text-dim); }

/* ============ 房间筛选 / 牌桌候场 / 一键绑定 ============ */
.room-filter { padding: 8px 10px 4px; display: flex; flex-direction: column; gap: 6px; }
.room-filter .input { padding: 6px 10px; font-size: .82rem; }
.room-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  font-size: .72rem; padding: 2px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-dim);
  transition: all .15s;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.on { border-color: var(--accent); color: #fff; background: var(--accent); }
.spy-seat.empty { opacity: .55; border-style: dashed; }
.lobby-note { font-size: .82rem; color: var(--text-dim); padding: 10px 12px; margin-bottom: 10px; line-height: 1.7; }
.bind-cmd-wrap { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.bind-cmd {
  display: block; padding: 12px 14px; border-radius: 10px;
  background: var(--bg-soft); border: 1px solid #2b4a66;
  color: #a9d2f5; font-size: .82rem; word-break: break-all; line-height: 1.7;
  user-select: all; box-shadow: inset 0 0 18px rgba(79,143,247,.08);
}

/* 提示词块（一键绑定 v2） */
.bind-prompt {
  display: block; padding: 14px 16px; border-radius: 10px;
  background: var(--bg-soft); border: 1px solid #2b4a66;
  color: #c9d9ec; font-size: .8rem; line-height: 1.85;
  white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow-y: auto;
  user-select: all; box-shadow: inset 0 0 18px rgba(79,143,247,.08);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}
.bind-quick .bind-cmd { font-size: .76rem; padding: 8px 12px; }

/* 行动代号：信号 */
.signal-panel { padding: 12px; }
.signal-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.signal-team { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; }
.signal-team.active { border-color: currentColor; box-shadow: 0 0 14px rgba(79,143,247,.12); }
.signal-team.red { color: #ff9d97; }
.signal-team.blue { color: #8db9ff; }
.signal-team small { margin-left: auto; color: var(--text-dim); }
.signal-status { margin-bottom: 10px; color: var(--text); font-size: .9rem; }
.signal-clue-form { display: flex; gap: 8px; margin-bottom: 10px; }
.signal-clue-form input:first-child { flex: 1; }
.signal-clue-form input[type="number"] { width: 76px; }
.signal-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: var(--text-dim); font-size: .8rem; }
.signal-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.signal-card { min-width: 0; min-height: 76px; padding: 7px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-soft); color: var(--text); }
.signal-card:disabled { opacity: 1; }
.signal-card:not(:disabled):hover { border-color: var(--accent); transform: translateY(-1px); }
.signal-card small { color: var(--text-dim); }
.signal-card strong { max-width: 100%; overflow-wrap: anywhere; font-size: .86rem; }
.signal-card span { font-size: .7rem; }
.signal-card.role-red-agent { background: rgba(198,72,66,.3); border-color: #a84f49; color: #ffd1cd; }
.signal-card.role-blue-agent { background: rgba(55,105,190,.3); border-color: #4f78bd; color: #d1e4ff; }
.signal-card.role-bystander { background: rgba(130,126,105,.25); color: #ddd7bd; }
.signal-card.role-assassin { background: rgba(0,0,0,.55); border-color: #666; color: #fff; }
.signal-history { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; color: var(--text-dim); font-size: .74rem; }
.signal-history span { padding: 2px 7px; border: 1px solid var(--border); border-radius: 999px; }
@media (max-width: 600px) {
  .signal-card { min-height: 62px; }
  .signal-card strong { font-size: .72rem; }
  .signal-clue-form { flex-wrap: wrap; }
  .signal-team small { display: none; }
}

/* ============ 2026 聊天室体验升级 ============ */
:root {
  --bg: #0b1119; --bg-soft: #111a26; --panel: #162130; --panel-2: #1b293a;
  --border: #2b3b50; --border-soft: #202e40; --text: #edf3fa; --text-dim: #97a7bb;
  --accent: #63a1ff; --accent-2: #8b70ff; --radius: 14px;
}
body { letter-spacing: .01em; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid #a9c8ff; outline-offset: 2px;
}
.btn { min-height: 38px; font-weight: 550; }
.btn.sm { min-height: 32px; }
.input:focus { box-shadow: 0 0 0 3px rgba(99,161,255,.12); }
.sidebar { width: 282px; background: rgba(14,23,35,.96); }
.side-head { padding: 18px 16px 14px; position: relative; }
.room-filter { position: sticky; top: 0; z-index: 3; background: rgba(14,23,35,.97); padding-bottom: 10px; border-bottom: 1px solid var(--border-soft); }
.room-item { border-radius: 10px; margin-bottom: 5px; }
.room-item.active { border-color: rgba(99,161,255,.7); background: linear-gradient(90deg, rgba(99,161,255,.14), rgba(139,112,255,.08)); box-shadow: inset 3px 0 0 var(--accent); }
.room-item .r-name { line-height: 1.35; }
.room-item .r-meta { margin-top: 2px; line-height: 1.35; }
.me-card { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px; padding: 12px; }
.me-card > div:nth-child(2) { min-width: 0; }
.me-card > div:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.me-card .btn { margin-left: 0; width: 100%; }
.room-header { flex-wrap: wrap; gap: 8px; min-height: 58px; padding: 10px 18px; }
.room-header h2 { max-width: min(46vw, 560px); }
.room-header .btn { min-height: 32px; }
.panel-slot { max-height: 64vh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.msg-scroll { max-width: 1180px; width: 100%; margin: 0 auto; }
.msg .bubble { max-width: min(760px, 82%); line-height: 1.65; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .bubble { background: #1b3450; border-color: #2c5075; border-radius: 14px 4px 14px 14px; }
.msg.mine .m-head { flex-direction: row-reverse; }
.msg.mine .m-text { text-align: left; }
.msg.mine .msg-actions { left: auto; right: 44px; }
.composer { background: rgba(13,22,33,.94); }
.composer textarea { min-height: 46px; }
.modal.card { max-height: min(86vh, 900px); overflow-y: auto; }
.collab-card { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; padding: 11px 13px; margin: 8px 0; border: 1px solid #4b4778; border-radius: 11px; background: linear-gradient(135deg, rgba(99,161,255,.1), rgba(139,112,255,.12)); color: #dce6ff; }
.collab-card small, .collab-card span { color: #aebdda; }
.collab-title { font-weight: 700; }
.game-view-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--text-dim); font-size: .8rem; }
.renderer-toggle { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); }
.renderer-toggle .btn { border: 0; min-height: 28px; }
.game-3d-mount { position: relative; height: 430px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: #0d141d; }
.game-3d-mount canvas { display: block; width: 100%; height: 100%; }
[data-renderer="3d"] .spy-roundtable, [data-renderer="3d"] .signal-grid { display: none; }
#btn-sidebar-toggle { display: none; }
@media (max-width: 767px) {
  .sidebar { width: 100%; max-height: 42vh; }
  #btn-sidebar-toggle { display: inline-flex; position: absolute; right: 12px; top: 12px; }
  .sidebar.is-collapsed { max-height: 62px; }
  .sidebar.is-collapsed .room-list, .sidebar.is-collapsed .side-actions, .sidebar.is-collapsed .me-card { display: none; }
  .room-header { padding: 8px 10px; }
  .room-header h2 { max-width: 72vw; font-size: .98rem; }
  .room-header .room-meta { width: 100%; order: 3; }
  .panel-slot { max-height: 68vh; padding: 8px 10px 0; }
  .game-3d-mount { height: 340px; }
  .msg .bubble { max-width: 88%; }
  .signal-clue-form .btn { flex: 1; }
}
@media (max-height: 760px) and (min-width: 721px) {
  .panel-slot { max-height: 58vh; }
  .game-3d-mount { height: 350px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ============ C/H 轮新增：反馈铁律 / 投票矩阵 / 战报重塑 / 首启引导 / 列表打磨 ============ */
/* 登录卡 → 落地页入口（D1①） */
.auth-landing-row { text-align: center; margin-top: 14px; }
.auth-landing-link { font-size: .84rem; color: var(--text-dim); text-decoration: none; border-bottom: 1px dashed var(--border); padding-bottom: 2px; }
.auth-landing-link:hover { color: var(--accent); border-color: var(--accent); }

/* D2 演示房只读回放 */
.badge.demo-badge { color: var(--gold); border-color: #6b5420; background: rgba(255, 200, 87, .07); }
.demo-readonly {
  padding: 10px 14px; border-radius: 10px; font-size: .84rem; color: var(--text-dim);
  border: 1px dashed #6b5420; background: rgba(255, 200, 87, .05); line-height: 1.7;
}
.sys-box.sys-guide { border-color: #6b5420; background: rgba(255, 200, 87, .06); color: var(--text); text-align: left; }

/* C2 输入一致性提示 / C3 投票矩阵 */
.vote-note { text-align: center; font-size: .78rem; color: var(--text-dim); margin-top: 10px; }
.vote-btn.predict { border-style: dashed; border-color: #4a3a7a; color: #cdb8ff; background: #1d1733; }
.vote-btn.predict:hover { border-color: var(--accent-2); }

/* A1 战报卡片重塑：裁判来源 / 分项 / 参考分 / 预测回显 / 降级与复读徽章 */
.report-card .rc-source { font-size: .76rem; color: var(--text-dim); margin: 2px 0 6px; }
.report-card .rc-scores { margin: 8px 0; border-top: 1px dashed var(--border-soft); padding-top: 8px; }
.report-card .rc-scores.rc-ref { opacity: .92; }
.report-card .rc-block-title { font-size: .76rem; color: var(--text-dim); margin-bottom: 5px; letter-spacing: 1px; }
.report-card .rc-side { margin: 6px 0; }
.report-card .rc-dims { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 3px; padding-left: 2px; }
.report-card .rc-dim { font-size: .78rem; color: var(--text-dim); }
.report-card .rc-dim b { color: var(--text); }
.report-card .rc-reasons { margin: 8px 0; border-top: 1px dashed var(--border-soft); padding-top: 8px; }
.report-card .rc-reason { font-size: .8rem; color: var(--text-dim); flex: 1; min-width: 0; }
.report-card .rc-votes { font-size: .8rem; color: var(--text-dim); margin-top: 6px; }
.report-card .rc-nomvp { font-size: .8rem; color: var(--text-dim); }
.report-card .rc-predict { margin: 6px 0; font-size: .88rem; font-weight: 700; border-radius: 9px; padding: 7px 12px; }
.report-card .rc-predict.hit { color: #7ee2a8; background: rgba(63,185,111,.1); border: 1px solid #245a3a; }
.report-card .rc-predict.miss { color: #ff9d97; background: rgba(229,83,75,.08); border: 1px solid #5a2b28; }
.badge.degraded-badge { color: #ffb26b; border-color: #7a4a1d; background: #2a1d10; font-weight: 700; }
.badge.dup-badge { color: #ffcf6b; border-color: #6b5420; background: rgba(255, 200, 87, .08); }
.rc-title .badge { margin-left: 8px; vertical-align: middle; }

/* A3/H 排行榜：Bot 行开关 */
.lb-card h2 .lb-toggle { float: right; display: inline-flex; gap: 6px; }

/* D3 房间列表：加载更多 / 到底提示 / 名称两行省略（H） */
.load-more { width: 100%; margin-top: 6px; }
.list-end { text-align: center; font-size: .72rem; color: var(--text-dim); padding: 8px 0 2px; }
.room-item .r-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  white-space: normal; line-clamp: 2; overflow: hidden;
}

/* H 自由房配置卡：移动端折叠 pill（桌面恒展开，pill 不显示） */
.free-toggle { display: none; }

/* H 卧底候场：8 席两行紧凑网格 */
.spy-seats.compact { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.spy-seats.compact .spy-seat { padding: 6px 8px; min-height: 44px; }
.spy-seats.compact .ss-name { font-size: .78rem; }
.spy-seats.compact .ss-avs .avatar { width: 20px; height: 20px; font-size: .58rem; }
@media (max-width: 767px) {
  .spy-seats.compact { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .spy-seats.compact .spy-seat { padding: 4px 6px; min-height: 38px; }
}

/* D1② 首启三选一引导卡 */
.guide-card { margin: auto; max-width: 560px; padding: 30px 26px; text-align: center; }
.guide-hello { font-size: 1.2rem; font-weight: 800; }
.guide-sub { color: var(--text-dim); font-size: .9rem; margin: 8px 0 18px; }
.guide-opts { display: flex; flex-direction: column; gap: 10px; }
.guide-opt {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 14px 16px; border-radius: 13px; border: 1.5px solid var(--border);
  background: var(--bg-soft); color: var(--text); transition: all .18s ease; font-family: inherit;
}
.guide-opt:hover { border-color: var(--accent); transform: translateY(-1px); }
.guide-opt .go-icon { font-size: 1.7rem; flex: none; }
.guide-opt .go-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.guide-opt .go-body b { font-size: .95rem; }
.guide-opt .go-sub { font-size: .78rem; color: var(--text-dim); }
@media (max-width: 767px) {
  .guide-card { padding: 22px 14px; }
}
