/* ============================================================
   设计系统：Dark OLED storefront
   背景 #161618 / 卡片 #1D1D20 / 主色 #7C3AED / 正文 #F2F2F2
   字体 Space Grotesk + Inter + JetBrains Mono；正文对比度 ≥ 4.5:1
   ============================================================ */

/* 自托管可变字体（latin 子集，中文回退系统字体）：避免 Google Fonts 阻塞首屏 */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/inter-var.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/space-grotesk-var.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-var.woff2") format("woff2");
}

:root {
  --bg: #161618;
  --surface: #1D1D20;
  --surface-2: #26262A;
  --muted-bg: #303035;
  --fg: #F2F2F2;
  --fg-dim: #C8C8CE;
  --fg-muted: #A0A0A9;
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #7C3AED;
  --accent-hover: #6D28D9;
  --accent-soft: rgba(124, 58, 237, 0.14);
  --link: #A78BFA;

  /*
   * 状态色统一走「紫色 + 互补色（琥珀）」体系。
   * 原来用绿色表示「有货 / 已完成 / 卡密」，在浅色主题的白底上对比度不足，
   * 现改为：正面状态 = 紫色，警示状态 = 紫色互补的琥珀色，中性 = 灰。
   */
  --ok: #A78BFA;
  --ok-bg: rgba(124, 58, 237, 0.14);
  --ok-border: rgba(124, 58, 237, 0.4);
  --ok-strong: #C4B5FD;
  --warn: #F59E0B;
  --warn-bg: rgba(245, 158, 11, 0.14);
  --danger: #F87171;
  --danger-bg: rgba(248, 113, 113, 0.14);
  --neutral: #A1A1AA;
  --neutral-bg: rgba(161, 161, 170, 0.16);

  /* 兼容旧变量名 */
  --success: var(--ok);
  --warning: var(--warn);

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --ease-out-soft: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.55);
  --font-body: Inter, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-display: "Space Grotesk", Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

html[data-theme="light"] {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f0f0f3;
  --muted-bg: #e8e8ee;
  --fg: #18181b;
  --fg-dim: #3f3f46;
  --fg-muted: #6b7280;
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.18);
  --accent-soft: rgba(124, 58, 237, 0.1);
  --link: #6D28D9;

  /*
   * 浅色主题下紫色要压深一档：#A78BFA 在白底上对比度只有 2.3:1，
   * 换成 #6D28D9 后约 7:1，满足正文可读性。
   */
  --ok: #6D28D9;
  --ok-bg: rgba(124, 58, 237, 0.1);
  --ok-border: rgba(124, 58, 237, 0.35);
  --ok-strong: #5B21B6;
  --warn: #B45309;
  --warn-bg: rgba(180, 83, 9, 0.1);
  --danger: #B91C1C;
  --danger-bg: rgba(185, 28, 28, 0.1);
  --neutral: #52525B;
  --neutral-bg: rgba(82, 82, 91, 0.1);

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 24px rgba(0, 0, 0, 0.08);
  color-scheme: light;
}

