/* 前台商城样式：简洁、大留白、Q 弹交互 */
:root {
  --brand: #FF6B35;
  --brand-2: #FF9A5A;
  --brand-ink: #fff;
  --brand-soft: #fff0ea;
  --price: #E63946;
  --badge: #E63946;
  --badge-ink: #fff;
  --bg: #f6f6f8;
  --card: #ffffff;
  --text: #17181c;
  --muted: #7b7f8a;
  --line: #ececf0;
  --field: #f3f4f7;
  --shadow: 0 1px 2px rgba(20, 22, 30, .04), 0 8px 24px rgba(20, 22, 30, .06);
  --shadow-lg: 0 12px 40px rgba(20, 22, 30, .18);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --smooth: cubic-bezier(.22, 1, .36, 1);
  --r: 22px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1013;
    --card: #1a1b20;
    --text: #f2f3f5;
    --muted: #9a9eaa;
    --line: #2a2c33;
    --field: #24262d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; touch-action: pan-x pan-y; }
body { touch-action: pan-x pan-y; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans Thai", "Sukhumvit Set", "Microsoft YaHei", "Segoe UI", sans-serif;
  padding-bottom: calc(110px + env(safe-area-inset-bottom));
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.brand-mark {
  flex: none; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); font-weight: 800; font-size: 18px;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 35%, transparent);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 17px; line-height: 1.2; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; flex: none; }
.pill {
  height: 36px; padding: 0 14px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: transform .35s var(--spring);
}
.pill:active { transform: scale(.9); }

/* ---------- 搜索与分类 ---------- */
.toolbar { padding: 6px 0 4px; }
.search { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; }
.search input::placeholder { color: var(--muted); }
.search:focus-within { box-shadow: 0 0 0 2px var(--brand), var(--shadow); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; } /* 用自己的清除按钮，不要浏览器自带的 */
.search-clear { flex: none; width: 26px; height: 26px; margin-right: -6px; border-radius: 50%; display: grid; place-items: center; background: var(--field); animation: pop .3s var(--spring); transition: transform .3s var(--spring); }
.search-clear svg { width: 12px; height: 12px; stroke-width: 2.6; }
.search-clear:active { transform: scale(.82); }
.search-clear[hidden] { display: none; }
.searching #grid { padding-top: 14px; } /* 搜索结果和搜索框之间留出距离 */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 16px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 16px; border-radius: 999px; background: var(--card); color: var(--muted); font-weight: 600; font-size: 14px;
  transition: transform .35s var(--spring), background .2s, color .2s;
}
.chip:active { transform: scale(.9); }
.chip.on { background: var(--text); color: var(--bg); }

/* ---------- 商品 ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card {
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  animation: rise .5s var(--smooth) backwards; animation-delay: calc(var(--i, 0) * 45ms); /* 播完后不保留任何状态，卡片回到普通图层 */
  contain: layout paint style; /* 每张卡片自成一块，互不牵连重绘 */
  transition: transform .35s var(--smooth), box-shadow .35s;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@media (hover: hover) { .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); } .card:hover .thumb img, .card:hover .ph { transform: scale(1.05); } }
