/* =============================================================================
   手机商城 · 前台 H5 样式（移动优先 / 零构建）
   -----------------------------------------------------------------------------
   说明：
     · 所有类名向下兼容，旧页面写法继续有效；
     · 新增类只做增强：.hero-tags / .thumb-wrap / .badge / .sold-out /
       .section-title / .btn-ghost / .btn-block / .tag-line / .sk / .sheet ...
     · [hidden] 一律 display:none（旧版被 .cart-float{display:flex} 之类覆盖过）
   ============================================================================= */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --brand: #ff3b4e;
  --brand-2: #ff7a45;
  --brand-deep: #e0243c;
  --brand-soft: #fff1f2;
  --brand-line: #ffd9dd;
  --gold: #ff9f1c;

  --text: #16181d;
  --text-2: #5a6070;
  --text-3: #9aa1ad;

  --line: #eef0f4;
  --line-2: #e5e8ee;
  --bg: #f4f5f8;
  --card: #fff;

  --ok: #0ea56a;
  --warn: #f59e0b;
  --blue: #1677ff;

  --r-xs: 8px;
  --r-sm: 10px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --sh-1: 0 1px 2px rgba(16, 24, 40, 0.04), 0 2px 8px rgba(16, 24, 40, 0.04);
  --sh-2: 0 6px 16px -8px rgba(16, 24, 40, 0.12), 0 16px 32px -24px rgba(16, 24, 40, 0.22);
  --sh-brand: 0 10px 20px -10px rgba(255, 59, 78, 0.6);

  --grad: linear-gradient(135deg, #ff8a4c 0%, #ff3b4e 72%);
  --grad-deep: linear-gradient(150deg, #ff9a5a 0%, #ff4d4f 46%, #e0243c 100%);
  --grad-soft: linear-gradient(135deg, #fff3f0, #fff8f2);
}

/* ---------- 2. 基础 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'HarmonyOS Sans SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

input[type='checkbox'] {
  accent-color: var(--brand);
}

::selection {
  background: rgba(255, 59, 78, 0.16);
}

/* ---------- 3. 页面容器 ---------- */
.page {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
}

@media (min-width: 600px) {
  body {
    background: #eceef3;
  }

  .page {
    box-shadow: 0 0 0 1px var(--line-2), 0 24px 60px -34px rgba(16, 24, 40, 0.3);
  }
}

/* ---------- 4. 顶部导航 ---------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.appbar .title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.appbar .back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f5f6f9;
  color: var(--text-2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.appbar .back:active {
  background: #eceef2;
}

.appbar .right {
  min-width: 34px;
  display: flex;
  justify-content: flex-end;
  font-size: 13px;
  color: var(--text-3);
}

/* ---------- 5. 首页头图 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 22px 18px 30px;
  color: #fff;
  background: var(--grad-deep);
  border-radius: 0 0 24px 24px;
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero::before {
  width: 220px;
  height: 220px;
  top: -110px;
  right: -70px;
  background: rgba(255, 255, 255, 0.16);
}

.hero::after {
  width: 170px;
  height: 170px;
  bottom: -110px;
  left: -50px;
  background: rgba(255, 255, 255, 0.1);
}

.hero h1 {
  position: relative;
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.6px;
}

.hero p {
  position: relative;
  margin: 6px 0 0;
  font-size: 12.5px;
  opacity: 0.94;
  letter-spacing: 0.2px;
}

.hero-tags {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.hero .btn-plain {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.36);
  color: #fff;
  box-shadow: none;
}

/* ---------- 6. 搜索框 ---------- */
.searchbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -20px 12px 0;
  padding: 7px 7px 7px 15px;
  background: #fff;
  border: 1px solid rgba(16, 24, 40, 0.04);
  border-radius: 999px;
  box-shadow: var(--sh-2);
}

.searchbar > span {
  font-size: 15px;
  opacity: 0.55;
}

.searchbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}

.searchbar input::placeholder {
  color: var(--text-3);
}

/* ---------- 7. 轮播 ---------- */
.banner-wrap {
  position: relative;
  margin: 12px 12px 0;
}

.banner-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  background: #fff;
  scrollbar-width: none;
}

.banner-track::-webkit-scrollbar {
  display: none;
}

.banner {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: block;
}

.banner img {
  width: 100%;
  aspect-ratio: 8 / 3;
  object-fit: cover;
}

