:root {
  color-scheme: light;
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f3eee6;
  --ink: #17130f;
  --ink-2: #4f473e;
  --ink-3: #776d62;
  --line: #e7dfd3;
  --accent: #dc4a12;
  --accent-2: #f0611f;
  --accent-ink: #ffffff;
  --accent-soft: #fde4d6;
  --accent-text: #b03a0e;
  --band: #17130f;
  --band-ink: #f6f1ea;
  --band-ink-2: #b9ae9f;
  --band-line: #2f2822;
  --band-surface: #211b16;
  --great: #15803d;
  --good: #4d7c0f;
  --ok: #b45309;
  --low: #c2410c;
  --mute: #b91c1c;
  --pass: #15803d;
  --fail: #b91c1c;
  --partial: #b45309;
  --shadow-sm: 0 1px 2px rgb(40 25 10 / .05);
  --shadow: 0 1px 2px rgb(40 25 10 / .05), 0 24px 48px -24px rgb(40 25 10 / .28);
  --radius: 20px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #12100d;
    --surface: #1b1814;
    --surface-2: #25201b;
    --ink: #f4eee6;
    --ink-2: #c7bcae;
    --ink-3: #9d9285;
    --line: #332c25;
    --accent: #ff6a33;
    --accent-2: #ff8a5c;
    --accent-ink: #1a0d06;
    --accent-soft: #3a2116;
    --accent-text: #ff7a47;
    --band: #261f19;
    --band-ink: #f4eee6;
    --band-ink-2: #b9ae9f;
    --band-line: #463b31;
    --band-surface: #322920;
    --great: #4ade80;
    --good: #a3e635;
    --ok: #fbbf24;
    --low: #fb923c;
    --mute: #f87171;
    --pass: #4ade80;
    --fail: #f87171;
    --partial: #fbbf24;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .3);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 24px 48px -24px rgb(0 0 0 / .7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }
code, pre { font-family: var(--mono); font-size: .9em; }
main { overflow-x: clip; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.08rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand:hover { color: var(--ink); }
.brand svg { width: 34px; height: 25px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  appearance: none; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: .92rem;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; text-decoration: none;
}
.nav-link:hover { color: var(--ink); background: var(--surface-2); }

/* ---------- megaphone waves (header logo doubles as the volume meter) ---------- */
.wave { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; opacity: .18; transition: opacity .4s; }
[data-volume="1"] .w1, [data-volume="2"] .w1, [data-volume="2"] .w2,
[data-volume="3"] .w1, [data-volume="3"] .w2, [data-volume="3"] .w3,
[data-volume="4"] .wave { opacity: 1; }
[data-volume="4"] .wave { animation: pulse 1.2s ease-in-out infinite; }
.loading .wave { animation: pulse .9s ease-in-out infinite; opacity: 1; }
[data-volume="4"] .w2, .loading .w2 { animation-delay: .15s; }
[data-volume="4"] .w3, .loading .w3 { animation-delay: .3s; }
@keyframes pulse { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 56px; align-items: center; padding-top: 40px; padding-bottom: 72px; }
.eyebrow { margin: 0 0 14px; color: var(--accent-text); font-weight: 750; font-size: .9rem; letter-spacing: .04em; }
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.7rem); line-height: 1.06; margin: 0 0 18px; letter-spacing: -.035em; font-weight: 850; text-wrap: balance; }
:lang(zh-CN) .hero h1 { letter-spacing: -.01em; line-height: 1.15; }
.hero h1 em { font-style: normal; color: var(--accent); }
@media (min-width: 340px) { .hero h1 em { white-space: nowrap; } }
.hero .sub { color: var(--ink-2); font-size: clamp(1.02rem, 1.6vw, 1.15rem); max-width: 520px; margin: 0 0 28px; text-wrap: pretty; }

.search {
  display: flex; gap: 6px; max-width: 560px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.02rem; padding: 10px 12px; outline: none; }
.search input::placeholder { color: var(--ink-3); }
.btn {
  appearance: none; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 750; padding: 10px 22px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--accent-2); }
.btn[disabled] { opacity: .6; cursor: progress; }

.examples { margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; color: var(--ink-3); font-size: .88rem; }
.chip {
  appearance: none; border: 0; background: var(--surface-2); color: var(--ink-2);
  border-radius: 8px; padding: 5px 10px; font: inherit; font-size: .85rem; cursor: pointer;
}
.chip:hover { color: var(--accent); background: var(--accent-soft); }

.status { min-height: 24px; margin: 16px 0 0; color: var(--ink-2); }
.status:empty { margin: 0; }
.status.error { color: var(--fail); }

