:root {
  /* 品牌绿：微调更沉稳；大面积色块改用 --primary-grad 同色系微渐变提升质感（不改布局/尺寸） */
  --primary: #3fa80f;
  --primary-dark: #2f7d0a;
  --primary-light: #7ed12b;
  --primary-bg: #eaf6db;
  --primary-grad: linear-gradient(135deg, #52c022 0%, #3fa80f 58%, #358f0c 100%);
  --accent: #ff5527;
  --accent-light: #ff8a3d;
  --price: #ff5527;
  --danger: #E53935;
  /* 中性阶：去脏灰、微绿调；弱化文字加深以保证白底对比度 */
  --text: #1f2420;
  --text-sub: #5c6359;
  --text-mute: #7d8478;
  --bg: #f4f6f2;
  --card: #fff;
  --border: #ebeee8;
  --fill: #f1f3ee;
  --fill-strong: #e7eae3;
  /* 阴影：纯黑→带绿调，柔化分层 */
  --shadow-sm: 0 1px 2px rgba(26,32,24,.05), 0 1px 3px rgba(26,32,24,.05);
  --shadow-md: 0 2px 6px rgba(26,32,24,.06), 0 8px 24px rgba(26,32,24,.07);
  --shadow-lg: 0 6px 18px rgba(26,32,24,.08), 0 18px 44px rgba(26,32,24,.10);
  --r: 16px;
  --r-sm: 10px;
  --r-tag: 4px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; min-height: 100vh; font-family: -apple-system, "PingFang SC", "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, textarea { font-family: inherit; border: none; outline: none; background: transparent; resize: none; }
ul, li { list-style: none; }
img { display: block; }

.app { width: 100%; max-width: 414px; min-height: 100vh; margin: 0 auto; background: var(--bg); position: relative; overflow: hidden; }

/* ===== Page nav header ===== */
.page-header { position: fixed; top: 0; left: 0; right: 0; max-width: 414px; margin: 0 auto; background: var(--primary-grad); z-index: 100; overflow: hidden; }
.page-header .statusbar { height: 44px; }
.page-header .nav { display: flex; align-items: center; padding: 0 12px 12px; gap: 8px; position: relative; }
.page-header .nav .back { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.page-header .nav .back svg { width: 20px; height: 20px; color: #fff; }
.page-header .nav .title { flex: 1; text-align: center; color: #fff; font-size: 17px; font-weight: 700; }
.page-header .nav .title.left { text-align: left; }
.page-header .nav .nav-right { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.page-header .nav .nav-right svg { width: 22px; height: 22px; color: #fff; }

/* ===== Fixed header (home style) ===== */
.header { position: fixed; top: 0; left: 0; right: 0; max-width: 414px; margin: 0 auto; background: var(--primary-grad); z-index: 100; overflow: hidden; }
.header-inner { position: relative; z-index: 1; }
.statusbar { height: 44px; }
.search-row { padding: 0 12px 12px; }
.search-box { display: flex; align-items: center; background: #fff; border-radius: 18px; padding: 0 14px; height: 36px; gap: 8px; cursor: pointer; box-shadow: 0 2px 6px rgba(26,32,24,.05); }
.search-box svg.s-ic { width: 16px; height: 16px; color: #7d8478; flex-shrink: 0; }
.search-box .ph { flex: 1; color: #7d8478; font-size: 13px; }
.search-box .go { color: var(--accent); font-size: 13px; font-weight: 700; }

.addr-row { display: flex; align-items: center; padding: 0 12px 12px; gap: 8px; }
.loc { display: flex; align-items: center; gap: 2px; flex-shrink: 0; cursor: pointer; padding: 2px 0; }
.loc svg { width: 14px; height: 14px; color: #fff; }
.loc span { color: #fff; font-size: 14px; font-weight: 700; }
.loc svg.dd { width: 10px; height: 10px; color: rgba(255,255,255,0.7); }
.addr-box { flex: 1; background: rgba(0,0,0,0.12); border-radius: 16px; padding: 5px 12px; display: flex; align-items: center; gap: 6px; overflow: hidden; cursor: pointer; min-width: 0; }
.addr-box .msg { flex: 1; color: #fff; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addr-box svg { width: 12px; height: 12px; color: rgba(255,255,255,0.7); flex-shrink: 0; }
.nav-btns { display: flex; gap: 6px; flex-shrink: 0; }
.nav-btn { position: relative; display: flex; align-items: center; border: 1px solid rgba(255,255,255,0.6); border-radius: 14px; padding: 3px 8px; gap: 3px; cursor: pointer; }
.nav-btn svg { width: 12px; height: 12px; color: #fff; }
.nav-btn .lbl { color: #fff; font-size: 12px; font-weight: 600; }
.nav-btn .badge { position: absolute; top: -4px; right: -3px; background: var(--accent); border: 1px solid #fff; border-radius: 8px; min-width: 14px; height: 14px; padding: 0 3px; display: flex; align-items: center; justify-content: center; font-size: 9px; color: #fff; font-weight: 700; line-height: 1; }

/* Sticky category nav */
.sticky-nav { display: flex; align-items: center; padding: 8px 12px 10px; opacity: 0; height: 0; overflow: hidden; transition: opacity 0.15s ease; gap: 0; }
.sticky-nav.show { opacity: 1; height: auto; }
.sticky-nav .si { width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-right: 2px; background: rgba(255,255,255,0.2); border-radius: 8px; cursor: pointer; }
.sticky-nav .si:last-child { margin-right: 0; }
.sticky-nav .si svg { width: 100%; height: 100%; }

/* ===== Scroll content area ===== */
.scroll { margin-top: 0; padding-top: 110px; height: 100vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.scroll::-webkit-scrollbar { display: none; }
.page-scroll { padding-top: 88px; padding-bottom: 100px; min-height: 100vh; overflow-y: auto; }
.page-scroll::-webkit-scrollbar { display: none; }

/* Gradient extension region */
.gradient-region { background: linear-gradient(180deg, var(--primary) 0%, var(--primary) 20%, #b8e566 50%, #e3f7c5 75%, #f7fce8 90%, var(--bg) 100%); position: relative; overflow: hidden; }
.glow { position: absolute; border-radius: 50%; pointer-events: none; }
.glow-1 { top: 30px; left: -30px; width: 140px; height: 140px; background: radial-gradient(circle, rgba(109,213,237,0.25) 0%, rgba(109,213,237,0) 70%); }
.glow-2 { top: 80px; right: -20px; width: 130px; height: 130px; background: radial-gradient(circle, rgba(139,92,246,0.2) 0%, rgba(139,92,246,0) 70%); }
.glow-3 { bottom: 100px; left: 30px; width: 110px; height: 110px; background: radial-gradient(circle, rgba(255,195,113,0.2) 0%, rgba(255,195,113,0) 70%); }
.glow-4 { bottom: 40px; right: 40px; width: 100px; height: 100px; background: radial-gradient(circle, rgba(244,114,182,0.15) 0%, rgba(244,114,182,0) 70%); }

/* Banner */
.banner-wrap { padding: 8px 12px 0; position: relative; z-index: 1; }
.banner-track { position: relative; width: 100%; aspect-ratio: 390 / 160; border-radius: var(--r); overflow: hidden; box-shadow: 0 4px 16px rgba(26,32,24,.09);margin-top: 32px; }
.banner-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s ease; cursor: pointer; }
.banner-slide.active { opacity: 1; }
.banner-slide svg { width: 100%; height: 100%; display: block; }
.banner-dots { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; z-index: 2; }
.banner-dots .dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.5); transition: all 0.2s; }
.banner-dots .dot.active { background: #fff; width: 16px; border-radius: 3px; }

/* Announcement */
.announce { margin: 10px 12px 0; padding: 0 12px; height: 36px; display: flex; align-items: center; background: rgba(255,255,255,0.92); border-radius: 12px; gap: 6px; overflow: hidden; cursor: pointer; position: relative; z-index: 1; box-shadow: 0 2px 8px rgba(26,32,24,.05); }
.announce .m-ic { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); }
.announce .tag { background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px; flex-shrink: 0; }
.announce .text { flex: 1; color: var(--text); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 5x2 category grid */
.grid-wrap { padding: 12px; margin: 8px 12px 0; background: rgba(255,255,255,0.4); border-radius: var(--r); position: relative; z-index: 1; backdrop-filter: blur(2px); }
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.grid-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.grid-item .ic { width: 100%; aspect-ratio: 1 / 1; overflow: hidden; flex-shrink: 0; background: #fff; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.grid-item .ic svg { width: 70%; height: 70%; }
.grid-item .nm { font-size: 11px; color: var(--text); margin-top: 4px; text-align: center; font-weight: 500; }

/* Marketing tiles */
.tiles { display: flex; gap: 8px; padding: 16px 12px 8px; }
.tile { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 12px 0; border-radius: 14px; cursor: pointer; color: #fff; font-weight: 700; font-size: 13px; box-shadow: 0 2px 8px rgba(26,32,24,.07); }
.tile svg { width: 14px; height: 14px; }
.tile.t1 { background: linear-gradient(135deg, #ff7a3d, var(--accent)); }
.tile.t2 { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.tile.t3 { background: linear-gradient(135deg, #6dc319, var(--primary)); }

/* Cards common */
.card { background: #fff; border-radius: var(--r); overflow: hidden; box-shadow: 0 2px 8px rgba(26,32,24,.05); }
.card-hd { display: flex; align-items: center; padding: 14px 16px 10px; gap: 8px; }
.card-hd .ic-box { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-hd .ic-box svg { width: 15px; height: 15px; }
.card-hd .ttl { flex: 1; min-width: 0; }
.card-hd .ttl .t1 { font-size: 17px; font-weight: 800; color: var(--text); line-height: 1.2; }
.card-hd .ttl .t2 { font-size: 11px; color: var(--text-mute); margin-top: 2px; }
.card-hd .more { display: flex; align-items: center; gap: 1px; color: var(--text-mute); font-size: 11px; cursor: pointer; }
.card-hd .more svg { width: 10px; height: 10px; }

/* Restock section */
.restock { margin: 12px; }
.restock .ic-box { background: #FFF3E0; }
.restock .ic-box svg { color: #F57C00; }
.restock .row { display: flex; align-items: center; padding: 10px 16px; gap: 12px; cursor: pointer; border-top: 1px solid var(--border); }
.restock .row .thumb { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: #f1f3ee; flex-shrink: 0; }
.restock .row .thumb svg { width: 100%; height: 100%; }
.restock .row .info { flex: 1; min-width: 0; }
.restock .row .info .nm { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.restock .row .info .meta { font-size: 11px; margin-top: 4px; }
.restock .row .info .meta.high { color: var(--danger); }
.restock .row .info .meta.mid { color: #F57C00; }
.restock .row .price { font-size: 18px; color: var(--price); font-weight: 800; flex-shrink: 0; }
.restock .row .price::before { content: '¥'; font-size: 12px; margin-right: 1px; font-weight: 600; }

/* Discount section */
.promo { margin: 12px; }
.promo-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; padding: 0 4px; }
.promo-hd .left { display: flex; align-items: baseline; gap: 8px; }
.promo-hd .left .t1 { font-size: 17px; font-weight: 800; color: var(--text); }
.promo-hd .left .t2 { font-size: 12px; color: var(--accent); font-weight: 600; }
.promo-hd .right { display: flex; align-items: center; gap: 1px; color: var(--text-mute); font-size: 11px; cursor: pointer; }
.promo-hd .right svg { width: 10px; height: 10px; }
.promo-row { display: flex; gap: 8px; }
.promo-row .box { flex: 1; background: #fff; overflow: hidden; border-radius: 14px; cursor: pointer; box-shadow: 0 2px 8px rgba(26,32,24,.05); }
.promo-row .box .top { padding: 0 12px; height: 50px; display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--danger); font-weight: 800; }
.promo-row .box .bot { padding: 8px 10px; background: linear-gradient(135deg, var(--danger), #f06292); height: 46px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 600; }

/* Hot sales */
.hotsales { margin: 12px; }
.hotsales .ic-box { background: #FFEBEE; }
.hotsales .ic-box svg { color: var(--danger); }
.hotsales-scroll { overflow-x: auto; padding: 4px 16px 16px; white-space: nowrap; -webkit-overflow-scrolling: touch; }
.hotsales-scroll::-webkit-scrollbar { display: none; }
.hotsales-track { display: inline-flex; gap: 10px; }
.hotsale-item { position: relative; width: 96px; flex-shrink: 0; display: inline-block; cursor: pointer; white-space: normal; vertical-align: top; }
.hotsale-item .rank { position: absolute; top: 0; left: 0; z-index: 2; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 800; border-radius: 0 0 8px 0; }
.hotsale-item .rank.top { background: linear-gradient(135deg, var(--danger), #f06292); }
.hotsale-item .rank.norm { background: #a8afa3; }
.hotsale-item .thumb { width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: #f1f3ee; }
.hotsale-item .thumb svg { width: 100%; height: 100%; }
.hotsale-item .nm { font-size: 12px; color: var(--text); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.hotsale-item .meta { display: flex; align-items: baseline; gap: 4px; margin-top: 2px; }
.hotsale-item .meta .pr { font-size: 15px; color: var(--price); font-weight: 800; }
.hotsale-item .meta .pr::before { content: '¥'; font-size: 10px; margin-right: 1px; }
.hotsale-item .meta .sa { font-size: 10px; color: var(--text-mute); }

/* Product grid */
.products { padding: 0 10px 112px; }
.products-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.pcard { width: calc(50% - 5px); background: #fff; border-radius: 12px; overflow: hidden; cursor: pointer; position: relative; }
.pcard .pimg { position: relative; aspect-ratio: 1 / 1; background: linear-gradient(135deg, var(--pc-cat-from, #66BB6A), var(--pc-cat-to, #4CAF50)); overflow: hidden; }
.pcard .pimg svg { width: 100%; height: 100%; color: rgba(255,255,255,.85); }
.pcard .promo-tag { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: row; align-items: center; gap: 4px; z-index: 2; }
.pcard .promo-tag .badge { background: #E53935; border-radius: 4px; padding: 3px 6px; height: 20px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 1px; line-height: 14px; }
.pcard .promo-tag .badge.specialty { background: #FFC107; color: #5D4037; }
.pcard .promo-tag .badge.new { background: #43A047; }
.pcard .promo-tag .badge.feat { background: #1f2420; color: #F5D78E; }
.pcard .promo-tag .badge.fresh { background: #00897B; }
.pcard .promo-tag .desc { background: rgba(255,193,7,0.15); border-radius: 4px; padding: 2px 6px; height: 20px; display: flex; align-items: center; justify-content: center; color: #F9A825; font-size: 10px; font-weight: 500; line-height: 14px; }
.pcard .promo-tag .desc.fresh { background: rgba(0,137,123,0.12); color: #00897B; }
.pcard .promo-tag .desc.new { background: rgba(67,160,71,0.15); color: #43A047; }
.pcard .promo-tag .desc.feat { background: rgba(26,26,26,0.12); color: #B8860B; }
.pcard .promo-tag .cd { background: rgba(229,57,53,0.15); border-radius: 4px; padding: 2px 4px; height: 20px; display: flex; align-items: center; justify-content: center; color: #E53935; font-size: 14px; font-weight: 700; line-height: 16px; font-variant-numeric: tabular-nums; }
.pcard .promo-tag .cn { color: #E53935; font-size: 14px; font-weight: 700; line-height: 16px; margin: 0 1px; }
.pcard .ph { padding: 12px 12px 0; }
.pcard .pname { font-size: 16px; color: #262b26; font-weight: 700; line-height: 22px; height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.2px; }
.pcard .selling-tags { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 6px; margin-top: 8px; overflow: hidden; }
.pcard .selling-tags .stag { background: #E53935; border-radius: 4px; padding: 3px 6px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 500; line-height: 14px; }
.pcard .selling-tags .stag.green { background: #43A047; }
.pcard .selling-tags .stag.blue { background: #1E88E5; }
.pcard .selling-tags .stag.brown { background: #8D6E63; }
.pcard .selling-tags .stag.orange { background: #FF6D00; }
.pcard .meta { margin-top: 8px; }
.pcard .sales { font-size: 14px; color: #5c6359; line-height: 18px; }
.pcard .unit-price { font-size: 12px; color: #E53935; line-height: 18px; }
.pcard .pfoot { display: flex; flex-direction: row; align-items: flex-end; justify-content: space-between; padding: 8px 12px 12px; margin-top: 4px; }
.pcard .pprice { display: flex; flex-direction: row; align-items: baseline; flex: 1; color: #E53935; font-weight: 700; font-family: "PingFang SC","Noto Sans SC",sans-serif; }
.pcard .pprice .cur { font-size: 14px; line-height: 22px; }
.pcard .pprice .int { font-size: 22px; line-height: 22px; letter-spacing: -0.5px; }
.pcard .pprice .dec { font-size: 14px; line-height: 22px; }
.pcard .padd { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #E53935, #EF5350); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 6px rgba(229,57,53,0.3); }
.pcard .padd svg { width: 14px; height: 14px; color: #fff; }
/* - N + 数字步进器（点击加号后切换） */
.pcard .pstep { flex-shrink: 0; display: flex; align-items: center; gap: 4px; }
.pcard .pstp { width: 26px; height: 26px; border-radius: 50%; border: none; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; line-height: 1; box-shadow: 0 2px 6px rgba(229,57,53,0.3); }
/* + 实心红圆（主操作） */
.pcard .pstp.add { background: linear-gradient(135deg, #E53935, #EF5350); }
/* - 浅灰底灰边（次要弱化） */
.pcard .pstp.min { background: #f1f3ee; color: #7d8478; border: 1px solid #dde1d9; box-shadow: none; }
.pcard .pstp.min:active { background: #e9ece6; }
.pcard .pstp svg { width: 14px; height: 14px; }
/* 中间数字：红字无边框（显示态，不抢眼） */
.pcard .pstp.num { background: transparent; color: #E53935; border: none; box-shadow: none; font-size: 18px; font-weight: 700; min-width: 26px; cursor: default; }

/* Bottom TabBar — 白底，选中绿色，未选中 #6a7269 */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; max-width: 414px; margin: 0 auto; background: #fff; display: flex; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); z-index: 50; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; padding: 3px 0; text-decoration: none; color: #6a7269; }
.tab svg { width: 22px; height: 22px; }
.tab .tl { font-size: 10px; color: #6a7269; }
.tab.active svg { color: var(--primary); }
.tab.active .tl { color: var(--primary); font-weight: 600; }

/* Toast */
.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,0.82); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
.toast.show { opacity: 1; }

/* Action sheet */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 998; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.mask.show { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; bottom: 0; left: 0; right: 0; max-width: 414px; margin: 0 auto; background: #f3f5f0; border-radius: 16px 16px 0 0; z-index: 999; transform: translateY(100%); transition: transform 0.25s; padding-bottom: env(safe-area-inset-bottom); }
.sheet.show { transform: translateY(0); }
.sheet-hd { padding: 14px; text-align: center; font-size: 14px; color: #7d8478; border-bottom: 1px solid var(--border); background: #fff; border-radius: 16px 16px 0 0; }
.sheet-list { background: #fff; max-height: 60vh; overflow-y: auto; }
.sheet-item { padding: 14px; text-align: center; font-size: 15px; color: var(--text); border-bottom: 1px solid var(--border); cursor: pointer; }
.sheet-item:last-child { border-bottom: none; }
.sheet-item:active { background: #f1f3ee; }
.sheet-cancel { margin-top: 8px; padding: 14px; text-align: center; font-size: 15px; color: var(--text); background: #fff; cursor: pointer; }
.sheet-cancel:active { background: #f1f3ee; }

/* ===== 通用弹窗（qxModal / data-modal / data-close） ===== */
.modal { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; }
.modal.open { display: flex; }
.modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.modal-panel { position: relative; width: 86%; max-width: 340px; background: #fff; border-radius: 16px; padding: 18px; animation: modalIn 0.2s ease; box-sizing: border-box; }
.modal-panel.sheet { align-self: flex-end; margin-bottom: 0; border-radius: 16px 16px 0 0; width: 100%; max-width: 414px; transform: none; animation: sheetUp 0.22s ease forwards; }
@keyframes modalIn { from { transform: translateY(20px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.modal-hd { display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 700; color: #262b26; margin-bottom: 12px; }
.modal-x { font-size: 22px; color: #7d8478; cursor: pointer; line-height: 1; }
.modal-bd { font-size: 14px; color: #4a5148; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; text-align: center; }
.modal .form-row { display: block; margin-bottom: 12px; }
.modal .form-row label { display: block; font-size: 13px; color: #5c6359; margin-bottom: 6px; white-space: nowrap; }
.modal .form-row input,
.modal .form-row select,
.modal .form-row textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 15px; outline: none; }
.modal .form-row input:focus,
.modal .form-row select:focus,
.modal .form-row textarea:focus { border-color: var(--primary); }
.modal .form-row .check-row { display: flex; align-items: center; gap: 8px; padding: 4px 2px; }
.modal .form-row .check-row input[type=checkbox] { width: auto; margin: 0; }
.modal .form-row .check-row label { margin: 0; }

/* Fly-to-cart animation */
.fly-dot { position: fixed; width: 24px; height: 24px; border-radius: 50%; background: var(--primary-grad); z-index: 9999; pointer-events: none; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700; transition: all 0.7s cubic-bezier(0.5, -0.3, 0.5, 1.5); box-shadow: 0 2px 8px rgba(76,176,20,0.4); }

/* Search overlay */
.search-overlay { position: fixed; inset: 0; background: var(--bg); z-index: 200; transform: translateY(-100%); transition: transform 0.25s; display: flex; flex-direction: column; }
.search-overlay.show { transform: translateY(0); }
.search-bar { background: var(--primary-grad); padding: 44px 12px 12px; display: flex; align-items: center; gap: 8px; }
.search-bar .box { flex: 1; display: flex; align-items: center; background: #fff; border-radius: 18px; padding: 0 14px; height: 36px; gap: 8px; }
.search-bar .box svg { width: 16px; height: 16px; color: #7d8478; }
.search-bar .box input { flex: 1; font-size: 14px; color: var(--text); }
.search-bar .box input::placeholder { color: #7d8478; }
.search-bar .cancel { color: #fff; font-size: 14px; padding: 8px; cursor: pointer; }
.search-suggest { padding: 20px 16px; }
.search-suggest h4 { font-size: 13px; color: var(--text-mute); margin-bottom: 10px; font-weight: normal; }
.search-suggest .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.search-suggest .tags span { padding: 6px 12px; background: #fff; border-radius: 16px; font-size: 13px; color: var(--text); cursor: pointer; }

.tab-page { display: none; }
.tab-page.active { display: block; }
.empty-page { padding: 80px 20px; text-align: center; color: #7d8478; }
.empty-page svg { width: 80px; height: 80px; margin: 0 auto 16px; opacity: 0.3; }
.empty-page h3 { font-size: 16px; color: #5c6359; margin-bottom: 6px; }
.empty-page p { font-size: 13px; color: var(--text-mute); }

/* ===== Utility ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; min-width: 0; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.p-3 { padding: 12px; }
.m-3 { margin: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-3 { margin-bottom: 12px; }
.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.bg-white { background: #fff; }
.text-sub { color: var(--text-sub); }
.text-mute { color: var(--text-mute); }
.text-price { color: var(--price); }
.font-bold { font-weight: 700; }
.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Profile dark header ===== */
.profile-header { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); padding: 56px 16px 32px; }
.profile-avatar { width: 56px; height: 56px; border-radius: 28px; background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; overflow: hidden; color: #fff; font-size: 24px; }
.member-card { margin: -16px 12px 0; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 16px rgba(26,32,24,.12); }

/* ===== Cart page ===== */
.cart-badge-row { display: flex; justify-content: space-around; padding: 10px 16px; margin: 10px 10px 0; background: #fff; border: 1px solid rgba(26,32,24,.07); border-radius: 8px; }
.cart-badge-row .item { display: flex; align-items: center; gap: 4px; font-size: 14px; color: #262b26; font-weight: 600; }
.cart-item-row { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cart-item-row:last-child { border-bottom: none; }
.cart-check { width: 22px; height: 22px; border-radius: 11px; background: #ebeee8; display: flex; align-items: center; justify-content: center; margin-right: 10px; flex-shrink: 0; cursor: pointer; }
.cart-check.checked { background: var(--primary-grad); }
.cart-check svg { width: 14px; height: 14px; color: #262b26; }
.cart-thumb { width: 72px; height: 72px; border-radius: 8px; background: #ebeee8; display: flex; align-items: center; justify-content: center; margin-right: 10px; flex-shrink: 0; overflow: hidden; }
.cart-thumb svg { width: 100%; height: 100%; }
.cart-del { flex-shrink: 0; width: 28px; height: 28px; margin-left: 8px; display: flex; align-items: center; justify-content: center; color: #a8afa3; cursor: pointer; align-self: center; }
.cart-qty { display: flex; align-items: center; gap: 0; flex-shrink: 0; }
.cart-qty .btn { width: 26px; height: 26px; border-radius: 13px; display: flex; align-items: center; justify-content: center; }
.cart-qty .btn.minus { background: #f1f3ee; }
.cart-qty .btn.plus { background: var(--primary-grad); }
.cart-qty .num { width: 28px; text-align: center; font-size: 14px; font-weight: 700; }
.cart-bar { position: fixed; bottom: 50px; left: 0; right: 0; max-width: 414px; margin: 0 auto; background: #fff; border-top: 1px solid var(--border); display: flex; align-items: center; padding: 8px 12px; gap: 12px; z-index: 40; }
.cart-bar .cart-check { flex-shrink: 0; }
.cart-bar > .select-all { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.cart-bar .total { flex: 1; font-size: 16px; font-weight: 700; color: var(--price); text-align: right; }
.cart-bar .checkout { background: var(--primary-grad); color: #fff; padding: 10px 22px; border-radius: 22px; font-weight: 700; font-size: 15px; cursor: pointer; flex-shrink: 0; }

/* 吸顶购物车结算栏（分类页下滑后出现在顶部导航下方，对齐原项目 CartBar topPosition + 满减进度条） */
.cart-bar-sticky {
  position: fixed; left: 10px; right: 10px; top: 88px;
  max-width: 394px; margin: 0 auto;
  background: #fff; z-index: 90;
  display: flex; align-items: center; gap: 10px;
  height: 60px; padding: 0 0 0 12px;
  box-shadow: 0 -1px 0 rgba(26,32,24,.07), 0 2px 8px rgba(26,32,24,.09);
  border-radius: 0;
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  --cb-theme: var(--danger);
}
.cart-bar-sticky.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
/* 左：购物车图标 + 数量角标 */
.cart-bar-sticky .cb-cart {
  position: relative; flex-shrink: 0; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.cart-bar-sticky .cb-cart svg { stroke: var(--cb-theme); }
.cart-bar-sticky .cb-count {
  position: absolute; top: -6px; right: -8px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--cb-theme); color: #fff; border: 1px solid #fff; border-radius: 8px;
  font-size: 10px; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center;
}
/* 中：满减规则 + 进度条 */
.cart-bar-sticky .cb-middle { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.cart-bar-sticky .cb-rule-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cart-bar-sticky .cb-rule { font-size: 15px; color: #262b26; font-weight: 700; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-bar-sticky .cb-saved { font-size: 15px; color: var(--cb-theme); font-weight: 700; line-height: 20px; white-space: nowrap; }
.cart-bar-sticky .cb-progress-row { display: flex; align-items: center; gap: 4px; }
.cart-bar-sticky .cb-progress { width: 95px; height: 10px; background: rgba(229,57,53,.12); border-radius: 5px; overflow: hidden; flex-shrink: 0; position: relative; }
.cart-bar-sticky .cb-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--cb-theme); border-radius: 5px; transition: width .25s ease; }
.cart-bar-sticky .cb-diff { display: flex; align-items: center; gap: 3px; color: var(--cb-theme); font-size: 13px; font-weight: 700; white-space: nowrap; }
.cart-bar-sticky .cb-diff svg { color: var(--cb-theme); }
/* 右：去结算（两行：文案 + 金额） */
.cart-bar-sticky .cb-checkout {
  flex-shrink: 0; background: var(--cb-theme); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 60px; padding: 0 16px; gap: 2px; cursor: pointer; border: 1px solid #fff;
}
.cart-bar-sticky .cb-checkout .cb-cta { font-size: 15px; font-weight: 700; line-height: 20px; }
.cart-bar-sticky .cb-checkout .cb-price { font-size: 15px; font-weight: 700; line-height: 20px; }

/* ===== Form ===== */
.form-group { background: #fff; border-radius: 12px; margin: 12px; overflow: hidden; }
.form-row { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.form-row:last-child { border-bottom: none; }
.form-label { width: 80px; color: #262b26; font-size: 14px; flex-shrink: 0; }
.form-input { flex: 1; font-size: 14px; color: var(--text); }
.form-input::placeholder { color: #7d8478; }
.btn-primary { background: var(--primary-grad); color: #fff; padding: 12px; border-radius: 8px; font-size: 15px; font-weight: 700; text-align: center; cursor: pointer; }
.btn-danger { background: var(--danger); color: #fff; padding: 12px; border-radius: 8px; font-size: 15px; font-weight: 700; text-align: center; cursor: pointer; }
.btn-ghost { background: #f1f3ee; color: #5c6359; padding: 12px; border-radius: 8px; font-size: 15px; font-weight: 700; text-align: center; cursor: pointer; }
.spec-opt { padding: 8px 16px; background: #f1f3ee; border: 1px solid transparent; border-radius: 8px; color: #5c6359; cursor: pointer; }
.spec-opt.active { background: var(--primary-bg); border-color: var(--primary); color: var(--primary); font-weight: 700; }

/* ===== List cells ===== */
.cell-list { background: #fff; border-radius: 12px; margin: 12px; overflow: hidden; }
.cell { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.cell:last-child { border-bottom: none; }
.cell .left { display: flex; align-items: center; gap: 10px; }
.cell .left svg { width: 18px; height: 18px; }
.cell .right { display: flex; align-items: center; gap: 2px; color: #7d8478; }
.cell .right svg { width: 14px; height: 14px; }

/* ===== Community ===== */
.community-banner { padding: 12px 12px 0; }
.community-banner .inner { height: 160px; border-radius: 16px; background: linear-gradient(135deg, var(--primary) 0%, #8BC34A 50%, #4CAF50 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; }
.community-tabs { position: sticky; top: 0; z-index: 100; background: #fff; padding: 12px 12px 8px; display: flex; gap: 8px; box-shadow: 0 2px 8px rgba(26,32,24,.07); }
.community-tabs .tab { flex: 1; border-radius: 12px; padding: 12px 8px; background: #f1f3ee; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px solid transparent; }
.community-tabs .tab.active { background: rgba(76,176,20,0.12); border-color: var(--primary); }
.community-tabs .tab svg { width: 22px; height: 22px; }
.community-tabs .tab .tl { font-size: 12px; color: #5c6359; }
.community-tabs .tab.active .tl { color: var(--primary); font-weight: 700; }
.post-card { background: #fff; border-radius: 12px; padding: 12px; margin: 0 12px 10px; }
.post-card .avatar { width: 44px; height: 44px; border-radius: 22px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.post-card .name { font-size: 16px; font-weight: 700; color: var(--text); }
.post-card .area { font-size: 12px; color: #7d8478; }
.post-card .content { font-size: 15px; color: var(--text); line-height: 22px; margin-top: 10px; }
.post-card .tags { display: flex; gap: 6px; margin-top: 6px; }
.post-card .tags .tag { background: #FFF8E1; border-radius: 10px; padding: 2px 8px; font-size: 11px; color: #F57C00; font-weight: 700; }
.post-card .actions { display: flex; margin-top: 12px; padding-top: 10px; border-top: 1px solid #ebeee8; }
.post-card .actions .act { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; color: #7d8478; font-size: 13px; cursor: pointer; }
.post-card .actions .act svg { width: 18px; height: 18px; }

/* ===== Login ===== */
.login-page { min-height: 100vh; background: #fff; padding-top: 80px; }
.login-logo { width: 80px; height: 80px; border-radius: 20px; background: var(--primary-grad); margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 28px; font-weight: 700; }
.login-title { text-align: center; font-size: 22px; font-weight: 800; margin-bottom: 40px; }

/* ===== Order ===== */
.order-tabs { position: sticky; top: 88px; z-index: 90; background: #fff; display: flex; border-bottom: 1px solid var(--border); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.order-tabs::-webkit-scrollbar { display: none; }
.order-tabs .tab { flex: 0 0 auto; min-width: 72px; text-align: center; padding: 12px 14px; font-size: 14px; color: #5c6359; position: relative; white-space: nowrap; }
.order-tabs .tab.active { color: var(--primary); font-weight: 700; }
.order-tabs .tab.active::after { content: ''; position: absolute; bottom: 0; left: 30%; right: 30%; height: 3px; background: var(--primary-grad); border-radius: 2px; }
.order-card { background: #fff; border-radius: 12px; margin: 12px; padding: 14px; }
.order-card .hd { display: flex; justify-content: space-between; margin-bottom: 12px; }
.order-card .items { display: flex; gap: 10px; margin-bottom: 12px; }
.order-card .items .thumb { width: 64px; height: 64px; border-radius: 8px; background: #f1f3ee; }
.order-card .ft { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }

/* ===== Category ===== */
.category-page { display: flex; height: 100vh; padding-top: 88px; }
.category-sidebar { width: 90px; background: #f4f6f1; overflow-y: auto; }
.category-sidebar .item { padding: 16px 8px; text-align: center; font-size: 13px; color: #5c6359; border-left: 3px solid transparent; }
.category-sidebar .item.active { background: #fff; color: var(--primary); font-weight: 700; border-left-color: var(--primary); }
.category-main { flex: 1; overflow-y: auto; padding: 12px; }

/* ===== 全局规格选择弹窗（居中深色金高亮，对齐原项目 SpecDrawer） ===== */
/* 规格弹窗：白底绿主题，与全站（--primary 绿）保持一致 */
#qxSpecModal { background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#qxSpecModal .qxspec-card {
  width: 100%; max-width: 360px; max-height: 80vh;
  border-radius: 16px; overflow: hidden;
  background: #fff;
  display: flex; flex-direction: column; color: var(--text);
}
.qxspec-hd { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.qxspec-title { font-size: 16px; font-weight: 700; color: var(--primary); }
.qxspec-close { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; color: var(--text-sub); cursor: pointer; }
.qxspec-scroll { overflow-y: auto; padding: 10px 16px 16px; flex: 1; }
.qxspec-prod { display: flex; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); align-items: center; }
.qxspec-img { width: 88px; height: 88px; border-radius: 8px; background: var(--primary-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 28px; color: var(--primary); font-weight: 700; }
.qxspec-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.qxspec-price { display: flex; align-items: baseline; }
.qxspec-price .cur { font-size: 14px; font-weight: 700; color: var(--price); line-height: 24px; }
.qxspec-price .int { font-size: 20px; font-weight: 800; color: var(--price); line-height: 24px; }
.qxspec-price .dec { font-size: 14px; font-weight: 700; color: var(--price); line-height: 24px; }
.qxspec-sel { font-size: 14px; color: var(--text-sub); margin-top: 6px; line-height: 18px; }
.qxspec-stock { font-size: 14px; color: var(--text-mute); margin-top: 4px; line-height: 18px; }
.qxspec-group { padding-top: 12px; }
.qxspec-group .sg-name { font-size: 13px; color: var(--text-sub); margin-bottom: 6px; font-weight: 500; }
.qxspec-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qxspec-chip { padding: 6px 10px; border-radius: 4px; border: 1px solid var(--border); background: #f6f8f3; font-size: 14px; color: var(--text-sub); cursor: pointer; transition: all 0.15s; }
.qxspec-chip.active { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); font-weight: 600; }
.qxspec-divider { height: 1px; background: var(--border); margin-top: 12px; }
.qxspec-summary { padding-top: 12px; border-top: 1px solid var(--border); }
.qxspec-sum-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.qxspec-sum-title { font-size: 14px; color: var(--primary); font-weight: 700; }
.qxspec-sum-total { font-size: 12px; color: var(--text-sub); }
.qxspec-sum-total span { color: var(--primary); }
.qxspec-sum-list { display: flex; flex-direction: column; gap: 6px; }
.qxspec-sum-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; background: rgba(65,184,18,0.06); }
.qxspec-sum-row.editing { background: var(--primary-bg); border: 1px dashed rgba(65,184,18,0.4); }
.qxspec-sum-row .qs-label { font-size: 13px; color: var(--text); flex: 1; line-height: 18px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qxspec-sum-row.editing .qs-label { color: var(--primary); font-weight: 500; }
.qs-stepper { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: 8px; }
.qs-btn { width: 24px; height: 24px; border-radius: 12px; background: var(--primary-grad); display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; font-weight: 700; cursor: pointer; user-select: none; line-height: 1; }
.qs-btn.dis { background: rgba(65,184,18,0.15); color: var(--primary); cursor: not-allowed; }
.qs-num { font-size: 14px; font-weight: 600; min-width: 20px; text-align: center; color: var(--primary); }
.qxspec-sum-empty { font-size: 13px; color: var(--text-mute); text-align: center; padding: 8px 0; }
.qxspec-cta { flex-shrink: 0; width: 100%; height: 44px; border-radius: 0; background: var(--primary-grad); color: #fff; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.15s; }
.qxspec-cta.disabled { background: rgba(65,184,18,0.3); cursor: not-allowed; }

/* ============ 全局 SVG 图标 sprite（供各页面 <use href="#i-..."> 引用） ============ */
.qx-svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.qx-svg-sprite symbol { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 通用导航栏（各子页面结构：.nav-bar > .statusbar + .nav） */
.nav-bar { position: sticky; top: 0; z-index: 100; }
.nav-bar .statusbar { height: 20px; }
.nav { display: flex; align-items: center; height: 44px; padding: 0 8px; box-sizing: border-box; }
.nav .back { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.nav .back svg { width: 22px; height: 22px; color: inherit; }
.nav .title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; }
.nav .title.has-back { text-align: left; padding-left: 4px; }
