:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --en: #8a93a3;
  --zh: #f2f4f8;
  --accent: #3b82f6;
  --ok: #22c55e;
  --warn: #f59e0b;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--zh);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }
body { display: flex; flex-direction: column; }

header { display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; font-size: 13px; border-bottom: 1px solid #2a2e37; }
.status { padding: 4px 10px; border-radius: 999px; background: #333; }
.status.idle { background: #333; }
.status.connecting { background: var(--warn); color: #000; }
.status.live { background: var(--ok); color: #000; }
.status.error { background: #ef4444; color: #fff; }
#meter { color: var(--en); font-variant-numeric: tabular-nums; }

.mode-selector { display: flex; gap: 6px; padding: 10px 16px 0; }
.mode-selector button { padding: 9px 12px; border-radius: 9px; font-size: 14px; color: var(--en); }
.mode-selector button.active { color: #fff; background: var(--accent); }
.mode-selector button:disabled { cursor: not-allowed; }

main#feed { flex: 1; overflow-y: auto; padding: 16px; display: flex;
  flex-direction: column; gap: 10px; }
.item.en { color: var(--en); font-size: 15px; }
.item.zh { color: var(--zh); font-size: 20px; font-weight: 600; margin-bottom: 6px; }

#live { padding: 10px 16px; border-top: 1px solid #2a2e37; min-height: 60px; background: var(--panel); }
.line.en { color: var(--en); font-size: 15px; min-height: 20px; }
.line.zh { color: var(--accent); font-size: 20px; font-weight: 600; min-height: 26px; }
.audio-toggle { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--en); font-size: 14px; }
.audio-toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.audio-toggle.hidden, .line.hidden { display: none; }

footer { display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid #2a2e37; }
button { flex: 1; padding: 14px 0; border: none; border-radius: 12px; font-size: 16px;
  font-weight: 600; color: #fff; background: #2a2e37; }
button.primary { background: var(--accent); }
button.ghost { background: #2a2e37; }
button:disabled { opacity: .4; }

dialog#summaryDlg { width: 90%; max-width: 640px; background: var(--panel); color: var(--zh);
  border: 1px solid #2a2e37; border-radius: 16px; }
#summaryText { white-space: pre-wrap; line-height: 1.6; max-height: 60vh; overflow-y: auto; }
dialog menu { display: flex; justify-content: flex-end; padding: 0; margin-top: 12px; }
dialog menu button { flex: 0 0 auto; padding: 10px 20px; }
audio { display: none; }
