/* Clean product look in the spirit of Meta's sites and Meta AI:
   white canvas, cool gray sections, Meta blue pill buttons,
   bold sans display type and a blue → violet → pink accent gradient. */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --section: #f1f4f7;
  --surface-2: #e9edf1;
  --line: #dee3e9;
  --line-strong: #cbd2d9;
  --text: #1c2b33;
  --muted: #465a69;
  --faint: #8595a4;
  --accent: #0064e0;
  --accent-strong: #0143b5;
  --accent-soft: #e5f0ff;
  --grad: linear-gradient(100deg, #0064e0 0%, #6b3cf0 52%, #e2427f 100%);
  --ok: #1d7f45;    --ok-soft: #e3f4e9;
  --warn: #a35a00;  --warn-soft: #fdf0dc;
  --hold: #0064e0;  --hold-soft: #e5f0ff;
  --done: #67788a;  --done-soft: #edf0f3;
  --bad: #c4283c;   --bad-soft: #fde7ea;
  --shadow: 0 1px 2px rgba(28, 43, 51, .06), 0 6px 20px -10px rgba(28, 43, 51, .16);
  --shadow-lg: 0 2px 6px rgba(28, 43, 51, .05), 0 30px 60px -28px rgba(40, 60, 140, .35);
  --radius: 24px;
  --sans: "Optimistic Display", "Optimistic Text", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b1216;
  --surface: #16222a;
  --section: #111b21;
  --surface-2: #1f2d36;
  --line: #24343e;
  --line-strong: #344a57;
  --text: #e8edf1;
  --muted: #a7b5c0;
  --faint: #73879a;
  --accent: #3d8bff;
  --accent-strong: #66a3ff;
  --accent-soft: rgba(61, 139, 255, .15);
  --grad: linear-gradient(100deg, #3d8bff 0%, #9b6bff 52%, #ff6f9d 100%);
  --ok: #5fcf8c;    --ok-soft: rgba(95, 207, 140, .14);
  --warn: #f2b155;  --warn-soft: rgba(242, 177, 85, .14);
  --hold: #66a3ff;  --hold-soft: rgba(102, 163, 255, .15);
  --done: #8b9cab;  --done-soft: rgba(139, 156, 171, .14);
  --bad: #ff7a8a;   --bad-soft: rgba(255, 122, 138, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 30px 60px -28px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
}
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
a { color: var(--accent); text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); padding: .1em .4em; border-radius: 6px; }
h1, h2 { margin: 0; font-weight: 600; }
h2 { font-size: 22px; letter-spacing: -.015em; }
.sub, .hint { color: var(--muted); font-size: 15px; margin: 6px 0 0; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 0 14px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------- nav --- */
.nav { position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark { width: 26px; height: 26px; flex: none; border-radius: 50%; background: conic-gradient(from 210deg, #0064e0, #6b3cf0, #e2427f, #ff9f43, #0064e0); -webkit-mask: radial-gradient(circle, transparent 6.5px, #000 7px); mask: radial-gradient(circle, transparent 6.5px, #000 7px); }
.live { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); animation: pulse 2.4s ease-in-out infinite; }
.dot.off { background: var(--bad); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--section); border-radius: 999px; }
.seg button { appearance: none; border: 0; background: transparent; color: var(--muted); font: 600 13px var(--sans); min-height: 32px; padding: 6px 14px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(28, 43, 51, .14); }
[data-theme="dark"] .seg button.on { background: var(--surface-2); }
.seg .n { font-variant-numeric: tabular-nums; color: var(--faint); margin-left: 2px; }
.icon-btn { appearance: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 0; background: var(--section); color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.i-moon { display: none; }
[data-theme="dark"] .i-moon { display: block; } [data-theme="dark"] .i-sun { display: none; }

/* ------------------------------------------------------------ hero --- */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: center; padding: 72px 0 56px; }
.hero h1 { font-size: clamp(38px, 5.4vw, 64px); line-height: 1.06; letter-spacing: -.035em; font-weight: 600; text-wrap: balance; }
[data-lang="zh"] .hero h1 { letter-spacing: -.01em; line-height: 1.18; }
.lead { font-size: 18px; color: var(--muted); max-width: 32em; margin: 22px 0 30px; text-wrap: pretty; }
.stats { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.stats li { display: flex; align-items: baseline; gap: 7px; padding: 8px 16px; border-radius: 999px; background: var(--section); font-size: 13px; font-weight: 500; color: var(--muted); }
.stats b { font: 700 16px var(--sans); font-variant-numeric: tabular-nums; color: var(--text); }
.stats .ok b { color: var(--ok); } .stats .warn b { color: var(--warn); } .stats .hold b { color: var(--hold); } .stats .bad b { color: var(--bad); }

.hero-pick { position: relative; isolation: isolate; }
.hero-pick::before { content: ""; position: absolute; inset: -12% -8%; z-index: -1; border-radius: 50%; background: radial-gradient(40% 50% at 30% 40%, rgba(0, 100, 224, .22), transparent 70%), radial-gradient(40% 50% at 70% 55%, rgba(107, 60, 240, .2), transparent 70%), radial-gradient(35% 45% at 55% 80%, rgba(226, 66, 127, .16), transparent 70%); filter: blur(24px); pointer-events: none; }
.pick-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.spark { width: 10px; height: 10px; border-radius: 50%; background: var(--grad); }
.hero-pick .hint { margin-top: 14px; font-size: 14px; }

/* ----------------------------------------------------------- panels --- */
.panel { background: var(--section); border-radius: var(--radius); padding: 32px; margin: 24px 0; }
.panel-head { margin-bottom: 22px; }
.panel-head.split { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.mine { background: var(--surface); border: 2px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; box-shadow: var(--shadow-lg); scroll-margin-top: calc(80px + env(safe-area-inset-top)); }
.mine-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.mine-row .code { font: 600 26px var(--mono); letter-spacing: .04em; }
.mine-row .meta { margin-top: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ----------------------------------------------------------- search --- */
.search { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 18px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { width: 18px; height: 18px; color: var(--faint); flex: none; }
.search input { flex: 1; border: 0; background: transparent; padding: 9px 0; font: 600 16px var(--mono); letter-spacing: .03em; color: var(--text); outline: none; min-width: 0; text-transform: uppercase; }
.search input::placeholder { font-family: var(--sans); letter-spacing: 0; font-weight: 400; color: var(--faint); text-transform: none; }
#checkResult:not(:empty) { margin-top: 20px; }
.check-out { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 24px; align-items: start; }
.explain p { margin: 0 0 8px; }
.verdict { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.verdict.ok { color: var(--ok); } .verdict.warn { color: var(--warn); } .verdict.hold { color: var(--hold); } .verdict.bad { color: var(--bad); } .verdict.done { color: var(--done); }

/* ------------------------------------------------------------ timer --- */
.timer { display: flex; align-items: center; gap: 10px; }
.timer svg { width: 40px; height: 40px; transform: rotate(-90deg); }
.timer circle { stroke-width: 3; }
.timer .track { stroke: var(--line); }
.timer .prog { stroke: var(--accent); stroke-dasharray: 97.4; transition: stroke-dashoffset .25s linear; }
.timer > div { display: flex; flex-direction: column; line-height: 1.15; }
.timer-label { font-size: 12px; color: var(--muted); }
.timer b { font: 700 20px var(--sans); font-variant-numeric: tabular-nums; display: inline; }
.timer .unit { font-size: 13px; color: var(--muted); margin-left: 2px; }

/* ------------------------------------------------------------ cards --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.grid + .grid { margin-top: 14px; }
.grid:empty { display: none; }
.card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); transition: transform .18s ease, box-shadow .18s ease; animation: rise .35s ease both; }
.grid .card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.card .code { font: 600 19px var(--mono); letter-spacing: .05em; word-break: break-all; }
.card.big { padding: 28px; gap: 16px; border-radius: 28px; border: 1.5px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; box-shadow: var(--shadow-lg); }
.card.big .code { font-size: clamp(34px, 4.4vw, 46px); letter-spacing: .08em; font-weight: 700; }
.card.done .code, .card.bad .code { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--faint); }
.card.done, .card.bad { background: transparent; }
.card.hold { border-style: dashed; }
.card-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px 4px 8px; border-radius: 999px; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.hold { background: var(--hold-soft); color: var(--hold); } .badge.done { background: var(--done-soft); color: var(--done); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.pill { font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: var(--section); color: var(--muted); white-space: nowrap; }
.pill.star { color: var(--accent); background: var(--accent-soft); }
.pill.you { color: var(--hold); background: var(--hold-soft); }
.uses { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.uses div { height: 100%; border-radius: 6px; background: var(--accent); transition: width .4s ease; }
.card.ok .uses div { background: var(--ok); } .card.warn .uses div { background: var(--warn); } .card.done .uses div { background: var(--done); }
.card.big .uses div { background: var(--grad); }
.meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.meta b { color: var(--text); font-weight: 700; }
.note { font-size: 13px; font-weight: 500; color: var(--muted); }
.compact .card { padding: 12px 14px; gap: 6px; }
.compact .card .code { font-size: 15px; }
.card .btn { margin-top: auto; }

/* ---------------------------------------------------------- buttons --- */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); padding: 10px 20px; border-radius: 999px; font: 600 15px var(--sans); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn:focus-visible, .seg button:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
[data-theme="dark"] .btn.primary { background: #0064e0; border-color: #0064e0; }
[data-theme="dark"] .btn.primary:hover { background: #1a77f2; border-color: #1a77f2; }
.btn.dark { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.dark:hover { opacity: .88; background: var(--text); }
.btn.soft { background: var(--section); border-color: transparent; }
.btn.soft:hover { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); background: transparent; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.xl { min-height: 54px; padding: 15px 24px; font-size: 17px; }

/* ------------------------------------------------------------ forms --- */
.submit { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 12px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.field input { width: 100%; background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); padding: 12px 16px; border-radius: 14px; font: 16px var(--sans); min-width: 0; outline: none; transition: border-color .15s, box-shadow .15s; }
.field.wide input { font-family: var(--mono); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.field.wide input::placeholder { font-weight: 400; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.submit .btn { height: 48px; }
.msg { margin-top: 12px; font-size: 14px; }
.msg:empty { display: none; }
.msg.ok { color: var(--ok); } .msg.bad { color: var(--bad); }

/* ------------------------------------------------------ transparency --- */
.algo .eyebrow { margin-bottom: 8px; }
.algo h2 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -.03em; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 8px 0 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.steps li { counter-increment: s; position: relative; padding: 18px 18px 18px 58px; background: var(--surface); border-radius: 18px; font-size: 15px; color: var(--text); }
.steps li::before { content: counter(s); position: absolute; left: 18px; top: 17px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font: 700 13px var(--sans); }
.steps b { font-weight: 700; }
.snippet { margin: 0 0 24px; }
.snippet figcaption { font-size: 14px; color: var(--muted); margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 2px 10px; }
.snippet figcaption b { color: var(--text); font-weight: 600; }
.snippet pre { margin: 0; padding: 18px 20px; max-height: 440px; overflow: auto; background: #0b1216; color: #dbe4ea; border-radius: 18px; font: 13px/1.65 var(--mono); tab-size: 2; -webkit-overflow-scrolling: touch; }
.snippet code { background: none; padding: 0; font-size: inherit; white-space: pre; color: inherit; }
.meta .copies { color: var(--muted); }
#coreLine { margin-bottom: 18px; word-break: break-word; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.chain { margin-top: 16px; font-size: 13px; color: var(--muted); line-height: 2; overflow-wrap: anywhere; }
.checks { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.checks:empty { display: none; }
.checks li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--surface); }
.checks li > div { min-width: 0; }
.checks .tick { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 700; }
.checks .ok .tick { background: var(--ok-soft); color: var(--ok); }
.checks .bad .tick { background: var(--bad-soft); color: var(--bad); }
.checks .sub { margin: 2px 0 0; font-size: 12.5px; font-family: var(--mono); word-break: break-all; }
.checks .summary { font-weight: 700; justify-content: center; text-align: center; }
.checks .summary.ok { background: var(--ok-soft); color: var(--ok); }
.checks .summary.bad, .checks li.bad:only-child { background: var(--bad-soft); color: var(--bad); }
.checks .running { color: var(--muted); }

/* ------------------------------------------------------------- misc --- */
.empty { color: var(--muted); text-align: center; padding: 32px 16px; grid-column: 1 / -1; border: 1.5px dashed var(--line-strong); border-radius: 18px; font-size: 14px; }
.skeleton { height: 250px; border-radius: 28px; background: linear-gradient(90deg, var(--section), var(--surface-2), var(--section)); background-size: 200% 100%; animation: sh 1.3s infinite; }
@keyframes sh { to { background-position: -200% 0; } }
.toast { position: fixed; left: 50%; bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px)); transform: translateX(-50%); z-index: 30; width: max-content; max-width: min(calc(100vw - 32px), 520px); padding: 13px 20px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500; text-align: center; box-shadow: var(--shadow-lg); animation: toast .25s ease; }
.toast.bad { background: var(--bad); color: #fff; }
.toast[hidden] { display: none; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 8px); } }
.foot { text-align: center; color: var(--faint); font-size: 13px; padding: 24px 0 calc(48px + env(safe-area-inset-bottom)); max-width: 46em; margin: 0 auto; }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ----------------------------------------------------------- mobile --- */
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 40px 0 24px; }
  .check-out { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .nav-in { gap: 10px; height: 56px; }
  .live span:last-child { display: none; }
  .brand { font-size: 16px; }
  .mark { width: 24px; height: 24px; }
  .seg button { padding: 6px 11px; }
  .hero { padding-top: 32px; }
  .lead { font-size: 16px; margin: 16px 0 22px; }
  .stats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .stats::-webkit-scrollbar { display: none; }
  .stats li { flex: none; }
  .hero-pick::before { inset: -6% 0; }
  .panel { padding: 20px 16px; border-radius: 20px; margin: 16px 0; }
  .panel-head { margin-bottom: 18px; }
  h2 { font-size: 20px; }
  .grid:not(#heroBody) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 14px; gap: 8px; border-radius: 16px; }
  .card .code { font-size: 15px; }
  .card .btn { min-height: 40px; padding: 8px 12px; font-size: 14px; }
  .card.big { padding: 22px; border-radius: 24px; }
  .card.big .btn { min-height: 52px; font-size: 16px; }
  .submit { grid-template-columns: 1fr 1fr; }
  .submit .wide, .submit .btn { grid-column: 1 / -1; }
  .mine-row .actions { width: 100%; }
  .mine-row .actions .btn.primary { flex: 1; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li { padding: 16px 16px 16px 54px; }
  .steps li::before { left: 16px; top: 15px; }
  .panel-head.split .tabs { width: 100%; }
  .panel-head.split .tabs button { flex: 1; }
}
@media (max-width: 400px) {
  .nav-in { gap: 8px; }
  .brand { gap: 8px; font-size: 15px; }
  .nav-actions { gap: 6px; }
  .seg button { padding: 6px 9px; }
  .icon-btn { width: 34px; height: 34px; }
}
