/* ===========================================================
   狼人杀 · 样式
   字体: Outfit (主) + JetBrains Mono (代码)
   主题: 深色 + 暖色强调（橙金 + 狼血红 + 月白）
   =========================================================== */

:root {
  --bg: #0e1217;
  --bg-2: #141a22;
  --panel: #1a2230;
  --panel-2: #202a3a;
  --line: #2a3548;
  --line-soft: #232c3a;
  --text: #e6ebf2;
  --text-dim: #9aa3b3;
  --text-faint: #6b7280;
  --accent: #f5a623;        /* 暖橙金 - 神职/管理员 */
  --accent-soft: rgba(245, 166, 35, 0.12);
  --blue: #4a9eff;          /* 好人 */
  --blue-soft: rgba(74, 158, 255, 0.12);
  --red: #e84a5f;           /* 狼人 */
  --red-soft: rgba(232, 74, 95, 0.12);
  --purple: #a47cff;        /* 预言家等神职 */
  --purple-soft: rgba(164, 124, 255, 0.14);
  --green: #4cd97b;         /* 成功 */
  --green-soft: rgba(76, 217, 123, 0.12);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-3: 0 8px 24px rgba(0, 0, 0, 0.4);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(74, 158, 255, 0.06), transparent),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(245, 166, 35, 0.04), transparent),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
code, pre, .mono { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; }
.hidden { display: none !important; }

/* ===========================================================
   顶部导航
   =========================================================== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  background: rgba(20, 26, 34, 0.85);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: linear-gradient(135deg, #1f1d1b 0%, #2d2620 100%);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 15px; font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.15);
}
.brand-text { color: var(--text); }

.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  color: var(--text-dim); text-decoration: none;
  font-size: 14px; font-weight: 500;
  padding: 6px 12px; border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.active { color: var(--accent); background: var(--accent-soft); }

.who-wrap { position: relative; margin-left: 4px; }
/* 关键:让 dropdown hover 触发,而不是默认展开 */
.who-wrap:hover .dropdown:not(.hidden),
.who-wrap:focus-within .dropdown:not(.hidden) {
  display: block;
  pointer-events: auto;
}
.dropdown {
  /* 默认隐藏 + 不响应鼠标,hover 时才显示 */
  display: none;
  pointer-events: none;
}
.dropdown.hidden { display: none !important; pointer-events: none; }
#who {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent) !important;
  font-size: 13px; font-weight: 500;
  padding: 6px 10px; border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
#who:hover { background: var(--accent-soft); }
#who .who-text { color: inherit; }
#who .ico { color: var(--accent); }

.dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 180px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 4px;
  box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; z-index: 200;
  overflow: hidden;
  animation: dropIn 0.15s ease-out;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.dropdown a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; color: var(--text-dim); text-decoration: none;
  font-size: 13px; font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.12s;
}
.dropdown a:hover { background: var(--panel-2); color: var(--text); }
.dropdown a .ico { color: var(--text-faint); flex-shrink: 0; }
.dropdown a:hover .ico { color: var(--accent); }

main { padding: 24px; max-width: 1200px; margin: 0 auto; }

/* ===========================================================
   通用按钮 / 输入
   =========================================================== */
button, .btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--blue); color: #fff; border: 0;
  padding: 8px 14px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; font-weight: 500;
  font-family: inherit; line-height: 1.2;
  transition: all 0.15s;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, var(--shadow-1);
}
button:hover, .btn:hover { background: #3d8be8; transform: translateY(-1px); box-shadow: var(--shadow-2); }
button:active, .btn:active { transform: translateY(0); }
button:disabled, .btn:disabled { background: var(--line); color: var(--text-faint); cursor: not-allowed; transform: none; box-shadow: none; }
button.secondary, .btn.secondary { background: var(--panel-2); color: var(--text); }
button.secondary:hover, .btn.secondary:hover { background: var(--line); }
button.danger, .btn.danger { background: var(--red); }
button.danger:hover, .btn.danger:hover { background: #d63a4f; }
button.ghost, .btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text-dim); }
button.ghost:hover, .btn.ghost:hover { background: var(--panel-2); color: var(--text); border-color: var(--text-faint); }

button .ico, .btn .ico { flex-shrink: 0; }

