/* ============================================================
   空间语音共赏平台 · 沉浸影院暗色 · Brand CSS
   Prefix: sv
   依据 space-voice-platform/colors_and_type.css 及全部页面设计稿
   ============================================================ */

:root,
html.dark {
  color-scheme: dark;

  /* Surfaces —— 深炭黑蓝底色系，边界优先的表面分层 */
  --color-bg: #0a0d14;
  --color-bg-deep: #070910;
  --color-surface: #11151f;
  --color-surface-raised: #182030;
  --color-surface-hover: #1e2739;
  --color-overlay: rgba(7, 9, 16, 0.72);
  --color-border: rgba(255, 255, 255, 0.07);
  --color-border-strong: rgba(255, 255, 255, 0.13);

  /* Text —— 暖白文字层级 */
  --color-text: #edeff4;
  --color-text-secondary: #9aa3b5;
  --color-text-muted: #5f687b;
  --color-text-inverse: #1c1204;

  /* Primary —— 唯一品牌色相：暖金舞台灯 */
  --color-primary-50: #fdf5e3;
  --color-primary-100: #fae7bc;
  --color-primary-200: #f6d68f;
  --color-primary-300: #f2c564;
  --color-primary-400: #eeb744;
  --color-primary-500: #e9a82b;
  --color-primary-600: #d1901f;
  --color-primary-700: #ae7418;
  --color-primary-800: #8a5a12;
  --color-primary-900: #6a440d;
  --color-primary: var(--color-primary-400);
  --color-primary-hover: var(--color-primary-300);
  --color-primary-active: var(--color-primary-500);
  --color-on-primary: #1c1204;

  /* States —— 仅语义状态使用 */
  --state-success: #3ecf8e;
  --state-warning: #f2a93b;
  --state-error: #f2555e;
  --state-info: #5aa9f2;

  /* Typography */
  --font-sans: 'Inter', -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-display: 'Inter', -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', Consolas, monospace;

  /* Radius —— 克制的圆角体系 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Elevation —— 仅浮层（弹窗/抽屉/菜单）允许深阴影；静态卡片用边界分层 */
  --shadow-float: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-float-lg: 0 20px 64px rgba(0, 0, 0, 0.6);

  /* Stage glow —— 页面背景的顶部暖金光晕（背景处理，非阴影） */
  --glow-top: radial-gradient(720px 320px at 50% -80px, rgba(233, 168, 43, 0.14), transparent 70%);
  --glow-screen: radial-gradient(560px 240px at 50% 0px, rgba(233, 168, 43, 0.1), transparent 70%);
}

html {
  background: var(--color-bg);
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  margin: 0;
}

* { box-sizing: border-box; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
input::placeholder { color: var(--color-text-muted); }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ============ Typography ============ */
.sv-h1 { font-size: 34px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; color: var(--color-text); margin: 0; }
.sv-h2 { font-size: 24px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; color: var(--color-text); margin: 0; }
.sv-h3 { font-size: 18px; font-weight: 600; line-height: 1.4; color: var(--color-text); margin: 0; }
.sv-body { font-size: 14px; line-height: 1.6; color: var(--color-text-secondary); }
.sv-body-sm { font-size: 13px; line-height: 1.6; color: var(--color-text-secondary); }
.sv-caption { font-size: 12px; line-height: 1.5; color: var(--color-text-muted); }
.sv-label { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--color-text); }

/* ============ Surfaces ============ */
.sv-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.sv-card-raised { background: var(--color-surface-raised); border: 1px solid var(--color-border-strong); border-radius: var(--radius-lg); }
.sv-hairline { border: 1px solid var(--color-border); }

/* ============ Brand glow helpers ============ */
.sv-stage-glow { background-image: var(--glow-top); background-repeat: no-repeat; }
.sv-screen-glow { background-image: var(--glow-screen); background-repeat: no-repeat; }

/* ============ Buttons ============ */
.sv-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  transition: background-color 150ms, color 150ms;
}
.sv-icon-btn:hover { background: var(--color-surface-hover); color: var(--color-text); }

.sv-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-on-primary);
  background: var(--color-primary-400);
  transition: filter 150ms;
  white-space: nowrap;
}
.sv-btn-primary:hover { filter: brightness(1.1); }

