/* ============================================================================
 * 手机内容基础内核：几何、层级、通用浮层
 * 各风格文件只需覆盖视觉（颜色/字体/圆角/阴影/动效），不要改这里的结构与尺寸
 * ==========================================================================*/

.page {
  position: relative;
  width: 390px; height: 844px;
  overflow: hidden;
  display: flex; flex-direction: column;
  font-size: 14px; line-height: 1.45;
  background: var(--pg-bg);
  color: var(--pg-ink);
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}
.page * { box-sizing: border-box; }
/* 按钮重置用 :where() 保证零特异性，任何风格的类名规则都能覆盖 */
.page :where(button) { font: inherit; color: inherit; border: none; background: none; padding: 0; cursor: pointer; }
.page a { color: inherit; text-decoration: none; }
.page img, .page svg { display: block; }
.page p, .page h1, .page h2, .page h3, .page h4, .page ul, .page li { margin: 0; padding: 0; list-style: none; }

/* 状态栏 + 导航高度基准 */
.page { --status-h: 54px; --bar-h: 48px; --tab-h: 86px; --homebar: 24px; }
.pad-top { height: var(--status-h); flex: none; }

/* ---------------------------------------------------------------- 滚动区 -- */
.scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  position: relative;
  min-height: 0;
}
.scroll::-webkit-scrollbar { display: none; }
.scroll > .pad-bot { height: calc(var(--tab-h) + 24px); }

