:root {
  --bg: #faf9f6; --surface: #fff; --text: #1a1a1a; --text-2: #55534e; --muted: #6b6963; --line: #dedbd3;
  --accent: #ffd60a; --accent-ink: #1a1a1a; --focus: #1a1a1a; --ok: #1f9d55; --bad: #b42318; --bad-bg: #fdecea;
  --note-bg: #faf6e6; --note-line: #e7d9a8;
  --prog: #7a4f00; --prog-ok: #17744a; --prog-warn: #8a4b00; --warn-bg: #fff4e5;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412; --surface: #1e1e1b; --text: #f1efe9; --text-2: #c9c6bd; --muted: #a09d94; --line: #3a3934;
    --focus: #ffd60a; --ok: #4cc38a; --bad: #ff9a8f; --bad-bg: #3a1d1a; --note-bg: #2a2718; --note-line: #5c5326;
    --prog: #ffd60a; --prog-ok: #4cc38a; --prog-warn: #f5b040; --warn-bg: #3a2a10;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}
[hidden] { display: none !important; }
.top {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
}
.mark {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--accent);
  color: var(--accent-ink); font-weight: 800;
}
.brand { font-weight: 700; flex: 1; }
.lang { min-height: 44px; min-width: 44px; padding: 0 10px; border: 0; background: none; color: var(--text-2); font: inherit; font-size: 14px; }
main { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: 24px 16px 32px; }
.steps { display: flex; gap: 6px; margin: 0 0 28px; padding: 0; list-style: none; }
.steps li { flex: 1; height: 3px; border-radius: 2px; background: var(--line); transition: background-color 180ms; }
.steps li.on { background: var(--text); }
h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; }
.lead { margin: 0 0 24px; color: var(--text-2); }
label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
input, textarea {
  display: block; width: 100%; margin: 0 0 16px; padding: 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: inherit; font: 15px/1.5 var(--mono);
}
input.focal {
  padding: 14px 4px; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; background: transparent;
  font-size: 22px; font-weight: 600; letter-spacing: 0.04em; font-variant-numeric: tabular-nums;
}
textarea { resize: vertical; min-height: 120px; word-break: break-all; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1:focus, .state:focus { outline: none; }
button { cursor: pointer; font: inherit; }
.primary {
  display: block; width: 100%; min-height: 48px; margin: 8px 0 0; border: 0; border-radius: 24px; background: var(--accent);
  color: var(--accent-ink); font-weight: 700;
}
.primary[disabled] { opacity: 0.55; cursor: default; }
.quiet { display: block; width: 100%; min-height: 44px; margin: 6px 0 0; border: 0; background: none; color: var(--muted); font-size: 14px; }
.facts { margin: 0 0 20px; border-top: 1px solid var(--line); }
.facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.facts dt { color: var(--text-2); }
.facts dd { margin: 0; font-weight: 600; text-align: end; word-break: break-all; font-variant-numeric: tabular-nums; }
.how { margin: 0 0 20px; padding: 0 0 0 20px; color: var(--text-2); }
.how li { margin: 0 0 8px; }
a { color: inherit; text-underline-offset: 3px; word-break: break-all; }
.note { margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--note-line); border-radius: 8px; background: var(--note-bg); font-size: 13px; line-height: 1.5; }
.alert { margin: 0 0 20px; padding: 10px 12px; border-radius: 8px; background: var(--bad-bg); color: var(--bad); font-size: 14px; }
.state { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 28px; font-weight: 700; line-height: 1.2; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); flex: none; }
.state.wait .dot { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.state.ok .dot { background: var(--ok); }
.state.bad .dot { background: var(--bad); }
@keyframes pulse { 50% { opacity: 0.35; } }
.progress { margin: 0 0 20px; }
.phead { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.pct { font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 4px; background: var(--line); box-shadow: inset 0 0 0 1px var(--muted); overflow: hidden; }
.fill { height: 100%; width: 0; border-radius: 4px; background: var(--prog); transition: width 240ms ease; }
.progress.ok .fill { background: var(--prog-ok); }
.progress.bad .fill { background: var(--bad); }
.progress.warn .fill { background: var(--prog-warn); }
.pnote { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--note-bg); border: 1px solid var(--note-line); font-size: 13px; line-height: 1.5; }
.progress.bad .pnote { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.progress.warn .pnote { background: var(--warn-bg); color: var(--prog-warn); border-color: var(--prog-warn); }
.psteps { margin: 12px 0 0; padding: 0; list-style: none; }
.psteps li { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 2px; min-height: 44px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--text-2); }
.psteps .d {
  flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); color: var(--muted);
  font-size: 12px; font-weight: 700; line-height: 16px; text-align: center;
}
.psteps .n { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.psteps .t { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: end; }
.psteps li.done { color: var(--text); }
.psteps li.done .d { border-color: var(--prog-ok); background: var(--prog-ok); color: var(--surface); }
.psteps li.current { color: var(--text); font-weight: 700; }
.psteps li.current .d { border-color: var(--prog); color: var(--prog); font-size: 11px; }
.psteps li.failed .d { border-color: var(--bad); background: var(--bad); color: var(--surface); }
.psteps li.attention .d { border-color: var(--prog-warn); background: var(--prog-warn); color: var(--surface); }
@media (max-width: 400px) { .psteps .t { flex: 0 0 100%; padding-inline-start: 32px; text-align: start; } }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
footer { padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); text-align: center; color: var(--muted); font-size: 12px; }
footer p { margin: 0 auto; max-width: 520px; }
@media (prefers-reduced-motion: reduce) {
  .steps li, .fill { transition: none; }
  .state.wait .dot { animation: none; }
}

.notice { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--note-line); background: var(--note-bg); color: var(--text); font-size: 14px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.notice.warn { background: var(--warn-bg); border-left-width: 4px; font-weight: 600; }