html[data-theme="light"] body { background: var(--bg); color: var(--fg); }
html[data-theme="light"] body::after { opacity: 0.02; }
html[data-theme="light"] .hero__title { color: var(--fg); }
html[data-theme="light"] .hero__badge { background: #ececf2; color: #3f3f46; }
html[data-theme="light"] .hero__badge:hover { background: #e4e4ea; }
html[data-theme="light"] .section-head h2 { color: var(--fg); }
html[data-theme="light"] .pcard__title { color: var(--fg); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 700ms var(--ease-out-soft), transform 700ms var(--ease-out-soft);
  transition-delay: calc(var(--i, 0) * 35ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

.js .cat-grid.reveal { opacity: 1; transform: none; transition: none; }
.js .cat-grid.reveal .cat-tile {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms var(--ease-out-soft), transform 500ms var(--ease-out-soft);
  transition-delay: calc(var(--i, 0) * 18ms);
}
.js .cat-grid.reveal.is-in .cat-tile { opacity: 1; transform: none; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 12px 20px;
  background: var(--accent);
  color: #fff;
  z-index: 100;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ------------------------------------------------------------- 顶栏 */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 0;
}

.topbar__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px var(--space-md);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  gap: var(--space-md);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  min-height: 44px;
}

.brand__mark { width: 26px; height: 26px; flex: none; }

.brand__text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand__text strong { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }

.topnav { display: flex; align-items: center; gap: var(--space-xs); margin-left: 20px; }
.menu-btn { display: none; }
.topbar__actions .menu-btn { display: none; }
.menu-icon--close { display: none; }
.menu-btn[aria-expanded="true"] .menu-icon--open { display: none; }
.menu-btn[aria-expanded="true"] .menu-icon--close { display: block; }

.topbar__actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.topbar__link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease;
}
.topbar__link:hover { color: var(--fg); }
button.topbar__link {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.icon-btn,
.lang-btn {
  display: inline-grid;
  place-items: center;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--fg-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}
.icon-btn:hover,
.lang-btn:hover { color: var(--fg); background: var(--surface-2); }
.lang-btn { padding: 0 8px; white-space: nowrap; }
.icon-btn svg { width: 18px; height: 18px; }
.theme-icon--sun { display: block; }
.theme-icon--moon { display: none; }
html[data-theme="light"] .theme-icon--sun { display: none; }
html[data-theme="light"] .theme-icon--moon { display: block; }

button.topnav__link {
  border: 0;
  background: transparent;
  font: inherit;
}

.topnav__link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: color 180ms ease;
  cursor: pointer;
}
.topnav__link:hover { color: var(--fg); background: transparent; }
.topnav__link.is-active { color: var(--fg); background: transparent; }

.shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) var(--space-3xl);
}

.page { max-width: 920px; margin: 0 auto; padding: var(--space-lg) 0 var(--space-2xl); }
@media (min-width: 1180px) {
  .page { margin-left: calc((100% - 920px) / 2 + 19px); margin-right: auto; }
}
.page__head { margin-bottom: var(--space-xl); }
.page__eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--link);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.page__head h1 { margin: 14px 0 0; font-family: var(--font-display); font-size: clamp(30px, 4vw, 42px); font-weight: 600; letter-spacing: -0.03em; }
.page__head p { margin: 10px 0 0; max-width: 62ch; color: var(--fg-muted); font-size: 15px; }
.doc-list { display: grid; gap: 12px; }
.doc-card { padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.doc-card h3 { margin: 8px 0 0; font-size: 15px; }
.doc-card p { margin: 6px 0 0; color: var(--fg-muted); font-size: 13.5px; line-height: 1.6; }
.help-steps { margin: 10px 0 0; padding-left: 20px; color: var(--fg-muted); font-size: 13.5px; line-height: 1.8; }
.help-steps li { margin: 4px 0; }
.prose { max-width: 68ch; color: var(--fg-dim); font-size: 15px; line-height: 1.8; }
.prose p { margin: 0 0 14px; }
.about-list { margin: 0 0 16px; padding-left: 20px; color: var(--fg-dim); }
.about-list li { margin: 6px 0; }

.footer {
  position: relative;
  z-index: 1;
  padding: 56px 0 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-muted);
  font-size: 13px;
}
.footer__inner {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 48px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}
.footer__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-size: 18px;
  text-decoration: none;
}
.footer__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
}
.footer__mark svg { width: 26px; height: 26px; }
.footer__desc { max-width: 34ch; margin: 14px 0 0; color: var(--fg-muted); font-size: 13.5px; line-height: 1.65; }
.footer__label {
  margin: 22px 0 8px;
  color: #A0A0A9;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.footer__social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.social-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--fg-dim);
  text-decoration: none;
  cursor: default;
  transition: background-color 150ms ease, color 150ms ease;
}
.social-btn svg { width: 17px; height: 17px; }
a.social-btn { cursor: pointer; }
#tgLink { color: var(--link); background: var(--accent-soft); }
a.social-btn:hover { background: var(--accent); color: #fff; }
.footer__cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.footer__cols h3 { margin: 0 0 12px; color: var(--fg); font-size: 12.5px; font-weight: 600; }
.footer__cols a,
.footer__cols button,
.footer__cols span {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg-muted);
  font: inherit;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.footer__cols a:hover,
.footer__cols button:hover { color: var(--fg); }
.footer__cols span { cursor: default; }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 48px auto 0;
  padding: 18px var(--space-md) 0;
  border-top: 1px solid var(--border);
  color: #A0A0A9;
  font-size: 12px;
}
@media (max-width: 959px) {
  .footer__inner { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 520px) {
  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__bottom { flex-direction: column; }
}

/* ------------------------------------------------------------- 页面提示 */

.page-lead { margin: var(--space-md) 0 var(--space-lg); }
.page-lead--after { margin: var(--space-lg) 0 0; }
.page-lead .notice { margin-top: 0; }
.page-lead .notice + .notice { margin-top: var(--space-sm); }

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: var(--space-lg);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg-muted);
  font-size: 13.5px;
  line-height: 1.55;
}
.notice svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--warning); }

