:root {
  --bg: #05070f;
  --bg-2: #0a1022;
  --panel: rgba(13, 19, 37, 0.82);
  --panel-2: rgba(19, 27, 51, 0.72);
  --line: rgba(122, 158, 255, 0.14);
  --line-strong: rgba(122, 158, 255, 0.28);
  --txt: #e9eeff;
  --muted: #8492b5;
  --muted-2: #5d6a8c;
  --cyan: #5eead4;
  --violet: #a78bfa;
  --red: #ff5d73;
  --amber: #ffd166;
  --green: #7bf1a8;
  --blue: #60a5fa;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  color: var(--txt);
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(94, 234, 212, 0.10), transparent 60%),
    radial-gradient(1000px 600px at 95% 0%, rgba(167, 139, 250, 0.13), transparent 55%),
    radial-gradient(900px 700px at 50% 115%, rgba(96, 165, 250, 0.10), transparent 60%),
    var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 18% 22%, rgba(255, 255, 255, 0.55), transparent 100%),
    radial-gradient(1.2px 1.2px at 72% 12%, rgba(255, 255, 255, 0.4), transparent 100%),
    radial-gradient(1.6px 1.6px at 46% 68%, rgba(255, 255, 255, 0.35), transparent 100%),
    radial-gradient(1.1px 1.1px at 88% 52%, rgba(255, 255, 255, 0.45), transparent 100%),
    radial-gradient(1.3px 1.3px at 28% 84%, rgba(255, 255, 255, 0.35), transparent 100%),
    radial-gradient(1.1px 1.1px at 62% 92%, rgba(255, 255, 255, 0.3), transparent 100%);
  opacity: 0.7;
}

button { font-family: inherit; }
input, select { font-family: inherit; }

.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 400; }

/* ================= 顶栏 ================= */
#topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 10, 22, 0.72);
  backdrop-filter: blur(16px);
  flex: 0 0 auto;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.brand-icon { font-size: 24px; filter: drop-shadow(0 0 10px rgba(94, 234, 212, 0.5)); }
.brand-text b { font-size: 15px; letter-spacing: 0.3px; display: block; }
.brand-text em { font-style: normal; font-size: 11px; color: var(--cyan); border: 1px solid rgba(94, 234, 212, 0.35); padding: 1px 6px; border-radius: 999px; margin-left: 4px; vertical-align: 1px; }
.brand-text small { display: block; font-size: 10px; color: var(--muted-2); letter-spacing: 2px; margin-top: 2px; }

.statusbar { display: flex; align-items: center; gap: 16px; flex: 1; justify-content: center; }
.stat { font-size: 11px; color: var(--muted); }
.stat b { color: var(--txt); font-size: 13px; margin-left: 3px; }

.phase-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.phase-badge.playing { color: var(--cyan); background: rgba(94, 234, 212, 0.10); border-color: rgba(94, 234, 212, 0.3); }
.phase-badge.meeting { color: var(--amber); background: rgba(255, 209, 102, 0.10); border-color: rgba(255, 209, 102, 0.35); animation: badgePulse 1.4s infinite; }
.phase-badge.ended { color: var(--violet); background: rgba(167, 139, 250, 0.12); border-color: rgba(167, 139, 250, 0.35); }

@keyframes badgePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,209,102,.35); } 50% { box-shadow: 0 0 0 5px rgba(255,209,102,0); } }

.taskbar-wrap { display: flex; align-items: center; gap: 8px; min-width: 190px; }
.taskbar { flex: 1; height: 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; position: relative; }
#taskFill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, #34d399, #5eead4); box-shadow: 0 0 12px rgba(94, 234, 212, 0.6); transition: width 0.5s ease; }
.taskbar-wrap span { font-size: 10px; color: var(--muted); white-space: nowrap; }

.actions { display: flex; align-items: center; gap: 7px; }

