:root {
  --bg: #f4f1ea;
  --bg-2: #ebe6db;
  --panel: #fbf9f4;
  --line: #ddd6c8;
  --line-2: #cfc6b4;
  --ink: #1b1a17;
  --ink-2: #57524a;
  --ink-3: #8a8378;
  --accent: #b7791f;
  --accent-soft: rgba(183, 121, 31, 0.12);
  --good: #2f7d4f;
  --good-soft: rgba(47, 125, 79, 0.11);
  --warn: #b26a00;
  --warn-soft: rgba(178, 106, 0, 0.12);
  --bad: #b3372b;
  --bad-soft: rgba(179, 55, 43, 0.11);
  --muted-soft: rgba(110, 102, 90, 0.1);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 10px 30px -18px rgba(60, 45, 20, 0.35);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f11;
    --bg-2: #15171a;
    --panel: #17191c;
    --line: #26292e;
    --line-2: #33373d;
    --ink: #ece8df;
    --ink-2: #aaa499;
    --ink-3: #757067;
    --accent: #e0a43a;
    --accent-soft: rgba(224, 164, 58, 0.13);
    --good: #5cc48a;
    --good-soft: rgba(92, 196, 138, 0.12);
    --warn: #e9a83f;
    --warn-soft: rgba(233, 168, 63, 0.13);
    --bad: #ef6b5c;
    --bad-soft: rgba(239, 107, 92, 0.13);
    --muted-soft: rgba(170, 164, 153, 0.1);
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 18px 40px -24px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0f11;
  --bg-2: #15171a;
  --panel: #17191c;
  --line: #26292e;
  --line-2: #33373d;
  --ink: #ece8df;
  --ink-2: #aaa499;
  --ink-3: #757067;
  --accent: #e0a43a;
  --accent-soft: rgba(224, 164, 58, 0.13);
  --good: #5cc48a;
  --good-soft: rgba(92, 196, 138, 0.12);
  --warn: #e9a83f;
  --warn-soft: rgba(233, 168, 63, 0.13);
  --bad: #ef6b5c;
  --bad-soft: rgba(239, 107, 92, 0.13);
  --muted-soft: rgba(170, 164, 153, 0.1);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 85% -10%, var(--accent-soft), transparent 60%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
code, .mono { font-family: var(--mono); font-feature-settings: "zero" 1; }
code { font-size: 0.88em; padding: 0.05em 0.35em; border-radius: 4px; background: var(--muted-soft); }
[hidden] { display: none !important; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.bar-in { width: min(1120px, 100% - 32px); margin-inline: auto; height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.brand svg { width: 26px; height: 26px; }
.brand .shield { fill: var(--accent); }
.brand .pulse { fill: none; stroke: var(--bg); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-size: 14px; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.nav a:hover, .nav a.on { color: var(--ink); background: var(--muted-soft); }
.icon-btn { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); cursor: pointer; }
.icon-btn svg { width: 17px; height: 17px; fill: currentColor; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }

/* Hero */
.hero { display: grid; grid-template-columns: 1fr 300px; gap: 40px; padding: 56px 0 28px; align-items: start; }
.eyebrow { margin: 0 0 10px; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
.ip { margin: 0; font-size: clamp(34px, 6.4vw, 64px); line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; word-break: break-all; }
.place { margin: 14px 0 0; font-family: var(--serif); font-size: 21px; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0; margin: 28px 0 0; border-top: 1px solid var(--line); }
.facts div { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 12px; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-size: 15px; overflow-wrap: anywhere; }
.stack-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.stack { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 13px; color: var(--ink-2); max-width: 100%; }
.stack b { font-weight: 600; color: var(--ink-3); font-size: 11px; letter-spacing: 0.08em; }
.stack span { font-family: var(--mono); color: var(--ink); overflow-wrap: anywhere; }

.hero-side { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.gauge { position: relative; width: 168px; height: 168px; margin: 4px auto 18px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.g-track { fill: none; stroke: var(--line); stroke-width: 7; }
.g-val { fill: none; stroke: var(--ink-3); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 314.16; stroke-dashoffset: 314.16; transition: stroke-dashoffset 1.1s cubic-bezier(.2,.8,.2,1), stroke 0.3s; }
.g-num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.g-num b { font-family: var(--serif); font-size: 50px; line-height: 1; font-weight: 600; }
.g-num span { font-size: 12px; color: var(--ink-3); margin-top: 6px; letter-spacing: 0.1em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 28px; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--muted-soft); color: var(--ink-2); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.hint { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-3); text-align: center; overflow-wrap: anywhere; }
.hint a { color: var(--accent); }

.btn { appearance: none; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font: 500 14px/1 var(--sans); padding: 11px 16px; border-radius: 10px; cursor: pointer; transition: transform 0.08s, opacity 0.15s; white-space: nowrap; }
.btn:hover { opacity: 0.88; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.small { padding: 7px 12px; font-size: 13px; background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn.small:hover { color: var(--ink); }

/* Verdict strip */
.verdicts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; margin-bottom: 28px; box-shadow: var(--shadow); }
.verdict { padding: 18px 22px; display: grid; gap: 2px; border-left: 1px solid var(--line); position: relative; }
.verdict:first-child { border-left: 0; }
.verdict::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.verdict.good::before { background: var(--good); }
.verdict.warn::before { background: var(--warn); }
.verdict.bad::before { background: var(--bad); }
.v-k { font-size: 12px; letter-spacing: 0.14em; color: var(--ink-3); text-transform: uppercase; }
.v-v { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.verdict.good .v-v { color: var(--good); }
.verdict.warn .v-v { color: var(--warn); }
.verdict.bad .v-v { color: var(--bad); }
.v-d { font-size: 13px; color: var(--ink-2); }

/* Cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px; margin-bottom: 28px; box-shadow: var(--shadow); min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid-2 > .card { margin-bottom: 28px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.card-head h2 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: 0.01em; }
.sub { margin: 6px 0 0; color: var(--ink-2); font-size: 13.5px; max-width: 70ch; }
.tag { font-size: 13px; padding: 4px 10px; border-radius: 8px; background: var(--muted-soft); color: var(--ink-2); white-space: nowrap; }

.dim { color: var(--ink-3); }
.pending { color: var(--ink-3); }
.pending::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 6px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.shimmer { background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink) 50%, var(--ink-3) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shim 1.6s linear infinite; }
@keyframes shim { to { background-position: -200% 0; } }

/* Lists */
.list { display: grid; gap: 0; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.row:last-child { border-bottom: 0; }
.row .k { color: var(--ink-2); font-size: 13.5px; min-width: 0; }
.row .v { font-family: var(--mono); font-size: 13.5px; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.row .v small { display: block; font-family: var(--sans); color: var(--ink-3); font-size: 12px; }
.note { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; background: var(--muted-soft); color: var(--ink-2); }
.note.good { background: var(--good-soft); color: var(--good); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad { background: var(--bad-soft); color: var(--bad); }

/* Readings */
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--ink-2); margin-bottom: 14px; }
.meta-row b { color: var(--ink); font-weight: 500; }
.readings { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.reading { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg-2); display: grid; gap: 4px; text-decoration: none; min-width: 0; }
.reading:hover { border-color: var(--line-2); }
.reading .top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-3); }
.reading .val { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.reading .val::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.reading.good .val::before { background: var(--good); }
.reading.warn .val::before { background: var(--warn); }
.reading.bad .val::before { background: var(--bad); }
.reading .hintx { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }

/* Report view */
.report { padding: 48px 0 8px; }
.report h1 { font-family: var(--serif); font-size: 34px; margin: 0 0 6px; }

.foot { padding: 12px 0 48px; color: var(--ink-3); font-size: 12.5px; text-align: center; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 36px; }
  .grid-2 { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 640px) {
  .bar-in { gap: 12px; }
  .brand span { display: none; }
  .verdicts { grid-template-columns: 1fr; }
  .verdict { border-left: 0; border-top: 1px solid var(--line); }
  .verdict:first-child { border-top: 0; }
  .card { padding: 20px 16px; border-radius: 14px; }
  .card-head { flex-direction: column; gap: 12px; }
  .facts { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