/* ------------------------------------------------------------- 首页 */

.home-section { margin-top: var(--space-3xl); }
#catalog { display: none; }
#app.has-category #catalog { display: block; }
#categories, #catalog { scroll-margin-top: 96px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section-head p { margin: 6px 0 0; color: var(--fg-muted); font-size: 13.5px; }
/* Hero：参考 Shoppex 首页第一屏 */
/* Hero：Shader 风格的像素抖动背景 + 逐词入场（参考 Shoppex 首页） */
/* Hero：按 Shoppex 首屏 1:1 复刻结构 */
.hero {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 780px;
  margin-top: -32px;
  padding: 163px 0 40px;
  isolation: isolate;
}
.hero__canvas {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 0;
  width: 100vw;
  height: 100%;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 1;
}
.hero__copy {
  position: relative;
  z-index: 1;
  max-width: 600px;
  will-change: transform, opacity;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px 0 3px;
  border: 0;
  border-radius: 999px;
  background: #26262A;
  color: #C8C8CE;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  animation: hero-rise 800ms var(--ease-out-soft) both;
  animation-delay: 0.05s;
}
.hero__badge:hover { background: #303035; }
.hero__badge-newest { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero__badge-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hero__badge-arrow { width: 12px; height: 12px; opacity: 0.65; }

.hero__title {
  margin: 26px 0 0;
  color: #F2F2F2;
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.045em;
}
html[lang="en"] .hero__title { font-size: 56px; }
.hero__line { display: inline-block; }
.sell-word { vertical-align: baseline; white-space: nowrap; margin-left: .04em; display: inline-block; position: relative; color: var(--link); font-style: normal; }
.sell-word-stage { color: var(--link); clip-path: inset(.04em -.05em -.12em); display: inline-grid; position: relative; }
.sell-word-letters { grid-area: 1 / 1; display: inline-flex; }
.sell-word-letters > span { display: inline-block; }
.sell-word-in > span { animation: sell-word-in .6s var(--ease-out-soft) both; animation-delay: calc(var(--i) * 34ms + 90ms); }
.sell-word-out > span { animation: sell-word-out .42s var(--ease-out-soft) both; animation-delay: calc(var(--i) * 22ms); }

.hero__sub {
  margin: 40px 0 0;
  max-width: 44ch;
  color: var(--fg-muted);
  font-size: 16.5px;
  line-height: 1.65;
  animation: hero-rise 800ms var(--ease-out-soft) both;
  animation-delay: 0.18s;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 44px;
  animation: hero-rise 800ms var(--ease-out-soft) both;
  animation-delay: 0.26s;
}
.btn--lg { min-height: 46px; padding: 0 18px; border-radius: 10px; font-size: 14.5px; }
.hero__arrow { width: 16px; height: 16px; margin-left: 7px; flex: none; }

.hero__pay {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 26px 0 0;
  padding: 6px;
  border-radius: 999px;
  background: var(--surface);
  list-style: none;
  animation: hero-rise 800ms var(--ease-out-soft) both;
  animation-delay: 0.34s;
}
.hero__pay-chip {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}
.hero__pay-chip img { width: 16px; height: 16px; border-radius: 50%; object-fit: contain; }


@keyframes hero-rise {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: none; }
}
@keyframes sell-word-in {
  0% { opacity: 0; filter: blur(4px); transform: translateY(0.6em); }
  100% { opacity: 1; filter: none; transform: none; }
}
@keyframes sell-word-out {
  100% { opacity: 0; filter: blur(4px); transform: translateY(-0.6em); }
}

@media (max-width: 1100px) {
  .hero__title { font-size: 56px; }
}
@media (max-width: 959px) {
  .hero { min-height: 700px; padding: 120px 0 32px; }
  .hero__copy { max-width: 100%; }
  .hero__title { font-size: 52px; }
  .hero__canvas {
    opacity: 0.6;
    -webkit-mask-image: linear-gradient(to right, transparent 40%, #000 100%);
    mask-image: linear-gradient(to right, transparent 40%, #000 100%);
  }
}
@media (max-width: 520px) {
  .hero { min-height: 600px; padding: 96px 0 24px; }
  .hero__title { font-size: 40px; }
  html[lang="en"] .hero__title { font-size: 36px; }
  .hero__sub { font-size: 15px; }
  .hero__pay { margin-top: 24px; }
  .hero__pay-chip { width: 34px; height: 34px; }
}

/* 全部分类 */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.cat-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--fg-dim);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}
.cat-tile:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--fg); }
.cat-tile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--fg); }
.cat-tile__icon { width: 24px; height: 24px; flex: none; object-fit: contain; border-radius: 6px; }
.cat-tile__icon--ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--muted-bg);
  color: #70707A;
}
.cat-tile__icon--ph svg { width: 14px; height: 14px; }
.cat-tile__name {
  display: -webkit-box;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.25;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.cat-tile__count { flex: none; color: var(--fg-muted); font-family: var(--font-mono); font-size: 11px; }
.cat-tile[aria-pressed="true"] .cat-tile__count { color: var(--accent); }

/* 商品筛选条 */
.catalog-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: var(--space-md); }
.catalog-search { flex: 1 1 320px; min-width: 0; position: relative; }
.catalog-select { flex: 0 1 280px; min-width: 0; }
.catalog-search .input, .catalog-select .input { width: 100%; }
.catalog-search .field-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--fg-muted);
  pointer-events: none;
}
.catalog-search .input { padding-left: 40px; }
.catalog-search:focus-within .field-icon { color: var(--accent); }
.select-wrap { position: relative; }
.select-wrap select.input {
  padding-right: 42px;
  background-color: var(--surface-2);
  color: var(--fg);
  cursor: pointer;
}
.select-chevron {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--fg-muted);
  pointer-events: none;
  transition: color 160ms ease;
}
.select-wrap:focus-within .select-chevron { color: var(--accent); }
.catalog-select option, .catalog-select optgroup { background: var(--surface); color: var(--fg); }
.catalog-select option:checked { background: var(--surface-2); color: var(--fg); }

