/* ===== 智慧丰食 设计系统 ===== */
:root {
  --brand: #ff6a3d;          /* 餐饮主色：温暖橙 */
  --brand-dark: #e8541e;
  --fresh: #16a34a;          /* 超市主色：鲜绿 */
  --fresh-dark: #128a3e;
  --price: #ff3b1d;          /* 价格/重点：红 */
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #ececef;
  --text: #1d2129;
  --text-2: #86909c;
  --text-3: #c0c4cc;
  --success: #00b42a;
  --warning: #ff7d00;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(20, 24, 35, 0.06);
  --shadow-strong: 0 6px 24px rgba(20, 24, 35, 0.10);
  --header-h: 56px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* 防止小屏出现横向滚动 */
  overflow-x: hidden;
  max-width: 100%;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; -webkit-appearance: none; appearance: none; }
input, textarea, select { font-family: inherit; font-size: 14px; -webkit-appearance: none; appearance: none; }
ul { list-style: none; }
.icon { flex: none; vertical-align: middle; }

/* 布局容器 */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
/* 底部留出 tabbar + iPhone 安全区高度 */
.page { padding: 16px 0 calc(78px + env(safe-area-inset-bottom)); min-height: calc(100vh - var(--header-h)); }

/* ===== 顶部导航 ===== */
.header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
  color: #fff;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
}
.header .logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; white-space: nowrap; }
.header .logo .mark {
  width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.18);
  display: grid; place-items: center;
}
.header .search {
  flex: 1; max-width: 520px; height: 36px; border-radius: 18px;
  background: rgba(255,255,255,.95); color: var(--text);
  display: flex; align-items: center; gap: 8px; padding: 0 14px;
}
.header .search input { flex: 1; border: none; outline: none; background: transparent; color: var(--text); }
.header .search .icon { color: var(--text-2); }
.header .nav-icons { display: flex; align-items: center; gap: 6px; }
.header .icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
}
.header .icon-btn:active { background: rgba(255,255,255,.18); }
.header .badge {
  position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; background: #fff; color: var(--brand-dark);
  font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 16px;
}

/* ===== 底部导航（移动端） ===== */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  /* 高度自适应，兼容 iPhone 底部安全区 */
  height: auto; min-height: 60px;
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; align-items: stretch; padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-2); font-size: 11px;
}
.tabbar a.active { color: var(--brand); }
.tabbar a .icon { width: 22px; height: 22px; }
.tabbar a .badge {
  position: absolute; top: 6px; margin-left: 12px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; background: var(--price); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}

/* ===== 通用区块 ===== */
.section { margin-top: 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; }
.section-title .bar { width: 4px; height: 16px; border-radius: 2px; background: var(--brand); }
.section-title.fresh .bar { background: var(--fresh); }
.section-more { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 2px; }

