:root {
  --ink: #111111;
  --muted: #8b8b8b;
  --line: #d7d7d7;
  --paper: #ffffff;
  --page: #f4f4f6;
  --price: #c92332;
  --success: #3f7448;
  --danger: #b82c3a;
}

* { box-sizing: border-box; }
html { background: var(--page); }

body {
  min-width: 280px;
  margin: 0;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  color: var(--ink);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

a { color: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
.to_pay:focus-visible {
  outline: 3px solid rgba(17, 17, 17, .22);
  outline-offset: 2px;
}

.main {
  width: 100%;
  max-width: 720px;
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
}

/* 头部对应参考图：方形品牌图、粗体名称以及一黑一白两个操作按钮。 */
.shop-header {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  margin: 0 18px;
  padding: 18px 0;
  border-top: 0;
  border-bottom: 4px solid var(--ink);
  background: #fff;
}

.shop-header-left {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.shop-logo-wrap {
  position: relative;
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  place-items: center;
  overflow: hidden;
  border-radius: 2px;
  /* 浅色底：站点 Logo 未上传或加载中时不再出现黑块。 */
  background: #f3f4f6;
}

.shop_img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-brand-copy { min-width: 0; flex: 1; }

.shop_title {
  overflow: hidden;
  color: var(--ink);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-header-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
  margin-left: 12px;
}

.btn-kefu,
.btn-order {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.btn-kefu { color: #fff; background: var(--ink); }
.btn-order { color: var(--ink); background: #fff; }
.body { padding: 28px 18px 42px; }

.notice-bar {
  display: flex;
  min-height: 58px;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 30px;
  padding: 16px 18px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  color: #3d3d3d;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.65;
}

.notice-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--ink);
}

.notice-text { min-width: 0; word-break: break-word; }
.section-block { margin-bottom: 32px; }

.section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.section-head > img { display: none; }
.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #26313d;
  font-size: 18px;
  font-weight: 800;
}

.section-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 限时活动与商品列表严格使用参考图中的紧凑横向信息卡。 */
.promotion-section { padding: 0; border: 0; background: transparent; }
.promotion-head { justify-content: flex-start; }

.promotion-head .section-title {
  padding: 0;
  color: #26313d;
  background: transparent;
  font-size: 18px;
}

.promotion-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.promotion-card,
.product-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 114px;
  align-items: center;
  padding: 15px 18px;
  overflow: visible;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  color: inherit;
  background: #fff;
  box-shadow: 0 2px 8px rgba(26, 32, 38, .07);
  text-decoration: none;
}

.promotion-card {
  border-color: #555;
  box-shadow: 0 2px 7px rgba(26, 32, 38, .06);
}

.promotion-card.product_active { border-color: #555; }

.product-card.product_active {
  border-color: #e8e8e8;
  box-shadow: 0 2px 8px rgba(26, 32, 38, .07);
}

.promotion-image,
.product-thumb {
  position: relative;
  display: grid;
  width: 78px;
  height: 78px;
  flex: 0 0 78px;
  place-items: center;
  overflow: hidden;
  border-radius: 3px;
  /* 浅色底：商品图加载中或未上传时显示浅灰空框，不再闪黑屏。 */
  background: #f3f4f6;
}

.promotion-image img,
.product-thumb img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.promotion-card-body,
.product-body {
  flex: 1;
  min-width: 0;
  padding-left: 18px;
}

.promotion-product-title,
.product_title {
  display: block;
  margin: 0 0 10px;
  color: #26313d;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.product_title {
  padding-right: 0;
  /* 商品标题按内容自然增高，价格区域跟随标题向下排列，避免长标题遮挡价格。 */
  overflow: visible;
}

.promotion-price-row,
.product-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 15px;
}

.product_price {
  color: var(--price);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: .01em;
}

.product_sold { color: var(--muted); font-size: 12px; }
.promotion-stock, .stock-tag { flex: 0 0 auto; }

.stock-tag {
  display: inline-block;
  margin: 0 0 0 18px;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.promotion-card .stock-tag { margin: 0 0 0 18px; }
.stock-ok { color: var(--success); background: #edf7ec; }
.stock-low { color: var(--danger); background: #fff0f1; }
.stock-out { color: #777; background: #ededed; }

.card-arrow {
  display: none;
}

.product-section-head {
  display: flex;
  margin: 30px 0 14px;
  text-align: left;
}

.product-section-head::before,
.product-section-head::after {
  display: none;
}

.product-section-head .section-title { white-space: nowrap; }

.product-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.product-card-inner {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
}

.sort-scroll { display: flex; flex-wrap: wrap; gap: 10px; }

.sort,
.sort_active {
  position: relative;
  min-width: calc(50% - 5px);
  min-height: 56px;
  padding: 10px 13px;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 3px;
  text-decoration: none;
}

.sort { color: var(--ink); background: #fff; }
.sort_active { color: #fff; background: var(--ink); }
.sort_active .fl_img { display: none; }

.sort_title {
  margin-bottom: 3px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sort_info { font-size: 11px; opacity: .65; }

.intro-box,
.form-row {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #555;
  background: #fff;
  font-size: 13px;
  line-height: 1.7;
}

.pcontent { margin: 10px 0 18px; }
.pcontent img { display: block; width: 100%; border-radius: 4px; }
.form-row { margin-bottom: 16px; }
.form-label { color: var(--ink); font-weight: 800; }
.form-label .req { color: var(--price); }

.form-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.amount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.amount-ctrl {
  display: flex;
  align-items: center;
  border: 1px solid var(--ink);
  border-radius: 3px;
}

.amount-ctrl input {
  width: 48px;
  height: 38px;
  padding: 6px;
  border: 0;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  text-align: center;
}

.clac {
  width: 38px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 38px;
  text-align: center;
  cursor: pointer;
  user-select: none;
}

.sub-accent { color: #666; font-size: 12px; font-weight: 400; }

.contact-input {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #bdbdbd;
  border-radius: 3px;
  background: #fff;
  font-size: 14px;
}

.pay-section,
.checkout-contact-source { display: none; }

.pay_box {
  position: relative;
  display: inline-block;
  width: calc(50% - 6px);
  max-width: 180px;
  height: 48px;
  margin: 0 8px 8px 0;
  overflow: hidden;
  border: 1px solid #d2d2d2;
  border-radius: 3px;
  background: #fff;
  font-size: 12px;
  line-height: 48px;
  text-align: center;
  cursor: pointer;
}

.pay_box input[type="radio"] { display: none; }
.pay_pic { width: 20px; margin-bottom: -5px; }
.checked { border-color: var(--ink) !important; color: var(--ink) !important; background: #f5f5f5 !important; }
.checked_img { position: absolute; right: 0; bottom: 0; width: 18px; }

.shop-footer {
  padding: 12px 18px 34px;
  color: #aaa;
  font-size: 12px;
  text-align: center;
}

.shop-footer > span {
  display: block;
  width: 78px;
  height: 3px;
  margin: 0 auto 23px;
  background: var(--ink);
}

.card7 {
  width: 100%;
  padding: 16px 0 8px;
  color: #999;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.card7 a,
#card7_xb .card7 a:link { color: var(--ink); }

.btn_buy {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  width: 100%;
  max-width: 720px;
  min-height: 68px;
  margin: 0 auto;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid #cfcfcf;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 -5px 18px rgba(0, 0, 0, .09);
}

.btn-buy-inner {
  display: flex;
  max-width: 560px;
  align-items: center;
  gap: 18px;
  margin: 0 auto;
}

.pay-total { flex: 1; min-width: 0; line-height: 1.15; text-align: left; }
.pay-total small { display: block; margin-bottom: 4px; color: #777; font-size: 10px; }
.pay-total strong { color: var(--price); font-size: 20px; font-weight: 900; }

.btn_buy .to_pay {
  min-height: 48px;
  flex: 0 0 min(54%, 280px);
  border-radius: 3px;
  color: #fff;
  background: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 48px;
  text-align: center;
  cursor: pointer;
}

.btn-buy-inner > .to_pay:only-child { flex-basis: 100%; }

/* 结算弹窗沿用原支付数据流，仅将视觉统一为黑白商城样式。 */
.checkout-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.checkout-modal.is-open { display: flex; }
.checkout-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }

.checkout-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 680px);
  max-height: calc(100vh - 24px);
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border-radius: 12px 12px 0 0;
  background: #fff;
  box-shadow: 0 -12px 36px rgba(0, 0, 0, .2);
  animation: checkoutSlideUp .22s ease-out;
}

.checkout-eyebrow { color: #777; font-size: 11px; font-weight: 700; }
.checkout-panel h2 { margin: 5px 0 18px; color: var(--ink); font-size: 20px; }

.checkout-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: #555;
  background: #f1f1f1;
  font-size: 24px;
  line-height: 38px;
  cursor: pointer;
}

.checkout-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border: 1px solid #d8d8d8;
  border-radius: 3px;
  color: #666;
  background: #f7f7f7;
  font-size: 13px;
}

.checkout-summary strong { color: var(--price); font-size: 19px; }
.checkout-field { margin-top: 18px; }
.checkout-field > label { display: block; margin-bottom: 9px; color: var(--ink); font-size: 14px; font-weight: 800; }
.checkout-field .contact-input { margin: 0; }
.checkout-field p { margin: 7px 0 0; color: #888; font-size: 11px; line-height: 1.45; }
.checkout-payment-options { display: flex; flex-wrap: wrap; gap: 8px; }
.checkout-payment-options .pay_box { min-width: 130px; max-width: none; flex: 1; margin: 0; }

.checkout-confirm {
  width: 100%;
  min-height: 48px;
  margin-top: 22px;
  padding: 14px;
  border: 0;
  border-radius: 3px;
  color: #fff;
  background: var(--ink);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

@keyframes checkoutSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.checkout-confirm.is-loading,
.to_pay.is-loading { pointer-events: none; opacity: .78; cursor: wait; }

/* APK 扫码收银台沿用商城黑白卡片风格，并在横屏下采用紧凑双栏布局。 */
.qr-pay-modal {
  align-items: center;
  padding: 18px;
}

.qr-pay-modal .checkout-mask {
  background: rgba(14, 14, 14, .68);
  backdrop-filter: blur(3px);
}

.qr-pay-panel {
  width: min(100%, 560px);
  max-height: calc(100vh - 36px);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
  text-align: left;
  animation: qrPayAppear .2s ease-out;
}

.qr-pay-panel .checkout-close {
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  color: #444;
  background: #f1f1ef;
  font-size: 21px;
  line-height: 32px;
  transition: color .16s ease, background .16s ease;
}

.qr-pay-panel .checkout-close:hover { color: #fff; background: #111; }
.qr-pay-heading { padding-right: 48px; }
.qr-pay-heading .checkout-eyebrow { letter-spacing: .08em; }
.qr-pay-panel .qr-pay-heading h2 { margin: 4px 0 3px; font-size: 23px; line-height: 1.25; }
.qr-pay-heading p { margin: 0; color: #8a8a86; font-size: 12px; }

.qr-pay-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  margin-top: 17px;
  padding: 14px 16px;
  border: 1px solid #e2e2df;
  border-radius: 12px;
  background: linear-gradient(135deg, #fafaf8 0%, #f3f3f0 100%);
}

.qr-pay-product { min-width: 0; }
.qr-pay-product span,
.qr-pay-amount > span { display: block; margin-bottom: 4px; color: #8a8a86; font-size: 10px; }
.qr-pay-product strong {
  display: -webkit-box;
  overflow: hidden;
  color: #262626;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.qr-pay-amount { flex: 0 0 auto; text-align: right; }
.qr-pay-price { color: var(--price); font-size: 25px; font-weight: 900; white-space: nowrap; }
.qr-pay-price small { margin-right: 2px; font-size: 14px; }

.qr-pay-main {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  margin-top: 18px;
}

.qr-pay-code-wrap { text-align: center; }
.qr-pay-code {
  width: 216px;
  min-height: 216px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid #dfdfdc;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(17, 17, 17, .08);
}
.qr-pay-code img,
.qr-pay-code canvas { display: block; width: 198px !important; height: 198px !important; margin: 0 auto; }
.qr-pay-code-caption { display: block; margin-top: 7px; color: #999; font-size: 10px; }
.qr-pay-guide { min-width: 0; }
.qr-pay-method { display: flex; align-items: center; justify-content: space-between; padding-bottom: 11px; border-bottom: 1px solid #ececea; }
.qr-pay-method span { color: #8a8a86; font-size: 11px; }
.qr-pay-method strong { color: #1f1f1f; font-size: 14px; }
.qr-pay-tutorial { margin: 11px 0 9px; padding: 10px 11px; border-radius: 9px; background: #f5f5f3; }
.qr-pay-tutorial > strong { display: block; color: #222; font-size: 11px; }
.qr-pay-tutorial ol { margin: 6px 0 0; padding-left: 18px; color: #666; font-size: 10px; line-height: 1.55; }
.qr-pay-tutorial li + li { margin-top: 2px; }
.qr-pay-status {
  position: relative;
  min-height: 20px;
  margin: 0;
  padding-left: 16px;
  color: #6f6f6b;
  font-size: 11px;
  line-height: 20px;
}
.qr-pay-status::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d7a000;
  box-shadow: 0 0 0 4px rgba(215, 160, 0, .12);
}
.qr-pay-status.is-error { color: #b42318; }
.qr-pay-status.is-error::before { background: #b42318; box-shadow: 0 0 0 4px rgba(180, 35, 24, .1); }
.qr-pay-status.is-paid { color: #16794a; }
.qr-pay-status.is-paid::before { background: #16794a; box-shadow: 0 0 0 4px rgba(22, 121, 74, .1); }
.qr-pay-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.qr-pay-view { grid-column: 1 / -1; }
.qr-pay-view[hidden] { display: none; }
.qr-pay-action:disabled { opacity: .65; cursor: wait; }
.qr-pay-action {
  min-height: 40px;
  padding: 9px 7px;
  border: 1px solid #111;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.qr-pay-save { color: #111; background: #fff; }
.qr-pay-open-app { color: #fff; background: #111; }
.qr-pay-action:active { transform: translateY(1px); }
.qr-pay-action-status { min-height: 17px; margin: 7px 0 0; color: #888; font-size: 9px; line-height: 1.45; text-align: center; }
.qr-pay-action-status.is-error { color: #b42318; }
.qr-pay-action-status.is-success { color: #16794a; }
.qr-pay-recheck-link {
  display: block;
  margin: 6px auto 0;
  padding: 0;
  border: 0;
  color: #555;
  background: transparent;
  font-size: 10px;
  text-decoration: underline;
  cursor: pointer;
}
.qr-pay-query-link { display: block; margin-top: 5px; color: #999; font-size: 10px; text-align: center; text-decoration: none; }
.qr-pay-query-link:hover { color: #111; text-decoration: underline; }
.qr-pay-order-no {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #ececea;
  color: #999;
  font-size: 10px;
}
.qr-pay-order-no span { flex: 0 0 auto; }
.qr-pay-order-no code { min-width: 0; overflow-wrap: anywhere; color: #666; font-size: 10px; }

@keyframes qrPayAppear {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.checkout-confirm.is-loading::before,
.to_pay.is-loading::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 9px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: -3px;
  animation: paymentSpin .75s linear infinite;
}

@keyframes paymentSpin { to { transform: rotate(360deg); } }

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

  .checkout-confirm.is-loading::before,
  .to_pay.is-loading::before { animation: none; }
}

@media screen and (max-width: 520px) {
  .shop-header { min-height: 76px; margin: 0 12px; padding: 14px 0; }
  .shop-logo-wrap { width: 46px; height: 46px; flex-basis: 46px; }
  .shop_title { font-size: 18px; }
  .shop-header-actions { gap: 6px; margin-left: 8px; }
  .btn-kefu, .btn-order { min-height: 36px; padding: 0 12px; font-size: 12px; }
  .body { padding: 24px 12px 36px; }
  .qr-pay-modal { align-items: flex-end; padding: 0; }
  .qr-pay-panel {
    width: 100%;
    max-height: calc(100vh - 10px);
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
  }
  .qr-pay-summary { margin-top: 14px; padding: 11px 13px; }
  .qr-pay-main { grid-template-columns: 1fr; gap: 12px; margin-top: 14px; }
  .qr-pay-code { width: 196px; min-height: 196px; }
  .qr-pay-code img,
  .qr-pay-code canvas { width: 178px !important; height: 178px !important; }
  .qr-pay-code-caption { margin-top: 5px; }
  .qr-pay-tutorial { margin: 9px 0 8px; }
  .qr-pay-order-no { margin-top: 12px; padding-top: 10px; }
  .notice-bar { margin-bottom: 26px; padding: 14px; }

  .promotion-card,
  .product-card { min-height: 98px; padding: 11px 12px; }

  .promotion-image,
  .product-thumb { width: 66px; height: 66px; flex-basis: 66px; }

  .promotion-card-body,
  .product-body { padding-right: 72px; padding-left: 13px; }

  .promotion-product-title,
  .product_title { margin-bottom: 8px; font-size: 14px; }

  .product_price { font-size: 17px; }

  .stock-tag,
  .promotion-card .stock-tag {
    position: absolute;
    right: 12px;
    bottom: 12px;
    margin: 0;
    font-size: 10px;
  }

  .product-section-head { gap: 8px; }
}

@media screen and (max-width: 360px) {
  .shop-header-left { gap: 8px; }
  .shop-logo-wrap { width: 40px; height: 40px; flex-basis: 40px; }
  .shop_title { max-width: 80px; font-size: 15px; }
  .btn-kefu, .btn-order { min-height: 34px; padding: 0 9px; font-size: 11px; }

  .promotion-image,
  .product-thumb { width: 58px; height: 58px; flex-basis: 58px; }

  .promotion-card-body,
  .product-body { padding-left: 10px; }

  .promotion-price-row,
  .product-meta { gap: 8px; }

  .sort, .sort_active { min-width: 100%; }
}

/* 在参考图的黑白骨架上增加柔和层次，避免粗边框和硬直角造成廉价感。 */
html {
  background: #f3f3f1;
}

body {
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, .96), transparent 360px),
    #f3f3f1;
}

.main {
  background: #fafaf9;
  box-shadow: 0 8px 26px rgba(19, 19, 19, .055);
}

.shop-header {
  position: sticky;
  top: 0;
  min-height: 86px;
  margin: 0;
  padding: 16px 22px;
  border-top-width: 0;
  border-bottom: 1px solid #dededb;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 5px 20px rgba(20, 20, 20, .035);
  backdrop-filter: blur(14px);
}

.shop-logo-wrap {
  border: 1px solid #eceef0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.shop-header-actions {
  gap: 8px;
}

.btn-kefu,
.btn-order {
  padding: 0 16px;
  border-width: 1px;
  border-radius: 9px;
  font-size: 13px;
}

.btn-kefu {
  box-shadow: 0 4px 10px rgba(0, 0, 0, .12);
}

.body {
  padding: 26px 20px 42px;
}

.notice-bar {
  margin-bottom: 28px;
  padding: 15px 17px;
  border: 1px solid #dcdcd8;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff 0%, #f7f7f5 100%);
  box-shadow: 0 3px 12px rgba(20, 20, 20, .035);
}

.notice-dot {
  width: 8px;
  height: 8px;
  flex-basis: 8px;
}

.promotion-head .section-title {
  box-shadow: none;
}

.promotion-card,
.product-card {
  border-radius: 8px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.promotion-card {
  border-color: #555;
  box-shadow: 0 2px 7px rgba(26, 32, 38, .06);
}

.promotion-card:hover,
.product-card:hover {
  border-color: #a8a8a3;
  box-shadow: 0 3px 10px rgba(26, 32, 38, .08);
}

.promotion-card.product_active,
.product-card.product_active {
  border-color: #111;
  background: #f8f8f7;
  box-shadow: inset 0 0 0 1px #111, 0 3px 11px rgba(17, 17, 17, .12);
}

/* 当前商品使用深色描边和文字角标，活动区与普通列表保持一致的选中反馈。 */
.promotion-card.product_active::after,
.product-card.product_active::after {
  content: "已选择";
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 3px;
  color: #fff;
  background: #111;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.promotion-image,
.product-thumb {
  border-radius: 3px;
}

.stock-tag {
  border-radius: 3px;
}

.product-section-head { gap: 8px; }

.sort,
.sort_active {
  border-color: #d0d0cc;
  border-radius: 10px;
}

.sort_active {
  border-color: #161616;
}

.intro-box,
.form-row,
.pcontent img {
  border-radius: 12px;
}

.shop-footer > span {
  width: 66px;
  height: 2px;
}

.btn_buy {
  border-top-color: #dededb;
}

.btn_buy .to_pay,
.checkout-confirm {
  border-radius: 10px;
}

@media screen and (max-width: 520px) {
  .shop-header {
    min-height: 76px;
    margin: 0;
    padding: 13px 14px;
  }

  .shop_title { font-size: 17px; }
  .shop-header-actions { gap: 6px; margin-left: 8px; }
  .btn-kefu,
  .btn-order { min-height: 36px; padding: 0 10px; font-size: 12px; }

  .body {
    padding: 22px 12px 36px;
  }
}

@media screen and (max-width: 360px) {
  .shop-header { padding-right: 9px; padding-left: 9px; }
  .shop-logo-wrap { width: 40px; height: 40px; flex-basis: 40px; }

  .shop_title {
    max-width: clamp(54px, 22vw, 80px);
    font-size: 14px;
  }

  .btn-kefu,
  .btn-order {
    min-height: 34px;
    padding-right: 6px;
    padding-left: 6px;
    font-size: 10px;
  }
}

@media screen and (max-width: 320px) {
  .body { padding: 18px 8px 32px; }
  .section-title { font-size: 16px; }
  .promotion-card,
  .product-card { min-height: 92px; padding: 9px; }
  .promotion-image,
  .product-thumb { width: 56px; height: 56px; flex-basis: 56px; }
  .promotion-card-body,
  .product-body { padding-right: 62px; padding-left: 9px; }
  .promotion-product-title,
  .product_title { font-size: 13px; }
  .product_price { font-size: 16px; }
  .product_sold { font-size: 10px; }
  .stock-tag,
  .promotion-card .stock-tag { right: 9px; bottom: 9px; padding: 3px 6px; font-size: 9px; }
  .promotion-card.product_active::after,
  .product-card.product_active::after { top: 7px; right: 7px; padding: 3px 5px; font-size: 9px; }
  .amount-row { align-items: stretch; flex-direction: column; }
  .amount-ctrl { align-self: flex-end; }
  .btn_buy { padding-right: 8px; padding-left: 8px; }
  .btn-buy-inner { gap: 10px; }
  .btn_buy .to_pay { flex-basis: 60%; }
}

/* 保留查询页与支付成功页样式，前台商城使用参考站结构。 */.query-shell {
    width: 100%;
    max-width: 720px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 22px 12px 60px;
    background: var(--page);
}

.query-card {
    overflow: hidden;
    padding: 18px 16px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(26, 32, 38, 0.055);
}

.query-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.query-head a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f2f3f4;
}

.query-head h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.query-tip {
    margin: 0 0 16px;
    color: #878b90;
    font-size: 12px;
    line-height: 1.6;
}

.query-field {
    margin-bottom: 10px;
}

.query-field input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #bdbdbd;
    border-radius: 3px;
    outline: none;
    background: #fff;
    font-size: 14px;
}

.query-field input:focus {
    border-color: var(--ink);
}

.query-submit {
    width: 100%;
    min-height: 48px;
    margin-top: 6px;
    border: 0;
    border-radius: 10px;
    background: var(--ink);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}

.query-result {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fafafa;
    color: #555;
    font-size: 13px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.query-result strong {
    color: var(--ink);
}

.return-shell {
    width: 100%;
    max-width: 720px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 22px 12px 60px;
    background: var(--page);
}

.return-hero,
.return-card {
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(26, 32, 38, 0.055);
}

.return-hero {
    padding: 26px 18px 22px;
    text-align: center;
}

.return-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--success-bg);
    color: var(--success);
}

.return-check svg {
    width: 30px;
    height: 30px;
}

.return-hero h1 {
    margin: 0;
    font-size: 21px;
    font-weight: 800;
}

.return-hero p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.return-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}

.return-actions a {
    display: inline-flex;
    min-height: 42px;
    flex: 1;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
}

.return-actions .primary {
    background: var(--ink);
    color: #fff;
}

.return-actions .secondary {
    border: 1px solid var(--ink);
    background: #fff;
    color: var(--ink);
}

.return-card {
    margin-top: 12px;
    padding: 16px;
}

.return-card h2 {
    margin: 0 0 10px;
    color: var(--ink);
    font-size: 15px;
}

.return-card p {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

/* 参考站前台适配：错误提示、金额宽度和移动端可读性。 */
.notice-bar.notice-error {
  border-color: #efd3d5;
  color: var(--danger);
  background: #fff0f1;
}

.notice-bar.notice-error .notice-dot {
  background: var(--danger);
}

.product-card .product_title,
.promotion-card .promotion-product-title {
  color: #111;
  font-weight: 900;
  -webkit-text-stroke: 0.14px currentColor;
}

.product-card .product_price,
.promotion-card .product_price,
.checkout-summary strong,
.pay-total strong {
  font-weight: 900;
  -webkit-text-stroke: 0.42px currentColor;
  text-shadow: 0 0 0.2px currentColor;
}

.btn_buy .pay-total {
  width: 152px;
  flex: 0 0 152px;
}

.btn_buy .to_pay {
  flex: 1 1 auto;
}

.checkout-close {
  z-index: 3;
  touch-action: manipulation;
}

@media screen and (max-width: 380px) {
  .btn_buy .pay-total {
    width: 132px;
    flex-basis: 132px;
  }
}

/* ==========================================================================
   主题配色：蓝色主题
   本模板只包含这一套配色，与其他主题模板相互独立，后台启用即可生效。
   ========================================================================== */
:root {
  --text: #111111;
  --muted: #8b8b8b;
  --line: #d7d7d7;
  --paper: #ffffff;
  --page: #eaf2ff;
  --price: #e4393c;
  --success: #3f7448;
  --success-bg: #edf7ec;
  --danger: #b82c3a;

  --ink: var(--text);

  --accent: #3b82f6;
  --accent-deep: #1d5fd8;
  --accent-soft: #e8f1ff;
  --accent-line: #bcd8ff;
  --accent-on: #ffffff;
  --accent-ink: #1a63e0;
  --accent-glow: rgba(59, 130, 246, .32);
  --focus-ring: rgba(59, 130, 246, .4);
  --page-bg: radial-gradient(circle at 50% 0, rgba(255, 255, 255, .98), transparent 380px), #eaf2ff;
  --main-bg: #fbfdff;
  --main-glow: rgba(59, 130, 246, .18);
  --header-bg: linear-gradient(180deg, #e8f1ff 0%, rgba(255, 255, 255, .97) 82%);
  --header-line: #cadeff;
  --card-active-bg: #f0f6ff;
  --grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
}

html { background: var(--page); }

body {
  color: var(--text);
  background: var(--page-bg);
}

.main {
  background:
    radial-gradient(120% 58% at 50% 0, var(--main-glow) 0%, rgba(255, 255, 255, 0) 68%),
    var(--main-bg);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
.to_pay:focus-visible {
  outline-color: var(--focus-ring);
}

/* 头部与操作按钮 */
.shop-header {
  border-bottom-color: var(--header-line);
  background: var(--header-bg);
}

.shop-header::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--grad);
}

.shop-logo-wrap,
.promotion-image,
.product-thumb {
  background: var(--accent-soft);
}

.btn-kefu {
  border-color: var(--accent);
  color: var(--accent-on);
  background: var(--grad);
  box-shadow: 0 6px 16px var(--accent-glow);
}

.btn-order {
  border-color: var(--accent-line);
  color: var(--accent-ink);
  background: #fff;
}

.btn-kefu:active,
.btn-order:active { transform: translateY(1px); }

/* 公告、分类与卡片选中态 */
.notice-bar { border-color: var(--accent-line); }
.notice-dot { background: var(--accent); }

.sort {
  border-color: var(--accent-line);
  color: var(--accent-ink);
}

.sort_active {
  border-color: var(--accent);
  color: var(--accent-on);
  background: var(--grad);
}

.promotion-card:hover,
.product-card:hover { border-color: var(--accent-line); }

.promotion-card.product_active,
.product-card.product_active {
  border-color: var(--accent);
  background: var(--card-active-bg);
  box-shadow: inset 0 0 0 1px var(--accent), 0 3px 11px var(--accent-glow);
}

.promotion-card.product_active::after,
.product-card.product_active::after {
  color: var(--accent-on);
  background: var(--grad);
}

/* 表单、底部购买栏与结算弹窗 */
.amount-ctrl { border-color: var(--accent); }
.clac { color: var(--accent-ink); }
.checked { border-color: var(--accent) !important; color: var(--accent-ink) !important; background: var(--accent-soft) !important; }

.shop-footer > span { background: var(--grad); }
.card7 a,
#card7_xb .card7 a:link { color: var(--accent-ink); }

.btn_buy { border-top-color: var(--header-line); }

.btn_buy .to_pay {
  color: var(--accent-on);
  background: var(--grad);
  box-shadow: 0 6px 18px var(--accent-glow);
}

.checkout-eyebrow { color: var(--accent-ink); }
.checkout-confirm { color: var(--accent-on); background: var(--grad); }

/* 查询页与支付成功页 */
.query-head a { color: var(--accent-ink); background: var(--accent-soft); }
.query-field input:focus { border-color: var(--accent); }
.query-submit { color: var(--accent-on); background: var(--grad); }
.query-result strong { color: var(--accent-ink); }
.return-check { background: var(--success-bg); color: var(--success); }
.return-actions .primary { color: var(--accent-on); background: var(--grad); }
.return-actions .secondary { border-color: var(--accent-line); color: var(--accent-ink); }

/* 扫码收银台 */
.qr-pay-action { border-color: var(--accent); }
.qr-pay-save { color: var(--accent-ink); }
.qr-pay-open-app { color: var(--accent-on); background: var(--grad); }
.qr-pay-panel .checkout-close:hover { color: var(--accent-on); background: var(--grad); }
.qr-pay-query-link:hover { color: var(--accent-ink); }

/* --------------------------------------------------------------------------
   金额排版：取消加粗描边，恢复常规字重与标准红色，观感更简洁。
   -------------------------------------------------------------------------- */
.product_price,
.product-card .product_price,
.promotion-card .product_price,
.pay-total strong,
.checkout-summary strong,
.qr-pay-price {
  color: var(--price);
  font-weight: 600;
  letter-spacing: 0;
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.product-card .product_title,
.promotion-card .promotion-product-title {
  color: #1c1c1c;
  font-weight: 700;
  -webkit-text-stroke: 0;
}
/* 限时活动卡片里的金额略微加粗，与普通商品金额形成对比 */
.promotion-card .product_price,
.promotion-price-row .product_price {
  font-weight: 700;
}



/* --------------------------------------------------------------------------
   “限时活动”标签：渐变胶囊样式，突出显示。
   -------------------------------------------------------------------------- */
.promotion-head .section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 17px 8px 13px;
  border-radius: 999px;
  color: var(--accent-on);
  background: var(--grad);
  box-shadow: 0 8px 20px var(--accent-glow);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .16);
}

.promotion-head .section-title .section-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  stroke-width: 2;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .18));
}

/* --------------------------------------------------------------------------
   商品标题：完整显示，常规字重，不做加粗加黑，也不截断。
   -------------------------------------------------------------------------- */
.product_title,
.promotion-product-title,
.product-card .product_title,
.promotion-card .promotion-product-title {
  display: block;
  overflow: visible;
  color: #2b2b2b;
  font-weight: 400;
  -webkit-text-stroke: 0;
}

/* 限时活动卡片的标题略微加粗加深，突出主推商品 */
.promotion-card .promotion-product-title {
  color: #141414;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   原价角标：贴在卡片右上角，底色跟随主题；有角标时不再显示“已选择”。
   原价由后台商品编辑页的“商品原价”填写，留空或 0 表示不显示。
   -------------------------------------------------------------------------- */
.promotion-card .old-price,
.product-card .old-price {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  padding: 5px 14px 6px 16px;
  border-radius: 0 7px 0 12px;
  color: var(--accent-on);
  background: var(--accent);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: .01em;
  white-space: nowrap;
}

/* 为角标让出顶部空间，标题整行从角标下方开始 */
.has-old-price .promotion-card-body,
.has-old-price .product-body { padding-top: 17px; }

.promotion-card.has-old-price::after,
.product-card.has-old-price::after { display: none; }

@media screen and (max-width: 520px) {
  .promotion-card .old-price,
  .product-card .old-price {
    padding: 4px 11px 5px 13px;
    font-size: 11px;
  }
  .has-old-price .promotion-card-body,
  .has-old-price .product-body { padding-top: 17px; }
}

/* --------------------------------------------------------------------------
   间距与留白统一，桌面端与移动端分别标定。
   -------------------------------------------------------------------------- */
.body { padding: 26px 20px 44px; }
.notice-bar { margin-bottom: 24px; }
.section-block { margin-bottom: 30px; }
.section-head { margin-bottom: 12px; }
.promotion-grid { gap: 12px; }
.product-list { gap: 8px; }

.promotion-card,
.product-card { min-height: 126px; padding: 16px; }

.promotion-image,
.product-thumb { width: 76px; height: 76px; flex-basis: 76px; }

.promotion-card-body,
.product-body { padding-left: 16px; }

.promotion-product-title,
.product_title { margin-bottom: 8px; line-height: 1.45; }

.promotion-price-row,
.product-meta { gap: 12px; }

.product-section-head { margin: 26px 0 12px; }
.intro-box,
.form-row { padding: 16px; }
.pcontent { margin: 10px 0 16px; }
.form-row { margin-bottom: 14px; }
.shop-footer { padding: 14px 20px 34px; }
.shop-footer > span { margin-bottom: 20px; }
.btn_buy { padding: 10px 18px calc(10px + env(safe-area-inset-bottom)); }
.btn-buy-inner { gap: 16px; }

@media screen and (max-width: 520px) {
  .shop-header { padding: 12px 14px; }
  .body { padding: 20px 14px 38px; }
  .notice-bar { margin-bottom: 22px; }
  .section-block { margin-bottom: 26px; }
  .promotion-card,
  .product-card { min-height: 110px; padding: 12px 14px; }
  .promotion-image,
  .product-thumb { width: 64px; height: 64px; flex-basis: 64px; }
  .promotion-card-body,
  .product-body { padding-right: 0; padding-left: 12px; }
  .promotion-price-row,
  .product-meta { padding-right: 72px; }
  .promotion-product-title,
  .product_title { margin-bottom: 6px; font-size: 14px; }
  .promotion-head .section-title { padding: 7px 15px 7px 12px; font-size: 16px; }
  .product-section-head { margin-top: 22px; }
  .shop-footer { padding: 12px 14px 30px; }
}

@media screen and (max-width: 360px) {
  .shop-header { padding-right: 10px; padding-left: 10px; }
  .body { padding: 18px 10px 34px; }
  .promotion-card,
  .product-card { min-height: 108px; padding: 10px 12px; }
  .promotion-image,
  .product-thumb { width: 58px; height: 58px; flex-basis: 58px; }
  .promotion-card-body,
  .product-body { padding-right: 0; padding-left: 10px; }
  .promotion-price-row,
  .product-meta { padding-right: 66px; }
}

@media screen and (max-width: 320px) {
  .body { padding: 16px 8px 32px; }
  .btn_buy { padding-right: 10px; padding-left: 10px; }
  .btn-buy-inner { gap: 12px; }
  .promotion-head .section-title { font-size: 15px; }
}