/* ============================================================
   拾光小铺 · H5 顾客端
   暖纸 / 墨绿 / 黄铜 · 移动端单页应用
   ============================================================ */

:root {
  --paper: #f7f5ef;
  --paper-2: #f1ede4;
  --surface: #ffffff;
  --ink: #171b18;
  --ink-2: #3d453f;
  --muted: #737a73;
  --faint: #9aa097;
  --line: #e7e2d6;
  --line-soft: #f0ece3;

  --pine: #11453a;
  --pine-600: #1a5a4a;
  --pine-50: #e9f0ec;
  --brass: #b8924f;
  --brass-soft: #f3e8d5;
  --cream: #f6ecda;

  --ok: #2c7a5e;
  --warn: #a9752b;
  --danger: #a3433a;
  --info: #3a6b8c;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;

  --sh-sm: 0 1px 2px rgba(23, 27, 24, .05);
  --sh-md: 0 2px 6px rgba(23, 27, 24, .04), 0 14px 30px -22px rgba(23, 27, 24, .35);
  --sh-lg: 0 24px 60px -34px rgba(15, 40, 33, .5);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;

  --ease: cubic-bezier(.22, .7, .28, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 58px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: #eae6db;
  background-image:
    radial-gradient(700px 380px at 88% -6%, rgba(184, 146, 79, .18), transparent 70%),
    radial-gradient(620px 400px at 0% 0%, rgba(17, 69, 58, .10), transparent 66%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; font-weight: 600; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
svg { display: block; flex: none; }
input, select, textarea { outline: none; }

:focus-visible { outline: 2px solid var(--pine-600); outline-offset: 2px; }

/* ---------------- 框架 ---------------- */

#app { min-height: 100vh; min-height: 100dvh; }

.frame {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  background-image:
    radial-gradient(420px 240px at 100% 0%, rgba(184, 146, 79, .09), transparent 70%);
  background-repeat: no-repeat;
  overflow: hidden;
}

@media (min-width: 560px) {
  .frame {
    box-shadow: 0 0 0 1px rgba(23, 27, 24, .06), 0 40px 90px -50px rgba(15, 40, 33, .55);
    border-radius: 0;
  }
}

.view {
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 10px);
  min-height: 100vh;
  min-height: 100dvh;
}

.view.no-tab { padding-bottom: 0; }

.view-inner { animation: pageIn .3s var(--ease) both; }

/* 注意：这里只做透明度动画。
   若在祖先上动画 transform 且 fill-mode:both，
   Chrome 会使其成为内部 fixed 底栏的包含块，固定定位将失效。 */
@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------------- 通用 ---------------- */

.serif { font-family: var(--serif); letter-spacing: .01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11px; letter-spacing: .04em; }
.strong { font-weight: 600; }
.row { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap8 { gap: 8px; }
.gap12 { gap: 12px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.px { padding-left: 16px; padding-right: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
}

.section-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 22px 16px 10px;
}
.section-label h2 { font-size: 16px; letter-spacing: .01em; }
.section-label .count { font-size: 11.5px; color: var(--faint); letter-spacing: .06em; }
.section-label .more { margin-left: auto; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 2px; }

/* ---------------- 顶栏 ---------------- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 12px 0 8px;
  background: rgba(247, 245, 239, .9);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid rgba(231, 226, 214, .7);
}
.appbar .title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
}
.appbar .sub { font-size: 11px; color: var(--faint); letter-spacing: .08em; margin-top: -2px; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-2);
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.icon-btn:active { transform: scale(.94); background: rgba(17, 69, 58, .07); }
.icon-btn.is-plain { background: rgba(255, 255, 255, .72); border: 1px solid var(--line); }

.appbar .right { margin-left: auto; display: flex; align-items: center; gap: 2px; }

/* ---------------- 首页 ---------------- */

.home-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 16px;
  background: rgba(247, 245, 239, .88);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  transition: box-shadow .24s var(--ease), border-color .24s var(--ease);
  border-bottom: 1px solid transparent;
}
.home-top.is-stuck {
  border-bottom-color: rgba(231, 226, 214, .9);
  box-shadow: 0 6px 20px -18px rgba(23, 27, 24, .5);
}

.brandmark { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 6px 16px -10px rgba(17, 69, 58, .9); }
.brand-name { font-family: var(--serif); font-size: 17px; letter-spacing: .09em; line-height: 1.2; }
.brand-sub { font-size: 10px; letter-spacing: .16em; color: var(--faint); }

.home-top .actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }

.cart-btn { position: relative; }
.cart-btn .badge {
  position: absolute;
  top: 3px; right: 2px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--brass);
  color: #2c1e08;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px var(--paper);
}

