/* ==========================================================================
   Tape Showcase — design system
   Modern minimal · pure white canvas · 8pt spacing scale
   ========================================================================== */

/* Author display rules (grid/flex) would otherwise beat the UA's
   [hidden] { display: none } and keep "hidden" panels rendered. */
[hidden] { display: none !important; }

:root {
  /* Surfaces — the canvas is pure white as specified */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --surface-sunken: #f5f6f7;

  /* Ink */
  --ink: #0f1115;
  --ink-2: #3d4351;
  --ink-3: #6b7280;
  --ink-4: #9aa1ac;

  /* Lines */
  --line: #ececef;
  --line-2: #e2e3e7;
  --line-strong: #d3d5da;

  /* Accent — a single restrained hue */
  --accent: #111827;
  --accent-ink: #ffffff;
  --focus: #2563eb;

  /* Semantic */
  --ok: #12805c;
  --ok-soft: #e8f5f0;
  --warn: #b45309;
  --warn-soft: #fef6e7;
  --danger: #c0392b;
  --danger-soft: #fdeceb;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-xs: 0 1px 2px rgba(15, 17, 21, .04);
  --shadow-sm: 0 1px 3px rgba(15, 17, 21, .05), 0 1px 2px rgba(15, 17, 21, .03);
  --shadow-md: 0 4px 14px rgba(15, 17, 21, .07), 0 1px 3px rgba(15, 17, 21, .04);
  --shadow-lg: 0 14px 40px rgba(15, 17, 21, .11), 0 2px 8px rgba(15, 17, 21, .05);

  --header-h: 128px;
  --nav-h: 52px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body { min-height: 100%; overflow-x: hidden; }

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 20px; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 0 1 auto;
}

/* Compact fixed-size logo; the brand name carries the visual weight. */
.brand-logo {
  height: 40px;
  width: auto;
  min-width: 40px;
  max-width: 110px;
  flex: 0 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  object-fit: contain;
  padding: 3px;
}

.brand-logo--fallback {
  display: grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.02em;
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
  padding: 0;
}

.brand-text { min-width: 0; display: flex; flex-direction: column; justify-content: center; }

.brand-name {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: #d0021b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-contact {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
}

.contact-list {
  /* Two rows × two columns: address·phone / e-mail·website */
  display: grid;
  grid-template-columns: auto auto;
  gap: 4px 18px;
  justify-content: end;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
  max-width: 340px;
}

.contact-item svg { flex: 0 0 auto; color: var(--ink-4); }

.contact-item a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* 地址行（无链接行）允许换行完整显示，不截断 */
.contact-item span {
  white-space: normal;
  line-height: 1.35;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

/* Language picker */

.lang-picker { position: relative; }

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}

.lang-btn:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.lang-btn .flag { font-size: 15px; line-height: 1; }
.lang-btn .chev { color: var(--ink-4); transition: transform .18s var(--ease); }
.lang-picker[data-open="true"] .chev { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .16s var(--ease), transform .16s var(--ease), visibility .16s;
  z-index: 70;
}

.lang-picker[data-open="true"] .lang-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}

.lang-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-size: 13.5px;
  transition: background .12s var(--ease);
}

.lang-item:hover { background: var(--surface-sunken); }
.lang-item[aria-selected="true"] { background: var(--surface-sunken); font-weight: 600; }
.lang-item .flag { font-size: 16px; }
.lang-item .code {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  color: var(--ink-4);
  letter-spacing: .04em;
}

/* Share / account cluster */

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--ink-2);
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}

.icon-btn:hover { border-color: var(--line-strong); background: var(--surface-soft); color: var(--ink); }
.icon-btn--share { width: 36px; }

/* Search */

.search-box {
  position: relative;
  flex: 0 1 170px;
  min-width: 120px;
}

.search-box svg {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-4);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 36px;
  padding: 0 30px 0 32px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}

.search-input::placeholder { color: var(--ink-4); }

.search-input:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}

.search-clear {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  display: none;
  place-items: center;
  width: 22px; height: 22px;
  background: none; border: 0; border-radius: 50%;
  cursor: pointer; color: var(--ink-4);
}
.search-clear:hover { background: var(--surface-sunken); color: var(--ink-2); }
.search-box[data-filled="true"] .search-clear { display: grid; }

/* Mobile header toggle */

.menu-toggle { display: none; }

/* ==========================================================================
   Category nav (horizontal slider)
   ========================================================================== */

