/* ===================================================================
   众好健康 H5 商城 · 原创设计系统
   配色：墨绿(草本/可信) + 暖金(品质) + 米白
   =================================================================== */
:root {
  --green: #2c4a3b;
  --green-2: #3c6350;
  --green-soft: #e8efe9;
  --gold: #c8a063;
  --gold-soft: #f6efe1;
  --bg: #faf7f1;
  --card: #ffffff;
  --ink: #2b2b2b;
  --ink-2: #5b5b5b;
  --muted: #9a9a9a;
  --line: #eee7db;
  --price: #c0392b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 6px 22px rgba(44, 74, 59, 0.08);
  --shadow-sm: 0 2px 10px rgba(44, 74, 59, 0.06);
  --maxw: 480px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #efeae0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; border: 0; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font-family: inherit; font-size: 14px; }

/* 页面容器：移动端全宽，桌面居中成手机视口 */
.app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 92px;
  box-shadow: 0 0 40px rgba(0,0,0,.05);
}

/* ---------------- 顶部品牌栏 ---------------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 241, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px 10px;
}
.header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; letter-spacing: 0;
}
.brand-name { font-size: 17px; font-weight: 700; color: var(--green); letter-spacing: .5px; }
.brand-en { font-size: 9px; color: var(--gold); letter-spacing: 2px; font-weight: 600; }
.header-icons { display: flex; gap: 14px; color: var(--green); }
.header-icons a { font-size: 20px; position: relative; }
.cart-dot {
  position: absolute; top: -4px; right: -6px; min-width: 15px; height: 15px; padding: 0 3px;
  background: var(--price); color: #fff; border-radius: 8px; font-size: 10px;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.search {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  padding: 8px 14px; color: var(--muted);
}
.search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search input::placeholder { color: var(--muted); }

/* ---------------- 通用区块 ---------------- */
.section { padding: 18px 16px 4px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 17px; font-weight: 700; color: var(--green); position: relative; padding-left: 11px; }
.section-title::before {
  content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px;
  border-radius: 2px; background: linear-gradient(var(--gold), var(--green));
}
.section-sub { font-size: 11px; color: var(--muted); }
.more { font-size: 12px; color: var(--muted); }

