:root {
  --bg: #f7f7f5; --card: #ffffff; --text: #1c1f1e; --muted: #5d6662; --line: #e3e5e1;
  --brand: #0f766e; --brand-ink: #ffffff; --ok: #15803d; --issue: #b45309; --und: #6b7280; --err: #b91c1c;
  --warn-bg: #fff7e6; --demo-bg: #fde68a; --chosen: #ecfdf5;
  --tap: 44px; --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1412; --card: #16201d; --text: #e7ece9; --muted: #9aa6a1; --line: #24312d;
    --brand: #2dd4bf; --brand-ink: #062a26; --ok: #4ade80; --issue: #fbbf24; --und: #9ca3af; --err: #f87171;
    --warn-bg: #2a2212; --demo-bg: #5b4a10; --chosen: #10291f; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1412; --card: #16201d; --text: #e7ece9; --muted: #9aa6a1; --line: #24312d;
  --brand: #2dd4bf; --brand-ink: #062a26; --ok: #4ade80; --issue: #fbbf24; --und: #9ca3af; --err: #f87171;
  --warn-bg: #2a2212; --demo-bg: #5b4a10; --chosen: #10291f; color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
.top { position: sticky; top: 0; z-index: 5; background: var(--brand); padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; }
.top a { color: var(--brand-ink); text-decoration: none; font-weight: 700; }
main { max-width: 760px; margin: 0 auto; padding: 12px 16px calc(84px + env(safe-area-inset-bottom)); }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; color: var(--muted); text-decoration: none; font-size: 12px; gap: 2px; }
.tabs a span { font-size: 20px; line-height: 1; }
.tabs a.active { color: var(--brand); font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 12px; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; gap: 8px; align-items: center; }
.wrap { flex-wrap: wrap; }
h2 { font-size: 19px; margin: 0; } h3 { font-size: 16px; margin: 0 0 8px; } h4 { font-size: 15px; margin: 0 0 4px; }
label { display: block; font-size: 14px; color: var(--muted); }
input[type=text], input[type=url], input[type=number], textarea, select {
  display: block; width: 100%; margin-top: 4px; min-height: var(--tap); padding: 10px 12px; font: inherit; font-size: 16px; /* 16px prevents iOS zoom */
  color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
textarea { resize: vertical; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 8px 14px; font: inherit; font-size: 15px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; text-decoration: none; }
button.primary, .button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; width: 100%; }
button.small { min-height: 34px; padding: 4px 10px; font-size: 13px; }
.tog { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding-right: 12px; color: var(--text); }
.tog input { width: 22px; height: 22px; }
fieldset { border: 0; padding: 0; margin: 0; } legend { font-size: 14px; color: var(--muted); }
summary { cursor: pointer; min-height: 32px; display: list-item; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.err { color: var(--err); }
.warnbox { background: var(--warn-bg); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: 14px; }
.demo { background: var(--demo-bg); color: var(--text); font-weight: 700; padding: 10px 12px; border-radius: 10px; margin: 0 0 12px; }
.offline { background: var(--warn-bg); padding: 8px 16px; font-size: 14px; }
.plain { list-style: none; padding: 0; margin: 0; } .plain li + li { margin-top: 6px; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.badge.must { border-color: var(--brand); color: var(--brand); } .badge.warn { border-color: var(--issue); color: var(--issue); }
.mp-tmall { border-color: #dc2626; color: #dc2626; } .mp-taobao { border-color: #ea580c; color: #ea580c; } .mp-pinduoduo { border-color: #e11d48; color: #e11d48; }
.price { font-size: 18px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 12px; overflow: hidden; }
.itemlink { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px; color: inherit; text-decoration: none; }
.itemlink img, .itemlink .noimg { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; background: var(--bg); }
.body { min-width: 0; } .body h4 { overflow-wrap: anywhere; }
.why { list-style: none; padding: 0; margin: 6px 0 0; font-size: 14px; }
.s-ok { color: var(--ok); } .s-issue { color: var(--issue); } .s-undetermined, .s-no_data { color: var(--und); }
.why li, .findings li { color: inherit; } .why li span, .findings > li > span { display: inline-block; width: 1.1em; }
.findings { list-style: none; padding: 0; margin: 0; } .findings > li { padding: 8px 0; border-top: 1px solid var(--line); } .findings > li:first-child { border-top: 0; }
.findings details { color: var(--muted); font-size: 13px; margin: 4px 0 0 1.1em; } .findings q { color: var(--text); overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chip.st-running { border-color: var(--brand); color: var(--brand); } .chip.st-error { border-color: var(--err); color: var(--err); } .chip.st-ok { color: var(--ok); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 12px 12px; }
.stage { font-weight: 600; } .stage.st-done { color: var(--ok); }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px 12px; padding: 0 16px; }
.gallery figure { margin: 0; flex: 0 0 78%; max-width: 360px; scroll-snap-align: start; display: grid; gap: 6px; }
.gallery img, .gallery .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); background: var(--card); }
.noimg { background: repeating-linear-gradient(45deg, var(--line) 0 6px, transparent 6px 12px); }
table { width: 100%; border-collapse: collapse; font-size: 14px; } td, th { padding: 8px 6px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
tr.chosen td { background: var(--chosen); }
.scrollx { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.compare { min-width: 560px; } table.compare img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; } table.compare th:first-child { width: 110px; color: var(--muted); font-weight: 500; }
.orig { font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
a { color: var(--brand); }
@media (min-width: 640px) { .itemlink { grid-template-columns: 128px 1fr; } .itemlink img, .itemlink .noimg { width: 128px; height: 128px; } }

/* --- markup used by app.js (china-app-6a) --- */
.between { justify-content: space-between; }
.field { display: block; }
button.ghost { background: transparent; }
.link { background: none; border: 0; color: var(--brand); padding: 0; min-height: 32px; }
.list { padding-left: 18px; margin: 6px 0 0; } .list li + li { margin-top: 6px; }
.warn { background: var(--warn-bg); border-radius: 10px; padding: 10px 12px; margin: 8px 0 0; font-size: 14px; }
.badge.warnb { border-color: var(--issue); color: var(--issue); }
h2 { margin: 16px 0 10px; } .card h2 { margin: 0 0 8px; } h2.inline { display: inline; }
.result { display: grid; grid-template-columns: 96px 1fr; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 0 0 12px; }
.thumb img, .thumb .noimg { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; background: var(--bg); display: block; }
.result .title { display: block; color: var(--text); text-decoration: none; font-weight: 600; overflow-wrap: anywhere; margin-bottom: 4px; }
.result .actions { grid-template-columns: 1fr 1fr; padding: 8px 0 0; }
.price.unknown { color: var(--und); font-size: 15px; }
.price-note { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.why li.ok { color: var(--ok); } .why li.issue { color: var(--issue); } .why li.undetermined, .why li.no_data { color: var(--und); }
.why li span { margin-right: 4px; }
.excl { font-size: 13px; color: var(--err); margin: 6px 0 0; }
.steps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.step { font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.step.st-running { border-color: var(--brand); color: var(--brand); } .step.st-ok { color: var(--ok); } .step.st-error { border-color: var(--err); color: var(--err); }
.findings > li { display: grid; grid-template-columns: 1.4em 1fr; }
.findings > li.ok .ic { color: var(--ok); } .findings > li.issue .ic { color: var(--issue); } .findings > li.undetermined .ic, .findings > li.no_data .ic { color: var(--und); }
.ev ul { padding-left: 16px; margin: 4px 0; }
.otitle { font-size: 19px; margin: 0 0 4px; overflow-wrap: anywhere; }
.zh { overflow-wrap: anywhere; }
.num { text-align: right; white-space: nowrap; }
.noimg.big { width: 100%; aspect-ratio: 1; border-radius: var(--radius); }
.hscroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.compare td span.ok { color: var(--ok); } .compare td span.issue { color: var(--issue); } .compare td span.undetermined { color: var(--und); }
.ocr { margin-top: 8px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
@media (min-width: 640px) { .result { grid-template-columns: 128px 1fr; } .thumb img, .thumb .noimg { width: 128px; height: 128px; } }
.browse { user-select: none; -webkit-user-select: none; display: flex; flex-direction: column; gap: 6px; height: calc(100dvh - 56px - 84px - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px); }
.bbar { gap: 6px; align-items: center; flex: none; }
.bbar input { flex: 1; min-width: 0; user-select: text; -webkit-user-select: text; }
.bbar .primary { white-space: nowrap; }
.screen { position: relative; flex: 1; min-height: 0; display: flex; justify-content: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.screen img { display: block; width: 100%; height: 100%; object-fit: fill; touch-action: none; user-select: none; -webkit-user-select: none; }
.screen p { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }
.screen p[hidden] { display: none; }
.browse details { flex: none; font-size: 13px; }
.bbar .primary, .bbar button { width: auto; flex: none; }
.burl { margin: 0; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