.thumb { position: relative; aspect-ratio: 1; background: var(--field); overflow: hidden; }
.thumb img, .ph { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--smooth); }
.ph { display: grid; place-items: center; font-size: clamp(40px, 12vw, 72px); font-weight: 800; color: color-mix(in srgb, var(--brand) 55%, transparent); background: radial-gradient(circle at 30% 25%, var(--brand-soft), var(--field) 75%); }
.tag { position: absolute; left: 10px; top: 10px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--price); color: #fff; animation: breathe 2s ease-in-out 3; } /* 呼吸三次就停，不再一直占用动画 */
.tag.out { background: rgba(0, 0, 0, .6); animation: none; }
@keyframes breathe { 50% { transform: scale(1.07); opacity: .86; } }
.card.sold .thumb img, .card.sold .ph { filter: grayscale(1); opacity: .5; }
.info { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.name { font-weight: 700; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.spec { color: var(--muted); font-size: 12.5px; min-height: 1.5em; overflow-wrap: anywhere; }
.buy { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 10px; min-height: 48px; }
.buy-act { margin-left: auto; }
.price { color: var(--price); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price i { font-style: normal; font-size: .65em; margin-right: 1px; }
.buy .price { font-size: 20px; line-height: 1.1; }
.buy .unit { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 18px; border-radius: 999px; font-weight: 700; font-size: 14px; white-space: nowrap;
  transition: transform .4s var(--spring), box-shadow .3s, opacity .2s; user-select: none;
}
.btn:active { transform: scale(.88); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 38%, transparent); }
@media (hover: hover) { .btn-primary:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 10px 22px color-mix(in srgb, var(--brand) 45%, transparent); } .btn-primary:active { transform: scale(.88); } }
.btn-ghost { background: var(--field); }
.btn-block { width: 100%; height: 52px; font-size: 16px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.pop { animation: pop .45s var(--spring); }
@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

.stepper { display: inline-flex; align-items: center; height: 38px; border-radius: 999px; background: var(--brand-soft); animation: pop .45s var(--spring); }
.stepper button { width: 36px; height: 38px; border-radius: 999px; font-size: 20px; font-weight: 700; color: var(--brand); line-height: 1; transition: transform .35s var(--spring); }
.stepper button:active { transform: scale(.75); }
.stepper button.plus { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); width: 38px; }
.stepper b { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; }
.stepper b.tick { animation: tick .3s var(--spring); }
@keyframes tick { 0% { transform: translateY(6px) scale(.7); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ---------- 悬浮购物车 ---------- */
.fab {
  position: fixed; z-index: 30; right: max(16px, env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom));
  height: 60px; min-width: 60px; padding: 0 18px; border-radius: 999px; display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); font-weight: 800; font-size: 16px;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--brand) 45%, transparent); transition: transform .45s var(--spring);
}
.fab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.fab:active { transform: scale(.88); }
.fab.bump { animation: bump .55s var(--spring); }
@keyframes bump { 0% { transform: scale(1); } 30% { transform: scale(1.22) rotate(-8deg); } 60% { transform: scale(.94) rotate(4deg); } 100% { transform: scale(1); } }
.fab-total:empty { display: none; }
.badge { position: absolute; top: -4px; left: 38px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--badge); color: var(--badge-ink); font-size: 12px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.badge.tick { animation: pop .45s var(--spring); }
.fly { position: fixed; z-index: 60; pointer-events: none; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); will-change: transform, opacity; }
.fly > * { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 弹层 ---------- */
.mask { position: fixed; inset: 0; z-index: 40; background: rgba(10, 11, 15, .58); opacity: 0; transition: opacity .3s; }
.mask.on { opacity: 1; }
.sheet {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; max-height: 90dvh; display: flex; flex-direction: column;
  background: var(--card); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(105%); transition: transform .5s var(--spring);
}
.sheet.on { transform: none; }
/* 平板和电脑：弹层和手机一样从底部弹出，限制宽度并居中；只有选规格 / 商品详情贴在屏幕最右侧 */
@media (min-width: 700px) {
  .sheet { margin: 0 auto; width: min(560px, 100%); }
  #detailSheet { left: auto; right: 0; margin: 0; width: min(480px, 100%); }
}
/* 弹层自己裁掉超出圆角的内容：里面的内容滚动或没有标题栏时，顶部两个角仍然是圆的 */
.sheet { overflow: hidden; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 10px; }
.sheet-head h2 { margin: 0; font-size: 20px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--field); font-size: 14px; transition: transform .35s var(--spring); }
.icon-btn:active { transform: scale(.8) rotate(90deg); }
.sheet-body { flex: 1; overflow-y: auto; padding: 6px 20px 16px; overscroll-behavior: contain; }
.sheet-foot { padding: 14px 20px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sum-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; color: var(--muted); }
.price.big { font-size: 26px; }

/* 购物车行 */
.cart-row { display: grid; grid-template-columns: 60px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); animation: rowIn .4s var(--smooth); overflow: hidden; }
.cart-row.out { animation: rowOut .3s var(--smooth) forwards; }
@keyframes rowIn { from { opacity: 0; transform: translateX(24px); } }
@keyframes rowOut { to { opacity: 0; transform: translateX(-40px); max-height: 0; padding: 0; } }
.cart-row .mini { width: 60px; height: 60px; border-radius: 14px; overflow: hidden; background: var(--field); }
.cart-row .mini > * { width: 100%; height: 100%; object-fit: cover; font-size: 24px; }
.cart-row .t { min-width: 0; }
.cart-row .t b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-row .t small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-row .t .price { font-size: 15px; }
.cart-row .stepper { animation: none; }
.blank { text-align: center; padding: 56px 0; color: var(--muted); }
.blank .big-emoji { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%; background: var(--brand-soft); display: grid; place-items: center; animation: float 3s ease-in-out infinite; }
.blank .big-emoji svg { width: 40px; height: 40px; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.blank b { display: block; color: var(--text); font-size: 16px; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* 表单 */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field textarea { border: 2px solid transparent; background: var(--field); border-radius: 14px; padding: 12px 14px; font-size: 16px; outline: 0; resize: none; transition: border-color .2s, background .2s; }
.field input:focus, .field textarea:focus { border-color: var(--brand); background: var(--card); }
.field.bad input, .field.bad textarea { border-color: var(--price); animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.form-err { margin: 0; color: var(--price); font-size: 13px; font-weight: 600; }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--field); border-radius: 14px; padding: 4px; }
.seg-btn { position: relative; z-index: 1; height: 40px; border-radius: 11px; font-weight: 700; color: var(--muted); transition: color .25s; }
.seg-btn.on { color: var(--text); }
.seg-thumb { position: absolute; z-index: 0; top: 4px; left: 4px; width: calc(50% - 4px); height: 40px; border-radius: 11px; background: var(--card); box-shadow: var(--shadow); transition: transform .45s var(--spring); }
.seg[data-v="pickup"] .seg-thumb { transform: translateX(100%); }
.summary { background: var(--field); border-radius: 16px; padding: 12px 14px; font-size: 14px; }
.summary div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); }
.summary div.sum { color: var(--text); font-weight: 700; border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 9px; }
.summary .hint { justify-content: flex-end; font-size: 12px; color: var(--brand); }

