/* ===== 默认模板「鲜橙」：大卖场柜台。界面安静，颜色交给商品和价格 ===== */
:root {
  --accent: #d4380d;          /* 主按钮、价格、选中态；白字对比度 4.8:1 */
  --accent-hover: #b8300a;
  --accent-soft: #fdf1ec;     /* 选中行、悬停底色 */
  --price: #d4380d;
  --bg: #f4f4f5;
  --panel: #ffffff;
  --raised: #f4f4f5;
  --text: #171717;
  --text-2: #525252;
  --text-3: #737373;
  --line: rgba(23, 23, 23, .08);
  --line-2: rgba(23, 23, 23, .14);
  --top-bg: #ececed;
  --nav-bg: #ffffff;
  --ok: #16a34a;
  --radius: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  /* 旧变量名兼容 */
  --brand: var(--accent);
  --brand-soft: var(--accent-soft);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; transition: color .16s var(--ease); }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
input, button, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 920px; }
.muted { color: var(--text-3); }
.main { min-height: 60vh; padding-bottom: 48px; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; font-size: 14px; font-weight: 500; white-space: nowrap; transition: background-color .16s var(--ease), color .16s var(--ease), transform .12s var(--ease); }
.btn:hover { color: #fff; background: var(--accent-hover); }
.btn:active { transform: scale(.98); }
.btn:disabled { background: #d4d4d8; color: #fff; cursor: not-allowed; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 28px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-ghost { background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { background: var(--raised); color: var(--text); }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0 4px; font-size: 13px; }

/* ---------- 顶栏 / 头部 / 分类导航 ---------- */
.topbar { background: var(--top-bg); color: var(--text-2); font-size: 12px; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; height: 32px; }
.topbar nav { display: flex; gap: 16px; align-items: center; }
.topbar .hl { color: var(--accent); }
.topbar .sep { color: var(--text-3); }
.header { background: var(--panel); }
.header .wrap { display: flex; align-items: center; gap: 40px; height: 88px; }
.logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo img { max-height: 48px; width: auto; }
.logo-mark { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 20px; font-weight: 600; }
.logo-text { display: flex; flex-direction: column; line-height: 1.3; }
.logo-text b { font-size: 20px; font-weight: 600; color: var(--text); }
.logo-text small { font-size: 12px; color: var(--text-3); }
.search { flex: 1; display: flex; max-width: 600px; height: 40px; border: 2px solid var(--accent); border-radius: 8px; overflow: hidden; background: var(--panel); }
.search input { flex: 1; border: 0; outline: 0; padding: 0 16px; background: transparent; min-width: 0; }
.search button { border: 0; padding: 0 24px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; transition: background-color .16s var(--ease); }
.search button:hover { background: var(--accent-hover); }
.head-user { display: flex; align-items: center; gap: 8px; margin-left: auto; height: 36px; padding: 0 12px; border-radius: 8px; color: var(--text-2); flex-shrink: 0; }
.head-user:hover { background: var(--raised); color: var(--text); }
.catnav { background: var(--nav-bg); border-bottom: 1px solid var(--line); }
.catnav .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.catnav .wrap::-webkit-scrollbar { display: none; }
.catnav a { height: 44px; display: flex; align-items: center; padding: 0 16px; font-size: 15px; white-space: nowrap; position: relative; color: var(--text); }
.catnav a.on { color: var(--accent); font-weight: 500; }
.catnav a.on::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 2px; background: var(--accent); }

.flash { margin: 16px 0 0; padding: 12px 16px; border-radius: 8px; background: #f0faf3; color: #166534; border: 1px solid rgba(22, 163, 74, .2); }
.flash-error { background: #fdf2f2; color: #b42318; border-color: rgba(220, 38, 38, .2); }

/* ---------- 首屏：分类 | 轮播 | 会员栏 ---------- */
.hero { display: grid; grid-template-columns: 200px 1fr 240px; gap: 12px; margin-top: 16px; height: 400px; }
.hero-cats, .hero-side > div, .panel { background: var(--panel); border-radius: var(--radius); }
.hero-cats { padding: 12px 0; overflow-y: auto; }
.hero-cats h3 { font-size: 13px; font-weight: 500; color: var(--text-3); padding: 4px 16px 8px; }
.hero-cats a { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 16px; }
.hero-cats a img { width: 18px; height: 18px; object-fit: contain; }
.hero-cats a span { flex: 1; }
.hero-cats .chev { color: var(--text-3); }
.hero-cats a:hover { background: var(--accent-soft); }

.slider { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility .4s; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: center; gap: 24px; padding: 0 40px; color: #fff;
  background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 86%, #000)); }
.slide.on { opacity: 1; visibility: visible; z-index: 1; }
.slide-img { display: block; padding: 0; }
.slide-img a, .slide-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slide-text h2 { font-size: 36px; line-height: 1.2; font-weight: 600; }
.slide-text p { font-size: 16px; line-height: 1.5; color: rgba(255, 255, 255, .86); margin: 12px 0 24px; }
.slide-btn { display: inline-flex; align-items: center; height: 40px; padding: 0 20px; border-radius: 8px; background: #fff; color: var(--text); font-weight: 500; transition: background-color .16s var(--ease); }
.slide-btn:hover { background: #f4f4f5; color: var(--text); }
.showcase { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sc-item { background: var(--panel); border-radius: 12px; padding: 8px 8px 12px; color: var(--text); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); display: flex; flex-direction: column; gap: 4px; }
.sc-item:hover { color: var(--text); }
.sc-img { aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--raised); margin-bottom: 4px; }
.sc-img img, .sc-img .ph { width: 100%; height: 100%; object-fit: cover; }
.sc-name { font-size: 13px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-item .price { font-size: 16px; }
.dots { position: absolute; z-index: 3; left: 40px; bottom: 20px; display: flex; gap: 8px; }
.dots button { width: 8px; height: 8px; border-radius: 4px; border: 0; padding: 0; background: rgba(255, 255, 255, .45); cursor: pointer; transition: background-color .16s var(--ease), width .3s var(--ease); }
.dots button.on { width: 20px; background: #fff; }

.hero-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.side-user { padding: 20px 16px 16px; text-align: center; }
.side-user p { margin: 8px 0 0; color: var(--text-2); font-size: 13px; }
.avatar { width: 48px; height: 48px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: var(--text-2); font-size: 18px; font-weight: 500; }
.side-btns { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.side-btns .btn { flex: 1; }
.side-notice, .side-feed { padding: 12px 16px; }
.side-notice h4, .side-feed h4 { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.side-notice p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.side-feed { flex: 1; min-height: 0; overflow: hidden; }
.side-feed ul { list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--text-2); }
.side-feed li { display: flex; gap: 8px; height: 24px; align-items: center; }
.side-feed .who { color: var(--text-3); flex-shrink: 0; }
.side-feed .what { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-feed time { color: var(--text-3); flex-shrink: 0; }

/* ---------- 楼层与商品卡 ---------- */
.block { margin-top: 32px; }
.block-hd { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.block-hd h2 { font-size: 20px; font-weight: 600; }
.block-hd a { color: var(--text-3); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.card { background: var(--panel); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .16s var(--ease); }
.card:hover { color: inherit; box-shadow: inset 0 0 0 1px var(--line-2), 0 8px 24px rgba(0, 0, 0, .06); }
.card:hover h4 { color: var(--accent); }
.card-img { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--raised); }
.card-img img, .card-img .ph { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px; display: flex; flex-direction: column; flex: 1; }
.card-body h4 { font-size: 14px; font-weight: 400; line-height: 20px; height: 40px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; transition: color .16s var(--ease); }
.card-sub { margin: 4px 0 0; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-foot { display: flex; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 8px; }
.card-foot del { color: var(--text-3); font-size: 12px; }
.card-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--text-3); }
.card-meta .auto { color: var(--ok); }
.price { color: var(--price); font-weight: 600; font-size: 18px; white-space: nowrap; }
.price i { font-style: normal; font-size: .72em; margin-right: 1px; }
.price.big { font-size: 28px; }
.tag { display: inline-block; font-size: 12px; line-height: 1; padding: 4px 6px; border-radius: 4px; background: var(--raised); color: var(--text-2); }
.tag-auto { background: #f0faf3; color: #15803d; }

/* ---------- 无图商品 ---------- */
/* 实物：素色底 + 线条图标 */
.ph { background: var(--raised); }
.cover-p { display: grid; place-items: center; color: #a3a3a3; }
.cover-p svg { width: 28%; height: auto; }
/* 卡密：画一张充值卡，两侧半圆缺口是本店的标志细节 */
.cover-v { container-type: inline-size; display: grid; place-items: center; }
.v { --notch: 4.4cqw; width: 80%; aspect-ratio: 1.586; border-radius: 5cqw; padding: 6cqw 7cqw; color: #fff; display: flex; flex-direction: column; position: relative;
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 3.2cqw),
    linear-gradient(160deg, color-mix(in srgb, var(--vc) 82%, #fff), var(--vc) 55%, color-mix(in srgb, var(--vc) 88%, #000));
  -webkit-mask: radial-gradient(circle at 0 58%, transparent var(--notch), #000 calc(var(--notch) + .3cqw)) left / 51% 100% no-repeat, radial-gradient(circle at 100% 58%, transparent var(--notch), #000 calc(var(--notch) + .3cqw)) right / 51% 100% no-repeat;
          mask: radial-gradient(circle at 0 58%, transparent var(--notch), #000 calc(var(--notch) + .3cqw)) left / 51% 100% no-repeat, radial-gradient(circle at 100% 58%, transparent var(--notch), #000 calc(var(--notch) + .3cqw)) right / 51% 100% no-repeat;
  filter: drop-shadow(0 1.2cqw 2.4cqw rgba(0, 0, 0, .18)); }
.v-hd { display: flex; justify-content: space-between; align-items: center; font-size: 4.6cqw; color: rgba(255, 255, 255, .72); line-height: 1; }
.v-chip { width: 10cqw; height: 7.4cqw; border-radius: 1.4cqw; background: linear-gradient(135deg, #e6cf9a, #b8955a); box-shadow: inset 0 0 0 .5cqw rgba(0, 0, 0, .12); }
.v-name { margin-top: auto; font-size: 6.4cqw; line-height: 1.25; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.v-no { margin-top: 2.4cqw; font: 4.2cqw/1 ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: .04em; color: rgba(255, 255, 255, .6); white-space: nowrap; }

/* ---------- 列表页 ---------- */
.crumb { padding: 16px 0 12px; color: var(--text-3); font-size: 13px; }
.crumb span { color: var(--text-2); }
.toolbar { display: flex; align-items: center; justify-content: space-between; background: var(--panel); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 12px; }
.sorts { display: flex; gap: 4px; flex-wrap: wrap; }
.sorts a { height: 32px; display: flex; align-items: center; padding: 0 12px; border-radius: 8px; color: var(--text-2); }
.sorts a.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.pager { display: flex; justify-content: center; gap: 4px; margin: 24px 0 0; }
.pager a, .pager b, .pager .dots { min-width: 36px; height: 36px; padding: 0 8px; display: grid; place-items: center; border-radius: 8px; background: var(--panel); font-weight: 400; }
.pager b { background: var(--accent); color: #fff; font-weight: 500; }
.empty { padding: 64px 20px; text-align: center; color: var(--text-3); background: var(--panel); border-radius: var(--radius); }
.empty a { color: var(--accent); }

/* ---------- 详情页 ---------- */
.detail { display: grid; grid-template-columns: 440px 1fr; gap: 40px; padding: 24px; }
.detail-img { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--raised); }
.detail-img img, .detail-img .ph { width: 100%; height: 100%; object-fit: cover; }
.detail-info h1 { font-size: 22px; line-height: 1.4; font-weight: 600; }
.detail-sub { color: var(--text-2); margin: 8px 0 0; }
.price-box { margin: 16px 0 20px; padding: 16px 20px; border-radius: 8px; background: var(--raised); }
.price-box label { color: var(--text-3); margin-right: 12px; }
.price-box del { color: var(--text-3); margin-left: 8px; }
.price-meta { display: flex; gap: 24px; margin-top: 4px; color: var(--text-3); font-size: 13px; }
.price-meta b { color: var(--text); font-weight: 500; }
.kv { display: grid; grid-template-columns: 80px 1fr; gap: 16px 12px; margin: 0; align-items: center; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }
.qty { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; vertical-align: middle; }
.qty button { width: 36px; border: 0; background: var(--raised); cursor: pointer; font-size: 16px; transition: background-color .16s var(--ease); }
.qty button:hover { background: #e9e9eb; }
.qty input { width: 56px; height: 36px; border: 0; text-align: center; outline: 0; -moz-appearance: textfield; background: var(--panel); }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.buy-form { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.buy-form input, .form-v input, .auth-form input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; outline: 0; background: var(--panel); transition: border-color .16s var(--ease); }
.buy-form input:focus, .form-v input:focus, .auth-form input:focus { border-color: var(--accent); }
.f-row { display: flex; gap: 8px; }
.buy-actions { display: flex; gap: 12px; margin-top: 24px; }
.assure { display: flex; gap: 20px; list-style: none; padding: 0; margin: 20px 0 0; color: var(--text-3); font-size: 13px; }
.assure li::before { content: "✓"; margin-right: 4px; color: var(--ok); }
.detail-bottom { display: grid; grid-template-columns: 1fr 240px; gap: 12px; margin-top: 12px; align-items: start; }
.detail-bottom:not(:has(.related)) { grid-template-columns: 1fr; }
.tabs-hd { padding: 0 20px; border-bottom: 1px solid var(--line); height: 48px; display: flex; align-items: center; }
.tabs-hd b { font-weight: 500; height: 48px; display: flex; align-items: center; box-shadow: inset 0 -2px 0 var(--accent); }
.rich { padding: 20px; overflow-wrap: anywhere; line-height: 1.8; }
.rich img { height: auto; margin: 8px auto; }
.related a { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.related a:last-child { border-bottom: 0; }
.related a img, .related a .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.related a span { display: block; margin-top: 8px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 订单页 ---------- */
.panel { padding: 20px 24px; margin-bottom: 12px; }
.panel h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.order-head h2 { font-size: 18px; font-weight: 600; }
.order-total { text-align: right; color: var(--text-2); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.badge-warn { background: #fff7ed; color: #c2410c; }
.badge-info { background: #eff6ff; color: #1d4ed8; }
.badge-primary { background: #f4f4f5; color: #3f3f46; }
.badge-ok { background: #f0faf3; color: #15803d; }
.badge-mute { background: #f4f4f5; color: #737373; }
.steps { display: flex; list-style: none; padding: 20px 24px; margin: 0 0 12px; background: var(--panel); border-radius: var(--radius); }
.steps li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-3); position: relative; font-size: 13px; }
.steps li::before { content: ""; position: absolute; top: 12px; left: -50%; right: 50%; height: 2px; background: var(--line-2); }
.steps li:first-child::before { display: none; }
.steps li i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #d4d4d8; color: #fff; font-style: normal; font-size: 12px; position: relative; z-index: 1; }
.steps li.done { color: var(--text); }
.steps li.done i, .steps li.done::before { background: var(--accent); }
.pay-box { text-align: center; }
.pay-box .muted { margin: 0 0 16px; }
.inline-actions { margin-top: 12px; }
.qrpay { display: flex; gap: 24px; align-items: center; justify-content: center; text-align: left; flex-wrap: wrap; }
.qrpay img { width: 200px; border-radius: 8px; border: 1px solid var(--line); }
/* 卡密框：与卡面同样的两侧缺口 */
.cards { margin: 0; padding: 16px 24px; background: #fffbeb; border-radius: 8px; font: 15px/1.7 ui-monospace, "SF Mono", Consolas, monospace; white-space: pre-wrap; word-break: break-all;
  -webkit-mask: radial-gradient(circle at 0 50%, transparent 8px, #000 8.5px) left / 51% 100% no-repeat, radial-gradient(circle at 100% 50%, transparent 8px, #000 8.5px) right / 51% 100% no-repeat;
          mask: radial-gradient(circle at 0 50%, transparent 8px, #000 8.5px) left / 51% 100% no-repeat, radial-gradient(circle at 100% 50%, transparent 8px, #000 8.5px) right / 51% 100% no-repeat; }
.order-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.order-item > img, .order-item > .ph { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; flex: none; }
.order-item > div:not(.ph) { flex: 1; min-width: 0; }
.order-item p { margin: 4px 0 0; font-size: 13px; }
.order-item .price { font-size: 16px; }
.panel .kv { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 16px; align-items: start; }

/* ---------- 登录注册 ---------- */
.auth { display: grid; grid-template-columns: 1fr 400px; max-width: 880px; margin: 40px auto; background: var(--panel); border-radius: 16px; overflow: hidden; }
.auth-side { padding: 48px 40px; background: var(--raised); color: var(--text); }
.auth-side h2 { font-size: 24px; font-weight: 600; }
.auth-side p { color: var(--text-2); margin: 8px 0 0; }
.auth-side ul { padding: 0; list-style: none; margin: 32px 0 0; color: var(--text-2); }
.auth-side li { display: flex; align-items: center; gap: 8px; height: 32px; }
.auth-side li::before { content: "✓"; color: var(--ok); }
.auth-form { padding: 40px; display: flex; flex-direction: column; gap: 16px; }
.auth-form h3 { font-size: 20px; font-weight: 600; }
.auth-form label, .form-v label { display: flex; flex-direction: column; gap: 8px; color: var(--text-2); font-size: 13px; }
.auth-alt { text-align: center; color: var(--text-3); margin: 0; }
.auth-alt a { color: var(--accent); }

/* ---------- 用户中心 ---------- */
.ucenter { display: grid; grid-template-columns: 220px 1fr; gap: 12px; margin-top: 16px; align-items: start; }
.umenu { padding: 0 0 8px; overflow: hidden; }
.uhead { padding: 24px 16px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.uhead b { font-weight: 500; margin-top: 4px; }
.uhead .muted { font-size: 12px; }
.umenu > a { display: flex; align-items: center; height: 40px; padding: 0 24px; box-shadow: inset 2px 0 0 transparent; }
.umenu > a.on { color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); background: var(--accent-soft); }
.form-v { display: flex; flex-direction: column; gap: 16px; max-width: 420px; }
.form-v .btn { align-self: flex-start; }
.otabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -8px 0 8px; overflow-x: auto; }
.otabs a { height: 40px; display: flex; align-items: center; padding: 0 12px; white-space: nowrap; box-shadow: inset 0 -2px 0 transparent; }
.otabs a.on { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.otabs sup { color: var(--accent); font-size: 11px; margin-left: 2px; }
.olist-item { border: 1px solid var(--line); border-radius: 8px; margin-top: 12px; overflow: hidden; }
.olist-hd { display: flex; gap: 16px; align-items: center; padding: 8px 12px; background: #fafafa; font-size: 13px; }
.olist-hd .badge { margin-left: auto; }
.olist-item .order-item { padding: 12px; }
.olist-item .order-item:hover { color: inherit; background: #fcfcfc; }

.msg-box { text-align: center; padding: 64px 20px; margin-top: 32px; }
.msg-icon { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: #f0faf3; color: var(--ok); }
.msg-icon.err { background: #fdf2f2; color: #dc2626; }
.msg-box h2 { margin-bottom: 24px; font-size: 18px; font-weight: 500; }

/* ---------- 页脚 ---------- */
.footer { background: var(--panel); margin-top: 24px; border-top: 1px solid var(--line); }
.promise { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; list-style: none; margin: 0; padding: 24px 0; border-bottom: 1px solid var(--line); }
.promise li { display: flex; align-items: center; justify-content: center; gap: 12px; }
.promise svg { width: 28px; height: 28px; fill: none; stroke: var(--text-2); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.promise div { display: flex; flex-direction: column; }
.promise b { font-size: 14px; font-weight: 500; }
.promise span { font-size: 12px; color: var(--text-3); }
.copy { text-align: center; padding: 16px 0 24px; color: var(--text-3); font-size: 12px; }
.copy p { margin: 4px 0; }
.police { margin-left: 12px; }

/* ---------- 手机专用元素（桌面隐藏） ---------- */
.tabbar, .m-notice, .m-cats, .bar-total { display: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .hero { grid-template-columns: 180px 1fr; }
  .hero-side { display: none; }
}

/* 平板竖屏和手机：吸顶页头、底部导航、底部购买栏 */
@media (max-width: 860px) {
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .wrap { padding: 0 16px; }
  .main { padding-bottom: 24px; }

  /* 页头：Logo + 搜索一行，吸顶 */
  .topbar { display: none; }
  .header { position: sticky; top: 0; z-index: 40; box-shadow: 0 1px 0 var(--line); }
  .header .wrap { height: 56px; gap: 12px; flex-wrap: nowrap; padding-top: 0; padding-bottom: 0; }
  .logo-text, .head-user { display: none; }
  .logo-mark { width: 32px; height: 32px; font-size: 16px; }
  .logo img { max-height: 32px; }
  .search { order: 0; flex: 1; max-width: none; height: 36px; border-width: 1.5px; }
  .search input { font-size: 16px; padding: 0 12px; }
  .search button { padding: 0 16px; }
  .catnav a { height: 40px; padding: 0 12px; font-size: 14px; }
  .catnav a.on::after { left: 12px; right: 12px; }
  .flash { margin-top: 12px; }

  /* 首页 */
  .hero { grid-template-columns: minmax(0, 1fr); height: auto; margin-top: 12px; }
  .hero-cats { display: none; }
  .slider { height: 180px; }
  .slide { grid-template-columns: 1fr; padding: 0 20px; }
  .slide-text h2 { font-size: 24px; }
  .slide-text p { font-size: 13px; margin: 8px 0 12px; }
  .slide-btn { height: 36px; padding: 0 16px; font-size: 14px; }
  .showcase { display: none; }
  .dots { left: 20px; bottom: 12px; }
  .m-notice { display: flex; align-items: center; gap: 8px; height: 40px; margin-top: 12px; padding: 0 12px; border-radius: 12px; background: var(--panel); font-size: 13px; color: var(--text-2); }
  .m-notice b { flex-shrink: 0; font-weight: 500; color: var(--text); }
  .m-notice span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-cats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px 0; margin-top: 12px; padding: 16px 4px 12px; border-radius: 12px; background: var(--panel); }
  .m-cats a { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
  .m-cat-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: var(--text-2); font-size: 16px; font-weight: 500; overflow: hidden; }
  .m-cat-ico img { width: 22px; height: 22px; object-fit: contain; }
  .m-cats em { font-style: normal; font-size: 12px; color: var(--text-2); max-width: 100%; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* 楼层与商品卡 */
  .block { margin-top: 20px; }
  .block-hd { margin-bottom: 8px; }
  .block-hd h2 { font-size: 18px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .card-body { padding: 8px 10px 10px; }
  .card-body h4 { font-size: 13px; line-height: 18px; height: 36px; }
  .price { font-size: 16px; }

  /* 列表页 */
  .crumb { padding: 12px 0 8px; }
  .toolbar { padding: 4px; gap: 8px; }
  .sorts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .sorts::-webkit-scrollbar { display: none; }
  .sorts a { height: 36px; flex-shrink: 0; }
  .toolbar > .muted { flex-shrink: 0; font-size: 12px; padding-right: 8px; }
  .pager { flex-wrap: wrap; }

  /* 商品详情：图片铺满宽度，购买按钮固定在底部 */
  .detail.panel { grid-template-columns: 1fr; gap: 0; padding: 0; margin: 0 -16px 12px; border-radius: 0; }
  .detail-img { border-radius: 0; }
  .detail-info { padding: 16px; }
  .detail-info h1 { font-size: 18px; }
  .price-box { margin: 12px 0 16px; padding: 12px 16px; }
  .kv { grid-template-columns: 72px 1fr; gap: 12px 8px; }
  .buy-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; margin: 0; display: flex; align-items: center; gap: 8px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); background: var(--panel); box-shadow: 0 -1px 0 var(--line); }
  .bar-total { display: block; flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); white-space: nowrap; }
  .bar-total .price { font-size: 18px; }
  .buy-actions .btn { height: 44px; padding: 0 24px; }
  .buy-actions .btn-ghost { display: none; }
  body:has(.buy-actions) { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body:has(.buy-actions) .tabbar { display: none; }
  .assure { flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; }
  .detail-bottom { grid-template-columns: minmax(0, 1fr); margin-top: 12px; }
  .related { display: none; }
  .tabs-hd { padding: 0 16px; }
  .rich { padding: 16px; }

  /* 订单页 */
  .panel { padding: 16px; }
  .order-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .order-total { text-align: left; }
  .steps { padding: 16px 8px; }
  .qrpay img { width: 180px; }

  /* 用户中心：左侧菜单变成顶部标签 */
  .ucenter { grid-template-columns: minmax(0, 1fr); margin-top: 12px; }
  .ubody { min-width: 0; }
  .otabs { scrollbar-width: none; }
  .otabs::-webkit-scrollbar { display: none; }
  .otabs a { flex-shrink: 0; }
  .umenu { display: flex; flex-wrap: wrap; padding: 0; }
  .uhead { flex-basis: 100%; flex-direction: row; text-align: left; gap: 12px; padding: 16px; margin-bottom: 0; }
  .uhead .avatar { margin: 0; }
  .uhead b { margin-top: 0; }
  .umenu > a { flex: 1; justify-content: center; height: 44px; padding: 0; box-shadow: inset 0 -2px 0 transparent; }
  .umenu > a.on { box-shadow: inset 0 -2px 0 var(--accent); background: none; }
  .form-v { max-width: none; }

  /* 登录注册 */
  .auth { grid-template-columns: 1fr; margin: 16px 0; }
  .auth-side { display: none; }
  .auth-form { padding: 24px 20px; }

  /* iPhone 上输入框小于 16px 会自动放大页面 */
  .buy-form input, .form-v input, .auth-form input, .qty input { font-size: 16px; }

  /* 页脚 */
  .footer { margin-top: 16px; }
  .promise { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; padding: 16px 0; }
  .promise li { justify-content: flex-start; gap: 8px; }
  .promise svg { width: 24px; height: 24px; }
  .copy { padding: 12px 0 16px; }

  /* 底部导航 */
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--panel); box-shadow: 0 -1px 0 var(--line); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--text-3); }
  .tabbar a:hover { color: var(--text-3); }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.on { color: var(--accent); }
}

/* 手机竖屏 */
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card-foot del { display: none; }
  .m-cats { grid-template-columns: repeat(5, 1fr); }
  .f-row { flex-direction: column; }
  .olist-hd { gap: 8px; font-size: 12px; }
  .olist-hd .muted { display: none; }
  .order-item > img, .order-item > .ph { width: 64px; height: 64px; }
  .order-item .btn { display: none; }
  .price.big { font-size: 24px; }
  .msg-box { padding: 40px 16px; }
}
