:root {
  --bg: #f4f5f7; --card: #ffffff; --line: #e3e5e9; --text: #1d2129; --muted: #6b7280;
  --accent: #2f6fed; --accent-text: #ffffff; --ok: #1f9d55; --danger: #d64545; --warn-bg: #fff6e0; --warn: #8a5a00;
  --code-bg: #f0f2f5; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --card: #171a21; --line: #272b34; --text: #e6e8ec; --muted: #8b93a1;
          --accent: #4c86ff; --ok: #3cc47c; --danger: #ef6b6b; --warn-bg: #2a2414; --warn: #e8cf8f;
          --code-bg: #1f232c; --shadow: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text);
       font: 15px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
       min-height: 100vh; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 440px; margin: 0 auto; padding: 40px 16px; }
.wrap.wide { max-width: 860px; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: .3px; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.brand-icon { width: 24px; height: 24px; border-radius: 6px; flex: none; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.topbar .brand { margin: 0; }
.topnav { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h1 { font-size: 20px; margin: 0 0 6px; }
.card h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.qr { display: block; width: 220px; height: 220px; margin: 16px auto 10px; image-rendering: pixelated;
      border-radius: 8px; background: #fff; padding: 8px; }
.qr.dim { opacity: .15; }
.bigcode { font-size: 40px; font-weight: 700; letter-spacing: 6px; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--code-bg); color: var(--muted); }
.pill.ok { color: var(--ok); } .pill.accent { color: var(--accent); }
button, .btn { font: inherit; border: 0; border-radius: 9px; padding: 10px 16px; cursor: pointer;
               background: var(--accent); color: var(--accent-text); font-weight: 600; display: inline-block; }
button:disabled { opacity: .55; cursor: default; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); font-weight: 500; }
button.small { padding: 5px 10px; font-size: 13px; }
button.block { width: 100%; }
input[type=text] { width: 100%; font: inherit; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line);
                   background: var(--bg); color: var(--text); }
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.row { display: flex; gap: 8px; align-items: center; }
.row > input { flex: 1; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 6px; }
.ok-text { color: var(--ok); }
details summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details[open] summary { margin-bottom: 10px; }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: 9px; padding: 10px 12px; font-size: 13px; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.choices button { font-size: 30px; padding: 18px 0; background: var(--code-bg); color: var(--text); font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: 76px 1fr; gap: 6px 10px; font-size: 14px; margin: 12px 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-all; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .meta { min-width: 0; }
.list .title { font-weight: 600; font-size: 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; font-family: ui-monospace, Menlo, Consolas, monospace;
         font-size: 15px; background: var(--code-bg); padding: 14px; border-radius: 9px; margin: 10px 0; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.steps span.on { background: var(--accent); }
table.audit { width: 100%; border-collapse: collapse; font-size: 13px; }
table.audit td { padding: 7px 6px; border-top: 1px solid var(--line); vertical-align: top; }
table.audit td:first-child { white-space: nowrap; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } .wrap { padding: 24px 16px; } }
.spacer { height: 10px; }