/* 成功页 */
.success { text-align: center; padding: 34px 22px 26px; }
.check { width: 88px; height: 88px; margin: 0 auto 14px; }
.check circle { fill: none; stroke: var(--brand); stroke-width: 4; stroke-dasharray: 252; stroke-dashoffset: 252; animation: draw .6s var(--smooth) .1s forwards; }
.check path { fill: none; stroke: var(--brand); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .4s var(--smooth) .6s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.success h2 { margin: 0 0 4px; font-size: 24px; }
.success p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.box { background: var(--field); border-radius: 18px; padding: 14px 16px; text-align: left; margin-bottom: 12px; }
/* 下单成功页的卡片：回到最初的弹跳节奏（0.5 秒后弹出）。提前升成独立图层，弹跳时只由显卡缩放，不重排不重绘 */
.success .box { animation: pop .5s var(--spring) .5s backwards; will-change: transform; }
/* 对勾单独一层：描边动画只重绘这 88px，不连累正在滑入的整张弹层 */
.success .check { will-change: transform; contain: strict; }
#grid.quiet .card { animation: none; opacity: 1; transform: none; }
.box h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 14px; }
.kv span { color: var(--muted); flex: none; }
.kv b { text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kv .copy { flex: none; margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; transition: transform .35s var(--spring); }
.kv .copy:active { transform: scale(.85); }
/* 复制按钮和左边的文字（订单号字号大）上下居中对齐，而不是按文字基线对齐后偏下 */
.kv .copy { vertical-align: middle; line-height: 1.5; }
.kv b:has(> .copy) { display: inline-flex; align-items: center; justify-content: flex-end; min-width: 0; }
.order-no { font-size: 22px; letter-spacing: .5px; }
.actions { display: grid; gap: 10px; margin-top: 16px; }
.actions .btn { height: 48px; }

/* 查单 */
.q-form { display: grid; gap: 10px; margin-bottom: 16px; }
.recent h3 { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.recent button { display: flex; justify-content: space-between; width: 100%; padding: 12px 14px; margin-bottom: 8px; border-radius: 14px; background: var(--field); font-weight: 600; transition: transform .35s var(--spring); }
.recent button:active { transform: scale(.96); }
.recent small { color: var(--muted); font-weight: 400; }
.status-pill { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px; }
.status-pill.cancelled { background: var(--field); color: var(--muted); }
.steps { display: flex; margin: 16px 0 18px; }
.steps div { flex: 1; text-align: center; font-size: 11.5px; color: var(--muted); position: relative; padding-top: 22px; }
.steps div::before { content: ""; position: absolute; top: 4px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--line); z-index: 1; }
.steps div::after { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.steps div:first-child::after { display: none; }
.steps div.done { color: var(--text); font-weight: 600; }
.steps div.done::before { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.steps div.done::after { background: var(--brand); }
.q-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.q-item small { color: var(--muted); display: block; }
.link { color: var(--brand); font-weight: 700; text-decoration: none; }

/* 页脚与提示 */
.footer { text-align: center; color: var(--muted); font-size: 12px; padding-top: 34px; }
.contacts { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.contacts a, .contacts button { height: 38px; padding: 0 16px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); color: var(--text); font-weight: 600; font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; transition: transform .35s var(--spring); }
.contacts a:active, .contacts button:active { transform: scale(.9); }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: 86vw; padding: 11px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: toastIn .45s var(--spring); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px) scale(.9); } }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 70; pointer-events: none; }
.skeleton { border-radius: var(--r); aspect-ratio: .72; background: linear-gradient(100deg, var(--card) 30%, var(--field) 50%, var(--card) 70%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

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

/* ================= 分类版、规格合并、商品详情 ================= */
#grid .grid + h4, #grid h4 + .grid { margin-top: 0; }
/* 商品很多时的分块列表：块与块的间距等于卡片行距，看起来和不分块一样 */
.vlist { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: var(--vgap, 12px); }
.vchunk { contain: layout style; }
.vchunk:empty { contain: strict; }
.vchunk.late .card { animation: none; }
.thumb, .name[data-open] { cursor: pointer; }
.flag { position: absolute; right: 10px; top: 10px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; background: var(--text); }
.flag.sale { background: var(--price); }
.flag.hot { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); }
.flag.isNew { background: #10b981; }
.buy s, .d-price s { color: var(--muted); font-size: 12px; margin-left: 6px; }
.buy .price small { font-size: 11px; font-weight: 600; margin-left: 2px; color: var(--muted); }
.btn .cnt { font-style: normal; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand-ink); color: var(--brand); font-size: 11px; display: inline-grid; place-items: center; }
.chip.sm { height: 30px; padding: 0 13px; font-size: 13px; }
.subchips { padding-top: 0; }

.shop-body { display: block; }
.side { display: none; }
.sec h3 { margin: 0; padding: 18px 0 12px; font-size: 18px; }
.sec:first-child h3 { padding-top: 6px; }
.sec h4 { margin: 0; padding: 16px 0 10px; font-size: 14px; color: var(--muted); font-weight: 600; }

.layout-cat .shop-body { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: start; }
.layout-cat main.wrap { padding-left: 0; }
.layout-cat .toolbar { padding-left: 16px; padding-bottom: 12px; }
.layout-cat .side {
  display: block; position: sticky; top: 64px; height: calc(100dvh - 64px); overflow-y: auto; scrollbar-width: none;
  background: var(--card); border-radius: 0 20px 0 0; padding: 6px 0 120px;
}
.layout-cat .side::-webkit-scrollbar { display: none; }
.side { position: relative; }
.side-ind { position: absolute; left: 0; top: 0; width: 100%; height: 0; opacity: 0; background: var(--bg); pointer-events: none; transition: transform .45s var(--spring), height .3s, opacity .2s; }
.side-ind::before { content: ""; position: absolute; left: 0; top: 22%; width: 4px; height: 56%; border-radius: 0 4px 4px 0; background: linear-gradient(var(--brand), var(--brand-2)); }
.side button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; min-height: 56px; padding: 10px 6px; font-size: 13px; color: var(--muted); line-height: 1.25; text-align: center; transition: color .2s, transform .35s var(--spring); }
.side button:active { transform: scale(.92); }
.side button.on { color: var(--text); font-weight: 700; }
.side button img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.side button span { overflow-wrap: anywhere; }
.side button em { position: absolute; top: 5px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--badge); color: var(--badge-ink); font-size: 10.5px; font-style: normal; font-weight: 700; display: grid; place-items: center; }
.side button em.tick { animation: pop .45s var(--spring); }
.layout-cat .subchips { position: sticky; top: 64px; z-index: 5; margin: 0; padding: 8px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.layout-cat .sec { scroll-margin-top: 80px; }

/* 手机上的分类版：一行一个的紧凑卡片 */
@media (max-width: 699px) {
  .layout-cat .grid { grid-template-columns: 1fr; gap: 10px; }
  .layout-cat .card { flex-direction: row; border-radius: 18px; }
  .layout-cat .thumb { width: 92px; flex: none; }
  .layout-cat .buy { flex-wrap: wrap; row-gap: 6px; }
  .layout-cat .buy-act { margin-left: auto; }
  .layout-cat .buy .unit { display: inline; margin-left: 3px; }
  .layout-cat .thumb .ph { font-size: 38px; }
  .layout-cat .info { padding: 10px 12px; min-width: 0; }
  .layout-cat .buy { padding-top: 4px; min-height: 40px; }
  .layout-cat .buy .price { font-size: 16px; }
  .layout-cat .tag, .layout-cat .flag { left: 6px; top: 6px; right: auto; font-size: 10px; padding: 2px 7px; }
  .layout-cat .tag + .flag { display: none; }
  .layout-cat .card .btn { height: 32px; padding: 0 13px; font-size: 13px; }
  .layout-cat .stepper, .layout-cat .stepper button { height: 34px; }
  .layout-cat .stepper button { width: 32px; }
  .layout-cat .sec h3 { font-size: 16px; padding: 14px 0 10px; }
}
@media (min-width: 700px) {
  .layout-cat .shop-body { grid-template-columns: 190px minmax(0, 1fr); gap: 22px; }
  .layout-cat main.wrap { padding-left: 16px; }
  .layout-cat .toolbar { padding-left: 0; }
  .layout-cat .side { border-radius: 20px; height: auto; max-height: calc(100dvh - 84px); top: 74px; padding: 8px 0; box-shadow: var(--shadow); }
  .layout-cat .side-ind { background: var(--brand-soft); }
  .layout-cat .side button { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 10px 16px; font-size: 14px; text-align: left; min-height: 48px; }
  .layout-cat .side button em { position: static; margin-left: auto; }
  .layout-cat .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

/* 商品详情 */
#detailSheet .detail { padding: 0; }
.detail-close { position: absolute; z-index: 3; right: 14px; top: 14px; background: color-mix(in srgb, var(--card) 85%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: var(--shadow); }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 28px 28px 0 0; background: var(--field); }
.gallery::-webkit-scrollbar { display: none; }
.gallery > div { flex: none; width: 100%; aspect-ratio: 1; scroll-snap-align: center; max-height: 46dvh; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .ph { width: 100%; height: 100%; }
.gallery.noimg > div { aspect-ratio: 2.4; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: -18px; position: relative; padding-bottom: 12px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .6); box-shadow: 0 0 2px rgba(0, 0, 0, .3); transition: width .3s var(--spring), background .2s; }
.dots i.on { width: 18px; background: var(--brand); }
.d-main { padding: 16px 20px 20px; }
.d-main h2 { margin: 0 0 8px; font-size: 21px; line-height: 1.3; }
.d-main h2 .flag { position: static; display: inline-block; vertical-align: middle; margin-left: 4px; }
.d-main h4 { margin: 18px 0 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.d-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; }
.d-price .unit { color: var(--muted); font-size: 13px; margin-left: 4px; }
.d-stock { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.d-stock.low { color: var(--price); font-weight: 700; }
.d-spec { margin: 8px 0 0; color: var(--muted); }
.variants { display: flex; flex-wrap: wrap; gap: 10px; }
.variant { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 14px; border-radius: 14px; background: var(--field); border: 2px solid transparent; text-align: left; transition: transform .35s var(--spring), border-color .2s, background .2s; }
.variant:active { transform: scale(.93); }
.variant span { font-weight: 700; font-size: 14px; }
.variant small { color: var(--muted); font-size: 12px; }
.variant.on { border-color: var(--brand); background: var(--brand-soft); }
.variant.on small { color: var(--price); font-weight: 700; }
.variant.off { opacity: .45; }
.variant.off span { text-decoration: line-through; }
.variant em { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--badge); color: var(--badge-ink); font-size: 11px; font-style: normal; font-weight: 700; display: grid; place-items: center; animation: pop .45s var(--spring); }
.desc { margin: 0; white-space: pre-line; line-height: 1.7; color: var(--text); font-size: 14.5px; }
.d-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.d-incart { color: var(--muted); font-size: 13px; }
.d-incart .price { font-size: 20px; margin-left: 4px; }
.stepper.lg, .stepper.lg button { height: 48px; }
.stepper.lg button { width: 48px; font-size: 24px; }
.stepper.lg b { min-width: 40px; font-size: 18px; }

/* ================= 我的订单 ================= */
.pill.has { position: relative; }
.pill.has::after { content: attr(data-n); position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--badge); color: var(--badge-ink); font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); animation: pop .45s var(--spring); }
.q-hint { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.q-tip { margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); color: var(--text); font-size: 13px; line-height: 1.5; }
.back { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 12px -4px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--field); color: var(--text); font-weight: 600; font-size: 13px; transition: transform .35s var(--spring); }
.back svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transform: rotate(180deg); }
.back { white-space: nowrap; }
.back:active { transform: scale(.92); }
.slip-ok { margin: 10px 0 8px; color: #10b981; font-weight: 700; font-size: 13.5px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.box .btn { margin-top: 10px; }
.box .two .btn { margin-top: 0; }
.box .btn-ghost { background: var(--card); box-shadow: var(--shadow); }
a.btn { text-decoration: none; }
.btn.live svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn.danger { color: var(--price); }
.btn.danger.armed { background: var(--price); color: #fff; animation: pop .4s var(--spring); }
.q-loading { display: flex; justify-content: center; gap: 6px; padding: 30px 0; }
.q-loading i { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); animation: dot 1s ease-in-out infinite; }
.q-loading i:nth-child(2) { animation-delay: .15s; }
.q-loading i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .86); display: grid; place-items: center; padding: 20px; animation: fadeIn .25s; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 14px; animation: pop .45s var(--spring); }
.lightbox .icon-btn { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; }
@keyframes fadeIn { from { opacity: 0; } }

