/* ===== 修肽健康商城 H5 · 全站样式 =====
   设计令牌与小程序 styles/theme.wxss 同源（12 个），配色中心 config.pub theme 下发后
   由 core.js 写到 :root —— 改后台配色，网页版跟小程序一起变。
   布局：竖屏移动端优先，最大 480px 居中（桌面看也不难看）。 */

:root {
  --brand: #C0282F;
  --brand-deep: #8E1B22;
  --btn-1: #F5464F;
  --btn-2: #D2242F;
  --price: #E2342C;
  --capsule-bg: #FDECEC;
  --capsule-ink: #C0282F;
  --bg: #F5F5F7;
  --card: #FFFFFF;
  --line: #EFEFEF;
  --ink-1: #1A1A1A;
  --ink-3: #8C8C8C;
  --ok: #1F8A4C;
  --warn: #E6A23C;
  --tabbar-h: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  background: #E9EAEE; color: var(--ink-1); font-size: 14px; line-height: 1.5;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: 0; background: none; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; border: 0; outline: none; background: transparent; }

/* 手机壳：窄屏全宽，宽屏居中成手机版面 */
#app {
  max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); position: relative; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
.page { min-height: 100vh; min-height: 100dvh; padding-bottom: 24px; }
.page--tab { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); }
.boot-loading { padding: 40vh 0; text-align: center; color: var(--ink-3); }

/* ===== 顶部导航 ===== */
.navbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; height: 46px; padding: 0 12px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.navbar__back { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; margin-left: -8px; }
.navbar__t { flex: 1; text-align: center; font-size: 16px; font-weight: 600; }
.navbar__r { min-width: 34px; text-align: right; font-size: 13px; color: var(--ink-3); }

/* ===== 底部 tabbar ===== */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 40;
  display: flex; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line);
}
.tabbar__i { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink-3); font-size: 10px; }
.tabbar__i.on { color: var(--brand); font-weight: 600; }
.tabbar__cart-dot {
  position: absolute; top: 2px; left: 50%; margin-left: 6px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--price); color: #fff; font-size: 10px; line-height: 16px; text-align: center;
}

