:root {
  --bg: #f6f7f9; --card: #fff; --fg: #1a1d21; --muted: #6b7280;
  --accent: #4f6ef7; --ok: #16a34a; --err: #dc2626; --warn: #b45309; --line: #e5e7eb;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #101214; --card: #1a1e22; --fg: #e7eaee; --muted: #9aa3ad; --warn: #fbbf24; --line: #2a2f36; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 -apple-system, "PingFang SC", "Segoe UI", sans-serif; }
#hdr { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: var(--card); border-bottom: 1px solid var(--line); }
#hdr h1 { font-size: 18px; margin: 0; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--line); color: var(--muted); }
.badge.run { background: #dbeafe; color: var(--accent); }
main { padding: 14px 14px calc(76px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 10px; font-size: 15px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 13px; }
.warn { color: var(--warn); font-size: 13px; margin: 6px 0; }
.stat { display: flex; gap: 18px; margin: 4px 0 10px; }
.stat b { font-size: 22px; display: block; }
.stat span { font-size: 12px; color: var(--muted); }
button { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--fg);
  border-radius: 10px; padding: 9px 14px; font-size: 14px; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.danger { color: var(--err); }
button:active { opacity: .7; }
#tabbar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; z-index: 5;
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
#tabbar button { flex: 1; border: 0; border-radius: 0; background: none; padding: 12px 4px; font-size: 13px; color: var(--muted); }
#tabbar button.on { color: var(--accent); font-weight: 600; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  border-radius: 10px; padding: 10px 12px; font-size: 15px; margin: 4px 0; }
textarea { min-height: 72px; font-family: ui-monospace, monospace; font-size: 13px; }
label { font-size: 13px; color: var(--muted); display: block; margin-top: 8px; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--line); }
.pill.ok { background: #dcfce7; color: var(--ok); }
.pill.err { background: #fee2e2; color: var(--err); }
.log { font: 12px/1.6 ui-monospace, monospace; white-space: pre-wrap; max-height: 220px; overflow: auto;
  background: var(--bg); border-radius: 10px; padding: 10px; }
.result { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.result small { color: var(--muted); display: block; }
.qr { text-align: center; }
.qr img { width: 220px; height: 220px; image-rendering: pixelated; border-radius: 8px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 90px; background: var(--fg);
  color: var(--bg); padding: 8px 16px; border-radius: 20px; font-size: 13px; z-index: 20; opacity: .95; }

/* 脚本池：源/音质对照表与控制列 */
.col { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.qtab { border-collapse: collapse; margin: 6px 0; font-size: 12px; }
.qtab th, .qtab td { border: 1px solid var(--line); padding: 2px 8px; text-align: left; font-weight: 400; }
.qtab th { color: var(--muted); background: var(--bg); }
details { margin-top: 6px; }
summary { cursor: pointer; font-size: 13px; }
details input, details select { font-size: 13px; padding: 7px 9px; }
button[disabled] { opacity: .35; cursor: default; }
