/* ============ HerbalEast Storefront ============ */
:root {
  --primary: #2d6a4f; --primary-dark: #1b4332; --primary-light: #40916c;
  --gold: #b7791f; --gold-light: #c8a24b;
  --bg: #f6f4ef; --card: #ffffff; --line: #e6e1d6;
  --text: #263238; --muted: #78909c; --danger: #c0392b;
  --radius: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font: 15px/1.6 "Segoe UI", "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* topbar */
.topbar { background: var(--primary-dark); color: #cfe3d8; font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; padding: 6px 16px; }
.topbar a { color: #e8f3ec; margin-left: 14px; }

/* header */
.header { background: var(--card); border-bottom: 1px solid var(--line); }
.header .wrap { display: flex; align-items: center; gap: 28px; padding: 18px 16px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #40916c, #1b4332); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; }
.logo-name { font-size: 24px; font-weight: 800; color: var(--primary-dark); letter-spacing: .5px; }
.logo-name small { display: block; font-size: 11px; font-weight: 400; color: var(--gold); letter-spacing: 3px; }
.search-box { flex: 1; display: flex; border: 2px solid var(--primary); border-radius: 8px; overflow: hidden; background: #fff; }
.search-box input { flex: 1; border: 0; padding: 11px 14px; font-size: 15px; outline: none; }
.search-box button { background: var(--primary); color: #fff; border: 0; padding: 0 26px; font-size: 15px; cursor: pointer; }
.hot-words { font-size: 12px; color: var(--muted); margin-top: 6px; }
.hot-words a { margin-right: 12px; }
.cart-entry { position: relative; background: var(--primary-light); color: #fff; padding: 12px 22px; border-radius: 8px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.cart-entry:hover { background: var(--primary); }
.cart-badge { position: absolute; top: -8px; right: -8px; background: var(--danger); color: #fff; font-size: 12px; min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }

/* nav */
.nav { background: var(--primary-dark); }
.nav .wrap { display: flex; align-items: stretch; }
.nav-cat { position: relative; }
.nav-cat > button { background: var(--primary); color: #fff; border: 0; padding: 12px 26px; font-size: 15px; font-weight: 600; cursor: pointer; }
.cat-menu { position: absolute; top: 100%; left: 0; width: 230px; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.15); z-index: 60; display: none; }
.nav-cat:hover .cat-menu { display: block; }
.cat-menu a { display: flex; gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); color: var(--text); }
.cat-menu a:hover { background: #eef4f0; color: var(--primary); }
.nav-links { display: flex; }
.nav-links a { color: #d7e8de; padding: 12px 18px; font-size: 14px; }
.nav-links a:hover, .nav-links a.active { color: #fff; background: rgba(255,255,255,.1); }

/* hero */
.hero { margin-top: 16px; }
.hero-banner { border-radius: var(--radius); overflow: hidden; position: relative; height: 340px; background: linear-gradient(115deg, #1b4332 0%, #2d6a4f 55%, #40916c 100%); color: #fff; display: flex; align-items: center; }
.hero-banner .hb-text { padding: 0 60px; max-width: 55%; }
.hero-banner h1 { font-size: 38px; line-height: 1.25; margin-bottom: 14px; }
.hero-banner h1 em { font-style: normal; color: var(--gold-light); }
.hero-banner p { color: #d7e8de; margin-bottom: 22px; }
.btn { display: inline-block; background: var(--gold); color: #fff; padding: 12px 30px; border-radius: 24px; font-weight: 600; border: 0; cursor: pointer; font-size: 15px; }
.btn:hover { background: #9c6612; }
.btn-green { background: var(--primary); }
.btn-green:hover { background: var(--primary-dark); }
.hero-deco { position: absolute; right: 40px; font-size: 170px; opacity: .9; filter: drop-shadow(0 10px 30px rgba(0,0,0,.25)); }
.hero-side { margin-top: 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hero-side .mini { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: center; }
.hero-side .mini .ic { font-size: 26px; }
.hero-side .mini b { display: block; font-size: 14px; }
.hero-side .mini span { font-size: 12px; color: var(--muted); }

/* floors (JD-style) */
.floor { margin: 34px 0; }
.floor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.floor-title { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; color: var(--primary-dark); }
.floor-title .ic { font-size: 26px; }
.floor-title::before { content: ""; width: 6px; height: 26px; background: var(--gold); border-radius: 3px; }
.floor-more { font-size: 13px; color: var(--muted); }

/* product cards */
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.p-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .15s, box-shadow .15s; display: block; position: relative; }
.p-card:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(45,106,79,.18); }
.p-img { height: 180px; display: flex; align-items: center; justify-content: center; font-size: 74px; }
.p-body { padding: 12px 14px 14px; }
.p-name { font-size: 14px; height: 42px; overflow: hidden; margin-bottom: 6px; }
.p-tags { margin-bottom: 6px; min-height: 18px; }
.tag { display: inline-block; font-size: 11px; color: var(--danger); border: 1px solid currentColor; border-radius: 3px; padding: 0 5px; margin-right: 5px; }
.tag.g { color: var(--primary); }
.p-price { color: var(--danger); font-size: 20px; font-weight: 800; }
.p-price small { font-size: 12px; }
.p-price del { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 8px; }
.p-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.rating { color: var(--gold); }
.badge-new { position: absolute; top: 10px; left: 10px; background: var(--gold); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 3px; }

/* category page */
.crumbs { padding: 16px 0; font-size: 13px; color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.cat-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.filter-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 0; align-self: start; }
.filter-panel h4 { padding: 10px 18px; font-size: 14px; color: var(--primary-dark); }
.filter-panel a { display: block; padding: 9px 18px; font-size: 13.5px; color: var(--text); border-left: 3px solid transparent; }
.filter-panel a.on, .filter-panel a:hover { background: #eef4f0; border-left-color: var(--gold); color: var(--primary); }
.sort-bar { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.sort-bar button { border: 0; background: transparent; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.sort-bar button.on { background: var(--primary); color: #fff; }
.sort-bar .cnt { margin-left: auto; color: var(--muted); font-size: 13px; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* detail page */
.detail { display: grid; grid-template-columns: 420px 1fr; gap: 30px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.d-gallery { text-align: center; }
.d-main { height: 360px; display: flex; align-items: center; justify-content: center; font-size: 150px; border-radius: var(--radius); }
.d-thumbs { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.d-thumbs span { width: 64px; height: 64px; border: 2px solid var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 30px; cursor: pointer; }
.d-thumbs span.on { border-color: var(--gold); }
.d-info h1 { font-size: 24px; line-height: 1.35; margin: 6px 0 10px; }
.d-sub { color: var(--danger); background: #fdf1ef; padding: 8px 12px; border-radius: 6px; font-size: 13px; }
.d-price-row { background: #f2f7f4; border-radius: 8px; padding: 16px; margin: 14px 0; display: flex; align-items: baseline; gap: 10px; }
.d-price-row .pr { color: var(--danger); font-size: 30px; font-weight: 800; }
.d-price-row .pr small { font-size: 14px; }
.d-price-row del { color: var(--muted); }
.d-price-row .save { margin-left: auto; color: var(--primary); font-size: 13px; font-weight: 600; }
.sku-row { display: flex; align-items: center; gap: 14px; margin: 12px 0; font-size: 14px; }
.sku-row .lbl { color: var(--muted); width: 70px; }
.sku-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.sku-opt { border: 1.5px solid var(--line); padding: 6px 16px; border-radius: 6px; cursor: pointer; }
.sku-opt.on { border-color: var(--primary); background: #eef4f0; color: var(--primary-dark); font-weight: 600; }
.qty-input { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.qty-input button { width: 34px; height: 34px; border: 0; background: #f1ede5; cursor: pointer; font-size: 16px; }
.qty-input input { width: 50px; height: 34px; border: 0; text-align: center; outline: none; }
.d-actions { display: flex; gap: 12px; margin-top: 18px; }
.btn-lg { padding: 13px 40px; font-size: 16px; border-radius: 28px; }
.btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: #eef4f0; }
.d-meta { margin-top: 18px; font-size: 13px; color: var(--muted); display: flex; gap: 22px; }

/* tabs */
.tabs { margin-top: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tab-head { display: flex; border-bottom: 1px solid var(--line); background: #faf8f3; }
.tab-head button { padding: 14px 26px; border: 0; background: transparent; font-size: 15px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tab-head button.on { color: var(--primary-dark); font-weight: 700; border-bottom-color: var(--gold); }
.tab-body { padding: 24px 28px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table td { border: 1px solid var(--line); padding: 10px 16px; }
.spec-table td:first-child { width: 180px; background: #faf8f3; color: var(--muted); }
.review { border-bottom: 1px dashed var(--line); padding: 16px 0; }
.review .r-head { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.review .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-light); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.review .r-date { color: var(--muted); font-size: 12px; margin-left: auto; }

/* checkout */
.co-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px; }
.panel h3 { font-size: 16px; margin-bottom: 14px; color: var(--primary-dark); display: flex; align-items: center; gap: 8px; }
.co-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.co-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.co-table td { padding: 12px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.co-prod { display: flex; align-items: center; gap: 12px; }
.co-prod .ic { width: 52px; height: 52px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 26px; background: #f2f7f4; }
.qty-mini { display: inline-flex; align-items: center; gap: 8px; }
.qty-mini button { border: 1px solid var(--line); background: #fff; width: 24px; height: 24px; border-radius: 5px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; outline: none; background: #fff; }
.field input:focus, .field select:focus { border-color: var(--primary); }
.pay-list { display: flex; flex-direction: column; gap: 10px; }
.pay-opt { border: 1.5px solid var(--line); border-radius: 8px; padding: 12px 16px; display: flex; align-items: center; gap: 14px; cursor: pointer; }
.pay-opt:hover { border-color: var(--primary-light); }
.pay-opt.on { border-color: var(--primary); background: #eef4f0; }
.pay-opt .ic { font-size: 22px; width: 36px; }
.pay-opt b { display: block; font-size: 14.5px; }
.pay-opt span { font-size: 12.5px; color: var(--muted); }
.card-form { margin-top: 14px; border: 1px dashed var(--line); border-radius: 8px; padding: 16px; display: none; }
.card-form.show { display: block; }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; }
.summary-row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-size: 20px; font-weight: 800; color: var(--danger); }
.order-success { text-align: center; padding: 50px 20px; }
.order-success .big { font-size: 60px; }
.empty { text-align: center; padding: 60px 0; color: var(--muted); }
.empty .big { font-size: 56px; display: block; margin-bottom: 10px; }

/* footer */
.footer { background: var(--primary-dark); color: #b8d4c6; margin-top: 50px; padding: 36px 0 24px; font-size: 13px; }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 24px; }
.footer h5 { color: #fff; margin-bottom: 10px; font-size: 14px; }
.footer a { display: block; margin-bottom: 6px; }
.footer a:hover { color: #fff; }
.footer .pay-icons { font-size: 22px; letter-spacing: 6px; color: #fff; margin-top: 8px; }
.copy { border-top: 1px solid rgba(255,255,255,.15); padding-top: 16px; text-align: center; color: #8fae9e; }

@media (max-width: 980px) {
  .grid, .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .detail, .co-layout, .cat-layout { grid-template-columns: 1fr; }
  .hero-banner .hb-text { max-width: 100%; padding: 0 30px; }
  .hero-deco { display: none; }
  .footer .cols { grid-template-columns: 1fr 1fr; }
  .hero-side { grid-template-columns: repeat(2, 1fr); }
}

/* ================= 首页轮播（后台可管理 / AI 可生成） ================= */
.he-carousel { position: relative; margin: 22px 0 8px; border-radius: 16px; overflow: hidden; border: 1px solid #e3ddcd; background: #f7f2e5; min-height: 360px; box-shadow: 0 10px 30px rgba(34,48,42,.06); }
.he-carousel .hc-stage { position: relative; min-height: 360px; }
.he-carousel .hc-slide { position: absolute; inset: 0; display: flex; align-items: center; gap: 24px; padding: 40px 52px; opacity: 0; transform: translateX(18px); transition: opacity .55s ease, transform .55s ease; pointer-events: none; }
.he-carousel .hc-slide.on { opacity: 1; transform: none; pointer-events: auto; position: relative; }
.he-carousel .hc-copy { flex: 1; max-width: 620px; }
.he-carousel .hc-eyebrow { font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: #8a7a55; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.he-carousel .hc-eyebrow i { display: inline-block; width: 22px; height: 1px; background: #b08d57; }
.he-carousel h2 { font-family: "Songti SC", Georgia, serif; font-size: 34px; line-height: 1.24; letter-spacing: .01em; color: #22302a; margin-bottom: 6px; }
.he-carousel h2 small { display: block; font-family: inherit; font-size: 15px; color: #6b7f72; letter-spacing: .18em; margin-top: 8px; font-weight: 400; }
.he-carousel .hc-sub { font-size: 13.5px; line-height: 1.95; color: #5c6b62; max-width: 540px; margin: 10px 0 20px; }
.he-carousel .hc-badge { display: inline-block; font-size: 11px; letter-spacing: .12em; color: #b08d57; border: 1px solid #d9c7a1; padding: 2px 9px; border-radius: 20px; vertical-align: middle; margin-left: 8px; }
.he-carousel .hc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.he-carousel .hc-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: 6px; font-size: 13px; background: #22302a; color: #f7f2e5; transition: .2s; }
.he-carousel .hc-btn:hover { background: #2d6a4f; transform: translateY(-1px); }
.he-carousel .hc-btn.ghost { background: transparent; color: #3f4d45; border: 1px solid #cfc6ad; }
.he-carousel .hc-btn.ghost:hover { background: rgba(255,255,255,.6); }
.he-carousel .hc-art { flex: 0 0 240px; display: flex; align-items: center; justify-content: center; font-size: 128px; line-height: 1; filter: drop-shadow(0 14px 26px rgba(34,48,42,.16)); position: relative; }
.he-carousel .hc-art::before { content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.85), rgba(217,199,161,.35)); z-index: -1; }
.he-carousel .hc-art img { width: 100%; height: 220px; object-fit: cover; border-radius: 12px; }
.he-carousel .hc-slide.theme-ink { background: linear-gradient(115deg, #1b2a22 0%, #243a2e 55%, #35513f 100%); }
.he-carousel .hc-slide.theme-ink h2, .he-carousel .hc-slide.theme-ink .hc-sub { color: #eef3ee; }
.he-carousel .hc-slide.theme-ink h2 small { color: #b9cbbe; }
.he-carousel .hc-slide.theme-ink .hc-eyebrow { color: #c9b98f; }
.he-carousel .hc-slide.theme-ink .hc-btn { background: #d9c7a1; color: #22302a; }
.he-carousel .hc-slide.theme-ink .hc-btn.ghost { background: transparent; color: #e6efe7; border-color: #5f7a68; }
.he-carousel .hc-slide.theme-light { background: linear-gradient(115deg, #fbf8f0 0%, #f1ece0 60%, #e9e2d1 100%); }
.he-carousel .hc-dots { position: absolute; left: 24px; bottom: 18px; display: flex; gap: 8px; z-index: 4; }
.he-carousel .hc-dot { width: 26px; height: 4px; border-radius: 3px; background: rgba(34,48,42,.18); border: 0; cursor: pointer; padding: 0; transition: .25s; }
.he-carousel .hc-dot.on { background: #22302a; width: 40px; }
.he-carousel .hc-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.82); color: #22302a; cursor: pointer; z-index: 4; font-size: 15px; box-shadow: 0 4px 14px rgba(0,0,0,.12); opacity: 0; transition: .2s; }
.he-carousel:hover .hc-nav { opacity: 1; }
.he-carousel .hc-nav.prev { left: 12px; }
.he-carousel .hc-nav.next { right: 12px; }
.he-carousel .hc-count { position: absolute; right: 22px; bottom: 18px; font-size: 11px; letter-spacing: .18em; color: #8a7a55; z-index: 4; }
.he-carousel .hc-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: #b08d57; z-index: 4; }
.he-carousel .hc-bar.run { animation: hcProgress linear forwards; }
@keyframes hcProgress { from { width: 0; } to { width: 100%; } }
@media (max-width: 980px) {
  .he-carousel, .he-carousel .hc-stage { min-height: 470px; }
  .he-carousel .hc-slide { flex-direction: column; align-items: flex-start; padding: 26px 24px 54px; gap: 6px; }
  .he-carousel h2 { font-size: 24px; }
  .he-carousel .hc-art { position: absolute; right: 14px; top: 16px; font-size: 62px; flex: none; }
  .he-carousel .hc-art::before { width: 96px; height: 96px; }
  .he-carousel .hc-art img { width: 92px; height: 92px; }
  .he-carousel .hc-sub { font-size: 12.5px; line-height: 1.85; }
  .he-carousel .hc-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .he-carousel .hc-slide { transition: none; }
  .he-carousel .hc-bar { display: none; }
}

/* ================= 平台图标分享条（多平台一键分发） ================= */
.he-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; background: #fbfaf6; border: 1px solid #e8e3d6; border-radius: 12px; margin: 14px 0; }
.he-strip .hs-label { font-size: 12px; color: #7b8a80; letter-spacing: .06em; margin-right: 2px; }
.he-strip .hs-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e6e1d3; background: #fff; border-radius: 20px; padding: 5px 11px 5px 8px; font-size: 12px; color: #3d4a42; cursor: pointer; transition: .18s; }
.he-strip .hs-chip:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(34,48,42,.1); }
.he-strip .hs-chip .ic { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; }
.he-strip .hs-chip .ok { color: #2d6a4f; font-size: 10px; }
.he-strip .hs-more { border: 1px dashed #c9c0a9; background: #fff; border-radius: 20px; padding: 5px 12px; font-size: 12px; cursor: pointer; color: #6b7f72; }
@media (max-width: 700px) { .he-strip { gap: 6px; padding: 10px; } .he-strip .hs-label { width: 100%; } }

/* ============ 商品媒体与内容维护（Product Studio） ============ */
.p-img.has-img { overflow: hidden; }
.p-img.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.p-card:hover .p-img.has-img img { transform: scale(1.05); }
.d-main { overflow: hidden; }
.d-main.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.d-thumbs span img { width: 100%; height: 100%; object-fit: cover; display: block; }
.he-ai-card { border: 1px solid #cfe3d8; background: linear-gradient(135deg, #f2f8f4, #eef4ee); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.he-ai-card > p { font-size: 14px; line-height: 1.9; color: #33443c; margin: 8px 0; }
.he-ai-head { font-weight: 700; color: #1b4332; font-size: 14px; }
.he-ai-head small { display: block; font-weight: 400; color: #7a9184; font-size: 11.5px; margin-top: 2px; }
.he-facts { margin: 8px 0 4px; padding-left: 18px; font-size: 13px; line-height: 2; color: #40554a; }
.he-cites { font-size: 12px; color: #7a9184; margin-top: 6px; }
.he-cites a { color: #2d6a4f; }
.he-highlights ul, .he-story, .he-usage { max-width: 860px; }
.he-highlights ul { padding-left: 20px; font-size: 14px; line-height: 2.1; color: #455a64; }
.he-story, .he-usage { margin-top: 14px; }
.he-story p, .he-usage p { font-size: 14px; line-height: 2; color: #455a64; background: #faf7f0; border-left: 3px solid #c9b98f; padding: 10px 14px; border-radius: 0 8px 8px 0; }
.he-usage p { background: #f4f8f5; border-left-color: #8fb996; }
.he-faq-block { margin-top: 18px; }
.he-faq { border-bottom: 1px dashed var(--line); padding: 6px 0; }
.he-faq summary { cursor: pointer; font-weight: 600; font-size: 14px; color: #33443c; padding: 6px 0; }
.he-faq summary small { font-weight: 400; color: var(--muted); margin-left: 8px; font-size: 12.5px; }
.he-faq-a { padding: 4px 0 10px; }
.he-faq-a p { font-size: 13.5px; line-height: 1.95; color: #556; margin: 4px 0; }
.he-faq-a p.zh { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .p-img.has-img img { transition: none; } }

/* ================= OPC 推广官荣耀榜（首页风采栏目） ================= */
.opc-glory { margin: 42px 0 10px; padding: 26px clamp(16px, 4vw, 40px); background: linear-gradient(160deg, #122e26 0%, #1b4332 55%, #23584a 100%); border-radius: 18px; color: #eef4ef; position: relative; overflow: hidden; }
.opc-glory::before { content: '荣'; position: absolute; right: -30px; top: -42px; font-size: 200px; font-weight: 700; color: rgba(151, 188, 98, .07); pointer-events: none; }
.opc-glory-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.opc-glory .news-home-title .cn { color: #fff; }
.opc-glory .news-home-title .en { color: #97bc62; }
.opc-glory .news-home-more { color: #d8c68f; }
.opc-glory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.gcard-mini { position: relative; border-radius: 14px; padding: 16px 16px 12px; background: linear-gradient(165deg, rgba(255,255,255,.10), rgba(255,255,255,.03)); border: 1px solid rgba(151,188,98,.25); cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; display: block; color: inherit; text-decoration: none; }
.gcard-mini:hover { transform: translateY(-4px); border-color: #d8c68f; box-shadow: 0 14px 30px rgba(0,0,0,.35); }
.gcard-mini.top1 { border-color: #d8c68f; box-shadow: 0 0 0 1px rgba(216,198,143,.4), 0 16px 34px rgba(0,0,0,.4); }
.gcard-medal { position: absolute; top: 10px; right: 12px; font-size: 20px; }
.gcard-rank { font-size: 11px; letter-spacing: 2px; color: #97bc62; text-transform: uppercase; }
.gcard-name { font-size: 16.5px; font-weight: 700; color: #fff; margin: 4px 0 2px; display: flex; align-items: center; gap: 8px; }
.gcard-avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #14342b; background: linear-gradient(140deg, #97bc62, #d8c68f); flex: 0 0 auto; }
.gcard-tag { display: inline-block; font-size: 11.5px; padding: 3px 10px; border-radius: 20px; background: rgba(216,198,143,.16); color: #ecd9a4; border: 1px solid rgba(216,198,143,.35); margin: 4px 0 10px; }
.gcard-index-row { display: flex; align-items: baseline; gap: 6px; }
.gcard-index { font-size: 34px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.gcard-idx-label { font-size: 11px; color: #a8c0b2; }
.gcard-meta { display: flex; gap: 12px; margin-top: 8px; font-size: 11px; color: #a8c0b2; }
.gcard-meta b { color: #dbe7dd; font-weight: 600; }
.gcard-cheer { margin-top: 10px; width: 100%; border: 1px solid rgba(151,188,98,.4); background: rgba(151,188,98,.12); color: #cfe3d3; border-radius: 9px; padding: 7px 0; font-size: 12.5px; cursor: pointer; transition: all .15s; font-family: inherit; }
.gcard-cheer:hover { background: rgba(216,198,143,.2); color: #ecd9a4; border-color: #d8c68f; }
.gcard-cheer.done { opacity: .75; cursor: default; }
.gcard-empty { grid-column: 1/-1; text-align: center; color: #a8c0b2; font-size: 13px; padding: 30px 0; }
.opc-glory-note { margin-top: 16px; font-size: 12px; color: #9db3a6; text-align: center; }
.opc-glory-note b { color: #c8d8c9; font-weight: 600; }
#opc-featured { margin-top: 26px; }
.opc-glory .floor-head .floor-title, .opc-glory .floor-more { color: #d8e5da; }
.opc-glory .floor-more { color: #d8c68f; }

/* oc-toast（荣耀卡片页轻提示） */
#oc-toast { position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%); background: #14342b; color: #fff; font-size: 13px; padding: 10px 20px; border-radius: 22px; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 99; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 86vw; }
#oc-toast.show { opacity: 1; }

/* ============================================================
   响应式适配层 v2.2 — 全终端（手机 iOS/Android · 平板/iPad · 大屏）
   断点：≥1600 大屏 · ≤1024 平板 · ≤640 手机 · ≤400 小屏手机
   原则：触控目标 ≥42px · 输入字号 ≥16px（防 iOS 聚焦缩放）·
        表格横向滚动 · 安全区适配 · 单列优先
   ============================================================ */

/* ---------- 大屏 ≥1600 ---------- */
@media (min-width: 1600px) {
  .wrap { max-width: 1400px; }
  body { font-size: 16px; }
  .grid { grid-template-columns: repeat(6, 1fr); }
  .cat-grid { grid-template-columns: repeat(5, 1fr); }
  .detail { grid-template-columns: 520px 1fr; }
  .hero-banner { min-height: 440px; }
}

/* ---------- 平板 ≤1024 ---------- */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  /* 导航横向滑动，避免链接文字被挤压竖排 */
  .nav .wrap { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav .wrap::-webkit-scrollbar { display: none; }
  .nav-links a, .nav-cat > button { white-space: nowrap; }
  /* 触屏点按开合：固定定位铺满宽度（top 由 JS 按导航实际位置写入），不受滚动容器裁剪 */
  .nav-cat.open .cat-menu { display: block !important; position: fixed; left: 0; right: 0; width: auto; max-height: 60vh; overflow-y: auto; box-shadow: 0 18px 40px rgba(0,0,0,.3); }
}

/* ---------- 手机 ≤640 ---------- */
@media (max-width: 640px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 14.5px; }
  .wrap { padding: 0 12px; }
  a, button { -webkit-tap-highlight-color: transparent; }

  /* 输入 16px 防 iOS 聚焦自动缩放；触控目标 ≥42px */
  input, select, textarea { font-size: 16px !important; }
  .btn, .btn-lg { padding: 11px 22px; font-size: 15px; }
  button, .btn, .btn-lg, .pay-opt { min-height: 42px; }

  /* 顶栏与主导航：横向滑动，不断行不挤压 */
  .topbar .wrap { flex-wrap: wrap; gap: 2px 10px; padding: 6px 12px; }
  .topbar a { margin-left: 0; margin-right: 12px; display: inline-block; }
  /* 账户区：欢迎语 + 退出，窄屏不撑破顶栏 */
  .he-account { gap: 6px; font-size: 12px; }
  .he-account a { display: inline-block; vertical-align: middle; }
  .he-account a:first-child { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
  .header .wrap { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .header .search-box { flex: 1 1 100%; min-width: 0; }
  .header .logo-name small { display: none; }
  .nav .wrap { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav .wrap::-webkit-scrollbar { display: none; }
  .nav-links a { padding: 12px 13px; white-space: nowrap; font-size: 13.5px; }
  .nav-cat > button { padding: 12px 16px; white-space: nowrap; }
  .logo-mark { font-size: 19px; }
  .nav .wrap .site-name { font-size: 17px; }

  /* 网格：商品 2 列、类目 2 列 */
  .grid, .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid .p-card { padding: 10px; }

  /* 详情 / 结算 / 分类 布局单列，图片自适应 */
  .detail, .co-layout, .cat-layout { grid-template-columns: 1fr; gap: 14px; }
  .detail { padding: 14px; }
  .detail .d-img { height: auto; aspect-ratio: 4 / 3; }
  .detail .d-main { padding: 14px; }
  .detail .d-actions { display: flex; flex-direction: column; gap: 10px; }
  .detail .d-actions .btn { width: 100%; text-align: center; }

  /* 表格：横向滑动（购物车 / 规格 / 列表通用） */
  table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .co-summary { position: static; margin-top: 12px; }

  /* 表单与支付 */
  .form-grid { grid-template-columns: 1fr; }
  .pay-opt { padding: 12px 14px; }

  /* 首页分区：压缩留白 */
  .hero-banner { min-height: 320px; }
  .hero-banner .hb-text { padding: 0 18px; }
  .hero-banner .hb-text h2 { font-size: 24px; }
  .hero-side { grid-template-columns: 1fr 1fr; gap: 10px; }
  .he-carousel, .he-carousel .hc-stage { min-height: 400px; }
  .he-carousel .hc-slide { padding: 26px 96px 54px 24px; }
  .opc-glory { padding: 20px 14px; margin-top: 28px; }
  .han-section { padding: 26px 0 !important; }
  .news-home { padding: 24px 0 !important; }
  .footer { margin-top: 32px; padding: 26px 0 18px; }
  .footer .cols { grid-template-columns: 1fr; gap: 18px; }
  .footer .pay-icons { letter-spacing: 4px; }

  /* 会员中心：侧栏信息块保留，菜单项变横向胶囊换行排布 */
  .m-layout { gap: 12px; }
  .m-wrap { padding: 0 12px; margin-top: 14px; }
  .m-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .m-side a { display: inline-block; padding: 9px 12px; margin: 0 4px 6px 0; white-space: nowrap; }
  .m-main { padding: 14px; }
  .m-main table, .m-main .m-cards + * { max-width: 100%; }

  /* 资讯 / OPC */
  .news-grid, .opc-grid { grid-template-columns: 1fr !important; }
  .news-detail .nd-body img { max-width: 100%; height: auto; }

  /* 底部安全区（iPhone 全面屏手势条） */
  .footer { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  #oc-toast { bottom: calc(36px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- 小屏手机 ≤400 ---------- */
@media (max-width: 400px) {
  .hero-banner .hb-text h2 { font-size: 21px; }
  .he-carousel h2 { font-size: 20px; }
  .m-cards { grid-template-columns: 1fr; }
  .stat .vl { font-size: 22px; }
}

/* ---------- 横屏矮屏（手机横置） ---------- */
@media (max-height: 480px) and (orientation: landscape) {
  .he-carousel, .he-carousel .hc-stage { min-height: 300px; }
  .hero-banner { min-height: 260px; }
}

/* ---------- 触屏交互增强 ---------- */
@media (hover: none) {
  .cat-menu { display: none; }
  .nav-cat:hover .cat-menu { display: none; }
  .nav-cat.open .cat-menu { display: block !important; }
  .p-card:hover { transform: none; box-shadow: var(--shadow); }
}


/* ============================================================
   ☯ 本草小能手 · AI 智能助手（悬浮客服）
   设计语言：宣纸米 × 墨绿 × 鎏金 —— 太极呼吸光晕，东方高贵质感
   ============================================================ */
.ai-root { font-family: inherit; }
.ai-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 9990;
  width: 60px; height: 60px; border-radius: 50%;
  border: 2px solid rgba(200, 162, 75, .6);
  background: radial-gradient(circle at 32% 28%, #4c9a75 0%, var(--primary) 42%, var(--primary-dark) 100%);
  box-shadow: 0 12px 32px rgba(27, 67, 50, .42), inset 0 1px 0 rgba(255, 255, 255, .18);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .25s ease, box-shadow .25s ease;
  animation: ai-fab-in .5s cubic-bezier(.2, .9, .3, 1.2);
}
.ai-fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 16px 40px rgba(27, 67, 50, .5); }
.ai-fab.hidden { opacity: 0; pointer-events: none; transform: scale(.6); }
.ai-fab-sym {
  color: #f3ead2; font-size: 31px; line-height: 1; user-select: none;
  text-shadow: 0 0 14px rgba(200, 162, 75, .85);
  animation: ai-taiji-breathe 3.2s ease-in-out infinite;
}
.ai-fab:hover .ai-fab-sym { animation: ai-taiji-spin 5s linear infinite; }
.ai-fab-dot {
  position: absolute; top: -2px; right: -2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--danger); border: 2px solid #fff;
}
@keyframes ai-fab-in { from { opacity: 0; transform: scale(.4) translateY(20px); } to { opacity: 1; } }
@keyframes ai-taiji-breathe {
  0%, 100% { text-shadow: 0 0 10px rgba(200, 162, 75, .6); transform: scale(1); }
  50% { text-shadow: 0 0 24px rgba(200, 162, 75, 1); transform: scale(1.07); }
}
@keyframes ai-taiji-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ---- 聊天面板 ---- */
.ai-panel {
  position: fixed; right: 22px; bottom: 94px; z-index: 9991;
  width: 372px; max-width: calc(100vw - 24px); height: min(584px, calc(100vh - 130px));
  display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 24px 64px rgba(27, 67, 50, .28);
  animation: ai-panel-in .3s cubic-bezier(.2, .9, .3, 1.15);
}
@keyframes ai-panel-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; } }

.ai-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 78%, #3d8266 100%);
  color: #f3ead2; flex: 0 0 auto;
}
.ai-head-sym {
  width: 38px; height: 38px; border-radius: 50%; font-size: 22px; line-height: 38px; text-align: center;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .22), rgba(0, 0, 0, .18));
  border: 1px solid rgba(200, 162, 75, .75);
  text-shadow: 0 0 12px rgba(200, 162, 75, .9);
}
.ai-head-tt { flex: 1; line-height: 1.3; }
.ai-head-tt b { font-size: 15px; letter-spacing: .5px; color: #f7efdb; }
.ai-head-tt small { display: block; font-size: 11px; color: rgba(243, 234, 210, .75); letter-spacing: .8px; }
.ai-close { background: none; border: none; color: rgba(243, 234, 210, .85); font-size: 16px; cursor: pointer; padding: 6px; }
.ai-close:hover { color: #fff; }

.ai-body { flex: 1; overflow-y: auto; padding: 14px 12px; background: linear-gradient(180deg, #faf8f3, var(--bg)); }
.ai-msg { display: flex; gap: 8px; margin-bottom: 10px; align-items: flex-end; }
.ai-msg.user { flex-direction: row-reverse; }
.ai-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  font-size: 14px; line-height: 26px; text-align: center;
}
.ai-msg.ai .ai-avatar { color: #f3ead2; background: radial-gradient(circle at 32% 28%, var(--primary-light), var(--primary-dark)); border: 1px solid rgba(200, 162, 75, .5); }
.ai-msg.user .ai-avatar { background: #ece7db; }
.ai-bubble {
  max-width: 76%; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
}
.ai-msg.ai .ai-bubble { background: #fff; border: 1px solid var(--line); border-top-left-radius: 3px; box-shadow: 0 2px 8px rgba(27, 67, 50, .06); }
.ai-msg.user .ai-bubble { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #f0f6f1; border-top-right-radius: 3px; }
.ai-escalate {
  margin: 4px 0 12px 34px; padding: 7px 11px; border-radius: 9px; font-size: 12px;
  background: #fff8e8; border: 1px dashed #c8a24b; color: #8a6a17;
}
.ai-typing span {
  display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%;
  background: var(--primary-light); animation: ai-dot 1.2s ease-in-out infinite;
}
.ai-typing span:nth-child(2) { animation-delay: .18s; }
.ai-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes ai-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }

.ai-chips { flex: 0 0 auto; display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px 2px; background: var(--bg); }
.ai-chip {
  font-size: 12px; padding: 5px 11px; border-radius: 999px; cursor: pointer;
  background: #fff; border: 1px solid var(--line); color: var(--primary-dark);
  transition: all .18s ease;
}
.ai-chip:hover { border-color: var(--primary); background: #eef5f0; transform: translateY(-1px); }

.ai-input { flex: 0 0 auto; display: flex; gap: 8px; padding: 10px 12px; background: var(--bg); border-top: 1px solid var(--line); }
.ai-input input {
  flex: 1; padding: 10px 13px; border: 1px solid var(--line); border-radius: 22px;
  font-size: 13.5px; outline: none; background: #fff; transition: border-color .2s;
}
.ai-input input:focus { border-color: var(--primary); }
.ai-input button {
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer; font-size: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #f3ead2; box-shadow: 0 4px 12px rgba(27, 67, 50, .3);
  transition: transform .18s ease;
}
.ai-input button:hover { transform: scale(1.08); }
.ai-input button:disabled { opacity: .5; cursor: default; }
.ai-foot { flex: 0 0 auto; text-align: center; font-size: 10.5px; color: var(--muted); padding: 6px 10px 9px; background: var(--bg); }
.ai-foot a { color: var(--gold); }

/* ---- 移动端：全宽面板 ---- */
@media (max-width: 640px) {
  .ai-fab { right: 14px; bottom: 14px; width: 54px; height: 54px; }
  .ai-fab-sym { font-size: 28px; }
  .ai-panel { left: 10px; right: 10px; width: auto; bottom: 80px; height: min(560px, calc(100vh - 110px)); }
  .ai-bubble { max-width: 84%; }
}

@media print { .ai-fab, .ai-panel { display: none !important; } }
