* { box-sizing: border-box; }
:root {
  --bg: #0b1220; --panel: #131e31; --line: #24344c;
  --ink: #e8eef7; --muted: #8ea1bb; --brand: #3b82f6; --ok: #22c55e; --danger: #ef4444;
}
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
body { font: 14px/1.5 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; }
.hidden { display: none !important; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: #101a2b; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-size: 15px; }
.brand em { font-style: normal; font-size: 11px; color: var(--muted); margin-left: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #38bdf8; box-shadow: 0 0 0 4px #38bdf833; }
.top-right { display: flex; align-items: center; gap: 14px; }
.link { color: var(--muted); font-size: 12px; text-decoration: none; }
.badge { font-size: 12px; padding: 5px 12px; border-radius: 999px; font-weight: 600; }
.badge.off { background: #ffffff12; color: var(--muted); }
.badge.wait { background: #f59e0b22; color: #fbbf24; }
.badge.on { background: #22c55e22; color: #6ee7a7; }
.badge.bad { background: #ef444422; color: #fca5a5; }
.eyebrow { display: block; font-size: 11px; letter-spacing: .12em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.join { display: grid; place-items: center; padding: 48px 20px; }
.join-card { width: 100%; max-width: 480px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.join-card h1 { font-size: 23px; margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 13px; }
.join-form { display: grid; gap: 14px; margin-top: 20px; }
.join-form label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.join-form input { padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line); background: #0e1828; color: var(--ink); font: inherit; outline: none; }
.join-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px #3b82f622; }
#code { font: 700 24px/1.2 Consolas, monospace; letter-spacing: .3em; }
.btn { padding: 12px 18px; border-radius: 8px; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: #2563eb; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.hint { font-size: 12px; color: #fbbf24; min-height: 18px; margin: 14px 0 0; }
.console { padding: 16px 20px 28px; max-width: 1400px; margin: 0 auto; }
.stage { position: relative; background: #050a12; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; max-height: 72vh; }
#screen { width: 100%; height: 100%; display: block; object-fit: contain; background: #050a12; }
.capture { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.capture.disabled { cursor: not-allowed; background: #050a1255; }
.stage-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; font-size: 13px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.tool { padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tool:hover { border-color: var(--brand); }
.tool.danger { border-color: #7f1d1d; color: #fca5a5; }
.tool.danger:hover { background: #7f1d1d33; }
.sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.text-send { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.text-send input { flex: 1; min-width: 120px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: #0e1828; color: var(--ink); font: inherit; outline: none; }
.text-send input:focus { border-color: var(--brand); }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.metric span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.metric strong { font-size: 14px; font-weight: 600; }
.notice-wrap { margin-top: 16px; }
.notices { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; height: 108px; overflow: auto; font: 12px/1.7 Consolas, monospace; color: #b9c8dc; }
.notices div { border-bottom: 1px solid #ffffff08; padding: 2px 0; }
.tip { color: var(--muted); font-size: 11px; margin-top: 10px; }
.touch-only { display: none; }
@media (max-width: 860px) {
  .console { padding: 10px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .text-send { min-width: 100%; }
  .tool { padding: 10px 12px; }
  .touch-only { display: inline-block; }
  .stage { aspect-ratio: auto; height: 52vh; }
}