/* ================= 收款方式 ================= */
.pay-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 -4px 10px; padding: 2px 4px; scrollbar-width: none; }
.pay-tabs::-webkit-scrollbar { display: none; }
.pay-tab { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--card); color: var(--muted); font-weight: 700; font-size: 13px; border: 2px solid transparent; transition: transform .35s var(--spring), border-color .2s, color .2s; }
.pay-tab:active { transform: scale(.9); }
.pay-tab.on { border-color: var(--brand); color: var(--text); }
.pay-qr { display: block; width: 190px; max-width: 70%; margin: 6px auto 10px; padding: 8px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); cursor: zoom-in; transition: transform .35s var(--spring); }
.pay-qr:active { transform: scale(.95); }
.pay-qr img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; border-radius: 8px; }
.pay-note { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; white-space: pre-line; line-height: 1.5; }
.pay-panel.sw { animation: rowIn .3s var(--smooth); }
.kv b.mono { font-size: 13px; word-break: break-all; }

/* ================= 下单表单与定位 ================= */
.row2 { display: grid; grid-template-columns: 1fr 1.15fr; gap: 10px; }
.row2 .field input { width: 100%; min-width: 0; }
.form { gap: 10px; }
.loc { display: flex; flex-direction: column; gap: 8px; }
.loc-row { display: flex; gap: 8px; }
.loc-row input { flex: 1; min-width: 0; border: 2px solid transparent; background: var(--field); border-radius: 14px; padding: 12px 14px; font-size: 16px; outline: 0; transition: border-color .2s, background .2s; }
.loc-row input:focus { border-color: var(--brand); background: var(--card); }
.loc-row.bad input { border-color: var(--price); animation: shake .4s; }
.loc-btn { flex: none; width: 50px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; transition: transform .35s var(--spring); }
.loc-btn:active { transform: scale(.85); }
.loc-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.loc-btn.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loc-map { position: relative; border-radius: 16px; overflow: hidden; background: var(--field); animation: pop .45s var(--spring); }
.loc-open { position: relative; display: block; cursor: zoom-in; }
.loc-map iframe { display: block; width: 100%; height: 160px; border: 0; pointer-events: none; }
.loc-map .loc-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; font-size: 12.5px; color: var(--muted); }
.loc-map .loc-bar b { color: #10b981; }
.loc-clear { color: var(--price); font-weight: 700; font-size: 12.5px; flex: none; }
.loc-msg { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--field); color: var(--muted); font-size: 13px; }
.loc-msg .q-loading { padding: 0; gap: 4px; }
.loc-msg .q-loading i { width: 6px; height: 6px; }