.sv-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-border-strong);
  transition: background-color 150ms, border-color 150ms;
  white-space: nowrap;
}
.sv-btn-outline:hover { background: var(--color-surface-hover); border-color: var(--color-primary-500); }

.sv-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  color: var(--color-text-secondary);
  background: transparent;
  transition: background-color 150ms, color 150ms;
  white-space: nowrap;
}
.sv-btn-ghost:hover { background: var(--color-surface-hover); color: var(--color-text); }

.sv-input {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text);
  outline: none;
}
.sv-input:focus { border-color: var(--color-primary-500); }

/* ============ Avatar / tags ============ */
.sv-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.sv-avatar-gold { background: rgba(233, 168, 43, 0.18); color: var(--color-primary-400); border: 1px solid var(--color-primary-600); }

.sv-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-strong);
  white-space: nowrap;
}
.sv-room-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary-400);
  background: rgba(233, 168, 43, 0.12);
  border: 1px solid var(--color-primary-600);
  white-space: nowrap;
}
.sv-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  white-space: nowrap;
}

/* ============ Home ============ */
.sv-friend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: 10px;
  color: var(--color-text);
  transition: background-color 150ms;
  text-align: left;
}
.sv-friend-item:hover { background: var(--color-surface-hover); }

.sv-tab {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: background-color 150ms, color 150ms;
  white-space: nowrap;
}
.sv-tab:hover { color: var(--color-text); }
.sv-tab-active { background: rgba(233, 168, 43, 0.12); color: var(--color-primary-400); border: 1px solid var(--color-primary-600); }

.sv-lobby-card {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: border-color 150ms, transform 150ms;
  cursor: pointer;
  color: var(--color-text);
}
.sv-lobby-card:hover { border-color: var(--color-primary-600); transform: translateY(-2px); }

.sv-card-cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 108px;
  background: linear-gradient(140deg, var(--color-bg-deep) 0%, var(--color-surface) 55%, var(--color-surface-raised) 100%);
  border-bottom: 1px solid var(--color-border);
}
.sv-card-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(140px 80px at 50% 120%, rgba(233, 168, 43, 0.14), transparent 70%);
  pointer-events: none;
}
.sv-cover-sports::after { background: radial-gradient(140px 80px at 50% 120%, rgba(233, 168, 43, 0.1), transparent 70%); }
.sv-cover-cinema::after { background: radial-gradient(140px 80px at 50% 120%, rgba(233, 168, 43, 0.09), transparent 70%); }
.sv-cover-midnight::after { background: radial-gradient(140px 80px at 50% 120%, rgba(233, 168, 43, 0.12), transparent 70%); }
.sv-cover-derby::after { background: radial-gradient(140px 80px at 50% 120%, rgba(233, 168, 43, 0.11), transparent 70%); }
.sv-cover-classic::after { background: radial-gradient(140px 80px at 50% 120%, rgba(233, 168, 43, 0.08), transparent 70%); }

.sv-friend-lobby {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  background: var(--color-surface);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  transition: border-color 150ms;
  cursor: pointer;
  text-align: left;
  color: var(--color-text);
}
.sv-friend-lobby:hover { border-color: var(--color-primary-600); }

