:root {
  color-scheme: light;
  --ink: #171714;
  --tmall-red: #ff1e3c;
  font-family: "Avenir Next", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: #f4f4f4;
}

button { font: inherit; -webkit-tap-highlight-color: transparent; }

.tmall-simulator {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #f4f4f4;
}

.commerce-scroll {
  position: absolute;
  inset: 0 0 calc(72px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.commerce-scroll::-webkit-scrollbar { display: none; }

.commerce-nav {
  position: sticky;
  z-index: 12;
  top: 0;
  height: calc(50px + env(safe-area-inset-top));
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px 34px 34px;
  align-items: end;
  gap: 4px;
  padding: env(safe-area-inset-top) 10px 6px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(14px);
}

.commerce-nav button {
  height: 34px;
  padding: 0;
  color: #161616;
  background: transparent;
  border: 0;
  font-size: 20px;
}

.commerce-nav button:first-child { font-size: 32px; line-height: 1; }

.search-pill {
  min-width: 0;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  overflow: hidden;
  color: #8c8c8c;
  background: #f0f0f2;
  border-radius: 18px;
  font-size: 12px;
  white-space: nowrap;
}

.search-pill span:last-child { overflow: hidden; text-overflow: ellipsis; }

.product-shell { background: #f3f3f3; }

.product-hero {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 69% 22%, rgba(255, 255, 255, 0.7), transparent 17%),
    linear-gradient(145deg, #97b7c6 0%, #dce7e3 52%, #d6b582 100%);
}

.product-hero img { width: 100%; height: 100%; object-fit: cover; }

.product-hero__placeholder { text-align: center; }
.product-hero__placeholder strong {
  display: block;
  font-family: "Songti SC", "Noto Serif CJK SC", serif;
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 600;
  letter-spacing: 0.08em;
}
.product-hero__placeholder span { display: block; margin-top: 9px; font-size: 10px; letter-spacing: 0.16em; }

.hero-index {
  position: absolute;
  right: 14px;
  bottom: 12px;
  padding: 4px 9px;
  background: rgba(0, 0, 0, 0.38);
  border-radius: 12px;
  font-size: 10px;
}

.product-price { padding: 13px 14px 4px; color: var(--tmall-red); background: #fff; font-size: 12px; }
.product-price strong { margin-left: 2px; font-size: 27px; letter-spacing: -0.04em; }
.product-title { padding: 3px 14px 10px; background: #fff; font-size: 15px; font-weight: 650; line-height: 1.55; }
.tmall-badge { display: inline-block; margin-right: 5px; padding: 1px 4px; color: #fff; background: var(--tmall-red); border-radius: 2px; font-size: 10px; vertical-align: 2px; }

.selling-points { display: flex; gap: 6px; padding: 0 14px 13px; overflow: hidden; background: #fff; }
.selling-points span { flex: none; padding: 4px 7px; color: #8c5e3c; background: #fff8f1; border: 1px solid #f0dfd1; border-radius: 3px; font-size: 9px; }

.service-card,
.store-card,
.review-card { margin-top: 8px; padding: 13px 14px; background: #fff; }

.service-row { min-height: 31px; display: grid; grid-template-columns: 58px 1fr auto; gap: 8px; align-items: center; border-bottom: 1px solid #f1f1f1; font-size: 11px; }
.service-row:last-child { border-bottom: 0; }
.service-row span { color: #5c5c5c; }
.service-row b { color: #a1a1a1; font-size: 14px; }

.review-title { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; }
.review-title span { color: var(--tmall-red); font-size: 10px; font-weight: 500; }
.review-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.review-tags span { padding: 5px 8px; color: #5a4a42; background: #fff2ef; border-radius: 12px; font-size: 9px; }

.store-card { display: flex; align-items: center; gap: 10px; }
.store-mark { width: 40px; height: 40px; display: grid; flex: none; place-items: center; color: #fff; background: #0877a6; border-radius: 8px; font-family: Georgia, serif; font-size: 21px; font-weight: 700; }
.store-copy { min-width: 0; flex: 1; }
.store-copy strong,
.store-copy span { display: block; }
.store-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.store-copy span { margin-top: 4px; color: #777; font-size: 9px; }
.store-card button { padding: 6px 10px; color: var(--tmall-red); background: #fff; border: 1px solid var(--tmall-red); border-radius: 14px; font-size: 9px; }

.detail-tabs {
  position: sticky;
  z-index: 11;
  top: calc(50px + env(safe-area-inset-top));
  height: 44px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  color: #8a8a8a;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #ececec;
  text-align: center;
  font-size: 12px;
  backdrop-filter: blur(14px);
}

.detail-tabs .is-active { position: relative; color: #151515; font-weight: 700; }
.detail-tabs .is-active::after { position: absolute; left: 50%; bottom: -11px; width: 19px; height: 2px; content: ""; transform: translateX(-50%); background: #151515; border-radius: 2px; }

.pdp-stream { width: 100%; background: #fff; }

.pdp-module {
  position: relative;
  min-height: var(--module-height, 420px);
  display: grid;
  align-content: space-between;
  padding: clamp(26px, 7vw, 42px) clamp(22px, 6vw, 36px) 22px;
  overflow: hidden;
  background: var(--module-bg, #f5f1e8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.pdp-module::before { position: absolute; top: 18%; right: -20%; width: 58%; aspect-ratio: 1; content: ""; background: var(--module-orb, rgba(255,255,255,.42)); border-radius: 50%; filter: blur(2px); }
.pdp-module.is-image { display: block; min-height: 0; padding: 0; }
.pdp-module.is-image::before { display: none; }
.pdp-module img { display: block; width: 100%; height: auto; }

.module-kicker,
.module-copy,
.module-number { position: relative; z-index: 1; }
.module-kicker { margin: 0; color: var(--module-accent); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; }
.module-copy { align-self: center; }
.module-copy h2 { max-width: 10em; margin: 0; font-family: "Songti SC", "Noto Serif CJK SC", serif; font-size: clamp(30px, 8.2vw, 42px); font-weight: 600; line-height: 1.25; letter-spacing: -0.04em; }
.module-copy p { max-width: 25em; margin: 13px 0 0; color: color-mix(in srgb, var(--module-ink) 72%, transparent); font-size: clamp(12px, 3.2vw, 15px); line-height: 1.8; }
.module-number { display: flex; align-items: end; justify-content: space-between; color: var(--module-accent); font-size: 10px; letter-spacing: 0.08em; }
.module-number span:last-child { width: 40px; height: 1px; background: currentColor; }

.scroll-end { padding: 30px 0 36px; color: #aaa; background: #f5f5f5; text-align: center; font-size: 10px; }

.purchase-bar {
  position: absolute;
  z-index: 19;
  right: 0;
  bottom: 0;
  left: 0;
  height: calc(72px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 48px 48px 48px 1fr 1fr;
  align-items: start;
  gap: 4px;
  padding: 8px 10px calc(7px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(16px);
}

.purchase-mini { display: grid; justify-items: center; gap: 2px; color: #222; }
.purchase-mini span { font-size: 21px; line-height: 1; }
.purchase-mini small { font-size: 9px; }
.purchase-bar button { height: 46px; color: #fff; border: 0; font-size: 12px; font-weight: 700; }
.cart-button { background: linear-gradient(90deg, #ffc400, #ff8a00); border-radius: 23px 0 0 23px; }
.buy-button { background: linear-gradient(90deg, #ff7500, #ff2c14); border-radius: 0 23px 23px 0; }

.scroll-progress { position: absolute; z-index: 20; top: 0; left: 0; width: 0; height: 2px; background: var(--tmall-red); transition: width 80ms linear; }

@media (min-width: 700px) {
  .tmall-simulator { left: 50%; width: 430px; transform: translateX(-50%); box-shadow: 0 0 80px rgba(0,0,0,.14); }
}

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