/* Hero */
.hero {
  position: relative;
  margin: 6px 16px 0;
  padding: 18px 18px 15px;
  border-radius: var(--r-lg);
  overflow: hidden;
  color: #f2ede0;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(201, 160, 99, .34), transparent 52%),
    linear-gradient(150deg, #1b5244 0%, #123f35 42%, #0b2b24 100%);
  box-shadow: 0 18px 38px -26px rgba(11, 43, 36, .85);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, .10);
  pointer-events: none;
}
.hero-ring {
  position: absolute;
  width: 190px; height: 190px;
  right: -66px; top: -86px;
  border-radius: 50%;
  border: 1px solid rgba(232, 205, 158, .22);
}
.hero-ring::before {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  border: 1px solid rgba(232, 205, 158, .14);
}

.hero-status { display: flex; align-items: center; gap: 8px; position: relative; }
.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: .04em;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .14);
}
.live i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #7ddcae;
  box-shadow: 0 0 0 3px rgba(125, 220, 174, .16);
}
.live.is-off i { background: #d9a07a; box-shadow: 0 0 0 3px rgba(217, 160, 122, .14); }
.hero-time { font-size: 11.5px; color: rgba(242, 237, 224, .62); letter-spacing: .04em; }

.hero-title {
  position: relative;
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.28;
  letter-spacing: .06em;
  font-weight: 500;
}
.hero-title em { font-style: normal; color: #e6c48c; }
.hero-meta {
  position: relative;
  margin-top: 7px;
  font-size: 11.5px;
  color: rgba(242, 237, 224, .55);
  letter-spacing: .04em;
}

.hero-stats {
  position: relative;
  display: flex;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.hero-stats > div { flex: 1; }
.hero-stats > div + div { border-left: 1px solid rgba(255, 255, 255, .1); padding-left: 14px; }
.hero-stats span { display: block; font-size: 10.5px; color: rgba(242, 237, 224, .5); letter-spacing: .08em; }
.hero-stats b {
  display: block;
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #f4ead6;
}

.hero-notice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, .13);
  font-size: 11.5px;
  line-height: 1.5;
  color: rgba(242, 237, 224, .62);
}
.hero-notice svg { margin-top: 1px; opacity: .7; }

/* 分类 */
.chips-wrap {
  position: sticky;
  top: 54px;
  z-index: 20;
  background: linear-gradient(180deg, var(--paper) 72%, rgba(247, 245, 239, 0));
  padding: 12px 0 10px;
}
.chips {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  white-space: nowrap;
  transition: all .2s var(--ease);
}
.chip svg { opacity: .62; }
.chip.is-active {
  background: var(--pine);
  border-color: var(--pine);
  color: #f4ecd9;
  box-shadow: 0 8px 18px -12px rgba(17, 69, 58, .8);
}
.chip.is-active svg { opacity: .95; }
.chip:active { transform: scale(.97); }

/* 商品网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  padding: 2px 16px 0;
}
@media (min-width: 430px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10px 10px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--sh-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
  animation: cardIn .42s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 26ms);
}
.pcard:active { transform: scale(.983); border-color: #ddd5c3; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.pcard.is-out { opacity: .56; }
.pcard.is-out:active { transform: none; }

.thumb {
  position: relative;
  aspect-ratio: 1 / .92;
  border-radius: 13px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 20% 10%, rgba(255, 255, 255, .55), transparent 60%);
}
.thumb svg { position: relative; z-index: 1; opacity: .88; }

.t-snack { background: linear-gradient(150deg, #fbf0dd, #f2dfc0); color: #9a6c2c; }
.t-drink { background: linear-gradient(150deg, #e7f0ea, #d6e7dd); color: #356b57; }
.t-noodle { background: linear-gradient(150deg, #fbe9df, #f4d8c8); color: #9c5c3c; }
.t-ice { background: linear-gradient(150deg, #e6eef4, #d6e5f0); color: #40667f; }
.t-box { background: linear-gradient(150deg, #efece4, #e2ddd0); color: #70685a; }
.t-gift { background: linear-gradient(150deg, #f7e9ec, #efd9df); color: #9a5566; }
.t-sparkle { background: linear-gradient(150deg, #f3ecf6, #e6dcef); color: #6f5b8c; }

.pcard-name {
  margin-top: 9px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}
.pcard-spec { margin-top: 2px; font-size: 11px; color: var(--faint); letter-spacing: .02em; }

.pcard-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
}
.price {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--pine);
  line-height: 1;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}
.price i { font-style: normal; font-size: 11.5px; margin-right: 1px; opacity: .8; }

.add-btn {
  width: 27px; height: 27px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--pine);
  color: #f7f1e1;
  box-shadow: 0 6px 14px -8px rgba(17, 69, 58, .9);
  transition: transform .16s var(--ease), background .16s var(--ease);
}
.add-btn:active { transform: scale(.9); }
.add-btn[disabled] { background: var(--line); color: var(--faint); box-shadow: none; }

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 27px;
  padding: 2px;
  border-radius: 999px;
  background: var(--pine-50);
  border: 1px solid #d7e3dc;
}
.stepper button {
  width: 23px; height: 23px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--pine);
}
.stepper button:active { background: rgba(17, 69, 58, .1); }
.stepper .q {
  min-width: 17px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--pine);
  font-variant-numeric: tabular-nums;
}

.hot-tag {
  position: absolute;
  top: 6px; left: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 19px;
  padding: 0 6px 0 5px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .82);
  color: #9a5a2a;
  font-size: 9.5px;
  letter-spacing: .04em;
  backdrop-filter: blur(4px);
}

.soldout-mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: rgba(247, 245, 239, .55);
  font-size: 11px;
  color: #6f6656;
  letter-spacing: .08em;
}

/* 搜索无结果 / 空状态 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 52px 24px;
  text-align: center;
  color: var(--muted);
}
.empty .ring {
  width: 66px; height: 66px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper-2);
  color: #b4aa96;
  margin-bottom: 4px;
}
.empty h3 { font-size: 15px; color: var(--ink-2); }
.empty p { font-size: 12.5px; color: var(--faint); max-width: 230px; line-height: 1.6; }

/* ---------------- 悬浮购物车 ---------------- */

.cartbar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--safe-b) + 10px);
  transform: translateX(-50%);
  z-index: 40;
  width: min(448px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 11px;
  height: 56px;
  padding: 0 10px 0 12px;
  border-radius: 999px;
  color: #f5efdf;
  background: linear-gradient(135deg, #1a5144, #0d3129);
  box-shadow: 0 16px 34px -16px rgba(11, 43, 36, .75), inset 0 1px 0 rgba(255, 255, 255, .1);
  animation: barUp .32s var(--ease) both;
}
@keyframes barUp {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.cartbar .bag { position: relative; display: grid; place-items: center; width: 34px; height: 34px; }
.cartbar .bag em {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #d8b072;
  color: #2b1d07;
  font-size: 9.5px;
  font-style: normal;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px #123f35;
}
.cartbar .sum { display: flex; flex-direction: column; line-height: 1.15; }
.cartbar .sum b { font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: .02em; }
.cartbar .sum span { font-size: 10px; color: rgba(245, 239, 223, .55); letter-spacing: .04em; }
.cartbar .go {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: #e7c893;
  color: #26301f;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
}
.cartbar .go.is-dim { background: rgba(245, 239, 223, .2); color: rgba(245, 239, 223, .8); }

/* ---------------- 底部标签栏 ---------------- */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 45;
  width: 100%;
  max-width: 480px;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: rgba(250, 248, 242, .93);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-top: 1px solid rgba(231, 226, 214, .9);
}
.tabbar[hidden] { display: none; }
.tabbar a {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--faint);
  transition: color .2s var(--ease);
}
.tabbar a.is-active { color: var(--pine); }
.tabbar a.is-active svg { stroke-width: 1.9; }
.tabbar a .dot {
  position: absolute;
  top: 6px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--brass);
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.tabbar a.is-active .dot { opacity: 1; }
.tabbar .badge {
  position: absolute;
  top: 2px;
  left: 50%;
  margin-left: 5px;
  min-width: 15px; height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--brass);
  color: #2c1e08;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ---------------- 商品详情 ---------------- */

