:root {
  --bg: #0e1116;
  --panel: #171b22;
  --panel2: #1e242d;
  --text: #e6e9ee;
  --muted: #9aa4b2;
  --accent: #4f8cff;
  --ok: #38c172;
  --err: #ff5c5c;
  --border: #2a313b;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}
header {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
h1 { font-size: 18px; margin: 0; letter-spacing: 1px; }
.tag {
  font-size: 12px; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 10px;
  padding: 1px 8px; margin-left: 6px;
}
.status { margin-left: auto; font-size: 13px; color: var(--muted); }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }
main { padding: 16px 20px; max-width: 1100px; margin: 0 auto; }
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; margin-bottom: 14px;
}
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 4px; }
select, input {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 9px; font-size: 14px;
}
input[readonly] { width: 100%; }
button {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 16px; font-size: 14px; cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.big { font-size: 18px; padding: 14px 28px; border-radius: 12px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
a { text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
p { line-height: 1.6; }

.stage {
  position: relative; background: #000;
  border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; aspect-ratio: 16 / 9;
}
.stage video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.stats {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(0, 0, 0, 0.6); color: #cfe;
  font-size: 12px; padding: 5px 9px; border-radius: 8px;
  font-variant-numeric: tabular-nums; pointer-events: none;
}
.toolbar { position: absolute; right: 10px; top: 10px; display: flex; gap: 8px; }
.overlay {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.78); cursor: pointer;
}
.overlay[hidden] { display: none; }
.overlay.passive { pointer-events: none; }

/* 观看页:舞台占满视口 */
.watch-main { padding: 12px 16px; max-width: none; }

.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.mode-card { min-height: 220px; display: flex; flex-direction: column; align-items: flex-start; }
.mode-card h2 { margin-top: 0; }
.narrow { max-width: 420px; }
.warn { color: #ffd166; }
.error { color: var(--err); }
#streamPanel label { display: flex; margin: 12px 0; }
#streamPanel input { width: 100%; }

.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.mode-card { min-height: 210px; display: flex; flex-direction: column; align-items: flex-start; }
.mode-card h2 { margin: 0; font-size: 20px; }
.mode-card p { flex: 1; }
.narrow { max-width: 440px; margin: 36px auto; }
.warn { color: #ffcc66; }
.error { color: var(--err); }
#streamPanel label { margin: 12px 0; }
#streamPanel input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.offline-card { text-align: center; color: var(--text); }
.offline-card p { color: var(--muted); }
.watch-main .stage { aspect-ratio: auto; height: calc(100vh - 92px); }
@media (max-width: 600px) { .toolbar select { max-width: 150px; } }