/* ============ Lobby 看台（200 座 = 4 区块 × 5 排 × 10 列） ============ */
.sv-arc {
  height: 26px;
  margin: 0 18px;
  border-bottom: 2px dashed rgba(233, 168, 43, 0.3);
  border-radius: 0 0 999px 999px;
}
.sv-block {
  flex: 1;
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
/* 看台横向轨道（设计稿 sv-seat-track）：移动端横向滚动查看全部座位 */
.sv-seat-track {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(233, 168, 43, 0.35) transparent;
  padding-bottom: 2px;
}
@media (min-width: 1024px) {
  .sv-seat-track { overflow: visible; }
}
@media (max-width: 1023.98px) {
  .sv-seat-track .sv-block { flex: 0 0 250px; min-width: 250px; }
}
/* 单圈大弧：两侧区块靠前（贴近屏幕），保持水平不旋转 */
.sv-block-outer { transform: translateY(-10px); }
.sv-block-4 { transform: translateY(-10px); }
.sv-block-inner { transform: translateY(10px); }
.sv-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}
.sv-seat-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}
.sv-seat {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  min-height: 0;
  border-radius: 3px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border-strong);
  transition: transform 150ms, border-color 150ms, background-color 150ms;
  cursor: pointer;
}
.sv-seat:hover {
  transform: scale(1.65);
  z-index: 2;
  border-color: var(--color-primary-400);
  box-shadow: 0 0 0 1px var(--color-primary-500);
}
.sv-seat b { font-size: 8px; font-weight: 600; color: var(--color-text); line-height: 1; }
.sv-seat-taken { background: var(--color-surface-hover); border-color: var(--color-border); cursor: default; }
.sv-seat-taken:hover { transform: none; box-shadow: none; border-color: var(--color-border); }
.sv-seat-select { border-color: var(--color-primary-600); box-shadow: inset 0 0 0 1px rgba(233, 168, 43, 0.25); }
.sv-seat-mine {
  background: var(--color-primary-500);
  border-color: var(--color-primary-300);
  box-shadow: 0 0 0 3px rgba(233, 168, 43, 0.25);
  z-index: 1;
}
.sv-seat-mine:hover { transform: scale(1.65); border-color: var(--color-primary-200); box-shadow: 0 0 0 3px rgba(233, 168, 43, 0.35); }
.sv-seat-mine b { color: var(--color-on-primary); font-size: 9px; }
.sv-seat-tag {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--color-primary-400);
  background: var(--color-bg-deep);
  border: 1px solid var(--color-primary-600);
  box-shadow: var(--shadow-float);
  pointer-events: none;
}
/* 沙盒房音源配色 */
.sv-seat-a { background: rgba(233, 168, 43, 0.35); border-color: var(--color-primary-400); }
.sv-seat-a b { color: var(--color-on-primary); }
.sv-seat-b { background: rgba(62, 207, 142, 0.3); border-color: rgba(62, 207, 142, 0.7); }
.sv-seat-b b { color: var(--color-on-primary); }
.sv-seat-c { background: rgba(90, 169, 242, 0.3); border-color: rgba(90, 169, 242, 0.7); }
.sv-seat-c b { color: var(--color-on-primary); }

.sv-seat-demo { display: inline-block; width: 14px; height: 14px; border-radius: 3px; background: var(--color-surface-raised); border: 1px solid var(--color-border-strong); }
.sv-seat-demo-taken { background: var(--color-surface-hover); border-color: var(--color-border); }
.sv-seat-demo-mine { background: var(--color-primary-500); border-color: var(--color-primary-400); }

.sv-dir-bubble {
  position: absolute;
  right: 16px;
  bottom: 52px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--color-primary-400);
  background: var(--color-surface);
  border: 1px solid var(--color-primary-600);
  box-shadow: var(--shadow-float);
  white-space: nowrap;
}
.sv-dir-bubble i { flex-shrink: 0; }

.sv-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background-color 150ms;
}
.sv-member:hover { background: var(--color-surface-hover); }
.sv-member-active { background: rgba(233, 168, 43, 0.08); }

/* ============ 测试房声场 ============ */
.sv-field { position: relative; }
.sv-circle {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 1px dashed var(--color-border-strong);
}
.sv-circle-1 { inset: 22%; }
.sv-circle-2 { inset: 42%; }
.sv-circle-3 {
  inset: 0;
  border-style: solid;
  border-color: var(--color-border-strong);
  background: radial-gradient(circle at 50% 50%, rgba(233,168,43,0.06), transparent 72%);
}
.sv-angle-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50%;
  height: 1px;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--color-border), transparent);
}
.sv-dir-label {
  position: absolute;
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.sv-listener {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text);
}
.sv-listener-label {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.sv-source {
  position: absolute;
  left: 68%;
  top: 26%;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-400);
  color: var(--color-on-primary);
  box-shadow: 0 0 0 6px rgba(233,168,43,0.18);
  cursor: grab;
}
.sv-source:active { cursor: grabbing; }
.sv-source-label {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--color-primary-400);
  white-space: nowrap;
}
.sv-readout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  white-space: nowrap;
}

