:root {
  --bg: #0a0d16;
  --bg-2: #101528;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef1f8;
  --text-dim: #9aa3bb;
  --text-mute: #646d85;
  --accent: #5b8cff;
  --accent-2: #7c5cff;
  --live: #2fd3a5;
  --warn: #ffb86b;
  --danger: #ff6b81;
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body::before {
  content: "";
  position: fixed;
  inset: -20% -20% auto -20%;
  height: 70vh;
  background:
    radial-gradient(45% 55% at 20% 20%, rgba(91, 140, 255, 0.28), transparent 70%),
    radial-gradient(40% 50% at 85% 10%, rgba(124, 92, 255, 0.22), transparent 70%),
    radial-gradient(35% 45% at 50% 0%, rgba(47, 211, 165, 0.12), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding-bottom: var(--safe-b);
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 18px 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(91, 140, 255, 0.9);
  animation: breathe 2.6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}

.brand-name {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.92);
}

.ghost-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s;
  font-family: inherit;
}

.ghost-btn:hover { background: var(--panel-2); color: var(--text); }

.me-avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* ---------- 舞台 ---------- */
.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 4px 18px 0;
}

.room-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 18px;
}

.room-head h1 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: 0.2px;
}

.room-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-mute);
  display: flex;
  gap: 6px;
  align-items: center;
}

.room-sub .sep { opacity: 0.5; }

.quality {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-dim);
  white-space: nowrap;
  transition: 0.35s;
}

.quality-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-mute);
  transition: 0.35s;
}

.quality[data-level="hq"] { color: #bcd0ff; border-color: rgba(91, 140, 255, 0.45); background: rgba(91, 140, 255, 0.12); }
.quality[data-level="hq"] .quality-dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.quality[data-level="stable"] { color: #9ff0d4; border-color: rgba(47, 211, 165, 0.4); background: rgba(47, 211, 165, 0.1); }
.quality[data-level="stable"] .quality-dot { background: var(--live); box-shadow: 0 0 10px var(--live); }
.quality[data-level="low"] { color: #ffd7a8; border-color: rgba(255, 184, 107, 0.4); background: rgba(255, 184, 107, 0.1); }
.quality[data-level="low"] .quality-dot { background: var(--warn); box-shadow: 0 0 10px var(--warn); }

/* ---------- 麦位 ---------- */
.seats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

/* 顶部主持位：居中、比普通麦位大一圈 */
.seat-host {
  display: flex;
  justify-content: center;
}

.seat-host .seat {
  width: 128px;
  padding: 10px 6px 9px;
}

.seat-host .avatar {
  width: 64px;
  height: 64px;
  font-size: 20px;
}

/* 下面 8 个麦位：每排 4 个，正好两排 */
.seat-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 10px;
}

.seat-grid .seat {
  width: calc((100% - 30px) / 4);
  padding: 10px 4px 9px;
}

.seat-grid .avatar {
  width: 50px;
  height: 50px;
  font-size: 17px;
}

.seat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 6px 12px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  cursor: pointer;
  transition: transform 0.18s ease, background 0.25s, border-color 0.25s;
  user-select: none;
}

.seat:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.075); }
.seat:active { transform: scale(0.97); }

.seat[data-empty="true"] {
  border: 1px dashed rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.018);
}

.seat[data-locked="true"] {
  border-color: rgba(255, 184, 107, 0.28);
  background: rgba(255, 184, 107, 0.05);
}

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  background: #2a3350;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: 0.25s;
}

.seat[data-empty="true"] .avatar {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-mute);
  font-size: 22px;
  font-weight: 300;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* 说话光环 */
.seat[data-speaking="true"] .avatar::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--live);
  animation: speak 1.15s ease-out infinite;
}

@keyframes speak {
  0% { transform: scale(0.92); opacity: 0.9; }
  70% { transform: scale(1.12); opacity: 0; }
  100% { transform: scale(1.12); opacity: 0; }
}

.seat[data-speaking="true"] .avatar {
  box-shadow: 0 0 0 2px rgba(47, 211, 165, 0.65), 0 0 26px rgba(47, 211, 165, 0.45);
}

