/* 与平台授权页同一套配色：米白底、白卡片、橄榄绿主色，从授权页跳回来不会有割裂感。 */
:root {
  --bg: #faf9f6; --surface: #fff; --line: #e7e5df; --line-strong: #d6d3cb;
  --ink: #242424; --muted: #475569; --subtle: #64748b;
  --accent: #507c0c; --accent-hover: #42670a; --accent-soft: rgba(80, 124, 12, .1);
  --warn-bg: #fffbeb; --warn-line: #fde68a; --warn-ink: #92400e;
  --error-bg: #fef2f2; --error-line: #fecaca; --error-ink: #b91c1c;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: var(--bg); font-synthesis: none; -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
p { margin: 0; line-height: 1.75; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; padding: 2px 6px; border-radius: 6px; background: #f1efe9; color: #3f4a2a; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid rgba(80, 124, 12, .35); outline-offset: 2px; }

.topbar { max-width: 720px; margin: 0 auto; padding: 24px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 15px; }
.brand-sub { color: var(--subtle); font-weight: 500; padding-left: 10px; border-left: 1px solid var(--line-strong); }

main { max-width: 720px; margin: 0 auto; padding: 0 20px 48px; display: flex; flex-direction: column; gap: 20px; }
.title { margin: 28px 0 4px; font-size: clamp(28px, 5vw, 36px); line-height: 1.25; letter-spacing: -.02em; font-weight: 650; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.card h2 { margin: 0; font-size: 17px; font-weight: 650; }
.block { display: flex; flex-direction: column; gap: 14px; }
.hint { font-size: 13px; color: var(--subtle); }
.center { text-align: center; }

/* 三步进度：完成为实心对勾，当前步骤为主色描边。 */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; color: var(--subtle); text-align: center; }
.step:not(:last-child)::after { content: ""; position: absolute; top: 11px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; border-radius: 2px; background: var(--line); }
.step.done:not(:last-child)::after { background: var(--accent); }
.step-dot { position: relative; width: 24px; height: 24px; border-radius: 999px; border: 2px solid var(--line-strong); background: var(--surface); }
.step.current { color: var(--ink); font-weight: 600; }
.step.current .step-dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.step.current .step-dot::after { content: ""; position: absolute; inset: 5px; border-radius: 999px; background: var(--accent); }
.step.done { color: var(--muted); }
.step.done .step-dot { border-color: var(--accent); background: var(--accent); }
.step.done .step-dot::after { content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.status { padding: 12px 14px 12px 34px; position: relative; border-radius: 12px; background: #f3f1eb; color: var(--muted); font-size: 14px; }
.status::before { content: ""; position: absolute; left: 14px; top: 19px; width: 8px; height: 8px; border-radius: 999px; background: var(--subtle); }
.status.ok { background: var(--accent-soft); color: #36540a; }
.status.ok::before { background: var(--accent); }
.status.warn { background: var(--warn-bg); color: var(--warn-ink); box-shadow: inset 0 0 0 1px var(--warn-line); }
.status.warn::before { background: #d97706; }
.status.error { background: var(--error-bg); color: var(--error-ink); box-shadow: inset 0 0 0 1px var(--error-line); }
.status.error::before { background: #dc2626; }

.btn { font: inherit; font-size: 15px; font-weight: 600; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; transition: background-color .15s, border-color .15s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: wait; }
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-hover); }
.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.ghost:hover { background: #f5f4f0; }
.danger { background: transparent; color: var(--error-ink); padding: 0 4px; font-weight: 500; }
.danger:hover { text-decoration: underline; }
.wide { width: 100%; }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; padding: 4px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.address { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; padding: 10px 12px; border-radius: 10px; background: #f3f1eb; color: var(--ink); word-break: break-all; }

.qr { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; border-radius: 16px; background: #f6f5f1; }
.qr-frame { padding: 12px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
#qr { display: block; width: 224px; height: 224px; }
.scan-status { font-size: 14px; color: var(--muted); }
.verify { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.verify-row { display: flex; gap: 8px; }
.verify input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 12px; font: inherit; font-size: 16px; letter-spacing: .1em; }
.manage { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.manage .danger { margin-left: auto; }
.diag summary { cursor: pointer; font-size: 13px; color: var(--subtle); }
.diag p { margin-top: 8px; font-size: 12px; line-height: 1.8; color: var(--subtle); white-space: pre-line; font-variant-numeric: tabular-nums; }

.commands { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.commands div { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); }
.commands dt { font-size: 14px; font-weight: 600; }
.commands dd { margin: 0; font-size: 13px; color: var(--subtle); }

footer { padding: 4px; font-size: 12px; color: var(--subtle); text-align: center; }

@media (max-width: 520px) {
  .topbar { padding: 18px 16px; }
  main { padding: 0 16px 36px; }
  .title { margin-top: 12px; }
  .card { padding: 20px 18px; }
  .commands { grid-template-columns: minmax(0, 1fr); }
  .manage .ghost { width: 100%; }
  .manage .danger { margin: 0 auto; }
}
