/* AI 酒馆 SaaS 共用样式：浅色 + 二次元（圆角卡片 / 柔和阴影 / 粉蓝渐变点缀）。
   没有构建链，所有页面直接引这一份，颜色统一走变量，避免各页各写一套。 */

:root {
  --bg: #f6f8fc;
  --card: #ffffff;
  --pri: #4f8cff;
  --pri-dark: #3a72e0;
  --pri-soft: #eaf2ff;
  --pink: #ff9ecb;
  --pink-soft: #fff0f7;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e7ecf6;
  --ok: #2fb27c;
  --warn: #e8a13a;
  --danger: #ef5b6b;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(79, 140, 255, .10), 0 1px 3px rgba(31, 36, 48, .04);
  --shadow-lg: 0 18px 50px rgba(79, 140, 255, .18);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 背景里的两团柔光：纯 CSS，不额外请求图片 */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 60vh;
  background:
    radial-gradient(closest-side, rgba(255, 158, 203, .22), transparent 70%) 15% 20%/46vw 46vw no-repeat,
    radial-gradient(closest-side, rgba(79, 140, 255, .18), transparent 70%) 80% 0/52vw 52vw no-repeat;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--pri); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: .2px; }
p { margin: 0; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace; }

/* ---------------------------------------------------------------- 导航 */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 16px;
  color: var(--ink);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--pri), var(--pink));
  box-shadow: 0 4px 12px rgba(79, 140, 255, .35);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.nav-links { display: flex; align-items: center; gap: 4px; }

.nav-link {
  padding: 7px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}
.nav-link:hover { background: var(--pri-soft); color: var(--pri); text-decoration: none; }
.nav-link.active { background: var(--pri-soft); color: var(--pri); }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.credits-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff2f8, #eef4ff);
  border: 1px solid #f0e2ee;
  font-weight: 700;
  font-size: 13px;
  color: #b0487e;
}

/* ---------------------------------------------------------------- 布局 */
.container { max-width: 1200px; margin: 0 auto; padding: 22px 20px 60px; position: relative; z-index: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-title { font-size: 22px; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card + .card { margin-top: 16px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card-title .dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--pri), var(--pink)); }

