:root {
  --bg: #eef1f5; --surface: #fff; --fg: #18212b; --muted: #5d6b7a; --line: #d6dde6;
  --accent: #1f5fbf; --accent-fg: #fff; --ok: #17803d; --err: #c4302b; --zone: #f6f8fb;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141a; --surface: #18202a; --fg: #e6ebf1; --muted: #93a1b1; --line: #2b3643;
    --accent: #6fa3f2; --accent-fg: #0b1420; --ok: #5cc884; --err: #f07a73; --zone: #131a22;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif; }
.wrap { max-width: 580px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); }
h1 { font-size: 22px; margin: 0; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.reader { width: 100%; border-radius: 10px; overflow: hidden; background: #000; min-height: 48px; }
.reader video { width: 100% !important; display: block; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > * { flex: 1 1 120px; }
button, .btn { font: inherit; padding: 11px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  color: var(--fg); cursor: pointer; text-align: center; text-decoration: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
button.small { padding: 5px 10px; font-size: 13px; flex: none; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, .btn:focus-within, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
select, input[type=text] { font: inherit; width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--zone); color: var(--fg); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.status { font-size: 14px; color: var(--muted); min-height: 1.4em; }
.status.ok { color: var(--ok); } .status.err { color: var(--err); }
.label { font-size: 12px; letter-spacing: .08em; color: var(--muted); }
.result-text { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; background: var(--zone); border-radius: 8px; padding: 12px; }
.head { display: flex; justify-content: space-between; align-items: center; }
.log { list-style: none; margin: 0; padding: 0; }
.log li { padding: 9px 0; border-top: 1px solid var(--line); word-break: break-all; font-size: 14px; }
.log li:first-child { border-top: 0; }
.log small { display: block; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.log a { color: var(--accent); }
.empty { color: var(--muted); }
@media (prefers-reduced-motion: no-preference) { .flash { animation: flash .6s ease-out; } }
@keyframes flash { from { box-shadow: 0 0 0 4px var(--ok); } to { box-shadow: 0 0 0 0 transparent; } }