.banner-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9px;
  display: flex;
  gap: 5px;
  justify-content: center;
}

.banner-dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  transition: width 0.25s ease, background 0.25s ease;
}

.banner-dots i.on {
  width: 18px;
  background: #fff;
}

/* ---------- 8. 活动标签 / 分类 ---------- */
.promo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 12px 0;
}

.promo-pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--brand-line);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--sh-1);
}

.cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 12px 4px;
  scrollbar-width: none;
  /* 右侧留一段渐隐，暗示「还能往右滑」而不是被硬生生裁掉 */
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), rgba(0, 0, 0, 0) 100%);
}

.cats::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  padding: 7px 15px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font-size: 13px;
  box-shadow: var(--sh-1);
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.chip.active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: var(--sh-brand);
}

/* ---------- 9. 商品瀑布流 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px 12px 96px;
}

.card {
  background: #fff;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-1);
}

.card.product {
  position: relative;
  display: block;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.card.product:active {
  transform: scale(0.985);
  box-shadow: var(--sh-2);
}

.thumb-wrap {
  position: relative;
  overflow: hidden;
}

.product .thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: linear-gradient(135deg, #f7f8fb, #eef0f5);
}

.badge {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.1);
}

.sold-out {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(22, 24, 29, 0.42);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
}

.product .body {
  padding: 9px 10px 11px;
}

.product .name {
  display: -webkit-box;
  min-height: 38px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product .sub {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product .foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-top: 7px;
}

.product .sold,
.sold {
  color: var(--text-3);
  font-size: 11px;
  white-space: nowrap;
}

/* ---------- 10. 价格 ---------- */
.price {
  color: var(--brand);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}

.price small {
  margin-right: 1px;
  font-size: 0.64em;
  font-weight: 700;
}

.price-old {
  margin-left: 6px;
  color: var(--text-3);
  font-size: 12px;
  text-decoration: line-through;
}

/* ---------- 11. 悬浮购物车 ---------- */
.cart-float {
  position: fixed;
  right: 14px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 31;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-size: 22px;
  box-shadow: 0 10px 24px -8px rgba(16, 24, 40, 0.3);
}

.cart-float:active {
  transform: scale(0.95);
}

.cart-float b {
  position: absolute;
  top: -2px;
  right: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(255, 59, 78, 0.5);
}

/* ---------- 12. 卡片 / 区块 ---------- */
.block {
  margin: 12px;
  padding: 14px;
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}

.block h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 14.5px;
  font-weight: 700;
}

.block h3 .sub,
h3 .sub {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 400;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 14.5px;
  font-weight: 700;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--grad);
}

/* ---------- 商品详情（结构化详情文案：.detail-h / .detail-ul / .detail-kv / .detail-p） ---------- */
.detail-body {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-2);
}

.detail-h {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 14px 0 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.detail-h:first-child {
  margin-top: 0;
}

.detail-h::before {
  content: '';
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--brand);
}

.detail-ul {
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
}

.detail-ul li {
  position: relative;
  padding-left: 14px;
  margin-bottom: 5px;
}

.detail-ul li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 9px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand);
  opacity: .75;
}

.detail-kv {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}

.detail-kv:last-child {
  border-bottom: 0;
}

.detail-kv span {
  flex: 0 0 86px;
  color: var(--text-3);
}

.detail-kv b {
  flex: 1;
  font-weight: 500;
  color: var(--text);
}

.detail-p {
  margin: 0 0 8px;
}

.detail-p:last-child {
  margin-bottom: 0;
}

.service-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.service-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-2);
  font-size: 11.5px;
}

.service-item + .service-item::before {
  content: '·';
  margin-right: 4px;
  color: var(--text-3);
}

/* ---------- 12.1 图标（统一来自 /js/icons.js，跟随文字颜色与字号） ---------- */
.hero-tag svg,
.service-item svg,
.badge svg,
.section-title svg,
.notice svg,
.quick-grid .qi svg,
.empty .ico svg,
.avatar svg,
.icon-btn svg,
.cart-float span svg {
  display: block;
  flex: 0 0 auto;
}

.searchbar .s-ico {
  display: flex;
  align-items: center;
  color: var(--text-3);
}

.cart-float span {
  display: flex;
  color: var(--brand);
}

