:root {
  --bg: #f6f4f1;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --surface-3: #f1efeb;
  --line: #efebe5;
  --line-soft: #f5f2ee;
  --ink-1: #26292e;
  --ink-2: #4c5158;
  --ink-3: #7d838c;
  --ink-4: #a5aab2;
  --brand: #ad4632;
  --brand-deep: #8c3826;
  --brand-soft: rgba(173, 70, 50, .07);
  --brand-line: rgba(173, 70, 50, .22);
  --gold: #96794c;
  --gold-bg: #f8f1e4;
  --gold-line: #eee0c8;
  --ok: #3f8e60;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow-1: 0 1px 2px rgba(38, 32, 26, .03), 0 8px 24px rgba(38, 32, 26, .05);
  --shadow-2: 0 10px 34px rgba(38, 32, 26, .09);
}

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

html, body {
  background: var(--bg);
  color: var(--ink-2);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.72;
  letter-spacing: .2px;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 96px;
  position: relative;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 244, 241, .92);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 18px 10px;
}

.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #b4523b, #8f3724);
  color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0;
}
.brand-name { font-size: 15px; font-weight: 600; color: var(--ink-1); letter-spacing: .4px; }
.brand-sub { font-size: 11px; color: var(--ink-4); letter-spacing: .6px; }

.top-link {
  font-size: 12.5px; color: var(--brand);
  padding: 5px 12px; border-radius: 999px;
  background: var(--brand-soft); border: 1px solid var(--brand-line);
}

/* ---------- 搜索 ---------- */
.search {
  margin-top: 10px;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: var(--shadow-1);
}
.search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--ink-1);
}
.search input::placeholder { color: var(--ink-4); }
.search-ic { color: var(--ink-4); font-size: 13px; }

/* ---------- 公告 ---------- */
.notice {
  margin: 14px 18px 0;
  display: flex; align-items: center; gap: 8px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-line);
  border-radius: var(--r-md);
  padding: 9px 12px;
  font-size: 12.5px; color: var(--gold);
  overflow: hidden;
}
.notice-tag { flex: none; font-weight: 600; }
.notice-txt { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 分类 ---------- */
.chips {
  display: flex; gap: 8px;
  padding: 14px 18px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  font-size: 13px;
  color: var(--ink-3);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: all .18s ease;
}
.chip.on {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 6px 16px rgba(140, 56, 38, .2);
}

/* ---------- 列表 ---------- */
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 18px 18px 10px;
}
.sec-title { font-size: 16px; font-weight: 600; color: var(--ink-1); letter-spacing: .3px; }
.sec-more { font-size: 12px; color: var(--ink-4); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px;
}

.card {
  min-width: 0;
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-1);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:active { transform: scale(.985); box-shadow: var(--shadow-2); }

.card-cover { position: relative; aspect-ratio: 1 / 1; background: #23262b; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-badge {
  position: absolute; left: 8px; top: 8px;
  font-size: 10.5px; letter-spacing: .3px;
  color: #fff; background: rgba(20, 18, 16, .55);
  border-radius: 6px; padding: 2px 7px;
  backdrop-filter: blur(6px);
}
.card-body { padding: 10px 11px 12px; }
.card-title {
  font-size: 13.5px; color: var(--ink-1); font-weight: 600;
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}
.price-row { display: flex; align-items: baseline; gap: 6px; margin-top: 7px; }
.price { color: var(--brand); font-size: 18px; font-weight: 600; letter-spacing: -.2px; }
.price small { font-size: 11px; font-weight: 500; margin-right: 1px; }
.price-old { color: var(--ink-4); font-size: 11.5px; text-decoration: line-through; }
.sold { margin-left: auto; font-size: 11px; color: var(--ink-4); }

/* ---------- 详情 ---------- */
.detail { padding-bottom: 24px; }
.detail-cover { background: #23262b; }
.detail-cover img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }

