:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f5f8fb;
  --ink: #14233a;
  --muted: #64748b;
  --line: #dde4ec;
  --navy: #12305c;
  --navy-2: #0b2145;
  --teal: #0e9f8e;
  --teal-ink: #ffffff;
  --gold: #e9a23b;
  --danger: #b4382c;
  --ok-bg: #e2f6f1;
  --ok-ink: #0a6e62;
  --wait-bg: #fdf3dc;
  --wait-ink: #7a5607;
  --bad-bg: #fbe6e3;
  --bad-ink: #8f2c22;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1422;
    --surface: #142033;
    --surface-2: #101a2b;
    --ink: #e8eef7;
    --muted: #9aa9bd;
    --line: #26354c;
    --navy: #173a6e;
    --navy-2: #0c1d3a;
    --teal: #2cc0ad;
    --teal-ink: #06231f;
    --danger: #f19a8f;
    --ok-bg: #123a35;
    --ok-ink: #8fe3d6;
    --wait-bg: #3a2f14;
    --wait-ink: #f0d58c;
    --bad-bg: #40201c;
    --bad-ink: #f4b4ab;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}
.app { max-width: 520px; min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 18px 64px;
  background: linear-gradient(150deg, var(--navy-2), var(--navy) 70%, #1d4f8f);
  color: #f2f7ff;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand strong { display: block; font-size: 18px; letter-spacing: .5px; }
.brand small { display: block; color: #b9cbe6; font-size: 12px; }
.mark {
  position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .08);
}
.mark::before {
  content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, .45);
}
.mark i {
  position: absolute; left: 50%; top: 50%; width: 8px; height: 26px; margin: -13px 0 0 -4px;
  background: linear-gradient(to bottom, var(--gold) 0 50%, #ffffff 50% 100%);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  transform: rotate(38deg);
}
.view { flex: 1; margin-top: -48px; padding: 0 14px 8px; }
.demo { margin: -50px 14px 0; padding: 8px 12px; border-radius: 10px; background: var(--wait-bg); color: var(--wait-ink); font-size: 13px; position: relative; z-index: 1; }
.demo:not([hidden]) + .view { margin-top: 12px; }
.loading { padding: 40px 0; text-align: center; color: var(--muted); }

.card {
  margin: 0 0 12px; padding: 16px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(18, 48, 92, .06);
}
.card h2 { margin: 0 0 4px; font-size: 17px; }
.card h3 { margin: 0 0 10px; font-size: 15px; }
.card p { margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row > div { min-width: 0; }
.grow { flex: 1; }

.me { display: flex; align-items: center; gap: 12px; }
.avatar {
  flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--teal), #1670b8); color: #fff; font-weight: 700; font-size: 17px;
}
.me b { font-size: 16px; }
.tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--ok-bg); color: var(--ok-ink); vertical-align: 1px; }
.tag.wait { background: var(--wait-bg); color: var(--wait-ink); }
.tag.bad { background: var(--bad-bg); color: var(--bad-ink); }
.tag.plain { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; }
.stats div { padding: 10px 6px; border-radius: 12px; background: var(--surface-2); text-align: center; }
.stats b { display: block; font-size: 20px; color: var(--navy); }
.stats span { font-size: 12px; color: var(--muted); }
@media (prefers-color-scheme: dark) { .stats b { color: #9fc3ff; } }

.action { display: flex; align-items: center; gap: 12px; }
.action + .action { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.action .ico {
  flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--navy); font-weight: 700; font-size: 18px;
}
@media (prefers-color-scheme: dark) { .action .ico { color: #9fc3ff; } }
.action b { display: block; }
.action small { color: var(--muted); font-size: 12px; }

button, .btn {
  font: inherit; cursor: pointer; border: 0; border-radius: 10px; min-height: 44px; padding: 0 16px;
  background: var(--teal); color: var(--teal-ink); font-weight: 700; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
}
button:disabled { opacity: .55; cursor: default; }
button.ghost, .btn.ghost { background: transparent; color: var(--teal); border: 1px solid var(--teal); }
button.small, .btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
button.block { width: 100%; }
button.link { background: none; color: var(--teal); min-height: 0; padding: 0; font-weight: 500; }
button.link.light { color: #cfe0f7; font-size: 13px; }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

label { display: block; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
input, select {
  display: block; width: 100%; min-height: 46px; margin-top: 4px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; font-size: 16px;
}
.foot .icp { text-align: center; }
.foot .icp a { color: inherit; text-decoration: none; }
/* —— 查询页 —— */
.progress { display: flex; list-style: none; margin: 0 0 16px; padding: 0 0 14px; border-bottom: 1px solid var(--line); }
.progress li { flex: 1; position: relative; display: grid; justify-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.progress li + li::before { content: ""; position: absolute; top: 11px; left: calc(-50% + 16px); right: calc(50% + 16px); height: 2px; background: var(--line); }
.progress i { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-style: normal; font-weight: 700; font-size: 12px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.progress li.on { color: var(--ink); font-weight: 600; }
.progress li.on i { background: var(--teal); color: var(--teal-ink); border-color: var(--teal); box-shadow: 0 0 0 4px rgba(14, 159, 142, .15); }
.kw { position: relative; margin: 0 0 14px; }
.kw .label { display: block; margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.searchbox { position: relative; }
.searchbox input { margin: 0; min-height: 52px; padding: 0 42px 0 42px; border-radius: 12px; font-size: 16px; background: var(--surface); border: 1.5px solid var(--line); -webkit-appearance: none; appearance: none; }
.searchbox input::-webkit-search-cancel-button { display: none; }
.searchbox input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(14, 159, 142, .12); }
.searchbox .mag { position: absolute; left: 15px; top: 50%; width: 15px; height: 15px; margin-top: -9px; border: 2px solid var(--muted); border-radius: 50%; pointer-events: none; }
.searchbox .mag::after { content: ""; position: absolute; right: -6px; bottom: -5px; width: 7px; height: 2px; background: var(--muted); transform: rotate(45deg); border-radius: 2px; }
.searchbox .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); min-height: 0; width: 28px; height: 28px; padding: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--muted); font-size: 18px; font-weight: 400; line-height: 1; }
.picked { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: var(--ok-bg); border: 1.5px solid var(--teal); }
.picked .ok { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: var(--teal-ink); font-weight: 700; font-size: 14px; }
.picked b { display: block; font-size: 15px; word-break: break-all; color: var(--ink); }
.picked span { display: block; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.picked .link { flex: none; font-size: 13px; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin: 6px 0 0; padding: 6px; list-style: none; max-height: 340px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 28px rgba(18, 48, 92, .16); }
.suggest li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); font-size: 15px; }
.suggest li + li:not(.head) { border-top: 1px solid var(--line); border-radius: 0; }
.suggest li.head { cursor: default; padding: 4px 12px 6px; font-size: 12px; color: var(--muted); }
.suggest li:not(.head):hover, .suggest li:not(.head):active { background: var(--surface-2); }
.suggest li b { font-weight: 600; }
.suggest li span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.hint { margin: -4px 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--wait-bg); color: var(--wait-ink); font-size: 13px; }
button.primary { min-height: 50px; border-radius: 12px; font-size: 16px; letter-spacing: 1px; box-shadow: 0 6px 16px rgba(14, 159, 142, .28); }
button.primary:disabled { box-shadow: none; }
.inline { display: flex; gap: 8px; align-items: flex-end; }
.inline label { flex: 1; margin: 0 0 12px; }
.inline button { margin-bottom: 12px; min-width: 112px; }
.error { margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--bad-bg); color: var(--bad-ink); font-size: 13px; }
.note { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.dev { margin: -4px 0 12px; color: var(--wait-ink); background: var(--wait-bg); padding: 6px 10px; border-radius: 8px; font-size: 13px; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { position: relative; padding: 0 0 12px 34px; font-size: 14px; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  counter-increment: s; content: counter(s); position: absolute; left: 0; top: 1px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.steps b { display: block; }
.steps span { color: var(--muted); font-size: 13px; }

.code {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; padding: 12px 14px;
  border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line);
}
.code b { font: 700 26px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 5px; color: var(--navy); }
@media (prefers-color-scheme: dark) { .code b { color: #9fc3ff; } }
.linkbox { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; word-break: break-all; color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .name { font-weight: 700; word-break: break-all; }
.list .meta { color: var(--muted); font-size: 12px; margin: 2px 0 8px; }
.list .ops { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { padding: 18px 0; text-align: center; color: var(--muted); font-size: 13px; }

.back { margin: 0 0 10px; }
.back button { min-height: 32px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--teal); font-size: 13px; }
.foot { padding: 18px 22px calc(26px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 12px; text-align: center; line-height: 1.7; }
.foot p { margin: 0 0 4px; }
.foot p:first-child { color: var(--ink); opacity: .7; }
.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%); max-width: 84%;
  padding: 10px 16px; border-radius: 999px; background: rgba(20, 35, 58, .92); color: #fff; font-size: 14px; z-index: 9;
}
[hidden] { display: none !important; }
label.agree { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 14px; font-size: 14px; color: var(--ink); }
label.agree input { flex: none; width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; padding: 0; accent-color: var(--teal); }
label.agree a { color: var(--teal); }