.seat[data-self="true"] .avatar { box-shadow: 0 0 0 2px rgba(91, 140, 255, 0.85); }
.seat[data-self="true"][data-speaking="true"] .avatar { box-shadow: 0 0 0 2px rgba(47, 211, 165, 0.75), 0 0 26px rgba(47, 211, 165, 0.5); }

.seat-name {
  font-size: 12.5px;
  color: var(--text-dim);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat[data-empty="true"] .seat-name { color: var(--text-mute); }

.badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  color: var(--text-dim);
}

.badge.crown { color: #ffd479; border-color: rgba(255, 212, 121, 0.35); background: rgba(255, 212, 121, 0.12); }
.badge.mute { color: var(--danger); border-color: rgba(255, 107, 129, 0.3); background: rgba(255, 107, 129, 0.12); }
.badge.lock { color: var(--warn); border-color: rgba(255, 184, 107, 0.3); background: rgba(255, 184, 107, 0.12); }

.seat-hint {
  position: absolute;
  bottom: -6px;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(10, 13, 22, 0.9);
  border: 1px solid var(--line);
  color: var(--text-mute);
}

/* ---------- 公屏 ---------- */
.feed-wrap {
  flex: 1;
  min-height: 90px;
  position: relative;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--line);
  overflow: hidden;
}

.feed-wrap::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 26px;
  background: linear-gradient(180deg, rgba(10, 13, 22, 0.75), transparent);
  pointer-events: none;
  z-index: 2;
}

.feed {
  height: 100%;
  overflow-y: auto;
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.feed::-webkit-scrollbar { width: 4px; }
.feed::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 4px; }

.msg {
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
  animation: msgIn 0.28s ease both;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.msg .who {
  color: #8fb0ff;
  font-weight: 500;
  margin-right: 6px;
}

.msg .body { color: rgba(238, 241, 248, 0.88); }

.msg.system {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-mute);
  padding: 2px 0;
}

.msg.system .body { color: var(--text-mute); }

/* ---------- 底部 ---------- */
.dock {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px calc(16px + var(--safe-b));
  background: linear-gradient(180deg, transparent, rgba(10, 13, 22, 0.9) 40%);
}

.mic-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(91, 140, 255, 0.4);
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.9), rgba(124, 92, 255, 0.9));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.22s;
  box-shadow: 0 8px 24px -8px rgba(91, 140, 255, 0.75);
  font-family: inherit;
  white-space: nowrap;
}

.mic-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -8px rgba(91, 140, 255, 0.9); }
.mic-btn:active { transform: scale(0.97); }

.mic-btn[data-state="on"] {
  border-color: rgba(47, 211, 165, 0.5);
  background: linear-gradient(135deg, rgba(47, 211, 165, 0.92), rgba(56, 189, 248, 0.88));
  box-shadow: 0 8px 24px -8px rgba(47, 211, 165, 0.8);
}

.mic-btn[data-state="muted"] {
  border-color: rgba(255, 107, 129, 0.45);
  background: linear-gradient(135deg, rgba(255, 107, 129, 0.9), rgba(200, 80, 120, 0.9));
  box-shadow: 0 8px 24px -8px rgba(255, 107, 129, 0.7);
}

.mic-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.mic-icon { display: grid; place-items: center; }

.chat-form {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 6px 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  transition: 0.2s;
}

.chat-form:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(91, 140, 255, 0.45);
}

.chat-form input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.chat-form input::placeholder { color: var(--text-mute); }

.send-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: rgba(91, 140, 255, 0.9);
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: 0.18s;
}

.send-btn:hover { background: rgba(91, 140, 255, 1); }

/* ---------- 杂项 ---------- */
.audio-sink { position: absolute; width: 0; height: 0; overflow: hidden; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translate(-50%, 12px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 25, 40, 0.94);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: 0.28s ease;
  z-index: 50;
  max-width: 84vw;
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 380px) {
  .avatar { width: 48px; height: 48px; font-size: 16px; }
  .seats { gap: 10px 8px; }
  .room-head h1 { font-size: 18px; }
  .mic-btn { padding: 0 14px; }
}