/* ============ 参数面板 ============ */
.sv-param-group { margin-bottom: 18px; }
.sv-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
}
.sv-switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 9999px;
  background: var(--color-surface-hover);
  border: 1px solid var(--color-border-strong);
  transition: background-color 150ms;
  flex-shrink: 0;
  padding: 0;
}
.sv-switch-on { background: var(--color-primary-500); border-color: var(--color-primary-400); }
.sv-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: var(--color-text);
  transition: transform 150ms;
}
.sv-switch-on .sv-switch-thumb { transform: translateX(18px); }
.sv-param-val { font-size: 12px; font-weight: 600; color: var(--color-primary-400); }
.sv-range { width: 100%; accent-color: var(--color-primary-400); cursor: pointer; }

.sv-details summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.sv-details summary::-webkit-details-marker { display: none; }

/* ============ 沙盒房用户列表 ============ */
.sv-user {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background-color 150ms, border-color 150ms;
  text-align: left;
  color: var(--color-text);
}
.sv-user:hover { background: var(--color-surface-hover); }
.sv-user-active { background: var(--color-surface-hover); border-color: var(--color-primary-600); }
.su-mute {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 13px;
  flex-shrink: 0;
  transition: background-color 150ms;
}
.su-mute:hover { background: var(--color-surface-hover); }
.su-mute.muted { color: var(--state-error); }
.sv-avatar-a { background: rgba(233,168,43,0.18); color: var(--color-primary-400); border: 1px solid var(--color-primary-600); }
.sv-avatar-b { background: rgba(62,207,142,0.14); color: var(--state-success); border: 1px solid rgba(62,207,142,0.5); }
.sv-avatar-c { background: rgba(90,169,242,0.14); color: var(--state-info); border: 1px solid rgba(90,169,242,0.5); }

/* ============ 登录页座位小方块 ============ */
.sv-seat-mini {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border-strong);
}
.sv-seat-mini-gold { background: rgba(233, 168, 43, 0.85); border-color: var(--color-primary-400); }
.sv-seat-mini-taken { background: var(--color-surface-hover); border-color: var(--color-border); }

/* ============ Screen 切换 ============ */
.screen { display: none; }
.screen.active { display: flex; }

/* ============ 弹窗（新建/加入大厅） ============ */
.sv-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-overlay);
  backdrop-filter: blur(4px);
}
.sv-modal {
  width: 100%;
  max-width: 400px;
  padding: 24px;
  border-radius: 12px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-float-lg);
}

/* ============ Toast ============ */
.message-box {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text);
  box-shadow: var(--shadow-float);
}
.message-box.error { border-color: var(--state-error); color: var(--state-error); }
.message-box.warning { border-color: var(--state-warning); color: var(--state-warning); }
.message-box.success { border-color: var(--state-success); color: var(--state-success); }
.message-box.info { border-color: var(--color-primary-600); color: var(--color-primary-400); }
.close-btn {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

/* ============ 状态条（兼容 app.js 连接/音频状态） ============ */
.status-bar {
  position: fixed;
  left: 16px;
  bottom: 12px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  color: var(--color-text-muted);
  background: rgba(7, 9, 16, 0.6);
  border: 1px solid var(--color-border);
}
.status-item { display: flex; align-items: center; gap: 6px; }
.status-item .indicator {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: var(--state-warning);
  flex-shrink: 0;
}
.status-item.connected .indicator { background: var(--state-success); }
.status-item.disconnected .indicator { background: var(--state-error); }

/* ============ 右侧栏伸缩（设计稿 sv-sidebar）：移动端抽屉 / 桌面端折叠 ============ */
.sv-sidebar {
  position: fixed;
  top: 56px;
  right: 0;
  bottom: 0;
  width: min(320px, 88vw);
  transform: translateX(105%);
  transition: transform 220ms ease;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: var(--shadow-float-lg);
  overflow-y: auto;
}
.sv-sidebar.sv-sidebar-open { transform: translateX(0); }
.sv-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--color-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
.sv-sidebar-backdrop.sv-backdrop-show { opacity: 1; pointer-events: auto; }
.sv-panel-toggle { flex-shrink: 0; }
.sv-panel-toggle.sv-panel-active { background: rgba(233, 168, 43, 0.14); color: var(--color-primary-400); }
@media (min-width: 1024px) {
  .sv-sidebar {
    position: static;
    width: 280px;
    transform: none;
    background: transparent;
    box-shadow: none;
    transition: width 220ms ease, padding 220ms ease, border-left-width 220ms ease;
    overflow: hidden;
  }
  .sv-sidebar.sv-sidebar-xl { width: 340px; }
  .sv-sidebar.sv-sidebar-lg { width: 300px; }
  .sv-sidebar.sv-sidebar-collapsed {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    border-left-width: 0;
    overflow: hidden;
  }
  .sv-sidebar-backdrop { display: none; }
}

/* ============ 开关（原生 checkbox 套壳） ============ */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.switch input { display: none; }
.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: var(--color-surface-hover);
  border: 1px solid var(--color-border-strong);
  transition: background-color 150ms, border-color 150ms;
  cursor: pointer;
}
.switch-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: var(--color-text);
  transition: transform 150ms;
}
.switch input:checked + .switch-slider { background: var(--color-primary-500); border-color: var(--color-primary-400); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

/* ============ 测试房 canvas 容器 ============ */
.test-canvas-wrap canvas {
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 50%, rgba(233,168,43,0.06), transparent 72%),
    var(--color-bg-deep);
}