/* ---------------------------------------------------------------- 顶栏 ---- */
.pbar {
  flex: none;
  height: var(--bar-h);
  margin-top: var(--status-h);
  display: flex; align-items: center;
  gap: 8px; padding: 0 12px;
  position: relative; z-index: 9;
}
.pbar-l, .pbar-r { display: flex; align-items: center; gap: 6px; min-width: 44px; }
.pbar-r { justify-content: flex-end; }
/* 同时兼容 .pbar-t 与 .pb-t 两种写法的标题容器 */
.pbar-t, .pb-t { flex: 1; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.pbar-t b, .pb-t b { font-size: 16px; font-weight: 600; letter-spacing: .01em; }
.pbar-t span, .pb-t span { font-size: 10px; opacity: .55; letter-spacing: .04em; }
.pb {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  transition: background .18s ease, transform .18s ease;
}
.pb:active { transform: scale(.9); }

/* 透明顶栏（详情页 / 沉浸页） */
.pbar-trans { position: absolute; top: var(--status-h); left: 0; right: 0; background: transparent; }

/* 内联页头（大标题式） */
.pagehead { padding: 6px 20px 14px; }
.pagehead h1 { font-size: 25px; letter-spacing: -.01em; line-height: 1.2; }
.pagehead p { font-size: 11.5px; opacity: .5; margin-top: 5px; letter-spacing: .03em; }

/* -------------------------------------------------------------- 底部 Tab -- */
.tabbar {
  flex: none;
  height: var(--tab-h);
  padding: 8px 6px var(--homebar);
  display: grid; grid-template-columns: repeat(4, 1fr);
  position: relative; z-index: 12;
  border-top: 1px solid var(--tab-line, rgba(0, 0, 0, .07));
  background: var(--tab-bg, #fff);
}
.tb {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 3px 0 0; position: relative;
  transition: transform .16s cubic-bezier(.2, .9, .3, 1), opacity .16s ease;
  opacity: .45;
}
.tb.on { opacity: 1; }
.tb:active { transform: scale(.92); }
.tb-ic { position: relative; display: grid; place-items: center; width: 24px; height: 24px; }
.tb-ic svg { transition: transform .28s cubic-bezier(.34, 1.56, .64, 1); }
.tb.on .tb-ic svg { transform: translateY(-1px) scale(1.06); }
.tb-n { font-size: 10px; letter-spacing: .06em; }
.tb-badge {
  position: absolute; top: -4px; right: -7px;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 99px; background: var(--badge-bg, #e5484d); color: #fff;
  font: 600 9.5px/15px "Inter", system-ui, sans-serif; text-align: center;
  font-style: normal; letter-spacing: 0;
  box-shadow: 0 0 0 1.5px var(--tab-bg, #fff);
  animation: badgePop .34s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }

/* ---------------------------------------------------------------- 浮层 ---- */
.mask {
  position: absolute; inset: 0; z-index: 60;
  background: rgba(12, 14, 18, .46);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: maskIn .24s ease both;
}
.mask-center { align-items: center; }
.mask-top { align-items: flex-start; }
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%;
  max-height: 78%;
  background: var(--sheet-bg, #fff);
  border-radius: 22px 22px 0 0;
  padding: 8px 20px calc(var(--homebar) + 4px);
  display: flex; flex-direction: column;
  animation: sheetIn .34s cubic-bezier(.22, .9, .28, 1) both;
  overflow: hidden;
}
@keyframes sheetIn { from { transform: translateY(102%); } to { transform: translateY(0); } }
.sheet-grip { width: 36px; height: 4px; border-radius: 99px; background: rgba(0, 0, 0, .14); margin: 0 auto 12px; flex: none; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; padding: 2px 0 14px; flex: none; }
.sheet-h b { font-size: 16px; font-weight: 600; }
.sheet-body { overflow-y: auto; scrollbar-width: none; padding-bottom: 6px; }

.dialog {
  width: 78%; max-width: 300px;
  background: var(--sheet-bg, #fff);
  border-radius: 18px; overflow: hidden;
  animation: dlgIn .3s cubic-bezier(.22, .9, .28, 1) both;
  text-align: center;
}
@keyframes dlgIn { from { opacity: 0; transform: scale(.9) translateY(8px); } to { opacity: 1; transform: none; } }
.dialog-b { padding: 24px 22px 20px; }
.dialog-b b { display: block; font-size: 16px; margin-bottom: 8px; }
.dialog-b p { font-size: 13px; opacity: .62; line-height: 1.6; }
.dialog-f { display: flex; border-top: 1px solid rgba(0, 0, 0, .07); }
.dialog-f button { flex: 1; padding: 14px 0; font-size: 15px; }
.dialog-f button + button { border-left: 1px solid rgba(0, 0, 0, .07); }

/* 底部大按钮条 */
.actionbar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px calc(var(--homebar) + 4px);
  background: var(--act-bg, #fff);
  border-top: 1px solid var(--act-line, rgba(0, 0, 0, .06));
  position: relative; z-index: 11;
}

/* 通用按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-main {
  flex: 1; height: 46px; border-radius: 23px;
  background: var(--btn-bg, #111); color: var(--btn-ink, #fff);
  font-size: 15px; font-weight: 600; letter-spacing: .02em;
  transition: transform .16s cubic-bezier(.2, .9, .3, 1), filter .16s ease, box-shadow .2s ease;
}
.btn-main:active { transform: scale(.97); filter: brightness(.94); }
.btn-ghost { height: 46px; padding: 0 18px; border-radius: 23px; border: 1px solid currentColor; font-size: 14px; }
.btn-ghost:active { transform: scale(.97); }

/* 徽标 / 标签 */
.tag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 3px; font-size: 10px; line-height: 16px; letter-spacing: .02em; }
.tag-line { border: 1px solid currentColor; }

/* 价格 */
.price { font-family: var(--num-font, "Inter", system-ui, sans-serif); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -.01em; }
.price i { font-style: normal; font-size: .72em; font-weight: 500; margin-right: 1px; }
.price-old { font-size: 11px; opacity: .42; text-decoration: line-through; font-weight: 400; }

/* 空态 */
.empty { padding: 90px 40px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty svg { color: currentColor; opacity: .14; }
.empty b { font-size: 14px; font-weight: 500; }
.empty span { font-size: 12px; opacity: .5; line-height: 1.6; }

/* 骨架屏 */
.skel { background: rgba(0, 0, 0, .06); border-radius: 8px; position: relative; overflow: hidden; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
  transform: translateX(-100%); animation: shimmer 1.2s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* 微信支付弹窗（原生观感，任何风格下都保持白底黑字） */
.wxpay-mask { position: absolute; inset: 0; z-index: 80; background: rgba(0, 0, 0, .5); display: flex; align-items: flex-end; animation: maskIn .2s ease both; }
.wxpay { width: 100%; background: #fff; color: #111; border-radius: 16px 16px 0 0; overflow: hidden; animation: sheetIn .3s cubic-bezier(.22, .9, .28, 1) both; }
.wxpay-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.wxpay-h b { font-size: 15px; font-weight: 500; }
.wxpay-h span { width: 20px; display: flex; }
.wxpay-amt { text-align: center; font: 400 40px/1.2 "Inter", system-ui, sans-serif; letter-spacing: -.02em; padding: 10px 0 18px; }
.wxpay-amt em { font-style: normal; font-size: 22px; margin-right: 2px; }
.wxpay-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid #eee; font-size: 14px; }
.wxpay-row span { display: flex; align-items: center; gap: 4px; color: #666; }
.wxpay-kp { display: flex; justify-content: center; gap: 0; padding: 22px 0 18px; }
.wxpay-kp i { width: 44px; height: 44px; border: 1px solid #ddd; border-left: none; display: grid; place-items: center; position: relative; }
.wxpay-kp i:first-child { border-left: 1px solid #ddd; border-radius: 5px 0 0 5px; }
.wxpay-kp i:last-child { border-radius: 0 5px 5px 0; }
.wxpay-kp i.on::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #111; }
.wxpay-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: #d6d6d6; padding-bottom: env(safe-area-inset-bottom); }
.wxpay-k { height: 50px; background: #fff; font-size: 23px; font-weight: 400; display: grid; place-items: center; }
.wxpay-k:active { background: #eee; }
.wxpay-k-empty { background: #d6d6d6; }
.wxpay-ok .wxpay-amt { color: #07c160; }

/* 全局按压回弹基线（风格可覆盖时长 / 曲线） */
.pressable { transition: transform .16s cubic-bezier(.2, .9, .3, 1); }
.pressable:active { transform: scale(.97); }

/* 长列表渐显 */
.fade-up { animation: fadeUp .42s cubic-bezier(.22, .85, .28, 1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