.btn {
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--txt);
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  font-weight: 500;
}
.btn:hover { border-color: rgba(94, 234, 212, 0.55); background: rgba(94, 234, 212, 0.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn.small { padding: 5px 11px; font-size: 11px; border-radius: 9px; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(255, 93, 115, 0.4); color: #ff92a2; }
.btn.danger:hover { background: rgba(255, 93, 115, 0.1); border-color: rgba(255, 93, 115, 0.65); }
.btn.primary {
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.22), rgba(167, 139, 250, 0.28));
  border-color: rgba(94, 234, 212, 0.6);
  color: #eafffb;
  font-weight: 700;
  box-shadow: 0 8px 26px rgba(94, 234, 212, 0.18);
}
.btn.primary:hover { box-shadow: 0 10px 34px rgba(94, 234, 212, 0.3); }
.btn.primary.big { padding: 13px 40px; font-size: 15px; border-radius: 14px; }

.mini-select {
  background: var(--panel-2);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px 8px;
  font-size: 11px;
  outline: none;
  cursor: pointer;
}

/* ================= 主布局 ================= */
#game {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr) 342px;
  gap: 12px;
  padding: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px 10px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.panel-head h2 { font-size: 12px; letter-spacing: 1.5px; color: var(--muted); font-weight: 600; }

.god-chip {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--violet);
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.1);
  padding: 2px 7px;
  border-radius: 999px;
}

/* ================= 玩家面板 ================= */
.player-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }

