/* 马来莲花村 · 榴莲卡  —— 暖色杂志风: 米白底(和 logo 底色一致) + 橄榄绿主色 + 金色点缀
   字阶 13 / 15 / 17 / 20 / 25 / 31 / 39   间距 4px 栅格   圆角 8 / 16 */
:root {
  --bg: #FEFAF1;
  --surface: #FFFDF8;
  --sunk: #F6EFDF;
  --line: #EADFC8;
  --ink: #2E2A1F;
  --ink-2: #625A47;
  --ink-3: #8C826B;
  --olive: #4F5D2F;
  --olive-d: #3D4823;
  --olive-l: #E7EAD8;
  --gold: #A9843A;
  --gold-l: #F1E5C6;
  --danger: #A8432C;
  --danger-l: #F6E1DA;
  --r1: 8px;
  --r2: 16px;
  --sh1: 0 1px 2px rgba(60, 50, 20, .06);
  --sh2: 0 8px 24px rgba(60, 50, 20, .12);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --tab-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
input, textarea, select { font-size: 16px; }   /* 小于 16px iOS 点进去会整页放大 */
button { cursor: pointer; }
a { color: var(--olive); }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.i { width: var(--s, 20px); height: var(--s, 20px); stroke-width: 1.5; flex: none; vertical-align: middle; }

.view { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); }
.view.no-tab { padding-bottom: calc(96px + var(--safe-b)); }
.pad { padding: 0 16px; }

/* ---------- 顶栏 ---------- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 8px;
  background: rgba(254, 250, 241, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 17px; flex: 1; text-align: center; padding-right: 40px; }
.back { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r1); color: var(--ink); }

/* ---------- 首页 ---------- */
.brand { text-align: center; padding: 32px 16px 8px; }
.brand img { width: 168px; height: auto; aspect-ratio: 400 / 406; display: block; margin: 0 auto; }
.brand h1 { font-family: var(--serif); font-size: 31px; letter-spacing: .18em; color: var(--gold); margin-top: 12px; padding-left: .18em; }
.brand .en { font-family: var(--serif); font-size: 13px; letter-spacing: .32em; color: var(--ink-3); margin-top: 4px; }
.brand .slogan { margin-top: 16px; color: var(--ink-2); font-size: 15px; }

.section { padding: 32px 16px 0; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-h h2 { font-family: var(--serif); font-size: 20px; }
.section-h small { color: var(--ink-3); font-size: 13px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); padding: 16px 8px; text-align: center; }
.step .i { color: var(--olive); --s: 24px; }
.step b { display: block; font-size: 15px; margin-top: 8px; }
.step span { display: block; font-size: 13px; color: var(--ink-3); line-height: 1.5; margin-top: 4px; }

.type-list { display: grid; gap: 24px; }
.type-item .lcard { box-shadow: var(--sh2); }
.type-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.type-meta p { color: var(--ink-2); font-size: 13px; min-width: 0; }
.type-meta .btn { flex: none; }

