:root {
  --bg: #f6f7f9; --panel: #fff; --text: #1d232b; --muted: #66707c; --line: #dfe3e8;
  --accent: #2563eb; --live: #dc2626; --ok: #15803d; --warn: #b45309;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 system-ui, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif; background: var(--bg); color: var(--text); }
header { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
header h1 { font-size: 16px; margin: 0; flex: 1; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.panel h2 { font-size: 15px; margin: 0 0 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 14px; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }
button { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font: inherit; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.danger { background: var(--live); color: #fff; border-color: var(--live); }
button:disabled { opacity: .5; cursor: default; }
input, select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; word-break: break-all; }
.muted { color: var(--muted); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #e5e7eb; }
.badge.live { background: var(--live); color: #fff; }
.badge.ok { background: #dcfce7; color: var(--ok); }
video { width: 100%; background: #000; border-radius: 6px; aspect-ratio: 16 / 9; }
.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.stats b { font-variant-numeric: tabular-nums; }
#chatlog { height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: #fbfcfd; }
.msg { margin: 2px 0; word-break: break-word; }
.msg .name { font-weight: 600; margin-right: 6px; }
.msg.teacher .name { color: var(--accent); }
.msg.notice { background: #fef3c7; padding: 4px 6px; border-radius: 4px; }
.msg.system { color: var(--muted); font-size: 12px; }
.reactions { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.reactions span { font-size: 13px; }
#toast { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 10; }
.toast { background: #111827; color: #fff; padding: 8px 12px; border-radius: 6px; max-width: 360px; }
.toast.error { background: var(--live); }