.pcard {
  position: relative;
  border-radius: 12px;
  padding: 9px 10px 9px 12px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-left: 3px solid var(--c, #556);
  transition: background 0.25s ease, opacity 0.3s ease;
}
.pcard:hover { background: rgba(255, 255, 255, 0.05); }
.pcard.dead { opacity: 0.42; filter: grayscale(0.55); }
.pcard.impostor { background: linear-gradient(90deg, rgba(255, 93, 115, 0.08), rgba(255, 255, 255, 0.02)); }
.pcard .row1 { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 27px; height: 27px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: #06101f;
  flex: 0 0 auto;
  box-shadow: 0 0 12px -2px var(--c);
}
.pname { font-size: 13px; font-weight: 700; letter-spacing: 0.3px; }
.role-tag { font-size: 9px; padding: 1px 6px; border-radius: 999px; font-weight: 700; letter-spacing: 0.5px; }
.role-tag.imp { color: #ff97a7; background: rgba(255, 93, 115, 0.14); border: 1px solid rgba(255, 93, 115, 0.35); }
.role-tag.crew { color: #7feedb; background: rgba(94, 234, 212, 0.1); border: 1px solid rgba(94, 234, 212, 0.28); }
.role-tag.human { color: #93c5fd; background: rgba(96, 165, 250, 0.12); border: 1px solid rgba(96, 165, 250, 0.32); }
.role-tag.out { color: var(--muted); background: rgba(148, 163, 184, 0.1); border: 1px solid rgba(148, 163, 184, 0.25); }
.pstat { margin-left: auto; font-size: 10px; color: var(--muted); white-space: nowrap; }
.pmeta { display: flex; gap: 10px; margin-top: 5px; font-size: 10px; color: var(--muted); flex-wrap: wrap; }
.pmeta b { color: #c9d4f5; font-weight: 500; }
.thought {
  margin-top: 6px;
  font-size: 10.5px;
  line-height: 1.5;
  color: #9fabcc;
  background: rgba(94, 234, 212, 0.045);
  border-left: 2px solid rgba(94, 234, 212, 0.25);
  border-radius: 0 6px 6px 0;
  padding: 4px 7px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.thought.imp { background: rgba(255, 93, 115, 0.05); border-left-color: rgba(255, 93, 115, 0.35); color: #c9a5ad; }
.warn { color: var(--amber); font-size: 10px; cursor: help; margin-left: 4px; }

/* ================= 地图 ================= */
#mapWrap { position: relative; }
.map-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 8px; flex: 0 0 auto; }
.map-title { font-size: 12px; letter-spacing: 2px; color: var(--muted); }
.map-legend { display: flex; gap: 12px; font-size: 10px; color: var(--muted); }
.map-legend span { display: flex; align-items: center; gap: 5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.alive { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.dot.dead { background: #4b5563; }
.dot.body { background: var(--red); box-shadow: 0 0 6px var(--red); }
.dot.imp { background: var(--red); border: 1px solid #ffb3bd; }

.svg-wrap { flex: 1; min-height: 0; padding: 0 10px; }
#map { width: 100%; height: 100%; display: block; }

.map-foot { display: flex; justify-content: space-between; padding: 8px 16px 12px; font-size: 10px; color: var(--muted-2); flex: 0 0 auto; }

.corridor { stroke: #16203c; stroke-width: 30; stroke-linecap: round; }
.corridorGlow { stroke: rgba(94, 234, 212, 0.12); stroke-width: 2; stroke-dasharray: 6 10; stroke-linecap: round; }

.roomRect {
  fill: rgba(17, 24, 46, 0.97);
  stroke: rgba(122, 158, 255, 0.22);
  stroke-width: 1.5;
  transition: stroke 0.3s ease, fill 0.3s ease;
}
.roomName { fill: #aebadf; font-size: 15px; font-weight: 600; text-anchor: middle; letter-spacing: 2px; }
.roomTasks { fill: #5c6a8d; font-size: 11px; text-anchor: middle; letter-spacing: 1px; }
.room.flash .roomRect { stroke: var(--red); fill: rgba(255, 93, 115, 0.16); }
.room.alert .roomRect { stroke: rgba(255, 209, 102, 0.6); }

.token { transition: transform 1.35s cubic-bezier(0.4, 0, 0.2, 1); pointer-events: none; }
.token circle.body { stroke: rgba(0, 0, 0, 0.45); stroke-width: 2; }
.token text { text-anchor: middle; font-weight: 800; fill: #071022; pointer-events: none; user-select: none; }
.token .ring { fill: none; stroke: var(--red); stroke-width: 2; stroke-dasharray: 5 4; opacity: 0; transition: opacity 0.3s; transform-box: fill-box; transform-origin: center; }
.token.is-imp .ring { opacity: 0.9; animation: spinRing 6s linear infinite; }
.token.is-dead { opacity: 0.32; }
.token.is-dead circle.body { fill: #4b5563 !important; }
.token.killer circle.body { filter: drop-shadow(0 0 6px rgba(255, 93, 115, 0.8)); }

@keyframes spinRing { to { transform: rotate(360deg); } }

.bodyMark { animation: bodyPulse 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes bodyPulse { 0%, 100% { opacity: 0.65; transform: scale(0.94); } 50% { opacity: 1; transform: scale(1.06); } }

/* ================= 日志 ================= */
.log-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }

.log-item {
  font-size: 11px;
  line-height: 1.55;
  color: #a8b6d9;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  border-left: 2px solid rgba(122, 158, 255, 0.25);
  animation: logIn 0.35s ease;
  word-break: break-word;
}
@keyframes logIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.log-item .lt { color: var(--muted-2); font-size: 9px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.log-item.god { border-left-color: rgba(167, 139, 250, 0.55); background: rgba(167, 139, 250, 0.06); }
.log-item.kill { border-left-color: var(--red); color: #ffb3bd; background: rgba(255, 93, 115, 0.08); }
.log-item.task { border-left-color: rgba(123, 241, 168, 0.5); }
.log-item.meeting { border-left-color: var(--amber); color: #ffe3a3; background: rgba(255, 209, 102, 0.06); }
.log-item.eject { border-left-color: var(--violet); color: #d7c9ff; background: rgba(167, 139, 250, 0.08); }
.log-item.report { border-left-color: var(--amber); }
.log-item.end { border-left-color: var(--cyan); color: #b9fff4; background: rgba(94, 234, 212, 0.08); font-weight: 600; }
.god-badge { font-size: 8px; color: var(--violet); border: 1px solid rgba(167,139,250,.3); padding: 0 4px; border-radius: 4px; margin-right: 5px; letter-spacing: 0.5px; }

/* ================= 配置页 ================= */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(3, 6, 15, 0.78);
  backdrop-filter: blur(14px);
  padding: 20px;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.setup-card {
  width: min(1000px, 100%);
  background: linear-gradient(160deg, rgba(19, 27, 51, 0.96), rgba(10, 15, 30, 0.98));
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(94, 234, 212, 0.05) inset;
  padding: 28px 32px 24px;
  animation: cardIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(0.985); } to { opacity: 1; transform: none; } }

.setup-head { display: flex; gap: 16px; align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.setup-logo {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center; font-size: 28px;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.16), rgba(167, 139, 250, 0.2));
  border: 1px solid rgba(94, 234, 212, 0.3);
  box-shadow: 0 0 30px rgba(94, 234, 212, 0.15);
  flex: 0 0 auto;
}
.setup-head h1 { font-size: 21px; letter-spacing: 0.5px; }
.setup-head p { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.6; max-width: 720px; }

.setup-body { display: grid; grid-template-columns: 1.05fr 1fr; gap: 26px; padding: 20px 0 6px; }
.setup-block { min-width: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.block-head h2 { font-size: 12px; letter-spacing: 1.5px; color: #b9c6e8; font-weight: 600; }

.add-row { display: flex; gap: 7px; }
.add-row input {
  flex: 1; min-width: 0;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--txt);
  padding: 8px 11px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}
.add-row input:focus { border-color: rgba(94, 234, 212, 0.5); }
.add-row input::placeholder { color: var(--muted-2); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; min-height: 40px; }
.chip {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px;
  padding: 5px 8px 5px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: logIn 0.25s ease;
}
.chip .cdot { width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 8px -1px var(--c); }
.chip .x { color: var(--muted-2); cursor: pointer; font-size: 13px; line-height: 1; padding: 0 2px; border-radius: 50%; }
.chip .x:hover { color: var(--red); }
.empty-chip { font-size: 11px; color: var(--muted-2); padding: 8px 2px; }

.hint { font-size: 10.5px; color: var(--muted-2); margin-top: 10px; line-height: 1.6; }
.hint a, .setup-head a { color: var(--cyan); text-decoration: none; border-bottom: 1px dashed rgba(94,234,212,.4); }
.hint a:hover, .setup-head a:hover { color: #fff; }

.human-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.human-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
}
.human-row .avatar { width: 22px; height: 22px; font-size: 10px; }
.hname { font-weight: 600; }
.htag { font-size: 9px; padding: 1px 7px; border-radius: 999px; margin-left: auto; }
.htag.on { color: #7bf1a8; background: rgba(123, 241, 168, 0.1); border: 1px solid rgba(123, 241, 168, 0.3); }
.htag.off { color: var(--muted); background: rgba(148, 163, 184, 0.1); border: 1px solid rgba(148, 163, 184, 0.25); }
.human-row .x { cursor: pointer; color: var(--muted-2); padding: 0 3px; font-weight: 400; }
.human-row .x:hover { color: var(--red); }
.demo-hint { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: rgba(94, 234, 212, 0.045); border: 1px dashed rgba(94, 234, 212, 0.2); }

.field { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.field > span { font-size: 11.5px; color: var(--muted); }
.field.column { flex-direction: column; align-items: stretch; gap: 5px; }
.field.column input[type="text"], .field.column input[type="password"], .field.column input:not([type]) {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--txt);
  padding: 8px 11px;
  font-size: 12px;
  outline: none;
}
.field.column input:focus { border-color: rgba(94, 234, 212, 0.5); }
.field em { font-style: normal; color: var(--cyan); }

.stepper { display: flex; align-items: center; gap: 2px; background: rgba(255,255,255,.045); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { width: 32px; height: 30px; background: none; border: none; color: var(--txt); font-size: 16px; cursor: pointer; }
.stepper button:hover { background: rgba(94, 234, 212, 0.12); }
.stepper b { width: 34px; text-align: center; font-size: 13px; color: var(--cyan); }

.segmented { display: flex; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.segmented button {
  border: none; background: none; color: var(--muted);
  font-size: 11.5px; padding: 6px 14px; border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.segmented button.active { background: rgba(94, 234, 212, 0.14); color: var(--cyan); box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.25) inset; }

.api-fields {
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--line);
  animation: fadeIn 0.25s ease;
}
.api-fields .field { margin-bottom: 10px; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 999px; background: rgba(255,255,255,.12); outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--cyan); cursor: pointer; box-shadow: 0 0 10px rgba(94,234,212,.6); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: none; border-radius: 50%; background: var(--cyan); cursor: pointer; }

.setup-foot { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.error { flex: 1; font-size: 11.5px; color: #ff97a7; min-height: 16px; }

/* ================= 会议 ================= */
.meeting-card {
  width: min(780px, 100%);
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, rgba(22, 30, 56, 0.98), rgba(9, 13, 26, 0.99));
  border: 1px solid rgba(255, 209, 102, 0.25);
  border-radius: 22px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), 0 0 60px rgba(255, 209, 102, 0.06);
  overflow: hidden;
  animation: cardIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.meeting-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--line); position: relative; }
.meeting-title { font-size: 17px; font-weight: 800; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.siren { animation: shake 1.5s infinite; display: inline-block; }
@keyframes shake { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(8deg); } }
.meeting-reason { font-size: 12px; color: var(--amber); margin-top: 6px; }
.meeting-stage {
  position: absolute; right: 22px; top: 20px;
  font-size: 10px; letter-spacing: 1px; color: var(--muted);
  border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.03);
}
.meeting-chat { flex: 1; min-height: 160px; overflow-y: auto; padding: 14px 22px; display: flex; flex-direction: column; gap: 9px; }
.chat-msg { display: flex; gap: 9px; animation: logIn 0.3s ease; }
.chat-msg .avatar { width: 24px; height: 24px; font-size: 11px; margin-top: 1px; }
.chat-bubble { flex: 1; min-width: 0; }
.chat-name { font-size: 11px; font-weight: 700; margin-bottom: 2px; }
.chat-text { font-size: 12.5px; line-height: 1.6; color: #cfd8ef; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.05); border-radius: 4px 12px 12px 12px; padding: 7px 11px; display: inline-block; max-width: 100%; word-break: break-word; }
.chat-sys { font-size: 11px; color: var(--muted); text-align: center; padding: 3px 0; letter-spacing: .5px; }
.chat-sys b { color: var(--amber); }

.vote-box { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 14px 22px; border-top: 1px solid var(--line); background: rgba(0,0,0,.15); max-height: 220px; overflow-y: auto; }
.vote-col h3 { font-size: 10px; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.vote-row { display: flex; justify-content: space-between; font-size: 11.5px; padding: 4px 0; border-bottom: 1px dashed rgba(255,255,255,.05); }
.vote-row .v { color: var(--amber); }
.vote-row .v.skip { color: var(--muted-2); }
.tally-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 11.5px; }
.tally-row .tname { width: 64px; flex: 0 0 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tally-bar { flex: 1; height: 8px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.tally-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #fbbf24, #ff8b5e); transition: width .5s ease; }
.tally-num { width: 20px; text-align: right; color: var(--amber); font-weight: 700; }

.meeting-result { padding: 16px 22px 20px; text-align: center; border-top: 1px solid var(--line); animation: fadeIn .3s ease; }
.meeting-result h3 { font-size: 16px; margin-bottom: 6px; }
.meeting-result p { font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.meeting-result .reveal { color: var(--red); font-weight: 700; }

/* ================= 结算 ================= */
.end-card {
  width: min(560px, 100%);
  text-align: center;
  background: linear-gradient(165deg, rgba(22, 30, 56, 0.98), rgba(9, 13, 26, 0.99));
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 34px 30px 26px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
  animation: cardIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.end-icon { font-size: 52px; margin-bottom: 6px; }
.end-card h1 { font-size: 24px; letter-spacing: 1px; margin-bottom: 8px; background: linear-gradient(90deg, #5eead4, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.end-roles { margin: 20px 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; text-align: left; }
.end-role { display: flex; align-items: center; gap: 8px; font-size: 11.5px; padding: 7px 10px; border-radius: 9px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.05); }
.end-role .avatar { width: 22px; height: 22px; font-size: 10px; }
.end-role .dead-mark { margin-left: auto; font-size: 10px; color: var(--muted-2); }
.end-actions { display: flex; gap: 10px; justify-content: center; }

/* ================= 单 AI 配置 ================= */
.chip.clickable { cursor: pointer; transition: border-color .15s, background .15s; }
.chip.clickable:hover { border-color: rgba(122, 158, 255, .55); background: rgba(122, 158, 255, .12); }
.chip.editing { border-color: #7a9eff; background: rgba(122, 158, 255, .18); box-shadow: 0 0 0 1px rgba(122, 158, 255, .35); }
.chip .cmodel {
  font-style: normal; font-size: 9.5px; color: #9db4e8;
  background: rgba(122, 158, 255, .12); border: 1px solid rgba(122, 158, 255, .25);
  padding: 1px 6px; border-radius: 999px; max-width: 110px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip .cbadge { font-style: normal; font-size: 10px; line-height: 1; }
.pcard .mtag {
  font-size: 9.5px; color: #9db4e8; background: rgba(122, 158, 255, .1);
  border: 1px solid rgba(122, 158, 255, .22); padding: 1px 7px; border-radius: 999px;
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 1;
}
.ai-editor {
  margin-top: 10px; padding: 12px 14px 14px; border-radius: 12px;
  background: rgba(122, 158, 255, .06); border: 1px solid rgba(122, 158, 255, .3);
  animation: cardIn .25s ease;
}
.ae-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; }
.ae-head .avatar { width: 24px; height: 24px; font-size: 11px; }
.ae-head .x { margin-left: auto; }
.ae-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.ae-grid .field.column span { font-size: 11px; }
.ae-grid input, .ae-grid select {
  background: rgba(10, 16, 32, .6); border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px; color: #e8eefc; padding: 7px 10px; font-size: 12px; width: 100%;
}
.ae-grid input:focus, .ae-grid select:focus { outline: none; border-color: rgba(122, 158, 255, .6); }
.ae-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.ae-foot .hint { margin: 0; font-size: 10.5px; }
.field.column span em { font-style: normal; color: var(--muted-2); font-size: 10px; margin-left: 4px; }
.field.column span em.ok { color: #5eead4; }
.btn.tiny { padding: 3px 10px; font-size: 10.5px; border-radius: 999px; }
#peClearKey { margin-top: 6px; }

/* ================= 滚动条 ================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(122, 158, 255, 0.18); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(122, 158, 255, 0.32); }

/* ================= 响应式 ================= */
@media (max-width: 1180px) {
  #game { grid-template-columns: 250px minmax(0, 1fr) 290px; }
  .brand { min-width: 0; }
  .brand-text small { display: none; }
  .statusbar { gap: 10px; }
  .taskbar-wrap { min-width: 130px; }
}

@media (max-width: 900px) {
  body { overflow: auto; }
  #topbar { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  #game { grid-template-columns: 1fr; grid-auto-rows: minmax(300px, auto); height: auto; }
  #mapWrap { min-height: 360px; }
  #playersPanel { max-height: 320px; }
  #logPanel { max-height: 300px; }
  .setup-body { grid-template-columns: 1fr; }
  .statusbar { order: 3; width: 100%; justify-content: flex-start; flex-wrap: wrap; }
}