.prod-list { display: grid; gap: 12px; }
.prod { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); padding: 12px; }
.prod .ph { width: 72px; height: 72px; border-radius: var(--r1); background: var(--sunk); flex: none; object-fit: cover; display: grid; place-items: center; color: var(--gold); }
.prod .ph img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r1); }
.prod .body { flex: 1; min-width: 0; }
.prod b { font-size: 17px; font-family: var(--serif); }
.prod .spec { font-size: 13px; color: var(--ink-3); }
.prod .intro { font-size: 13px; color: var(--ink-2); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod .side { text-align: right; flex: none; }
.muted { color: var(--ink-3); font-size: 13px; }

.service { margin: 32px 16px 0; padding: 16px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 13px; line-height: 1.9; text-align: center; }

.price { font-family: var(--serif); color: var(--olive-d); font-weight: 600; font-size: 20px; white-space: nowrap; }
.price small { font-size: 13px; margin-right: 1px; }

/* ---------- 卡面 ---------- */
.lcard { position: relative; aspect-ratio: 1.586; border-radius: var(--r2); padding: 20px; overflow: hidden; color: #F7EDD3; isolation: isolate;
  background: linear-gradient(135deg, #5A6936 0%, #3D4823 100%); display: flex; flex-direction: column; }
.lcard.value { background: linear-gradient(135deg, #5B4824 0%, #2F2612 100%); }
.lcard::before { content: ""; position: absolute; right: -18%; top: -30%; width: 78%; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(233, 205, 140, .35); z-index: -1; }
.lcard::after { content: ""; position: absolute; right: -6%; top: -14%; width: 50%; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(233, 205, 140, .22); z-index: -1; }
.lcard .lc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lcard .lc-brand { font-family: var(--serif); font-size: 13px; letter-spacing: .24em; color: #E6CB8A; }
.lcard .lc-chip { font-size: 13px; line-height: 1; padding: 4px 8px; border-radius: 999px; border: 1px solid rgba(230, 203, 138, .5); color: #E6CB8A; white-space: nowrap; }
.lcard .lc-name { font-family: var(--serif); font-size: 25px; margin-top: auto; line-height: 1.2; color: #FBF3DF; }
.lcard .lc-big { display: flex; align-items: baseline; gap: 4px; margin-top: 4px; color: #E6CB8A; font-family: var(--serif); }
.lcard .lc-big b { font-size: 39px; font-weight: 600; line-height: 1.1; }
.lcard .lc-big span { font-size: 15px; }
.lcard .lc-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: rgba(247, 237, 211, .72); margin-top: 8px; font-variant-numeric: tabular-nums; }
.lcard.off { filter: grayscale(.85); opacity: .72; }
.lcard .lc-state { position: absolute; right: 20px; bottom: 44px; font-size: 13px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .35); color: #fff; }

/* ---------- 卡包 ---------- */
.wallet { display: grid; gap: 16px; padding: 16px; }
.wallet a { text-decoration: none; display: block; }
.empty { text-align: center; padding: 64px 24px; color: var(--ink-2); }
.empty .i { --s: 40px; color: var(--gold); }
.empty h3 { font-family: var(--serif); font-size: 20px; margin: 16px 0 8px; color: var(--ink); }
.empty p { font-size: 13px; color: var(--ink-3); margin-bottom: 24px; }
.hint { display: flex; gap: 8px; align-items: flex-start; margin: 0 16px; padding: 12px; background: var(--gold-l); border-radius: var(--r1); font-size: 13px; color: var(--ink-2); }
.hint .i { color: var(--gold); --s: 18px; margin-top: 2px; }

/* ---------- 列表行 / 面板 ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); margin: 16px; overflow: hidden; }
.panel > h3 { font-size: 15px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 48px; text-decoration: none; color: inherit; }
.row:last-child { border-bottom: 0; }
.row .k { color: var(--ink-3); font-size: 13px; width: 72px; flex: none; }
.row .v { flex: 1; min-width: 0; word-break: break-all; }
.row .grow { flex: 1; min-width: 0; }
.row .sub { font-size: 13px; color: var(--ink-3); }
.row > .i:last-child { color: var(--ink-3); }

.tag { display: inline-block; font-size: 13px; line-height: 1; padding: 4px 8px; border-radius: 999px; background: var(--olive-l); color: var(--olive-d); white-space: nowrap; }
.tag.gold { background: var(--gold-l); color: #7A5D22; }
.tag.gray { background: var(--sunk); color: var(--ink-3); }
.tag.red { background: var(--danger-l); color: var(--danger); }

.logs { list-style: none; margin: 0; padding: 0; }
.logs li { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.logs li:last-child { border-bottom: 0; }
.logs .t { color: var(--ink-3); width: 88px; flex: none; font-variant-numeric: tabular-nums; }
.logs .n { flex: 1; min-width: 0; color: var(--ink-2); }
.logs .d { flex: none; font-variant-numeric: tabular-nums; color: var(--olive-d); }
.logs .d.minus { color: var(--danger); }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 20px; border-radius: var(--r1);
  border: 1px solid transparent; background: var(--olive); color: #FBF6E8; font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease-out, opacity .15s ease-out; }
.btn:hover { background: var(--olive-d); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--olive-d); border-color: var(--olive); }
.btn.ghost:hover { background: var(--olive-l); }
.btn.text { background: none; color: var(--ink-2); border: 0; padding: 0 8px; }
.btn.danger { background: none; border-color: var(--danger); color: var(--danger); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn.block { display: flex; width: 100%; }

.actions { display: flex; gap: 12px; padding: 0 16px; margin-top: 16px; }
.actions .btn { flex: 1; }

/* 底部固定操作条 */
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: rgba(255, 253, 248, .96); border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + var(--safe-b)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.bar-in { max-width: 528px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.bar-in .sum { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-2); }
.bar-in .sum .price { font-size: 25px; }
.bar-in .btn { min-width: 132px; }

/* ---------- 数量 / 选择 ---------- */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r1); background: var(--surface); }
.stepper button { width: 36px; height: 36px; border: 0; background: none; display: grid; place-items: center; color: var(--olive-d); }
.stepper button:disabled { color: var(--line); cursor: default; }
.stepper span { min-width: 32px; text-align: center; font-variant-numeric: tabular-nums; font-size: 15px; }

.seg { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 8px; }
.seg button { height: 64px; border-radius: var(--r1); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; color: var(--ink-2); }
.seg button .i { --s: 20px; }
.seg button[aria-pressed="true"] { border-color: var(--olive); background: var(--olive-l); color: var(--olive-d); font-weight: 500; }

.form { display: grid; gap: 12px; padding: 16px; }
.field { display: grid; gap: 4px; }
.field label { font-size: 13px; color: var(--ink-2); }
.field input, .field textarea, .field select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r1); background: #fff; }
.field textarea { height: 76px; padding: 10px 12px; resize: none; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--olive); outline: none; box-shadow: 0 0 0 3px var(--olive-l); }
.field .err { color: var(--danger); font-size: 13px; }
.field.bad input, .field.bad textarea { border-color: var(--danger); }

.info-block { padding: 12px 16px; font-size: 13px; color: var(--ink-2); background: var(--sunk); border-radius: var(--r1); margin: 0 16px; }

/* ---------- 兑换单 ---------- */
.status-hero { text-align: center; padding: 32px 16px 16px; }
.status-hero .i { --s: 40px; color: var(--olive); }
.status-hero h2 { font-family: var(--serif); font-size: 25px; margin-top: 12px; }
.status-hero p { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.code { font-family: var(--serif); font-size: 39px; letter-spacing: .2em; color: var(--olive-d); text-align: center; padding: 16px 0 4px; font-variant-numeric: tabular-nums; padding-left: .2em; }
.qr { display: grid; place-items: center; padding: 16px; }
.qr svg { width: 184px; height: 184px; display: block; }

/* ---------- 底栏 ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: center; height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b); background: rgba(255, 253, 248, .96); border-top: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.tabbar[hidden] { display: none; }
.tabbar a { flex: 1; max-width: 186px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 13px; color: var(--ink-3); text-decoration: none; }
.tabbar a[aria-current="page"] { color: var(--olive-d); font-weight: 500; }
.tabbar .i { --s: 22px; }

/* ---------- 提示 / 弹层 ---------- */
.toast { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 50; max-width: 80vw; padding: 12px 20px; border-radius: var(--r1);
  background: rgba(46, 42, 31, .9); color: #fff; font-size: 15px; text-align: center; }
.toast[hidden] { display: none; }
.mask { position: fixed; inset: 0; z-index: 40; background: rgba(30, 26, 15, .45); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade .15s ease-out; }
.dialog { width: 100%; max-width: 340px; background: var(--surface); border-radius: var(--r2); overflow: hidden; }
.dialog-body { padding: 24px 20px 16px; text-align: center; }
.dialog-body h3 { font-size: 17px; margin-bottom: 8px; }
.dialog-body p { color: var(--ink-2); font-size: 15px; white-space: pre-line; }
.dialog-acts { display: flex; border-top: 1px solid var(--line); }
.dialog-acts button { flex: 1; height: 52px; border: 0; background: none; font-size: 17px; color: var(--ink-2); }
.dialog-acts button + button { border-left: 1px solid var(--line); }
.dialog-acts .ok { color: var(--olive-d); font-weight: 600; }
.sheet-mask { align-items: flex-end; padding: 0; }
.sheet { width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--r2) var(--r2) 0 0; padding: 24px 16px calc(16px + var(--safe-b)); animation: up .2s ease-out; }
.sheet h3 { font-family: var(--serif); font-size: 20px; text-align: center; }
.sheet p { text-align: center; color: var(--ink-2); font-size: 13px; margin-top: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mask, .sheet { animation: none; } }

.skeleton { margin: 16px; height: 200px; border-radius: var(--r2); background: var(--sunk); }
.error-box { text-align: center; padding: 64px 24px; color: var(--ink-2); }
.error-box .i { --s: 36px; color: var(--danger); }
.error-box p { margin: 12px 0 20px; }

/* 店员面板(扫码进来的店员看到) */
.staff { margin: 16px; padding: 16px; border-radius: var(--r2); border: 1px dashed var(--gold); background: #FFF9EA; }
.staff h3 { font-size: 15px; display: flex; align-items: center; gap: 6px; color: #7A5D22; margin-bottom: 12px; }
