:root {
  --page: #efe6d4;
  --page-deep: #e6d8c0;
  --surface: #f4ead8;
  --surface-2: #eadcbf;
  --ink: #23180f;
  --ink-soft: #6a5848;
  --line: #d4c4a8;
  --accent: #8c2a22;
  --accent-dark: #6f1f1a;
  --accent-contrast: #f7efe2;
  --shelf: #3d291c;
  --shelf-deep: #2a1b12;
  --shelf-line: #5c4030;
  --wood: #5a3a26;
  --wood-dark: #3a2418;
  --kraft: #d8c19a;
  --kraft-deep: #c9ad82;
  --package-ink: #24180f;
  --seal: #a32b24;
  --shadow: 0 18px 48px rgb(48 28 14 / 0.18);
  --header-height: 72px;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
  font-family: var(--sans);
  font-synthesis: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #1c1610;
    --page-deep: #16110c;
    --surface: #2a2118;
    --surface-2: #35281d;
    --ink: #f3ead8;
    --ink-soft: #c4b39a;
    --line: #4a3b2c;
    --accent: #c45a4e;
    --accent-dark: #d57a70;
    --accent-contrast: #1c1610;
    --shelf: #24180f;
    --shelf-deep: #140e09;
    --shelf-line: #4a3426;
    --wood: #6a4630;
    --wood-dark: #3d281c;
    --kraft: #cbb48a;
    --kraft-deep: #b79a6e;
    --package-ink: #24180f;
    --seal: #c45a4e;
    --shadow: 0 18px 48px rgb(0 0 0 / 0.45);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 20px); }

