/* 电音助手Link 网页端 · 设计规范
 * 实体表面承载信息（卡片 / 列表 / 输入），玻璃只用在浮层与悬浮栏（顶栏、底栏、菜单、弹窗、提示）。
 * 玻璃：低透明度填充 + 适度模糊 + 1px 高光描边，保证文字清晰不糊。
 * 层级：背景光影 < 卡片 < 悬浮栏 < 弹窗 < 菜单 / 提示。
 */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --fill: rgba(118, 118, 128, 0.1);
  --fill-2: rgba(118, 118, 128, 0.16);
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #8e8e93;
  --sep: rgba(0, 0, 0, 0.08);

  --accent: #5856d6;
  --accent-2: #a35cf0;
  --accent-soft: rgba(88, 86, 214, 0.12);
  --accent-grad: linear-gradient(135deg, #6e6cf5 0%, #9b5df2 100%);
  --green: #28b04f;
  --green-soft: rgba(52, 199, 89, 0.14);
  --teal: #0a84d6;
  --teal-soft: rgba(10, 132, 214, 0.12);
  --orange: #e48a00;
  --orange-soft: rgba(255, 159, 10, 0.15);
  --red: #e5352b;
  --red-soft: rgba(255, 59, 48, 0.12);
  --gold: #c88a00;

  --glass-bg: rgba(255, 255, 255, 0.66);
  --glass-line: rgba(255, 255, 255, 0.75);
  --glass-edge: rgba(0, 0, 0, 0.06);
  --glass-blur: saturate(180%) blur(22px);

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.05);
  --shadow-float: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  --ring: 0 0 0 4px rgba(88, 86, 214, 0.22);

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 26px;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --amb-opacity: 0.55;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0f;
    --surface: #1c1c1e;
    --surface-2: #232326;
    --fill: rgba(118, 118, 128, 0.2);
    --fill-2: rgba(118, 118, 128, 0.3);
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #7c7c82;
    --sep: rgba(255, 255, 255, 0.09);

    --accent: #7d7aff;
    --accent-2: #bf5af2;
    --accent-soft: rgba(125, 122, 255, 0.18);
    --green: #30d158;
    --green-soft: rgba(48, 209, 88, 0.16);
    --teal: #64d2ff;
    --teal-soft: rgba(100, 210, 255, 0.14);
    --orange: #ff9f0a;
    --orange-soft: rgba(255, 159, 10, 0.16);
    --red: #ff453a;
    --red-soft: rgba(255, 69, 58, 0.16);
    --gold: #ffd60a;

    --glass-bg: rgba(30, 30, 34, 0.58);
    --glass-line: rgba(255, 255, 255, 0.09);
    --glass-edge: rgba(0, 0, 0, 0.4);

    --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.05);
    --shadow-float: 0 16px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --ring: 0 0 0 4px rgba(125, 122, 255, 0.3);
    --amb-opacity: 0.45;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 14px; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }

/* ── 背景光影：大面积柔和渐变，提供通透的纵深，不抢信息 ── */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient i {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--amb-opacity);
  animation: drift 26s ease-in-out infinite alternate;
}
.ambient i:nth-child(1) { width: 52vw; height: 52vw; left: -14vw; top: -18vw; background: radial-gradient(circle, rgba(110, 108, 245, 0.55), transparent 65%); }
.ambient i:nth-child(2) { width: 46vw; height: 46vw; right: -12vw; top: 8vh; background: radial-gradient(circle, rgba(191, 90, 242, 0.42), transparent 65%); animation-delay: -8s; }
.ambient i:nth-child(3) { width: 50vw; height: 50vw; left: 22vw; bottom: -30vw; background: radial-gradient(circle, rgba(100, 210, 255, 0.35), transparent 65%); animation-delay: -16s; }
@keyframes drift { to { transform: translate3d(3vw, 2vh, 0) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .ambient i { animation: none; } * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }

/* ── 玻璃（只给浮层用） ── */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 0.5px 0 var(--glass-line), 0 0 0 0.5px var(--glass-edge), var(--shadow-float);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--surface); }
}