.catalog-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.catalog-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--fg-muted);
}
.catalog-icon:hover { border-color: var(--fg-muted); color: var(--fg); background: var(--surface-2); }
.catalog-icon.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--link); }
.catalog-icon svg { width: 18px; height: 18px; }
.catalog-view { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); }
.catalog-view .catalog-icon { width: 38px; height: 38px; min-width: 38px; border: 0; border-radius: 6px; background: transparent; }
.catalog-view .catalog-icon.is-active { background: var(--accent-soft); color: var(--link); }
.catalog-sort .sort-arrow { opacity: 0.45; }
.catalog-sort.is-asc .sort-arrow--up,
.catalog-sort.is-desc .sort-arrow--down { opacity: 1; color: var(--link); }
.catalog-clear { color: var(--fg-muted); }

/* 商品卡（D 的购买卡结构） */
.grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}
.grid.is-list { grid-template-columns: 1fr; }
.grid.is-list .pcard { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 16px; }
.grid.is-list .pcard__head { flex: 0 0 210px; max-width: 210px; }
.grid.is-list .pcard__title { flex: 1 1 260px; min-height: 0; margin: 0; }
.grid.is-list .pcard__price { margin-left: auto; }
.grid.is-list .pcard__actions { flex: 0 0 auto; margin: 0; }
.grid.is-list .pcard__actions .btn { width: auto; min-width: 104px; }