.announce {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef4ff, #fff4fa);
  border: 1px solid #e6edfb;
  color: #3c4a63;
  font-size: 13px;
  margin-bottom: 16px;
}
.announce b { color: var(--pri); }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  background: var(--pri);
  color: #fff;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  box-shadow: 0 4px 12px rgba(79, 140, 255, .28);
  white-space: nowrap;
}
.btn:hover { background: var(--pri-dark); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}
.btn.ghost:hover { border-color: #cfdcf5; background: #f8fbff; color: var(--pri); }

.btn.pink { background: linear-gradient(135deg, #ff9ecb, #ffb3d6); box-shadow: 0 4px 14px rgba(255, 158, 203, .4); }
.btn.pink:hover { background: linear-gradient(135deg, #ff8fc2, #ffa6cd); }

.btn.danger { background: var(--danger); box-shadow: 0 4px 12px rgba(239, 91, 107, .3); }
.btn.danger:hover { background: #e04b5b; }

.btn.sm { padding: 5px 11px; font-size: 12px; border-radius: 9px; }
.btn.block { display: block; width: 100%; }
.btn.lg { padding: 11px 22px; font-size: 14px; border-radius: 12px; }

/* ---------------------------------------------------------------- 表单 */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12px; font-weight: 700; color: #4b5563; margin-bottom: 6px; }
.hint { font-size: 11px; color: var(--muted); margin-top: 5px; }

.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcff;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: #a9c6ff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 140, 255, .12);
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.65; }
.input:disabled, .select:disabled, .textarea:disabled { background: #f3f5fa; color: #9aa3b2; cursor: not-allowed; }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: #4b5563; cursor: pointer; user-select: none; }
.check input { width: 15px; height: 15px; accent-color: var(--pri); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }

.error-box {
  background: #fff2f3;
  border: 1px solid #ffd9dd;
  color: #c43c4c;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 12px;
}

/* ---------------------------------------------------------------- 徽标 / 标签 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #f1f4fa;
  color: #5b6475;
  white-space: nowrap;
}
.badge.pri { background: var(--pri-soft); color: var(--pri); }
.badge.pink { background: var(--pink-soft); color: #c25a8c; }
.badge.ok { background: #e9f8f1; color: #218a60; }
.badge.warn { background: #fff6e7; color: #b07316; }
.badge.danger { background: #fff0f1; color: #c43c4c; }

.tag {
  display: inline-block;
  padding: 1px 8px;
  margin: 2px 4px 2px 0;
  border-radius: 7px;
  background: #f3f6fd;
  color: #6b7a92;
  font-size: 11px;
}

/* ---------------------------------------------------------------- 广场 */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .select { width: auto; min-width: 130px; }
.filter-bar .input { width: 150px; }

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 16px;
}

.room-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  cursor: pointer;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.room-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #dbe7ff; }
.room-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--pri), var(--pink));
  opacity: .75;
}
.room-card.playing::before { background: linear-gradient(90deg, #9b7bff, var(--pink)); }

.room-card h3 { font-size: 15px; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.room-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.seat-dots { display: flex; gap: 3px; flex-wrap: wrap; }
.seat-dot { width: 8px; height: 8px; border-radius: 50%; background: #e3e9f5; }
.seat-dot.on { background: linear-gradient(135deg, var(--pri), var(--pink)); }

.empty {
  padding: 50px 20px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 1px dashed #dbe4f4;
  border-radius: var(--radius);
  font-size: 13px;
}

/* ---------------------------------------------------------------- 房间页 */
.room-layout {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.seat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.seat {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcff;
  padding: 9px 8px;
  min-height: 78px;
  text-align: center;
  font-size: 12px;
  transition: all .15s ease;
}
.seat .seat-no { font-size: 10px; color: #9aa3b2; font-weight: 700; }
.seat .seat-name {
  font-weight: 700;
  font-size: 12.5px;
  margin-top: 2px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}
.seat .seat-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.seat.empty-slot { cursor: pointer; border-style: dashed; color: #9aa3b2; }
.seat.empty-slot:hover { border-color: var(--pri); background: var(--pri-soft); color: var(--pri); }
.seat.mine { border-color: var(--pri); background: linear-gradient(160deg, #f2f7ff, #fff); box-shadow: 0 0 0 2px rgba(79, 140, 255, .12); }
.seat.ready .seat-name::after { content: " ✓"; color: var(--ok); }
.seat.dead { opacity: .55; filter: grayscale(1); }
.seat.selectable { cursor: crosshair; border-color: var(--pink); background: var(--pink-soft); }
.seat.selectable:hover { background: #ffe4f1; }
.seat.host::after {
  content: "房主";
  position: absolute;
  top: -7px; right: -4px;
  background: linear-gradient(135deg, #ffc857, #ff9ecb);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(255, 158, 203, .5);
}

.chat-box { display: flex; flex-direction: column; gap: 8px; }
.chat-log {
  height: 220px;
  overflow-y: auto;
  background: #fbfcff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-line { word-break: break-word; }
.chat-line .who { font-weight: 700; color: var(--pri); margin-right: 6px; }
.chat-line.sys { color: var(--muted); font-style: normal; }
.chat-line.sys .who { color: var(--pink); }

.stage-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #2a2140;   /* 舞台自身的夜色底，加载瞬间不闪白 */
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}
/* 舞台是 1920×1080 的固定画布（和主播端 OBS 同一套构图），
   由 fitStage() 算出缩放比例后整体 transform，不靠 iframe 内部自适应 */
.stage-wrap iframe {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  border: 0;
  display: block;
  transform-origin: 0 0;
  background: #2a2140;
}
.stage-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 20px;
}

.phase-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f4f8ff, #fff6fb);
  border: 1px solid #e8eefb;
  margin-bottom: 12px;
}
.phase-name { font-weight: 800; font-size: 15px; }
.countdown { font-family: ui-monospace, Consolas, monospace; font-weight: 800; font-size: 18px; color: var(--pri); }
.countdown.urgent { color: var(--danger); }

.action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.action-btn { border-radius: 10px; }

.speech-row { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.speech-row .textarea { min-height: 62px; }

.log-list { max-height: 170px; overflow-y: auto; font-size: 12px; color: #4b5563; display: flex; flex-direction: column; gap: 4px; }
.log-list .item { padding: 3px 8px; border-radius: 7px; background: #f8faff; }

.env-bar {
  height: 8px;
  border-radius: 999px;
  background: #eef2fa;
  overflow: hidden;
  margin-top: 8px;
}
.env-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pri), var(--pink));
  transition: width .06s linear;
}

.bill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.bill-cell { background: #fbfcff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.bill-cell .k { font-size: 11px; color: var(--muted); }
.bill-cell .v { font-weight: 800; font-size: 15px; }

/* ---------------------------------------------------------------- 标签页 */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab {
  appearance: none;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  position: relative;
}
.tab:hover { color: var(--pri); background: #f8fbff; }
.tab.active { color: var(--pri); }
.tab.active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--pri), var(--pink));
}

/* ---------------------------------------------------------------- 表格 */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table.table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #fff; }
table.table th, table.table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.table th { background: #f8faff; font-size: 11.5px; color: var(--muted); font-weight: 700; position: sticky; top: 0; }
table.table tbody tr:last-child td { border-bottom: 0; }
table.table tbody tr:hover { background: #fafcff; }
table.table tbody tr.clickable { cursor: pointer; }
table.table td.wrap { white-space: normal; min-width: 200px; }

.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 12px; font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- 卡片网格（角色 / 音色） */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.item-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.item-card .thumb {
  height: 96px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eef4ff, #fff0f7);
  display: grid;
  place-items: center;
  color: #9aa9c2;
  font-size: 12px;
  overflow: hidden;
}
.item-card .thumb img { max-height: 100%; max-width: 100%; object-fit: contain; }
.item-card h4 { font-size: 14px; }
.item-card .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }

/* ---------------------------------------------------------------- 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(31, 36, 48, .38);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade .15s ease;
}
.modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(31, 36, 48, .28);
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: pop .18s ease;
}
.modal.wide { max-width: 720px; }
.modal-head { padding: 16px 20px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 14px 20px; overflow-y: auto; }
.modal-foot { padding: 0 20px 18px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal-x {
  appearance: none;
  border: 0;
  background: #f3f5fa;
  color: var(--muted);
  width: 26px; height: 26px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  flex: none;
}
.modal-x:hover { background: #e9edf6; color: var(--ink); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- Toast */
.toast-wrap {
  position: fixed;
  top: 68px;   /* 让开吸顶导航 */
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 9px 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 26px rgba(31, 36, 48, .14);
  font-size: 13px;
  font-weight: 600;
  max-width: 78vw;
  animation: pop .16s ease;
}
.toast.ok { border-color: #c9ecdb; color: #1d7d57; background: #f4fdf8; }
.toast.err { border-color: #ffd3d8; color: #c43c4c; background: #fff6f7; }
.toast.warn { border-color: #ffe6bd; color: #a76c12; background: #fffbf2; }

/* ---------------------------------------------------------------- 登录页 */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.auth-card {
  width: 100%;
  max-width: 860px;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(79, 140, 255, .16);
  border: 1px solid #eef2fa;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}
.auth-art {
  padding: 34px 30px;
  background: linear-gradient(160deg, #eef5ff 0%, #f7f2ff 48%, #fff1f8 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.auth-art::before, .auth-art::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}
.auth-art::before { width: 190px; height: 190px; right: -50px; top: -40px; background: rgba(255, 158, 203, .35); }
.auth-art::after { width: 140px; height: 140px; left: -40px; bottom: -40px; background: rgba(79, 140, 255, .22); }
.auth-art h1 { font-size: 26px; line-height: 1.35; position: relative; }
.auth-art .lead { color: #55617a; font-size: 13px; position: relative; }
.auth-art .chips { display: flex; flex-wrap: wrap; gap: 6px; position: relative; margin-top: 6px; }
.auth-art .chip { background: rgba(255, 255, 255, .75); border: 1px solid #e8eefb; border-radius: 999px; padding: 3px 10px; font-size: 11.5px; color: #5b6a86; font-weight: 600; }
.auth-form { padding: 32px 30px; }
.auth-form h2 { font-size: 19px; margin-bottom: 4px; }

.auth-switch { display: flex; gap: 4px; background: #f4f6fb; border-radius: 12px; padding: 4px; margin: 16px 0 18px; }
.auth-switch button {
  flex: 1;
  appearance: none;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  padding: 7px 0;
  border-radius: 9px;
  cursor: pointer;
}
.auth-switch button.active { background: #fff; color: var(--pri); box-shadow: 0 2px 8px rgba(79, 140, 255, .16); }

/* ---------------------------------------------------------------- 管理后台 */
.admin-layout { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 18px; align-items: start; }
.sidebar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  position: sticky;
  top: 76px;
}
.side-item {
  display: block;
  width: 100%;
  text-align: left;
  appearance: none;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #5b6475;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 2px;
}
.side-item:hover { background: #f7faff; color: var(--pri); }
.side-item.active { background: var(--pri-soft); color: var(--pri); font-weight: 700; }
.side-sep { height: 1px; background: var(--line); margin: 8px 6px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.stat .k { font-size: 11.5px; color: var(--muted); }
.stat .v { font-size: 21px; font-weight: 800; margin-top: 4px; letter-spacing: .4px; }

.group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.group-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fcfdff; margin-bottom: 12px; }
.sub-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sub-table th, .sub-table td { padding: 5px 6px; text-align: left; border-bottom: 1px solid #eef2fa; }
.sub-table th { color: var(--muted); font-size: 11px; font-weight: 700; }
.sub-table .input { padding: 6px 8px; font-size: 12px; }

.code-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  background: #fbfcff;
  border: 1px dashed #dbe4f4;
  border-radius: 10px;
  padding: 10px;
}
.code-item { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; letter-spacing: .5px; padding: 4px 8px; background: #fff; border-radius: 7px; border: 1px solid var(--line); }

.warn-strip {
  background: #fff8ec;
  border: 1px solid #ffe3bb;
  color: #9a6a14;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 12px;
}

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 900px) {
  .room-layout { grid-template-columns: minmax(0, 1fr); }
  .room-layout > .left-col { order: 2; }
  .room-layout > .right-col { order: 1; }
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; display: flex; gap: 4px; overflow-x: auto; padding: 8px; }
  .side-item { white-space: nowrap; width: auto; margin-bottom: 0; }
  .side-sep { display: none; }
  .auth-card { grid-template-columns: 1fr; max-width: 440px; }
  .auth-art { padding: 24px; }
  .auth-art h1 { font-size: 21px; }
  .nav-inner { padding: 9px 12px; gap: 8px; flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; overflow-x: auto; }
  .container { padding: 16px 12px 50px; }
  .room-grid { grid-template-columns: minmax(0, 1fr); }
  .chat-log { height: 170px; }
}

@media (max-width: 520px) {
  .stage-wrap { aspect-ratio: 4 / 3; }
  .seat-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .modal { max-width: 100%; }
  .page-title { font-size: 19px; }
}