@media (min-height: 780px) and (min-width: 520px) {
  .app {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.45);
  }
}

/* ---------- 麦位操作面板 ---------- */
.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.sheet-wrap.show { opacity: 1; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 10, 0.6);
  backdrop-filter: blur(3px);
}

.sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 10px calc(10px + var(--safe-b));
  padding: 8px 8px 6px;
  border-radius: 22px;
  background: #151a2b;
  border: 1px solid var(--line);
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.5);
  transform: translateY(18px);
  transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.sheet-wrap.show .sheet { transform: none; }

.sheet-title {
  padding: 12px 14px 10px;
  font-size: 12.5px;
  color: var(--text-mute);
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.sheet-item,
.sheet-cancel {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.sheet-item:hover,
.sheet-cancel:hover { background: rgba(255, 255, 255, 0.06); }

.sheet-item.danger { color: var(--danger); }

.sheet-cancel {
  margin-top: 4px;
  color: var(--text-mute);
  border-top: 1px solid var(--line);
  border-radius: 0 0 16px 16px;
}

/* ---------- 传输模式标识 ---------- */
.mode-chip {
  margin-left: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.3px;
  color: #9ff0d4;
  background: rgba(47, 211, 165, 0.1);
  border: 1px solid rgba(47, 211, 165, 0.3);
}

/* ---------- 非安全上下文提示 ---------- */
.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 12.5px;
  color: #ffd7a8;
  background: rgba(255, 184, 107, 0.13);
  border-bottom: 1px solid rgba(255, 184, 107, 0.3);
}

.banner[hidden] { display: none; }

.banner a {
  color: #ffd7a8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 380px) {
  .seat-grid .seat { padding: 8px 2px 7px; }
  .seat-grid .avatar { width: 44px; height: 44px; font-size: 15px; }
  .seat-host .seat { width: 112px; }
  .seat-host .avatar { width: 58px; height: 58px; }
}

/* ---------- 顶部工具栏 / 扬声器音量 ---------- */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 12px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: 0.2s;
}

.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn[aria-expanded="true"] { border-color: rgba(91, 140, 255, 0.5); color: #bcd0ff; }

.vol-panel {
  position: absolute;
  top: 62px;
  right: 18px;
  z-index: 40;
  width: 268px;
  padding: 14px 16px 12px;
  border-radius: 16px;
  background: #151a2b;
  border: 1px solid var(--line);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.5);
}

.vol-panel[hidden] { display: none; }

.vol-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.vol-row output {
  color: #bcd0ff;
  font-variant-numeric: tabular-nums;
}

.vol-panel input[type="range"] {
  width: 100%;
  height: 30px;
  accent-color: var(--accent);
  cursor: pointer;
}

.vol-mute {
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: 0.18s;
}

.vol-mute:hover { background: rgba(255, 255, 255, 0.09); }
.vol-mute[aria-pressed="true"] {
  color: var(--danger);
  border-color: rgba(255, 107, 129, 0.4);
  background: rgba(255, 107, 129, 0.12);
}

/* ---------- 无障碍基础 ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid #9fbcff;
  outline-offset: 3px;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid #9fbcff;
  outline-offset: 2px;
  border-radius: 10px;
}

.seat:focus-visible {
  outline: 2px solid #9fbcff;
  outline-offset: 3px;
  background: rgba(91, 140, 255, 0.12);
}

/* 提高次要文字的对比度，满足 4.5:1 */
:root {
  --text-dim: #aeb6c9;
  --text-mute: #8d95a9;
}

/* 系统开启"减少动态效果"时关掉所有动画 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- 操作面板里的个人音量 ---------- */
.sheet-vol {
  padding: 10px 12px 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.sheet-vol input[type="range"] {
  width: 100%;
  height: 30px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- 锁房按钮（仅主持麦可见） ---------- */
.lock-btn[hidden] { display: none; }

.lock-btn[aria-pressed="true"] {
  color: #ffd479;
  border-color: rgba(255, 212, 121, 0.45);
  background: rgba(255, 212, 121, 0.12);
}


/* ---------- 锁房提示 ---------- */
.locked-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #ffd7a8;
  background: rgba(255, 184, 107, 0.12);
  border-bottom: 1px solid rgba(255, 184, 107, 0.3);
}

.locked-note[hidden] { display: none; }

.locked-note button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 184, 107, 0.45);
  background: rgba(255, 184, 107, 0.18);
  color: #ffd7a8;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}