.pcard {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 180ms ease, background-color 180ms ease;
}
.pcard:hover { border-color: var(--border-strong); background: var(--surface-2); }
.pcard.is-out { opacity: 0.6; }
.pcard__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pcard__icon {
  width: 34px;
  height: 34px;
  flex: none;
  object-fit: contain;
  border-radius: 8px;
  background: var(--muted-bg);
}
.pcard__icon--ph { display: flex; align-items: center; justify-content: center; color: #70707A; }
.pcard__icon--ph svg { width: 18px; height: 18px; }
.pcard__cat {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--fg-muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pcard__stock { flex: none; color: var(--ok); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.pcard__stock.is-out { color: var(--danger); }
.pcard__title {
  display: -webkit-box;
  min-height: 42px;
  margin: 0;
  overflow: hidden;
  color: var(--fg);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.pcard__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.pcard__price .cur { color: var(--fg-muted); font-size: 13px; }
.pcard__price strong { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.pcard__price .unit { color: var(--fg-muted); font-size: 12px; }
.pcard__ship {
  margin-left: 2px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--muted-bg);
  color: var(--fg-dim);
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.pcard__ship.is-manual { color: var(--warning); }
.pcard__actions { display: flex; gap: 8px; margin-top: auto; }
.pcard__actions .btn { flex: 1; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--muted-bg);
  color: var(--fg-dim);
  font-size: 11.5px;
  white-space: nowrap;
}
.tag--ok { color: var(--ok); background: var(--ok-bg); }
.tag--out { color: var(--danger); background: var(--danger-bg); }
.tag--manual { color: var(--warn); background: var(--warn-bg); }

.loadmore {
  display: flex;
  justify-content: center;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}
.loadmore-btn { min-width: 220px; gap: 8px; background: var(--surface-2); }
.loadmore-btn svg { width: 16px; height: 16px; transition: transform 160ms ease; }
.loadmore-btn:hover:not(:disabled) svg { transform: translateY(2px); }

@media (max-width: 720px) {
  .topnav {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 12px;
    right: 12px;
    z-index: 60;
    margin: 0;
    padding: 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  }
  .topnav.is-open { display: flex; }
  .topnav__link { justify-content: flex-start; min-height: 46px; padding: 0 12px; border-radius: 8px; }
  .topnav__link.is-active { background: var(--accent-soft); color: var(--link); }
  .menu-btn { display: inline-grid; width: 40px; height: 40px; }
  .topbar__actions .menu-btn { display: inline-grid; }
  .topbar__actions { gap: 6px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-tile__count { display: none; }
}

@media (max-width: 520px) {
  .catalog-search, .catalog-select { flex: 1 1 100%; }
  .catalog-tools { width: 100%; justify-content: flex-end; }
  .catalog-icon { width: 44px; height: 44px; min-width: 44px; }
  .catalog-view .catalog-icon { width: 38px; height: 38px; min-width: 38px; }
  .grid.is-list .pcard__head { flex-basis: 100%; max-width: none; }
  .grid.is-list .pcard__title { flex-basis: 100%; }
  .loadmore-btn { width: 100%; }
  .pcard__actions .btn { min-height: 42px; }
}
@media (max-width: 380px) {
  #registerBtn { display: none; }
  .topbar__actions { gap: 4px; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease, opacity 180ms ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); color: #fff; }

.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn--ghost:hover:not(:disabled) { background: var(--muted-bg); border-color: var(--border-strong); }

.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: var(--radius-sm); }

.btn svg { width: 17px; height: 17px; }

/* ------------------------------------------------------------- 详情页 */

.detail { display: grid; gap: var(--space-xl); grid-template-columns: 1fr; }

.detail__head { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px 14px; align-items: start; }
.detail__icon {
  width: 52px;
  height: 52px;
  flex: none;
  object-fit: contain;
  border-radius: 10px;
  background: var(--muted-bg);
  grid-column: 1;
  grid-row: 1;
}
.detail__icon--ph { display: flex; align-items: center; justify-content: center; color: var(--fg-muted); }
.detail__icon--ph svg { width: 26px; height: 26px; }
.detail__head .tag-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  align-self: start;
  grid-column: 2;
  grid-row: 1;
}
.detail__head .detail__title { grid-column: 1 / -1; grid-row: 2; margin: 2px 0 10px; }
@media (min-width: 900px) {
  .detail { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 13.5px;
  cursor: pointer;
  transition: color 180ms ease;
}
.back:hover { color: var(--fg); }
.back svg { width: 16px; height: 16px; }

.detail__title {
  margin: var(--space-sm) 0 var(--space-sm);
  font-family: var(--font-display);
  font-size: clamp(24px, 4.6vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.detail__desc { color: var(--fg-muted); font-size: 15px; line-height: 1.7; margin: 0 0 var(--space-lg); max-width: 62ch; white-space: pre-line; }
.detail__desc.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.desc-toggle {
  margin: -8px 0 var(--space-lg);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--link);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.desc-toggle:hover { text-decoration: underline; }

.panel {
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel + .panel { margin-top: var(--space-md); }

.panel__title {
  margin: 0 0 var(--space-md);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.field { margin-bottom: var(--space-lg); }
.field:last-child { margin-bottom: 0; }

.field__label {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: 13.5px;
  color: var(--fg-dim);
  font-weight: 500;
}
.field__hint { color: var(--fg-muted); font-size: 12.5px; margin-top: 6px; }

.options { display: flex; flex-wrap: wrap; gap: var(--space-sm); }

.option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg-dim);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 180ms ease;
}
.option:hover { border-color: var(--border-strong); color: var(--fg); }
.option[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--fg);
}
.option--pay { padding-left: 10px; }
.pay-icon {
  width: 18px;
  height: 18px;
  flex: none;
  object-fit: contain;
  border-radius: 4px;
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.stepper button {
  width: 44px; height: 44px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 160ms ease;
}
.stepper button:hover:not(:disabled) { background: var(--muted-bg); }
.stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper output {
  min-width: 56px;
  text-align: center;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
}

/* 购买数量步进器（详情页） */
.stepper__btn {
  width: 44px; height: 44px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 160ms ease;
}
.stepper__btn:hover:not(:disabled) { background: var(--muted-bg); }
.stepper__btn:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper__input {
  min-width: 64px;
  height: 44px;
  text-align: center;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  padding: 0;
  appearance: textfield;
  -moz-appearance: textfield;
}
.stepper__input::-webkit-outer-spin-button,
.stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 支付方式单选：点 label 也能选中，键盘也能操作 */
.options label.option { display: inline-flex; align-items: center; gap: 6px; }
.options label.option input[type="radio"] { accent-color: var(--accent); margin: 0; cursor: pointer; }
.options label.option:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--fg);
}


.buy {
  position: sticky;
  top: 84px;
}
@media (max-width: 899px) {
  .buy { position: static; }
}

.buy__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}
.buy__label { color: var(--fg-muted); font-size: 13px; }
.buy__amount {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.buy__amount .cur { font-size: 15px; color: var(--fg-muted); margin-right: 2px; }
.buy__price { display: inline-flex; align-items: baseline; gap: 4px; }
.buy__unit { color: var(--fg-muted); font-size: 12px; }

.kv { display: flex; justify-content: space-between; gap: var(--space-md); padding: 7px 0; font-size: 13.5px; }
.kv dt { color: var(--fg-muted); }
.kv dd { margin: 0; color: var(--fg-dim); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- 按钮 */

.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.input::placeholder { color: #8A8A95; }
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}
select.input { appearance: none; background-image: none; cursor: pointer; }
textarea.input { min-height: 96px; line-height: 1.5; resize: vertical; }

/* ------------------------------------------------------------- 订单页 */

.order-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: var(--space-md);
}
.order-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.35; }
.pay-return-tip {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--fg-dim);
  font-size: 12.5px;
  line-height: 1.6;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  flex: none;
}
.status-pill--pending { background: var(--warn-bg); color: var(--warn); }
.status-pill--paying { background: var(--accent-soft); color: var(--ok); }
.status-pill--paid { background: rgba(139, 92, 246, 0.16); color: #C4B5FD; }
.status-pill--delivered { background: var(--ok-bg); color: var(--ok); }
.status-pill--failed { background: var(--danger-bg); color: var(--danger); }
.status-pill--canceled { background: var(--muted-bg); color: var(--fg-muted); }
.status-pill--refunded { background: var(--neutral-bg); color: var(--neutral); }

.secret {
  position: relative;
  margin: var(--space-md) 0 0;
  padding: 18px;
  border: 1px dashed var(--ok-border);
  border-radius: var(--radius-sm);
  background: var(--ok-bg);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--ok-strong);
}

.secret__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); margin-bottom: var(--space-sm); }
.secret__bar span { font-family: var(--font-body); font-size: 12.5px; color: var(--ok); letter-spacing: 0.04em; }

.copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--ok-border);
  border-radius: 6px;
  background: transparent;
  color: var(--ok);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background-color 160ms ease;
}
.copy:hover { background: var(--ok-bg); }
.copy svg { width: 14px; height: 14px; }