input, select, textarea {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  padding: 8px 12px; border-radius: var(--radius-sm); font-size: 14px;
  font-family: inherit;
  transition: all 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
textarea { width: 100%; min-height: 80px; resize: vertical; }

/* ===========================================================
   SVG 图标基础
   =========================================================== */
.ico {
  display: inline-block; vertical-align: -0.15em;
  color: currentColor;
  flex-shrink: 0;
}
.ico-chevron-down { color: var(--text-faint); }

/* ===========================================================
   首页 Hero 区
   =========================================================== */
.page-hero {
  position: relative;
  padding: 40px 36px 32px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(74, 158, 255, 0.08) 0%, rgba(164, 124, 255, 0.06) 50%, rgba(245, 166, 35, 0.05) 100%),
    var(--panel);
  border: 1px solid var(--line);
  margin-bottom: 20px;
  overflow: hidden;
}
.page-hero::before {
  content: ""; position: absolute; top: -50%; right: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(245, 166, 35, 0.10), transparent 70%);
  pointer-events: none;
}
.page-hero::after {
  content: ""; position: absolute; bottom: -60%; left: -10%;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(74, 158, 255, 0.08), transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px; font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero-eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.hero-title {
  font-size: 36px; font-weight: 700;
  margin: 0 0 8px; letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 0%, #b8c5d6 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 15px; color: var(--text-dim);
  margin: 0 0 20px; line-height: 1.5; max-width: 580px;
}
.hero-user {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  font-size: 13px;
}
.hero-user-avatar {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), #ff8a3d);
  border-radius: 50%;
  color: #000; font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.hero-user-info { display: flex; flex-direction: column; }
.hero-user-name { font-weight: 600; color: var(--text); font-size: 14px; }
.hero-user-role { color: var(--text-dim); font-size: 11px; }

/* 统计卡片 */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 20px;
}
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  transition: all 0.15s;
}
.stat-card:hover { border-color: var(--line); transform: translateY(-1px); }
.stat-card::before {
  content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 3px;
  background: var(--blue);
}
.stat-card.stat-waiting::before { background: var(--text-dim); }
.stat-card.stat-running::before { background: var(--green); animation: blink 1.5s infinite; }
.stat-card.stat-finished::before { background: var(--line); }
.stat-card.stat-total::before { background: var(--accent); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.stat-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--text-dim);
  margin-bottom: 10px;
}
.stat-card.stat-waiting .stat-icon { color: var(--text-dim); }
.stat-card.stat-running .stat-icon { color: var(--green); background: var(--green-soft); }
.stat-card.stat-finished .stat-icon { color: var(--text-faint); }
.stat-card.stat-total .stat-icon { color: var(--accent); background: var(--accent-soft); }
.stat-value {
  font-size: 28px; font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: -0.02em; line-height: 1;
}
.stat-label {
  font-size: 12px; color: var(--text-dim);
  margin-top: 4px;
  display: flex; align-items: center; gap: 4px;
}

/* 创建场次专用卡片 */
.create-card {
  padding: 24px 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
}
.create-card-title {
  font-size: 14px; font-weight: 600;
  color: var(--text); margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.create-card-title .ico { color: var(--accent); }
.create-card-sub { font-size: 12px; color: var(--text-dim); }
.create-card-form {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  flex: 1; justify-content: flex-end;
}
.create-card-form input, .create-card-form select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 12px; border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}
.create-card-form input { min-width: 160px; }
.create-card-form select { min-width: 180px; cursor: pointer; }
.create-card-form input:focus, .create-card-form select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.create-card-form button {
  padding: 8px 20px; font-size: 13px; font-weight: 600;
  background: linear-gradient(135deg, var(--accent), #ff8a3d);
  color: #1a0d00; border: none; border-radius: 6px;
  cursor: pointer; transition: all 0.12s;
}
.create-card-form button:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245, 166, 35, 0.3); }

@media (max-width: 700px) {
  .create-card { flex-direction: column; align-items: stretch; }
  .create-card-form { justify-content: stretch; }
  .create-card-form input, .create-card-form select, .create-card-form button { flex: 1; min-width: 0; }
  .page-hero { padding: 30px 20px 24px; }
  .hero-title { font-size: 28px; }
}

/* ===========================================================
   场次列表卡片
   =========================================================== */
.page-title { font-size: 20px; font-weight: 600; margin: 0 0 16px; letter-spacing: -0.01em; }
.page-sub { color: var(--text-dim); font-size: 13px; margin: -8px 0 16px; }

.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 0 14px;
}
.section-title-text {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 600;
  color: var(--text);
}
.section-title-text .ico { color: var(--accent); }
.section-title-count {
  font-size: 12px; color: var(--text-dim);
  font-family: "JetBrains Mono", monospace;
}

.room-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px; margin-top: 4px;
}
.room-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  overflow: hidden;
  cursor: default;
}
.room-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--accent) 100%);
  opacity: 0.6; transition: opacity 0.2s;
}
.room-card.running::before { background: linear-gradient(90deg, var(--accent) 0%, var(--green) 100%); opacity: 1; }
.room-card.finished::before { background: linear-gradient(90deg, var(--line) 0%, var(--text-faint) 100%); opacity: 0.4; }
.room-card.waiting::before { background: linear-gradient(90deg, var(--blue) 0%, var(--purple) 100%); opacity: 0.8; }
.room-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(245, 166, 35, 0.15);
  border-color: rgba(245, 166, 35, 0.3);
}