/* ---------- 修改昵称弹窗 ---------- */
.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-wrap[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 10, 0.62);
  backdrop-filter: blur(3px);
}

.modal {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 20px 20px 16px;
  border-radius: 20px;
  background: #151a2b;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.modal h2 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
}

.modal input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
}

.modal input:focus {
  border-color: rgba(91, 140, 255, 0.6);
  background: rgba(255, 255, 255, 0.09);
}

.modal-hint {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--text-mute);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.btn-ghost,
.btn-primary {
  flex: 1;
  height: 42px;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  transition: 0.18s;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); }

.btn-primary {
  border: none;
  background: linear-gradient(135deg, #5b8cff, #7c5cff);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover { filter: brightness(1.08); }


/* 非主持人看到的锁房按钮：可见但弱化，点击给出提示 */
.lock-btn.is-readonly { opacity: 0.5; }
.lock-btn.is-readonly:hover { opacity: 0.8; }


/* ---------- 音质档位选择（主持麦可见） ---------- */
.rate-select {
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 12px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  outline: none;
}

.rate-select[hidden] { display: none; }

.rate-select:focus-visible {
  outline: 2px solid #9fbcff;
  outline-offset: 2px;
}


/* ---------- 入场页 ---------- */
.entry {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(70% 50% at 50% 0%, #17203a, #080b13 70%);
}

.entry[hidden] { display: none; }

.entry-card {
  width: 100%;
  max-width: 340px;
  padding: 26px 22px 20px;
  border-radius: 22px;
  background: rgba(21, 26, 43, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.entry-logo { border-radius: 14px; margin-bottom: 10px; }

.entry-card h1 {
  margin: 0 0 18px;
  font-size: 17px;
  font-weight: 600;
}

.entry-card label {
  display: block;
  text-align: left;
  margin: 12px 0 6px;
  font-size: 12px;
  color: var(--text-dim);
}

.entry-card input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
}

.entry-card input:focus {
  border-color: rgba(91, 140, 255, 0.6);
  background: rgba(255, 255, 255, 0.09);
}

.entry-hint {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-mute);
  text-align: left;
}

.entry-btn {
  width: 100%;
  height: 48px;
  margin-top: 18px;
  border-radius: 14px;
  font-size: 15px;
}

.entry-btn:disabled { opacity: 0.6; cursor: default; }

.entry-tip {
  min-height: 18px;
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--danger);
}

.entry-btn-2 { margin-top: 10px; height: 44px; }

/* ---------- 视觉统一：中性深色 + 单一实色强调（去掉渐变/光晕/大圆角） ---------- */
:root {
  --bg: #0b0c0f;
  --panel: #14161b;
  --panel-2: #1a1d24;
  --line: #262a33;
  --text: #e8eaf0;
  --text-dim: #a7adba;
  --text-mute: #7c8391;
  --accent: #f2375a;
  --danger: #ff5a6e;
}

body,
.entry {
  background: #0b0c0f;
}

.seat,
.feed,
.chat-form input,
.vol-panel,
.modal,
.entry-card,
.icon-btn,
.ghost-btn,
.rate-select,
.sheet {
  background: var(--panel);
  border-color: var(--line);
  border-radius: 10px;
  box-shadow: none;
  backdrop-filter: none;
}

.entry-card,
.modal,
.vol-panel {
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.btn-primary,
.mic-btn[data-state="on"],
.send-btn {
  background: var(--accent);
  border-radius: 10px;
  filter: none;
  box-shadow: none;
}

.btn-primary:hover,
.send-btn:hover {
  filter: brightness(1.06);
}

.banner,
.locked-note,
.quality,
.mode-chip,
.lock-btn[aria-pressed="true"],
.icon-btn[aria-expanded="true"] {
  border-radius: 8px;
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--text-dim);
}

.lock-btn[aria-pressed="true"] {
  color: var(--accent);
  border-color: rgba(242, 55, 90, 0.45);
}

.brand .dot {
  background: var(--accent);
  box-shadow: none;
}

.avatar,
.me-avatar {
  border-radius: 10px;
  box-shadow: none;
}

.seat[data-speaking="true"] .avatar {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-dim);
  border-radius: 10px;
}

.entry-card input,
.modal input,
.chat-form input {
  border-radius: 8px;
  background: #0f1116;
}

.modal input:focus,
.entry-card input:focus {
  border-color: var(--accent);
  background: #0f1116;
}


/* ---------- 固定窗口下的防遮挡 ---------- */
html,
body {
  overflow-x: hidden;
}

.app {
  max-width: 100%;
  overflow-x: hidden;
}

.topbar {
  gap: 8px;
  flex-wrap: nowrap;
}

.brand-name {
  font-size: 13px;
  letter-spacing: 0;
}

#meName {
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}