/* 餐饮/超市 切换 tabs */
.type-tabs { display: flex; gap: 10px; padding: 12px 16px 0; }
.type-tab {
  flex: 1; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); font-weight: 600; color: var(--text-2);
}
.type-tab.active.restaurant { color: var(--brand-dark); border-color: var(--brand); background: #fff4ef; }
.type-tab.active.supermarket { color: var(--fresh-dark); border-color: var(--fresh); background: #eefaf1; }

/* 分类横滑 */
.cat-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 14px 16px; scrollbar-width: none; }
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: none; min-width: 76px; padding: 10px 14px; border-radius: 10px; background: var(--surface);
  border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text); font-size: 13px;
}
.cat-chip.active { border-color: var(--brand); color: var(--brand-dark); background: #fff4ef; }
.cat-chip .ic { width: 26px; height: 26px; color: var(--brand); }
.cat-chip .ic.fresh { color: var(--fresh); }

/* ===== 商品网格 ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding: 0 16px; }
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s;
}
.card:active { transform: scale(.98); }
.card .thumb { position: relative; aspect-ratio: 1/1; background: #f0f1f3; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .name { font-size: 14px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.card .price { color: var(--price); font-weight: 700; font-size: 16px; }
.card .price small { font-size: 11px; font-weight: 600; }
.card .origin { color: var(--text-3); text-decoration: line-through; font-size: 12px; margin-left: 4px; }
.card .sales { color: var(--text-2); font-size: 12px; }
.card .add {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; flex: none;
}
.card .add:active { background: var(--brand-dark); }
.tag {
  position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600;
  background: rgba(0,0,0,.45); color: #fff;
}
.tag.fresh { background: var(--fresh); }

/* 占位图 */
.ph { width: 100%; height: 100%; display: grid; place-items: center; }
.ph.restaurant { background: linear-gradient(135deg, #fff1ea, #ffe2d6); color: var(--brand); }
.ph.supermarket { background: linear-gradient(135deg, #e8f8ec, #d6f3de); color: var(--fresh); }
.ph .ph-icon { width: 40%; height: 40%; opacity: .85; }

/* ===== 商品详情 ===== */
.detail-img { width: 100%; aspect-ratio: 1/1; background: #f0f1f3; }
.detail-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-box { background: var(--surface); padding: 16px; }
.detail-box .d-name { font-size: 19px; font-weight: 700; }
.detail-box .d-price { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.detail-box .d-price .p { color: var(--price); font-size: 24px; font-weight: 800; }
.detail-box .d-price .o { color: var(--text-3); text-decoration: line-through; }
.detail-box .d-meta { color: var(--text-2); font-size: 13px; margin-top: 8px; display: flex; gap: 16px; }
.detail-box .d-desc { margin-top: 12px; color: #4a505c; line-height: 1.7; }
.qty-row { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.stepper { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.stepper button { width: 34px; height: 34px; display: grid; place-items: center; color: var(--text); font-size: 18px; }
.stepper button:active { background: var(--bg); }
.stepper .num { min-width: 38px; text-align: center; font-weight: 600; }

.detail-actions { position: fixed; bottom: calc(60px + env(safe-area-inset-bottom)); left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border); display: flex; gap: 10px; padding: 10px 16px; }
.btn {
  height: 44px; border-radius: 22px; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 6px;
  flex: 1; transition: opacity .2s;
}
.btn:active { opacity: .85; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-fresh { background: var(--fresh); color: #fff; }
.btn-ghost { background: #fff; color: var(--brand-dark); border: 1px solid var(--brand); }
.btn-block { width: 100%; }
.btn:disabled { background: var(--text-3); color: #fff; cursor: not-allowed; }

/* ===== 购物车 ===== */
.cart-list { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.cart-item { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); display: flex; gap: 12px; padding: 12px; align-items: center; }
.cart-item .ci-thumb { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; flex: none; background: #f0f1f3; }
.cart-item .ci-body { flex: 1; min-width: 0; }
.cart-item .ci-name { font-weight: 600; font-size: 14px; }
.cart-item .ci-price { color: var(--price); font-weight: 700; margin-top: 4px; }
.cart-item .ci-del { color: var(--text-3); width: 30px; height: 30px; display: grid; place-items: center; }

.cart-bar { position: fixed; bottom: calc(60px + env(safe-area-inset-bottom)); left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.cart-bar .total { flex: 1; }
.cart-bar .total .t-label { color: var(--text-2); font-size: 12px; }
.cart-bar .total .t-val { color: var(--price); font-weight: 800; font-size: 20px; }

/* ===== 订单 ===== */
.order-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); margin: 0 16px 12px; overflow: hidden; }
.order-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.order-no { color: var(--text-2); font-size: 12px; font-family: ui-monospace, monospace; }
.order-status { font-size: 13px; font-weight: 600; }
.status-pending { color: var(--warning); }
.status-paid, .status-completed { color: var(--success); }
.status-cancelled { color: var(--text-3); }
.order-items { padding: 8px 14px; }
.order-line { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.order-line .ol-thumb { width: 44px; height: 44px; border-radius: 6px; overflow: hidden; flex: none; background: #f0f1f3; }
.order-line .ol-name { flex: 1; min-width: 0; font-size: 13px; }
.order-line .ol-qty { color: var(--text-2); font-size: 12px; }
.order-line .ol-price { color: var(--text); font-weight: 600; font-size: 13px; min-width: 56px; text-align: right; }
.order-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--border); }
.order-foot .of-total { color: var(--price); font-weight: 700; }
.order-foot .of-actions { display: flex; gap: 8px; }
.mini-btn { height: 30px; padding: 0 14px; border-radius: 15px; border: 1px solid var(--border); font-size: 13px; color: var(--text); }
.mini-btn.danger { color: var(--price); border-color: #ffd2c8; }

/* ===== 登录 / 表单 ===== */
.auth-wrap { max-width: 400px; margin: 40px auto; padding: 0 20px; }
.auth-card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 26px 22px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 20px; }
.auth-logo .mark { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; display: grid; place-items: center; }
.auth-logo h1 { font-size: 20px; }
.auth-logo p { color: var(--text-2); font-size: 13px; }
.auth-tabs { display: flex; background: var(--bg); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.auth-tabs button { flex: 1; height: 36px; border-radius: 8px; color: var(--text-2); font-weight: 600; }
.auth-tabs button.active { background: var(--surface); color: var(--brand-dark); box-shadow: var(--shadow); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input { width: 100%; height: 44px; border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; outline: none; }
.field input:focus { border-color: var(--brand); }
.auth-tip { color: var(--text-2); font-size: 12px; text-align: center; margin-top: 14px; }

/* ===== 通用组件 ===== */
.empty { text-align: center; color: var(--text-2); padding: 60px 20px; }
.empty .ic { width: 56px; height: 56px; color: var(--text-3); margin: 0 auto 12px; }
.bar-title { font-size: 18px; font-weight: 700; padding: 16px 16px 8px; display: flex; align-items: center; gap: 8px; }
.back-bar { position: sticky; top: 0; z-index: 20; height: 48px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; padding: 0 12px; font-weight: 600; }
.back-bar .icon-btn { width: 36px; height: 36px; display: grid; place-items: center; color: var(--text); }
.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 200;
  background: rgba(0,0,0,.82); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px;
  opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 80%;
}
.toast.show { opacity: 1; }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot { display: grid; place-items: center; height: 100vh; color: var(--text-2); }

/* 管理台 */
.admin-form { padding: 16px; display: flex; flex-direction: column; gap: 14px; max-width: 560px; margin: 0 auto; }
.upload-box { border: 1.5px dashed var(--border); border-radius: 12px; padding: 18px; text-align: center; color: var(--text-2); }
.upload-box .prev { width: 120px; height: 120px; border-radius: 10px; margin: 0 auto 10px; overflow: hidden; background: #f0f1f3; display: none; }
.upload-box .prev.show { display: block; }

/* ===== Hero 首页横幅 ===== */
.hero { background: linear-gradient(120deg, var(--brand), var(--brand-dark)); color: #fff; }
.hero-inner { display: flex; align-items: center; justify-content: space-between; padding: 22px 16px; gap: 16px; }
.hero-text h2 { font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.hero-text p { opacity: .9; margin-top: 4px; font-size: 14px; }
.hero-search {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  background: rgba(255,255,255,.95); color: var(--text-2);
  padding: 8px 16px; border-radius: 20px; font-size: 13px;
}
.hero-art { background: rgba(255,255,255,.16); border-radius: 18px; width: 84px; height: 84px; display: grid; place-items: center; flex: none; }

/* ===== 结算弹层 ===== */
.overlay {
  position: fixed; inset: 0; z-index: 120; background: rgba(0,0,0,.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--surface); width: 100%; max-width: var(--maxw);
  border-radius: 16px 16px 0 0; padding: 16px 18px calc(18px + env(safe-area-inset-bottom));
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 16px; margin-bottom: 14px; }
.sheet-head .icon-btn { width: 34px; height: 34px; display: grid; place-items: center; color: var(--text-2); }

@media (min-width: 720px) {
  .overlay { align-items: center; }
  .sheet { border-radius: 16px; max-width: 460px; }
}

/* ===== 开屏广告 ===== */
.splash { position: fixed; inset: 0; z-index: 300; background: linear-gradient(135deg, #ff6a3d, #c9410f); display: grid; place-items: center; }
.splash-media { width: 100%; height: 100%; }
.splash-media img { width: 100%; height: 100%; object-fit: cover; }
.splash-skip {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px;
  background: rgba(0,0,0,.35); color: #fff; border-radius: 16px; padding: 7px 14px; font-size: 13px;
}

/* ===== 弹窗广告 ===== */
.ad-modal { position: fixed; inset: 0; z-index: 250; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 24px; }
.ad-modal-box { position: relative; width: 100%; max-width: 340px; background: #fff; border-radius: 14px; overflow: hidden; padding-bottom: 14px; }
.ad-modal-close {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.4); color: #fff;
  font-size: 18px; line-height: 30px; text-align: center;
}
.ad-modal-media { height: 190px; background: #f0f1f3; }
.ad-modal-media img { width: 100%; height: 100%; object-fit: cover; }
.ad-modal-title { padding: 14px 16px 10px; font-weight: 700; font-size: 15px; text-align: center; }
.ad-modal-box .btn { margin: 0 16px; width: calc(100% - 32px); }

/* ===== 首页大图轮播 ===== */
.carousel { position: relative; overflow: hidden; border-radius: 12px; margin: 12px; background: #f0f1f3; }
.carousel-track { position: relative; width: 100%; aspect-ratio: 16/7; }
.carousel-item { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; }
.carousel-item.active { opacity: 1; }
.carousel-item img { width: 100%; height: 100%; object-fit: cover; }
.carousel-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.carousel-dots .dot { width: 7px; height: 7px; border-radius: 4px; background: rgba(255,255,255,.55); transition: width .3s; }
.carousel-dots .dot.active { width: 18px; background: #fff; }

/* 广告位无图时统一占位 */
.banner-ph {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 16px;
  background: linear-gradient(135deg, #ff8a5c, #e8541e); color: #fff;
}
.banner-ph-title { font-size: 20px; font-weight: 800; line-height: 1.3; }
.banner-ph-sub { font-size: 12px; opacity: .9; }

/* ===== 个人中心 / 会员卡 ===== */
.member-card { margin: 12px; border-radius: 14px; padding: 16px; color: #fff; background: linear-gradient(135deg, #ff8a5c, #e8541e); }
.mc-top { display: flex; align-items: center; gap: 12px; }
.mc-avatar { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; overflow: hidden; flex: none; }
.mc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mc-info { flex: 1; min-width: 0; }
.mc-name { font-size: 17px; font-weight: 800; }
.mc-level { font-size: 12px; opacity: .95; margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.mc-edit { background: rgba(255,255,255,.22); border-radius: 14px; padding: 6px 10px; font-size: 12px; display: flex; align-items: center; gap: 4px; flex: none; }
.mc-points { display: flex; margin-top: 16px; }
.mc-points > div { flex: 1; text-align: center; }
.p-v { font-size: 18px; font-weight: 800; }
.p-k { font-size: 11px; opacity: .9; margin-top: 2px; }
.mc-progress { margin-top: 14px; }
.mp-label { display: flex; justify-content: space-between; font-size: 11px; opacity: .95; margin-bottom: 6px; }
.mp-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.3); overflow: hidden; }
.mp-bar i { display: block; height: 100%; background: #fff; border-radius: 3px; }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 12px; }
.quick { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 4px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--text); }
.quick:active { background: var(--bg); }

.panel-box { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin: 12px; overflow: hidden; }
.pb-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; }
.pb-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pb-body input { height: 42px; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; outline: none; }
.pb-link { display: flex; align-items: center; gap: 8px; padding: 14px; font-weight: 600; }

.point-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.point-row:last-child { border-bottom: none; }
.pr-reason { font-size: 13px; }
.pr-time { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.pr-change { font-weight: 800; font-size: 15px; flex: none; }
.pr-change.plus { color: var(--success); }
.pr-change.minus { color: var(--price); }

/* ===== 支付页 ===== */
.pay-amount { margin: 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px; text-align: center; }
.pa-k { color: var(--text-2); font-size: 13px; }
.pa-v { color: var(--price); font-size: 30px; font-weight: 800; margin-top: 4px; }
.pa-m { color: var(--text-2); font-size: 12px; margin-top: 6px; font-family: ui-monospace, monospace; }
.pa-discount { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; background: #fff2ed; color: var(--brand-dark); border-radius: 12px; padding: 5px 12px; font-size: 12px; font-weight: 600; }

.pay-method { display: flex; align-items: center; gap: 10px; padding: 11px 0; cursor: pointer; border-bottom: 1px solid var(--border); }
.pay-method:last-child { border-bottom: none; }
.pm-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); flex: none; }
.pay-method.active .pm-radio { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px #fff; }
.pay-method.active .pm-name { font-weight: 700; color: var(--brand-dark); }

.qr-box { text-align: center; }
.qr-box img { max-width: 220px; margin: 0 auto; border-radius: 10px; border: 1px solid var(--border); }
.qr-tip { color: var(--text-2); font-size: 12px; margin-top: 8px; }
.qr-empty { color: var(--text-2); font-size: 13px; padding: 14px 0; }

.proof-box { text-align: center; }
.proof-preview { width: 140px; height: 140px; margin: 0 auto 10px; border-radius: 10px; overflow: hidden; background: #f0f1f3; display: none; }
.proof-preview.show { display: block; }
.proof-preview img { width: 100%; height: 100%; object-fit: cover; }
.proof-url { color: var(--text-2); font-size: 12px; margin-top: 8px; word-break: break-all; }

/* tabbar 徽标定位基准 */
.tabbar a { position: relative; }

/* ===== 手机端适配（覆盖各类机型） ===== */

/* 手机通用：收紧边距 */
@media (max-width: 719px) {
  .container { padding: 0 12px; }
  .grid { gap: 10px; padding: 0 12px; }
  .cat-scroll { padding: 12px; }
  .order-card { margin: 0 12px 10px; }
  .cart-list { padding: 0 12px; }
  .type-tabs { padding: 10px 12px 0; }
}

/* 主流手机（360–400px） */
@media (max-width: 400px) {
  .header { gap: 8px; padding: 0 10px; }
  .header .logo { font-size: 15px; gap: 6px; }
  .header .logo .mark { width: 28px; height: 28px; border-radius: 7px; }
  .header .search { height: 34px; padding: 0 10px; min-width: 0; }
  .header .search input { font-size: 13px; min-width: 0; }
  .header .nav-icons { gap: 2px; }
  .header .icon-btn { width: 36px; height: 36px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .hero-inner { padding: 18px 12px; }
  .hero-text h2 { font-size: 21px; }
  .hero-art { width: 68px; height: 68px; }
  .card .add { width: 34px; height: 34px; }
  .cat-chip { min-width: 68px; padding: 9px 10px; font-size: 12px; }
  .type-tab { height: 42px; font-size: 14px; }
  .btn { height: 42px; font-size: 14px; }
  .bar-title { font-size: 16px; }
}

/* 超小屏（≤360px：iPhone SE 一代、老旧安卓） */
@media (max-width: 360px) {
  .header .logo { font-size: 0; gap: 0; }         /* 仅保留品牌图标 */
  .header .logo .mark { width: 30px; height: 30px; }
  .header .search input { font-size: 12px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); }
  .card .name { font-size: 13px; }
  .card .price { font-size: 15px; }
  .card .sales { font-size: 11px; }
  .tabbar a { font-size: 10px; }
  .container, .grid { padding-left: 10px; padding-right: 10px; }
  .cat-chip { min-width: 62px; }
}

/* 触摸设备：放大可点区域（符合 44px 触控建议） */
@media (pointer: coarse) {
  .stepper button { width: 40px; height: 40px; }
  .stepper .num { min-width: 40px; }
  .card .add { width: 36px; height: 36px; }
  .mini-btn { height: 34px; }
  .cat-chip { min-height: 44px; }
  .header .icon-btn { width: 40px; height: 40px; }
  .ci-del { width: 36px; height: 36px; }
}

/* 横屏矮屏：压缩纵向空间 */
@media (max-height: 480px) and (orientation: landscape) {
  .hero-inner { padding: 12px 16px; }
  .hero-art { display: none; }
  .hero-text h2 { font-size: 19px; }
}

@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .tabbar { display: none; }
  .detail-actions, .cart-bar { max-width: var(--maxw); margin: 0 auto; left: 50%; transform: translateX(-50%); }
  .page { padding-bottom: 30px; }
}