.room-card-inner { padding: 20px 22px 18px; }

.room-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.room-card-title {
  font-size: 17px; font-weight: 600;
  margin: 0; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 0;
}
.room-card-title-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.room-card-id {
  font-size: 10px; color: var(--text-faint);
  font-family: "JetBrains Mono", monospace;
  background: var(--bg-2);
  padding: 2px 6px; border-radius: 3px;
  flex-shrink: 0;
}
.room-card-meta {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
  font-size: 12px; color: var(--text-dim); margin-bottom: 14px;
}
.room-card-meta-item { display: inline-flex; align-items: center; gap: 4px; }

.room-card-progress {
  margin: 14px 0;
  padding: 10px 12px;
  background: var(--bg-2);
  border-radius: 6px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text-dim);
}
.room-card-progress-bar {
  flex: 1; height: 6px;
  background: var(--line-soft);
  border-radius: 3px;
  overflow: hidden;
}
.room-card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--accent));
  border-radius: 3px;
  transition: width 0.3s;
}
.room-card-progress-text {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  color: var(--text);
  min-width: 60px; text-align: right;
}

.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.3px;
}
.status-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.status-running::before { animation: blink 1.5s infinite; }
.status-waiting { background: var(--blue-soft); color: var(--blue); }
.status-running { background: var(--green-soft); color: var(--green); }
.status-finished { background: var(--line-soft); color: var(--text-faint); }

.seat-mini { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; }
.seat-mini .chip {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-2); border: 1px solid var(--line-soft);
  border-radius: 6px; font-size: 11px; color: var(--text-faint);
  font-family: "JetBrains Mono", monospace;
  transition: all 0.15s;
  position: relative;
}
.seat-mini .chip.taken { background: var(--blue-soft); color: var(--blue); border-color: rgba(74, 158, 255, 0.4); }
.seat-mini .chip.taken.ai { background: var(--purple-soft); color: var(--purple); border-color: rgba(164, 124, 255, 0.4); }
.seat-mini .chip.taken.ai::after {
  content: "AI"; position: absolute; top: -3px; right: -3px;
  background: var(--purple); color: #fff;
  font-size: 7px; padding: 1px 3px; border-radius: 3px;
  font-weight: 700; letter-spacing: 0.3px;
}
.seat-mini .chip.dead { background: var(--line-soft); color: var(--text-faint); text-decoration: line-through; opacity: 0.5; }
.seat-mini .chip:hover { transform: scale(1.1); }

.room-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.room-actions button {
  flex: 1; min-width: 100px;
  padding: 8px 14px; font-size: 12px; font-weight: 500;
  border-radius: 6px;
  transition: all 0.12s;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.room-actions button.primary {
  background: linear-gradient(135deg, var(--accent), #ff8a3d);
  color: #1a0d00; border: none;
}
.room-actions button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 166, 35, 0.3);
}
.room-actions button.danger {
  background: transparent; color: var(--red);
  border: 1px solid rgba(232, 74, 95, 0.3);
}
.room-actions button.danger:hover { background: var(--red-soft); border-color: var(--red); }
.room-actions button:not(.primary):not(.danger) {
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line);
}
.room-actions button:not(.primary):not(.danger):hover {
  background: var(--panel-2); border-color: var(--line);
}

/* 管理员看到的场次卡:加个提示边框 */
.room-card.admin-room-card { border-color: rgba(245, 166, 35, 0.25); }
.admin-mark {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 10px; font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.5px;
}

/* 空状态 */
.empty-state {
  padding: 60px 30px;
  text-align: center;
  background: var(--panel);
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
}
.empty-state-icon {
  width: 72px; height: 72px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--accent);
  border: 1px solid var(--line);
}
.empty-state-title {
  font-size: 18px; font-weight: 600; color: var(--text);
  margin: 0 0 8px;
}
.empty-state-sub {
  font-size: 13px; color: var(--text-dim);
  max-width: 400px; margin: 0 auto;
  line-height: 1.5;
}
.empty-state-cta {
  margin-top: 20px;
}

/* ===========================================================
   房间页头
   =========================================================== */
.room-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 18px 22px; border-radius: var(--radius);
  margin-bottom: 14px;
}
.room-title { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.room-info {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: 12px; color: var(--text-dim); margin-top: 8px; align-items: center;
}
.room-info .badge {
  background: var(--panel-2); color: var(--text);
  padding: 3px 8px; border-radius: 4px;
  font-family: "JetBrains Mono", monospace; font-size: 11px;
}
.room-info .badge.accent { background: var(--accent-soft); color: var(--accent); }
.room-info .badge.blue { background: var(--blue-soft); color: var(--blue); }

.you-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 14px 18px; border-radius: var(--radius);
  margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center;
}
.you-card .role { font-size: 18px; font-weight: 600; color: var(--accent); }
.you-card .role.wolf { color: var(--red); }
.you-card .role.good { color: var(--blue); }

