/* OpenGrove 直播间样式（第 29 轮追加 7 整站改版）。
   设计变量取自 opengrove.io 官网（2026-10-26 读取它的 :root 和计算样式）：米白底、墨色字、品牌绿；Inter / 苹方无衬线 + 衬线点缀；
   胶囊按钮（深墨色主按钮、白色次按钮）、16px 圆角输入框、20–28px 圆角卡片、细边框 + 柔和阴影。只有视频画面保持黑底。
   页面：首页（YouTube 式：顶部导航 + 可折叠左侧导航 + 直播间卡片网格）、观看页（画面 + 信息条 + 聊天）、登录页、审计面板。 */
* { box-sizing: border-box; }
:root {
  --bg: #fbfcfa; --paper: #ffffff; --wash: #f3f5f1; --wash-2: #e9ece6;
  --ink: #161b18; --ink-soft: #4f5852; --muted: #7d857f; --faint: #a6ada8;
  --line: rgba(22, 27, 24, .12); --line-strong: rgba(22, 27, 24, .2);
  --green: #118554; --green-deep: #0b5338; --green-wash: #e6eee8; --green-soft: #cfe1d5; --sprout: #5fb24a;
  --story: #eae5da; --story-ink: #383026;
  --live: #e0362c; --live-wash: #fde8e6;
  --warn: #8a5a06; --warn-wash: #fbf1dc; --warn-line: #ecd39b;
  --danger: #b93025; --danger-wash: #fbe9e7; --danger-line: rgba(185, 48, 37, .35);
  --info: #2c5d86; --info-wash: #e8eff6; --info-line: #c6d7e7;
  --violet: #5f45a8; --violet-wash: #efebfa;
  --pink: #a3386d; --pink-wash: #f9e8f1; --pink-line: #e6b5cf;
  --sans: Inter, "SF Pro Display", "SF Pro Text", ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r-sm: 12px; --r: 16px; --r-lg: 20px; --r-xl: 28px; --pill: 999px;
  --sh-xs: 0 1px 2px rgba(22, 27, 24, .06);
  --sh-sm: 0 2px 7px rgba(34, 50, 40, .06);
  --sh: 0 6px 18px rgba(19, 28, 23, .10);
  --sh-lg: 0 30px 90px rgba(12, 24, 17, .16);
  --focus: 0 0 0 3px rgba(17, 133, 84, .22);
  --nav-h: 64px; --side-w: 236px; --side-mini: 76px; --chat-w: 400px;
}
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--green-deep); }
a:hover { color: var(--green); }
h1, h2, h3 { letter-spacing: -.02em; }
code { font: 12px/1.4 var(--mono); background: var(--wash); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.55; }
.msg { color: var(--danger); min-height: 1.2em; }
.msg.ok { color: var(--green-deep); }
.hidden { display: none !important; }
.spacer { flex: 1; }

/* ---------- 身份：谁能看到什么 ---------- */
body[data-role="viewer"] .admin-only { display: none !important; }
body:not([data-role="viewer"]) .viewer-only { display: none !important; }
body[data-role="guest"] .login-only, body:not([data-role="guest"]) .guest-only { display: none !important; }
body[data-role="guest"] .admin-only, body[data-role="user"] .admin-only { display: none !important; }
body[data-role="guest"] .user-only { display: none !important; }
body[data-role="admin"] .user-tip { display: none !important; }