/* ---------- 13. 按钮 ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.2px;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--sh-brand);
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:active {
  transform: scale(0.975);
}

.btn[disabled] {
  background: #e8eaef;
  color: #a9b0bb;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-plain {
  background: #fff;
  color: var(--text-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--sh-1);
}

.btn-ghost {
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: none;
}

.btn-blue {
  background: linear-gradient(135deg, #4b9bff, #1677ff);
  box-shadow: 0 10px 20px -10px rgba(22, 119, 255, 0.6);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 22px;
  font-size: 16px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row .btn {
  flex: 1;
}

/* ---------- 14. 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.tag-warn {
  background: #fff7e6;
  color: #c2410c;
}

.tag-ok {
  background: #e9f9f0;
  color: var(--ok);
}

.tag-gray {
  background: #f3f4f7;
  color: #6b7280;
}

.tag-blue {
  background: #e8f2ff;
  color: var(--blue);
}

.tag-line {
  background: #fff;
  border: 1px solid var(--line-2);
  color: var(--text-2);
}

/* ---------- 15. 键值列表 ---------- */
.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  font-size: 13.5px;
  border-bottom: 1px dashed var(--line);
}

.kv:first-child {
  padding-top: 0;
}

.kv:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.kv .k {
  color: var(--text-3);
  white-space: nowrap;
}

.kv .v {
  text-align: right;
  word-break: break-all;
}

/* ---------- 16. 表单 ---------- */
.field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.field:first-child {
  padding-top: 0;
}

.field:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.field label {
  flex: 0 0 76px;
  width: 76px;
  padding-top: 1px;
  color: var(--text-2);
  font-size: 13.5px;
}

.field input,
.field textarea,
.field select {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14.5px;
  resize: none;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #b9bfc9;
}

.field textarea {
  min-height: 44px;
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: #fbfcfd;
}

.field-inline input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

/* ---------- 17. 列表项 ---------- */
.list-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.list-item:first-child {
  padding-top: 0;
}

.list-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.list-item .pic {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: var(--r);
  object-fit: cover;
  background: linear-gradient(135deg, #f7f8fb, #eef0f5);
}

/* ---------- 18. 购物车行 ---------- */
.cart-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cart-row:first-child {
  padding-top: 0;
}

.cart-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.cart-row input[type='checkbox'] {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin-top: 26px;
}

/* ---------- 19. 数量步进器 ---------- */
.qty {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: #fff;
}

.qty button {
  width: 32px;
  height: 30px;
  border: 0;
  background: #f7f8fa;
  color: var(--text-2);
  font-size: 16px;
  cursor: pointer;
}

.qty button:active {
  background: #eceef2;
}

.qty span {
  min-width: 38px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- 20. 底部操作栏 ---------- */
.bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -18px rgba(16, 24, 40, 0.35);
}

.bottombar .btn {
  flex: 1;
}

/* ---------- 21. 底部标签栏 ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  max-width: 560px;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
}

.tabbar a {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 9px 0 8px;
  color: var(--text-3);
  font-size: 11px;
  transition: color 0.18s ease;
}

.tabbar a.active {
  color: var(--brand);
  font-weight: 600;
}

.tabbar .ico {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  font-size: 19px;
  line-height: 1;
}

.tabbar .ico svg {
  display: block;
  width: 22px;
  height: 22px;
}

.tabbar a.active .ico {
  transform: translateY(-1px);
}

.tabbar .badge {
  position: absolute;
  top: 7px;
  left: 50%;
  margin-left: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(255, 59, 78, 0.5);
}

/* ---------- 22. 规格选择 ---------- */
.spec-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.spec-chip {
  padding: 8px 15px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: #fafbfc;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.spec-chip.on,
.spec-chip.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(255, 59, 78, 0.07);
}

/* ---------- 23. 商品图集 ---------- */
.gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 12px;
  scrollbar-width: none;
}

.gallery::-webkit-scrollbar {
  display: none;
}

.gallery img {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, #f7f8fb, #eef0f5);
  box-shadow: var(--sh-1);
  scroll-snap-align: center;
}

/* ---------- 24. 收货地址卡 ---------- */
.addr-card {
  padding: 11px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: #fff;
  cursor: pointer;
  transition: all 0.16s ease;
}

.addr-card:last-child {
  margin-bottom: 0;
}

.addr-card.on {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(255, 59, 78, 0.07);
}