/* ── 实体卡片 ── */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.card-inset { background: var(--fill); border-radius: var(--r); padding: 4px 14px; }

/* ── 品牌 ── */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; color: #fff;
  background: var(--accent-grad); box-shadow: 0 4px 12px rgba(110, 108, 245, 0.35), inset 0 0.5px 0 rgba(255, 255, 255, 0.4);
}
.brand-mark.lg { width: 56px; height: 56px; border-radius: 16px; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(0.92); opacity: 0.7; } }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-error { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 12px; padding: 24px; }

.icon { display: inline-flex; flex: none; }
.icon svg { display: block; }

/* ── 按钮 ── */
.btn {
  height: 40px; padding: 0 18px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 500; white-space: nowrap; transition: transform 0.15s var(--ease), background 0.2s, filter 0.2s, opacity 0.2s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 2px 10px rgba(110, 108, 245, 0.3), inset 0 0.5px 0 rgba(255, 255, 255, 0.3); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-secondary { background: var(--fill); }
.btn-secondary:hover:not(:disabled) { background: var(--fill-2); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red); color: #fff; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; margin-top: 12px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--text-2);
  transition: background 0.2s, color 0.2s;
}
.icon-btn:hover { background: var(--fill); color: var(--text); }

/* ── 表单 ── */
.input {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 12px; background: var(--fill); border: 1px solid transparent;
  transition: box-shadow 0.2s, background 0.2s; outline: none;
}
.input:focus { background: var(--surface); box-shadow: var(--ring); border-color: var(--accent); }
.input::placeholder { color: var(--text-3); }
.textarea { height: auto; padding: 10px 14px; resize: vertical; min-height: 72px; line-height: 1.5; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.form > * + * { margin-top: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-hint { font-size: 12px; color: var(--text-3); }
.pw-row { display: flex; gap: 8px; }

.segmented { display: flex; padding: 3px; gap: 2px; background: var(--fill); border-radius: 13px; }
.seg {
  flex: 1; min-width: 0; padding: 8px 6px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; gap: 1px;
  transition: background 0.25s var(--ease), box-shadow 0.25s var(--ease), color 0.2s;
}
.seg-main { font-weight: 600; font-size: 14px; }
.seg-sub { font-size: 11px; color: var(--text-2); }
.seg:hover:not(.active) { background: var(--fill); }
.seg.active { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 0.5px var(--sep); }
.seg.active .seg-main { color: var(--accent); }
.seg.locked { opacity: 0.55; cursor: pointer; }
.seg.locked .seg-main::after { content: " 🔒"; font-size: 10px; }
.quality-desc { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }

.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--fill); border-radius: 12px; padding: 3px; width: fit-content; }
.stepper .icon-btn { font-size: 20px; width: 36px; height: 36px; border-radius: 9px; color: var(--text); }
.stepper .icon-btn:hover { background: var(--surface); }
.stepper-val { min-width: 36px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.toggles { display: flex; flex-direction: column; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; cursor: pointer; }
.toggle-row + .toggle-row { border-top: 0.5px solid var(--sep); }
.toggle-label { font-size: 14px; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch-knob { position: absolute; inset: 0; border-radius: 99px; background: var(--fill-2); transition: background 0.25s var(--ease); pointer-events: none; }
.switch-knob::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.04); transition: transform 0.25s var(--ease);
}
.switch input:checked + .switch-knob { background: var(--green); }
.switch input:checked + .switch-knob::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-knob { box-shadow: var(--ring); }

.range-row { display: flex; align-items: center; gap: 10px; }
.range { flex: 1; accent-color: var(--accent); }
.range-val { width: 46px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 13px; }

.meter { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.meter-fill { height: 100%; background: linear-gradient(90deg, var(--green) 0%, var(--green) 70%, var(--orange) 88%, var(--red) 100%); transform-origin: left; transform: scaleX(0); transition: transform 0.06s linear; }

.tip { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--accent-soft); color: var(--text); font-size: 13px; }
.tip .icon { color: var(--accent); margin-top: 1px; }