/* ================= 全屏层：骑手位置 / 地图选点 ================= */
.fullview { position: fixed; inset: 0; z-index: 95; background: var(--bg); display: flex; flex-direction: column; animation: slideUp .4s var(--smooth); }
@keyframes slideUp { from { transform: translateY(100%); } }
.fullview.out { animation: slideDown .28s var(--smooth) forwards; }
@keyframes slideDown { to { transform: translateY(100%); } }
.fv-head { display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; background: var(--card); box-shadow: var(--shadow); z-index: 1; }
.fv-head h3 { flex: 1; margin: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fv-head .link { font-size: 13px; white-space: nowrap; }
.fv-body { flex: 1; position: relative; }
.fv-body iframe, .fv-body .gmap { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.fv-tip { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--card) 92%, transparent); box-shadow: var(--shadow); font-size: 12.5px; color: var(--muted); text-align: center; }
.fv-tip.fade { animation: tipOut .5s 6s forwards; pointer-events: none; }
@keyframes tipOut { to { opacity: 0; transform: translateY(10px); } }
.fv-foot { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: var(--card); }
.pin { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -34px 0 0 -17px; pointer-events: none; fill: var(--price); stroke: #fff; stroke-width: 1.5; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }

/* ================= 账号 ================= */
.pill.icon { width: 36px; padding: 0; display: grid; place-items: center; position: relative; }
.pill.icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pill.icon.on { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); }
.link-btn { color: var(--brand); font-weight: 700; font-size: 13px; padding: 2px 0; }
.link-btn.danger { color: var(--price); }
.muted-c { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0; }
.acct-phone { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 0; font-size: 18px; }
.agree { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.agree input { width: 20px; height: 20px; flex: none; accent-color: var(--brand); margin: 0; }
.privacy { max-height: 180px; overflow-y: auto; padding: 12px 14px; border-radius: 14px; background: var(--field); font-size: 12.5px; line-height: 1.7; color: var(--muted); white-space: pre-line; }
.acct-head { display: flex; align-items: center; gap: 14px; padding: 6px 2px 16px; }
.acct-avatar { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); }
.acct-head b { display: block; font-size: 18px; }
.acct-head small { color: var(--muted); }
.acct-h { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.menu-row { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 52px; padding: 0 16px; margin-top: 8px; border-radius: 16px; background: var(--field); font-weight: 600; font-size: 15px; transition: transform .35s var(--spring); }
.menu-row:active { transform: scale(.97); }
.menu-row svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.menu-row.quiet { background: none; color: var(--muted); font-weight: 500; font-size: 13px; height: 40px; }
.addr-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 8px; border-radius: 16px; background: var(--field); animation: rowIn .35s var(--smooth) backwards; }
.addr-item b { font-size: 14px; margin-right: 6px; }
.addr-item p { margin: 4px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.addr-item .status-pill { font-size: 11px; padding: 1px 8px; }
.addr-ops { display: flex; flex-direction: column; gap: 6px; flex: none; text-align: right; }
.addr-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.addr-chips::-webkit-scrollbar { display: none; }
.addr-chips .chip { background: var(--field); }
.addr-chips .chip.on { background: var(--text); color: var(--bg); }
#accountSheet .btn-block.danger { background: var(--price); color: #fff; }

/* ================= 收货信息折叠、应付金额 ================= */

/* ================= 折叠块（订单列表、收货信息共用） ================= */
.fold-arrow { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .45s var(--spring); }
.open > button > .fold-arrow { transform: rotate(180deg); }
.fold-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--smooth); }
.open > .fold-body { grid-template-rows: 1fr; }
.fold-body > div { overflow: hidden; padding: 0 16px; }
.open > .fold-body > div { padding-bottom: 14px; }