.steps { display: flex; flex-direction: column; gap: 0; padding: 0; margin: 0; list-style: none; }
.steps li {
  position: relative;
  padding: 0 0 var(--space-lg) 30px;
  color: var(--fg-muted);
  font-size: 14px;
}
.steps li::before {
  content: "";
  position: absolute;
  left: 6px; top: 7px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
}
.steps li::after {
  content: "";
  position: absolute;
  left: 10px; top: 18px; bottom: 0;
  width: 1px;
  background: var(--border);
}
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps li.is-done { color: var(--fg-dim); }
.steps li.is-done::before { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.steps li.is-current::before { background: var(--accent-hover); box-shadow: 0 0 0 4px var(--accent-soft); }
.steps strong { display: block; color: var(--fg); font-weight: 500; margin-bottom: 2px; }

/* ------------------------------------------------------------- 我的订单列表 */

.order-list { display: flex; flex-direction: column; gap: var(--space-sm); }

.order-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-md);
  align-items: center;
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.order-row__main { min-width: 0; }
.order-row__title { font-size: 14.5px; font-weight: 500; margin: 0 0 4px; }
.order-row__sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.order-row__side { display: flex; align-items: center; gap: var(--space-sm); }
.order-row__amount { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 16px; }

/* ------------------------------------------------------------- 状态与骨架 */