/* ── 徽章 / 标签 ── */
.badge { white-space: nowrap; flex: none; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 600; background: var(--fill); color: var(--text-2); }
.badge-sub { font-weight: 500; opacity: 0.8; }
.badge-q { background: var(--accent-soft); color: var(--accent); }
.badge-q.q510 { background: linear-gradient(135deg, rgba(110, 108, 245, 0.18), rgba(191, 90, 242, 0.2)); }
.role-tag { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.role-tag.owner { background: rgba(255, 196, 0, 0.16); color: var(--gold); }
.role-tag.admin { background: var(--teal-soft); color: var(--teal); }
.role-tag.member { background: var(--fill); color: var(--text-2); }
.me-tag { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; margin-left: 6px; }
.pill { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px; font-size: 11px; font-weight: 600; margin-left: 6px; }
.pill.warn { background: var(--orange-soft); color: var(--orange); }
.code { font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; color: var(--text-2); }

/* ── 头像 ── */
.avatar {
  --hue: 245; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, hsl(var(--hue) 70% 62%), hsl(calc(var(--hue) + 40) 70% 52%));
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── 顶栏 ── */
.topnav { position: sticky; top: 0; z-index: 20; border-radius: 0; box-shadow: inset 0 -0.5px 0 var(--sep); }
.topnav-inner { max-width: 1120px; margin: 0 auto; height: 60px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
.topnav-right { display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 99px; transition: background 0.2s; }
.user-chip:hover { background: var(--fill); }
.user-chip-text { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.user-chip-name { font-size: 14px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-sub { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ── 登录 ── */
.login-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 18px; }
.login-card { width: min(380px, 100%); padding: 40px 32px 28px; border-radius: var(--r-xl); text-align: center; display: flex; flex-direction: column; align-items: center; }
.login-brand { margin-bottom: 16px; }
.login-card h1 { font-size: 28px; font-weight: 700; }
.login-sub { color: var(--text-2); margin-top: 4px; }
.qr-box { width: 220px; height: 220px; margin: 28px 0 14px; border-radius: 18px; background: #fff; padding: 12px; display: grid; place-items: center; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.08); }
.qr-img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; border-radius: 6px; }
.qr-skeleton { width: 100%; height: 100%; border-radius: 8px; background: #eee; }
.qr-retry { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #1d1d1f; font-weight: 600; border-radius: 8px; background: rgba(0, 0, 0, 0.04); }
.qr-retry .muted { color: #6e6e73; font-weight: 400; font-size: 13px; }
.login-hint { font-size: 14px; color: var(--text-2); min-height: 21px; }
.login-hint.error { color: var(--red); }
.login-foot { display: flex; align-items: center; gap: 6px; margin-top: 22px; padding-top: 18px; border-top: 0.5px solid var(--sep); width: 100%; justify-content: center; font-size: 12px; color: var(--text-3); }
.login-room { margin-top: 10px; font-size: 12px; color: var(--accent); }
.login-legal { font-size: 12px; }

.shimmer { position: relative; overflow: hidden; }
.shimmer::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent); animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* ── 大厅 ── */
.lobby { max-width: 1120px; margin: 0 auto; padding: 56px 24px 80px; }
.hero h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.hero-sub { margin-top: 12px; font-size: 17px; color: var(--text-2); }
.action-cards { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; margin-top: 36px; }
.action-card { display: flex; align-items: center; gap: 16px; padding: 22px; transition: transform 0.25s var(--ease), box-shadow 0.25s; }
.action-card:not(.join-card) { cursor: pointer; }
.action-card:not(.join-card):hover { transform: translateY(-2px); box-shadow: var(--shadow-card), 0 12px 30px rgba(0, 0, 0, 0.08); }
.action-icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: var(--fill); color: var(--text); flex: none; }
.action-icon.accent { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 18px rgba(110, 108, 245, 0.35); }
.action-text { flex: 1; min-width: 0; }
.action-text h3 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.action-text p { font-size: 13px; }
.action-chevron { color: var(--text-3); }
.join-row { display: flex; gap: 8px; margin-top: 8px; }
.code-input { font-family: var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.code-input:placeholder-shown { font-family: var(--font); letter-spacing: normal; }
.room-section { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { font-size: 21px; font-weight: 700; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.room-card { text-align: left; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-height: 128px; transition: transform 0.25s var(--ease), box-shadow 0.25s; }
.room-card:hover:not(.skeleton) { transform: translateY(-2px); box-shadow: var(--shadow-card), 0 12px 30px rgba(0, 0, 0, 0.08); }
.room-card.skeleton { background: var(--surface); opacity: 0.6; }
.room-card-top { display: flex; align-items: center; gap: 8px; }
.room-card-name { font-size: 16px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-card-meta { display: flex; align-items: center; gap: 10px; }
.room-card-foot { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: auto; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.online-dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.empty { grid-column: 1 / -1; padding: 28px; text-align: center; color: var(--text-3); border: 1px dashed var(--sep); border-radius: var(--r-lg); font-size: 14px; }

.lobby-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.lobby-bar .lobby-tabs { margin: 0; padding: 4px; width: 260px; }
.lobby-tabs .tab { height: 34px; font-size: 14px; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); color: var(--text-3); width: min(320px, 100%); transition: box-shadow 0.2s; }
.search:focus-within { box-shadow: var(--ring); }
.search-input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; }
.search-input::placeholder { color: var(--text-3); }
.search-input:focus-visible { box-shadow: none; }
.sub-head { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 4px 2px 10px; }
.room-grid + .sub-head { margin-top: 28px; }
.room-owner { display: flex; align-items: center; gap: 6px; font-size: 12.5px; min-width: 0; margin-top: -4px; }
.room-owner span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.avatar-stack { display: inline-flex; align-items: center; margin-left: 4px; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface); font-size: 10px !important; }
.avatar-stack .avatar + .avatar { margin-left: -6px; }
.avatar-more { margin-left: 4px; font-size: 11px; color: var(--text-3); }

/* ── 个人资料 ── */
.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-avatar .avatar { box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--sep); }
.profile-head-text { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }

/* ── 进房前 ── */
.prejoin { max-width: 560px; margin: 0 auto; padding: 48px 20px 80px; }
.prejoin-card { padding: 28px; display: flex; flex-direction: column; gap: 22px; }
.prejoin-card.skeleton { height: 420px; }
.prejoin-card.center { align-items: center; text-align: center; }
.big-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--fill); display: grid; place-items: center; color: var(--text-2); }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: 0.06em; font-family: var(--mono); }
.prejoin-head h2 { font-size: 26px; font-weight: 700; margin-top: 4px; }
.prejoin-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }
.owner-line { display: inline-flex; align-items: center; gap: 6px; }
.device-check { display: flex; flex-direction: column; gap: 10px; }
.mic-status { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.mic-status.error { color: var(--red); }
.prejoin-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ── 房间 ── */
.room { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto 1fr; padding-bottom: 104px; }
.room-bar { position: relative; z-index: 10; margin: 12px 16px 0; padding: 10px 14px 10px 8px; border-radius: var(--r-lg); display: flex; align-items: center; gap: 10px; }
.room-headline { flex: 1; min-width: 0; }
.room-title { font-size: 18px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-sub { display: flex; align-items: center; gap: 10px; margin-top: 3px; flex-wrap: wrap; }
.code-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 7px; background: var(--fill); font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--text-2); transition: background 0.2s; }
.code-chip:hover { background: var(--fill-2); color: var(--text); }
.net-summary { display: inline-flex; gap: 6px; }
.net { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 600; }
.net.p2p { background: var(--green-soft); color: var(--green); }
.net.relay { background: var(--teal-soft); color: var(--teal); }
.net.wait { background: var(--fill); color: var(--text-2); }
.room-bar-right { display: flex; gap: 4px; }

.room-body { min-height: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr) 340px; gap: 16px; padding: 16px; }
.panel { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; font-weight: 700; font-size: 15px; border-bottom: 0.5px solid var(--sep); }
.panel-head .icon { color: var(--text-2); }
.panel-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.member-section { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 4px; font-size: 12px; font-weight: 700; color: var(--text-2); letter-spacing: 0.02em; }
.member-section:first-child { padding-top: 2px; }
.member-empty { font-size: 12px; color: var(--text-3); padding: 4px 8px 8px; }
.member-av { position: relative; display: inline-flex; border-radius: 50%; }
.member-row.speaking .member-av { box-shadow: 0 0 0 2px var(--green), 0 0 10px rgba(48, 209, 88, 0.45); }
.member-nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-sub { display: flex; align-items: center; gap: 5px; margin-top: 2px; min-height: 20px; }
.member-sub .pill { margin-left: 0; }
.member-conn .conn-chip { height: 18px; padding: 0 6px; font-size: 10.5px; }
.seat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; align-content: start; }
.seat-empty { border: 1.5px dashed var(--sep); background: transparent; box-shadow: none; justify-content: center; min-height: 196px; color: var(--text-3); cursor: default; }
.seat-empty:hover { transform: none; }
.seat-empty.can-sit { cursor: pointer; }
.seat-empty.can-sit:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.seat-empty-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); }
.seat-empty.can-sit:hover .seat-empty-icon { background: var(--surface); }
.seat-empty-text { font-size: 13px; font-weight: 600; }
.dock-center { display: flex; align-items: center; gap: 22px; }
.seat-btn {
  height: 52px; padding: 0 26px; border-radius: 26px; display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: #fff;
  background: var(--accent-grad); box-shadow: 0 6px 20px rgba(110, 108, 245, 0.4), inset 0 0.5px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.2s var(--ease), filter 0.2s, opacity 0.2s;
}
.seat-btn:hover:not(:disabled) { filter: brightness(1.06); }
.seat-btn:active:not(:disabled) { transform: scale(0.96); }
.seat-btn:disabled { opacity: 0.6; }
.rot180 svg { transform: rotate(180deg); }
.sound-gate { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 16; display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 99px; font-weight: 600; color: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.room-badges { display: inline-flex; gap: 6px; }
.lobby-bar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.auto-mic .toggle-row { padding: 0; gap: 10px; }
.auto-mic .toggle-label { font-size: 13px; color: var(--text-2); }
.stage { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.announce { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-card); font-size: 14px; }
.announce .icon { color: var(--orange); margin-top: 2px; }
.stage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; align-content: start; }
.tile {
  position: relative; padding: 22px 14px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.3s;
}
.tile:hover { transform: translateY(-2px); }
.tile.speaking { box-shadow: var(--shadow-card), 0 0 0 1.5px var(--green-soft); }
.tile-avatar { position: relative; width: 76px; height: 76px; margin-bottom: 4px; }
.tile-ring {
  position: absolute; inset: -6px; border-radius: 50%; opacity: 0; pointer-events: none;
  box-shadow: 0 0 0 2.5px var(--green), 0 0 22px 2px rgba(48, 209, 88, 0.45);
  transition: opacity 0.12s linear, transform 0.12s linear;
}
.tile-name { display: flex; align-items: center; max-width: 100%; font-weight: 600; }
.tile-nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-tags { display: flex; align-items: center; gap: 6px; min-height: 20px; }
.tile-mic .live { color: var(--green); }
.mic-forced { color: var(--red); display: inline-flex; }
.tile-conn { min-height: 22px; }
.conn-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.conn-chip.p2p { background: var(--green-soft); color: var(--green); }
.conn-chip.relay { background: var(--teal-soft); color: var(--teal); }
.conn-chip.wait, .conn-chip.self { background: var(--fill); color: var(--text-2); }
.conn-chip.bad { background: var(--red-soft); color: var(--red); }
.spinner { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tile-more { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity 0.2s; width: 30px; height: 30px; }
.tile:hover .tile-more, .tile:focus-within .tile-more { opacity: 1; }
@media (hover: none) { .tile-more { opacity: 1; } }


.tabs { display: flex; gap: 2px; padding: 6px; margin: 10px 10px 0; background: var(--fill); border-radius: 12px; }
.tab { flex: 1; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); transition: background 0.25s var(--ease), color 0.2s; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.side-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.chat-empty { margin: auto; font-size: 13px; }
.chat-sys { text-align: center; margin: 8px 0; }
.chat-sys span { display: inline-block; font-size: 12px; color: var(--text-3); background: var(--fill); padding: 3px 10px; border-radius: 99px; max-width: 90%; }
.chat-msg { display: flex; gap: 8px; margin-top: 10px; align-items: flex-start; }
.chat-msg.grouped { margin-top: 2px; }
.chat-msg.mine { justify-content: flex-end; }
.chat-av { width: 28px; flex: none; }
.chat-body { max-width: 78%; display: flex; flex-direction: column; min-width: 0; }
.chat-msg.mine .chat-body { align-items: flex-end; }
.chat-meta { display: flex; gap: 8px; align-items: baseline; font-size: 11.5px; margin: 0 4px 3px; }
.chat-name { font-weight: 600; color: var(--text-2); }
.chat-time { color: var(--text-3); }
.bubble-row { display: flex; align-items: center; gap: 4px; }
.chat-msg.mine .bubble-row { flex-direction: row-reverse; }
.bubble { padding: 8px 12px; border-radius: 16px; background: var(--fill); font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.chat-msg.mine .bubble { background: var(--accent-grad); color: #fff; }
.bubble.deleted { background: transparent !important; color: var(--text-3) !important; font-style: italic; border: 1px dashed var(--sep); }
.chat-del { width: 26px; height: 26px; opacity: 0; }
.chat-msg:hover .chat-del { opacity: 1; }
@media (hover: none) { .chat-del { opacity: 0.6; } }
.chat-note { margin: 0 14px 6px; font-size: 12px; color: var(--orange); text-align: center; }
.chat-compose { display: flex; align-items: flex-end; gap: 8px; margin: 6px 12px 12px; padding: 6px 6px 6px 14px; border-radius: 18px; background: var(--fill); }
.chat-input { flex: 1; min-height: 24px; max-height: 120px; padding: 5px 0; border: 0; outline: none; resize: none; background: transparent; line-height: 1.45; }
.chat-input:disabled { opacity: 0.5; }
.chat-input:focus-visible { box-shadow: none; }
.chat-compose:focus-within { box-shadow: var(--ring); }
.send-btn { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--accent-grad); flex: none; transition: transform 0.15s, opacity 0.2s; }
.send-btn:active { transform: scale(0.92); }
.send-btn:disabled { opacity: 0.35; }

.member-list { flex: 1; overflow-y: auto; padding: 8px; }
.member-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; text-align: left; transition: background 0.2s; }
.member-row:hover { background: var(--fill); }
.member-row .live { color: var(--green); }
.member-main { flex: 1; min-width: 0; }
.member-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.member-sub { font-size: 12px; display: flex; align-items: center; }

/* ── 底部控制栏 ── */
.dock {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 15;
  display: flex; align-items: center; gap: 28px; padding: 10px 26px; border-radius: 30px;
}
.dock-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--text-2); width: 52px; padding: 6px 0; border-radius: 12px; transition: background 0.2s, color 0.2s; }
.dock-btn:hover { background: var(--fill); color: var(--text); }
.dock-btn.danger:hover { color: var(--red); background: var(--red-soft); }
.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mic-label { font-size: 11px; color: var(--text-2); }
.mic-btn {
  --lv: 0; position: relative; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: var(--accent-grad); box-shadow: 0 6px 20px rgba(110, 108, 245, 0.4), inset 0 0.5px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.2s var(--ease), background 0.3s, box-shadow 0.3s;
}
.mic-btn:active { transform: scale(0.94); }
.mic-ring { position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--green); opacity: calc(var(--lv) * 1.4); transform: scale(calc(1 + var(--lv) * 0.12)); transition: opacity 0.08s linear, transform 0.08s linear; pointer-events: none; }
.mic-btn.muted { background: var(--fill-2); color: var(--text); box-shadow: none; }
.mic-btn.muted .mic-ring { opacity: 0; }
.mic-btn.forced { background: var(--red-soft); color: var(--red); }