.token { max-width: 560px; margin: 8px 0 0; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.token p { margin: 0 0 10px; }
.token .hint { margin: 10px 0 0; }
.token-row { display: flex; gap: 8px; }
.token-row input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-family: var(--mono); font-size: .9rem; padding: 10px 12px; }
.token-row input:focus { outline: none; border-color: var(--accent); }
.link-btn { appearance: none; border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- sample result (hero, right) ---------- */
.sample { position: relative; }
.sample::before {
  content: ""; position: absolute; inset: 6% -6% -8% 8%; z-index: 0; border-radius: 40px;
  background: radial-gradient(closest-side, var(--accent-soft), transparent);
}
.sample-card {
  position: relative; z-index: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: 24px; box-shadow: var(--shadow); max-width: 440px; margin-left: auto; transform: rotate(1.2deg);
}
.sample-tag { position: absolute; top: -12px; left: 22px; background: var(--ink); color: var(--bg); font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.sample-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.mini-dial { position: relative; width: 84px; height: 84px; flex: none; }
.mini-dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mini-dial .track { fill: none; stroke: var(--surface-2); stroke-width: 11; }
.mini-dial .value { fill: none; stroke-width: 11; stroke-linecap: round; }
.mini-dial b { position: absolute; inset: 0; display: grid; place-content: center; font-size: 1.75rem; font-weight: 850; letter-spacing: -.03em; }
.sample-repo { font-family: var(--mono); font-size: .8rem; color: var(--ink-3); }
.sample-level { font-size: 1.2rem; font-weight: 800; margin-top: 2px; }
.sample-bars { display: grid; gap: 8px; margin-bottom: 18px; }
.sb { display: grid; grid-template-columns: 6.5em 1fr 3em; gap: 10px; align-items: center; font-size: .82rem; color: var(--ink-2); }
.sb i { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.sb i b { display: block; height: 100%; border-radius: 999px; background: var(--ink-2); }
.sb em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.sample-row { display: flex; align-items: baseline; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .9rem; }
.sample-row + .sample-row { margin-top: 12px; }
.sample-row .k { flex: none; width: 4.8em; color: var(--ink-3); font-size: .8rem; }
.sample-row .v { flex: 1; min-width: 0; }
.sample-row .gain { margin-left: auto; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { background: var(--surface-2); border-radius: 6px; padding: 2px 8px; font-size: .8rem; color: var(--ink-2); }

/* ---------- result ---------- */
.result[hidden] { display: none; }
.result { margin: 0 0 72px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; scroll-margin-top: 16px; }
.result > *, .score-card > *, .two > *, .split > * { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.card h2 { font-size: 1.08rem; margin: 0 0 14px; letter-spacing: -.01em; }
.card h2 .count { color: var(--ink-3); font-weight: 500; }

.score-card { display: grid; grid-template-columns: 200px 1fr; gap: 36px; align-items: center; }
.dial { position: relative; width: 184px; height: 184px; margin: 0 auto; }
.dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial .track { fill: none; stroke: var(--surface-2); stroke-width: 13; }
.dial .value { fill: none; stroke-width: 13; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.dial .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dial .num { font-size: 3.4rem; font-weight: 850; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.dial .of { color: var(--ink-3); font-size: .85rem; margin-top: 4px; }
.repo-line { font-family: var(--mono); font-size: .85rem; color: var(--ink-3); margin-bottom: 6px; word-break: break-all; }
.repo-line a { color: inherit; }
.level { display: flex; align-items: center; gap: 10px; font-size: 1.6rem; font-weight: 850; margin: 0 0 4px; letter-spacing: -.02em; }
.level-say { color: var(--ink-2); margin: 0 0 20px; }
.cats { display: grid; gap: 10px; max-width: 520px; }
.cat-row { display: grid; grid-template-columns: 7.5em 1fr 3.5em; gap: 12px; align-items: center; font-size: .9rem; color: var(--ink-2); }
.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--ink); width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.cat-score { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.notice { background: var(--accent-soft); border-radius: 12px; padding: 10px 14px; font-size: .92rem; margin: 14px 0 0; }

.c-great { color: var(--great); stroke: var(--great); }
.c-good { color: var(--good); stroke: var(--good); }
.c-ok { color: var(--ok); stroke: var(--ok); }
.c-low { color: var(--low); stroke: var(--low); }
.c-mute { color: var(--mute); stroke: var(--mute); }

.split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 20px; align-items: start; }

.fixes { list-style: none; margin: 0; padding: 0; counter-reset: fix; }
.fixes li { display: grid; grid-template-columns: 28px 1fr auto; gap: 14px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.fixes li:first-child { border-top: 0; padding-top: 2px; }
.fixes li::before {
  counter-increment: fix; content: counter(fix); width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--line); color: var(--ink-2); display: grid; place-content: center; font-weight: 750; font-size: .82rem;
}
.fix-title { font-weight: 700; margin-bottom: 2px; }
.fix-body { color: var(--ink-2); font-size: .93rem; }
.fix-skill { margin-top: 6px; font-size: .84rem; color: var(--ink-3); }
.fix-skill code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; color: var(--ink); }
.gain { font-weight: 750; font-size: .82rem; color: var(--accent-text); background: var(--accent-soft); border-radius: 999px; padding: 2px 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.prompt { margin-top: 18px; background: var(--surface-2); border-radius: 14px; padding: 14px 16px 16px; }
.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.prompt-head h3 { margin: 0; font-size: .95rem; }
.prompt p { margin: 0; font-size: .9rem; line-height: 1.65; color: var(--ink); word-break: break-word; }
.prompt + .hint { margin-top: 10px; }

.channels { display: grid; }
.channel { padding: 12px 0; border-top: 1px solid var(--line); }
.channel:first-child { border-top: 0; padding-top: 2px; }
.channel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.channel b { font-size: .98rem; }
.channel a { font-size: .84rem; font-weight: 650; white-space: nowrap; text-decoration: none; }
.channel a:hover { text-decoration: underline; }
.channel p { margin: 3px 0 0; color: var(--ink-2); font-size: .88rem; }

details.cat { border-top: 1px solid var(--line); }
details.cat:first-of-type { border-top: 0; }
details.cat summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; padding: 12px 2px; font-weight: 700; }
details.cat summary::-webkit-details-marker { display: none; }
details.cat summary::after { content: "＋"; color: var(--ink-3); font-weight: 400; }
details.cat[open] summary::after { content: "－"; }
details.cat summary .s { margin-left: auto; color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.checks { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.checks li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; font-size: .92rem; }
.checks .ico { font-weight: 900; }
.checks .pass .ico { color: var(--pass); }
.checks .fail .ico { color: var(--fail); }
.checks .partial .ico { color: var(--partial); }
.checks .ev { display: block; color: var(--ink-3); font-size: .85rem; word-break: break-word; }
.checks .pts { color: var(--ink-3); font-variant-numeric: tabular-nums; }

.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.codebox { display: flex; gap: 8px; align-items: stretch; margin-top: 10px; }
.codebox code { flex: 1; min-width: 0; display: block; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; overflow-x: auto; white-space: nowrap; font-size: .82rem; }
.codebox .prose { font-family: var(--sans); white-space: normal; font-size: .88rem; line-height: 1.6; }
.copy {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: 6px 12px; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.copy:hover { border-color: var(--accent); color: var(--accent); }
.badge-preview { display: block; height: 20px; margin-top: 6px; }
.hint { color: var(--ink-3); font-size: .86rem; margin: 6px 0 0; }

/* ---------- how (dark band) ---------- */
.how { background: var(--band); color: var(--band-ink); padding: 76px 0 80px; }
.how h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); letter-spacing: -.03em; margin: 0 0 36px; font-weight: 850; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.step { border-top: 1px solid var(--band-line); padding-top: 20px; }
.step .n { display: block; font-size: 2.6rem; font-weight: 850; line-height: 1; color: var(--accent); letter-spacing: -.04em; }
.step h3 { margin: 14px 0 6px; font-size: 1.1rem; }
.step p { margin: 0; color: var(--band-ink-2); font-size: .94rem; }
.install { margin-top: 44px; background: var(--band-surface); border: 1px solid var(--band-line); border-radius: var(--radius); padding: 26px; scroll-margin-top: 16px; }
.install h3 { font-size: 1.05rem; margin: 0 0 4px; }
.install .hint { color: var(--band-ink-2); margin-top: 14px; }
.install .codebox code { background: rgb(255 255 255 / .06); color: var(--band-ink); }
.install .copy { background: transparent; color: var(--band-ink); border-color: var(--band-line); }
.install .copy:hover { border-color: var(--accent); color: var(--accent); }

footer { padding-top: 28px; padding-bottom: 44px; color: var(--ink-3); font-size: .86rem; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 20px; padding-bottom: 56px; }
  .sample-card { margin: 0 auto; transform: none; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .has-result .sample { display: none; }
}

@media (max-width: 760px) {
  .wrap { padding-inline: 16px; }
  .score-card { grid-template-columns: minmax(0, 1fr); gap: 18px; text-align: center; }
  .level { justify-content: center; }
  .cats { margin: 0 auto; }
  .cat-row { grid-template-columns: 6em 1fr 3em; text-align: left; }
  .two, .steps { grid-template-columns: minmax(0, 1fr); }
  .steps { gap: 24px; }
  .card { padding: 20px; }
  .install { padding: 20px; }
  .fixes li { grid-template-columns: 26px 1fr; }
  .fixes li .gain { grid-column: 2; justify-self: start; }
  .token-row { flex-direction: column; }
  .how { padding: 56px 0 60px; }
}

@media (max-width: 420px) {
  .search { flex-direction: column; }
  .btn { width: 100%; padding: 12px 22px; }
  .sample-card { padding: 20px 18px; }
  .sb { grid-template-columns: 5.5em 1fr 2.6em; }
}

@media (max-width: 380px) {
  .brand-name { display: none; }
  .hero h1 { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