body {
  position: relative;
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background-color: var(--page);
  background-image:
    radial-gradient(1200px 640px at 8% -10%, color-mix(in srgb, #f8f1e2 78%, transparent), transparent 58%),
    radial-gradient(900px 520px at 100% 8%, color-mix(in srgb, #e4d3b0 55%, transparent), transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42  0 0 0 0 .34  0 0 0 0 .22  0 0 0 .14 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: auto, auto, 180px 180px;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }
::selection { color: var(--accent-contrast); background: var(--accent); }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
}

.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;
}

.load-error { display: grid; min-height: 100dvh; padding: 24px; place-content: center; text-align: center; }
.load-error strong { font-family: var(--serif); font-size: clamp(28px, 5vw, 54px); font-weight: 600; }
.load-error p { max-width: 520px; margin: 16px auto 0; color: var(--ink-soft); line-height: 1.7; }

.primary-button,
.secondary-button,
.text-button {
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  font-weight: 640;
  white-space: nowrap;
  transition: transform 180ms cubic-bezier(.16, 1, .3, 1), background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.primary-button { color: var(--accent-contrast); background: var(--accent); border-color: var(--accent); }
.primary-button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.secondary-button { background: transparent; border-color: color-mix(in srgb, var(--ink) 55%, transparent); }
.secondary-button:hover { color: var(--accent); border-color: var(--accent); }
.text-button { min-height: 40px; padding: 0; color: var(--accent); background: transparent; text-decoration: underline; text-underline-offset: 5px; }
.primary-button:active,
.secondary-button:active,
.text-button:active { transform: scale(.98); }

.seal {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #f6ece0;
  background: var(--seal);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 18%, transparent);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  min-height: var(--header-height);
  padding: 0 clamp(18px, 4vw, 64px);
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  backdrop-filter: blur(16px);
}

.brand { display: inline-flex; width: max-content; align-items: center; gap: 12px; text-decoration: none; }
.brand strong { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: .04em; }
.mode-nav {
  display: flex;
  justify-self: center;
  align-items: stretch;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.mode-nav button {
  min-height: 38px;
  padding: 0 16px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  cursor: pointer;
  font-size: 13px;
  font-weight: 560;
}
.mode-nav button:last-child { border-right: 0; }
.mode-nav button:hover { color: var(--ink); }
.mode-nav button.active { color: var(--accent-contrast); background: var(--accent); }
.header-cart {
  display: inline-flex;
  min-height: 42px;
  padding: 0 0 0 15px;
  justify-self: end;
  align-items: center;
  gap: 14px;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  font-family: var(--serif);
  font-weight: 600;
}
.header-cart strong {
  display: grid;
  min-width: 42px;
  min-height: 40px;
  padding: 0 8px;
  place-items: center;
  color: var(--accent-contrast);
  background: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.side-verse {
  position: fixed;
  top: 28%;
  right: 18px;
  z-index: 8;
  writing-mode: vertical-rl;
  color: color-mix(in srgb, var(--ink-soft) 72%, transparent);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .42em;
  pointer-events: none;
}

main { overflow: hidden; }

.hero {
  position: relative;
  display: grid;
  max-width: 1180px;
  min-height: min(58dvh, 620px);
  padding: clamp(36px, 5vw, 72px) clamp(22px, 5vw, 74px) 40px;
  margin: 0 auto;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.hero-kicker {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 520;
  letter-spacing: .28em;
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(56px, 9vw, 108px);
  font-weight: 600;
  line-height: .95;
  letter-spacing: .08em;
}

.hero-lead {
  max-width: 520px;
  margin: 22px 0 28px;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.85;
}

.entry-doors {
  display: grid;
  width: min(100%, 920px);
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: left;
}
.entry-doors button {
  display: grid;
  min-height: 168px;
  padding: 22px 20px 20px;
  align-content: start;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 78%, #fff);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 220ms cubic-bezier(.16, 1, .3, 1), border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}
.entry-doors button span {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .12em;
}
.entry-doors button strong {
  margin: 18px 0 10px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .04em;
}
.entry-doors button p {
  margin: 0;
  max-width: 22em;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}
.entry-doors button:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.entry-doors button.active { color: var(--accent-contrast); background: var(--accent); border-color: var(--accent); }
.entry-doors button.active span,
.entry-doors button.active p { color: color-mix(in srgb, var(--accent-contrast) 78%, transparent); }

.hero::after {
  position: absolute;
  right: 8%;
  bottom: 18%;
  width: 120px;
  height: 120px;
  opacity: .18;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120' fill='none' stroke='%2323180f' stroke-width='1.2'%3E%3Cpath d='M18 92c18-28 28-58 22-78M42 96c10-24 8-52-6-74M70 98c12-30 28-48 38-70'/%3E%3Cpath d='M24 40c8 4 14 12 12 22'/%3E%3C/svg%3E") center / contain no-repeat;
  content: "";
  pointer-events: none;
}

.market-facts {
  display: grid;
  max-width: 1180px;
  min-height: 120px;
  padding: 0 clamp(22px, 5vw, 74px);
  margin: 0 auto;
  grid-template-columns: minmax(280px, 2fr) repeat(3, minmax(110px, .5fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.market-facts > p {
  max-width: 520px;
  padding: 28px 32px 28px 0;
  margin: 0;
  align-self: center;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
}

.fact { display: grid; padding: 24px 12px; align-content: center; border-left: 1px solid var(--line); }
.fact strong {
  font-family: var(--serif);
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 600;
  line-height: 1;
}
.fact span { margin-top: 8px; color: var(--ink-soft); font-size: 12px; }

.market-floor { max-width: 1280px; padding: clamp(72px, 8vw, 120px) clamp(18px, 4vw, 64px) 100px; margin: 0 auto; }
.guide-zone,
.aisle-directory { margin-bottom: clamp(72px, 8vw, 120px); }
.section-heading { max-width: 760px; }
.section-heading h2,
.checkout-callout h2,
.drawer-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: .04em;
}
.section-heading p { max-width: 660px; margin: 16px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.8; }
.section-heading .text-button { margin-top: 16px; }

.mode-panel { margin-bottom: clamp(40px, 6vw, 72px); }

.guide-grid {
  display: grid;
  padding: 4px 0 8px;
  margin-top: 36px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.guide-card {
  position: relative;
  display: grid;
  min-height: 188px;
  padding: 20px;
  grid-template-rows: auto 1fr auto;
  text-align: left;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 82%, #fff 18%);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 40%, transparent) inset;
  cursor: pointer;
  transition: transform 220ms cubic-bezier(.16, 1, .3, 1), border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.guide-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--accent);
  content: "";
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 220ms cubic-bezier(.16, 1, .3, 1);
}

.guide-card:hover { border-color: color-mix(in srgb, var(--ink) 40%, var(--line)); transform: translateY(-3px); }
.guide-card:hover::before,
.guide-card.active::before { transform: scaleY(1); }
.guide-card.active { color: var(--accent-contrast); background: var(--accent); border-color: var(--accent); }
.guide-card.active::before { background: var(--accent-contrast); }
.guide-count { justify-self: end; color: var(--ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.guide-card.active .guide-count { color: color-mix(in srgb, var(--accent-contrast) 76%, transparent); }
.guide-card h3 { margin: 0; align-self: end; font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.42; text-wrap: pretty; }
.guide-card p { margin: 7px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.guide-card.active p { color: color-mix(in srgb, var(--accent-contrast) 78%, transparent); }

.aisle-index {
  display: grid;
  margin-top: 36px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.aisle-card {
  display: grid;
  min-height: 118px;
  padding: 16px 18px;
  text-align: left;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 80%, #fff);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 180ms cubic-bezier(.16, 1, .3, 1), border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}
.aisle-card span { color: var(--ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; letter-spacing: .08em; }
.aisle-card strong { margin-top: 18px; font-family: var(--serif); font-size: 22px; font-weight: 600; }
.aisle-card small { margin-top: 6px; color: var(--ink-soft); font-size: 12px; }
.aisle-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.aisle-card.active { color: var(--accent-contrast); background: var(--accent); border-color: var(--accent); }
.aisle-card.active span,
.aisle-card.active small { color: color-mix(in srgb, var(--accent-contrast) 78%, transparent); }
.aisle-card:disabled { opacity: .35; cursor: not-allowed; transform: none; }

.theme-toolbar { margin-top: 28px; }
.theme-search { display: grid; gap: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 640; }
.theme-search input {
  width: min(420px, 100%);
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 70%, #fff);
  border: 1px solid var(--line);
}
.theme-gallery { margin-top: 18px; }
.theme-featured,
.theme-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.theme-chips { margin-top: 12px; }
.theme-more-label { margin: 22px 0 10px; color: var(--ink-soft); font-size: 12px; }
.theme-card {
  display: grid;
  min-height: 108px;
  padding: 16px;
  text-align: left;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 82%, #fff);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 180ms cubic-bezier(.16, 1, .3, 1), border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}
.theme-card-lg { min-height: 132px; }
.theme-card-sm { min-height: 44px; padding: 10px 12px; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.theme-card-sm small { display: none; }
.theme-card-sm span { margin-top: 0; }
.theme-card-sm strong { font-size: 14px; }
.theme-card strong { font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.35; text-wrap: pretty; }
.theme-card span { margin-top: 8px; color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.theme-card small { margin-top: 6px; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.theme-card:hover { transform: translateY(-3px); }
.theme-card.active { color: var(--accent-contrast); background: var(--accent); border-color: var(--accent); }
.theme-card.active span,
.theme-card.active small { color: color-mix(in srgb, var(--accent-contrast) 80%, transparent); }
.theme-empty { padding: 48px 16px; color: var(--ink-soft); border: 1px dashed var(--line); text-align: center; }

.aisle-jump {
  display: flex;
  padding: 4px 0 18px;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.aisle-jump button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  color: #f3ead8;
  background: color-mix(in srgb, var(--shelf) 70%, #5a3d28);
  border: 1px solid var(--shelf-line);
  cursor: pointer;
  font-size: 12px;
}
.aisle-jump button:hover { color: #fff; border-color: #ead9bc; }
.aisle-group { padding: 8px 0 28px; }
.aisle-group-head {
  display: flex;
  margin-bottom: 12px;
  align-items: baseline;
  justify-content: space-between;
  color: #d8c8b0;
}
.aisle-group-head h3 { margin: 0; color: #f3ead8; font-family: var(--serif); font-size: 22px; font-weight: 600; }
.aisle-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.aisle-more {
  min-height: 44px;
  margin-top: 12px;
  padding: 0 16px;
  color: #f3ead8;
  background: transparent;
  border: 1px dashed #7a614c;
  cursor: pointer;
  font-size: 13px;
}
.aisle-more:hover { border-color: #ead9bc; }
.product-card.as-open {
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 228px;
}
.product-card.as-open h3 { -webkit-line-clamp: 3; }
.product-card.as-open .product-summary { -webkit-line-clamp: 4; }

.shelf-department {
  overflow: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--shelf) 92%, #5a3d28) 0%, var(--shelf-deep) 100%);
  border: 1px solid var(--shelf-line);
  box-shadow: var(--shadow);
}

.department-sign {
  display: flex;
  min-height: 128px;
  padding: 28px 34px;
  align-items: flex-end;
  justify-content: space-between;
  color: #f3ead8;
  border-bottom: 1px solid color-mix(in srgb, var(--shelf-line) 80%, #000);
}

.department-code { display: block; margin-bottom: 10px; color: #cbbba6; font-size: 11px; letter-spacing: .18em; }
.department-sign h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 56px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: .08em;
}
.department-sign p { margin: 10px 0 0; color: #c4b39a; font-size: 13px; }
.department-count { padding-left: 28px; text-align: right; border-left: 1px solid var(--shelf-line); }
.department-count strong {
  display: block;
  color: #e7c9a4;
  font-family: var(--serif);
  font-size: clamp(36px, 4.6vw, 58px);
  font-weight: 600;
  line-height: .9;
}
.department-count span { display: block; margin-top: 10px; color: #c4b39a; font-size: 11px; }

.shelf-tools {
  display: grid;
  padding: 16px 18px;
  gap: 12px;
  background: color-mix(in srgb, var(--page-deep) 88%, #d9c7a4);
  border-bottom: 1px solid var(--shelf-line);
}

.search-shell {
  display: grid;
  min-height: 54px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  background: color-mix(in srgb, var(--surface) 70%, #fff);
  border: 1px solid var(--line);
}

.search-shell label { padding: 0 16px; color: var(--ink); font-size: 12px; font-weight: 640; }
.search-shell input { min-width: 0; height: 52px; padding: 0 14px; color: var(--ink); background: transparent; border: 0; border-left: 1px solid var(--line); outline: 0; }
.search-shell input::placeholder { color: var(--ink-soft); opacity: 1; }
.search-shell kbd { margin-right: 12px; padding: 5px 7px; color: var(--ink-soft); background: var(--surface-2); border: 1px solid var(--line); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.filter-row { display: flex; gap: 18px; align-items: center; justify-content: space-between; }
.stage-filter { display: flex; gap: 1px; overflow-x: auto; background: var(--line); border: 1px solid var(--line); }
.stage-filter button { min-height: 38px; padding: 0 15px; flex: 0 0 auto; color: var(--ink); background: var(--surface); border: 0; border-right: 1px solid var(--line); border-radius: 0; cursor: pointer; font-size: 12px; }
.stage-filter button:last-child { border-right: 0; }
.stage-filter button.active { color: #f3ead8; background: var(--shelf); }
.theme-select { display: flex; gap: 10px; align-items: center; color: var(--ink-soft); font-size: 11px; }
.theme-select select { min-height: 38px; max-width: 280px; padding: 0 38px 0 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 0; }

.shelf-unit { padding: 18px 24px 34px; background: transparent; }
.shelf-row { position: relative; padding: 8px 0 28px; }
.shelf-row-head { display: flex; min-height: 32px; margin-bottom: 8px; align-items: center; justify-content: space-between; color: #d8c8b0; font-size: 11px; }
.shelf-row-head span { font-weight: 640; letter-spacing: .12em; }
.shelf-row-head b { color: #e8c9a8; font-family: var(--serif); font-size: 13px; font-weight: 600; }
.shelf-row-head em { max-width: 70%; overflow: hidden; color: #b9a48a; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }

.shelf-track {
  display: flex;
  min-height: 268px;
  padding: 8px 4px 18px;
  gap: 16px;
  align-items: flex-end;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scrollbar-color: #8a6a4e transparent;
  scrollbar-width: thin;
}

.shelf-track::-webkit-scrollbar { height: 6px; }
.shelf-track::-webkit-scrollbar-thumb { background: #8a6a4e; }

.shelf-board {
  position: absolute;
  right: -24px;
  bottom: 6px;
  left: -24px;
  height: 16px;
  background:
    linear-gradient(90deg, rgb(0 0 0 / .22), transparent 12%, transparent 88%, rgb(0 0 0 / .28)),
    repeating-linear-gradient(90deg, transparent 0 18px, rgb(255 220 170 / .06) 18px 19px),
    linear-gradient(#6b4630, #4a2e1c 42%, #2e1c12);
  box-shadow: 0 10px 16px rgb(8 4 2 / .42);
}

.shelf-empty {
  display: grid;
  min-width: 220px;
  height: 188px;
  place-items: center;
  color: #cbbba6;
  border: 1px dashed #7a614c;
  font-size: 12px;
}

.product-card {
  --pack-tone: #d9c49a;
  position: relative;
  display: flex;
  width: 196px;
  min-width: 196px;
  height: 228px;
  padding: 16px 16px 14px;
  overflow: hidden;
  flex-direction: column;
  scroll-snap-align: start;
  color: var(--package-ink);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--pack-tone) 88%, #fff) 0%, var(--pack-tone) 100%);
  border: 1px solid #b39468;
  border-radius: 3px;
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 35%, transparent) inset,
    0 10px 16px rgb(12 6 2 / .28);
  cursor: pointer;
  transition: transform 220ms cubic-bezier(.16, 1, .3, 1), box-shadow 220ms ease, border-color 180ms ease;
}

.product-card:nth-child(3n + 2) { height: 218px; }
.product-card:nth-child(5n) { width: 208px; min-width: 208px; }
.product-card:hover { z-index: 2; transform: translateY(-8px); box-shadow: 0 18px 24px rgb(12 6 2 / .34); }
.product-card:active { transform: translateY(-2px) scale(.985); }
.product-card.pack-0 { --pack-tone: #d9c49a; }
.product-card.pack-1 { --pack-tone: #d3bc90; }
.product-card.pack-2 { --pack-tone: #cbb48a; }
.product-card.pack-3 { --pack-tone: #e0c89c; }
.product-card.pack-4 { --pack-tone: #d6ba8c; }
.product-card.pack-5 { --pack-tone: #c9ae80; }
.product-card.pack-6 { --pack-tone: #decdab; }
.product-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 16px 22px rgb(12 6 2 / .32); }

.product-top { display: flex; align-items: center; justify-content: space-between; }
.product-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.product-badge { padding: 2px 7px; color: #5c4632; background: color-mix(in srgb, #fff 28%, transparent); border: 1px solid #b39468; font-size: 9px; }
.product-theme { margin: 16px 0 6px; overflow: hidden; color: var(--accent-dark); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.product-card h3 {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: .02em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.product-summary {
  display: -webkit-box;
  margin: 10px 0 0;
  overflow: hidden;
  color: #5e4a38;
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.product-bottom { position: relative; z-index: 1; display: flex; margin-top: auto; align-items: flex-end; justify-content: space-between; }
.barcode { display: none; }
.put-button {
  min-height: 28px;
  padding: 0;
  color: var(--accent);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 640;
  white-space: nowrap;
}
.put-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.put-button.selected { color: var(--shelf); }

.empty-state { padding: 70px 20px; text-align: center; color: #f3ead8; border: 1px dashed #7a614c; }
.empty-state strong { font-family: var(--serif); font-size: 22px; }
.empty-state p { color: #c4b39a; }

.checkout-callout {
  position: relative;
  display: grid;
  max-width: 1180px;
  min-height: 320px;
  padding: 80px clamp(22px, 6vw, 92px);
  margin: 0 auto;
  align-content: center;
  justify-items: start;
  border-top: 1px solid var(--line);
}

.checkout-callout::before {
  position: absolute;
  right: 8%;
  bottom: 24px;
  width: 140px;
  height: 90px;
  opacity: .28;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 90' fill='none' stroke='%2323180f' stroke-width='1.15'%3E%3Cpath d='M22 70h28l6-22H28zM18 70h92'/%3E%3Cpath d='M86 70 78 42h28l8 28'/%3E%3Cpath d='M108 28c8 10 6 22-4 30M118 20c10 12 8 26-2 36'/%3E%3Ccircle cx='112' cy='18' r='6'/%3E%3C/svg%3E") center / contain no-repeat;
  content: "";
  pointer-events: none;
}

.checkout-callout p { max-width: 620px; margin: 18px 0 28px; color: var(--ink-soft); font-size: 15px; line-height: 1.8; }

footer {
  display: flex;
  max-width: 1180px;
  min-height: 96px;
  padding: 24px clamp(22px, 5vw, 74px) 36px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

footer strong { color: var(--ink); font-family: var(--serif); font-size: 16px; font-weight: 600; }

.cart-dock {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 35;
  display: flex;
  min-height: 54px;
  padding: 0 0 0 18px;
  align-items: center;
  gap: 16px;
  color: #f3ead8;
  background: var(--shelf);
  border: 1px solid #ead9bc;
  box-shadow: 0 16px 40px rgb(28 16 8 / .32);
  cursor: pointer;
  font-family: var(--serif);
  font-weight: 600;
  transition: transform 200ms cubic-bezier(.16, 1, .3, 1), background-color 180ms ease;
}

.cart-dock strong {
  display: grid;
  min-width: 54px;
  min-height: 52px;
  padding: 0 10px;
  place-items: center;
  color: #f3ead8;
  background: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 18px;
}

.cart-dock:hover { transform: translateY(-4px); }
.cart-dock.bump { animation: cart-bump 420ms cubic-bezier(.16, 1, .3, 1); }
@keyframes cart-bump { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-10px); } 65% { transform: translateY(2px); } }

.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgb(28 18 10 / .58); backdrop-filter: blur(5px); }
.selection-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  width: min(600px, 100%);
  height: 100dvh;
  padding: 30px;
  overflow-y: auto;
  color: var(--ink);
  background: var(--page);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 70px rgb(28 16 8 / .28);
  transform: translateX(102%);
  transition: transform 280ms cubic-bezier(.16, 1, .3, 1);
}
.selection-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; }
.drawer-header > div > span { display: block; margin-bottom: 10px; color: var(--accent); font-size: 11px; letter-spacing: .16em; }
.drawer-header h2 { font-size: clamp(32px, 5vw, 48px); }
.icon-button { min-height: 40px; padding: 0 12px; color: var(--ink-soft); background: transparent; border: 1px solid var(--line); border-radius: 0; cursor: pointer; font-size: 11px; font-weight: 640; }
.icon-button:hover { color: var(--accent); border-color: var(--accent); }
.selection-summary { margin: 26px 0; padding: 16px 0; color: var(--ink-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.7; }
.selection-list { display: grid; gap: 12px; }
.selection-item { padding: 16px; background: var(--surface); border: 1px solid var(--line); }
.selection-item-top { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.selection-item .course-id { display: block; margin-bottom: 5px; color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 700; }
.selection-item h3 { margin: 0; font-family: var(--serif); font-size: 16px; font-weight: 600; line-height: 1.45; }
.selection-blurb {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}
.remove-button { flex: 0 0 auto; min-height: 32px; padding: 0 9px; color: var(--accent); background: transparent; border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line)); border-radius: 0; cursor: pointer; font-size: 10px; }
.selection-item label { display: block; margin-top: 14px; color: var(--ink-soft); font-size: 11px; }
.selection-item textarea { width: 100%; min-height: 74px; padding: 10px; margin-top: 7px; resize: vertical; color: var(--ink); background: var(--page); border: 1px solid var(--line); border-radius: 0; }
.selection-empty { padding: 64px 20px; text-align: center; color: var(--ink-soft); border: 1px dashed var(--line); }
.selection-empty strong { display: block; margin-bottom: 8px; color: var(--ink); font-family: var(--serif); font-size: 22px; }
.drawer-actions { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; margin-top: 22px; }

.course-dialog,
.receipt-dialog {
  width: min(760px, calc(100% - 24px));
  max-height: min(90dvh, 920px);
  padding: 36px;
  overflow-y: auto;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: var(--shadow);
}

.course-dialog::backdrop,
.receipt-dialog::backdrop { background: rgb(28 18 10 / .66); backdrop-filter: blur(6px); }
.dialog-close,
.receipt-close { position: absolute; z-index: 3; top: 18px; right: 18px; background: var(--surface); }
.dialog-code { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 700; }
.course-dialog h2 {
  max-width: 610px;
  margin: 18px 70px 8px 0;
  font-family: var(--serif);
  font-size: clamp(32px, 4.6vw, 48px);
  font-weight: 600;
  line-height: 1.12;
}
.dialog-theme { color: var(--accent); font-size: 12px; font-weight: 640; }
.dialog-subtitle { margin: 10px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.dialog-summary { padding: 20px 0; margin: 20px 0 0; color: var(--ink-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.85; }
.course-dialog h3 { margin: 26px 0 12px; font-size: 13px; }
.practice-list { display: grid; padding: 0; gap: 8px; list-style: none; }
.practice-list li { padding: 14px 16px; background: var(--page); border-left: 4px solid var(--accent); line-height: 1.72; }
.dialog-meta { display: flex; gap: 8px; margin: 20px 0; flex-wrap: wrap; }
.dialog-meta span { padding: 6px 9px; color: var(--ink-soft); background: var(--surface-2); font-size: 11px; }
.course-dialog .primary-button { width: 100%; }

.receipt-dialog { width: min(590px, calc(100% - 20px)); background: var(--page-deep); }
.receipt-paper {
  position: relative;
  max-height: 66dvh;
  padding: 36px 30px;
  overflow-y: auto;
  color: #23180f;
  background: #f4ead8;
  filter: drop-shadow(0 12px 18px rgb(40 24 10 / .16));
  font-family: ui-monospace, SFMono-Regular, "Microsoft YaHei", monospace;
}
.receipt-paper::before,
.receipt-paper::after {
  position: absolute;
  right: 0;
  left: 0;
  height: 9px;
  background: radial-gradient(circle at 5px 0, transparent 5px, #f4ead8 5.5px) 0 0 / 10px 10px repeat-x;
  content: "";
}
.receipt-paper::before { top: -9px; transform: rotate(180deg); }
.receipt-paper::after { bottom: -9px; }
.receipt-logo { text-align: center; }
.receipt-logo h2 { margin: 0 0 5px; font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: .12em; }
.receipt-logo p { margin: 0; color: #6a5848; font-size: 10px; }
.receipt-rule { margin: 18px 0; overflow: hidden; color: #8a7460; white-space: nowrap; }
.receipt-line { display: grid; padding: 11px 0; grid-template-columns: 66px 1fr 28px; gap: 8px; border-bottom: 1px dashed #cbbba6; font-size: 11px; line-height: 1.55; }
.receipt-line strong { display: block; font-size: 12px; }
.receipt-line small { display: block; color: #6a5848; }
.receipt-blurb { margin-top: 6px; color: #3d2c20; font-size: 10px; line-height: 1.55; }
.receipt-line .qty { text-align: right; }
.receipt-note { margin-top: 7px; padding: 7px; background: #eadcbf; font-size: 10px; }
.receipt-total { display: flex; padding: 18px 0 8px; align-items: flex-end; justify-content: space-between; }
.receipt-total span { font-size: 11px; }
.receipt-total strong { font-family: var(--serif); font-size: 27px; font-weight: 600; }
.receipt-footer { margin-top: 20px; text-align: center; color: #6a5848; font-size: 10px; line-height: 1.7; }
.receipt-barcode { width: 170px; height: 32px; margin: 15px auto 4px; background: repeating-linear-gradient(90deg, #23180f 0 2px, transparent 2px 4px, #23180f 4px 5px, transparent 5px 9px); }
.receipt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 22px; }
.receipt-actions .text-button { grid-column: 1 / -1; }

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 100;
  padding: 12px 18px;
  color: #f3ead8;
  background: var(--shelf);
  border: 1px solid #cbbba6;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 180ms ease, transform 180ms cubic-bezier(.16, 1, .3, 1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.print-sheet { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .hero h1 { animation: hero-copy 760ms cubic-bezier(.16, 1, .3, 1) both; }
  body.motion-ready .reveal { opacity: 0; transform: translateY(28px); transition: opacity 620ms cubic-bezier(.16, 1, .3, 1), transform 620ms cubic-bezier(.16, 1, .3, 1); }
  body.motion-ready .reveal.is-visible { opacity: 1; transform: translateY(0); }
  .product-card { animation: product-arrive 420ms calc(var(--i, 0) * 34ms) cubic-bezier(.16, 1, .3, 1) both; }
  @keyframes hero-copy { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes product-arrive { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
}

@media (max-width: 1080px) {
  .site-header { grid-template-columns: 1fr auto; padding-top: 8px; padding-bottom: 8px; }
  .mode-nav { grid-column: 1 / -1; justify-self: stretch; }
  .mode-nav button { flex: 1; padding: 0 8px; font-size: 12px; }
  .side-verse { display: none; }
  .market-facts { grid-template-columns: 1.7fr repeat(3, .6fr); }
  .entry-doors { grid-template-columns: 1fr; }
  .entry-doors button { min-height: 0; padding: 16px 18px; grid-template-columns: auto 1fr; gap: 0 14px; }
  .entry-doors button span { grid-row: 1 / 3; align-self: center; }
  .entry-doors button strong { margin: 0; font-size: 22px; }
  .guide-grid,
  .aisle-index,
  .theme-featured,
  .theme-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  :root { --header-height: 110px; }
  .site-header {
    padding: 6px 12px 8px;
    gap: 8px;
    grid-template-columns: 1fr auto;
  }
  .brand strong { font-size: 20px; }
  .header-cart { min-height: 38px; padding-left: 11px; gap: 10px; font-size: 12px; }
  .header-cart strong { min-width: 38px; min-height: 36px; }
  .hero { min-height: 0; padding: 28px 18px 24px; }
  .hero h1 { font-size: clamp(40px, 13vw, 56px); }
  .hero-lead { margin: 14px 0 20px; font-size: 14px; }
  .hero::after { display: none; }
  .entry-doors { gap: 8px; }
  .market-facts { padding: 0 18px; grid-template-columns: repeat(3, 1fr); }
  .market-facts > p { grid-column: 1 / -1; padding: 20px 0; border-bottom: 1px solid var(--line); }
  .fact { padding: 18px 10px; text-align: center; border-left: 0; }
  .fact + .fact { border-left: 1px solid var(--line); }
  .fact strong { font-size: 32px; }
  .market-floor { padding: 48px 14px 80px; }
  .guide-zone,
  .aisle-directory,
  .mode-panel { margin-bottom: 48px; }
  .section-heading h2,
  .checkout-callout h2 { font-size: clamp(28px, 8vw, 40px); }
  .guide-grid,
  .aisle-index,
  .theme-featured { grid-template-columns: 1fr; }
  .theme-chips { grid-template-columns: 1fr 1fr; }
  .mode-nav button { min-height: 44px; }
  .guide-card { min-height: 0; }
  .guide-card h3 { font-size: 17px; }
  .aisle-card { min-height: 88px; }
  .shelf-department { margin-right: -14px; margin-left: -14px; border-right: 0; border-left: 0; }
  .department-sign { min-height: 118px; padding: 22px 16px; flex-wrap: wrap; gap: 16px; }
  .department-sign h2 { font-size: 30px; }
  .department-count { padding-left: 0; border-left: 0; text-align: left; }
  .department-count strong { font-size: 36px; }
  .shelf-tools { padding: 12px; }
  .search-shell { grid-template-columns: 1fr auto; }
  .search-shell label { display: none; }
  .search-shell input { border-left: 0; }
  .search-shell kbd { display: none; }
  .filter-row { align-items: stretch; flex-direction: column; }
  .stage-filter { width: 100%; }
  .theme-select { justify-content: space-between; }
  .theme-select select { min-width: 0; max-width: 65%; }
  .shelf-unit { padding-right: 12px; padding-left: 12px; }
  .shelf-board { right: -12px; left: -12px; }
  .shelf-row-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .shelf-row-head em { max-width: 100%; white-space: normal; }
  .shelf-track {
    display: grid;
    min-height: 0;
    grid-template-columns: 1fr;
    overflow-x: visible;
    scroll-snap-type: none;
    align-items: stretch;
  }
  .product-card,
  .product-card:nth-child(3n + 2),
  .product-card:nth-child(5n) {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
  }
  .product-card h3 { font-size: 20px; -webkit-line-clamp: 3; }
  .product-summary { -webkit-line-clamp: 5; font-size: 13px; line-height: 1.65; }
  .aisle-cards { grid-template-columns: 1fr; }
  .checkout-callout { min-height: 260px; padding: 56px 18px; }
  .checkout-callout::before { display: none; }
  footer { min-height: 126px; padding: 24px 18px 80px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 8px; }
  .cart-dock { right: 10px; bottom: 10px; min-height: 48px; padding-left: 14px; font-size: 13px; }
  .cart-dock strong { min-width: 48px; min-height: 46px; }
  .selection-drawer { padding: 24px 16px; }
  .drawer-actions { grid-template-columns: 1fr; }
  .course-dialog,
  .receipt-dialog { padding: 28px 18px; }
  .course-dialog h2 { margin-right: 0; padding-top: 38px; }
  .dialog-close,
  .receipt-close { top: 12px; right: 12px; }
  .receipt-paper { padding: 32px 16px; }
  .receipt-actions { grid-template-columns: 1fr; }
  .receipt-actions .text-button { grid-column: auto; }
  .toast { left: 12px; right: 12px; bottom: 72px; transform: translateY(16px); }
  .toast.show { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--page); backdrop-filter: none; }
  .drawer-backdrop,
  .course-dialog::backdrop,
  .receipt-dialog::backdrop { backdrop-filter: none; }
}

@media print {
  body > * { display: none !important; }
  .print-sheet { display: block !important; width: 82mm; padding: 8mm 5mm; margin: 0 auto; color: #23180f; background: #f4ead8; font-family: ui-monospace, "Microsoft YaHei", monospace; }
  .print-sheet h1 { margin: 0; text-align: center; font-family: "Songti SC", "STSong", serif; font-size: 19px; }
  .print-sheet .print-meta { text-align: center; font-size: 9px; }
  .print-sheet .print-item { padding: 9px 0; border-bottom: 1px dashed #8a7460; font-size: 9px; line-height: 1.55; }
  .print-sheet .print-item strong { display: block; font-size: 10px; }
  .print-sheet .print-total { margin-top: 14px; text-align: right; font-size: 16px; font-weight: 700; }
  .print-sheet .print-footer { margin-top: 22px; text-align: center; font-size: 8px; }
}