.cat-nav {
  position: sticky;
  top: 76px;
  z-index: 55;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.cat-nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-scroll {
  display: flex;
  align-items: stretch;
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1 1 auto;
  padding: 6px 0;
}

.nav-scroll::-webkit-scrollbar { display: none; }

.nav-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  height: 38px;
  padding: 0 14px;
  background: none;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color .15s var(--ease), background .15s var(--ease);
}

.nav-pill:hover { color: var(--ink); background: var(--surface-sunken); }

.nav-pill[aria-current="true"] {
  color: var(--accent);
  font-weight: 650;
  background: var(--surface-sunken);
}

.nav-pill .pill-count {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 20px;
  background: var(--line);
  color: var(--ink-3);
  line-height: 1.5;
}

.nav-pill[aria-current="true"] .pill-count { background: var(--accent); color: var(--accent-ink); }

.nav-arrow {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px; height: 30px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink-2);
  box-shadow: var(--shadow-xs);
  transition: opacity .18s var(--ease), border-color .15s var(--ease);
}

.nav-arrow:hover { border-color: var(--line-strong); }
.nav-arrow[disabled] { opacity: 0; pointer-events: none; }

/* Fade hints at the scroll edges */
.nav-fade {
  position: absolute;
  top: 0; bottom: 0;
  width: 34px;
  pointer-events: none;
  z-index: 2;
}
.nav-fade--l { left: 0; background: linear-gradient(90deg, #fff 30%, rgba(255,255,255,0)); opacity: 0; transition: opacity .2s; }
.nav-fade--r { right: 0; background: linear-gradient(270deg, #fff 30%, rgba(255,255,255,0)); opacity: 0; transition: opacity .2s; }
.cat-nav-inner[data-overflow-l="true"] .nav-fade--l { opacity: 1; }
.cat-nav-inner[data-overflow-r="true"] .nav-fade--r { opacity: 1; }

/* ==========================================================================
   Page body
   ========================================================================== */

main { padding: 26px 0 72px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  scroll-margin-top: calc(var(--header-h) + 14px);
}

.page-title {
  margin: 0;
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -.025em;
  line-height: 1.2;
}

.page-sub {
  margin: 5px 0 0;
  font-size: 13.5px;
  color: var(--ink-3);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.select-wrap { position: relative; }

.select {
  appearance: none;
  height: 36px;
  padding: 0 30px 0 11px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 11px; top: 50%;
  width: 7px; height: 7px;
  border-right: 1.5px solid var(--ink-4);
  border-bottom: 1.5px solid var(--ink-4);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.count-chip {
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 6px 11px;
  background: var(--surface-sunken);
  border-radius: 20px;
  white-space: nowrap;
}

/* ==========================================================================
   Product grid & cards
   ========================================================================== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow .22s var(--ease), border-color .22s var(--ease), transform .22s var(--ease);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--line-2);
  transform: translateY(-2px);
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-sunken);
  overflow: hidden;
  cursor: pointer;
}

/* The stamp logo opts out — it sizes itself (see .card-logo below). */
.card-media img:not(.card-logo) {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}

.card:hover .card-media img:not(.card-logo) { transform: scale(1.035); }

.card-media--empty {
  display: grid;
  place-items: center;
  color: var(--ink-4);
  background:
    linear-gradient(135deg, #fafafa 25%, transparent 25%) -8px 0 / 16px 16px,
    linear-gradient(225deg, #fafafa 25%, transparent 25%) -8px 0 / 16px 16px,
    linear-gradient(315deg, #fafafa 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(45deg, #fafafa 25%, #fff 25%) 0 0 / 16px 16px;
}

.card-media--empty svg { opacity: .5; }

.card-cat {
  position: absolute;
  top: 10px; left: 10px;
  padding: 3px 9px;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 550;
  color: var(--ink-2);
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Category chip moves to the right when the logo badge sits top-left. */
.card-media--branded .card-cat { left: auto; right: 10px; }

/*
 * Company logo stamped on the product image: top-left, transparent, layered
 * above the photo. `sizeCardLogos()` sets an absolute width equal to 25% of the
 * card media box; the 25% here is only a fallback before that measurement runs.
 */
.card-logo {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: 25%;
  max-width: 130px;
  height: auto;
  object-fit: contain;
  opacity: .92;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 1px 2px rgba(15, 17, 21, .16));
}

/* Extra product photos, shown as a small counter badge. */
.card-image-count {
  position: absolute;
  bottom: 8px; right: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(15, 17, 21, .62);
  backdrop-filter: blur(6px);
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 550;
  color: #fff;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 15px 15px;
  flex: 1 1 auto;
}

.card-name {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

/* Attribute rows: spec / colour */
.card-attrs {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.attr {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  min-width: 0;
}

.attr-key {
  flex: 0 0 auto;
  color: var(--ink-4);
  font-size: 11.5px;
  letter-spacing: .01em;
}

.attr-val {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Barcode plate */
.barcode-plate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 8px 7px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.barcode-svg { display: block; width: 100%; height: 44px; }

.barcode-digits {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1;
}

.price-amount {
  font-size: 20px;
  font-weight: 680;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.price-cur {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}

.price--na { font-size: 13px; color: var(--ink-4); }

.sku {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-4);
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin-top: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}

.btn:hover { background: var(--surface-sunken); border-color: var(--line-strong); color: var(--ink); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #000; border-color: #000; color: #fff; }
.btn--ghost { background: none; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-sunken); }
.btn--icon { width: 34px; padding: 0; }

/* ==========================================================================
   Empty / error states
   ========================================================================== */

.state {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 72px 24px;
  text-align: center;
}

.state-icon {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--surface-sunken);
  color: var(--ink-4);
  margin-bottom: 4px;
}

.state h3 { margin: 0; font-size: 16px; font-weight: 620; }
.state p { margin: 0; font-size: 13.5px; color: var(--ink-3); max-width: 420px; }

/* ==========================================================================
   Skeleton
   ========================================================================== */

.sk { background: linear-gradient(90deg, #f2f3f5 25%, #e9eaed 37%, #f2f3f5 63%); background-size: 400% 100%; animation: shimmer 1.3s ease-in-out infinite; border-radius: 4px; }

@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

.sk-card { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.sk-media { aspect-ratio: 4/3; border-radius: 0; }
.sk-body { padding: 14px 15px; display: grid; gap: 9px; }
.sk-line { height: 11px; }

/* ==========================================================================
   Back to top
   ========================================================================== */

.back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(.94);
  transition: opacity .24s var(--ease), transform .24s var(--ease), visibility .24s;
}

.back-top[data-visible="true"] { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.back-top:hover { background: #000; }
.back-top:active { transform: translateY(0) scale(.96); }

/* Radial progress ring around the button */
.back-top-progress {
  position: absolute;
  inset: -3px;
  transform: rotate(-90deg);
  pointer-events: none;
}

.back-top-progress circle {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  opacity: .28;
  stroke-dasharray: 138.2;
  stroke-dashoffset: 138.2;
  transition: stroke-dashoffset .1s linear;
}

/* ==========================================================================
   Modal (QR / share / detail)
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 17, 21, .42);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s var(--ease), visibility .2s;
}

.modal[data-open="true"] { opacity: 1; visibility: visible; }

.modal-panel {
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(.98);
  transition: transform .24s var(--ease);
}

.modal[data-open="true"] .modal-panel { transform: translateY(0) scale(1); }
.modal-panel--wide { max-width: 720px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.015em; }

.modal-body { padding: 20px; }

/* QR modal */
.qr-stage {
  display: grid;
  place-items: center;
  gap: 14px;
}

.qr-canvas-wrap {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.qr-canvas-wrap canvas { width: 232px; height: 232px; display: block; image-rendering: pixelated; }

.qr-url {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
}

.qr-url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }

.share-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 9px;
  width: 100%;
}

.share-target {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}

.share-target:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.share-target svg { flex: 0 0 auto; }
.share-target--wa svg { color: #25d366; }
.share-target--fb svg { color: #1877f2; }
.share-target--x svg { color: #0f1115; }
.share-target--mail svg { color: var(--ink-3); }

/* Detail modal */
.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}

.detail-media {
  aspect-ratio: 1 / 1;
  background: var(--surface-sunken);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.detail-media img { width: 100%; height: 100%; object-fit: contain; }

/* --- gallery: main image + thumbnail strip --- */
.detail-gallery { display: flex; flex-direction: column; gap: 10px; }

.detail-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.detail-thumb {
  flex: 0 0 auto;
  width: 56px; height: 56px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s var(--ease), transform .15s var(--ease);
}

.detail-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-thumb:hover { border-color: var(--line-strong); }
.detail-thumb[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* Category chip at the top-left of the detail view. */
.detail-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px 11px;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--ink-2);
}

/* Use-case block in the detail view. */
.detail-usecase {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}

.detail-usecase h4 {
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.detail-usecase p { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }

/* Favourite button state. */
.btn--fav[aria-pressed="true"] {
  border-color: #e5484d;
  color: #e5484d;
  background: #fff5f5;
}

.btn--fav svg { transition: transform .18s var(--ease); }
.btn--fav[aria-pressed="true"] svg { fill: currentColor; transform: scale(1.06); }
.btn[disabled].btn--fav { opacity: .55; cursor: not-allowed; }

.detail-name { margin: 0 0 12px; font-size: 20px; font-weight: 660; letter-spacing: -.02em; line-height: 1.3; }

.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 16px; }
.detail-table th { text-align: left; font-weight: 500; color: var(--ink-4); padding: 7px 12px 7px 0; width: 34%; vertical-align: top; }
.detail-table td { padding: 7px 0; color: var(--ink-2); vertical-align: top; }
.detail-table tr + tr th, .detail-table tr + tr td { border-top: 1px solid var(--line); }

.detail-price { display: flex; align-items: baseline; gap: 5px; margin-bottom: 16px; }
.detail-price .price-amount { font-size: 30px; }

.detail-barcode { margin-bottom: 16px; }
.detail-barcode .barcode-svg { height: 60px; }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: 22px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toast-in .26s var(--ease);
  max-width: min(90vw, 460px);
}

.toast[data-tone="ok"] { background: var(--ok); }
.toast[data-tone="warn"] { background: var(--warn); }
.toast[data-tone="error"] { background: var(--danger); }

@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
  background: var(--surface-soft);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-3);
}

.footer-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-meta a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1080px) {
  .contact-list { gap: 3px 12px; }
  .contact-item { max-width: 280px; }
  .search-box { flex-basis: 150px; }
  .header-inner { gap: 16px; }
}

@media (max-width: 900px) {
  .header-contact { display: none; }
  .header-inner { min-height: 64px; justify-content: space-between; }
  .cat-nav { top: 64px; }
  .menu-toggle { display: grid; }
}

@media (max-width: 720px) {
  :root { --header-h: 64px; }
  body { font-size: 14.5px; }
  .wrap { padding: 0 14px; }
  main { padding: 18px 0 60px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
  .card-body { padding: 11px 12px 12px; gap: 8px; }
  .card-name { font-size: 13.5px; min-height: 2.8em; }
  .price-amount { font-size: 17px; }
  .barcode-svg { height: 38px; }
  .page-title { font-size: 21px; }
  .card-actions { grid-template-columns: 1fr; }
  .card-actions .btn--icon { display: none; }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .back-top { right: 14px; bottom: 14px; width: 40px; height: 40px; }
  .brand-logo { height: 34px; min-width: 34px; max-width: 92px; }
  .brand-name { font-size: 17px; }
  /* 手机屏隐藏搜索框，为品牌与图标腾出空间 */
  .search-box { display: none; }
}

@media (max-width: 460px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-attrs { display: none; }
  .card-name { -webkit-line-clamp: 3; min-height: 4.2em; }
  .qr-canvas-wrap canvas { width: 190px; height: 190px; }
  .toolbar { width: 100%; }
  .select { flex: 1 1 auto; }
}

/* Mobile drawer for header contacts */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 17, 21, .42);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s var(--ease), visibility .22s;
}

.mobile-drawer[data-open="true"] { opacity: 1; visibility: visible; }

.mobile-drawer-panel {
  position: absolute;
  top: 0; right: 0;
  width: min(340px, 88vw);
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .26s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-drawer[data-open="true"] .mobile-drawer-panel { transform: translateX(0); }

.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-head h2 { margin: 0; font-size: 15px; font-weight: 640; }

.drawer-contact { display: grid; grid-template-columns: minmax(0, 1fr); gap: 11px; }
.drawer-contact .contact-item { white-space: normal; max-width: none; font-size: 13.5px; align-items: flex-start; }
.drawer-contact .contact-item svg { margin-top: 3px; }

/* ==========================================================================
   Print — clean product sheets
   ========================================================================== */

@media print {
  .site-header, .cat-nav, .back-top, .card-actions, .site-footer, .toolbar { display: none !important; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .card { break-inside: avoid; border-color: #ddd; }
  body { font-size: 11px; }
}

/* ==========================================================================
   Member account — header button, auth modal, /me member centre
   ========================================================================== */

.user-btn { gap: 7px; }

.modal-panel--narrow { max-width: 400px; width: calc(100vw - 36px); }

.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: #f3f4f6; border-radius: 9px; padding: 4px; margin-bottom: 16px;
}
.auth-tab {
  border: 0; background: transparent; padding: 8px 10px; border-radius: 7px;
  font-size: 13.5px; font-weight: 600; color: #6b7280; cursor: pointer; font-family: inherit;
}
.auth-tab[aria-selected="true"] {
  background: #fff; color: #111827; box-shadow: 0 1px 3px rgba(17, 24, 39, .12);
}

.auth-field { margin-bottom: 13px; display: flex; flex-direction: column; gap: 5px; }
.auth-field label { font-size: 12.5px; font-weight: 600; color: #374151; }
.auth-input {
  height: 40px; border: 1px solid #d1d5db; border-radius: 9px; padding: 0 12px;
  font-size: 14px; font-family: inherit; background: #fff; color: #111827;
}
.auth-input:focus { outline: none; border-color: #111827; box-shadow: 0 0 0 3px rgba(17, 24, 39, .08); }
.auth-hint { font-size: 11.5px; color: #9ca3af; }
.auth-error { margin: 2px 0 10px; font-size: 12.5px; color: var(--danger, #dc2626); }
.auth-submit { width: 100%; height: 40px; margin-top: 2px; }

.me-card {
  max-width: 460px; margin: 26px auto; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 14px; padding: 24px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}
.me-card--center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.me-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.me-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #f3f4f6; color: #6b7280;
}
.me-avatar--solid { background: #111827; color: #fff; font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.me-name { margin: 0; font-size: 17px; font-weight: 700; color: #111827; }
.me-sub { margin-top: 2px; font-size: 12.5px; color: #9ca3af; }
.me-hint { margin: 0; font-size: 13.5px; color: #6b7280; }
.me-rows { border: 1px solid #f0f1f3; border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.me-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; font-size: 13.5px; }
.me-row + .me-row { border-top: 1px solid #f0f1f3; }
.me-row span { color: #6b7280; }
.me-row strong { font-weight: 600; color: #111827; }
.me-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* E-mail confirmation badge under the member name. */
.me-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 550;
}
.me-chip--ok { background: var(--ok-soft, #e8f5f0); color: var(--ok, #12805c); }
.me-chip--warn { background: #fef3c7; color: #92400e; }

/* Favourites block below the profile card. */
.me-section { margin-top: 22px; }
.me-section-title {
  display: flex; align-items: center; gap: 7px;
  margin: 0 0 14px; font-size: 15px; font-weight: 650; color: #111827;
}
.me-count {
  padding: 1px 8px; border-radius: 20px;
  background: #f3f4f6; font-size: 11.5px; font-weight: 600; color: #6b7280;
}
.me-fav-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.me-empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 38px 20px; text-align: center;
  background: #fff; border: 1px dashed #e5e7eb; border-radius: 12px;
  color: #9ca3af;
}
.me-empty p { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: #6b7280; }
.me-empty span { font-size: 12.5px; }

@media (max-width: 560px) {
  .me-card { margin: 14px auto; padding: 18px; }
  .me-actions { grid-template-columns: 1fr; }
  .me-fav-grid { grid-template-columns: 1fr 1fr; }
}

/* ------------------------------------------- e-mail verification states */

.auth-pending-icon {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin: 2px auto 14px;
  border-radius: 50%; background: #f3f4f6; color: #6b7280;
}
.auth-pending-title { margin: 0 0 8px; font-size: 16px; font-weight: 650; color: #111827; text-align: center; }
.auth-pending-text { margin: 0 0 6px; font-size: 13.5px; line-height: 1.6; color: #6b7280; text-align: center; }
.auth-pending-mail {
  margin: 0 0 16px; font-size: 13.5px; font-weight: 600; color: #111827;
  text-align: center; word-break: break-all;
}
.auth-submit--ghost { margin-top: 8px; background: #fff; color: #374151; border: 1px solid #d1d5db; }
.auth-submit--ghost:hover { background: #f9fafb; }
.auth-pending-dev {
  margin: 12px 0 0; padding: 9px 11px; background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 8px; font-size: 11.5px; line-height: 1.6; color: #92400e; word-break: break-all;
}

/* /verify landing page */
.verify-card {
  max-width: 480px; margin: 30px auto; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 14px; padding: 30px 26px;
  text-align: center; box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}
.verify-icon {
  display: flex; align-items: center; justify-content: center;
  width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 50%;
  background: #f3f4f6; color: #6b7280;
}
.verify-icon[data-tone="ok"] { background: var(--ok-soft, #e8f5f0); color: var(--ok, #12805c); }
.verify-icon[data-tone="err"] { background: var(--danger-soft, #fdeceb); color: var(--danger, #c0392b); }
.verify-title { margin: 0 0 10px; font-size: 19px; font-weight: 660; color: #111827; letter-spacing: -.015em; }
.verify-text { margin: 0 0 18px; font-size: 14px; line-height: 1.65; color: #6b7280; }
.verify-actions { display: flex; flex-direction: column; gap: 9px; }
@media (max-width: 560px) {
  .verify-card { margin: 14px auto; padding: 22px 18px; }
}
