:root {
  --brand: #e92322;
  --brand-deep: #b81216;
  --gold: #ffd45a;
  --ink: #24212a;
  --muted: #77717d;
  --line: #eee5df;
  --card: #fffaf6;
  --paper: #fff;
  --success: #16a36d;
  --alipay: #1677ff;
  --wechat: #17b55f;
  --shadow: 0 18px 50px rgba(130, 51, 21, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  background:
    radial-gradient(circle at top left, rgba(255, 37, 37, 0.18), transparent 28rem),
    linear-gradient(135deg, #fff1ee 0%, #fff7f2 48%, #ffe4df 100%);
  color: var(--ink);
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue",
    sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.phone-shell {
  margin: 0 auto;
  min-height: 100vh;
  max-width: 460px;
  background: #f6f6f6;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6), 0 30px 80px rgba(85, 35, 11, 0.18);
}

.app {
  min-height: 100vh;
  padding-bottom: 96px;
}

.site-footer {
  display: grid;
  gap: 4px;
  padding: 18px 16px calc(84px + env(safe-area-inset-bottom));
  color: #8a838d;
  background: #f6f6f6;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #8a838d;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  color: #fff;
  background: linear-gradient(180deg, #e92322 0%, #f43a2f 100%);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(238, 229, 223, 0.72);
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.back-btn,
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 8px 22px rgba(117, 53, 23, 0.1);
}

.promo-head {
  padding: 8px 12px 10px;
  color: #fff;
  background: linear-gradient(180deg, #f43a2f 0%, #f14a35 72%, rgba(241, 74, 53, 0) 100%);
}

.pdd-search {
  margin: 0;
  border-radius: 999px;
  box-shadow: none;
}

.quick-tabs {
  display: flex;
  overflow-x: auto;
  justify-content: flex-start;
  gap: 8px;
  padding: 9px 2px 0;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.quick-tabs span {
  flex: 0 0 auto;
  padding: 0 8px;
}

.hero {
  position: relative;
  overflow: hidden;
  margin: 0 12px 12px;
  padding: 16px;
  color: #fff;
  border-radius: 18px;
  background:
    radial-gradient(circle at 86% 22%, rgba(255, 246, 134, 0.82), transparent 7rem),
    linear-gradient(135deg, #ff6b2c 0%, #ef2828 50%, #b00f17 100%);
  box-shadow: 0 10px 22px rgba(177, 18, 22, 0.14);
}

.hero::after {
  content: "";
  position: absolute;
  right: -36px;
  bottom: -54px;
  width: 166px;
  height: 166px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.eyebrow {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
}

.hero h2 {
  position: relative;
  margin: 0;
  max-width: 290px;
  font-size: 24px;
  line-height: 1.16;
  letter-spacing: -0.5px;
}

.hero p {
  position: relative;
  margin: 8px 0 14px;
  max-width: 300px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  line-height: 1.7;
}

.hero-actions {
  position: relative;
  display: flex;
  gap: 10px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 700;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  box-shadow: 0 12px 26px rgba(255, 75, 31, 0.28);
}

.hero .primary-btn {
  color: var(--brand-deep);
  background: #fff;
  box-shadow: none;
}

.coupon-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 12px 12px;
}

.coupon-strip button {
  display: grid;
  gap: 2px;
  padding: 8px 6px;
  border-radius: 12px;
  color: var(--brand-deep);
  background:
    linear-gradient(90deg, transparent 0 6px, #fff4dd 6px calc(100% - 6px), transparent calc(100% - 6px)),
    radial-gradient(circle at left center, #f6f6f6 0 5px, transparent 6px),
    radial-gradient(circle at right center, #f6f6f6 0 5px, transparent 6px);
  box-shadow: 0 8px 18px rgba(177, 18, 22, 0.08);
}

.coupon-strip strong {
  font-size: 18px;
  line-height: 1;
}

.coupon-strip span {
  font-size: 11px;
}

.secondary-btn {
  color: var(--brand-deep);
  background: #fff0e8;
}

.ghost-btn {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.36);
}

.danger-btn {
  color: #a82412;
  background: #ffe9df;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px 12px;
  padding: 10px 14px;
  border-radius: 18px;
  color: var(--muted);
  background: #fff;
  box-shadow: 0 10px 24px rgba(112, 54, 18, 0.08);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.section {
  margin: 14px 12px 0;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-title h3 {
  margin: 0;
  font-size: 17px;
}

.section-title span,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.category-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.category-card {
  padding: 10px 4px;
  border-radius: 12px;
  text-align: center;
  background: #fff;
  box-shadow: 0 10px 22px rgba(112, 54, 18, 0.07);
}

.category-card strong {
  display: block;
  margin-top: 7px;
  font-size: 12px;
}

.category-icon,
.product-art,
.detail-art {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.78), transparent 30%),
    linear-gradient(135deg, #fff2d8, #ffd0bd);
}

.product-art img,
.detail-art img,
.mini-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-art img {
  object-fit: contain;
  background: #fff;
}

.product-img-p004,
.product-img-p005,
.product-img-p007 {
  object-position: center 34%;
}

.category-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border-radius: 16px;
  font-size: 22px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.product-card {
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(96, 39, 24, 0.07);
}

.product-card button {
  display: block;
  width: 100%;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
}

.product-art {
  position: relative;
  aspect-ratio: 1 / 1;
  height: auto;
  font-size: 46px;
}

.deal-ribbon {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #e92322, #ff6b2c);
  font-size: 11px;
  font-weight: 900;
}

.product-info {
  padding: 8px 9px 10px;
}

.product-info h4 {
  display: -webkit-box;
  min-height: 36px;
  margin: 0 0 6px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 13px;
  line-height: 1.38;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 99px;
  color: var(--brand-deep);
  background: #fff0f0;
  font-size: 10px;
}

.product-info .tag:nth-child(n + 3) {
  display: none;
}

.price-line,
.price-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
}

.price {
  color: var(--brand-deep);
  font-size: 20px;
  font-weight: 800;
}

.price small {
  font-size: 12px;
}

.group-badge {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid #ef3d32;
  border-radius: 4px;
  color: #df1f1f;
  font-size: 10px;
  line-height: 1;
}

.sales {
  color: var(--muted);
  font-size: 11px;
}

.market-line {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin-top: 4px;
  color: #9a9191;
  font-size: 11px;
}

.market-line span {
  text-decoration: line-through;
}

.market-line strong {
  overflow: hidden;
  color: #9a9191;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 10px 16px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab {
  flex: 0 0 auto;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
}

.tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
}

.detail-art {
  aspect-ratio: 1 / 1;
  height: auto;
  margin: 12px 12px 0;
  border-radius: 18px;
  background: #fff;
  font-size: 94px;
  box-shadow: 0 8px 20px rgba(96, 39, 24, 0.08);
}

.detail-panel,
.order-card,
.cart-card,
.pay-card,
.result-card,
.notice-card {
  margin: 10px 12px 0;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(96, 39, 24, 0.06);
}

.detail-panel h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.detail-price {
  font-size: 28px;
}

.detail-market {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff3f0;
}

.spec-row,
.summary-row,
.address-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.spec-row:last-child,
.summary-row:last-child,
.address-row:last-child {
  border-bottom: 0;
}

.cart-item,
.order-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item:last-child,
.order-item:last-child {
  border-bottom: 0;
}

.mini-art {
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: #fff0e8;
  font-size: 30px;
}

.item-main h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.qty {
  display: inline-flex;
  overflow: hidden;
  align-items: center;
  border-radius: 999px;
  background: #fff4ed;
}

.qty button {
  width: 32px;
  height: 32px;
  color: var(--brand-deep);
  background: transparent;
  font-weight: 800;
}

.qty span {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
}

.bottom-bar,
.nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 50;
  width: 100%;
  max-width: 460px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(238, 229, 223, 0.9);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.06);
}

.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 64px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}

.bottom-bar .primary-btn,
.bottom-bar .secondary-btn {
  min-width: 128px;
}

.nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 58px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}

.nav button {
  display: grid;
  gap: 3px;
  place-items: center;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.nav button.active {
  color: var(--brand-deep);
  font-weight: 800;
}

.empty {
  margin: 38px 16px;
  padding: 34px 18px;
  border-radius: 28px;
  text-align: center;
  background: #fff;
}

.empty strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.pay-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.pay-option.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 75, 31, 0.1);
}

.pay-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pay-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  color: #fff;
  font-weight: 900;
}

.pay-logo.wechat {
  background: var(--wechat);
}

.pay-logo.alipay {
  background: var(--alipay);
}

.result-card {
  margin-top: 48px;
  text-align: center;
}

.result-icon {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin: 0 auto 14px;
  border-radius: 50%;
  color: #fff;
  background: var(--success);
  font-size: 38px;
}

.result-icon.cancel {
  background: var(--brand);
}

.fineprint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.fade-in {
  animation: fade-in 0.28s ease both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (min-width: 720px) {
  .phone-shell {
    margin: 24px auto;
    min-height: calc(100vh - 48px);
    border-radius: 34px;
    overflow: hidden;
  }
}