/* ===== 通用组件 ===== */
.card { background: var(--card); border-radius: 12px; margin: 10px 12px; padding: 12px; }
.cell { display: flex; align-items: center; gap: 10px; padding: 13px 12px; background: var(--card); }
.cell + .cell { border-top: 1px solid var(--line); }
.cell__bd { flex: 1; min-width: 0; }
.cell__ft { color: var(--ink-3); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.cell-group { border-radius: 12px; overflow: hidden; margin: 10px 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border-radius: 20px;
  background: linear-gradient(96deg, var(--btn-1) 0%, var(--btn-2) 100%);
  color: #fff; font-size: 15px; font-weight: 600; border: 0;
}
.btn:active { opacity: .85; }
.btn--dis { background: #C4C4C4 !important; }
.btn--line { background: var(--card); color: var(--brand); border: 1px solid var(--brand); }
.btn--gray { background: #F2F3F5; color: var(--ink-1); }
.btn--sm { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 15px; }
.btn--block { display: flex; width: calc(100% - 24px); margin: 12px; }

.tag {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px;
  background: var(--capsule-bg); color: var(--capsule-ink); font-size: 10px; white-space: nowrap;
}
.tag--gray { background: #F2F3F5; color: var(--ink-3); }
.tag--green { background: #E8F6EE; color: var(--ok); }
.tag--warn { background: #FBF3E4; color: var(--warn); }

.price { color: var(--price); font-weight: 700; }
.price__cur { font-size: 11px; }
.sec-t { display: flex; align-items: center; gap: 7px; padding: 16px 12px 8px; font-size: 15px; font-weight: 700; }
.sec-t::before { content: ''; width: 4px; height: 14px; border-radius: 2px; background: var(--brand); }

.input {
  width: 100%; height: 44px; padding: 0 12px; border-radius: 10px;
  background: #F5F6F8; font-size: 14px;
}
textarea.input { height: 80px; padding: 10px 12px; resize: none; }
.fld { margin: 10px 12px; }
.fld__lb { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }

.empty { padding: 60px 0; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty svg { opacity: .5; margin: 0 auto 10px; }
.load-more { text-align: center; color: var(--ink-3); font-size: 12px; padding: 12px 0; }

/* 商品卡 */
.good-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 12px; }
.good-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.gcard { background: var(--card); border-radius: 10px; overflow: hidden; }
.gcard__img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #F2F3F5; }
.gcard__bd { padding: 8px 9px 10px; }
.gcard__t { font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.gcard__ft { display: flex; align-items: baseline; justify-content: space-between; margin-top: 6px; }
.gcard__price { font-size: 16px; }
.gcard__tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }

/* Banner 轮播 */
.banner { position: relative; margin: 10px 12px 0; border-radius: 12px; overflow: hidden; }
.banner img { width: 100%; aspect-ratio: 2.4; object-fit: cover; }
.banner__dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.banner__dot { width: 5px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.5); }
.banner__dot.on { background: #fff; width: 12px; }

/* 列表行（订单等） */
.orow { background: var(--card); border-radius: 12px; margin: 10px 12px; padding: 12px; }
.orow__hd { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.orow__it { display: flex; gap: 10px; padding: 10px 0; }
.orow__img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; background: #F2F3F5; flex: none; }
.orow__bd { flex: 1; min-width: 0; }
.orow__t { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.orow__sku { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.orow__ft { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--ink-3); }
.orow__ops { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

/* 状态色 */
.st-paid { color: var(--warn); } .st-ok { color: var(--ok); } .st-gray { color: var(--ink-3); } .st-red { color: var(--price); }

/* 弹层 / 对话框 / Toast */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 480px; max-height: 82vh; overflow-y: auto;
  background: var(--card); border-radius: 16px 16px 0 0; padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
}
.sheet__hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet__t { font-size: 16px; font-weight: 700; }
.dlg-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 70; display: flex; align-items: center; justify-content: center; }
.dlg { width: 82%; max-width: 340px; background: var(--card); border-radius: 14px; padding: 20px 16px 14px; text-align: center; }
.dlg__t { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.dlg__bd { font-size: 14px; color: var(--ink-1); white-space: pre-wrap; text-align: left; max-height: 50vh; overflow-y: auto; }
.dlg__ops { display: flex; gap: 10px; margin-top: 16px; }
.dlg__ops .btn { flex: 1; height: 38px; }
#toastLayer { position: fixed; top: 18%; left: 0; right: 0; z-index: 90; display: flex; justify-content: center; pointer-events: none; }
.toast {
  background: rgba(0,0,0,.78); color: #fff; padding: 9px 16px; border-radius: 8px;
  font-size: 13px; max-width: 70%; text-align: center; animation: tin .18s ease;
}
@keyframes tin { from { opacity: 0; transform: translateY(-6px);} to { opacity: 1; } }

/* 步进器 */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.stepper button { width: 28px; height: 26px; font-size: 15px; color: var(--ink-1); background: #F7F8FA; }
.stepper input { width: 34px; height: 26px; text-align: center; font-size: 13px; }

/* SKU 弹层里的行 */
.sku-rows { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.sku-opt { padding: 6px 14px; border-radius: 8px; background: #F5F6F8; font-size: 13px; border: 1px solid transparent; }
.sku-opt.on { background: var(--capsule-bg); color: var(--capsule-ink); border-color: var(--brand); }

/* 表单行 */
.form-row { margin: 10px 12px; }
.form-row .input { margin-top: 6px; }

/* 键盘可达：小屏输入放大 */
@media (max-width: 480px) { input, select, textarea { font-size: 16px; } .input { font-size: 16px; } }