@media (max-width: 460px) {
  .topbar {
    padding: 12px 12px 8px;
    gap: 6px;
  }

  .icon-btn,
  .rate-select {
    padding: 0 9px;
    height: 32px;
    font-size: 11.5px;
  }

  /* 只留图标，文字靠 aria-label 给读屏，视觉上不挤 */
  #roomBtn span:last-child,
  #lockText,
  #volBtnText {
    display: none;
  }

  #meName {
    max-width: 52px;
  }

  .seat-grid {
    gap: 10px 8px;
  }
}

/* ---------- 矮屏自适应：保证底栏（麦克风/输入框）永远完整可见 ---------- */
.seats {
  flex-shrink: 0;
}

html,
body {
  overflow: hidden;
}

.app {
  overflow: hidden;
}

@media (max-height: 800px) {
  .topbar { padding: 10px 12px 6px; }
  .room-head { margin: 4px 0 10px; }
  .room-head h1 { font-size: 18px; margin-bottom: 4px; }
  .seats { gap: 8px; margin-bottom: 10px; }
  .seat { padding: 9px 4px 8px; gap: 5px; }
  .avatar { width: 46px; height: 46px; font-size: 15px; }
  .seat-host .seat { width: 112px; padding: 9px 4px 8px; }
  .seat-host .avatar { width: 54px; height: 54px; font-size: 18px; }
  .feed-wrap { min-height: 62px; }
  .dock { padding: 8px 14px calc(10px + var(--safe-b)); }
  .mic-btn { height: 42px; }
  .chat-form { height: 42px; }
}

@media (max-height: 680px) {
  .seat { padding: 7px 3px 6px; gap: 4px; }
  .avatar { width: 40px; height: 40px; font-size: 14px; }
  .seat-host .seat { width: 100px; }
  .seat-host .avatar { width: 46px; height: 46px; font-size: 16px; }
  .feed-wrap { min-height: 52px; }
  .room-head h1 { font-size: 16px; }
  .room-sub { font-size: 11.5px; }
  .seat .seat-name { font-size: 11px; }
}

/* ---------- 手机端原生手感（去掉一切网页痕迹） ---------- */
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

input,
textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* 手机上不显示滚动条，避免"网页感" */
@media (pointer: coarse) {
  ::-webkit-scrollbar { width: 0; height: 0; }
  .feed { scrollbar-width: none; }
}

@media (max-width: 420px) {
  .topbar { gap: 5px; padding: 10px 10px 6px; }
  .icon-btn { padding: 0 8px; height: 34px; }
  .rate-select { height: 34px; padding: 0 8px; }
  #meName { max-width: 46px; }
  /* 只留图标，文字靠 aria-label 交给读屏 */
  #ttsBtn span:last-child,
  #exitBtn span:last-child { display: none; }
  .stage { padding: 2px 12px 0; }
  .dock { padding: 8px 12px calc(10px + var(--safe-b)); gap: 8px; }
  .chat-form { height: 44px; }
  .mic-btn { padding: 0 14px; }
}