/* ---------- 按钮 ---------- */
button, a.btn { font: inherit; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 18px; border-radius: var(--pill); border: 1px solid transparent; background: rgba(16, 22, 18, .94); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: 0 5px 14px rgba(19, 28, 23, .12); transition: background .15s, box-shadow .15s, border-color .15s, color .15s, transform .05s; }
button:hover:not(:disabled), a.btn:hover { background: #000; color: #fff; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; box-shadow: none; }
button.ghost, a.btn.ghost { background: var(--paper); color: var(--ink); border-color: var(--line); box-shadow: var(--sh-sm); font-weight: 500; }
button.ghost:hover:not(:disabled), a.btn.ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
button.small, a.btn.small { min-height: 32px; padding: 0 13px; font-size: 13px; }
button.danger { background: var(--paper); color: var(--danger); border-color: var(--danger-line); box-shadow: none; }
button.danger:hover:not(:disabled) { background: var(--danger-wash); color: var(--danger); }
.danger-text { color: var(--danger) !important; border-color: var(--danger-line) !important; }
.icon-btn { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; background: transparent; color: var(--ink); box-shadow: none; flex: none; }
.icon-btn:hover:not(:disabled) { background: var(--wash); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- 输入 ---------- */
input, select, textarea { font: inherit; color: var(--ink); }
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="search"], select, textarea {
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: 14px; padding: 9px 14px; font-size: 15px; min-height: 42px; transition: border-color .15s, box-shadow .15s; }
:is(input, select, textarea):focus { outline: none; border-color: var(--green); box-shadow: var(--focus); }
::placeholder { color: var(--faint); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%234f5852' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; background-size: 11px 8px; cursor: pointer; }
/* 第 29 轮追加 9：勾选框、单选框固定 18px，和文字同一行（以前被表单里的“输入框整宽、至少 40px 高”一起撑成了 60px 的大方块） */
input[type="checkbox"], input[type="radio"] { accent-color: var(--green); width: 18px; height: 18px; min-width: 18px; min-height: 0; margin: 0; padding: 0; flex: none; vertical-align: middle; cursor: pointer; }
textarea { resize: vertical; line-height: 1.55; }

/* ---------- 徽标、身份 ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 2px 10px; border-radius: var(--pill); background: var(--wash); color: var(--ink-soft); font-size: 12.5px; font-weight: 550; line-height: 1.3; white-space: nowrap; border: 1px solid transparent; }
.chip.ok, .chip.done { background: var(--green-wash); color: var(--green-deep); }
.chip.warn, .chip.claimed { background: var(--warn-wash); color: var(--warn); }
.chip.delivered, .chip.delivering, .chip.queued { background: var(--info-wash); color: var(--info); }
.chip.rejected, .chip.failed { background: var(--danger-wash); color: var(--danger); }
.chip.expired, .chip.cancelled { background: var(--wash); color: var(--muted); }
.chip.background { background: var(--violet-wash); color: var(--violet); }
.chip-quiet { background: transparent; border-color: var(--line); }
.chip-host { background: var(--wash); color: var(--ink-soft); }
.chip-host.agent { background: var(--info-wash); color: var(--info); }
.chip-assist { background: var(--story); color: var(--story-ink); }
.chip-voice { background: var(--green-wash); color: var(--green-deep); }
.chip-mic { background: var(--story); color: var(--story-ink); }
.chip-vis { background: var(--ink); color: #fff; }
.chip-remote { background: var(--info-wash); color: var(--info); }
.chip-rt { background: var(--violet-wash); color: var(--violet); }
.chip-dm, .chip-mention, .chip-assist-tag, .chip-relay { min-height: 20px; padding: 1px 7px; font-size: 11px; }
.chip-dm { background: var(--pink-wash); color: var(--pink); }
.chip-mention { background: var(--info-wash); color: var(--info); }
.chip-mention.me { background: #fdf0c4; color: #6b4a00; }
.chip-assist-tag { background: var(--story); color: var(--story-ink); }
.chip-relay { background: var(--green-wash); color: var(--green-deep); }
.role-badge { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: var(--pill); font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft); }
.role-admin { background: var(--ink); color: #fff; border-color: var(--ink); }
.role-user, .role-viewer { background: var(--green-wash); color: var(--green-deep); border-color: var(--green-soft); }
.role-guest { background: var(--paper); color: var(--muted); border-style: dashed; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: var(--sprout); box-shadow: 0 0 0 3px rgba(95, 178, 74, .18); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex: none; }
.live-dot.on { background: var(--live); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(224, 54, 44, .5); } 70% { box-shadow: 0 0 0 7px rgba(224, 54, 44, 0); } 100% { box-shadow: 0 0 0 0 rgba(224, 54, 44, 0); } }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin .9s linear infinite; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; flex: none; border-color: rgba(11, 83, 56, .2); border-top-color: var(--green-deep); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 卡片、提示 ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.guest-note { background: var(--green-wash); border: 1px solid var(--green-soft); color: var(--green-deep); padding: 12px 16px; border-radius: var(--r); margin: 0 0 18px; font-size: 14px; line-height: 1.6; }
.guest-note a, .viewer-note a, .guest-link a { color: var(--green-deep); font-weight: 600; }
.offair-banner { display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; text-align: center; padding: 18px; margin-bottom: 18px; border-radius: var(--r-lg); background: var(--danger-wash); border: 1px solid var(--danger-line); color: var(--danger); }
.offair-banner b { font-size: 20px; letter-spacing: -.02em; }
.conn-banner { padding: 8px 20px; font-size: 13.5px; line-height: 1.5; background: var(--warn-wash); color: var(--warn); border-bottom: 1px solid var(--warn-line); flex: none; }
.conn-banner.info { background: var(--info-wash); color: var(--info); border-bottom-color: var(--info-line); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: var(--pill); font-size: 14px; z-index: 80; box-shadow: var(--sh); max-width: 90vw; text-align: center; }

/* ---------- 顶部导航（所有页面） ---------- */
.topnav { position: sticky; top: 0; z-index: 30; height: var(--nav-h); display: flex; align-items: center; gap: 16px; padding: 0 20px 0 14px; background: rgba(251, 252, 250, .88); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); flex: none; }
.topnav-left { display: flex; align-items: center; gap: 6px; min-width: 0; flex: none; }
.logo { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px; text-decoration: none; color: var(--ink); white-space: nowrap; border-radius: 12px; }
.logo:hover { color: var(--ink); }
.logo-mark { width: 30px; height: 30px; display: block; flex: none; }
.logo-word { font-size: 20px; font-weight: 700; letter-spacing: -.035em; }
.logo-word em { font-style: normal; color: var(--green); }
.logo-tag { font-size: 12.5px; font-weight: 650; color: var(--green-deep); background: var(--green-wash); padding: 2px 9px; border-radius: var(--pill); }
.search { flex: 1; max-width: 560px; margin: 0 auto; display: flex; align-items: center; min-width: 0; }
.search input { flex: 1; min-width: 0; height: 42px; min-height: 42px; border-radius: var(--pill) 0 0 var(--pill); padding: 0 18px; background: var(--paper); }
.search input:focus { position: relative; z-index: 1; }
.search-btn { width: 60px; height: 42px; min-height: 42px; padding: 0; margin-left: -1px; border-radius: 0 var(--pill) var(--pill) 0; background: var(--wash); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: none; }
.search-btn:hover:not(:disabled) { background: var(--wash-2); color: var(--ink); }
.search-btn svg { width: 20px; height: 20px; }
.topnav-right { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.pill-link, a.lang-switch { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: var(--pill); text-decoration: none; color: var(--ink-soft); font-size: 13.5px; font-weight: 550; white-space: nowrap; border: 1px solid transparent; }
.pill-link:hover, a.lang-switch:hover { background: var(--wash); color: var(--ink); }
a.lang-switch { border-color: var(--line); }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 50%; background: var(--green-deep); color: #fff; font-size: 15px; font-weight: 700; box-shadow: none; border: 2px solid var(--paper); outline: 1px solid var(--line); }
.avatar:hover:not(:disabled) { background: var(--green); color: #fff; }
.avatar-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-lg); z-index: 60; display: flex; flex-direction: column; gap: 2px; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.menu-name { font-weight: 650; }
.menu a, .menu button { display: flex; justify-content: flex-start; width: 100%; min-height: 38px; padding: 0 10px; border-radius: 10px; background: transparent; color: var(--ink); box-shadow: none; font-weight: 500; font-size: 14px; text-decoration: none; align-items: center; }
.menu a:hover, .menu button:hover:not(:disabled) { background: var(--wash); color: var(--ink); }

/* ---------- 首页：左侧导航 + 卡片网格 ---------- */
.home-page { min-height: 100vh; min-height: 100dvh; }
.shell { display: flex; align-items: flex-start; }
.sidenav { position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); height: calc(100dvh - var(--nav-h)); width: var(--side-w); flex: none; overflow-y: auto; padding: 12px 12px 20px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.nav-item { display: flex; align-items: center; gap: 16px; min-height: 42px; padding: 0 14px; border-radius: 12px; color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 550; white-space: nowrap; }
.nav-item svg { width: 20px; height: 20px; flex: none; }
.nav-item span { overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: var(--wash); color: var(--ink); }
.nav-item.active { background: var(--green-wash); color: var(--green-deep); font-weight: 650; }
.nav-count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--pill); background: var(--live); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 10px; flex: none; }
.nav-title { margin: 6px 14px 4px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.nav-foot { margin: auto 14px 0; padding-top: 18px; font-size: 12px; line-height: 1.6; color: var(--faint); }
body.nav-mini .sidenav { width: var(--side-mini); padding: 10px 6px; }
body.nav-mini .nav-item { flex-direction: column; justify-content: center; gap: 4px; min-height: 66px; padding: 6px 2px; font-size: 10.5px; font-weight: 550; white-space: normal; text-align: center; line-height: 1.25; }
body.nav-mini .nav-item span { max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
body.nav-mini .nav-title, body.nav-mini .nav-foot, body.nav-mini .nav-count, body.nav-mini .nav-sep { display: none; }
.nav-mask { position: fixed; inset: var(--nav-h) 0 0 0; background: rgba(22, 27, 24, .32); z-index: 35; }
.lobby { flex: 1; min-width: 0; }
.home { padding: 18px 28px 56px; }
.home-hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 2px 0 14px; }
.home-hero h1 { margin: 0; font-size: clamp(26px, 2.6vw, 34px); font-weight: 760; letter-spacing: -.05em; line-height: 1.15; }
.home-hero .lead { margin: 0; font-family: var(--serif); font-size: clamp(17px, 1.6vw, 21px); color: var(--ink-soft); letter-spacing: -.01em; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 18px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.fchip { min-height: 34px; padding: 0 14px; border-radius: 10px; background: var(--wash); color: var(--ink); border: 1px solid transparent; box-shadow: none; font-weight: 550; font-size: 13.5px; }
.fchip:hover:not(:disabled) { background: var(--wash-2); color: var(--ink); }
.fchip.active, .fchip.active:hover:not(:disabled) { background: var(--ink); color: #fff; }
.search-note { display: flex; align-items: center; gap: 10px; margin: -6px 0 16px; color: var(--ink-soft); font-size: 14px; }
.empty-state { margin: 28px 0; padding: 40px 20px; text-align: center; color: var(--ink-soft); background: var(--wash); border-radius: var(--r-lg); }
.empty-state b { display: block; font-size: 17px; color: var(--ink); margin-bottom: 4px; }
/* 第 29 轮追加 14：卡片按宽度排满一行（直播间少的时候不在右边留一大片空白）；只有一张时不放得太大 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 30px 20px; align-items: start; }
body[data-role="admin"] .cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.cards[data-n="1"] > .stream-card:not(.featured) { max-width: 760px; }
.stream-card { display: flex; flex-direction: column; min-width: 0; background: transparent; border: 0; box-shadow: none; border-radius: 0; }
/* 缩略图还没有（或者取不到）时显示品牌小树苗；图片加载好了盖在上面 */
.stream-card .thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: url("/assets/opengrove-sapling.svg") center / 64px no-repeat, radial-gradient(120% 120% at 20% 0%, #1c3a2c 0%, #0d1411 70%); box-shadow: var(--sh-xs); transition: box-shadow .2s; }
.stream-card:hover .thumb { box-shadow: var(--sh); }
.stream-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.stream-card:hover .thumb img { transform: scale(1.025); }
.thumb-lock { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; text-align: center; padding: 12px; color: var(--ink-soft); font-size: 14px; font-weight: 600; background: repeating-linear-gradient(135deg, #eef1ec 0 12px, #e8ece6 12px 24px); }
.thumb-lock svg { width: 26px; height: 26px; color: var(--muted); }
.thumb-chip { position: absolute; left: 10px; top: 10px; min-height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; background: rgba(22, 27, 24, .78); color: #fff; }
.thumb-chip.ok { background: var(--live); color: #fff; }
.thumb-viewers { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 0 8px; border-radius: 6px; background: rgba(0, 0, 0, .66); color: #fff; font-size: 12px; font-weight: 600; }
.thumb-viewers svg { width: 13px; height: 13px; }
.thumb-vis { position: absolute; right: 10px; top: 10px; min-height: 22px; padding: 0 8px; border-radius: 6px; background: rgba(255, 255, 255, .92); color: var(--ink); font-size: 11.5px; font-weight: 700; }
.card-body { padding: 12px 2px 0; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.card-head { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: start; }
.av-host { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; background: var(--green-wash); color: var(--green-deep); border: 1px solid var(--green-soft); }
.av-host.agent { background: var(--info-wash); color: var(--info); border-color: var(--info-line); }
.card-titles { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.card-body h3 { margin: 0; font-size: 16px; font-weight: 650; line-height: 1.35; letter-spacing: -.015em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-body h3 a { color: inherit; text-decoration: none; }
.card-body h3 a:hover { color: var(--green-deep); }
.card-body p { margin: 0; }
/* “主播 · 助播”只占一行：写成一行字（不是胶囊），放不下就省略号，完整内容在悬停提示里 */
.card-sub { margin: 0; color: var(--ink-soft); font-size: 13.5px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card-sub .chip { display: inline; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; color: inherit; font-size: inherit; font-weight: 550; line-height: inherit; white-space: nowrap; }
.card-sub .chip + .chip::before { content: '·'; margin: 0 6px; color: var(--faint); font-weight: 400; }
.card-sub .chip-host.agent { color: var(--info); }
.card-sub .chip-assist { color: var(--story-ink); font-weight: 500; }
.card-sub .dot { width: 6px; height: 6px; margin-left: 4px; vertical-align: middle; }
.card-desc, .status-text, .about-text { margin: 0; color: var(--muted); font-size: 13px; line-height: 19px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.status-text, .about-text { color: var(--ink-soft); }
.about-can { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.card-meta .chip { min-height: 22px; padding: 1px 9px; font-size: 12px; }
.card-meta > .muted { font-size: 12.5px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card-admin { margin-top: 2px; padding: 12px; border-radius: var(--r); background: var(--wash); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.card-admin-title { margin: 0; font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.card-admin .card-actions { gap: 8px; }
/* 置顶：根直播（整块桌面）在播、而且能看时占一整行 */
.stream-card.featured { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 26px; align-items: start; }
.stream-card.featured .thumb { border-radius: var(--r-lg); }
.stream-card.featured .card-body { padding-top: 4px; }
.stream-card.featured h3 { font-size: 22px; letter-spacing: -.035em; }
.host-select, .card-actions select, .card-admin select { min-height: 34px; padding: 4px 30px 4px 12px; font-size: 13px; border-radius: var(--pill); background-color: var(--paper); max-width: 100%; background-position: right 11px center; }
.assist-ctl, .voice-ctl, .vis-ctl, .rules-ctl, .mic-ctl { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rules-ctl { display: flex; }
.pick-pair { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.pick-pair select { min-width: 0; }
.rules-text { width: 100%; font: 12px/1.45 var(--mono); border-radius: 12px; }
.rt-hint { color: var(--violet); }
.voice-note { color: var(--green-deep); }
/* 勾选框和文字第一行对齐（文字折行时也不跑到两行中间） */
.relay-pick { display: inline-flex; align-items: flex-start; gap: 8px; min-height: 32px; padding: 6px 0; white-space: normal; line-height: 20px; font-size: 13.5px; color: var(--ink-soft); cursor: pointer; max-width: 100%; }
.relay-pick input[type="checkbox"], .relay-pick input[type="radio"] { margin-top: 1px; }
button.danger.close-stream { margin: 0; font-weight: 650; }
button.danger.close-stream:hover:not(:disabled) { background: var(--danger); color: #fff; border-color: var(--danger); }

/* 管理台（只给管理员）：开播 / 下播、邀请、开一路、助播、语音、主播、派驻端 */
.admin-panel { margin-top: 44px; display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; align-items: start; scroll-margin-top: calc(var(--nav-h) + 16px); }
.section-head { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 2px; }
.section-head h2 { margin: 0; font-size: 24px; font-weight: 760; letter-spacing: -.045em; }
.section-head p { margin: 0; font-family: var(--serif); color: var(--ink-soft); font-size: 17px; }
.admin-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--sh-sm); scroll-margin-top: calc(var(--nav-h) + 16px); }
details.admin-box > summary, .assist-new > summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
details.admin-box > summary::-webkit-details-marker, .assist-new > summary::-webkit-details-marker, .roles-box > summary::-webkit-details-marker { display: none; }
details.admin-box > summary::after, .assist-new > summary::after, .roles-box > summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; flex: none; }
details[open].admin-box > summary::after, details[open].assist-new > summary::after, details[open].roles-box > summary::after { transform: rotate(225deg) translate(-2px, -2px); }
details[open].admin-box > summary { margin-bottom: 10px; }
details.admin-box.flash { box-shadow: 0 0 0 3px rgba(17, 133, 84, .35), var(--sh); }
.onair-box { display: flex; flex-direction: column; gap: 8px; }
.onair-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.onair-row .btn, .onair-row button { margin: 0; }
.open-form { display: grid; gap: 10px; margin: 6px 0 4px; }
.open-form label { display: grid; gap: 5px; font-size: 13px; color: var(--ink-soft); font-weight: 550; }
.open-form input:not([type="checkbox"]):not([type="radio"]), .open-form select, .open-form textarea { width: 100%; font-size: 14.5px; min-height: 40px; }
.open-form .relay-pick { display: inline-flex; }
.open-form button { justify-self: start; }
.inv-routes { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.inv-routes legend { padding: 0; margin-bottom: 4px; color: var(--ink-soft); font-weight: 550; }
.hosts-list { list-style: none; margin: 10px 0 4px; padding: 0; display: grid; gap: 8px; }
.host-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--wash); }
.host-row button { margin-left: auto; }
.host-caps { max-width: 420px; }
.assist-persona { flex-basis: 100%; margin: 0; color: var(--ink-soft); }
.assist-new { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.assist-new > summary { font-size: 14px; }
.copy-text { width: 100%; font: 13px/1.5 var(--mono); background: var(--wash); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; margin-bottom: 8px; resize: vertical; }

/* ---------- 观看页：画面 + 信息条 + 聊天 ---------- */
.room-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.room { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--chat-w); gap: 20px; padding: 16px 20px 18px; }
.stage { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin; }
/* 画面保持 16:9：高度上给顶部导航、信息条、播放条、说明留出约 250px */
.player, .watch-info, .player-bar, .hint { width: min(100%, calc((100dvh - 250px) * 16 / 9)); margin-left: auto; margin-right: auto; }
.player { position: relative; flex: none; aspect-ratio: 16 / 9; background: #000; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh); }
.player video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; color: #f1f5f2; font-size: 16px; background: rgba(5, 10, 8, .62); text-align: center; padding: 20px; }
.offair-overlay { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; text-align: center; padding: 20px; background: rgba(13, 20, 17, .94); color: #fbe2df; }
.offair-overlay b { font-size: 24px; letter-spacing: -.03em; }
.locked-panel { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; text-align: center; padding: 20px; background: radial-gradient(120% 120% at 30% 0%, #1c3a2c 0%, #0d1411 70%); color: #e9efe9; z-index: 2; }
.locked-panel strong { font-size: 20px; letter-spacing: -.02em; }
.locked-panel .muted { color: #b8c4bc; }
.locked-panel .btn { background: #fff; color: var(--ink); }
.sound-cta { position: absolute; left: 14px; bottom: 14px; z-index: 4; min-height: 36px; background: rgba(255, 255, 255, .94); color: var(--ink); border: 0; border-radius: var(--pill); padding: 0 16px; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.sound-cta:hover:not(:disabled) { background: #fff; color: var(--ink); }
.watch-info { flex: none; margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.watch-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.watch-title { margin: 0; font-size: 21px; font-weight: 720; letter-spacing: -.035em; line-height: 1.25; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-sub { color: inherit; }
.watch-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.player-bar { flex: none; display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.hint { flex: none; color: var(--muted); font-size: 13px; margin-top: 8px; margin-bottom: 0; }

.chat { display: flex; flex-direction: column; min-height: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--sh-sm); overflow: hidden; }
.chat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex: none; }
.chat-head h2 { margin: 0; font-size: 16px; font-weight: 720; letter-spacing: -.025em; }
.chat-body { position: relative; flex: 1; min-height: 0; }
.chat-list { list-style: none; margin: 0; padding: 14px 16px; height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; scrollbar-width: thin; }
.chat-list .empty { color: var(--muted); text-align: center; margin: auto 0; padding: 20px 10px; line-height: 1.65; }
.new-msgs { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); min-height: 32px; font-size: 13px; }
.m { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
.av { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.m-admin .av { background: var(--info-wash); color: var(--info); }
.m-manus .av { background: var(--green-wash); color: var(--green-deep); }
.av.av-assist { background: var(--story); color: var(--story-ink); }
.m-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.m-name { font-weight: 700; font-size: 13px; color: var(--ink); }
.m-admin .m-name { color: var(--info); }
.m-manus .m-name { color: var(--green-deep); }
.m-bubble { margin-top: 4px; padding: 9px 12px; border-radius: 4px 14px 14px 14px; background: var(--wash); line-height: 1.6; word-break: break-word; white-space: pre-wrap; font-size: 14.5px; color: var(--ink); }
.m-manus .m-bubble { background: var(--green-wash); border: 1px solid var(--green-soft); color: #0e2a1e; }
.m-manus.rejected .m-bubble { background: var(--warn-wash); border-color: var(--warn-line); color: #4a3405; }
li.mention-me .m-bubble { outline: 2px solid #f0c64a; outline-offset: 1px; }
.m-quote { margin-top: 4px; padding-left: 8px; border-left: 2px solid var(--line-strong); color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-note { margin-top: 6px; display: flex; gap: 6px; align-items: center; color: var(--warn); font-size: 13px; }
.m-note.m-bg { color: var(--violet); }
.m-note.m-queue { color: var(--info); }
.m-error { margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.m-actions { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.m-actions summary { cursor: pointer; user-select: none; }
.m-actions ol { margin: 4px 0 0; padding-left: 20px; }
.m-actions li.bad { color: var(--danger); }
.m-tools { margin-top: 4px; }
.tag-test { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--wash-2); color: var(--ink-soft); }
.now-working { display: flex; gap: 8px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--green-soft); background: var(--green-wash); color: var(--green-deep); font-size: 13px; line-height: 1.5; flex: none; }

/* 评论输入：大输入框 + 私聊开关 + @ 下拉 + 发送 */
.composer { padding: 12px 14px 12px; border-top: 1px solid var(--line); background: var(--paper); flex: none; }
.composer-box { border: 1px solid var(--line-strong); border-radius: 18px; background: var(--paper); transition: border-color .15s, box-shadow .15s; }
.composer-box:focus-within { border-color: var(--green); box-shadow: var(--focus); }
.composer.dm-on .composer-box { border-color: var(--pink-line); box-shadow: 0 0 0 3px rgba(163, 56, 109, .12); }
.composer textarea { display: block; width: 100%; border: 0; border-radius: 18px 18px 0 0; box-shadow: none; background: transparent; min-height: 88px; max-height: 180px; padding: 12px 15px 6px; font-size: 15px; resize: none; }
.composer textarea:focus { box-shadow: none; }
.composer-row { display: flex; align-items: center; gap: 8px; }
.composer-opts { flex-wrap: nowrap; gap: 6px; padding: 6px 8px 8px 10px; }
.composer-opts .spacer { min-width: 2px; }
.composer-opts #comment-btn { flex: none; padding: 0 14px; }
.dm-pick { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px 0 8px; border-radius: var(--pill); background: var(--wash); color: var(--ink-soft); font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; white-space: nowrap; transition: background .15s, color .15s; }
.dm-pick input { appearance: none; -webkit-appearance: none; width: 30px; height: 18px; border-radius: var(--pill); background: var(--line-strong); position: relative; cursor: pointer; transition: background .15s; flex: none; border: 0; }
.dm-pick input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.dm-pick input:checked { background: var(--pink); }
.dm-pick input:checked::after { transform: translateX(12px); }
.dm-pick:has(input:checked) { background: var(--pink-wash); color: var(--pink); }
.dm-pick svg { width: 14px; height: 14px; flex: none; }
select.to-pick { flex: 0 1 auto; min-width: 92px; text-overflow: ellipsis; min-height: 34px; height: 34px; max-width: 160px; padding: 0 30px 0 12px; border-radius: var(--pill); background-color: var(--wash); border-color: transparent; font-size: 13px; font-weight: 600; color: var(--ink-soft); background-position: right 11px center; }
select.to-pick:hover { background-color: var(--wash-2); }
#comment-count { font-size: 12px; white-space: nowrap; display: none; }
.composer.near #comment-count { display: inline; }
.composer.near #comment-count.over, .composer.near.full #comment-count { color: var(--danger); }
#comment-btn { min-height: 36px; padding: 0 18px; }
.composer-status { min-height: 0; margin: 6px 4px 0; }
.composer-status:empty { display: none; }
.composer-tip { margin: 8px 2px 0; color: var(--muted); }
.viewer-note { padding: 14px 18px; color: var(--ink-soft); font-size: 14px; line-height: 1.65; flex: none; }
.guest-panel .viewer-note { border-top: 0; }
.guest-cta { padding: 0 18px 18px; }

/* 管理员的控制抽屉（观看页） */
.drawer-mask { position: fixed; inset: 0; background: rgba(22, 27, 24, .32); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; height: 100dvh; width: min(420px, 92vw); background: var(--paper); border-left: 1px solid var(--line); box-shadow: var(--sh-lg); z-index: 50; transform: translateX(105%); transition: transform .2s ease; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 17px; letter-spacing: -.03em; }
.controls { padding: 10px 18px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.controls .ctl-loading { margin: 0 0 6px; display: none; }
.controls.loading .ctl-loading { display: block; }
.controls.loading .switch { opacity: .5; cursor: default; }
.controls button.danger { width: 100%; margin-top: 10px; }
.switch { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 11px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch input { width: 18px; height: 18px; margin-top: 2px; }
.switch b { display: block; font-weight: 650; font-size: 14.5px; }
.switch small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.5; margin-top: 2px; }

/* 确认弹窗 */
.modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(22, 27, 24, .36); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); padding: 16px; }
.modal-card { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; max-width: 540px; width: 100%; padding: 22px 22px 18px; box-shadow: var(--sh-lg); max-height: 90dvh; overflow-y: auto; }
.modal-card h3 { margin: 0 0 10px; font-size: 19px; letter-spacing: -.035em; }
.modal-body ul { margin: 8px 0 14px; padding-left: 20px; color: var(--ink-soft); line-height: 1.65; font-size: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal-actions button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.modal-actions button.danger:hover:not(:disabled) { background: #a02a20; color: #fff; }

/* ---------- 登录页 ---------- */
.login-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 0 16px 48px; background: radial-gradient(1000px 520px at 50% -12%, #e9f1ea 0%, var(--bg) 62%); }
.login-nav { width: 100%; max-width: 1120px; height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; }
.login-card { width: 100%; max-width: 460px; margin-top: 3vh; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 34px 32px 26px; box-shadow: var(--sh-lg); }
.login-card h1 { margin: 0; font-size: 30px; font-weight: 760; letter-spacing: -.05em; line-height: 1.15; }
.login-card .sub { margin: 8px 0 24px; font-family: var(--serif); font-size: 17px; line-height: 1.5; color: var(--ink-soft); }
.login-card label { display: block; margin: 0 0 7px; font-weight: 600; font-size: 13.5px; color: var(--ink-soft); }
.login-card input:not([type="checkbox"]):not([type="radio"]) { display: block; width: 100%; height: 50px; min-height: 50px; font-size: 16px; border-radius: 16px; padding: 0 16px; }
.login-card #code { letter-spacing: .06em; }
.login-card form > button[type="submit"] { width: 100%; min-height: 50px; margin-top: 12px; font-size: 15.5px; border-radius: 16px; }
.email-row { display: flex; gap: 8px; align-items: stretch; }
.email-row + .email-row { margin-top: 10px; }
.email-row input { flex: 1 1 auto; width: auto; min-width: 0; }
.email-row button { flex: none; width: auto; min-height: 50px; padding: 0 20px; border-radius: 16px; }
.login-card .msg { margin: 10px 2px 0; font-size: 13.5px; line-height: 1.5; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 24px 0 18px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.guest-link { margin: 20px 0 0; font-size: 14.5px; text-align: center; }
.roles-box { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.roles-box > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.roles { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.roles li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-radius: var(--r-sm); background: var(--wash); font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); }
.roles li b { color: var(--ink); }
.login-card .foot { color: var(--muted); font-size: 12.5px; margin: 14px 0 0; line-height: 1.6; }
.login-legal { margin-top: 18px; font-size: 12px; color: var(--faint); text-align: center; }

/* ---------- 审计面板 ---------- */
.audit-page { min-height: 100vh; min-height: 100dvh; }
.audit { max-width: 1200px; margin: 0 auto; padding: 22px 24px 56px; }
.audit-page .admin-box { margin-bottom: 14px; }
.audit-page h3 { margin: 0 0 12px; font-size: 17px; letter-spacing: -.03em; }
.audit-hero h1 { margin: 0 0 4px; font-size: 28px; font-weight: 760; letter-spacing: -.05em; }
.audit-hero p { margin: 0 0 18px; font-family: var(--serif); color: var(--ink-soft); font-size: 17px; }
.audit-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.audit-filters label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-soft); font-weight: 550; }
.audit-filters select, .audit-filters input { min-height: 38px; font-size: 14px; border-radius: 12px; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.audit-table th, .audit-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.audit-table th { color: var(--muted); font-weight: 650; font-size: 12.5px; }
.audit-table tbody tr:hover td { background: var(--wash); }
.audit-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.audit-table td.bad, .audit-events li.bad { color: var(--danger); }
.audit-table tr.muted td { color: var(--muted); }
.table-wrap { overflow-x: auto; }
.audit-traces { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.audit-trace details { background: var(--wash); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; }
.audit-trace summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.audit-models { flex-basis: 100%; }
.audit-text { margin: 6px 0; color: var(--ink-soft); font-size: 13.5px; }
.audit-events { list-style: none; margin: 6px 0 2px; padding: 0; font-size: 13px; }
.audit-events li { display: grid; grid-template-columns: 70px 150px 1fr; gap: 8px; padding: 4px 0; border-top: 1px dashed var(--line); }
.audit-events .ev-at { color: var(--muted); font-variant-numeric: tabular-nums; }
.audit-events .ev-detail { color: var(--ink-soft); word-break: break-word; }

/* ---------- 响应式 ---------- */
@media (max-width: 1279px) { :root { --chat-w: 360px; } }
@media (max-width: 1100px) {
  .sidenav { width: var(--side-mini); padding: 10px 6px; }
  .nav-item { flex-direction: column; justify-content: center; gap: 4px; min-height: 66px; padding: 6px 2px; font-size: 10.5px; white-space: normal; text-align: center; line-height: 1.25; }
  .nav-item span { max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .nav-title, .nav-foot, .nav-count, .nav-sep { display: none; }
  body.nav-wide .sidenav { position: fixed; left: 0; top: var(--nav-h); bottom: 0; height: auto; z-index: 40; width: var(--side-w); padding: 12px 12px 20px; background: var(--paper); box-shadow: var(--sh-lg); }
  body.nav-wide .nav-item { flex-direction: row; justify-content: flex-start; gap: 16px; min-height: 42px; padding: 0 14px; font-size: 14px; white-space: nowrap; text-align: left; }
  body.nav-wide .nav-item span { display: block; }
  body.nav-wide .nav-title, body.nav-wide .nav-foot, body.nav-wide .nav-sep { display: block; }
  body.nav-wide .nav-count { display: inline-grid; }
  .stream-card.featured { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .stream-card.featured .card-body { padding-top: 12px; }
}
@media (max-width: 900px) {
  .room { display: flex; flex-direction: column; padding: 0; gap: 0; }
  .stage { flex: none; overflow: visible; }
  .player, .watch-info, .player-bar, .hint { width: 100%; }
  .player { border-radius: 0; box-shadow: none; max-height: 42dvh; }
  .watch-info { margin: 0; padding: 10px 14px 4px; gap: 8px; }
  .watch-title { font-size: 16px; }
  .watch-meta { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .watch-meta::-webkit-scrollbar { display: none; }
  .player-bar { margin: 0; padding: 4px 12px 8px; border-bottom: 1px solid var(--line); }
  .player-bar #player-stats { display: none; }
  .hint, .composer-tip { display: none; }
  .chat { flex: 1; border-radius: 0; border: 0; box-shadow: none; }
  .chat-head { padding: 10px 14px; }
  .chat-list { padding: 10px 12px; gap: 12px; }
  .composer { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .composer textarea { min-height: 60px; font-size: 15px; }
  .topnav { gap: 8px; padding: 0 10px 0 6px; }
  .room-page .search { display: none; }
  .home-page .search { max-width: none; }
  .room-page .topnav-right .pill-link:not(.lang-switch), .room-page .role-badge { display: none; }
  .chip { font-size: 12px; }
}
@media (max-width: 760px) {
  :root { --nav-h: 58px; }
  .sidenav { position: fixed; left: 0; top: var(--nav-h); bottom: 0; height: auto; z-index: 40; width: min(var(--side-w), 84vw); padding: 12px 12px 20px; background: var(--paper); box-shadow: var(--sh-lg); transform: translateX(-105%); transition: transform .2s ease; }
  body.nav-open .sidenav { transform: none; }
  .nav-item { flex-direction: row; justify-content: flex-start; gap: 16px; min-height: 44px; padding: 0 14px; font-size: 14.5px; white-space: nowrap; text-align: left; }
  .nav-item span { display: block; }
  .nav-title, .nav-foot, .nav-sep { display: block; }
  .nav-count { display: inline-grid; }
  .home { padding: 12px 14px 40px; }
  .home-hero { margin-bottom: 10px; }
  .home-hero .lead { display: none; }
  .cards, body[data-role="admin"] .cards { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .admin-panel { grid-template-columns: minmax(0, 1fr); margin-top: 32px; }
  .logo-word { font-size: 18px; }
  .home-page .logo-tag, .audit-page .logo-tag { display: none; }
  .home-page .search { flex: 1; }
  .home-page .search input { height: 38px; min-height: 38px; padding: 0 12px; font-size: 14px; }
  .home-page .search-btn { width: 44px; height: 38px; min-height: 38px; }
  .home-page .topnav-right .role-badge, .home-page .topnav-right .lang-switch, .audit-page .role-badge { display: none; }
  .topnav-right { gap: 6px; }
  .topnav-right .btn { min-height: 34px; padding: 0 14px; font-size: 13px; }
  .login-card { padding: 26px 20px 22px; border-radius: 24px; margin-top: 1vh; }
  .login-card h1 { font-size: 26px; }
  .audit { padding: 14px 12px 40px; }
  .audit-events li { grid-template-columns: 56px 1fr; }
  .audit-events .ev-detail { grid-column: 2; }
  .audit-table { font-size: 12px; }
}
@media (max-width: 600px) {
  .room-page .logo-tag { display: none; }
  .room-page .logo-word { font-size: 17px; }
  .room-page .topnav-right { gap: 4px; }
  .room-page .topnav-right button.small, .room-page .topnav-right .btn.small, .room-page a.lang-switch { min-height: 32px; padding: 0 10px; font-size: 12.5px; }
  #chip-manus { display: none; }
  .player-bar { flex-wrap: nowrap; gap: 6px; }
  .player-bar #player-mode { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
  .player-bar .spacer { display: none; }
  .player-bar button.small { padding: 0 9px; font-size: 12px; }
  .composer-opts { gap: 6px; }
  select.to-pick { max-width: 140px; }
}
@media (max-width: 420px) {
  .email-row { flex-direction: column; }
  .email-row button { width: 100%; }
  .home-page .logo-word { display: none; }
}
/* 第 29 轮追加 9：iOS Safari 遇到字号小于 16px 的输入框、文本框、下拉框，一获得焦点就把整页放大，而且不会自己缩回去。
   手机和触屏设备上所有输入控件至少 16px（不禁止用户自己缩放）。 */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px !important; }
  select.to-pick { max-width: 150px; }
}
/* 第 29 轮追加 13：按住说话（按住录音，松开识别成文字填进输入框，确认后自己点发送）。只有麦克风图标，挨着“发送”（评论框窄，带字会把 @ 下拉和发送按钮挤出去） */
.ptt { flex: none; width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; justify-content: center; border-radius: 50%; background: var(--wash); color: var(--ink-soft); border: 1px solid transparent; box-shadow: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.ptt svg { width: 18px; height: 18px; flex: none; }
.ptt:hover:not(:disabled) { background: var(--wash-2); color: var(--ink); }
.ptt.wait { background: var(--wash-2); color: var(--ink); }
.ptt.rec, .ptt.rec:hover:not(:disabled) { background: var(--live); color: #fff; animation: pulse 1.4s infinite; }
.ptt.busy { opacity: .7; }
.ptt.unsupported { opacity: .55; }

/* ---- 第 31 轮：直播间经营方案 ---- */
/* 开了游客发言的直播间：游客也有聊天栏和输入框（别的直播间照旧只给登录的人） */
body[data-role="guest"][data-guestchat="1"] aside.chat.guest-chat-ok { display: flex !important; }
body[data-role="guest"][data-guestchat="1"] form.composer.guest-chat-ok { display: block !important; }
body[data-role="guest"][data-guestchat="1"] .guest-panel { display: none !important; }
body:not([data-role="guest"]) .guest-tip, body[data-role="guest"]:not([data-guestchat="1"]) .guest-tip { display: none !important; }
body[data-role="guest"] .guest-tip ~ .user-tip, body[data-role="guest"] .user-tip { display: none !important; }
/* 准备中的直播间：普通观众看到“正在准备”，不是“请登录” */
body[data-preparing="1"] .lock-default, body:not([data-preparing="1"]) .lock-preparing { display: none !important; }
.room-intro { margin: 10px 0 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); display: flex; flex-direction: column; gap: 8px; }
.room-intro p { margin: 0; line-height: 1.5; }
.room-intro-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.m.order-ticket .m-bubble { background: var(--green-wash); border: 1px dashed var(--green); }
.m.order-ticket .av { background: var(--green); color: #fff; }
.m.secret-hint .m-bubble { font-style: italic; opacity: 0.85; }
.chip.chip-order { background: var(--green-wash); color: var(--green-deep); }
.my-orders { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 13px; display: flex; flex-direction: column; gap: 4px; background: var(--paper); }
.my-orders b { font-weight: 600; }
.my-orders a { color: var(--green); }
.room-admin { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; gap: 8px; }
.room-admin .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.room-admin ul { margin: 0; padding-left: 18px; font-size: 13px; }
.room-admin li.ok::marker { color: var(--green); }
.room-admin li.bad::marker { color: #b42318; }
.room-admin textarea.pb-text { width: 100%; min-height: 220px; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
.room-admin input { min-width: 0; }

/* 第 34 轮：私密模式（只有管理员和运营者在场；聊天、画面不带出去） */
.private-banner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 8px 12px 0; padding: 10px 12px; border-radius: 12px; background: #2b2140; color: #f1eaff; font-size: 13px; line-height: 1.5; }
.private-banner b { font-size: 13px; }
.private-banner .muted { color: #cdbff0; }
.m.m-private { box-shadow: inset 3px 0 0 #8b5cf6; }
.m.m-private .m-name::before { content: '🔒 '; }
.secret-box { margin: 8px 4px 0; }
.secret-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.secret-form input { flex: 1 1 160px; min-width: 0; }
.secret-form p { flex: 1 0 100%; margin: 0; }
.private-ops { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; }
.private-ops input { flex: 1 1 200px; min-width: 0; }
#btn-private.warn { background: #8b5cf6; color: #fff; }
.thumb-vis.thumb-private { background: #2b2140; color: #f1eaff; }
.private-toggle.warn { background: #8b5cf6; color: #fff; }