.detail-body { padding: 18px; }
.detail-title { font-size: 20px; font-weight: 600; color: var(--ink-1); line-height: 1.45; letter-spacing: .2px; }
.detail-meta { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tagpill {
  font-size: 11.5px; color: var(--gold);
  background: var(--gold-bg); border: 1px solid var(--gold-line);
  padding: 2px 9px; border-radius: 999px;
}
.tagpill.plain { color: var(--ink-3); background: var(--surface-3); border-color: var(--line); }

.price-card {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 16px 16px 14px;
  display: flex; align-items: flex-end; justify-content: space-between;
}
.price-big { color: var(--brand); font-size: 30px; font-weight: 600; letter-spacing: -.5px; line-height: 1.1; }
.price-big small { font-size: 14px; font-weight: 500; margin-right: 2px; }
.price-note { font-size: 11.5px; color: var(--ink-4); margin-top: 4px; }

.blk { margin-top: 22px; }
.blk-title {
  font-size: 15px; font-weight: 600; color: var(--ink-1);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.blk-title::before {
  content: ''; width: 3px; height: 14px; border-radius: 2px;
  background: var(--brand);
}
.blk-text { font-size: 14px; color: var(--ink-2); line-height: 1.85; white-space: pre-wrap; }
.blk-list { list-style: none; }
.blk-list li {
  position: relative;
  padding-left: 16px;
  font-size: 13.5px; color: var(--ink-2); line-height: 1.9;
}
.blk-list li::before {
  content: ''; position: absolute; left: 2px; top: 11px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--brand-line);
}

/* ---------- 底部操作栏 ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: 480px; margin: 0 auto;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border-top: 1px solid var(--line);
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px;
}
.qty { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 32px; height: 32px; color: var(--ink-2); font-size: 16px; }
.qty span { min-width: 26px; text-align: center; font-size: 14px; color: var(--ink-1); }

.btn {
  border-radius: 999px;
  font-size: 15px; font-weight: 500;
  letter-spacing: .6px;
  padding: 11px 18px;
  text-align: center;
  transition: transform .16s ease, opacity .16s ease;
}
.btn:active { transform: scale(.975); }
.btn-primary {
  flex: 1;
  color: #fff;
  background: linear-gradient(135deg, #b4523b 0%, #8f3724 100%);
  box-shadow: 0 8px 22px rgba(140, 56, 38, .22);
}
.btn-ghost {
  color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.btn-block { display: block; width: 100%; }

/* ---------- 表单 ---------- */
.form-wrap { padding: 18px; }
.fcard {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 16px;
  margin-bottom: 14px;
}
.fld { margin-bottom: 14px; }
.fld:last-child { margin-bottom: 0; }
.fld-label { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; letter-spacing: .3px; }
.fld-label em { font-style: normal; color: var(--brand); margin-left: 3px; }
.fld input, .fld textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 10px 12px;
  font-size: 14px; color: var(--ink-1);
  outline: none;
  transition: border-color .18s ease, background .18s ease;
  font-family: inherit;
}
.fld input:focus, .fld textarea:focus {
  border-color: var(--brand-line); background: #fff;
}
.fld textarea { min-height: 74px; resize: vertical; line-height: 1.7; }

.hint { font-size: 12px; color: var(--ink-4); line-height: 1.7; margin-top: 10px; }