/* ===========================================================
   房间布局: 左侧座位 + 右侧游戏
   =========================================================== */
.room-layout {
  display: grid; grid-template-columns: 340px 1fr; gap: 14px;
}
@media (max-width: 900px) { .room-layout { grid-template-columns: 1fr; } }

.seat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 14px; border-radius: var(--radius);
}
.seat-cell {
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px 8px; text-align: center; cursor: pointer;
  transition: all 0.15s; position: relative;
}
.seat-cell:hover { border-color: var(--blue); transform: translateY(-1px); }
.seat-cell.taken { background: var(--blue-soft); border-color: var(--blue); cursor: default; }
.seat-cell.ai { background: var(--purple-soft); border-color: var(--purple); }
.seat-cell.dead { opacity: 0.45; filter: grayscale(0.6); }
.seat-cell.dead .name { text-decoration: line-through; }
.seat-cell.you { background: var(--green-soft); border-color: var(--green); }
.seat-cell.admin { box-shadow: 0 0 0 2px var(--accent); }
.seat-cell.revealed { box-shadow: 0 0 0 2px var(--accent); }
.seat-cell .num {
  font-size: 10px; color: var(--text-faint);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.05em;
}
.seat-cell .name { font-size: 13px; font-weight: 500; margin-top: 4px; color: var(--text); }
.seat-cell .meta { font-size: 10px; color: var(--text-faint); margin-top: 4px; }

.game-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  /* 游戏面板自身高度 = 视口 - 顶栏(约 60px),确保有足够滚动空间 */
  max-height: calc(100vh - 80px);
  min-height: 420px;
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; min-height: 540px;
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); margin-bottom: 12px; }
.tab {
  padding: 8px 14px; cursor: pointer;
  color: var(--text-dim); font-size: 13px; font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.msg-list {
  flex: 1 1 auto;
  min-height: 0;                       /* 关键:让 flex 容器能缩到比内容小,触发 overflow */
  overflow-y: auto; padding: 4px;
  overscroll-behavior: contain;        /* 防止 wheel 事件冒泡到外层 body */
  scrollbar-gutter: stable;            /* 占位滚动条,避免内容抖动 */
  scrollbar-width: thin;               /* Firefox: 细滚动条 */
  scrollbar-color: var(--line) var(--bg-2);
}
/* WebKit 滚动条 — 显眼可见 */
.msg-list::-webkit-scrollbar { width: 10px; }
.msg-list::-webkit-scrollbar-track { background: var(--bg-2); border-radius: 5px; }
.msg-list::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 5px;
  border: 2px solid var(--bg-2);
  min-height: 30px;
}
.msg-list::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.msg {
  padding: 9px 12px; margin-bottom: 6px;
  border-radius: var(--radius-sm);
  font-size: 14px; line-height: 1.5;
  border-left: 3px solid transparent;
}
.msg.speak { background: var(--bg-2); border-left-color: var(--line); }
.msg.announce { background: rgba(245, 166, 35, 0.08); color: var(--accent); border-left-color: var(--accent); font-weight: 500; }
.msg.system { background: var(--bg-2); color: var(--text-faint); font-style: italic; border-left-color: transparent; }
.msg.night_action { background: rgba(164, 124, 255, 0.08); color: var(--purple); border-left-color: var(--purple); }
.msg.vote { background: var(--blue-soft); color: var(--blue); border-left-color: var(--blue); }
.msg.result { background: rgba(232, 74, 95, 0.12); color: var(--red); border-left-color: var(--red); font-weight: 600; }
.msg .who { font-size: 12px; color: var(--text-faint); margin-bottom: 2px; }
.msg .who .badge { background: var(--panel-2); color: var(--text); padding: 1px 6px; border-radius: 3px; font-size: 10px; margin-right: 4px; font-family: "JetBrains Mono", monospace; }

/* ===========================================================
   游戏结束 (finished 阶段)
   =========================================================== */
.game-finish-banner {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px;
  border-radius: 10px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.game-finish-banner.good-win {
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.18) 0%, rgba(76, 217, 123, 0.12) 100%);
  border: 1px solid var(--blue);
  color: var(--blue);
}
.game-finish-banner.wolf-win {
  background: linear-gradient(135deg, rgba(232, 74, 95, 0.18) 0%, rgba(232, 74, 95, 0.08) 100%);
  border: 1px solid var(--red);
  color: var(--red);
}
.finish-icon { flex-shrink: 0; }
.game-finish-banner.good-win .finish-icon { color: var(--blue); }
.game-finish-banner.wolf-win .finish-icon { color: var(--red); }
.finish-title { font-size: 22px; font-weight: 700; line-height: 1.2; }
.finish-sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

