:root { --bg: #0f0d1f; --panel: #1a1733; --line: #2e2a52; --fg: #ecebf7; --muted: #9a97b8; --accent: #ffd24a; --hot: #ff5d7a; --ok: #5fdd6b; color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.6 "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 20px; }
h1 { font-size: 26px; margin: 0; letter-spacing: 0.02em; } h1 span { color: var(--accent); }
h2 { font-size: 13px; margin: 0 0 10px; color: var(--muted); font-weight: 700; letter-spacing: 0.12em; }
p { margin: 0; color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-width: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
button { font: inherit; font-weight: 700; color: var(--fg); background: #2a2650; border: 1px solid #3d3873; border-radius: 10px; padding: 8px 14px; cursor: pointer; }
button:hover { background: #353069; } button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.on, button.primary { background: var(--accent); border-color: var(--accent); color: #221b00; }
button.hot { background: var(--hot); border-color: var(--hot); color: #2a0010; }
input, select { font: inherit; color: var(--fg); background: #100e22; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 0; }
.url { display: flex; gap: 8px; } .url input { flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.stage { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.stage canvas { display: block; width: 100%; height: auto; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; background: #2a2650; }
.pill.online { background: var(--ok); color: #04210a; } .pill.error { background: var(--hot); color: #2a0010; } .pill.connecting { background: var(--accent); color: #221b00; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; } th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 13px; } .scroll { overflow-x: auto; }
.err { color: var(--hot); }

.lead { max-width: 62ch; }
.toggles label { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.stage.cam { position: relative; background: linear-gradient(160deg, #5d6470, #3b4049 60%, #2c3038); }
.stage.cam canvas { position: relative; }
.camlabel { position: absolute; left: 0; right: 0; top: 30%; text-align: center; color: rgba(255,255,255,0.45); font-size: clamp(14px, 2.4vw, 26px); font-weight: 700; letter-spacing: 0.1em; }
.stage.portrait { max-width: 620px; margin: 0 auto; }
td.wrapcell { white-space: normal; min-width: 180px; }
a.btn { display: inline-block; font-weight: 700; text-decoration: none; color: var(--fg); background: #2a2650; border: 1px solid #3d3873; border-radius: 10px; padding: 8px 14px; }
a.btn.primary { background: var(--accent); border-color: var(--accent); color: #221b00; }
a.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
[hidden] { display: none !important; }
