:root {
  color-scheme: dark;
  --bg: #0d1325;
  --bg2: #141a31;
  --card: rgba(255,255,255,.08);
  --card2: rgba(255,255,255,.12);
  --ink: #f8f7ff;
  --muted: #b9c0d6;
  --line: rgba(255,255,255,.14);
  --accent: #9b8cff;
  --accent2: #f2c6de;
  --shadow: 0 24px 80px rgba(0,0,0,.32);
  --radius: 26px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at top left, #28315e 0, var(--bg) 42%, #090d18 100%); color: var(--ink); }
body { padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
button, input, textarea, select { font: inherit; }
button, .file-button { border: 0; border-radius: 999px; padding: 12px 16px; background: var(--card2); color: var(--ink); cursor: pointer; transition: .18s ease; white-space: nowrap; }
button:hover, .file-button:hover { transform: translateY(-1px); background: rgba(255,255,255,.18); }
button.primary { background: linear-gradient(135deg, var(--accent), #6fd6ff); color: #11172b; font-weight: 800; }
button.ghost { background: transparent; border: 1px solid var(--line); }
button.full { width: 100%; }
button:disabled { opacity: .55; cursor: not-allowed; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 18px; padding: 12px 13px; background: rgba(255,255,255,.08); color: var(--ink); outline: none; }
textarea { min-height: 92px; resize: vertical; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
input::placeholder, textarea::placeholder { color: rgba(231,235,255,.45); }
.app-shell { max-width: 1180px; margin: 0 auto; }
.hero, .panel { border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.07)); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.hero { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; border-radius: 34px; padding: 24px; margin-bottom: 16px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(30px, 6vw, 56px); letter-spacing: -.05em; }
h2 { margin-bottom: 0; font-size: 22px; }
.hero-copy { max-width: 760px; margin-bottom: 0; color: var(--muted); line-height: 1.8; }
.eyebrow { margin-bottom: 8px; color: var(--accent2); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero-actions, .button-row { display: flex; gap: 10px; align-items: center; }
.button-row.wrap { flex-wrap: wrap; }
.panel { border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.panel-title-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.one { grid-template-columns: 1fr; }
.room-input { max-width: 160px; text-transform: uppercase; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 11px; background: rgba(255,255,255,.11); color: var(--muted); font-size: 12px; }
.pill.strong { background: rgba(155,140,255,.22); color: #fff; font-weight: 800; }
.status-line { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(330px, .9fr); gap: 16px; align-items: start; }
.video-wrap { position: relative; overflow: hidden; border-radius: 24px; background: #02040a; border: 1px solid rgba(255,255,255,.12); aspect-ratio: 16 / 9; margin-bottom: 14px; }
video { width: 100%; height: 100%; display: block; background: #02040a; }
.subtitle-overlay { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); max-width: 88%; padding: 7px 12px; border-radius: 12px; color: #fff; background: rgba(0,0,0,.56); text-shadow: 0 1px 3px rgba(0,0,0,.9); font-size: clamp(14px, 2.8vw, 22px); line-height: 1.45; text-align: center; pointer-events: none; }
.danmaku-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.danmaku { position: absolute; right: -80%; white-space: nowrap; color: #fff; font-weight: 800; text-shadow: 0 1px 5px #000; animation: fly 8s linear forwards; }
@keyframes fly { from { transform: translateX(0); } to { transform: translateX(-180vw); } }
.file-button { display: inline-flex; align-items: center; overflow: hidden; position: relative; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.tab { padding: 10px 8px; border-radius: 16px; }
.tab.active { background: var(--accent); color: #151827; font-weight: 900; }
.tab-page { display: none; }
.tab-page.active { display: block; }
.log { height: 330px; overflow: auto; padding: 12px; border-radius: 20px; background: rgba(0,0,0,.18); border: 1px solid var(--line); }
.log-item { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.log-item:last-child { border-bottom: 0; }
.log-meta { color: var(--accent2); font-size: 12px; margin-bottom: 3px; }
.composer { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-top: 10px; }
#tab-notes .composer { grid-template-columns: 1fr auto; }
.card-preview { margin-top: 12px; padding: 16px; border-radius: 22px; background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(155,140,255,.13)); border: 1px solid var(--line); line-height: 1.75; white-space: pre-wrap; }
.hall-list { display: grid; gap: 10px; margin: 12px 0; }
.hall-item { padding: 12px; border-radius: 18px; background: rgba(255,255,255,.08); border: 1px solid var(--line); }
dialog { border: 1px solid var(--line); border-radius: 24px; background: #151b31; color: var(--ink); max-width: 420px; padding: 22px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.55); }
.small { color: var(--muted); font-size: 13px; line-height: 1.7; }
@media (max-width: 860px) {
  body { padding-left: 10px; padding-right: 10px; }
  .hero { display: block; padding: 20px; }
  .hero-actions { margin-top: 16px; flex-wrap: wrap; }
  .grid.two, .layout { grid-template-columns: 1fr; }
  .button-row { flex-wrap: wrap; }
  .room-input { max-width: 100%; }
  .composer, #tab-notes .composer { grid-template-columns: 1fr; }
  .log { height: 260px; }
}
@media (display-mode: standalone) {
  body { background: var(--bg); }
  .hero-copy::after { content: " 已从主屏幕启动。"; color: var(--accent2); }
}