/* ============================================================
   移动端 / Pad 适配（断点 1024px，与设计稿 Tailwind lg 一致）
   ============================================================ */
@media (max-width: 1023.98px) {
  /* ---- 登录：隐藏左视觉，表单单列居中 ---- */
  #login-container .login-grid { grid-template-columns: 1fr !important; }
  #login-container .login-hero { display: none !important; }
  #login-container .login-form-col { padding: 32px 24px !important; }
  #login-container header { padding: 16px 24px !important; }
  #login-container footer { padding: 14px 24px !important; }

  /* ---- 首页 ---- */
  #home-container > header { padding: 0 16px !important; }
  #home-container .home-main { padding: 16px !important; gap: 18px !important; }
  #home-container .home-topbar-actions { gap: 2px !important; }
  #home-container .home-topbar-actions .sv-btn-ghost { padding: 0 8px !important; font-size: 12px !important; }
  #home-container .home-topbar-actions .sv-btn-primary { height: 34px !important; padding: 0 12px !important; font-size: 12px !important; }

  /* ---- 大厅：页面可纵向滚动，看台区块横向滑动 ---- */
  #chat-container { overflow-y: auto !important; }
  #chat-container header { padding: 0 12px !important; }
  #chat-container .sv-btn-ghost { padding: 0 8px !important; font-size: 12px !important; }
  #chat-container #stage-click-area { height: 42vh !important; }
  #chat-container .seats-section { height: auto !important; min-height: 46vh !important; padding: 10px 12px 8px !important; }
  #chat-container .sv-arc { height: 18px !important; margin: 0 8px !important; }
  #chat-container .sv-seat-track { gap: 8px !important; }
  #chat-container .sv-block { padding: 8px !important; }
  #chat-container .sv-seat-grid { gap: 3px !important; }
  #chat-container .sv-block-head { font-size: 11px !important; }
  #chat-container .sv-seat-tag { font-size: 9px !important; }

  /* ---- 测试房：页面可滚动，声场保持可见 ---- */
  #test-room-screen { overflow-y: auto !important; }
  #test-room-screen .test-field-col { min-height: 62vh !important; padding: 16px !important; }
  #test-room-screen .test-canvas-wrap { max-width: 340px !important; }

  /* ---- 沙盒房：页面可滚动，舞台区压低，看台横滑 ---- */
  #sandbox-room-screen { overflow-y: auto !important; }
  #sandbox-room-screen #sandbox-stage { height: 40vh !important; }
  #sandbox-room-screen .seats-section { height: auto !important; min-height: 46vh !important; padding: 10px 12px 8px !important; }
  #sandbox-room-screen .sv-arc { height: 18px !important; margin: 0 8px !important; }
  #sandbox-room-screen .sv-seat-track { gap: 8px !important; }
  #sandbox-room-screen .sv-block { padding: 8px !important; }
  #sandbox-room-screen .sv-seat-grid { gap: 3px !important; }
  #sandbox-room-screen .sv-block-head { font-size: 11px !important; }
}

/* 小屏（<768px，对应设计稿 md 断点）：隐藏看台图例，压缩提示行 */
.swipe-hint { display: none; white-space: nowrap; }
@media (max-width: 767.98px) {
  .seat-legend { display: none !important; }
  .swipe-hint { display: inline !important; }
  #chat-container .sv-block-head { font-size: 10px !important; }
  #sandbox-room-screen .sv-block-head { font-size: 10px !important; }
}
