/* Warehouse inspection bench: steel-grey surface, white bench paper, packing-tape amber. */
:root {
  --steel: #E6ECF1;
  --bench: #FFFFFF;
  --ink: #18222F;
  --muted: #586777;
  --line: #C6D0DA;
  --tape: #F2B21B;
  --tape-dark: #D99A00;
  --tape-ink: #241A00;
  --stamp: #1F4FC4;
  --photo-bg: #D5DDE5;
  --danger: #B3261E;
  --radius: 6px;
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --steel: #111923;
    --bench: #1A2430;
    --ink: #E8EEF4;
    --muted: #9AA9B8;
    --line: #2E3D4D;
    --tape: #F2B21B;
    --tape-dark: #FFC633;
    --tape-ink: #241A00;
    --stamp: #8AAEFF;
    --photo-bg: #0C121A;
    --danger: #FF8A80;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--steel);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; outline: none; }
img { max-width: 100%; display: block; }
a { color: var(--stamp); text-underline-offset: 3px; }
h1, h2 { line-height: 1.1; margin: 0; }
h2 { font-size: 1.25rem; font-weight: 700; font-stretch: 112%; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--stamp); outline-offset: 2px; border-radius: 3px; }
#app:focus, #app:focus-visible { outline: none; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--bench); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ------------------------------------------------------------ top bar */
.top { padding: 18px 0 10px; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 6px; background: var(--ink); position: relative; overflow: hidden;
}
.brand-mark::before { content: ''; position: absolute; left: 0; right: 0; top: 10px; height: 8px; background: var(--tape); }
.brand-mark::after {
  content: ''; position: absolute; left: 7px; top: 7px; width: 11px; height: 11px;
  border: 2.5px solid var(--bench); border-radius: 50%;
}
.brand-name { font-weight: 800; font-stretch: 120%; font-size: 1.15rem; letter-spacing: -0.01em; }
.lang {
  font: inherit; font-weight: 600; font-size: 0.875rem; color: var(--ink); background: transparent;
  border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer;
}
.lang:hover { border-color: var(--ink); }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2; text-decoration: none; text-align: center;
  border-radius: var(--radius); padding: 13px 20px; border: 2px solid transparent; cursor: pointer;
}
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-tape { background: var(--tape); color: var(--tape-ink); border-color: var(--tape); }
.btn-tape:hover { background: var(--tape-dark); border-color: var(--tape-dark); }
.btn-ink { background: var(--ink); color: var(--bench); }
.btn-ink:hover { opacity: 0.88; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-block { width: 100%; }

/* ------------------------------------------------------------ hero + search */
.hero { padding: clamp(32px, 7vw, 72px) 0 40px; max-width: 760px; }
.hero-title {
  font-size: clamp(2.1rem, 6.2vw, 3.75rem); font-weight: 800; font-stretch: 118%;
  letter-spacing: -0.025em; line-height: 1.02; margin-bottom: 18px;
}
.lead { font-size: 1.125rem; color: var(--muted); max-width: 62ch; margin-bottom: 40px; }

/* The search sits on a bench label with a strip of packing tape across it. */
.label-card {
  position: relative; background: var(--bench); border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 30px 22px 20px;
}
.label-card::before {
  content: ''; position: absolute; top: -14px; left: 7%; width: 44%; height: 26px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.10) 0 1px, transparent 1px 14px),
    var(--tape);
  transform: rotate(-1.4deg); opacity: 0.94;
  clip-path: polygon(1.5% 0, 100% 6%, 98.5% 100%, 0 92%);
}
.search-label { display: block; font-weight: 700; font-size: 0.9375rem; margin-bottom: 8px; }
.search-row { display: flex; gap: 10px; }
.search input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.0625rem; color: var(--ink);
  background: var(--steel); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
}
.search input::placeholder { color: var(--muted); opacity: 0.8; }
.search input:focus-visible { border-color: var(--stamp); outline-offset: 0; }
.form-error { color: var(--danger); font-weight: 600; margin-top: 10px; }
.form-error:empty { display: none; }
.hint { color: var(--muted); font-size: 0.875rem; margin-top: 12px; }
@media (max-width: 560px) {
  .search-row { flex-direction: column; }
  .label-card { padding: 28px 14px 16px; }
}

/* ------------------------------------------------------------ recent */
.recent { padding: 24px 0 8px; }
.recent h2 { margin-bottom: 16px; }
.recent-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px;
}
.recent-card { display: block; color: var(--ink); text-decoration: none; }
.recent-img {
  display: block; aspect-ratio: 1; background: var(--photo-bg); border-radius: var(--radius); overflow: hidden;
}
.recent-img img { width: 100%; height: 100%; object-fit: cover; }
.recent-card:hover .recent-img { outline: 3px solid var(--tape); outline-offset: -3px; }
.recent-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; font-size: 0.875rem; }
.recent-count { color: var(--muted); }