.pd-hero {
  position: relative;
  padding: 8px 16px 0;
}
.pd-stage {
  position: relative;
  height: 216px;
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(23, 27, 24, .05);
}
.pd-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 70% at 50% 0%, rgba(255, 255, 255, .7), transparent 65%);
}
.pd-stage svg { position: relative; }
.pd-back {
  position: absolute;
  top: 18px; left: 14px;
  z-index: 5;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .7);
  color: var(--ink);
  box-shadow: var(--sh-sm);
}
.pd-back svg { position: relative; }

.pd-body { padding: 18px 16px 0; }
.pd-cat { font-size: 10.5px; letter-spacing: .18em; color: var(--brass); text-transform: uppercase; }
.pd-title { margin-top: 7px; font-family: var(--serif); font-size: 24px; line-height: 1.3; font-weight: 600; letter-spacing: .02em; }
.pd-spec { margin-top: 5px; font-size: 12.5px; color: var(--faint); }
.pd-price { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.pd-price .price { font-size: 27px; }
.pd-price .unit { font-size: 11.5px; color: var(--faint); }

.pd-facts {
  display: flex;
  gap: 26px;
  margin-top: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.pd-facts div span { display: block; font-size: 10.5px; color: var(--faint); letter-spacing: .08em; }
.pd-facts div b { display: block; margin-top: 2px; font-size: 14px; font-variant-numeric: tabular-nums; }

.pd-desc { margin-top: 16px; font-size: 13.5px; line-height: 1.75; color: var(--ink-2); }
.pd-desc.empty-desc { color: var(--faint); }

.pd-related { display: flex; gap: 10px; overflow-x: auto; padding: 2px 16px 6px; scrollbar-width: none; }
.pd-related::-webkit-scrollbar { display: none; }
.pd-related .mini {
  width: 116px;
  flex: none;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.pd-related .mini .thumb { aspect-ratio: 1 / .82; border-radius: 10px; }
.pd-related .mini h4 { margin-top: 7px; font-size: 12.5px; line-height: 1.35; height: 34px; overflow: hidden; }
.pd-related .mini .price { margin-top: 4px; font-size: 14px; }

.pd-buybar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 42;
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px calc(10px + var(--safe-b));
  background: rgba(250, 248, 242, .94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.pd-buybar .stepper { height: 38px; padding: 3px; }
.pd-buybar .stepper button { width: 32px; height: 32px; }
.pd-buybar .stepper .q { min-width: 24px; font-size: 14px; }
.pd-buybar .btn { flex: 1; }

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .02em;
  background: var(--pine);
  color: #f6f0df;
  box-shadow: 0 12px 24px -16px rgba(17, 69, 58, .9);
  transition: transform .16s var(--ease), opacity .16s var(--ease), background .16s var(--ease);
}
.btn:active { transform: scale(.985); }
.btn[disabled] { background: #dcd6c8; color: #8e8878; box-shadow: none; }
.btn.brass { background: #e7c893; color: #26301f; }
.btn.ghost { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); box-shadow: none; }
.btn.text { background: none; color: var(--muted); box-shadow: none; height: auto; padding: 6px 2px; font-weight: 500; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 12.5px; }
.btn.block { display: flex; width: 100%; }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid #ecd8d4; box-shadow: none; }

/* ---------------- 购物车 / 结算 ---------------- */

.stack { padding: 14px 16px 0; display: flex; flex-direction: column; gap: 12px; }

.line-item {
  display: flex;
  gap: 11px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.line-item .thumb { width: 58px; height: 58px; flex: none; border-radius: 12px; aspect-ratio: auto; }
.line-item .thumb svg { width: 22px; height: 22px; }
.line-item h4 { font-size: 14px; font-weight: 600; line-height: 1.4; }
.line-item .meta { margin-top: 3px; font-size: 11.5px; color: var(--faint); }
.line-item .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.line-item .price { font-size: 15.5px; }

.sum-card { padding: 14px 15px; }
.sum-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; padding: 5px 0; color: var(--ink-2); }
.sum-row .num { font-variant-numeric: tabular-nums; }
.sum-row.total { margin-top: 8px; padding-top: 11px; border-top: 1px dashed var(--line); font-size: 14px; }
.sum-row.total b { font-family: var(--serif); font-size: 20px; color: var(--pine); }

.checkout-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 42;
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px calc(10px + var(--safe-b));
  background: rgba(250, 248, 242, .95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.checkout-bar .total { line-height: 1.15; }
.checkout-bar .total span { display: block; font-size: 10.5px; color: var(--faint); letter-spacing: .06em; }
.checkout-bar .total b { font-family: var(--serif); font-size: 22px; color: var(--pine); letter-spacing: .01em; }
.checkout-bar .btn { margin-left: auto; min-width: 132px; }

.banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 13px;
  border-radius: 13px;
  font-size: 12.5px;
  line-height: 1.55;
  background: #fbf3e4;
  border: 1px solid #f0e0c4;
  color: #8a6425;
}
.banner.danger { background: #fbf0ee; border-color: #f0d9d4; color: #94413a; }
.banner.info { background: var(--pine-50); border-color: #d9e6df; color: #2f6a58; }
.banner svg { margin-top: 1px; }

/* 表单 */
.field { display: block; }
.field + .field { margin-top: 0; }
.field label { display: block; font-size: 11px; letter-spacing: .1em; color: var(--faint); margin-bottom: 5px; }
.input, .select, .textarea {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
  appearance: none;
  -webkit-appearance: none;
}
.textarea { height: 76px; padding: 11px 13px; resize: none; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  border-color: #b9cdc2;
  box-shadow: 0 0 0 3px rgba(17, 69, 58, .07);
}
.input::placeholder, .textarea::placeholder { color: #b6b1a4; }
.select {
  background-image: linear-gradient(45deg, transparent 50%, #8d9389 50%), linear-gradient(135deg, #8d9389 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.panel { padding: 15px; }
.panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--faint);
  margin-bottom: 12px;
}
.panel-title svg { opacity: .7; }

/* ---------------- 订单 ---------------- */

.segmented {
  display: flex;
  gap: 6px;
  padding: 12px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
  transition: all .18s var(--ease);
}
.segmented button.is-active { background: var(--pine); border-color: var(--pine); color: #f4ecd9; }

.ocard {
  display: block;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
}
.ocard-head { display: flex; align-items: center; gap: 8px; }
.ocard-head .no { font-size: 11px; color: var(--faint); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.status-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: .04em;
  border: 1px solid transparent;
}
.tone-warn { color: #8f6420; background: #fbf3e2; border-color: #f0e1c2; }
.tone-info { color: #2f5c7c; background: #edf3f8; border-color: #d9e5ee; }
.tone-brand { color: #16564a; background: var(--pine-50); border-color: #d6e4dd; }
.tone-ok { color: #2a6b52; background: #eaf4ee; border-color: #d5e8dd; }
.tone-muted { color: var(--muted); background: var(--paper-2); border-color: var(--line); }

.ocard-items { display: flex; align-items: center; gap: 8px; margin-top: 11px; }
.ocard-items .ic {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
}
.ocard-items .names { flex: 1; min-width: 0; font-size: 13px; line-height: 1.4; }
.ocard-items .names .sub { font-size: 11px; color: var(--faint); margin-top: 1px; }
.ocard-foot { display: flex; align-items: baseline; gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.ocard-foot .t { margin-left: auto; font-size: 11px; color: var(--faint); }
.ocard-foot b { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.ocard-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* 订单详情 */
.od-hero {
  padding: 22px 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.od-hero .badge-icon {
  width: 52px; height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
}
.od-hero h2 { font-family: var(--serif); font-size: 21px; letter-spacing: .02em; }
.od-hero p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.od-hero.tone-warn-bg { background: linear-gradient(180deg, #fbf5e8, transparent); }
.od-hero.tone-ok-bg { background: linear-gradient(180deg, #edf6f1, transparent); }
.od-hero.tone-brand-bg { background: linear-gradient(180deg, #eef4f1, transparent); }

.timeline { padding: 2px 16px 0; }
.tl-item { position: relative; display: flex; gap: 13px; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: 7px; top: 16px; bottom: 0;
  width: 1px;
  background: var(--line);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  position: relative;
  z-index: 1;
  width: 15px; height: 15px;
  flex: none;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--line);
}
.tl-item.is-done .tl-dot { background: var(--pine); border-color: var(--pine); }
.tl-item.is-done .tl-dot::after {
  content: "";
  position: absolute;
  left: 4px; top: 3.4px;
  width: 5px; height: 8px;
  border: 1.5px solid #f7f2e4;
  border-top: 0; border-left: 0;
  transform: rotate(42deg);
}
.tl-item.is-current .tl-dot { background: #fff; border-color: var(--brass); box-shadow: 0 0 0 4px rgba(184, 146, 79, .14); }
.tl-body { flex: 1; }
.tl-body h4 { font-size: 13.5px; color: var(--ink-2); }
.tl-item:not(.is-done) .tl-body h4 { color: var(--faint); font-weight: 500; }
.tl-body time { display: block; margin-top: 2px; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }

.kv { display: flex; gap: 10px; font-size: 13px; padding: 5px 0; }
.kv .k { width: 62px; flex: none; color: var(--faint); font-size: 12px; }
.kv .v { flex: 1; color: var(--ink-2); word-break: break-all; }
.kv .v.num { text-align: right; }

.copy-no {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.copy-no:active { color: var(--pine); }

/* ---------------- 钱包 ---------------- */

.balance-card {
  position: relative;
  margin: 14px 16px 0;
  padding: 20px 18px 16px;
  border-radius: var(--r-lg);
  color: #f4eedf;
  overflow: hidden;
  background:
    radial-gradient(110% 130% at 96% -10%, rgba(201, 160, 99, .4), transparent 55%),
    linear-gradient(150deg, #1b5244 0%, #123f35 46%, #0b2b24 100%);
  box-shadow: 0 20px 42px -28px rgba(11, 43, 36, .9);
}
.balance-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, .1);
}
.balance-card .label { font-size: 10.5px; letter-spacing: .18em; color: rgba(244, 238, 223, .55); }
.balance-card .amount {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}
.balance-card .amount i { font-style: normal; font-size: 19px; margin-right: 3px; opacity: .8; }
.balance-card .meta { display: flex; gap: 26px; margin-top: 18px; padding-top: 13px; border-top: 1px solid rgba(255, 255, 255, .12); }
.balance-card .meta span { display: block; font-size: 10px; color: rgba(244, 238, 223, .5); letter-spacing: .1em; }
.balance-card .meta b { display: block; margin-top: 3px; font-family: var(--serif); font-size: 16px; font-weight: 600; }
.balance-card .coin-deco {
  position: absolute;
  right: 16px; top: 18px;
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(231, 200, 147, .35);
  color: #e4c48e;
}

.redeem { display: flex; gap: 9px; margin-top: 11px; }
.redeem .input { flex: 1; text-transform: uppercase; letter-spacing: .12em; font-size: 13px; font-variant-numeric: tabular-nums; }
.redeem .btn { height: 44px; padding: 0 18px; flex: none; }

.log-item { display: flex; align-items: center; gap: 11px; padding: 12px 15px; }
.log-item + .log-item { border-top: 1px solid var(--line-soft); }
.log-ic {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--paper-2);
  color: var(--muted);
}
.log-ic.in { background: #eaf4ee; color: var(--ok); }
.log-item h4 { font-size: 13px; font-weight: 500; line-height: 1.4; }
.log-item time { font-size: 11px; color: var(--faint); }
.log-item .amt { margin-left: auto; font-family: var(--serif); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.log-item .amt.in { color: var(--ok); }

/* ---------------- 我的 ---------------- */

.me-head {
  position: relative;
  padding: 26px 16px 22px;
  color: #f4eedf;
  background:
    radial-gradient(100% 120% at 100% 0%, rgba(201, 160, 99, .32), transparent 55%),
    linear-gradient(160deg, #1b5244, #0e332b 70%);
  overflow: hidden;
}
.me-head::after {
  content: "";
  position: absolute;
  width: 220px; height: 220px;
  right: -90px; top: -110px;
  border-radius: 50%;
  border: 1px solid rgba(231, 200, 147, .2);
}
.avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 22px;
  color: #402d10;
  background: linear-gradient(140deg, #f6e4c4, #ddbc84);
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, .8);
  flex: none;
}
.me-name { font-family: var(--serif); font-size: 20px; letter-spacing: .03em; }
.me-sub { font-size: 11.5px; color: rgba(244, 238, 223, .55); margin-top: 3px; letter-spacing: .03em; }
.me-role {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 9.5px;
  letter-spacing: .1em;
  background: rgba(231, 200, 147, .18);
  border: 1px solid rgba(231, 200, 147, .3);
  color: #e7cd9f;
}

.menu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 15px;
  font-size: 14px;
  text-align: left;
  color: var(--ink-2);
}
.menu-item + .menu-item { border-top: 1px solid var(--line-soft); }
.menu-item .mi {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--paper-2);
  color: #6f766d;
  flex: none;
}
.menu-item .arrow { margin-left: auto; color: #c3bcae; }
.menu-item .hint { margin-left: auto; font-size: 12px; color: var(--faint); }
.menu-item:active { background: #fbf9f4; }

/* ---------------- 登录 ---------------- */

.auth {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 26px calc(28px + var(--safe-b));
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(520px 320px at 100% 0%, rgba(184, 146, 79, .14), transparent 70%),
    radial-gradient(420px 300px at 0% 10%, rgba(17, 69, 58, .07), transparent 65%);
}
.auth-top { padding-top: 22px; display: flex; align-items: center; justify-content: space-between; }
.auth-brand { margin-top: 38px; }
.auth-brand .mark { width: 46px; height: 46px; border-radius: 14px; box-shadow: 0 10px 22px -14px rgba(17, 69, 58, .9); }
.auth-brand h1 { margin-top: 18px; font-family: var(--serif); font-size: 30px; line-height: 1.3; letter-spacing: .04em; font-weight: 600; }
.auth-brand p { margin-top: 7px; font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }

.auth-form { margin-top: 30px; display: flex; flex-direction: column; gap: 12px; }
.auth-form .input { height: 48px; border-radius: 13px; background: rgba(255, 255, 255, .8); }
.auth-form .btn { height: 48px; margin-top: 6px; }
.auth-alt { margin-top: 20px; text-align: center; font-size: 12.5px; color: var(--muted); }
.auth-alt b { color: var(--pine); font-weight: 600; }
.auth-foot { margin-top: auto; padding-top: 30px; text-align: center; font-size: 10.5px; color: #b3ada0; letter-spacing: .1em; }

/* ---------------- 搜索浮层 / 弹层 ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 26, 22, .38);
  backdrop-filter: blur(3px);
  opacity: 0;
  animation: fadeIn .22s var(--ease) forwards;
}
@keyframes fadeIn { to { opacity: 1; } }
.overlay.is-closing { animation: fadeOut .18s var(--ease) forwards; }
@keyframes fadeOut { to { opacity: 0; } }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 81;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -20px 60px -30px rgba(11, 43, 36, .6);
  animation: sheetUp .3s var(--ease) both;
  padding-bottom: calc(18px + var(--safe-b));
}
@keyframes sheetUp {
  from { transform: translate(-50%, 100%); }
  to { transform: translate(-50%, 0); }
}
.sheet.is-closing { animation: sheetDown .22s var(--ease) forwards; }
@keyframes sheetDown {
  to { transform: translate(-50%, 100%); }
}
.sheet-grab { width: 38px; height: 4px; border-radius: 99px; background: #ddd6c7; margin: 9px auto 0; }
.sheet-body { padding: 16px 18px 4px; }
.sheet h3 { font-family: var(--serif); font-size: 19px; letter-spacing: .02em; }
.sheet p { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.sheet-actions { display: flex; gap: 10px; padding: 16px 18px 2px; }
.sheet-actions .btn { flex: 1; }

.search-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 12px;
  background: var(--paper);
}
.search-input {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.search-input input { flex: 1; min-width: 0; border: 0; background: none; font-size: 14px; }
.search-input svg { color: var(--faint); }
.search-body { padding: 2px 14px calc(18px + var(--safe-b)); }
.search-body .grid { padding: 0; }
.search-tip { padding: 26px 8px; font-size: 12.5px; color: var(--faint); line-height: 1.7; }
.search-tip b { color: var(--ink-2); font-weight: 600; }

/* 提示 / 骨架 */
.toast {
  position: fixed;
  left: 50%;
  top: 64px;
  transform: translate(-50%, -8px);
  z-index: 120;
  max-width: min(400px, calc(100% - 40px));
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(23, 27, 24, .92);
  color: #f6f1e4;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 16px 34px -20px rgba(0, 0, 0, .8);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-err { background: rgba(140, 55, 47, .95); }

.skeleton {
  border-radius: 14px;
  background: linear-gradient(100deg, #efece4 30%, #f7f4ec 48%, #efece4 66%);
  background-size: 240% 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer {
  from { background-position: 120% 0; }
  to { background-position: -40% 0; }
}
.sk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; padding: 16px; }
.sk-grid .skeleton { height: 196px; }

.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--paper);
  transition: opacity .4s var(--ease), visibility .4s;
}
.splash.is-off { opacity: 0; visibility: hidden; }
.splash .mark { width: 52px; height: 52px; border-radius: 15px; animation: breathe 1.8s var(--ease) infinite; }
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: .82; }
}

.fade-list > * { animation: cardIn .34s var(--ease) both; }
.fade-list > *:nth-child(2) { animation-delay: .04s; }
.fade-list > *:nth-child(3) { animation-delay: .08s; }
.fade-list > *:nth-child(4) { animation-delay: .12s; }
.fade-list > *:nth-child(5) { animation-delay: .16s; }
.fade-list > *:nth-child(6) { animation-delay: .2s; }

.safe-top { height: env(safe-area-inset-top, 0px); }

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

/* ---------------- 补充：个人中心 / 列表 ---------------- */

.me-guest { padding: 42px 26px 18px; text-align: center; }
.me-guest .brandmark { margin: 0 auto; }
.me-guest .btn { min-width: 108px; }

.me-addr {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 12px;
  color: rgba(244, 238, 223, .66);
  letter-spacing: .02em;
}
.me-addr svg { opacity: .55; }

.qty-slot { display: flex; align-items: center; }

/* 让固定底栏不遮住内容 */
.stack:last-child { padding-bottom: 2px; }

/* hidden 属性优先（覆盖 display:flex 类） */
[hidden] { display: none !important; }
