/* 生态农业网 —— 全站样式（成熟商业版） */
:root {
  --green: #1e6b2f;          /* 品牌主色：沉稳深绿 */
  --green-dark: #124a1e;
  --green-light: #eef5ef;
  --red: #d5382e;            /* 价格红 */
  --orange: #e8890c;
  --bg: #f4f5f6;             /* 中性灰底 */
  --card: #ffffff;
  --text: #222222;
  --text2: #555555;
  --muted: #999999;
  --line: #ebebeb;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0, 0, 0, .05);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
}
img { display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; cursor: pointer; }
input, select, textarea { font-family: inherit; outline: none; }

/* ===== 页面容器 ===== */
.page { max-width: 520px; margin: 0 auto; min-height: 100vh; background: var(--bg); box-shadow: 0 0 30px rgba(0,0,0,.06); }

/* ===== 顶部品牌区（沉稳实色） ===== */
.header {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  padding: 0 0 12px;
}
.topbar {
  background: var(--green-dark);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar .tb-brand { display: flex; align-items: center; gap: 9px; }
.topbar .tb-logo { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
.topbar .tb-name { font-size: 19px; font-weight: 600; color: #fff; letter-spacing: 1px; }
.topbar .tb-right { font-size: 12px; color: rgba(255,255,255,.75); }
.brand-slogan { font-size: 12px; color: rgba(255,255,255,.8); margin-top: 2px; letter-spacing: .5px; }

.search-bar {
  margin: 12px 14px 0; display: flex; align-items: center; gap: 8px;
  background: #f4f5f6; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 12px;
}
.search-bar input { flex: 1; border: none; font-size: 14px; background: transparent; color: var(--text); }
.search-bar input::placeholder { color: #b5b5b5; }
.search-btn { background: var(--green); color: #fff; font-size: 13px; font-weight: 500; padding: 6px 18px; border-radius: 6px; }

/* ===== 权益条 ===== */
.trust-row { display: flex; background: var(--card); padding: 11px 8px; border-bottom: 1px solid var(--line); }
.trust-item { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 12px; color: var(--text2); }
.trust-item svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ===== 分类导航（细线图标，非 emoji） ===== */
.cats { display: flex; justify-content: space-around; padding: 16px 8px 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.cat-item { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12px; color: var(--text2); width: 60px; cursor: pointer; }
.cat-icon {
  width: 46px; height: 46px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  background: var(--green-light); color: var(--green);
}
.cat-icon svg { width: 24px; height: 24px; }
.cat-label { color: var(--text); }

/* ===== Banner（真实商品图 + 深色渐变压字） ===== */
.banner { margin: 12px 14px 0; border-radius: var(--radius); overflow: hidden; position: relative; background: var(--green-dark); box-shadow: var(--shadow); }
.banner.recruit { cursor: pointer; }
.banner.recruit .banner-veil { background: linear-gradient(90deg, rgba(13,45,20,.88) 0%, rgba(13,45,20,.62) 45%, rgba(13,45,20,.22) 100%); }
.banner.recruit .b3 { background: #f0b23c; border-color: #f0b23c; color: #3a2a05; font-weight: 600; }
.banner-img { width: 100%; height: 150px; object-fit: cover; display: block; }
.banner-veil { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(9,40,17,.82) 0%, rgba(9,40,17,.55) 45%, rgba(9,40,17,.15) 100%); }
.banner-copy { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); z-index: 2; }
.banner-copy .b1 { font-size: 20px; font-weight: 600; color: #fff; letter-spacing: 2px; }
.banner-copy .b2 { font-size: 12px; color: rgba(255,255,255,.85); margin-top: 7px; letter-spacing: 1px; }
.banner-copy .b3 { display: inline-block; margin-top: 10px; font-size: 11px; color: #fff; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); padding: 3px 10px; border-radius: 3px; letter-spacing: 2px; }

/* ===== 楼层 ===== */
.floor { margin: 14px 14px; }
.floor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 0 2px; }
.floor-title { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; color: var(--text); }
.floor-title::before { content: ""; width: 4px; height: 16px; background: var(--green); border-radius: 2px; }
.floor-more { font-size: 12px; color: var(--muted); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pcard {
  background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.pcard:active { background: #fafafa; }
.pcard-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #f0f1f0; }
.pcard-body { padding: 9px 10px 11px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard-title { font-size: 13px; line-height: 1.45; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 37px; font-weight: 500; }
.pcard-meta { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price { color: var(--red); font-weight: 700; font-size: 17px; }
.price .yen { font-size: 12px; font-weight: 600; }
.orig { color: #b5b5b5; font-size: 11px; text-decoration: line-through; }
.coupon-tag { border: 1px solid var(--red); color: var(--red); font-size: 10px; padding: 0 5px; border-radius: 3px; line-height: 15px; }
.self-tag { background: var(--green); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 3px; }
.pcard-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.sales { font-size: 11px; color: var(--muted); }
.buy-mini { background: var(--red); color: #fff; font-size: 12px; padding: 5px 12px; border-radius: 4px; }
.buy-mini.green { background: var(--green); }
.shop-line { font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 骨架屏 */
.skel { background: linear-gradient(90deg, #ececec 25%, #f6f6f6 50%, #ececec 75%); background-size: 200% 100%; animation: shine 1.2s infinite; border-radius: var(--radius); }
@keyframes shine { to { background-position: -200% 0; } }
.skel-card { height: 230px; }
.skel-row { height: 60px; margin: 10px 14px; border-radius: var(--radius); }

/* ===== 详情页 ===== */
.gallery { background: #fff; }
.gallery-scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
.gallery-scroll img { width: 100%; flex-shrink: 0; aspect-ratio: 1; object-fit: cover; scroll-snap-align: center; background: #f0f1f0; }
.detail-card { background: #fff; padding: 16px; margin: 10px 0; }
.d-price-row { display: flex; align-items: baseline; gap: 8px; }
.d-price { font-size: 25px; color: var(--red); font-weight: 700; }
.d-title { font-size: 16px; font-weight: 600; line-height: 1.55; margin-top: 8px; }
.d-desc { font-size: 13px; color: var(--text2); line-height: 1.7; margin-top: 8px; white-space: pre-wrap; }
.d-info { background: #fff; padding: 14px 16px; margin: 10px 0; display: flex; flex-direction: column; gap: 9px; }
.d-info-row { display: flex; justify-content: space-between; font-size: 13px; }
.d-info-row .k { color: var(--muted); }
.d-info-row .v { color: var(--text); max-width: 70%; text-align: right; }
.buy-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px;
  background: #fff; padding: 10px 14px; display: flex; gap: 10px; align-items: center;
  border-top: 1px solid var(--line); z-index: 50;
}
.buy-bar .btn-home { width: 44px; height: 44px; border-radius: var(--radius); background: #f4f5f6; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--text2); flex-shrink: 0; }
.btn-buy {
  flex: 1; height: 44px; border-radius: var(--radius); color: #fff; font-size: 15px; font-weight: 600;
  background: var(--red); letter-spacing: 1px;
}
.btn-buy.merchant { background: var(--green); }
.pad-bottom { height: 72px; }

/* ===== 弹窗 ===== */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; }
.mask.show { display: flex; }
.dialog { background: #fff; border-radius: 10px; width: 100%; max-width: 360px; padding: 24px 20px; }
.dialog h3 { font-size: 16px; text-align: center; margin-bottom: 6px; }
.dialog .sub { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 16px; line-height: 1.6; }
.dialog .field { margin-bottom: 12px; }
.dialog .field input, .dialog .field select, .dialog .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; font-size: 14px; background: #fafafa;
}
.dialog .btn-ok { width: 100%; height: 44px; border-radius: 6px; background: var(--green); color: #fff; font-size: 15px; font-weight: 600; }
.dialog .notice-icon { font-size: 34px; text-align: center; margin-bottom: 6px; }
.form-err { color: var(--red); font-size: 12px; min-height: 16px; margin-bottom: 6px; text-align: center; }

/* ===== 后台通用（商家/总后台） ===== */
.auth-wrap { max-width: 380px; margin: 60px auto; background: #fff; border-radius: 10px; padding: 28px 24px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-wrap h2 { text-align: center; color: var(--green-dark); margin-bottom: 4px; }
.auth-wrap .sub { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.auth-wrap .field { margin-bottom: 12px; }
.auth-wrap input { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 12px; font-size: 14px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--green); margin-top: 12px; cursor: pointer; }
.btn-main { width: 100%; height: 46px; border-radius: 6px; background: var(--green); color: #fff; font-size: 15px; font-weight: 600; }
.tabs { display: flex; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.tab { flex: 1; text-align: center; padding: 13px 0; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.tab.active { color: var(--green); font-weight: 600; border-bottom-color: var(--green); }
.panel { padding: 14px; display: none; }
.panel.active { display: block; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border-radius: var(--radius); padding: 14px; text-align: center; border: 1px solid var(--line); }
.stat .num { font-size: 22px; font-weight: 700; color: var(--green-dark); }
.stat .lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }
.list-item { background: #fff; border-radius: var(--radius); padding: 14px; margin-bottom: 10px; border: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.list-item img { width: 54px; height: 54px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.li-main { flex: 1; min-width: 0; }
.li-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.tag-ok { color: var(--green); font-weight: 600; } .tag-warn { color: var(--orange); font-weight: 600; } .tag-off { color: #999; }
.btn-sm { padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.btn-green { background: var(--green-light); color: var(--green); }
.btn-red { background: #fdecea; color: var(--red); }
.btn-orange { background: #fff4e3; color: var(--orange); }
.add-fab { position: fixed; right: 18px; bottom: 24px; width: 52px; height: 52px; border-radius: var(--radius); background: var(--green); color: #fff; font-size: 26px; box-shadow: 0 4px 14px rgba(18,74,30,.35); z-index: 40; }

/* ===== 页脚 ===== */
.footer { padding: 22px 16px 26px; text-align: center; color: var(--muted); font-size: 11px; line-height: 1.9; border-top: 1px solid var(--line); margin-top: 10px; }
.footer .f-brand { color: var(--text); font-weight: 600; font-size: 14px; letter-spacing: 1px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--green); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: rgba(20,20,20,.9); color: #fff; padding: 10px 20px; border-radius: 6px; font-size: 13px; z-index: 200; display: none; max-width: 80%; text-align: center; }
.toast.show { display: block; }

/* ============================================================ */
/* ===== 首页（对标成熟商业商城版面） ===== */

/* 品牌渐变头部 */
.hero {
  background: linear-gradient(180deg, #1c6e30 0%, #2a8a3f 78%, #3a9a4e 100%);
  padding: 14px 14px 16px;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; }
.hero-brand { display: flex; align-items: center; gap: 8px; }
.hero-brand span { font-size: 20px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.hero-merchant { font-size: 12px; color: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.45); border-radius: 14px; padding: 4px 11px; }
.hero-notice {
  margin-top: 11px; display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.16); border-radius: 17px; padding: 7px 12px;
  color: #fff; cursor: pointer;
}
.hero-notice .hn-label { font-size: 12px; font-weight: 700; flex-shrink: 0; }
.hero-notice .hn-text { flex: 1; font-size: 12px; color: rgba(255,255,255,.95); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-notice .hn-arrow { font-size: 15px; color: rgba(255,255,255,.8); flex-shrink: 0; }
.hero-search { margin-top: 11px; display: flex; gap: 9px; }
.hero-search .hs-input {
  flex: 1; display: flex; align-items: center; gap: 7px;
  background: #fff; border-radius: 21px; padding: 9px 14px;
}
.hero-search input { flex: 1; border: none; font-size: 14px; background: transparent; color: var(--text); }
.hero-search input::placeholder { color: #b5b5b5; }
.hero-search .hs-btn {
  background: #fff; color: var(--green); font-size: 14px; font-weight: 700;
  border-radius: 21px; padding: 0 20px;
}

/* Banner 轮播 */
.carousel { position: relative; overflow: hidden; background: #dce8dd; }
.car-track { display: flex; transition: transform .45s ease; }
.car-slide { position: relative; width: 100%; flex-shrink: 0; }
.car-slide img { width: 100%; aspect-ratio: 750 / 380; object-fit: cover; display: block; }
.car-veil { position: absolute; inset: 0; }
.car-veil.left { background: linear-gradient(90deg, rgba(10,50,20,.72) 0%, rgba(10,50,20,.38) 42%, rgba(10,50,20,0) 72%); }
.car-veil.right { background: linear-gradient(270deg, rgba(10,50,20,.72) 0%, rgba(10,50,20,.38) 42%, rgba(10,50,20,0) 72%); }
.car-copy { position: absolute; top: 50%; transform: translateY(-50%); max-width: 52%; }
.car-copy.left { left: 18px; text-align: left; }
.car-copy.right { right: 18px; text-align: right; }
.car-copy .c1 { font-size: 19px; font-weight: 700; color: #fff; letter-spacing: 1.5px; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.car-copy .c2 { font-size: 12px; color: rgba(255,255,255,.92); margin-top: 6px; letter-spacing: 1px; text-shadow: 0 1px 6px rgba(0,0,0,.35); }
.car-dots { position: absolute; bottom: 9px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.car-dots .dot { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.55); transition: all .3s; }
.car-dots .dot.on { width: 16px; background: #fff; }

/* 分类（实拍图块） */
.cat-grid { display: flex; justify-content: space-around; background: #fff; padding: 14px 8px 12px; }
.cat-item { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 62px; cursor: pointer; }
.cat-img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.cat-label { font-size: 12px; color: var(--text); }

/* 数据卡片 */
.stats-row { display: flex; gap: 10px; padding: 12px 14px 2px; }
.stat-card { flex: 1; border-radius: 12px; padding: 13px 14px; color: #fff; position: relative; overflow: hidden; }
.stat-card.dark { background: linear-gradient(135deg, #1c6e30, #3a9a4e); }
.stat-card.light { background: linear-gradient(135deg, #e7f5ea, #d2ecda); color: var(--green-dark); }
.stat-card::after { content: ""; position: absolute; right: -18px; bottom: -22px; width: 70px; height: 70px; border-radius: 50%; background: rgba(255,255,255,.12); }
.sc-title { font-size: 13px; font-weight: 700; letter-spacing: 1px; }
.stat-card.dark .sc-num { font-size: 26px; font-weight: 800; margin-top: 6px; }
.stat-card.dark .sc-num i { font-style: normal; font-size: 15px; font-weight: 700; }
.sc-row { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; }
.sc-row b { font-size: 18px; font-weight: 800; }
.sc-row i { font-style: normal; font-size: 11px; opacity: .85; }
.sc-sub { font-size: 11px; margin-top: 7px; opacity: .85; }
.stat-card.light .sc-title { color: var(--green-dark); }
.stat-card.light .sc-sub { color: var(--green-dark); }

/* 招商加盟海报 */
.join-banner { margin: 12px 14px 0; border-radius: 12px; overflow: hidden; position: relative; cursor: pointer; box-shadow: var(--shadow); }
.join-banner img { width: 100%; aspect-ratio: 750 / 300; object-fit: cover; display: block; }
.join-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(60,8,8,.62) 0%, rgba(60,8,8,.18) 55%, rgba(60,8,8,.35) 100%); }
.join-copy { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 0 16px; }
.join-copy .j1 { font-size: 20px; font-weight: 800; color: #ffe9b8; letter-spacing: 2px; text-shadow: 0 2px 10px rgba(80,10,10,.6); }
.join-copy .j2 { font-size: 12px; color: rgba(255,255,255,.95); letter-spacing: 1px; text-shadow: 0 1px 6px rgba(80,10,10,.55); }
.join-copy .j3 { margin-top: 5px; font-size: 12px; font-weight: 700; color: #5c2d00; background: linear-gradient(180deg, #ffd98a, #f0b23c); border-radius: 15px; padding: 5px 18px; letter-spacing: 1px; }

/* 三列高密度商品流 */
.grid3 { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.grid3 .pcard { border-radius: 10px; }
.grid3 .pcard-body { padding: 7px 8px 9px; gap: 4px; }
.grid3 .pcard-title { font-size: 12px; min-height: 34px; -webkit-line-clamp: 2; }
.grid3 .price { font-size: 16px; }
.grid3 .sales { font-size: 10px; }
.grid3 .shop-line { max-width: 55%; }
.pcard-imgwrap { position: relative; }
.pcard-imgwrap .self-tag { position: absolute; left: 6px; top: 6px; }
.pcard-imgwrap .coupon-tag { position: absolute; left: 6px; top: 6px; background: #fff; }
.skel-card3 { height: 172px; }