.finish-reveal {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.finish-reveal-title {
  font-size: 13px; font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 6px;
}

.finish-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.finish-actions button { flex: 0 1 auto; }
.finish-actions button.primary { flex: 1 1 200px; }   /* 重新开始 / 返回 撑满 */

.action-panel {
  border-top: 1px solid var(--line-soft);
  padding-top: 14px; margin-top: 14px;
  flex-shrink: 0;                     /* flex column 中操作面板不滚 */
  background: var(--panel);
}

/* 投票进度 */
.vote-progress-text {
  font-size: 13px; color: var(--text);
  margin: 6px 0 10px;
  padding: 6px 10px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  display: flex; align-items: center; gap: 6px;
}
.vote-stats {
  font-size: 12px; color: var(--text-dim);
  margin: 6px 0 10px;
  padding: 4px 8px;
  background: var(--bg-2);
  border-left: 2px solid var(--accent);
  border-radius: 3px;
}
.vote-status-list {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin: 8px 0 12px;
  font-size: 12px;
}
.vote-status-row {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
}
.vote-status-row.me {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.vote-status-seat {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-faint);
  min-width: 28px;
}
.vote-status-name {
  flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vote-status-yes { color: #4cd97b; display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.vote-status-yes .ico { stroke: #4cd97b; }
.vote-status-pending { color: var(--text-faint); font-size: 11px; }
.vote-status-no { color: #d97706; font-size: 11px; }
@media (max-width: 640px) {
  .vote-status-list { grid-template-columns: 1fr; }
}

/* ===========================================================
   角色条(对话栏上方) - 身份分配一目了然
   =========================================================== */
.role-strip {
  display: grid; grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  margin-bottom: 8px;
  padding: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  flex-shrink: 0;                     /* 关键:game-panel flex column 时不被压缩 */
}
.role-strip:empty { display: none; }  /* waiting 时不显示,不留空 */
.role-chip {
  text-align: center; padding: 5px 2px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.3;
  position: relative;
  min-width: 0;       /* 允许内容超出收缩 */
  overflow: hidden;
}
.role-chip-num {
  font-family: "JetBrains Mono", monospace; font-size: 9px;
  color: var(--text-faint);
}
.role-chip-name {
  font-size: 11px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.role-chip-role {
  font-size: 10px; font-weight: 600; margin-top: 1px;
  font-family: "JetBrains Mono", monospace;
}
.role-chip.me {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 8px rgba(245, 166, 35, 0.18);
  background: var(--accent-soft);
}
.role-chip.dead {
  opacity: 0.4;
  background: #1a1d24;
  text-decoration: line-through;
}
.role-chip.dead .role-chip-num,
.role-chip.dead .role-chip-name { text-decoration: line-through; }
.role-chip.ai::after {
  content: "AI"; position: absolute; top: 1px; right: 3px;
  font-size: 8px; color: var(--purple);
  font-family: "JetBrains Mono", monospace;
}
@media (max-width: 900px) {
  .role-strip { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 640px) {
  .role-strip { grid-template-columns: repeat(6, 1fr); gap: 3px; padding: 4px; }
  .role-chip { padding: 3px 1px; }
  .role-chip-name { font-size: 10px; }
  .role-chip-role { font-size: 9px; }
}

/* ===========================================================
   我的私密信息(普通玩家,对话栏上方)
   只显示跟自己角色相关的夜晚行动
   =========================================================== */
.my-private-box {
  background: var(--purple-soft);
  border: 1px solid var(--purple);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 12px;
  flex-shrink: 0;                     /* flex column 中不被压缩 */
}
.my-private-title {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px;
  color: var(--purple);
  font-size: 12px;
}
.my-private-title .ico { color: var(--purple); }
.my-private-title strong { color: var(--purple); font-weight: 600; }
.my-private-round {
  margin: 4px 0;
  padding: 4px 6px;
  background: rgba(0,0,0,0.18);
  border-radius: 3px;
}
.my-private-round-num {
  font-size: 11px; color: var(--accent);
  font-weight: 600; margin-bottom: 2px;
  font-family: "JetBrains Mono", monospace;
}
.my-private-row {
  font-size: 12px; padding: 2px 0;
  display: flex; align-items: center; gap: 6px;
  color: var(--text);
}
.action-tag {
  display: inline-block;
  padding: 1px 6px; border-radius: 3px;
  font-size: 10px; color: #fff;
  font-family: "JetBrains Mono", monospace;
  min-width: 36px; text-align: center;
}
.targets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.target-chip {
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  padding: 7px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px;
  transition: all 0.12s;
}
.target-chip:hover { background: var(--panel-2); border-color: var(--blue); }
.target-chip.selected { background: var(--blue); color: #fff; border-color: var(--blue); }
.target-chip.disabled { opacity: 0.35; cursor: not-allowed; }
.action-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }

/* ===========================================================
   管理员 / 观察者
   =========================================================== */
.admin-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 18px 20px; border-radius: var(--radius);
  margin-bottom: 14px;
}
.admin-panel h2 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 14px; font-size: 16px; font-weight: 600;
}
.admin-panel h2 .ico { color: var(--accent); }
.form-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.form-row label { min-width: 80px; color: var(--text-dim); font-size: 13px; }

.observer-banner {
  display: flex; gap: 14px; align-items: center;
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--accent);
  padding: 14px 18px; border-radius: var(--radius);
  margin-bottom: 14px;
  box-shadow: 0 0 24px rgba(245, 166, 35, 0.08);
}
.observer-banner .ico { color: var(--accent); width: 32px; height: 32px; }
.observer-title { font-size: 15px; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.observer-hint { font-size: 12px; color: var(--text-dim); line-height: 1.5; }

/* ====== 全知视角(可折叠) ====== */
.omni-view { padding: 14px 18px; flex-shrink: 0; }
.omni-title {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}
.omni-title:hover { color: var(--accent); }
.omni-title h2 { flex: 0 0 auto; }
.omni-toggle-text { transition: color 0.15s; }
.omni-title:hover .omni-toggle-text { color: var(--accent); }
.omni-body {
  max-height: 5000px;
  overflow: hidden;
  transition: max-height 0.25s ease;
  margin-top: 8px;
}
.omni-body.collapsed {
  max-height: 0;
  margin-top: 0;
}
.omni-section-title {
  font-size: 13px; font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 4px;
}
.omni-section-title .ico { color: var(--accent); }

/* 身份总览 */
.role-overview-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px; font-size: 12px;
}
.role-overview-row {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px;
  background: #0f1419;
  border-radius: 4px;
  border-left: 3px solid var(--line);
}
.role-overview-row.dead { opacity: 0.45; text-decoration: line-through; }
.ro-seat {
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  color: var(--text-faint); flex-shrink: 0;
  min-width: 28px;
}
.ro-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ro-role { font-weight: 700; font-family: "JetBrains Mono", monospace; font-size: 11px; }
.ro-tag { font-size: 9px; color: var(--text-faint); padding: 1px 4px; background: #1a1d24; border-radius: 2px; flex-shrink: 0; text-decoration: none; }

/* 夜晚行动 / 投票明细 - 公共 round 框 */
.omni-round-box {
  margin-bottom: 8px;
  padding: 8px 10px;
  background: #0f1419;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}
.omni-round-num {
  font-size: 12px; color: var(--accent);
  font-weight: 600; margin-bottom: 6px;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.05em;
}

/* 夜晚行动行 */
.omni-action-row {
  font-size: 12px;
  padding: 3px 0;
  display: flex; align-items: center; gap: 4px;
  flex-wrap: wrap;
}
.omni-action-tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: 3px;
  color: #fff; font-size: 10px;
  font-family: "JetBrains Mono", monospace;
  min-width: 64px; justify-content: center;
  margin-right: 4px;
  flex-shrink: 0;
}
.omni-action-tag .ico { color: #fff; }
.omni-result {
  font-weight: 700; font-family: "JetBrains Mono", monospace;
  font-size: 11px; margin-left: 4px;
}

/* 投票明细行 */
.omni-vote-row {
  font-size: 12px; padding: 2px 0;
  display: flex; align-items: center; gap: 4px;
}
.omni-vote-row strong { font-family: "JetBrains Mono", monospace; }
.omni-tally {
  font-size: 11px; color: var(--text-dim);
  margin-top: 4px; padding-top: 4px;
  border-top: 1px dashed var(--line-soft);
}
.omni-tally-live {
  font-size: 12px; padding: 3px 0;
  display: flex; align-items: center; gap: 4px;
}
.tally-bar {
  font-family: "JetBrains Mono", monospace;
  letter-spacing: -1px;
  font-size: 12px;
}
.role-list {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px; font-size: 12px;
}

/* ===========================================================
   AI 设置
   =========================================================== */
.ai-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}
.ai-card:hover { border-color: var(--text-faint); }
.ai-card.default { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.ai-card h4 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.ai-card .meta { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }

/* ===========================================================
   Toast & Modal
   =========================================================== */
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  background: var(--panel); color: var(--text);
  padding: 10px 20px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); z-index: 200;
  box-shadow: var(--shadow-3);
  font-size: 13px; font-weight: 500;
  animation: toastIn 0.2s ease-out;
}
.toast.error { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.toast.success { background: var(--green-soft); border-color: var(--green); color: var(--green); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; animation: modalIn 0.18s ease-out; }
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }
.modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px); }
.modal-body {
  position: relative; background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  width: 92%; max-width: 520px; max-height: 80vh; overflow-y: auto;
  box-shadow: var(--shadow-3);
}
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.modal-title .ico { color: var(--accent); }
.modal-content { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

.empty {
  text-align: center; color: var(--text-dim);
  padding: 40px 0; font-size: 13px;
}

.role-tag {
  padding: 2px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 500; margin-left: 4px;
  font-family: "JetBrains Mono", monospace;
}
.role-tag.werewolf { background: var(--red-soft); color: var(--red); }
.role-tag.good { background: var(--blue-soft); color: var(--blue); }
.role-tag.special { background: var(--purple-soft); color: var(--purple); }

.ai-thinking {
  display: flex; align-items: center; gap: 8px;
  background: rgba(164, 124, 255, 0.08);
  border-left: 3px solid var(--purple);
  padding: 6px 12px; margin-bottom: 8px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--purple);
}
.spinner {
  width: 12px; height: 12px;
  border: 2px solid var(--purple);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ===========================================================
   登录 / 注册
   =========================================================== */
.auth-card {
  max-width: 380px; margin: 80px auto; background: var(--panel);
  border: 1px solid var(--line);
  padding: 32px 30px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
}
.auth-card h2 {
  margin: 0 0 20px; font-size: 24px; font-weight: 600;
  text-align: center; letter-spacing: -0.01em;
}
.auth-card .form-row { flex-direction: column; align-items: stretch; }
.auth-card .form-row label { min-width: 0; color: var(--text); font-weight: 500; }
.auth-card .form-row button { width: 100%; justify-content: center; padding: 10px; font-size: 14px; }
.auth-card code { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; color: var(--accent); }
.auth-card .meta { font-size: 12px; color: var(--text-dim); text-align: center; margin-top: 14px; }
.auth-card .meta a { color: var(--blue); text-decoration: none; }
.auth-card .meta a:hover { text-decoration: underline; }
.auth-card .brand-mark { margin: 0 auto 14px; width: 44px; height: 44px; font-size: 20px; }

/* 发言倒计时 */
.speak-countdown {
  text-align: center; padding: 6px;
  font-size: 12px; font-weight: 600;
  color: var(--accent); margin-bottom: 8px;
  font-family: "JetBrains Mono", monospace;
}

/* PK 候选高亮 */
.seat-cell.pk-candidate {
  box-shadow: 0 0 0 2px var(--accent);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 2px var(--accent); } 50% { box-shadow: 0 0 0 4px var(--accent), 0 0 12px var(--accent-soft); } }

.phase-cd { margin-left: 4px; font-size: 11px; color: var(--text-dim); font-family: "JetBrains Mono", monospace; }

/* ===========================================================
   管理员场次管理
   =========================================================== */
.admin-room-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: all 0.15s;
}
.admin-room-row:hover { border-color: var(--text-faint); }
.admin-room-info { flex: 1; min-width: 0; }
.admin-room-name { font-size: 14px; font-weight: 500; margin-bottom: 4px; word-break: break-all; }
.admin-room-meta {
  font-size: 12px; color: var(--text-dim);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.admin-room-actions { display: flex; gap: 6px; flex-shrink: 0; margin-left: 12px; }
.admin-room-actions button { padding: 5px 10px; font-size: 12px; }

/* 编辑座位弹窗 */
.edit-seats-box { max-height: 60vh; overflow-y: auto; }
.edit-seat-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;          /* 12人时换行,不被挤出去 */
}
.edit-seat-row:last-child { border-bottom: 0; }
.edit-seat-label { width: 36px; font-weight: 600; color: var(--accent); flex-shrink: 0; font-family: "JetBrains Mono", monospace; }
.edit-seat-ai { font-size: 12px; color: var(--text-dim); flex-shrink: 0; }