.conn-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 50; text-align: center; padding: 8px; font-size: 13px; font-weight: 600; color: #fff; background: var(--orange); }

/* ── 成员卡片 / 统计 ── */
.member-card { display: flex; flex-direction: column; gap: 18px; }
.member-card-head { display: flex; gap: 16px; align-items: center; }
.member-card-name { font-size: 19px; font-weight: 700; }
.member-card-tags { display: flex; gap: 6px; margin-top: 6px; }
.member-card-tags .pill { margin-left: 0; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--sep); border-radius: var(--r); overflow: hidden; }
.stat { background: var(--surface-2); padding: 12px 14px; }
.stat-label { font-size: 12px; color: var(--text-2); }
.stat-value { font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.action-list { display: flex; flex-direction: column; background: var(--fill); border-radius: var(--r); overflow: hidden; }
.action-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; text-align: left; font-size: 14px; transition: background 0.15s; }
.action-item + .action-item { border-top: 0.5px solid var(--sep); }
.action-item:hover { background: var(--fill); }
.action-item.danger { color: var(--red); }
.ban-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; }
.ban-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--red-soft); font-size: 13px; }

/* ── PCM / 客服 ── */
.pcm-hero { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r); background: var(--accent-soft); }
.pcm-hero .icon { color: var(--accent); }
.pcm-title { font-weight: 700; }
.support-box { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: var(--r); background: var(--fill); }
.support-qr { width: 160px; height: 160px; border-radius: 12px; display: block; margin: 0 auto; }

