/* ============================================================
 * 梓轩源选商城 · H5 样式
 * ============================================================ */
:root {
  --c-primary: #c8102e;
  --c-primary-dark: #a20d24;
  --c-accent: #d4a24c;
  --c-text: #1f2329;
  --c-text-2: #646a73;
  --c-text-3: #8f959e;
  --c-bg: #f5f6f8;
  --c-line: #eef0f3;
  --c-card: #fff;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(20, 24, 35, .06);
  --tab-h: 54px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
img { display: block; }
input, button, textarea { font-family: inherit; }

/* Vant 主题覆盖 */
:root {
  --van-primary-color: #c8102e;
  --van-danger-color: #c8102e;
  --van-button-primary-background: linear-gradient(135deg, #d4112f, #a20d24);
  --van-button-primary-border-color: transparent;
  --van-nav-bar-icon-color: #1f2329;
  --van-nav-bar-text-color: #1f2329;
  --van-tabbar-item-active-color: #c8102e;
  --van-checkbox-checked-icon-color: #c8102e;
  --van-radio-checked-icon-color: #c8102e;
  --van-stepper-button-icon-color: #c8102e;
  --van-tabs-bottom-bar-color: #c8102e;
}
.van-button--primary { background: linear-gradient(135deg, #d4112f, #a20d24) !important; border: 0 !important; }

/* 布局 */
.page { min-height: 100vh; padding-bottom: 24px; }
.page.with-tab { padding-bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); }
.wrap { padding: 0 12px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb12 { margin-bottom: 12px; }
.flex { display: flex; } .flex1 { flex: 1; } .between { justify-content: space-between; }
.center { align-items: center; } .aic { align-items: center; }
.col { flex-direction: column; } .gap8 { gap: 8px; } .gap12 { gap: 12px; }
.tc { text-align: center; } .tr { text-align: right; }
.muted { color: var(--c-text-3); }
.small { font-size: 12px; }
.bold { font-weight: 600; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ellipsis2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 顶部导航（自定义，替代 NavBar 以获得更灵活样式） */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: 46px; display: flex; align-items: center;
  background: #fff; border-bottom: 1px solid var(--c-line);
  padding: 0 6px;
}
.nav .back { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--c-text); }
.nav .title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; }
.nav .right { min-width: 40px; padding-right: 8px; font-size: 13px; color: var(--c-text-2); }

/* 卡片 */
.card { background: var(--c-card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-pad { padding: 14px; }
.card-hd { padding: 13px 14px; border-bottom: 1px solid var(--c-line); display: flex; align-items: center; justify-content: space-between; }
.card-hd h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-hd .more { font-size: 12.5px; color: var(--c-text-3); }

/* 价格 */
.price { color: var(--c-primary); font-weight: 700; }
.price .sym { font-size: .72em; margin-right: 1px; }
.price-lg { font-size: 20px; }
.price-md { font-size: 16px; }
.price-origin { color: var(--c-text-3); font-size: 12px; text-decoration: line-through; margin-left: 6px; font-weight: 400; }

/* 商品网格 */
.goods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.goods-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.goods-card .thumb { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #f2f3f5; }
.goods-card .info { padding: 9px 10px 12px; }
.goods-card .name { font-size: 13.5px; line-height: 1.45; height: 2.9em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.goods-card .sub { font-size: 11.5px; color: var(--c-text-3); margin-top: 3px; height: 1.4em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.goods-card .btm { display: flex; align-items: baseline; justify-content: space-between; margin-top: 7px; }
.goods-card .sold { font-size: 11px; color: var(--c-text-3); }

/* 分类侧边栏 */
.cat-side { width: 88px; background: #f7f8fa; flex-shrink: 0; }
.cat-side .it { padding: 15px 8px; text-align: center; font-size: 13.5px; color: var(--c-text-2); border-left: 3px solid transparent; }
.cat-side .it.on { background: #fff; color: var(--c-primary); font-weight: 600; border-left-color: var(--c-primary); }

/* 列表行 */
.row-item { display: flex; align-items: center; gap: 12px; padding: 14px; background: #fff; border-bottom: 1px solid var(--c-line); }
.row-item:last-child { border-bottom: 0; }
.row-item .ic { width: 22px; text-align: center; font-size: 17px; }
.row-item .lb { flex: 1; font-size: 14.5px; }
.row-item .val { color: var(--c-text-3); font-size: 13px; }
.row-item .arrow { color: #c8ccd4; font-size: 15px; }

/* 底部 tabbar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid var(--c-line);
  display: flex;
}
.tabbar .tb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #8a8f99; font-size: 11px; position: relative; }
.tabbar .tb .ti { font-size: 20px; line-height: 1; }
.tabbar .tb.on { color: var(--c-primary); }
.tabbar .tb .badge { position: absolute; top: 4px; right: 50%; margin-right: -20px; background: var(--c-primary); color: #fff; font-size: 10px; line-height: 15px; min-width: 15px; padding: 0 4px; border-radius: 8px; text-align: center; }
/* 显示底部导航时：页面留白 + 自带操作栏上移避让 */
.has-tab .page { padding-bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); }
.has-tab .bottom-bar { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }

/* 底部操作栏 */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
  background: #fff; border-top: 1px solid var(--c-line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px;
}

/* 首页 */
.home-hero { position: relative; background: linear-gradient(160deg, #b30f2c, #d4243c 60%, #e2603c); padding: 14px 14px 34px; }
.home-hero .brand { color: #fff; font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.home-hero .slogan { color: rgba(255,255,255,.82); font-size: 12px; margin-top: 3px; }
.home-search { margin-top: 12px; height: 36px; border-radius: 18px; background: rgba(255,255,255,.94); display: flex; align-items: center; padding: 0 14px; gap: 7px; color: #9aa0aa; font-size: 13px; }
.banner-box { margin: -26px 12px 0; border-radius: var(--radius); overflow: hidden; box-shadow: 0 6px 20px rgba(180,20,45,.16); }
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; }
.cat-grid .ci { padding: 8px 2px; }
.cat-grid .ci .cw { width: 42px; height: 42px; margin: 0 auto 5px; border-radius: 12px; background: #fdf2f4; display: flex; align-items: center; justify-content: center; font-size: 19px; }
.cat-grid .ci .cn { font-size: 11.5px; color: var(--c-text-2); }
.notice-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #fff; font-size: 12.5px; color: var(--c-text-2); }
.notice-bar .tag { background: #fdf2f4; color: var(--c-primary); font-size: 10.5px; padding: 1px 6px; border-radius: 4px; flex-shrink: 0; }
.notice-bar .txt { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* 商品详情 */
.gd-gallery { width: 100%; aspect-ratio: 1/1; background: #f2f3f5; }
.gd-price-box { background: linear-gradient(135deg, #d4112f, #a20d24); color: #fff; padding: 14px; }
.gd-price-box .p { font-size: 26px; font-weight: 700; }
.gd-price-box .op { font-size: 13px; opacity: .72; text-decoration: line-through; margin-left: 8px; }
.gd-title { font-size: 16.5px; font-weight: 600; line-height: 1.45; }
.gd-sub { color: var(--c-text-3); font-size: 12.5px; margin-top: 6px; }
.gd-spec { display: flex; flex-wrap: wrap; gap: 8px; }
.gd-spec .sp { border: 1px solid var(--c-line); border-radius: 7px; padding: 6px 12px; font-size: 12.5px; color: var(--c-text-2); }
.meta-line { display: flex; font-size: 12.5px; padding: 6px 0; }
.meta-line .k { width: 76px; color: var(--c-text-3); flex-shrink: 0; }
.meta-line .v { flex: 1; color: var(--c-text-2); }
.detail-html { font-size: 14px; line-height: 1.8; word-break: break-word; }
.detail-html img { max-width: 100%; height: auto; border-radius: 8px; }

/* 购物车 */
.cart-item { display: flex; align-items: center; gap: 10px; padding: 12px; background: #fff; border-bottom: 1px solid var(--c-line); }
.cart-item .thumb { width: 78px; height: 78px; border-radius: 9px; object-fit: cover; background: #f2f3f5; flex-shrink: 0; }
.cart-item .mid { flex: 1; min-width: 0; }
.cart-item .nm { font-size: 13.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 空状态 */
.empty-box { padding: 70px 20px; text-align: center; color: var(--c-text-3); }
.empty-box .ei { font-size: 46px; opacity: .35; }
.empty-box .et { margin-top: 12px; font-size: 13.5px; }
.empty-box .btn { margin-top: 18px; }

/* 表单 */
.f-item { padding: 13px 14px; background: #fff; border-bottom: 1px solid var(--c-line); display: flex; align-items: center; gap: 10px; }
.f-item label { width: 76px; flex-shrink: 0; font-size: 14px; color: var(--c-text); }
.f-item input, .f-item textarea, .f-item select { flex: 1; border: 0; outline: none; font-size: 14px; background: transparent; color: var(--c-text); width: 100%; }
.f-item.col { display: block; }
.f-item.col textarea { margin-top: 8px; min-height: 72px; resize: none; }

/* 登录页 */
.auth-hero { background: linear-gradient(160deg, #b30f2c, #d4243c 60%, #e2603c); padding: 46px 24px 58px; color: #fff; }
.auth-hero h1 { margin: 0; font-size: 23px; letter-spacing: 1px; }
.auth-hero p { margin: 6px 0 0; font-size: 12.5px; opacity: .82; }
.auth-card { margin: -34px 16px 0; background: #fff; border-radius: 16px; box-shadow: 0 10px 30px rgba(24,28,40,.1); padding: 22px 18px; }
.auth-card .fld { border-bottom: 1px solid var(--c-line); padding: 12px 0; display: flex; align-items: center; gap: 10px; }
.auth-card .fld input { flex: 1; border: 0; outline: none; font-size: 14.5px; }
.auth-card .fld .code-btn { color: var(--c-primary); font-size: 13px; flex-shrink: 0; }
.auth-card .fld .code-btn.dis { color: var(--c-text-3); }
.auth-tabs { display: flex; gap: 22px; padding: 0 18px; }
.auth-tabs .t { padding: 4px 0; font-size: 15px; color: var(--c-text-3); position: relative; }
.auth-tabs .t.on { color: var(--c-text); font-weight: 600; }
.auth-tabs .t.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--c-primary); border-radius: 2px; }

/* 订单 */
.order-card { background: #fff; border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; box-shadow: var(--shadow); }
.order-card .oh { display: flex; justify-content: space-between; align-items: center; padding: 11px 13px; border-bottom: 1px solid var(--c-line); font-size: 12.5px; color: var(--c-text-3); }
.order-card .oh .st { color: var(--c-primary); font-weight: 600; }
.order-card .og { display: flex; gap: 10px; padding: 12px 13px; }
.order-card .og .thumb { width: 66px; height: 66px; border-radius: 9px; object-fit: cover; background: #f2f3f5; flex-shrink: 0; }
.order-card .of { padding: 10px 13px; border-top: 1px solid var(--c-line); display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.seg-tabs { display: flex; background: #fff; border-bottom: 1px solid var(--c-line); position: sticky; top: 46px; z-index: 99; overflow-x: auto; }
.seg-tabs .st { padding: 11px 14px; font-size: 13.5px; color: var(--c-text-2); white-space: nowrap; position: relative; }
.seg-tabs .st.on { color: var(--c-primary); font-weight: 600; }
.seg-tabs .st.on::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: var(--c-primary); border-radius: 2px; }

/* 个人中心 */
.me-hero { background: linear-gradient(160deg, #b30f2c, #d4243c 65%, #e2603c); padding: 22px 16px 62px; }
.me-user { display: flex; align-items: center; gap: 12px; }
.me-user .av { width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,.22); border: 2px solid rgba(255,255,255,.5); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 21px; font-weight: 600; overflow: hidden; }
.me-user .av img { width: 100%; height: 100%; object-fit: cover; }
.me-user .nm { color: #fff; font-size: 17px; font-weight: 600; }
.me-user .mo { color: rgba(255,255,255,.8); font-size: 12.5px; margin-top: 3px; }
.me-assets { margin: -46px 12px 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; padding: 15px 0; }
.me-assets .a { flex: 1; text-align: center; }
.me-assets .a .v { font-size: 17px; font-weight: 700; color: var(--c-primary); }
.me-assets .a .k { font-size: 11.5px; color: var(--c-text-3); margin-top: 2px; }
.me-tools { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 0; }
.me-tools .g { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.me-tools .it { text-align: center; padding: 8px 0; }
.me-tools .it .ti { font-size: 21px; }
.me-tools .it .tt { font-size: 11.5px; color: var(--c-text-2); margin-top: 3px; }
.me-tools .it .nb { position: relative; }
.me-tools .it .nb em { position: absolute; top: -4px; right: -12px; background: var(--c-primary); color: #fff; font-style: normal; font-size: 9.5px; line-height: 14px; padding: 0 4px; border-radius: 7px; }

/* 通用工具类 */
.sec-title { font-size: 15px; font-weight: 600; padding: 16px 14px 8px; display: flex; align-items: center; justify-content: space-between; }
.sec-title .line { display: inline-block; width: 3px; height: 14px; background: var(--c-primary); border-radius: 2px; margin-right: 7px; vertical-align: -2px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; background: #fdf2f4; color: var(--c-primary); }
.chip-g { background: #e8f7ef; color: #1e7a4c; }
.chip-n { background: #f0f1f3; color: #6b7280; }
.chip-o { background: #fff4e5; color: #a35b00; }
.divider { height: 1px; background: var(--c-line); margin: 12px 0; }
.notice-box { background: #fff8f4; border-left: 3px solid #e2603c; border-radius: 8px; padding: 11px 13px; font-size: 12.5px; color: #8a5233; line-height: 1.75; }
.bank-box { background: #f7f9fc; border: 1px dashed #cfd8e3; border-radius: 10px; padding: 13px; font-size: 13px; }
.bank-box .r { display: flex; justify-content: space-between; padding: 4px 0; }
.bank-box .r .k { color: var(--c-text-3); }
.bank-box .r .v { font-weight: 600; }
.coupon-item { display: flex; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 10px; }
.coupon-item .left { width: 104px; background: linear-gradient(135deg, #d4112f, #a20d24); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 6px; flex-shrink: 0; }
.coupon-item .left .amt { font-size: 23px; font-weight: 700; }
.coupon-item .left .amt small { font-size: 13px; }
.coupon-item .left .th { font-size: 11px; opacity: .85; margin-top: 2px; }
.coupon-item .right { flex: 1; padding: 13px 14px; display: flex; flex-direction: column; justify-content: center; }
.coupon-item .right .nm { font-size: 14px; font-weight: 600; }
.coupon-item .right .ex { font-size: 11.5px; color: var(--c-text-3); margin-top: 4px; }
.coupon-item.gray .left { background: linear-gradient(135deg, #b6bcc6, #98a0ad); }
.agreement-html { font-size: 14px; line-height: 1.85; word-break: break-word; padding: 14px; }
.agreement-html h3 { font-size: 14.5px; margin: 18px 0 8px; }
.agreement-html p { margin: 8px 0; color: #3a3f47; }
.loading-more { text-align: center; padding: 16px; color: var(--c-text-3); font-size: 12.5px; }
.thumb-uploader { width: 96px; height: 96px; border: 1px dashed #cfd8e3; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--c-text-3); font-size: 12px; background: #fafbfc; overflow: hidden; }
.thumb-uploader img { width: 100%; height: 100%; object-fit: cover; }
