:root {
  --shop-bg: #f3efe6;
  --shop-card: #fffbf5;
  --shop-text: #1a1714;
  --shop-muted: #6f675c;
  --shop-line: #e2d9cc;
  --shop-brand: #b85c2a;
  --shop-price: #b85c2a;
  --shop-tab: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.shop-body {
  font: 15px/1.5 "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--shop-text);
  background: #1c1916;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.shop-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 20px;
  padding: 20px 16px;
}
.shop-phone {
  width: min(390px, 100%);
  height: min(844px, calc(100vh - 40px));
  background: var(--shop-bg);
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
  border: 8px solid #0b0f14;
  display: flex;
  flex-direction: column;
}
.shop-statusbar {
  flex: none;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px 6px;
  background: #1c1916;
  color: #c9d4e3;
  font-size: 11px;
}
.shop-statusbar strong { color: #fff; font-weight: 600; }
.shop-app { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--shop-bg); }
.shop-main { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding-bottom: 12px; display: flex; flex-direction: column; }
.shop-main:has(.shop-buybar) { padding-bottom: 0; }
.shop-tabbar {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: var(--shop-tab);
  background: #fff;
  border-top: 1px solid var(--shop-line);
}
.shop-tabbar a {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  color: #8a93a0;
  font-size: 11px;
  position: relative;
}
.shop-tabbar a.is-on { color: var(--shop-brand); }
.shop-tabbar svg { width: 20px; height: 20px; }
.shop-tabbar i, .shop-buy-cart i {
  position: absolute;
  top: 4px;
  right: calc(50% - 22px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--shop-price);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  font-style: normal;
}
.shop-note {
  display: none;
  max-width: 280px;
  color: #c9d4e3;
}
.shop-note h2 { margin: 0 0 8px; font-size: 18px; color: #fff; }
.shop-note p { margin: 0 0 10px; font-size: 13px; line-height: 1.6; }
.shop-note a, .shop-note code { color: #e0b08a; }
@media (min-width: 900px) {
  .shop-stage { grid-template-columns: 390px 280px; justify-content: center; align-items: center; }
  .shop-note { display: block; }
}
@media (max-width: 520px) {
  body.shop-body { background: var(--shop-bg); }
  .shop-stage { padding: 0; display: block; }
  .shop-phone {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

.shop-hero { background: #f3efe6; padding: 14px 12px 8px; border-bottom: 1px solid var(--shop-line); }
.shop-hero.is-compact { background: var(--shop-bg); padding: 10px 12px 0; }
.shop-search { display: flex; gap: 8px; background: #fff; border-radius: 999px; padding: 4px 4px 4px 14px; }
.shop-search input { flex: 1; border: 0; outline: 0; min-width: 0; background: transparent; }
.shop-search button {
  border: 0; background: var(--shop-brand); color: #fff;
  border-radius: 999px; padding: 7px 14px;
}
.shop-cats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 4px;
  margin-top: 14px;
  background: #fff;
  border-radius: 4px;
  padding: 12px 6px;
}
.shop-cats a { display: grid; justify-items: center; gap: 4px; font-size: 11px; color: #334155; text-align: center; }
.shop-cats a:nth-child(4n+1) span { background: #f4e6d8; color: #8e4318; }
.shop-cats a:nth-child(4n+2) span { background: #e7efe4; color: #2f6b45; }
.shop-cats a:nth-child(4n+3) span { background: #efe6d4; color: #6f4a1d; }
.shop-cats a:nth-child(4n+4) span { background: #eadfd4; color: #a33a2c; }
.shop-cats span {
  width: 36px; height: 36px; border-radius: 4px;
  background: #f4e6d8; color: var(--shop-brand);
  display: grid; place-items: center; font-weight: 700;
}
.shop-chips { display: flex; gap: 8px; overflow: auto; padding: 10px 0 8px; }
.shop-chips a {
  flex: none; padding: 4px 10px; border-radius: 999px;
  background: #f1f5f9; font-size: 12px; color: #475569;
}
.shop-chips a.is-on { background: var(--shop-brand); color: #fff; }
.shop-block { padding: 8px 12px 16px; }
.shop-block-head { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0; }
.shop-block-head h2 { margin: 0; font-size: 16px; }
.shop-block-head a, .shop-block-head span { color: var(--shop-muted); font-size: 12px; }
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shop-card { background: var(--shop-card); border-radius: 4px; overflow: hidden; border: 1px solid var(--shop-line); }
.shop-card-cover { aspect-ratio: 1; background: #efe8dc; }
.shop-card-cover img { width: 100%; height: 100%; object-fit: contain; display: block; }
.shop-card-cover span { display: grid; place-items: center; height: 100%; color: #94a3b8; font-size: 12px; }
.shop-card-body { padding: 8px; }
.shop-card-body h3 { margin: 0; font-size: 15px; font-weight: 600; height: 42px; overflow: hidden; }
.shop-card-body p { margin: 4px 0 0; color: var(--shop-muted); font-size: 11px; height: 16px; overflow: hidden; }
.shop-card-price { margin-top: 6px; color: var(--shop-price); display: flex; align-items: baseline; gap: 4px; }
.shop-card-price em { font-style: normal; font-weight: 700; font-size: 16px; }
.shop-card-price span, .shop-card-price s { color: var(--shop-muted); font-size: 11px; font-weight: 400; }
.shop-card-price .is-ask { font-size: 14px; }
.shop-empty { margin: 24px 12px; padding: 28px 16px; text-align: center; color: var(--shop-muted); background: #fff; border-radius: 4px; }
.shop-empty-page { margin: 48px 16px; }
.shop-empty-page h2 { margin: 0 0 8px; color: var(--shop-text); font-size: 16px; }
.shop-pager { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 16px 0 8px; color: var(--shop-muted); }
.shop-pager a { color: var(--shop-brand); }

.shop-back {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: rgba(15, 23, 42, .55); color: #fff;
  border-radius: 999px; padding: 4px 10px; font-size: 13px;
}
.shop-product { position: relative; flex: 1; display: flex; flex-direction: column; padding-bottom: 0; }
.shop-gallery { background: #fff; }
.shop-gallery-stage { aspect-ratio: 1; background: #f8fafc; }
.shop-gallery-stage img { width: 100%; height: 100%; object-fit: contain; display: block; }
.shop-gallery-empty { height: 100%; display: grid; place-items: center; color: #94a3b8; }
.shop-thumbs { display: flex; gap: 8px; padding: 8px 12px 12px; overflow: auto; }
.shop-thumb { width: 52px; height: 52px; padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; background: #fff; }
.shop-thumb.is-on { border-color: var(--shop-brand); }
.shop-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.shop-panel { background: #fff; margin-top: 8px; padding: 14px 14px 16px; }
.shop-panel h1 { margin: 6px 0 0; font-size: 18px; line-height: 1.35; }
.shop-panel h2 { margin: 0 0 10px; font-size: 14px; }
.shop-sub { margin: 6px 0 0; color: var(--shop-price); font-size: 13px; }
.shop-price-row { display: flex; align-items: baseline; gap: 8px; }
.shop-price { color: var(--shop-price); font-size: 26px; font-weight: 700; }
.shop-price small { font-size: 14px; }
.shop-price-row s { color: var(--shop-muted); }
.shop-meta { display: grid; gap: 6px; margin: 12px 0 0; }
.shop-meta div { display: flex; gap: 10px; font-size: 13px; }
.shop-meta dt { color: var(--shop-muted); width: 36px; }
.shop-specs { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-spec {
  padding: 6px 10px; border: 1px solid var(--shop-line); border-radius: 6px;
  background: #f8fafc; font-size: 13px;
}
.shop-spec.is-on { border-color: var(--shop-brand); color: var(--shop-brand); background: #f7efe6; }
.shop-rich { white-space: pre-wrap; font-size: 13px; color: #334155; }
.shop-params { color: #475569; font-size: 13px; }
.shop-detail-img { width: 100%; display: block; margin-top: 8px; }
.shop-muted { color: var(--shop-muted); }
.shop-buybar {
  margin-top: auto;
  position: sticky; bottom: 0;
  display: grid; grid-template-columns: 64px 1fr 1fr;
  gap: 8px; align-items: center;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--shop-line);
}
.shop-buy-cart { position: relative; text-align: center; font-size: 11px; color: #475569; }
.shop-btn {
  border: 0; background: var(--shop-brand); color: #fff;
  border-radius: 999px; padding: 10px 12px; text-align: center;
}
.shop-btn.ghost { background: transparent; color: var(--shop-brand); box-shadow: inset 0 0 0 1px var(--shop-brand); }
.shop-text-btn { border: 0; background: none; color: var(--shop-muted); padding: 0; }

.shop-cart { padding: 12px 12px 80px; }
.shop-cart-list { display: grid; gap: 8px; }
.shop-cart-item {
  display: grid; grid-template-columns: 72px 1fr auto;
  gap: 10px; background: #fff; border-radius: 4px; padding: 10px;
}
.shop-cart-item .cover, .shop-cart-item img {
  width: 72px; height: 72px; object-fit: contain; border-radius: 4px; background: #eef2f6;
}
.shop-cart-item .info a { display: block; font-weight: 600; }
.shop-cart-item .info p { margin: 4px 0; color: var(--shop-muted); font-size: 12px; }
.shop-cart-item .row { display: flex; justify-content: space-between; align-items: center; }
.shop-cart-item em { color: var(--shop-price); font-style: normal; font-weight: 700; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button { width: 24px; height: 24px; border: 1px solid var(--shop-line); background: #fff; border-radius: 6px; }
.shop-preview-tip { margin-top: 12px; font-size: 12px; color: var(--shop-muted); line-height: 1.6; }
.shop-cart-bar {
  position: sticky; bottom: 8px;
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; border-radius: 4px; padding: 10px 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}
.shop-cart-bar em { color: var(--shop-price); font-style: normal; font-size: 18px; font-weight: 700; }

.shop-toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(15,23,42,.88); color: #fff; padding: 8px 14px;
  border-radius: 999px; font-size: 13px; z-index: 20; pointer-events: none;
}
.shop-cat-panel { margin-top: 10px; }
.shop-cat-l1 {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.shop-cat-l1 a {
  flex: 0 0 auto; padding: 6px 10px; border-radius: 999px;
  background: #eef2f6; color: #334155; font-size: 12px; white-space: nowrap;
}
.shop-cat-l1 a.is-on { background: var(--shop-brand, #b85c2a); color: #fff; }
.shop-cat-crumbs {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 12px; color: #64748b; margin-bottom: 8px;
}
.shop-cat-crumbs a { color: #b85c2a; }
