/* 购物：与 style.css 同一套简约黑白（白底、墨黑、细线框），不使用橙/薄荷绿。 */
:root { --tab-h: 58px; }
.page { padding-bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }

/* tabbar 4 格 + 图标 + 角标 */
.tabbar { grid-template-columns: repeat(4, 1fr); padding: 4px 0 calc(4px + env(safe-area-inset-bottom)); height: auto; }
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 0 2px; color: #888; }
.tabbar a svg { display: block; }
.tabbar a b { font-weight: 600; font-size: 11px; }
.tabbar a.active { color: var(--ink); }
.tabbar a.active svg { stroke: #111; fill: none; }
.tab-badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: #111; color: #fff; font-size: 10px; font-style: normal; font-weight: 700; line-height: 17px; text-align: center; }
.tab-badge[hidden] { display: none; }

.foot-links { margin-top: 6px; }
.foot-links a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
.muted { color: var(--grey); }
.fine { font-size: 11.5px; color: var(--grey); line-height: 1.6; margin: 8px 2px 0; }

/* 商品「+」按钮 */
.add-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #111; background: #111; color: #fff; font-size: 20px; line-height: 28px; font-weight: 500; flex: none; cursor: pointer; }
.add-btn:active { transform: scale(.9); }
.add-off { flex: none; font-size: 11px; color: #8a8a84; background: #f4f4f4; border-radius: 999px; padding: 3px 8px; }
.card-body.has-add { position: relative; padding-right: 42px; }
.add-btn.on-card, .add-off.on-card { position: absolute; right: 8px; bottom: 9px; }
.price-row { align-items: center; }
.row-add { flex: none; width: 34px; display: flex; justify-content: flex-end; }
.demo-tip { display: block; margin: -6px 0 12px; font-size: 12.5px; color: var(--ink-soft); background: var(--white); border: 1px dashed var(--mint-deep); border-radius: 12px; padding: 8px 12px; }

/* toast */
#bb-toast { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.9); background: rgba(17,17,17,.9); color: #fff; font-size: 14px; padding: 10px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .18s; z-index: 99; text-align: center; max-width: 72%; }
#bb-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#bb-toast.with-ico { padding: 18px 22px 14px; min-width: 120px; }
#bb-toast .t-ico { display: block; font-size: 30px; line-height: 1; margin-bottom: 8px; }

/* 底部规格弹层 */
.sheet-mask { position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 50; transition: background .22s; }
.sheet-mask.on { background: rgba(0,0,0,.45); }
.sheet { position: absolute; left: 50%; bottom: 0; width: min(100%, 480px); transform: translate(-50%, 100%); transition: transform .22s ease-out; background: #fff; border-radius: 18px 18px 0 0; padding: 16px 16px calc(14px + env(safe-area-inset-bottom)); }
.sheet-mask.on .sheet { transform: translate(-50%, 0); }
.sheet-x { position: absolute; right: 12px; top: 8px; border: 0; background: none; font-size: 26px; color: #999; line-height: 1; cursor: pointer; }
.sheet-top { display: flex; gap: 12px; align-items: flex-end; }
.sheet-img { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; margin-top: -36px; border: 3px solid #fff; box-shadow: var(--card-shadow); background: #f4f4f4; flex: none; }
.ph { display: flex; align-items: center; justify-content: center; background: #f4f4f4; color: #555; font-weight: 600; font-size: 16px; }
.sheet-price { color: #111; font-size: 22px; font-weight: 700; line-height: 1.2; }
.sheet-price small { font-size: 12px; color: var(--grey); font-weight: 500; }
.sheet-name { font-size: 15px; font-weight: 700; }
.sheet-sel { font-size: 12px; color: var(--ink-soft); }
.sheet-note { font-size: 11px; color: var(--grey); }
.sheet-label { display: block; font-size: 13px; font-weight: 700; margin: 16px 0 8px; }
.spec-list { display: flex; flex-wrap: wrap; gap: 8px; }
.spec { border: 1px solid #e5e5e5; background: #fff; color: #111; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-family: inherit; cursor: pointer; text-align: left; }
.spec.on { border-color: #111; background: #fff; font-weight: 700; }
.qty-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.qty-row .sheet-label { margin: 10px 0; }
.stepper { display: inline-flex; align-items: center; border-radius: 8px; overflow: hidden; background: #f4f4f4; }
.stepper button { width: 30px; height: 28px; border: 0; background: none; font-size: 18px; color: var(--ink); cursor: pointer; }
.stepper input { width: 34px; height: 28px; border: 0; background: #fff; text-align: center; font-size: 14px; font-family: inherit; color: var(--ink); }
.sheet-btns { display: flex; gap: 0; margin-top: 18px; border-radius: 999px; overflow: hidden; }
.btn-cart, .btn-buy, .btn-wx, .btn-gold { border: 1px solid #111; font-family: inherit; font-size: 15px; font-weight: 600; color: #111; background: #fff; padding: 11px 0; cursor: pointer; flex: 1; }
.btn-cart { background: #fff; color: #111; }
.btn-buy { background: #111; color: #fff; }
.sheet-btns button:only-child { border-radius: 999px; }
.btn-buy[disabled] { background: #f4f4f4; color: #999; border-color: #ccc; }
.wide { display: block; width: 100%; border-radius: 999px; margin-top: 14px; }

/* 单品页底部购买栏 */
.buy-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); width: min(100%, 480px); display: flex; align-items: center; gap: 0; background: #fff; padding: 8px 12px; border-top: 1px solid var(--line); z-index: 19; }
.buy-bar .bb-icon { position: relative; width: 56px; font-size: 11px; text-align: center; color: var(--ink-soft); display: flex; flex-direction: column; align-items: center; }
.buy-bar .bb-icon .tab-badge { left: 34px; }
.buy-bar .btn-cart { border-radius: 999px 0 0 999px; }
.buy-bar .btn-buy { border-radius: 0 999px 999px 0; }
.has-buybar { padding-bottom: calc(var(--tab-h) + 90px); }

/* 小标题栏 */
.mini-head { position: sticky; top: 0; z-index: 15; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; background: var(--cream); padding: 8px 12px; border-bottom: 1px solid var(--line); }
.mini-back { font-size: 28px; line-height: 1; color: var(--ink); }
.mini-title { text-align: center; font-size: 17px; font-weight: 700; }
.mini-brand { text-align: right; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; font-weight: 700; letter-spacing: .28em; line-height: 1.2; color: #111; text-decoration: none; }
.mini-brand small { display: block; font-size: 9px; font-weight: 400; letter-spacing: .4em; color: #111; margin-top: 3px; }

/* 分类（左侧分类 + 右侧商品卡，沿用已有黑白字标与现有色板，不模仿其他商城的视觉识别） */
.cat-wrap { display: flex; min-height: 60vh; border-top: 1px solid var(--line); }
.cat-rail { width: 92px; flex: none; background: #f7f7f7; position: sticky; top: 0; align-self: flex-start; }
.cat-rail button { display: block; width: 100%; border: 0; background: none; padding: 14px 6px 12px; font-family: inherit; font-size: 13px; color: var(--ink-soft); position: relative; cursor: pointer; line-height: 1.3; text-align: center; }
.cat-rail button small { display: block; font-size: 10px; font-weight: 500; color: var(--grey); margin-top: 2px; }
.cat-rail button.on { background: var(--cream); color: var(--ink); font-weight: 800; }
.cat-rail button.on small { color: var(--ink-soft); }
.cat-rail button.on::before { content: ""; position: absolute; left: 0; top: 30%; bottom: 30%; width: 3px; border-radius: 2px; background: var(--ink); }
.cat-list { flex: 1; padding: 10px 10px 10px 8px; min-width: 0; }
.cat-list h2 { font-size: 14px; margin: 2px 0 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cat-list h2 span { font-size: 11px; font-weight: 500; color: var(--grey); }
.goods { display: flex; gap: 8px; align-items: center; background: #fff; border-radius: 14px; padding: 8px; margin-bottom: 8px; box-shadow: var(--card-shadow); }
.goods .g-main { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 0; color: inherit; }
.g-img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }
.cat-list .g-img, .cat-list .g-img.ph { width: 80px; height: 80px; }
.g-img.ph { padding: 6px; text-align: center; line-height: 1.25; white-space: normal; }
.g-info { flex: 1; min-width: 0; }
.g-name { font-size: 14px; font-weight: 700; line-height: 1.3; }
.g-price, .goods .g-price { font-size: 12.5px; color: #111; font-weight: 700; margin-top: 2px; line-height: 1.4; }
.g-spec { font-size: 12px; color: var(--ink-soft); background: #f4f4f4; display: inline-block; border-radius: 6px; padding: 0 6px; margin-top: 2px; }
.g-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.g-foot .g-price { font-size: 16px; color: #111; }

/* 购物车 */
.page-cart { padding-bottom: calc(var(--tab-h) + 80px); }
.cart-card, .co-card { background: #fff; border-radius: 16px; margin: 12px; padding: 12px; box-shadow: var(--card-shadow); }
.cart-shop { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 4px; padding-bottom: 6px; }
.cart-shop .muted { font-size: 12px; font-weight: 500; }
.link { border: 0; background: none; font-family: inherit; color: var(--ink-soft); font-size: 13px; cursor: pointer; margin-left: auto; }
.link.warn { color: #111; }
.cart-line { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid #eee; position: relative; }
.del { position: absolute; right: 0; top: 6px; border: 0; background: none; color: #bbb; font-size: 18px; cursor: pointer; }
.ck { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.ck input, .agree input { position: absolute; opacity: 0; width: 0; height: 0; }
.ck i, .agree i { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #bbb; flex: none; display: inline-block; position: relative; background: #fff; }
.ck input:checked + i, .agree input:checked + i { background: var(--orange); border-color: var(--orange); }
.ck input:checked + i::after, .agree input:checked + i::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.settle-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); width: min(100%, 480px); background: #fff; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 8px 12px; z-index: 19; }
.settle-sum { margin-left: auto; text-align: right; font-size: 13px; line-height: 1.25; }
.settle-sum b { color: #111; font-size: 19px; }
.settle-sum small { display: block; font-size: 10.5px; color: var(--grey); }
.settle-bar .btn-buy, .settle-bar .btn-wx { flex: none; border-radius: 999px; padding: 11px 20px; }
.btn-wx { background: #fff; color: #111; }
.empty { text-align: center; padding: 70px 20px; color: var(--ink-soft); }
.empty-ico { font-size: 54px; }
.pill { display: inline-block; margin-top: 12px; background: #111; color: #fff; border: 1px solid #111; border-radius: 999px; padding: 8px 22px; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; }
.pill.ghost { background: #fff; color: #111; border: 1px solid #111; }
.pill.sm { margin: 0; padding: 7px 12px; font-size: 13px; white-space: nowrap; }

/* 结算：一屏 */
.page-checkout .site-footer { display: none; }
.page-checkout { padding-bottom: calc(var(--tab-h) + 70px); }
.co-card { margin: 10px 12px; padding: 10px 12px; }
.co-h { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.co-card input, .co-card select, .login-card input { width: 100%; font-family: inherit; font-size: 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; margin-top: 6px; }
.f2 { display: flex; gap: 8px; }
.f2 input { flex: 1; min-width: 0; width: auto; }
.f2 input:first-child { flex: 0 0 38%; }
.co-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-soft); margin-top: 6px; white-space: nowrap; }
.co-row input, .co-row select { margin-top: 0; flex: 1; min-width: 0; }
.co-line { display: grid; grid-template-columns: 1fr auto 76px; gap: 8px; align-items: baseline; font-size: 13.5px; padding: 3px 0; }
.co-line small { display: block; font-size: 11.5px; color: var(--grey); }
.co-line b { text-align: right; }
.co-line.sub { border-top: 1px dashed #eee; font-size: 12.5px; color: var(--ink-soft); grid-template-columns: 1fr 0 auto; }
.pay-opt { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.wx { width: 22px; height: 22px; border-radius: 6px; background: #111; color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.pay-opt .dot { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #bbb; }
.pay-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 60; display: flex; align-items: center; justify-content: center; }
.pay-box { background: #fff; border-radius: 14px; padding: 22px 26px; text-align: center; font-weight: 700; }
.pay-box small { display: block; color: var(--orange); font-size: 12px; margin-top: 6px; }
.spin { width: 32px; height: 32px; margin: 0 auto 10px; border-radius: 50%; border: 3px solid #e5e5e5; border-top-color: #111; animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* 成功页 */
.ok-card { background: #fff; margin: 16px 12px; border-radius: 18px; padding: 22px 18px; text-align: center; box-shadow: var(--card-shadow); }
.ok-ico { width: 58px; height: 58px; margin: 0 auto 8px; border-radius: 50%; background: #111; color: #fff; font-size: 32px; line-height: 58px; }
.ok-card h1 { font-size: 20px; }
.demo-stamp { display: inline-block; margin: 10px 0 6px; padding: 6px 14px; border: 1px solid #111; color: #111; border-radius: 8px; font-weight: 800; font-size: 15px; letter-spacing: .04em; background: #fff; }
.ok-amt { font-size: 30px; font-weight: 800; margin: 4px 0 10px; }
.ok-card dl { display: grid; grid-template-columns: 76px 1fr; gap: 6px 10px; text-align: left; font-size: 13px; background: #f7f7f7; border-radius: 12px; padding: 12px; }
.ok-card dt { color: var(--grey); }
.ok-card dd { word-break: break-all; }
.ok-btns { display: flex; gap: 10px; justify-content: center; }

/* 登录 */
.login-card { margin: 18px 14px; background: #fff; border-radius: 18px; padding: 22px 18px; box-shadow: var(--card-shadow); }
.login-brand { text-align: center; font-size: 24px; font-weight: 800; letter-spacing: .16em; margin-bottom: 14px; }
.login-brand small { display: block; font-size: 13px; letter-spacing: .02em; color: var(--ink-soft); font-weight: 600; }
.code-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.code-row input { margin-top: 0; flex: 1; }
.demo-code { margin-top: 10px; background: #f7f7f7; border: 1px dashed #111; color: #111; border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.demo-code[hidden] { display: none; }
.agree { display: flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 12.5px; color: var(--ink-soft); position: relative; cursor: pointer; flex-wrap: wrap; }
.agree a { color: #111; font-weight: 700; text-decoration: underline; }
.agree i { width: 17px; height: 17px; }
.agree input:checked + i::after { left: 5px; top: 1px; }

/* 我的 */
.me-head { display: flex; align-items: center; gap: 12px; padding: 18px 16px 10px; }
.me-head.guest .pill { margin: 0 0 0 auto; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--mint); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; border: 3px solid #fff; box-shadow: var(--card-shadow); }
.me-id b { font-size: 18px; }
.me-id p, .me-head p { font-size: 12.5px; color: var(--ink-soft); }
.plus-tag { margin-left: 6px; font-size: 10.5px; background: #2b2a27; color: #f2f2f2; border-radius: 6px; padding: 1px 6px; vertical-align: 2px; }
.tier-card { display: block; margin: 4px 12px 10px; border-radius: 16px; padding: 14px; color: #fff; background: #111; box-shadow: var(--card-shadow); }
.tier-top { display: flex; justify-content: space-between; align-items: center; }
.tier-name { font-size: 18px; font-weight: 800; letter-spacing: .06em; }
.ex { font-size: 10.5px; background: rgba(255,255,255,.18); border-radius: 6px; padding: 1px 6px; }
.tier-spent { margin-top: 6px; font-size: 13px; }
.tier-spent b { font-size: 20px; }
.tier-spent small { opacity: .75; font-size: 11px; }
.bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.22); margin: 8px 0 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #111; border-radius: 3px; }
.tier-next { font-size: 12px; opacity: .9; }
.me-grid { display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; margin: 0 12px; border-radius: 16px; box-shadow: var(--card-shadow); text-align: center; padding: 10px 0; font-size: 12px; color: var(--ink-soft); }
.me-grid b { display: block; font-size: 18px; color: var(--ink); }
.ord { border-top: 1px solid #eee; padding: 8px 0; font-size: 13px; }
.ord-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); }
.ord-top .tag { color: #111; }
.ord-items { margin: 4px 0; }
.ord-foot { display: flex; justify-content: space-between; }
.me-links { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: center; padding: 6px 12px 0; font-size: 13px; }
.me-links .link { margin: 0; }
.me-links a { color: var(--ink-soft); text-decoration: underline; }

/* 会员 */
.ex-banner { margin: 10px 12px 0; background: #f7f7f7; color: #111; border: 1px dashed #111; border-radius: 12px; padding: 8px 12px; font-size: 13px; font-weight: 800; text-align: center; }
.plus-card { margin: 10px 12px; border-radius: 18px; padding: 18px 16px; color: #f2f2f2; background: #111; box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.plus-logo { font-size: 22px; font-weight: 900; letter-spacing: .08em; }
.plus-logo small { font-size: 13px; font-weight: 600; letter-spacing: 0; color: #ccc; }
.plus-fee { margin-top: 6px; font-size: 14px; color: #ddd; }
.plus-fee b { font-size: 22px; color: #f2f2f2; }
.plus-fee span { margin-left: 8px; font-size: 11px; background: #fff; color: #111; border-radius: 6px; padding: 2px 6px; font-weight: 800; }
.perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.perk { text-align: center; font-size: 12px; color: #eee; }
.perk i { display: flex; margin: 0 auto 4px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.35); align-items: center; justify-content: center; font-style: normal; font-weight: 800; color: #f2f2f2; }
.perk small { display: block; font-size: 10px; color: #ccc; }
.btn-gold { display: block; width: 100%; text-align: center; border-radius: 999px; background: #fff; color: #111; border: 1px solid #111; }
.plus-on { text-align: center; font-weight: 800; padding: 10px; border: 1px solid #f2f2f2; border-radius: 999px; }
.tier-row { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 8px 0; border-top: 1px solid #eee; }
.tier-row span { color: var(--ink-soft); flex: 1; }
.tier-row.cur b { color: var(--orange-deep); }
.tier-row em { font-style: normal; font-size: 11px; color: #fff; background: var(--orange); border-radius: 6px; padding: 1px 6px; }

/* 隐私草稿 */
.draft-flag { display: inline-block; margin: 6px 0 4px; border: 1px solid #111; color: #111; border-radius: 8px; padding: 4px 12px; font-weight: 800; }
.privacy h2 { font-size: 15px; }
.privacy p { font-size: 14px; }

.g-wrap { position: relative; display: block; flex: none; }
.thumb-tag { position: absolute; right: 3px; top: 3px; font-size: 9.5px; line-height: 1; padding: 2px 4px; border-radius: 6px; background: #fff; color: #111; border: 1px solid #111; }
.ph { font-size: 11px !important; color: var(--ink-soft) !important; font-weight: 600 !important; }
.page-cart .fine { margin: 0 16px; }

/* 结算收款方式 */
.co-card textarea { width: 100%; font-family: inherit; font-size: 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; margin-top: 6px; resize: vertical; min-height: 64px; }
.pay-opt { padding: 10px 4px; border-top: 1px solid #eee; cursor: pointer; }
.pay-opt:first-of-type { border-top: 0; }
.pay-opt span small { display: block; font-size: 11.5px; font-weight: 500; color: var(--grey); margin-top: 2px; }
.pay-opt.on { background: #f7f7f7; margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 10px; }
.pay-opt .dot { border: 2px solid #bbb; background: #fff; box-sizing: border-box; }
.pay-opt.on .dot { border: 5px solid #111; }
.pay-opt.disabled { opacity: .48; cursor: not-allowed; pointer-events: none; }
.pay-ico { width: 22px; height: 22px; border-radius: 6px; color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pay-ico.cod { background: #111; }
.pay-ico.tf { background: #111; }
.pay-ico.wx { background: #111; }
.pay-ico.ali { background: #111; }
.ok-sub { font-size: 13px; color: var(--ink-soft); margin: 6px 12px 0; }
.ok-card dd small { display: block; font-size: 11.5px; color: var(--grey); font-weight: 400; }