.edit-seat-row input[type=text] { flex: 1 1 100px; min-width: 100px; }
.edit-seat-row .prof-select {
  flex-shrink: 0; min-width: 160px;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
}
.model-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--purple-soft);
  color: var(--purple);
  border: 1px solid var(--purple);
  padding: 2px 8px; border-radius: 12px;
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden; text-overflow: ellipsis;
}
.model-badge .ico { color: var(--purple); flex-shrink: 0; }

.edit-seats-hint {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-dim);
  margin-top: 10px;
}
.btn-tiny {
  padding: 3px 8px !important; font-size: 12px !important;
  display: inline-flex; align-items: center; gap: 4px;
}

/* 快速新建 AI 模型弹窗 */
.qf-label {
  display: block; font-size: 12px; color: var(--text-dim);
  margin: 4px 0 4px;
}
.qf-check {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; margin-top: 4px;
}

/* ===========================================================
   响应式 — 平板
   =========================================================== */
@media (max-width: 900px) {
  .room-layout { grid-template-columns: 1fr; }
  .room-layout > div:first-child { order: 1; }
  .room-layout > div:last-child { order: 2; }
  .game-panel { min-height: 400px; }
}

/* ===========================================================
   响应式 — 手机 (核心)
   =========================================================== */
@media (max-width: 640px) {
  /* 顶栏紧凑 */
  .topbar { padding: 10px 12px; }
  .brand-text { display: none; }
  .brand { gap: 8px; }
  .nav a { padding: 6px 8px; font-size: 13px; }
  .nav { gap: 0; }
  .dropdown { right: -8px; min-width: 160px; }
  .who-wrap { margin-left: 0; }

  /* 主体紧凑 */
  main { padding: 12px; }
  .page-title { font-size: 17px; margin-bottom: 10px; }

  /* 房间卡片:1列 */
  .room-grid { grid-template-columns: 1fr; gap: 10px; }
  .room-card { padding: 14px; }
  .room-card h3 { font-size: 15px; }
  .seat-mini .chip { width: 22px; height: 22px; font-size: 10px; }

  /* 房间头:更紧凑 */
  .room-header { padding: 12px 14px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .room-title { font-size: 17px; }
  .room-info { font-size: 11px; gap: 4px; }
  .room-info .badge { padding: 2px 6px; font-size: 10px; }

  /* 你的信息卡 */
  .you-card { padding: 10px 14px; font-size: 13px; flex-direction: column; align-items: flex-start; gap: 6px; }

  /* 房间布局:堆叠 */
  .room-layout { grid-template-columns: 1fr; gap: 10px; }
  .seat-grid { padding: 10px; gap: 6px; }
  /* 12人板手机:3列 x 4 行 */
  .seat-cell { padding: 6px 4px; min-height: 56px; }
  .seat-cell .name { font-size: 12px; }
  .seat-cell .num { font-size: 9px; }
  .seat-cell .meta { display: none; }  /* 座位副信息隐藏 */

  /* 游戏面板 */
  .game-panel { padding: 12px; min-height: 360px; }
  .tabs { gap: 2px; }
  .tab { padding: 6px 10px; font-size: 12px; }
  .msg { padding: 7px 10px; font-size: 13px; }
  .game-panel { max-height: calc(100vh - 70px); }
  .action-panel { padding-top: 10px; margin-top: 10px; }
  .target-chip { padding: 6px 10px; font-size: 12px; }

  /* 管理员控制台 */
  .admin-panel { padding: 14px; }
  .admin-panel h2 { font-size: 15px; }
  .form-row { flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
  .form-row label { min-width: 60px; font-size: 12px; }
  .form-row input, .form-row select, .form-row textarea { font-size: 14px; }

  .admin-room-row { flex-direction: column; align-items: flex-start; padding: 10px 12px; }
  .admin-room-actions { margin-left: 0; margin-top: 8px; flex-wrap: wrap; }
  .admin-room-actions button { padding: 5px 10px; font-size: 11px; }

  /* 观察者横幅简化 */
  .observer-banner { padding: 10px 14px; gap: 10px; }
  .observer-banner .ico { width: 24px; height: 24px; }
  .observer-title { font-size: 14px; }
  .observer-hint { font-size: 11px; line-height: 1.4; }

  /* 全知视角 */
  .role-list { grid-template-columns: 1fr 1fr !important; gap: 6px !important; }
  .omni-body { max-height: 2000px; }  /* 手机端 max-height 调大,内容能展开 */
  .omni-body.collapsed { max-height: 0; }

  /* 按钮紧凑 */
  button, .btn { padding: 7px 12px; font-size: 12px; }
  .room-actions button { padding: 5px 10px; font-size: 11px; }

  /* 登录注册卡:全宽 */
  .auth-card { margin: 30px 12px; padding: 24px 20px; }
  .auth-card h2 { font-size: 20px; }

  /* 模态框全宽 */
  .modal-body { width: 96%; padding: 18px 16px; }
  .modal-title { font-size: 15px; }
  .modal-actions { flex-wrap: wrap; }

  /* toast */
  .toast { font-size: 12px; padding: 8px 14px; top: 56px; max-width: 90vw; }
}

/* 极小屏 (iPhone SE 等) */
@media (max-width: 380px) {
  .seat-grid { grid-template-columns: repeat(3, 1fr); }
  .seat-cell { min-height: 50px; padding: 4px 2px; }
  .seat-cell .name { font-size: 11px; }
  .nav a { padding: 4px 6px; font-size: 12px; }
}