/* ── 弹窗 ── */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, 0); transition: background 0.25s var(--ease); }
.overlay.in { background: rgba(0, 0, 0, 0.28); }
.sheet {
  width: min(460px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; border-radius: var(--r-xl); padding: 22px 24px 20px;
  transform: translateY(10px) scale(0.97); opacity: 0; transition: transform 0.32s var(--ease), opacity 0.22s;
}
@media (prefers-color-scheme: light) { .sheet { background: rgba(255, 255, 255, 0.86); } }
@media (prefers-color-scheme: dark) { .sheet { background: rgba(36, 36, 40, 0.84); } }
.sheet-wide { width: min(620px, 100%); }
.overlay.in .sheet { transform: none; opacity: 1; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-head h3 { font-size: 19px; font-weight: 700; }
.sheet-body { font-size: 14px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ── 菜单 ── */
.menu { position: fixed; z-index: 200; min-width: 200px; padding: 6px; border-radius: 14px; opacity: 0; transform: scale(0.96); transform-origin: top right; transition: opacity 0.16s, transform 0.2s var(--ease); }
.menu.in { opacity: 1; transform: none; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 9px; font-size: 14px; text-align: left; }
.menu-item:hover:not(:disabled) { background: var(--accent); color: #fff; }
.menu-item.danger { color: var(--red); }
.menu-item.danger:hover { background: var(--red); color: #fff; }
.menu-item:disabled { opacity: 0.4; }
.menu-hint { margin-left: auto; font-size: 12px; opacity: 0.6; }
.menu-sep { height: 0.5px; background: var(--sep); margin: 5px 8px; }

/* ── 提示 ── */
.toast-host { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  padding: 10px 18px; border-radius: 99px; font-size: 14px; font-weight: 500; max-width: 88vw;
  background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 0.5px 0 var(--glass-line), 0 0 0 0.5px var(--glass-edge), var(--shadow-float);
  opacity: 0; transform: translateY(-10px) scale(0.96); transition: opacity 0.22s, transform 0.3s var(--ease);
}
.toast.in { opacity: 1; transform: none; }
.toast-ok { color: var(--green); }
.toast-warn { color: var(--orange); }
.toast-error { color: var(--red); }

/* ── 私信 ── */
.dm-btn { position: relative; }
.dm-badge { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--surface); font-variant-numeric: tabular-nums; }
.dm-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0); transition: background 0.25s var(--ease); }
.dm-overlay.in { background: rgba(0, 0, 0, 0.18); }
.dm-sheet {
  position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(400px, calc(100vw - 24px)); border-radius: var(--r-xl);
  display: flex; flex-direction: column; overflow: hidden; transform: translateX(calc(100% + 24px)); transition: transform 0.34s var(--ease);
}
@media (prefers-color-scheme: light) { .dm-sheet { background: rgba(255, 255, 255, 0.88); } }
@media (prefers-color-scheme: dark) { .dm-sheet { background: rgba(30, 30, 34, 0.88); } }
.dm-overlay.in .dm-sheet { transform: none; }
.dm-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dm-head { display: flex; align-items: center; gap: 6px; padding: 12px 12px 10px 16px; border-bottom: 0.5px solid var(--sep); }
.dm-head h3 { flex: 1; font-size: 18px; font-weight: 700; }
.dm-peer { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.dm-peer-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-threads { flex: 1; overflow-y: auto; padding: 6px; }
.dm-thread { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; text-align: left; transition: background 0.2s; }
.dm-thread:hover { background: var(--fill); }
.dm-thread-main { flex: 1; min-width: 0; }
.dm-thread-top { display: flex; align-items: baseline; gap: 8px; }
.dm-thread-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-thread-time { font-size: 11.5px; color: var(--text-3); flex: none; }
.dm-thread-preview { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.dm-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; flex: none; }
.dm-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 60px 20px; color: var(--text-2); text-align: center; }
.dm-empty .icon { color: var(--text-3); }
.dm-loading, .dm-hint { text-align: center; padding: 24px; font-size: 13px; }
.dm-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.dm-time { text-align: center; font-size: 11.5px; color: var(--text-3); margin: 10px 0 2px; }
.dm-cta { margin-top: 0; }

/* ── 响应式 ── */
@media (max-width: 1180px) and (min-width: 901px) {
  .room-body { grid-template-columns: 220px minmax(0, 1fr) 300px; gap: 12px; padding: 12px; }
  .seat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (max-width: 900px) {
  .action-cards { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .room { height: auto; min-height: 100dvh; display: block; padding-bottom: 12px; }
  .room-bar { position: sticky; top: 8px; margin: 8px 10px 0; }
  .room-body { display: flex; flex-direction: column; padding: 12px 10px; }
  .stage { overflow: visible; order: 1; }
  .members-panel { order: 2; max-height: 46vh; }
  .chat-panel { order: 3; height: 62vh; min-height: 380px; }
  .seat-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .seat-empty { min-height: 150px; }
  .tile { padding: 16px 10px 12px; }
  .sound-gate { bottom: auto; top: 90px; }
  .dock { position: sticky; left: auto; transform: none; width: fit-content; margin: 0 auto; gap: 18px; padding: 8px 18px; }
}
@media (max-width: 560px) {
  .dm-sheet { top: 0; right: 0; bottom: 0; width: 100vw; border-radius: 0; }
  .lobby-tabs, .search { width: 100%; }
  .lobby { padding-top: 32px; }
  .topnav-inner { padding: 0 14px; }
  .user-chip-text { display: none; }
  .user-chip { padding: 4px; }
  .join-row { flex-direction: column; }
  .prejoin-card { padding: 20px; }
  .seg-sub { display: none; }
}