.empty {
  padding: var(--space-3xl) var(--space-md);
  text-align: center;
  color: var(--fg-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.empty svg { width: 34px; height: 34px; color: var(--border-strong); margin-bottom: var(--space-md); }
.empty h3 { margin: 0 0 6px; color: var(--fg-dim); font-size: 15px; font-weight: 500; }
.empty p { margin: 0; font-size: 13.5px; }

/*
 * 通用「正在加载」文案 + 小转圈。
 * 详情页、订单页、商品列表共用同一套视觉，不再用骨架方块。
 */
.loading-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: var(--space-lg) 0;
  color: var(--fg-muted);
  font-size: 14px;
}
.loading-line.is-loading::before,
#count.is-loading::before {
  content: "";
  width: 11px;
  height: 11px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  border-top-color: var(--accent);
  animation: sk-spin 720ms linear infinite;
}
#count.is-loading { display: flex; align-items: center; gap: 6px; }
@keyframes sk-spin { to { transform: rotate(360deg); } }
.grid[aria-busy="true"] { cursor: progress; min-height: clamp(220px, 38vh, 360px); }

body.modal-open { overflow: hidden; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
}
.modal__panel {
  position: relative;
  width: min(480px, 100%);
  max-height: 80vh;
  overflow: auto;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow-card);
}
.modal__panel h2 { margin: 0 0 12px; font-size: 20px; }
.modal__panel p, .modal__panel li { color: var(--fg-muted); font-size: 13.5px; line-height: 1.7; }
.modal__panel ul { margin: 10px 0 0; padding-left: 18px; }
.modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg-muted);
  font-size: 20px;
  cursor: pointer;
}
.modal__close:hover { background: var(--surface-2); color: var(--fg); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  z-index: 90;
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--fg);
  font-size: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
/* 成功/失败提示：沿用紫色与红色的语义色，避免白底上出现看不清的亮绿 */
.toast.is-success { border-color: var(--ok-border); color: var(--ok); background: var(--surface); }
.toast.is-error { border-color: var(--danger); color: var(--danger); background: var(--surface); }

/* 内联的危险色文字（如订单失败原因） */
.text-danger { color: var(--danger); }

.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;
}