.plat {
  display: inline-block; font-size: 0.8125rem; font-weight: 700; padding: 2px 8px; border-radius: 4px;
  background: var(--ink); color: var(--bench);
}
.plat-taobao { background: #E8590C; color: #fff; }
.plat-weidian { background: #C2255C; color: #fff; }
.plat-1688 { background: #1C5DB8; color: #fff; }

/* ------------------------------------------------------------ how */
.how { padding: 48px 0 56px; }
.how h2 { margin-bottom: 20px; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.steps li { counter-increment: step; position: relative; padding-top: 48px; max-width: 34ch; }
.steps li::before {
  content: counter(step); position: absolute; top: 0; left: 0;
  font-size: 2.4rem; font-weight: 800; font-stretch: 125%; line-height: 1; color: var(--ink);
  border-bottom: 5px solid var(--tape); padding-bottom: 2px;
}

/* ------------------------------------------------------------ item page */
.item-top { display: flex; align-items: flex-start; gap: 16px; padding-top: 12px; flex-wrap: wrap; }
.back { font-weight: 600; padding-top: 12px; white-space: nowrap; }
.search-compact { flex: 1; min-width: 260px; max-width: 640px; }
.search-compact input { font-size: 1rem; padding: 10px 12px; background: var(--bench); }
.search-compact .btn { padding: 10px 16px; }
@media (max-width: 560px) {
  .item-top { flex-direction: column; gap: 8px; }
  .back { padding-top: 0; }
  .search-compact { width: 100%; min-width: 0; }
}
.item-head { display: flex; align-items: center; gap: 12px; padding: 28px 0 18px; flex-wrap: wrap; }
.item-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; font-stretch: 112%;
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em; overflow-wrap: anywhere;
}
.item-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding-bottom: 56px; }
@media (min-width: 900px) {
  .item-grid { grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); align-items: start; }
}

.stage {
  position: relative; margin: 0; aspect-ratio: 4 / 3; background: var(--photo-bg);
  border-radius: var(--radius); overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.shot { width: 100%; height: 100%; object-fit: contain; }
.nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
  border: none; background: rgba(24, 34, 47, 0.72); color: #fff; font-size: 1.75rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center; padding-bottom: 4px;
}
.nav:hover { background: rgba(24, 34, 47, 0.9); }
.nav-prev { left: 10px; }
.nav-next { right: 10px; }
/* The counter reads like a scale ticket stuck to the photo. */
.shot-count {
  position: absolute; left: 10px; bottom: 10px; background: var(--tape); color: var(--tape-ink);
  font-weight: 800; font-variant-numeric: tabular-nums; font-size: 0.875rem; padding: 3px 9px; border-radius: 3px;
}
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 6px; scrollbar-width: thin; }
.thumb {
  flex: 0 0 auto; width: 68px; height: 68px; padding: 0; border: 2px solid transparent; border-radius: 5px;
  background: var(--photo-bg); overflow: hidden; cursor: pointer;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb[aria-current='true'] { border-color: var(--tape); }
.thumb { position: relative; }
.thumb-num { display: none; }
.thumb.is-broken img { display: none; }
.thumb.is-broken .thumb-num {
  display: grid; place-items: center; width: 100%; height: 100%;
  font-weight: 800; font-size: 1.1rem; color: var(--muted);
}
.shot-blocked {
  display: none; position: absolute; inset: 0; padding: 24px 64px; text-align: center;
  flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.shot-blocked p { max-width: 34ch; }
.stage.is-broken .shot { visibility: hidden; }
.stage.is-broken .shot-blocked { display: flex; }
.gallery-meta { font-size: 0.875rem; margin-top: 8px; }
.gallery > .notice { margin-bottom: 14px; }
.shot-full { white-space: nowrap; }

.stage-loading { flex-direction: column; gap: 18px; padding: 24px; text-align: center; }
.stage-loading p { max-width: 40ch; }
.tape-loader {
  width: 180px; height: 22px; border-radius: 2px;
  background: repeating-linear-gradient(-45deg, var(--tape) 0 12px, var(--tape-dark) 12px 24px);
  background-size: 34px 34px; animation: tape 1s linear infinite;
}
@keyframes tape { to { background-position: 34px 0; } }
@media (prefers-reduced-motion: reduce) { .tape-loader { animation: none; } }

.notice {
  background: var(--bench); border-left: 5px solid var(--tape); border-radius: var(--radius);
  padding: 20px 22px; display: grid; gap: 14px;
}
.notice-empty { min-height: 220px; align-content: center; }
.notice p { max-width: 60ch; }
.elsewhere { display: grid; gap: 10px; }
.pill-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pill-links a {
  display: inline-block; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.pill-links a:hover { border-color: var(--ink); }

.panel {
  background: var(--bench); border: 1px solid var(--line); border-radius: 8px; padding: 22px;
  display: grid; gap: 12px;
}
.panel h2 { margin-bottom: 4px; }
.field-label { font-weight: 600; font-size: 0.875rem; color: var(--muted); }
.panel select {
  font: inherit; color: var(--ink); background: var(--steel); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 11px 12px; width: 100%;
}
.item-side { display: grid; gap: 16px; align-content: start; }
.small { font-size: 0.875rem; }

/* Conversion note: a strip of tape under the item number, like a relabelled parcel. */
.conv-note {
  display: table; max-width: 100%; margin: -4px 0 20px;
  background: var(--tape); color: var(--tape-ink); font-weight: 700; font-size: 0.9375rem;
  padding: 5px 12px; border-radius: 3px; transform: rotate(-0.6deg);
}

.link-rows { list-style: none; margin: 4px 0 0; padding: 0; display: grid; }
.link-rows li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-top: 1px solid var(--line);
}
.link-rows li:first-child { border-top: none; }
.link-rows li.is-original a { color: var(--ink); }
.link-rows a { font-weight: 600; overflow-wrap: anywhere; }
.copy-btn {
  flex: 0 0 auto; font: inherit; font-size: 0.8125rem; font-weight: 700; color: var(--ink);
  background: var(--steel); border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 12px;
  cursor: pointer; min-width: 74px;
}
.copy-btn:hover { border-color: var(--ink); }

/* ------------------------------------------------------------ footer */
.foot { border-top: 1px solid var(--line); padding: 22px 0 30px; color: var(--muted); font-size: 0.8125rem; }
.foot p { max-width: 80ch; }

/* ------------------------------------------------------------ product cards */
.card {
  display: flex; flex-direction: column; gap: 6px; height: 100%;
  color: var(--ink); text-decoration: none; background: var(--bench);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 8px 10px;
}
.card:hover { border-color: var(--ink); }
.card-img {
  display: block; aspect-ratio: 1; border-radius: 5px; overflow: hidden; background: var(--photo-bg);
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-title {
  font-size: 0.875rem; line-height: 1.35; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em;
}
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; }
.card-price { font-weight: 800; font-stretch: 110%; font-variant-numeric: tabular-nums; }
.qc-badge {
  font-size: 0.75rem; font-weight: 800; background: var(--tape); color: var(--tape-ink);
  padding: 2px 7px; border-radius: 3px;
}
.card-skel { pointer-events: none; }
.skel-line { display: block; height: 0.8em; border-radius: 3px; background: var(--photo-bg); }
.skel-line.short { width: 40%; }

/* ------------------------------------------------------------ popular shelf */
.shelf { padding: 8px 0 24px; }
.shelf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.shelf-nav { display: flex; gap: 8px; }
.scroll-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--bench);
  color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding-bottom: 3px;
}
.scroll-btn:hover:not(:disabled) { border-color: var(--ink); }
.scroll-btn:disabled { opacity: 0.35; cursor: default; }
.carousel {
  list-style: none; margin: 0; padding: 2px 2px 12px;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 200px); gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: thin;
  overscroll-behavior-x: contain;
}
.carousel > li { scroll-snap-align: start; }
@media (max-width: 560px) {
  .carousel { grid-auto-columns: 46%; gap: 10px; }
  .shelf-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) { .carousel { scroll-behavior: auto; } }

/* ------------------------------------------------------------ search results */
.results-head { padding: 26px 0 10px; display: grid; gap: 6px; }
.results-title { font-size: clamp(1.5rem, 3.6vw, 2.2rem); font-weight: 800; font-stretch: 112%; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.search-status { display: flex; align-items: center; gap: 12px; min-height: 28px; margin: 6px 0 16px; }
.search-status .notice { flex: 1; }
.tape-loader-sm { width: 72px; height: 12px; flex: 0 0 auto; }
.result-grid {
  list-style: none; margin: 0 0 56px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px;
}
@media (max-width: 560px) { .result-grid { grid-template-columns: 1fr 1fr; gap: 10px; } }

/* ------------------------------------------------------------ item: known product */
.item-product {
  display: flex; gap: 14px; align-items: center; background: var(--bench); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px; margin: -6px 0 20px; max-width: 760px;
}
.item-product img { width: 72px; height: 72px; object-fit: cover; border-radius: 5px; flex: 0 0 auto; background: var(--photo-bg); }
.item-product-title { font-weight: 600; line-height: 1.35; }
