: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));
  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;
  -webkit-font-smoothing: antialiased;
}

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: 4px solid var(--ink);
  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;
  background: #080808;
}

.shop-logo-wrap::before {
  content: "X";
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 32px;
  font-weight: 300;
}

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

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

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

.shop-subtitle { display: none; }

.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;
  margin-bottom: 14px;
}

.section-head > img { display: none; }
.section-title { color: var(--ink); font-size: 16px; font-weight: 800; }

/* 限时专区使用参考图中的黑色标签，商品保持单行信息卡。 */
.promotion-section { padding: 0; border: 0; background: transparent; }
.promotion-head { justify-content: flex-start; }

.promotion-head .section-title {
  padding: 10px 16px;
  border-radius: 2px;
  color: #fff;
  background: var(--ink);
  font-size: 14px;
}

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

.promotion-card,
.product-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 116px;
  align-items: center;
  padding: 15px 46px 15px 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: inherit;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .08);
  text-decoration: none;
}

.promotion-card { border: 2px solid var(--ink); }

.promotion-card.product_active,
.product-card.product_active {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink), 0 3px 10px rgba(0, 0, 0, .08);
}

.promotion-image,
.product-thumb {
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  place-items: center;
  overflow: hidden;
  border-radius: 2px;
  background: #050505;
}

.promotion-image::before,
.product-thumb::before {
  content: "X";
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 40px;
  font-weight: 300;
}

.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: -webkit-box;
  min-height: 42px;
  margin: 0 0 7px;
  overflow: hidden;
  color: #171717;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product_title { padding-right: 0; }

.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: 48px 0 0 10px;
  padding: 4px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

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

.card-arrow {
  position: absolute;
  top: 50%;
  right: 18px;
  color: #777;
  font-family: Arial, sans-serif;
  font-size: 31px;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-52%);
}

.product-section-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  margin: 38px 0 18px;
  text-align: center;
}

.product-section-head::before,
.product-section-head::after {
  content: "";
  height: 3px;
  background: var(--ink);
}

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

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

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

.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-logo-wrap::before { font-size: 27px; }
  .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; }
  .notice-bar { margin-bottom: 26px; padding: 14px; }

  .promotion-card,
  .product-card { min-height: 104px; padding: 12px 38px 12px 12px; }

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

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

  .promotion-product-title,
  .product_title { min-height: 38px; font-size: 13px; }

  .product_price { font-size: 17px; }

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

  .card-arrow { right: 13px; font-size: 27px; }
  .product-section-head { gap: 12px; }
}

@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%; }
}