/* 订单列表 */
.o-card { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 14px 14px 12px; margin-bottom: 10px; border-radius: 18px; background: var(--field); text-align: left; border: 2px solid transparent; transition: transform .35s var(--spring), border-color .2s; animation: rowIn .4s var(--smooth) backwards; }
.o-card:active { transform: scale(.97); }
@media (hover: hover) { .o-card:hover { border-color: var(--brand); } .o-card:hover .o-go svg { transform: translateX(4px); } }
.o-top, .o-bot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.o-top b { font-size: 16px; letter-spacing: .3px; }
.o-sum { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.o-bot small { color: var(--muted); font-size: 12px; }
.o-bot .price { font-size: 17px; }
.o-go { display: flex; align-items: center; justify-content: flex-end; gap: 2px; padding-top: 8px; margin-top: 2px; border-top: 1px dashed var(--line); color: var(--brand); font-weight: 700; font-size: 13px; }
.o-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--spring); }
.status-pill.topay { background: color-mix(in srgb, var(--price) 12%, transparent); color: var(--price); }

/* 订单详情里的商品明细：三列对齐 */
.it-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px 86px; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.it-row:first-child { border-top: 0; padding-top: 2px; }
.it-n { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.it-n small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.it-q { text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.it-a { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.recv + .recv, .recv + .summary { margin-top: 0; }

/* 收货信息 */
.recv { padding: 0; overflow: hidden; }
.recv-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; text-align: left; }
.recv-who { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.recv-who b { color: var(--text); font-size: 15px; margin-right: 8px; }
.recv-mode { flex: none; font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 2px 10px; border-radius: 999px; }
.recv .fold-body p { margin: 0 0 6px; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.recv .fold-body .recv-sub { color: var(--muted); font-size: 13px; }

/* 付款方式里的账户信息与应付金额：同样的白底卡片 */
.pay-acc { padding: 8px 14px; margin-bottom: 10px; border-radius: 14px; background: var(--card); }
.pay-acc .kv { padding: 5px 0; }
.pay-amt { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 10px; padding: 12px 14px; margin-bottom: 12px; border-radius: 14px; background: var(--card); }
.pay-amt-l { display: contents; }
.pay-amt-l span { grid-column: 1; grid-row: 1; }
.pay-amt-l small { grid-column: 1 / -1; grid-row: 2; }
.pay-amt b { grid-column: 2; grid-row: 1; }
.pay-amt .copy { grid-column: 3; grid-row: 1; }
.pay-amt-l span { color: var(--text); font-size: 13.5px; font-weight: 600; }
.pay-amt-l small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.pay-amt b { font-size: 22px; line-height: 1; white-space: nowrap; }
.pay-amt .copy { padding: 4px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; white-space: nowrap; transition: transform .35s var(--spring); }
.pay-amt .copy:active { transform: scale(.85); }

/* 订单详情进场：整体淡入上移一次，只动透明度和位移 */
.detail-in { animation: detailIn .24s ease-out; }
@keyframes detailIn { from { opacity: 0; transform: translateY(10px); } }

/* =====================================================================
   所有弹层统一：灰色底 + 白色圆角卡片；标题栏、底部按钮栏为白色
   （购物车、选规格、下单、下单成功、我的订单、账号 共用这一套）
   ===================================================================== */
.sheet { --sheet-bg: var(--bg); --sheet-card: var(--card); background: var(--sheet-bg); --field: var(--sheet-card); }
.sheet-head { padding: 18px 16px 12px 20px; background: var(--sheet-card); border-radius: 28px 28px 0 0; box-shadow: 0 1px 0 var(--line); position: relative; z-index: 2; }
.sheet-head h2 { font-size: 18px; }
.sheet-head .icon-btn { background: var(--sheet-bg); }
.sheet-body { padding: 14px 16px 18px; }
.sheet-foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--sheet-card); border-top: 0; box-shadow: 0 -1px 0 var(--line); }
@media (max-width: 699px) { /* 手机上的抽拉条 */
  .sheet::before { content: ""; position: absolute; z-index: 5; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 38%, transparent); pointer-events: none; }
}

/* 卡片：弹层里所有成块的内容 */
.sheet .box, .sheet .o-card, .sheet .summary, .sheet .menu-row, .sheet .addr-item, .sheet .d-main { background: var(--sheet-card); --card: var(--sheet-bg); --field: var(--sheet-bg); }
.sheet .box { border-radius: 18px; padding: 14px 16px; margin-bottom: 12px; }
.sheet .box:last-child { margin-bottom: 0; }
.sheet .summary { border-radius: 18px; padding: 14px 16px; }
.sheet .menu-row.quiet { background: none; }
.sheet .box .btn-ghost { background: var(--sheet-bg); box-shadow: none; }
.sheet .recv { padding: 0; }

/* 卡片内的小标题统一 */
.sheet .box h3, .sheet .acct-h, .sheet .d-main h4, .sheet .q-hint { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sheet .acct-h { margin: 16px 2px 10px; }
.sheet .d-main h4 { margin-top: 16px; }

/* 输入框：灰底上的白色圆角框 */
.sheet .field input, .sheet .field textarea, .sheet .loc-row input { background: var(--sheet-card); }
.sheet .field input:focus, .sheet .field textarea:focus, .sheet .loc-row input:focus { background: var(--sheet-card); }
.sheet .box .field input, .sheet .box .field textarea { background: var(--sheet-bg); }
.sheet .seg { background: var(--sheet-card); }
.sheet .seg-thumb { background: var(--brand-soft); box-shadow: none; }
.sheet .seg-btn.on { color: var(--brand); }
.sheet .addr-chips .chip { background: var(--sheet-card); }
.sheet .addr-chips .chip.on { background: var(--text); color: var(--sheet-bg); }
.sheet .back, .sheet .privacy { background: var(--sheet-card); }
.sheet .loc-msg, .sheet .loc-map { background: var(--sheet-card); }

/* 购物车 */
.sheet .cart-list { padding: 4px 16px; }
.sheet .cart-list .cart-row:last-child { border-bottom: 0; }
.sheet .blank .big-emoji { background: var(--sheet-card); }

/* 选规格 / 商品详情：图片在上，下面是一张白色内容卡 */
#detailSheet .detail { padding: 0 0 14px; }
.sheet .gallery { background: var(--sheet-card); }
.sheet .d-main { margin: 0; padding: 16px 20px 18px; border-radius: 0 0 22px 22px; }
.sheet .variant.on { background: var(--brand-soft); }

/* 下单成功 */
.sheet .success { padding: 30px 16px 20px; }
.sheet .success .actions { margin-top: 14px; }
.sheet .success .actions .btn-ghost { background: var(--sheet-card); }

/* 订单 */
.sheet .o-card { border-radius: 18px; }
.sheet .o-headbox .order-no { font-size: 20px; }
.sheet .o-headbox .kv:last-child { padding-bottom: 0; }
.sheet .q-tip { margin: 0 0 12px; }
.sheet .q-tip { border-radius: 14px; }
.sheet .steps { background: var(--sheet-card); border-radius: 18px; padding: 14px 6px 12px; margin: 12px 0; }
.sheet .actions .btn-ghost { background: var(--sheet-card); }
.sheet .box .actions .btn-ghost, .sheet .box .two .btn-ghost { background: var(--sheet-bg); }

/* 全屏层（骑手位置、地图选点）的标题栏和弹层一致 */
.fv-head { padding: max(12px, env(safe-area-inset-top)) 12px 12px 20px; }
.fv-head h3 { font-size: 18px; }

/* 手机上顶栏和分类胶囊栏不做实时模糊：它们吸在顶部，滚动时每一帧都要重新模糊背后的内容，很耗性能 */
@media (max-width: 699px) {
  .topbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .layout-cat .subchips { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 6px 8px -8px rgba(0, 0, 0, .18); }
}
.chip, .side button, .pay-tab { touch-action: manipulation; }
.chip { transition: transform .18s ease-out, background .12s, color .12s; } /* 按下的反馈更快 */

/* ================= 商品列表滚动流畅度 ================= */
@media (max-width: 699px) {
  /* 手机上卡片用一层更轻的阴影：两层大范围模糊阴影在几十张卡片上叠加，滚动时绘制成本很高 */
  .card, .search, .pill { box-shadow: 0 1px 3px rgba(20, 22, 30, .07); }
  .card { transition: none; }
  .thumb img, .ph { transition: none; }
}
@media (hover: none) { .card:hover { transform: none; } } /* 触屏上滑过卡片不触发悬停位移 */
.thumb { contain: strict; aspect-ratio: 1; } /* 图片区域尺寸固定，图片加载进来不会引起周围重排 */
.layout-cat .thumb { contain: layout paint style; }

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

/* ================= 所有弹层：快速弹出 + 果冻回弹（手机、平板、电脑一致） =================
   0.18 秒冲到位，然后以底边为支点拉长、压扁、再拉长、再压扁，幅度越来越小，像果冻落下来抖两下再定住。
   只动位移和缩放。关闭是加速下滑收起。 */
.sheet { transform-origin: 50% 100%; transition: none; animation: jellyOut .3s cubic-bezier(.5, 0, .8, .45) both; }
.sheet.on { animation: jellyIn .56s both; }
@keyframes jellyOut { from { transform: none; } to { transform: translateY(105%); } }
@keyframes jellyIn {
  0% { transform: translateY(105%); animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  33% { transform: translateY(0) scale(.98, 1.04); animation-timing-function: ease-in-out; }
  52% { transform: scale(1.025, .97); animation-timing-function: ease-in-out; }
  69% { transform: scale(.991, 1.015); animation-timing-function: ease-in-out; }
  85% { transform: scale(1.004, .995); animation-timing-function: ease-in-out; }
  100% { transform: none; }
}