/* ---------- 订单 / 支付 ---------- */
.pay-hero {
  margin: 18px; padding: 22px 18px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  text-align: center;
}
.pay-hero h2 { font-size: 17px; font-weight: 600; color: var(--ink-1); letter-spacing: .3px; }
.pay-hero p { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.pay-amount { font-size: 34px; font-weight: 600; color: var(--brand); letter-spacing: -.6px; margin: 14px 0 4px; }
.pay-amount small { font-size: 15px; font-weight: 500; margin-right: 2px; }

.kv { padding: 4px 18px 0; }
.kv-row {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.kv-row:last-child { border-bottom: none; }
.kv-k { color: var(--ink-3); flex: none; }
.kv-v { color: var(--ink-1); text-align: right; word-break: break-all; }

.steps { margin: 18px; }
.step {
  display: flex; gap: 12px;
  padding: 12px 0;
}
.step-no {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}
.step-txt { font-size: 13.5px; color: var(--ink-2); line-height: 1.75; }
.step-txt b { color: var(--ink-1); font-weight: 600; }

/* ---------- 订单列表 ---------- */
.order-item {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  padding: 14px;
  margin: 0 18px 12px;
}
.order-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.order-title { font-size: 14px; color: var(--ink-1); font-weight: 600; }
.order-status { font-size: 12px; color: var(--gold); flex: none; }
.order-status.done { color: var(--ok); }
.order-meta { font-size: 12px; color: var(--ink-4); margin-top: 6px; }
.order-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.order-money { font-size: 15px; color: var(--brand); font-weight: 600; }
.mini-btn {
  font-size: 12.5px; color: var(--brand);
  border: 1px solid var(--brand-line);
  background: var(--brand-soft);
  border-radius: 999px; padding: 4px 12px;
}

/* ---------- 空态 / 页脚 ---------- */
.empty { text-align: center; padding: 70px 24px; color: var(--ink-4); font-size: 13.5px; }

.foot {
  margin-top: 28px;
  padding: 22px 18px calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-4);
  line-height: 1.9;
}
.foot b { color: var(--ink-3); font-weight: 500; }

/* ---------- 返回 ---------- */
.backbar {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 18px 0;
}
.back {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13.5px; color: var(--ink-2);
  padding: 5px 12px 5px 9px;
  border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(8px);
  background: rgba(38, 41, 46, .92); color: #fff;
  font-size: 13px; padding: 9px 18px; border-radius: 999px;
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 90;
  max-width: 80vw; text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 560px) {
  body { background: #e9e5df; }
  .shell { box-shadow: 0 18px 60px rgba(38, 32, 26, .12); }
  .actionbar { box-shadow: 0 -6px 24px rgba(38, 32, 26, .06); }
}

/* ---------- 售罄角标 / 折扣标签 ---------- */
.card-soldout {
  position: absolute; right: 8px; top: 8px;
  font-size: 10.5px; color: #fff;
  background: rgba(38, 41, 46, .62);
  border-radius: 6px; padding: 2px 7px;
}
.btn-tag {
  display: block;
  font-style: normal;
  font-size: 11px; font-weight: 400;
  opacity: .85;
  letter-spacing: .2px;
  margin-top: -2px;
}

/* ---------- 多买多送阶梯 ---------- */
.tier-list { display: flex; gap: 8px; }
.tier {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 9px 6px;
  text-align: center;
  transition: all .18s ease;
}
.tier.on {
  border-color: var(--brand-line);
  background: var(--brand-soft);
}
.tier-l { display: block; font-size: 11px; color: var(--ink-4); }
.tier.on .tier-l { color: var(--brand); }
.tier-v { display: block; font-size: 13.5px; color: var(--ink-1); font-weight: 600; margin-top: 2px; }
.tier.on .tier-v { color: var(--brand); }

/* ---------- 结算金额明细 ---------- */
.sum-title {
  font-size: 14.5px; font-weight: 600; color: var(--ink-1);
  padding-bottom: 12px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
}
.sum-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13.5px; color: var(--ink-2);
  padding: 9px 0;
}
.sum-row.promo { color: var(--gold); }
.sum-row.total {
  border-top: 1px solid var(--line-soft);
  margin-top: 4px; padding-top: 12px;
  font-size: 15px; font-weight: 600; color: var(--brand);
}

/* ---------- 在线付款窗口 ---------- */
.paywin-sec { margin-top: 22px; }
.paywin-grid { display: flex; gap: 12px; margin-top: 10px; }
.paywin-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-1);
  padding: 16px 8px;
  font-size: 15px; font-weight: 600; color: var(--ink-1);
  transition: transform .16s ease;
}
.paywin-btn:active { transform: scale(.97); }
.paywin-ic {
  width: 34px; height: 34px; border-radius: 10px;
  color: #fff; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.pw-wx { background: #37b64f; }
.pw-ali { background: #1677ff; }

/* ---------- 付款弹层 ---------- */
.pmodal-mask {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(34, 29, 24, .55);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease;
}
.pmodal-mask.on { opacity: 1; pointer-events: auto; }
.pmodal {
  width: 100%; max-width: 480px;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 14px 18px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(24px);
  transition: transform .24s ease;
  box-shadow: 0 -8px 40px rgba(38, 32, 26, .18);
}
.pmodal-mask.on .pmodal { transform: translateY(0); }

.pmodal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ptabs {
  display: flex; gap: 6px;
  background: var(--surface-3);
  border-radius: 999px; padding: 4px;
}
.ptab {
  font-size: 13px; color: var(--ink-3);
  padding: 6px 14px; border-radius: 999px;
  transition: all .18s ease;
}
.ptab.on { background: var(--surface); color: var(--ink-1); font-weight: 600; box-shadow: var(--shadow-1); }
.pclose {
  width: 30px; height: 30px;
  color: var(--ink-4); font-size: 15px;
  border-radius: 50%;
  background: var(--surface-3);
}

.pamount {
  text-align: center;
  color: var(--brand); font-size: 32px; font-weight: 600; letter-spacing: -.5px;
  margin: 8px 0 12px;
}
.pamount small { font-size: 15px; font-weight: 500; margin-right: 2px; }

.pqr {
  width: 200px; height: 200px;
  margin: 0 auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}
.pqr-img { width: 100%; height: 100%; object-fit: cover; }
.pqr-ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding: 14px;
  border: 1.5px dashed var(--line);
  border-radius: 16px;
}
.pqr-ph-t { font-size: 14px; color: var(--ink-3); font-weight: 600; }
.pqr-ph-s { font-size: 11px; color: var(--ink-4); line-height: 1.7; }

.pname { text-align: center; font-size: 13.5px; color: var(--ink-2); margin-top: 12px; }
.paccount {
  display: flex; align-items: center; gap: 8px;
  margin: 10px auto 0; max-width: 320px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
}
.pacc-label { color: var(--ink-4); flex: none; }
.pacc-val {
  flex: 1; color: var(--ink-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.paccount-hint { text-align: center; font-size: 12px; color: var(--ink-4); margin-top: 10px; }
.pnote { text-align: center; font-size: 12px; color: var(--gold); margin: 14px 0 12px; line-height: 1.7; }

/* 无收款码时的备用收款方式 */
.palt { margin: 6px 0 0; }
.palt-title {
  text-align: center; font-size: 12.5px; color: var(--ink-3);
  margin-bottom: 10px; letter-spacing: .02em;
}
.palt-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  margin-bottom: 8px;
  font-size: 13px;
  text-decoration: none;
  color: inherit;
}
.palt-k { color: var(--ink-4); flex: none; font-size: 12.5px; }
.palt-v {
  flex: 1; color: var(--ink-1); font-weight: 600;
  word-break: break-all;
}
.palt-go { flex: none; color: var(--brand); font-size: 12.5px; font-weight: 600; }
.palt-hint {
  text-align: center; font-size: 11.5px; color: var(--ink-4);
  line-height: 1.75; margin-top: 6px;
}

/* ---------- 云端状态胶囊 ---------- */
.status-pill {
  display: inline-block;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--gold);
  background: var(--gold-bg);
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  padding: 4px 14px;
}
.status-pill.ok {
  color: var(--ok);
  background: rgba(63, 142, 96, .08);
  border-color: rgba(63, 142, 96, .3);
}
