:root {
  --brand: #ff5a1f;
  --brand-2: #ff9f43;
  --brand-soft: #fff1e8;
  --ink: #1c1b20;
  --sub: #55545e;
  --muted: #92909c;
  --line: #eeeae4;
  --bg: #f6f3ee;
  --card: #ffffff;
  --green: #0fae6e;
  --gold: #f3cf8b;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(28, 27, 32, 0.07);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #e9e5df;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; }

.stage { min-height: 100vh; display: flex; justify-content: center; background: radial-gradient(1200px 600px at 50% -10%, #f3e7db, #e7e2da 70%); }
.phone {
  position: relative; width: 100%; max-width: 480px; min-height: 100vh;
  background: var(--bg); overflow-x: hidden;
  box-shadow: 0 0 60px rgba(0,0,0,.12);
}
@media (min-width: 520px) { .phone { margin: 18px 0; min-height: calc(100vh - 36px); border-radius: 26px; overflow: hidden; } }

.view { padding-bottom: calc(76px + var(--safe-b)); min-height: 100vh; }
.view.no-tab { padding-bottom: 24px; }

/* ---------- 顶部 ---------- */
.hero {
  background: linear-gradient(140deg, #ff7a3d 0%, #ff5a1f 45%, #f0452a 100%);
  color: #fff; padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 46px;
  border-radius: 0 0 26px 26px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -50px; top: -70px; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,.28), transparent 65%); border-radius: 50%;
}
.hero-top { display: flex; align-items: center; gap: 10px; position: relative; z-index: 2; }
.city { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 3px; opacity: .95; }
.hero-top .spacer { flex: 1; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.18); color: #fff; font-size: 14px;
  display: grid; place-items: center;
}
.search {
  margin-top: 14px; height: 40px; border-radius: 20px; background: rgba(255,255,255,.96);
  display: flex; align-items: center; gap: 8px; padding: 0 14px; position: relative; z-index: 2;
  box-shadow: 0 4px 14px rgba(150,40,0,.14);
}
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 13px; color: var(--ink); }
.search input::placeholder { color: #b3aeb0; }
.search .go { font-size: 12px; color: var(--brand); font-weight: 700; background: none; border: 0; }

.hero-title { margin: 16px 0 4px; font-size: 22px; font-weight: 800; letter-spacing: .5px; position: relative; z-index: 2; }
.hero-sub { font-size: 12.5px; opacity: .9; position: relative; z-index: 2; }

/* ---------- 轮播 ---------- */
.banner-wrap { margin: -32px 14px 0; position: relative; z-index: 3; }
.carousel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.banner {
  flex: 0 0 100%; scroll-snap-align: center; border-radius: 18px; padding: 18px;
  color: #fff; min-height: 118px; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden; box-shadow: 0 10px 24px rgba(120,60,20,.18);
}
.banner.sunset { background: linear-gradient(120deg, #ff8a4c, #ff3d68); }
.banner.ocean { background: linear-gradient(120deg, #3d8bff, #00c2d1); }
.banner.forest { background: linear-gradient(120deg, #17b978, #6ed47c); }
.banner.dark { background: linear-gradient(120deg, #2b2b33, #5a4636); }
.banner b { font-size: 19px; font-weight: 800; letter-spacing: .4px; }
.banner span { font-size: 12px; opacity: .92; margin-top: 6px; }
.banner .deco { position: absolute; right: 10px; bottom: -12px; font-size: 74px; opacity: .22; }
.dots { display: flex; gap: 5px; justify-content: center; margin-top: 10px; }
.dots i { width: 5px; height: 5px; border-radius: 3px; background: #d8d1c8; transition: .25s; }
.dots i.on { width: 16px; background: var(--brand); }

/* ---------- 会员条 ---------- */
.vip-strip {
  margin: 14px; border-radius: 16px; padding: 13px 14px; display: flex; align-items: center; gap: 12px;
  background: linear-gradient(100deg, #2a2930, #43382c 65%, #6b5137); color: #fff;
  box-shadow: 0 8px 22px rgba(40,30,20,.2); position: relative; overflow: hidden;
}
.vip-strip::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent, rgba(255,214,150,.16)); }
.vip-strip .vip-ico { font-size: 22px; }
.vip-strip .vip-main { flex: 1; position: relative; z-index: 2; }
.vip-strip .vip-main b { font-size: 13.5px; color: var(--gold); letter-spacing: .3px; }
.vip-strip .vip-main p { margin: 3px 0 0; font-size: 11px; opacity: .72; }
.vip-strip .vip-go {
  position: relative; z-index: 2; border: 0; border-radius: 20px; padding: 8px 15px;
  background: linear-gradient(120deg, #f7d9a4, #e8b872); color: #4a3418; font-size: 12px; font-weight: 800;
}

/* ---------- 金刚区 ---------- */
.cats { margin: 16px 10px 6px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 0; }
.cat { text-align: center; font-size: 11.5px; color: var(--sub); }
.cat .ci {
  width: 48px; height: 48px; margin: 0 auto 7px; border-radius: 16px; display: grid; place-items: center;
  font-size: 23px; background: #fff; box-shadow: var(--shadow);
}
.cat:hover .ci { transform: translateY(-2px); transition: .2s; }
.cat:nth-child(1) .ci { background: linear-gradient(145deg,#fff3e4,#ffe0c4); }
.cat:nth-child(2) .ci { background: linear-gradient(145deg,#e8f7ef,#d2f0e0); }
.cat:nth-child(3) .ci { background: linear-gradient(145deg,#e8f1ff,#d5e6ff); }
.cat:nth-child(4) .ci { background: linear-gradient(145deg,#fff0e8,#ffdccc); }
.cat:nth-child(5) .ci { background: linear-gradient(145deg,#f3ecff,#e6dbff); }
.cat:nth-child(6) .ci { background: linear-gradient(145deg,#fff6dc,#ffe9b5); }
.cat:nth-child(7) .ci { background: linear-gradient(145deg,#ffeef0,#ffd9de); }
.cat:nth-child(8) .ci { background: linear-gradient(145deg,#e9f7ff,#d2edff); }

/* ---------- 通用区块 ---------- */
.sec { margin: 18px 14px; }
.sec-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.sec-head h3 { margin: 0; font-size: 16px; letter-spacing: .3px; }
.sec-head span { font-size: 11px; color: var(--muted); }
.sec-head .more { margin-left: auto; font-size: 11.5px; color: var(--muted); }

/* ---------- 商品卡 ---------- */
.goods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pcard {
  background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; position: relative;
}
.pcard .thumb {
  height: 96px; display: grid; place-items: center; font-size: 42px;
  background: linear-gradient(145deg,#fff6ec,#ffe9d6);
}
.pcard.t2 .thumb { background: linear-gradient(145deg,#eefaf2,#d9f2e3); }
.pcard.t3 .thumb { background: linear-gradient(145deg,#eef4ff,#dbe8ff); }
.pcard.t4 .thumb { background: linear-gradient(145deg,#fff3f5,#ffe1e6); }
.pcard .body { padding: 9px 10px 11px; }
.pcard .name { font-size: 12.5px; font-weight: 600; line-height: 1.35; height: 34px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pcard .tagline { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.tag { font-size: 9.5px; padding: 2px 5px; border-radius: 4px; background: var(--brand-soft); color: #e2571f; }
.tag.green { background: #e7f8f0; color: #0b9a61; }
.price-row { display: flex; align-items: baseline; gap: 5px; margin-top: 8px; }
.price { color: var(--brand); font-weight: 800; font-size: 17px; letter-spacing: -.3px; }
.price i { font-size: 10.5px; font-style: normal; font-weight: 700; margin-right: 1px; }
.official { font-size: 10.5px; color: #b7b3ae; text-decoration: line-through; }
.save { font-size: 9px; background: #fff0e6; color: #e2571f; padding: 1px 4px; border-radius: 3px; margin-left: auto; }
.ribbon {
  position: absolute; left: 0; top: 10px; background: linear-gradient(90deg,#ff5a1f,#ff8a3d);
  color: #fff; font-size: 9.5px; padding: 2px 7px; border-radius: 0 8px 8px 0; font-weight: 600;
}

/* ---------- 列表行 ---------- */
.rows { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .ri { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 19px; background: #f8f4ee; }
.row .rm { flex: 1; min-width: 0; }
.row .rm b { font-size: 13px; font-weight: 600; display: block; }
.row .rm p { margin: 3px 0 0; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .rv { font-size: 12px; color: var(--muted); }
.row .arrow { color: #c9c4bd; font-size: 14px; }
.discount-pill { font-size: 10.5px; color: #e2571f; background: var(--brand-soft); padding: 3px 7px; border-radius: 6px; font-weight: 700; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  height: calc(58px + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(255,255,255,.94); backdrop-filter: blur(14px);
  border-top: 1px solid #f0ece6; display: flex; z-index: 60;
}
@media (min-width: 520px) { .tabbar { bottom: 18px; border-radius: 0 0 26px 26px; } }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #a5a1a9; }
.tabbar a .ti { font-size: 19px; filter: grayscale(.5); opacity: .75; }
.tabbar a em { font-style: normal; font-size: 10px; }
.tabbar a.active { color: var(--brand); font-weight: 700; }
.tabbar a.active .ti { filter: none; opacity: 1; transform: translateY(-1px); }

/* ---------- 卡包 / 卡面 ---------- */
.page-head { padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 12px; display: flex; align-items: center; gap: 10px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.page-head h1 { font-size: 16.5px; margin: 0; }
.page-head .back { border: 0; background: none; font-size: 18px; padding: 0 2px; }
.page-head .spacer { flex: 1; }

.bigcard {
  margin: 18px 14px; border-radius: 20px; padding: 20px; color: #f8e5c1; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #2a2930 0%, #3d3228 55%, #6d5137 100%);
  box-shadow: 0 14px 34px rgba(40,28,15,.28); min-height: 168px;
}
.bigcard::before { content: ""; position: absolute; right: -60px; top: -60px; width: 210px; height: 210px; border-radius: 50%; background: radial-gradient(circle, rgba(255,214,150,.25), transparent 65%); }
.bigcard::after { content: "省着花"; position: absolute; right: 16px; bottom: 10px; font-size: 44px; font-weight: 900; color: rgba(255,255,255,.055); letter-spacing: 2px; }
.bigcard .bc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.bigcard .bc-name { font-size: 15px; font-weight: 700; color: #ffe6b8; letter-spacing: .4px; }
.bigcard .bc-badge { font-size: 9.5px; border: 1px solid rgba(255,220,160,.5); color: #ffd9a0; padding: 3px 8px; border-radius: 20px; }
.bigcard .bc-balance { margin-top: 26px; font-size: 11px; opacity: .68; }
.bigcard .bc-balance b { display: block; font-size: 30px; font-weight: 800; margin-top: 2px; color: #fff; letter-spacing: -.5px; }
.bigcard .bc-balance b i { font-size: 14px; font-style: normal; margin-right: 2px; opacity: .8; }
.bigcard .bc-foot { display: flex; justify-content: space-between; font-size: 10.5px; opacity: .7; margin-top: 16px; }

.benefit-list { display: grid; gap: 8px; }
.benefit { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--sub); }
.benefit .ck { color: var(--green); font-weight: 800; }

/* ---------- 商家核销码 ---------- */
.verify-card {
  margin: -4px 14px 4px; background: #fff; border-radius: 18px; padding: 18px 16px 15px;
  box-shadow: var(--shadow); border: 1px dashed #ffc9ad; text-align: center; position: relative;
}
.verify-card::before, .verify-card::after {
  content: ""; position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); transform: translateY(-50%);
}
.verify-card::before { left: -8px; }
.verify-card::after { right: -8px; }
.vc-label { font-size: 11px; color: var(--muted); letter-spacing: .5px; }
.vc-code {
  font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 34px; font-weight: 800;
  letter-spacing: 5px; color: var(--ink); margin: 8px 0 6px; padding-left: 5px;
}
.vc-hint { font-size: 10.5px; color: var(--muted); line-height: 1.6; margin: 0 auto 10px; max-width: 280px; }

/* ---------- 我的 ---------- */
.mine-hero { background: linear-gradient(150deg, #ff7a3d, #ff4f2e); padding: calc(24px + env(safe-area-inset-top, 0px)) 20px 58px; color: #fff; border-radius: 0 0 26px 26px; position: relative; }
.mine-user { display: flex; align-items: center; gap: 13px; }
.avatar { width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: 27px; border: 2px solid rgba(255,255,255,.5); }
.mine-user b { font-size: 17px; display: block; }
.mine-user p { margin: 4px 0 0; font-size: 11.5px; opacity: .88; }
.mine-stats { display: flex; background: #fff; margin: -40px 14px 0; border-radius: 16px; padding: 15px 0; box-shadow: var(--shadow); position: relative; z-index: 3; }
.mine-stats div { flex: 1; text-align: center; position: relative; }
.mine-stats div + div::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.mine-stats b { display: block; font-size: 18px; color: var(--ink); }
.mine-stats span { font-size: 10.5px; color: var(--muted); }

/* ---------- 按钮 ---------- */
.btn {
  border: 0; border-radius: 24px; padding: 12px 18px; font-size: 14px; font-weight: 700;
  background: linear-gradient(100deg, #ff7a3d, #ff4f2e); color: #fff;
  box-shadow: 0 8px 20px rgba(255,79,46,.28); width: 100%;
}
.btn:active { transform: scale(.985); }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid #ffd6c4; box-shadow: none; }
.btn.dark { background: linear-gradient(100deg,#33323a,#1d1c22); box-shadow: 0 8px 20px rgba(30,30,35,.25); }
.btn.sm { padding: 8px 14px; font-size: 12px; width: auto; }
.btn:disabled { opacity: .5; }

/* ---------- 详情页 ---------- */
.detail-hero { background: linear-gradient(150deg, #fff3e6, #ffe2cb); padding: 34px 0 28px; display: grid; place-items: center; font-size: 78px; position: relative; }
.detail-body { background: #fff; border-radius: 22px 22px 0 0; margin-top: -18px; position: relative; padding: 20px 18px 20px; }
.detail-name { font-size: 18px; font-weight: 700; line-height: 1.35; }
.detail-price { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; }
.detail-price .big { color: var(--brand); font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.detail-price .big i { font-size: 15px; font-style: normal; }
.detail-price .old { color: #b9b4ae; font-size: 12px; text-decoration: line-through; }
.detail-price .off { font-size: 10.5px; background: #fff0e6; color: #e2571f; padding: 3px 7px; border-radius: 5px; font-weight: 600; }
.kv { display: grid; gap: 10px; margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
.kv div { display: flex; font-size: 12.5px; color: var(--sub); }
.kv div span:first-child { width: 68px; color: var(--muted); }
.notice-box { background: #faf7f2; border-radius: 12px; padding: 12px; font-size: 11.5px; color: #7d7a75; line-height: 1.7; margin-top: 14px; }

.buybar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  background: #fff; border-top: 1px solid var(--line); padding: 10px 14px calc(10px + var(--safe-b));
  display: flex; gap: 10px; align-items: center; z-index: 55;
}
@media (min-width: 520px) { .buybar { bottom: 18px; border-radius: 0 0 26px 26px; } }
.buybar .sum { flex: 1; }
.buybar .sum b { color: var(--brand); font-size: 20px; }
.buybar .sum span { display: block; font-size: 10px; color: var(--muted); }
.buybar .btn { width: auto; padding: 12px 28px; }

/* ---------- 半屏弹层 ---------- */
.sheet-mask { position: fixed; inset: 0; background: rgba(20,15,10,.45); z-index: 100; display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
@media (min-width: 520px) { .sheet-mask { align-items: center; } }
.sheet {
  background: #fff; width: 100%; max-width: 480px; border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + var(--safe-b));
  animation: up .22s ease-out;
}
@media (min-width: 520px) { .sheet { border-radius: 22px; margin: 0 20px; max-height: 80vh; overflow: auto; } }
.sheet h3 { margin: 0 0 4px; font-size: 16.5px; }
.sheet .sub { color: var(--muted); font-size: 12px; margin: 0 0 16px; }
.sheet .close { position: absolute; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: #faf8f5; border-radius: 12px;
  padding: 12px 13px; font-size: 14px; outline: 0; color: var(--ink);
}
.field input:focus { border-color: #ffbe9e; background: #fff; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.switch { position: relative; width: 44px; height: 25px; border-radius: 14px; background: #e2ddd7; transition: .2s; border: 0; flex: none; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.switch.on { background: var(--brand); }
.switch.on::after { left: 22px; }
.tip-line { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.6; }

/* ---------- 订单 ---------- */
.order-card { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.oc-top { display: flex; align-items: center; gap: 10px; }
.oc-top .oi { width: 42px; height: 42px; border-radius: 12px; background: #faf5ee; display: grid; place-items: center; font-size: 22px; }
.oc-top .om { flex: 1; min-width: 0; }
.oc-top .om b { font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-top .om span { font-size: 10.5px; color: var(--muted); }
.oc-status { font-size: 11px; color: var(--brand); font-weight: 600; }
.oc-status.done { color: var(--green); }
.oc-status.refund { color: var(--muted); }
.oc-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--muted); }
.oc-bottom b { color: var(--ink); font-size: 14px; }
.empty { text-align: center; padding: 70px 20px; color: var(--muted); font-size: 13px; }
.empty .em { font-size: 46px; display: block; margin-bottom: 12px; opacity: .6; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.94);
  background: rgba(28,25,22,.9); color: #fff; padding: 11px 18px; border-radius: 12px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .2s; z-index: 999; max-width: 300px; text-align: center; line-height: 1.5;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: .6; } }
.fade-in { animation: fade .22s; }

/* ---------- 权益页 ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 14px; scrollbar-width: none; background: #fff; position: sticky; top: 0; z-index: 25; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 13px; border-radius: 18px; background: #f6f2ec; color: var(--sub); font-size: 12px; border: 0; }
.chip.on { background: var(--ink); color: #fff; font-weight: 600; }

.cps-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.cps {
  background: #fff; border-radius: 14px; padding: 12px 6px; text-align: center; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.cps .emo { font-size: 24px; }
.cps b { font-size: 11.5px; font-weight: 600; }
.cps span { font-size: 9px; color: var(--brand); }

.foot { text-align: center; font-size: 10.5px; color: #b3aea7; padding: 18px 20px 8px; line-height: 1.8; }