.muted { color: var(--fg-muted); }
.mono { font-family: var(--font-mono); }
.center { text-align: center; }

/* ------------------------------------------------------------- 账号 / 表单页 */

.auth { max-width: 420px; margin: 0 auto; }

.account-page { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-md); }
.account-page .auth { max-width: 100%; }

.auth__switch-btn {
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth__switch-btn:hover { color: var(--fg); }

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

@media (max-width: 520px) {
  .shell { padding: var(--space-lg) var(--space-md) var(--space-2xl); }
  .topbar__inner { gap: var(--space-sm); }
  .topbar__actions { gap: 6px; }
  .topnav { gap: 2px; }
  .topnav__link { padding: 0 9px; font-size: 13px; }
  .order-row { grid-template-columns: 1fr; }
  .order-row__side { justify-content: flex-start; flex-wrap: wrap; row-gap: 8px; }
  .order-row__side > * { flex: none; }
  .btn--sm { min-height: 40px; }
}

@media (max-width: 720px) {
  .grid.is-list {
    display: block;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .grid.is-list .pcard {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas:
      "icon title action"
      "icon price action";
    align-items: center;
    gap: 4px 10px;
    padding: 12px 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
  }
  .grid.is-list .pcard:last-child { border-bottom: 0; }
  .grid.is-list .pcard__head { grid-area: icon; display: flex; align-items: center; min-width: 0; }
  .grid.is-list .pcard__head .pcard__cat,
  .grid.is-list .pcard__head .pcard__stock { display: none; }
  .grid.is-list .pcard__icon { width: 40px; height: 40px; }
  .grid.is-list .pcard__title {
    grid-area: title;
    min-height: 0;
    margin: 0;
    font-size: 13.5px;
    line-height: 1.35;
  }
  .grid.is-list .pcard__price { grid-area: price; gap: 3px; margin: 0; }
  .grid.is-list .pcard__price strong { font-size: 18px; }
  .grid.is-list .pcard__price .unit,
  .grid.is-list .pcard__ship { font-size: 10px; }
  .grid.is-list .pcard__actions { grid-area: action; align-self: center; margin: 0; }
  .grid.is-list .pcard__actions .btn {
    width: auto;
    min-width: 76px;
    min-height: 36px;
    padding: 0 12px;
    font-size: 12.5px;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal,
  .js .cat-grid.reveal .cat-tile {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .sell-word-letters span,
  .hero__line,
  .hero__badge,
  .hero__sub,
  .hero__actions,
  .hero__pay {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    filter: none !important;
  }
}


body.no-scroll{overflow:hidden}


.pay-notice[hidden]{display:none}
.pay-notice{position:fixed;inset:0;z-index:130;display:grid;place-items:center;padding:24px}
.pay-notice__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.62);backdrop-filter:blur(4px)}
.pay-notice__panel{position:relative;width:min(480px,100%);max-height:84vh;overflow:auto;background:var(--surface);color:var(--fg);border:1px solid var(--border);border-radius:18px;padding:26px;box-shadow:var(--shadow-card)}
.pay-notice__panel h2{margin:0 0 16px;font-size:20px;line-height:1.25;letter-spacing:-.02em;color:var(--fg)}
.pay-notice__panel p{margin:0 0 12px;font-size:13.5px;line-height:1.7;color:var(--fg-muted)}
.pay-notice__panel p.pay-notice__warning{color:var(--warning);font-weight:650}
.pay-notice__panel p.pay-notice__strong{color:var(--fg-dim);font-weight:600}
.pay-notice__actions{display:flex;gap:10px;justify-content:flex-end;margin-top:20px}
@media (max-width: 720px) {
  .pay-notice { padding: 0; }
  .pay-notice__panel {
    width: 100%;
    max-height: 100%;
    height: auto;
    border-radius: 0;
    border: 0;
    padding: 28px 20px 20px;
  }
  .pay-notice__actions { flex-direction: column-reverse; }
  .pay-notice__actions .btn { width: 100%; }
}
.pay-notice__countdown{margin:6px 0 0!important;font-size:12.5px!important;color:var(--link)!important;font-weight:600!important;min-height:20px}
.pay-notice__actions .btn:disabled{opacity:.45;cursor:not-allowed}
