:root {
  --bg: #0f1420;
  --panel: #1a2233;
  --line: #2c3650;
  --text: #e8edf7;
  --muted: #93a0bd;
  --accent: #3b82f6;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  -webkit-user-select: none;
  user-select: none;
}

/* 顶部状态条 */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 15px; margin: 0; font-weight: 600; }
.spacer { flex: 1; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 0 rgba(0,0,0,0); }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.err { background: var(--danger); }
.badge { font-size: 12px; color: var(--muted); padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; }
.badge.live { color: #fff; background: var(--danger); border-color: var(--danger); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%{opacity:1} 50%{opacity:.45} 100%{opacity:1} }

/* 通用按钮 */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); padding: 10px 14px; border-radius: 10px; font-size: 14px;
  cursor: pointer; transition: .15s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.success { background: var(--ok); border-color: var(--ok); color: #06281a; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.field label { font-size: 13px; color: var(--muted); }
.field input {
  background: #0c1322; border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font-size: 15px;
}

/* 全屏遮罩（锁屏 / 文字通知） */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: none;
  flex-direction: column; align-items: center; justify-content: center;
  background: rgba(8, 11, 20, .96); text-align: center; padding: 24px;
}
.overlay.show { display: flex; }
.overlay .big { font-size: 22vw; line-height: 1; }
.overlay .msg { font-size: clamp(28px, 6vw, 72px); font-weight: 700; margin-top: 10px; }
.overlay .sub { color: var(--muted); margin-top: 16px; font-size: 16px; }

/* 卡片容器（手机端） */
.wrap { max-width: 560px; margin: 0 auto; padding: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.card h2 { font-size: 14px; margin: 0 0 10px; color: var(--muted); font-weight: 600; }

video { width: 100%; background: #000; border-radius: var(--radius); display: block; }
.selfpreview { position: fixed; right: 14px; bottom: 14px; width: 180px; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; z-index: 6; }
.selfpreview video { border-radius: 8px; }

/* 大号对讲按钮 */
.ptt {
  width: 100%; height: 160px; border-radius: 20px; font-size: 22px; font-weight: 700;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .08s, background .15s;
  touch-action: none;
}
.ptt.active { background: var(--danger); transform: scale(.98); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.hint { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.center-screen { min-height: 100%; display: flex; align-items: center; justify-content: center; }
.center-screen .card { width: min(420px, 92vw); }