/* ---------- 25. 收银台 / 支付 ---------- */
.cashier {
  position: relative;
  overflow: hidden;
  padding: 26px 16px 30px;
  border-radius: 0 0 24px 24px;
  background: linear-gradient(150deg, #4b9bff, #1677ff);
  color: #fff;
  text-align: center;
}

.cashier::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  top: -120px;
  left: -40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.cashier .amount {
  position: relative;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

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

.pay-method .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r);
  background: #e8f2ff;
  color: var(--blue);
  font-size: 20px;
}

.pay-method .check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
}

.pay-hero {
  position: relative;
  overflow: hidden;
  padding: 24px 16px 28px;
  border-radius: 0 0 24px 24px;
  background: var(--grad-deep);
  color: #fff;
  text-align: center;
}

.pay-hero::after {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  top: -130px;
  right: -60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.pay-hero .amount {
  position: relative;
  margin-top: 6px;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.pay-hero .sub {
  position: relative;
  font-size: 12px;
  opacity: 0.9;
}

/* ---------- 26. 结果页 ---------- */
.result-hero {
  padding: 34px 16px 10px;
  text-align: center;
}

.result-hero .ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--grad-soft);
  font-size: 38px;
  box-shadow: var(--sh-1);
  animation: mm-pop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
}

.result-hero h2 {
  margin: 14px 0 4px;
  font-size: 19px;
  font-weight: 700;
}

/* ---------- 27. 进度步骤 ---------- */
.steps {
  display: flex;
  gap: 4px;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-3);
}

.steps span {
  flex: 1;
  text-align: center;
}

.steps b {
  color: var(--brand);
  font-weight: 700;
}

/* ---------- 28. 弹层 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(16, 24, 40, 0.5);
  backdrop-filter: blur(2px);
  animation: mm-fade 0.18s ease;
}

.modal-mask .modal {
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow: auto;
  padding: 18px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  background: #fff;
  border-radius: 20px 20px 0 0;
  animation: mm-sheet 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}

@media (min-width: 520px) {
  .modal-mask {
    align-items: center;
    padding: 20px;
  }

  .modal-mask .modal {
    border-radius: var(--r-xl);
    padding-bottom: 18px;
    animation: mm-pop 0.22s ease both;
  }
}

.modal h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
}

/* ---------- 29. 提示 / 空状态 ---------- */
.notice {
  padding: 11px 12px;
  border: 1px solid #fde68a;
  border-radius: var(--r);
  background: #fffbeb;
  color: #a16207;
  font-size: 12.5px;
  line-height: 1.6;
}

.notice-info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.notice-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
}

.empty .ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--grad-soft);
  color: var(--brand);
  font-size: 32px;
}

.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 999;
  max-width: 76vw;
  padding: 11px 18px;
  border-radius: var(--r);
  background: rgba(22, 24, 29, 0.86);
  color: #fff;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
  animation: mm-pop 0.18s ease both;
}

.countdown {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- 30. 工具类 ---------- */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.row.between {
  justify-content: space-between;
}

.grow {
  flex: 1;
  min-width: 0;
}

.muted {
  color: var(--text-3);
  font-size: 13px;
}

.tiny {
  color: var(--text-3);
  font-size: 11.5px;
}

.one-line {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy {
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:active {
  background: #f3f4f7;
}

.divider {
  height: 1px;
  margin: 12px 0;
  background: var(--line);
}

.p-12 {
  padding: 12px;
}

.p-16 {
  padding: 16px;
}

.text-right {
  text-align: right;
}

.center {
  text-align: center;
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.36);
  font-size: 22px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.quick-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 2px;
  border-radius: var(--r);
  color: var(--text-2);
  font-size: 11.5px;
  transition: background 0.16s ease;
}

.quick-grid a:active {
  background: #f7f8fa;
}

.quick-grid .qi {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 20px;
}

.rec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.rec-grid .product .name {
  min-height: 0;
  font-size: 12.5px;
  -webkit-line-clamp: 1;
}

.rec-grid .product .body {
  padding: 8px 9px 10px;
}

/* ---------- 31. 骨架屏 ---------- */
.sk {
  border-radius: var(--r);
  background: linear-gradient(90deg, #f1f2f5 25%, #e7e9ee 37%, #f1f2f5 63%);
  background-size: 400% 100%;
  animation: mm-shine 1.3s ease infinite;
}

/* ---------- 32. 动画 ---------- */
@keyframes mm-shine {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

@keyframes mm-pop {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes mm-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes mm-sheet {
  from {
    transform: translateY(16px);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