/* ---------- 手机端顶栏：一律图标模式，文字交给读屏 ---------- */
@media (pointer: coarse), (max-width: 480px) {
  .topbar {
    gap: 6px;
    padding: 10px 12px 8px;
    padding-top: calc(10px + env(safe-area-inset-top));
  }

  .icon-btn {
    padding: 0 11px;
    height: 48px;
    min-width: 48px;
    justify-content: center;
    white-space: nowrap;
  }

  .icon-btn > span:not([aria-hidden]) {
    display: none;
  }

  /* 锁房和音量只留图标 */
  #lockText,
  #volBtnText,
  #ttsBtn span:last-child,
  #exitBtn span:last-child,
  #roomBtn span:last-child {
    display: none;
  }

  .rate-select {
    height: 48px;
    padding: 0 10px;
    font-size: 12.5px;
  }

  /* 手机上昵称只留头像，点头像即可改名 */
  #meName {
    display: none;
  }

  .modal-exit {
    width: 100%;
    height: 44px;
    margin-top: 10px;
    border-radius: 12px;
  }

  .ghost-btn {
    height: 48px;
    padding: 0 12px;
  }

  /* 手机上麦位也要够大，读屏双击容错更高 */
  .seat { min-height: 84px; }
  .mic-btn { height: 52px; }
  .send-btn { min-width: 64px; height: 48px; }
  .entry-card input { height: 48px; }
  .entry-btn { height: 52px; }
  .modal input { height: 48px; }
  .btn-primary, .btn-ghost { height: 48px; }
}


/* ---------- iPhone 全屏（添加到主屏幕后生效） ---------- */
@supports (padding: env(safe-area-inset-top)) {
  .entry {
    padding-top: calc(24px + env(safe-area-inset-top));
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .dock {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .topbar {
    padding-top: calc(12px + env(safe-area-inset-top));
  }
}

/* iOS 不显示长按菜单与橡皮筋回弹，减少"网页感" */
body {
  -webkit-touch-callout: none;
  overscroll-behavior-y: none;
}

input,
textarea {
  -webkit-user-select: text;
  user-select: text;
}


/* ---------- iPhone 添加到主屏幕提示 ---------- */
.ios-tip {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #1a1d24;
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
}

.ios-tip[hidden] { display: none; }

.ios-tip span { flex: 1; }

.ios-tip button {
  flex: 0 0 auto;
  min-width: 64px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}


/* ---------- 房间列表 ---------- */
.room-list {
  max-height: 210px;
  overflow-y: auto;
  margin: 2px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

.room-item {
  display: flex;
  align-items: stretch;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
}

/* 主区域就是"进入"，未上锁可点，上锁的只播报 */
.ri-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

.room-item .ri-rid {
  flex: 0 0 auto;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: #E9EEFF;
}

.room-item .ri-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
  font-size: 12.5px;
}

.room-item .ri-meta {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: #7C8391;
}

.room-item.locked {
  opacity: 0.55;
}

.room-item.locked .ri-main {
  cursor: not-allowed;
}

.room-item.locked .ri-meta {
  color: #C08A8A;
}

.ri-main:not(:disabled):active {
  background: rgba(255, 255, 255, 0.08);
}

/* 解散：只出现在自己的房间上 */
.ri-del {
  flex: 0 0 auto;
  min-width: 62px;
  border: none;
  border-left: 1px solid var(--line);
  background: rgba(242, 55, 90, 0.12);
  color: #F2375A;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.ri-del:active {
  background: rgba(242, 55, 90, 0.22);
}

.room-list-empty {
  padding: 14px 4px;
  font-size: 12.5px;
  color: #7C8391;
  text-align: center;
}


/* 入场页里的房间列表：不抢主要操作的位置 */
#entryRoomList {
  max-height: 168px;
  margin-top: 6px;
}

#entryRoomListHint {
  margin-top: 14px;
}


/* 宽屏（电脑）才显示顶栏退出；手机上放不下，用房间弹窗里的那个 */
.exit-top {
  display: none;
}

@media (min-width: 481px) {
  .exit-top {
    display: inline-flex;
  }
}