/* ---------------- 品牌 banner ---------------- */
.hero {
  margin: 14px 16px 0;
  border-radius: 18px;
  padding: 26px 22px;
  background:
    radial-gradient(circle at 90% 10%, rgba(200,160,99,.35), transparent 55%),
    linear-gradient(135deg, #2c4a3b 0%, #3c6350 60%, #4a7560 100%);
  color: #fff; position: relative; overflow: hidden;
}
.hero::after {
  content: "养"; position: absolute; right: -8px; bottom: -34px;
  font-size: 130px; font-weight: 700; color: rgba(255,255,255,.06);
}
.hero-tag { display: inline-block; font-size: 11px; letter-spacing: 2px; color: var(--gold-soft); border: 1px solid rgba(255,255,255,.3); padding: 2px 10px; border-radius: 20px; margin-bottom: 12px; }
.hero h1 { font-size: 25px; line-height: 1.35; font-weight: 700; letter-spacing: 1px; margin-bottom: 8px; }
.hero p { font-size: 12.5px; color: rgba(255,255,255,.82); max-width: 78%; }
.hero-btns { margin-top: 18px; display: flex; gap: 10px; }
.hero-btn { background: var(--gold); color: #3a2c17; font-weight: 700; font-size: 13px; padding: 9px 20px; border-radius: 22px; }
.hero-btn.ghost { background: rgba(255,255,255,.14); color: #fff; font-weight: 500; border: 1px solid rgba(255,255,255,.35); }

/* ---------------- 分类快捷 ---------------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 0 16px; margin-top: 16px; }
.cat-item {
  background: var(--card); border-radius: var(--radius); padding: 14px 6px 11px;
  text-align: center; box-shadow: var(--shadow-sm); display: block;
}
.cat-ico {
  width: 42px; height: 42px; margin: 0 auto 7px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 21px;
  background: var(--green-soft);
}
.cat-item:nth-child(2) .cat-ico { background: var(--gold-soft); }
.cat-item:nth-child(3) .cat-ico { background: #eef1f6; }
.cat-item:nth-child(4) .cat-ico { background: #f7ecec; }
.cat-name { font-size: 12px; color: var(--ink-2); font-weight: 500; }

/* ---------------- 商品卡片 ---------------- */
.goods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 16px; }
.goods-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: transform .15s ease;
}
.goods-card:active { transform: scale(.98); }
.goods-thumb {
  aspect-ratio: 1/1; position: relative; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f0ece2, #e3ecdf);
  color: var(--green); font-size: 30px; font-weight: 700; letter-spacing: 1px;
  overflow: hidden;
}
.goods-thumb img { width: 100%; height: 100%; object-fit: cover; }
.goods-thumb .ph { font-size: 26px; opacity: .5; }
.goods-badge {
  position: absolute; top: 8px; left: 8px; background: rgba(44,74,59,.9); color: #fff;
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
}
.goods-body { padding: 10px 11px 12px; display: flex; flex-direction: column; flex: 1; }
.goods-name { font-size: 13.5px; font-weight: 600; line-height: 1.4; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.goods-sub { font-size: 11px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goods-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; padding-top: 9px; }
.price { color: var(--price); font-weight: 700; }
.price .sym { font-size: 12px; }
.price .num { font-size: 19px; }
.price-old { font-size: 11px; color: var(--muted); text-decoration: line-through; margin-left: 4px; font-weight: 400; }
.add-btn {
  width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1;
  box-shadow: 0 3px 10px rgba(44,74,59,.3);
}

/* ---------------- 品质保障条 ---------------- */
.assure { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; padding: 6px 16px 0; margin-top: 18px; }
.assure-item { background: var(--card); border-radius: var(--radius-sm); padding: 13px 8px; text-align: center; box-shadow: var(--shadow-sm); }
.assure-item .ic { font-size: 19px; }
.assure-item .t { font-size: 12px; font-weight: 600; color: var(--green); margin-top: 3px; }
.assure-item .d { font-size: 10px; color: var(--muted); }

/* ---------------- 品牌故事 ---------------- */
.story { margin: 18px 16px 0; background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.story h3 { color: var(--green); font-size: 16px; margin-bottom: 10px; }
.story p { font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }

/* ---------------- 页面标题条 ---------------- */
.page-title { padding: 16px 16px 6px; }
.page-title h2 { font-size: 20px; color: var(--green); }
.page-title p { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ---------------- 底部公司信息 ---------------- */
.site-foot { margin-top: 26px; padding: 22px 18px 26px; background: var(--green); color: rgba(255,255,255,.8); }
.site-foot .f-brand { color: #fff; font-size: 16px; font-weight: 700; margin-bottom: 10px; letter-spacing: .5px; }
.site-foot .f-row { font-size: 12px; line-height: 1.9; }
.site-foot .f-row b { color: var(--gold-soft); font-weight: 500; }
.site-foot .f-links { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0; font-size: 12px; }
.site-foot .f-links a { color: rgba(255,255,255,.9); }
.site-foot .f-icp { font-size: 11.5px; color: rgba(255,255,255,.6); margin-top: 8px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.15); }
.site-foot .f-icp a { color: rgba(255,255,255,.72); }
.site-foot .f-icp .sep { margin: 0 6px; opacity: .5; }
.site-foot .f-slogan { font-size: 12px; color: rgba(255,255,255,.62); margin: -4px 0 10px; letter-spacing: .3px; }
.site-foot .f-note { font-size: 11px; color: rgba(255,255,255,.45); margin-top: 8px; line-height: 1.7; }

/* ---------------- 底部 Tab ---------------- */.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--maxw); z-index: 60;
  background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4,1fr);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10.5px; color: var(--muted); padding: 4px 0; position: relative;
}
.tab .ti { font-size: 21px; }
.tab.active { color: var(--green); font-weight: 600; }
.tab .badge {
  position: absolute; top: 0; left: 50%; margin-left: 6px; min-width: 15px; height: 15px; padding: 0 3px;
  background: var(--price); color: #fff; border-radius: 8px; font-size: 9.5px;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}

/* ---------------- 按钮通用 ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--green); color: #fff; font-weight: 600; font-size: 14.5px;
  padding: 12px 22px; border-radius: 26px; width: 100%; }
.btn:active { opacity: .9; }
.btn.gold { background: var(--gold); color: #3a2c17; }
.btn.outline { background: #fff; color: var(--green); border: 1px solid var(--green); }
.btn.dark { background: var(--green); }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 20px; width: auto; }

/* ---------------- 表单 ---------------- */
.form { padding: 10px 16px; }
.field { background: #fff; border-radius: var(--radius-sm); padding: 13px 15px; margin-bottom: 12px;
  border: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.field label { font-size: 13px; color: var(--ink-2); width: 62px; flex-shrink: 0; }
.field input, .field textarea, .field select { flex: 1; border: 0; outline: 0; background: transparent; font-size: 14.5px; color: var(--ink); }
.field textarea { min-height: 60px; resize: vertical; }
.field:focus-within { border-color: var(--green-2); }

/* ---------------- 列表通用 ---------------- */
.list { padding: 8px 12px; }
.list-item { background: #fff; border-radius: var(--radius); padding: 13px 14px; margin-bottom: 11px;
  box-shadow: var(--shadow-sm); display: flex; gap: 12px; align-items: center; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-size: 14px; font-weight: 600; }
.list-item .li-desc { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.chev { color: #c6c0b4; font-size: 18px; }

/* ---------------- 富文本（关于/政策页） ---------------- */
.doc { padding: 8px 18px 10px; }
.doc h3 { color: var(--green); font-size: 16px; margin: 20px 0 8px; }
.doc h4 { color: var(--ink); font-size: 14px; margin: 14px 0 6px; }
.doc p { font-size: 13px; color: var(--ink-2); margin-bottom: 9px; }
.doc ul { margin: 0 0 10px 18px; }
.doc li { font-size: 13px; color: var(--ink-2); margin-bottom: 5px; list-style: disc; }
.doc .muted { color: var(--muted); font-size: 12px; }

/* ---------------- 空状态 ---------------- */
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty .e-ic { font-size: 46px; opacity: .5; }
.empty p { margin: 12px 0 16px; font-size: 13px; }

/* ---------------- 数量步进 ---------------- */
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button { width: 30px; height: 30px; font-size: 16px; color: var(--green); background: #f7f4ee; }
.stepper span { width: 34px; text-align: center; font-size: 13.5px; }

/* ---------------- 底部结算条 ---------------- */
.bottom-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--maxw); z-index: 60; background: #fff;
  border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px; }
.bottom-bar .bb-total { flex: 1; font-size: 13px; color: var(--ink-2); }
.bottom-bar .bb-total .price .num { font-size: 21px; }
.bottom-bar .btn { width: auto; padding: 12px 34px; }

/* ---------------- 详情页 ---------------- */
.detail-hero { aspect-ratio: 1/1; background: linear-gradient(135deg,#f0ece2,#dfeade);
  display: flex; align-items: center; justify-content: center; color: var(--green); font-size: 40px; font-weight: 700; }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { background: #fff; padding: 16px; }
.detail-price-row { display: flex; align-items: baseline; gap: 8px; }
.detail-title { font-size: 18px; font-weight: 700; margin: 6px 0 4px; line-height: 1.4; }
.detail-sub { font-size: 12.5px; color: var(--muted); }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.detail-tag { font-size: 11px; color: var(--green-2); background: var(--green-soft); padding: 3px 10px; border-radius: 12px; }
.spec-list { display: flex; gap: 9px; flex-wrap: wrap; padding: 14px 16px 0; }
.spec-opt { border: 1px solid var(--line); border-radius: 9px; padding: 9px 14px; font-size: 13px; background: #fff; color: var(--ink-2); }
.spec-opt.active { border-color: var(--green); color: var(--green); background: var(--green-soft); font-weight: 600; }
.detail-block { background: #fff; margin-top: 10px; padding: 16px; }
.detail-block h3 { font-size: 15px; color: var(--green); margin-bottom: 12px; }
.kv { display: flex; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv .k { width: 84px; color: var(--muted); flex-shrink: 0; }
.kv .v { flex: 1; color: var(--ink-2); }
.intro-text { font-size: 13px; color: var(--ink-2); line-height: 1.8; }

/* ---------------- 订单卡 ---------------- */
.order-card { background: #fff; border-radius: var(--radius); margin: 11px 12px; padding: 14px; box-shadow: var(--shadow-sm); }
.order-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.order-status { color: var(--price); font-weight: 600; }
.order-line { display: flex; justify-content: space-between; font-size: 13px; padding: 7px 0; color: var(--ink-2); }
.order-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------------- 我的页 ---------------- */
.user-hero { background: linear-gradient(135deg, var(--green), var(--green-2)); color: #fff; padding: 26px 18px 22px; }
.user-hero .u-name { font-size: 19px; font-weight: 700; }
.user-hero .u-phone { font-size: 12px; color: rgba(255,255,255,.75); margin-top: 2px; }
.user-hero .u-avatar { width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center; font-size: 24px; }
.user-flex { display: flex; align-items: center; gap: 14px; }
.menu { background: #fff; border-radius: var(--radius); margin: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.menu-item:last-child { border-bottom: 0; }
.menu-item .mi-ic { font-size: 18px; width: 22px; text-align: center; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%) scale(.92);
  background: rgba(20,30,25,.92); color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 13.5px; z-index: 200; opacity: 0; pointer-events: none; transition: all .22s ease; max-width: 78%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }

/* ---------------- 认证页 ---------------- */
.auth-wrap { padding: 34px 26px; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .brand-mark { width: 56px; height: 56px; font-size: 26px; margin: 0 auto 12px; border-radius: 16px; }
.auth-logo h2 { color: var(--green); font-size: 21px; }
.auth-logo p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.auth-tabs { display: flex; gap: 22px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.auth-tab { padding: 8px 0; font-size: 15px; color: var(--muted); position: relative; }
.auth-tab.active { color: var(--green); font-weight: 700; }
.auth-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px; background: var(--green); border-radius: 2px; }
.auth-tip { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 16px; line-height: 1.8; }
.hidden { display: none !important; }

/* ---------------- 资质证照 ---------------- */
.cert-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cert-strip a { background: #fff; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); display: block; }
.cert-strip img { width: 100%; height: 74px; object-fit: cover; display: block; }
.cert-strip span { display: block; text-align: center; font-size: 11px; color: var(--ink-2); padding: 6px 2px; }

.cert-list { padding: 12px; }
.cert-item { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 14px; }
.cert-item .ci-head { padding: 13px 15px 11px; border-bottom: 1px solid var(--line); }
.cert-item .ci-title { font-size: 14.5px; font-weight: 700; color: var(--green); }
.cert-item .ci-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.7; }
.cert-item img { width: 100%; display: block; background: #f7f4ee; }
.cert-kv { padding: 12px 15px; font-size: 12.5px; line-height: 2; color: var(--ink-2); }
.cert-kv b { color: var(--ink); font-weight: 600; }

/* ---------------- 商品详情：品牌行 / 数量 ---------------- */
.detail-brand { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.7; }
.qty-row { display: flex; align-items: center; gap: 12px; background: #fff; margin: 10px 12px; padding: 13px 14px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.qty-row .qty-label { font-size: 13px; color: var(--ink-2); }
.qty-row .qty-ctrl { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qty-row .qty-ctrl button { width: 32px; height: 30px; background: #f7f4ee; border: 0; font-size: 16px; color: var(--ink-2); cursor: pointer; }
.qty-row .qty-ctrl input { width: 44px; height: 30px; border: 0; text-align: center; font-size: 14px; color: var(--ink); background: #fff; }
.qty-row .qty-stock { margin-left: auto; font-size: 11.5px; color: var(--muted); }

/* ---------------- 营养成分表 ---------------- */
.nutri-wrap { padding: 4px 0 2px; overflow-x: auto; }
.nutri-table { width: 100%; border-collapse: collapse; font-size: 12.5px; color: var(--ink-2); }
.nutri-table th, .nutri-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: center; }
.nutri-table th { background: #f4f1ea; color: var(--ink); font-weight: 600; }
.nutri-table td:first-child { text-align: left; }
.nutri-table tbody tr:nth-child(even) td { background: #fbf9f5; }
.nutri-note { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.7; }
