/* =========================================================
   优选数卡 DEMO — 高保真前端克隆（纯静态）
   设计系统 + 响应式（PC / 平板 / 移动 H5）
   原创代码，占位品牌与模拟数据，非原站资产
   ========================================================= */

:root {
  --brand: #3a6df0;
  --brand-d: #2a55c8;
  --brand-l: #5b8def;
  --brand-grad: linear-gradient(135deg, #3a6df0 0%, #5b8def 100%);
  --accent: #ff7a1a;
  --accent-grad: linear-gradient(135deg, #ff8a1f 0%, #ff6a00 100%);
  --green: #00b96b;
  --green-bg: #e8f8f0;
  --orange-bg: #fff3e8;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1f2733;
  --text-2: #5a6678;
  --text-3: #97a2b3;
  --line: #eef1f6;
  --line-2: #e3e8f0;
  --radius: 14px;
  --radius-s: 10px;
  --shadow: 0 6px 22px rgba(30, 50, 90, 0.07);
  --shadow-h: 0 12px 34px rgba(30, 50, 90, 0.14);
  --maxw: 1200px;
  --hdr-h: 64px;
  --tab-h: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* 禁止复制：后台「站点设置」开启后，前台正文不可选中 / 复制 / 右键（输入框放行） */
body.disable-copy, body.disable-copy * {
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
body.disable-copy input, body.disable-copy textarea, body.disable-copy [contenteditable="true"] {
  -webkit-user-select: text !important; -moz-user-select: text !important; -ms-user-select: text !important; user-select: text !important;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }
input, select { font-family: inherit; font-size: 14px; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 20px; border-radius: 999px; font-weight: 600;
  font-size: 14px; transition: .2s; white-space: nowrap;
}
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 16px rgba(58,109,240,.28); }
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 8px 22px rgba(58,109,240,.36); }
.btn-accent { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 16px rgba(255,122,26,.3); }
.btn-accent:hover { filter: brightness(1.05); }
.btn-ghost { background: #eef3ff; color: var(--brand); }
.btn-ghost:hover { background: #e2ebff; }
.btn-line { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn-line:hover { background: #f5f8ff; }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 28px; font-size: 16px; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; height: var(--hdr-h); gap: 18px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--brand); flex-shrink: 0; }
.logo .mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--brand-grad);
  display: grid; place-items: center; color: #fff; font-size: 17px; font-weight: 900;
  box-shadow: 0 4px 12px rgba(58,109,240,.35);
}
.logo small { font-size: 11px; color: var(--text-3); font-weight: 600; display: block; margin-top: -3px; }

/* 全站公告栏 */
.site-notice {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg,#fff7e6,#fff1d6);
  border-bottom: 1px solid #ffe2a8;
  color: #8a5a00; font-size: 13px; min-height: 38px;
  padding: 7px 16px;
}
.site-notice .nt-ic { flex-shrink: 0; font-size: 15px; }
.site-notice .nt-wrap { flex: 1; overflow: hidden; position: relative; height: 24px; }
.site-notice .nt-track {
  display: inline-flex; align-items: center; height: 100%;
  white-space: nowrap; position: absolute; left: 0; top: 0;
  animation: nt-marquee 18s linear infinite; will-change: transform;
}
.site-notice .nt-wrap:hover .nt-track { animation-play-state: paused; }
.site-notice .nt-txt { padding-right: 80px; }
@keyframes nt-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  padding: 8px 14px; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: 15px;
  transition: .15s;
}
.nav a:hover, .nav a.active { color: var(--brand); background: #f2f6ff; }

.search {
  flex: 1; max-width: 460px; margin-left: auto; position: relative;
}
.search input {
  width: 100%; height: 40px; border-radius: 999px; border: 1px solid var(--line-2);
  background: #f7f9fc; padding: 0 16px 0 42px; outline: none; transition: .2s;
}
.search input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(58,109,240,.12); }
.search .ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search button {
  position: absolute; right: 5px; top: 5px; height: 30px; padding: 0 16px;
  background: var(--brand-grad); color: #fff; border-radius: 999px; font-weight: 600; font-size: 13px;
}

.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  color: var(--text-2); font-size: 19px; transition: .15s;
}
.icon-btn:hover { background: #f2f6ff; color: var(--brand); }
.cart-badge {
  position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px;
  display: grid; place-items: center; line-height: 1;
}
.hamburger { display: none; }

.user-menu { position: relative; }
.user-trigger {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 4px;
  border-radius: 999px; background: #f2f6ff; color: var(--brand); font-weight: 700; font-size: 13px;
  border: none; cursor: pointer; transition: .2s;
}
.user-trigger:hover { background: #e6efff; }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--brand-grad); color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
}
.user-phone { max-width: 86px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 140px;
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-h); border: 1px solid var(--line);
  padding: 8px 0; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .2s;
  z-index: 200;
}
.user-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown a {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 14px;
  color: var(--text-2); font-weight: 600; transition: .15s;
}
.user-dropdown a:hover { background: #f2f6ff; color: var(--brand); }

.m-only { display: none; }

/* mobile search row */
.m-search { display: none; }

/* ---------------- Hero ---------------- */
.hero {
  background: radial-gradient(1200px 400px at 70% -10%, rgba(91,141,239,.35), transparent),
    var(--brand-grad);
  color: #fff; padding: 46px 0 54px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 360px; height: 360px;
  background: rgba(255,255,255,.08); border-radius: 50%;
}
.hero-inner { display: flex; align-items: center; gap: 40px; position: relative; z-index: 1; }
.hero-text { flex: 1; }
.hero h1 { font-size: 34px; line-height: 1.3; margin-bottom: 14px; font-weight: 800; }
.hero h1 .hl { color: #ffe08a; }
.hero p { font-size: 15px; opacity: .92; margin-bottom: 22px; max-width: 520px; }
.hero-search {
  display: flex; background: #fff; border-radius: 999px; padding: 5px; max-width: 520px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.hero-search input { flex: 1; border: none; outline: none; padding: 0 18px; height: 42px; background: transparent; color: var(--text); }
.hero-search button { background: var(--accent-grad); color: #fff; height: 42px; padding: 0 26px; border-radius: 999px; font-weight: 700; }
.hero-stats { display: flex; gap: 30px; margin-top: 26px; }
.hero-stats .s b { font-size: 24px; display: block; }
.hero-stats .s span { font-size: 12px; opacity: .85; }
.hero-card {
  width: 320px; flex-shrink: 0; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  border-radius: 16px; padding: 22px; backdrop-filter: blur(6px);
}
.hero-card h3 { font-size: 17px; margin-bottom: 6px; }
.hero-card .price { font-size: 30px; font-weight: 800; color: #ffe08a; }
.hero-card .price small { font-size: 14px; text-decoration: line-through; color: rgba(255,255,255,.6); font-weight: 500; margin-left: 8px; }
.hero-card ul { margin: 14px 0 18px; }
.hero-card li { font-size: 13px; padding: 4px 0; display: flex; gap: 8px; align-items: center; }
.hero-card li::before { content: "✓"; color: #7CFFB0; font-weight: 800; }

/* ---------------- Category nav ---------------- */
.cat-strip { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-top: -28px; position: relative; z-index: 5; }
.cat-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.cat-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px; border-radius: 12px; transition: .15s; color: var(--text-2); cursor: pointer; }
.cat-item:hover { background: #f2f6ff; color: var(--brand); transform: translateY(-2px); }
.cat-item.active { background: #eef4ff; color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.cat-item .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: linear-gradient(135deg,#eef3ff,#e2ebff); }
.cat-item span { font-size: 12px; font-weight: 600; }
/* 分屏结构：PC 端让 .cat-page 内容直接参与父级网格，视觉保持原样（10 列）；移动端在 media 查询里改为独立整屏块 */
.cat-page { display: contents; }

/* 点击一级分类后下方展开的二级分类面板 */
.cat-sub-panel { margin-top: 16px; padding: 18px; border-radius: 14px; background: #f8faff; border: 1px solid #e8eefc; animation: fadeIn .2s ease; }
.cat-sub-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 15px; color: var(--text-2); }
.cat-sub-head b { font-size: 17px; color: var(--brand); }
.cat-sub-head .sub-count { font-size: 12px; color: #fff; background: var(--brand); padding: 2px 8px; border-radius: 10px; }
.cat-sub-grid { display: flex; flex-direction: column; gap: 4px; }
.cat-sub-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 12px; transition: .15s; color: var(--text-2); text-decoration: none; background: #fff; border: 1px solid transparent; }
.cat-sub-item:hover { background: #fff; border-color: var(--brand); color: var(--brand); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(58,109,240,.08); }
.cat-sub-item .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; color: #fff; }
.cat-sub-item span { font-size: 12px; font-weight: 600; }
.cat-sub-empty { color: var(--text-3); font-size: 13px; padding: 16px; text-align: center; background: #fff; border-radius: 12px; }

/* ====== 三级分类：二级块（卡片） + 下方可展开的三级网格 ====== */
.cat-sub-block { display: flex; flex-direction: column; gap: 6px; padding: 4px; border-radius: 14px; transition: .15s; }
.cat-sub-block:hover { background: rgba(58,109,240,.04); }
.cat-sub-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid transparent; cursor: pointer; color: var(--text); transition: .15s; user-select: none; }
.cat-sub-card:hover { border-color: var(--brand); box-shadow: 0 4px 12px rgba(58,109,240,.08); }
.cat-sub-card.has-third.open { border-color: var(--brand); background: #eef4ff; }
.cat-sub-card .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; color: #fff; flex-shrink: 0; font-weight: 600; }
.cat-sub-card .cat-sub-name { flex: 1; font-size: 13.5px; font-weight: 600; }
.cat-sub-card .cat-sub-count { font-size: 11px; color: #fff; background: var(--brand); padding: 2px 8px; border-radius: 10px; }
.cat-sub-card .cat-sub-caret { color: var(--text-3); font-size: 14px; transition: transform .2s; margin-left: 4px; }
.cat-sub-card.open .cat-sub-caret { transform: rotate(-180deg); color: var(--brand); }

.cat-third-grid { display: none; flex-wrap: wrap; gap: 8px; padding: 10px 8px 14px 50px; animation: fadeIn .18s ease; }
.cat-third-grid[style*="flex"] { display: flex !important; }
.cat-third-item { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid #e8eefc; color: var(--text-2); font-size: 12.5px; text-decoration: none; transition: .15s; }
.cat-third-item:hover { background: var(--brand); color: #fff; border-color: var(--brand); transform: translateY(-1px); }
.cat-third-item .ic { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; color: #fff; flex-shrink: 0; }
.cat-third-item:hover .ic { background: rgba(255,255,255,.25); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* 层级分类卡片（旧版兼容，当前首页已不再生成该结构） */
.cat-card { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 6px; border-radius: 12px; transition: .15s; background: #fff; border: 1px solid transparent; }
.cat-card:hover { background: #f8faff; border-color: #e8eefc; }
.cat-main { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-2); text-decoration: none; }
.cat-main .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: linear-gradient(135deg,#eef3ff,#e2ebff); color: #fff; }
.cat-main .title { font-size: 13px; font-weight: 700; }
.cat-subs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 22px; }
.cat-subs a { font-size: 11px; color: var(--text-3); background: #f2f4f7; padding: 2px 7px; border-radius: 10px; line-height: 1.4; transition: .15s; text-decoration: none; }
.cat-subs a:hover { background: var(--brand); color: #fff; }

/* ---------------- Sections ---------------- */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.section-head h2 { font-size: 24px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.section-head h2::before { content: ""; width: 5px; height: 22px; border-radius: 3px; background: var(--brand-grad); }
.section-head .more { color: var(--text-3); font-size: 13px; }
.section-head .more:hover { color: var(--brand); }

/* ---------------- Product grid ---------------- */
.goods-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.good-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: .2s; display: flex; flex-direction: column; border: 1px solid transparent;
}
.good-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-h); border-color: #e2ebff; }
.good-thumb { aspect-ratio: 3 / 4; height: auto; display: grid; place-items: center; position: relative; color: #fff; font-size: 15px; font-weight: 700; }
/* 有图：图片流式铺满卡片宽，高度随图自适应，零留白 */
.good-thumb.has-img { aspect-ratio: auto; display: block; overflow: hidden; }
.good-thumb .badge-self { position: absolute; top: 10px; left: 10px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; z-index: 2; }
.good-thumb .badge-auto { position: absolute; bottom: 10px; left: 10px; background: rgba(0,0,0,.35); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 6px; backdrop-filter: blur(2px); z-index: 2; }
/* 渠道同步商品真图展示：完整显示不裁切（竖版海报常见），加载失败自动回退为分类色块+文字 */
.good-thumb img.thumb-img { display: block; width: 100%; height: auto; transition: transform .25s ease; }
.good-card:hover .good-thumb img.thumb-img { transform: scale(1.03); }
.detail-gallery .main-img.has-img { aspect-ratio: auto; display: block; overflow: hidden; }
.detail-gallery .main-img img { display: block; width: 100%; height: auto; }
.ci-thumb img, .thumbs .t img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; z-index: 1; }
.detail-gallery .main-img { position: relative; overflow: hidden; }
.cart-row .ci-thumb { position: relative; overflow: hidden; }
.thumbs .t { position: relative; overflow: hidden; }
.good-body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.good-name { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.45; height: 39px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.good-code { font-size: 11px; color: var(--text-3); }
.good-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 5px; background: var(--green-bg); color: var(--green); font-weight: 600; }
.tag.o { background: var(--orange-bg); color: var(--accent); }
.tag.g { background: #eef3ff; color: var(--brand); }
.good-price { margin-top: auto; display: flex; align-items: baseline; gap: 8px; }
.good-price .now { color: var(--accent); font-weight: 800; font-size: 20px; }
.good-price .now small { font-size: 12px; }
.good-price .min { font-size: 11px; color: var(--text-3); }
.good-buy { display: flex; gap: 8px; margin-top: 8px; }
.good-buy .btn { flex: 1; height: 36px; }

/* ---------------- Promo (分站) ---------------- */
.promo {
  background: linear-gradient(120deg, #1c2b55 0%, #2a55c8 60%, #3a6df0 100%);
  border-radius: 20px; padding: 36px; color: #fff; display: flex; gap: 36px; align-items: center;
  position: relative; overflow: hidden;
}
.promo::before { content: ""; position: absolute; left: -60px; bottom: -80px; width: 280px; height: 280px; background: rgba(255,255,255,.06); border-radius: 50%; }
.promo-text { flex: 1; position: relative; z-index: 1; }
.promo-text h2 { font-size: 26px; margin-bottom: 10px; }
.promo-text p { opacity: .9; margin-bottom: 18px; max-width: 520px; }
.promo-points { display: flex; gap: 26px; flex-wrap: wrap; }
.promo-points .p b { font-size: 22px; display: block; color: #ffe08a; }
.promo-points .p span { font-size: 12px; opacity: .85; }
.promo-ticket { background: #fff; border-radius: 16px; padding: 24px; color: var(--text); width: 300px; flex-shrink: 0; text-align: center; position: relative; z-index: 1; }
.promo-ticket .lab { font-size: 13px; color: var(--text-2); }
.promo-ticket .old { color: var(--text-3); text-decoration: line-through; font-size: 15px; }
.promo-ticket .cur { color: var(--accent); font-size: 40px; font-weight: 800; }
.promo-ticket .cur small { font-size: 18px; }
.promo-ticket .save { display: inline-block; background: var(--orange-bg); color: var(--accent); font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; margin: 8px 0 14px; }
.promo-ticket .note { font-size: 11px; color: var(--text-3); margin-top: 10px; }

/* ---------------- Feature grid ---------------- */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature-card { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); transition: .2s; }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-h); }
.feature-card .fic { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: linear-gradient(135deg,#eef3ff,#e2ebff); margin-bottom: 14px; }
.feature-card h3 { font-size: 16px; margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--text-2); }

/* ---------------- Testimonials ---------------- */
.review-head { display: flex; align-items: center; gap: 30px; background: var(--card); border-radius: var(--radius); padding: 22px 28px; box-shadow: var(--shadow); margin-bottom: 20px; }
.review-score { text-align: center; flex-shrink: 0; }
.review-score b { font-size: 44px; color: var(--accent); font-weight: 800; line-height: 1; }
.review-score span { font-size: 12px; color: var(--text-3); }
.review-bars { flex: 1; }
.review-bars .rb { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-2); margin: 5px 0; }
.review-bars .rb .track { flex: 1; height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.review-bars .rb .track i { display: block; height: 100%; background: var(--accent-grad); border-radius: 999px; }
.reviews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.review-card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.review-card .top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.review-card .avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: grid; place-items: center; font-weight: 700; }
.review-card .who b { font-size: 14px; }
.review-card .who span { font-size: 12px; color: var(--text-3); display: block; }
.review-card .stars { color: #ffb400; font-size: 13px; }
.review-card p { font-size: 13px; color: var(--text-2); }
.review-card .rtags { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- Advantages ---------------- */
.adv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.adv-card { display: flex; gap: 14px; background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.adv-card .aic { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-grad); color: #fff; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.adv-card h3 { font-size: 15px; margin-bottom: 4px; }
.adv-card p { font-size: 12.5px; color: var(--text-2); }

/* ---------------- Partners ---------------- */
.partner-wrap { display: flex; align-items: center; gap: 30px; background: var(--card); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.partner-num { text-align: center; flex-shrink: 0; }
.partner-num b { font-size: 38px; color: var(--brand); font-weight: 800; }
.partner-num span { font-size: 12px; color: var(--text-3); display: block; }
.partner-logos { flex: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.partner-logos .pl { padding: 8px 16px; background: #f4f6fa; border-radius: 10px; font-weight: 700; color: var(--text-2); font-size: 13px; }

/* ---------------- Footer ---------------- */
.site-footer { background: #1b2233; color: #aeb8c8; margin-top: 30px; }
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; padding: 44px 0 30px; }
.footer-top .f-brand .logo { color: #fff; margin-bottom: 14px; }
.footer-top .f-brand p { font-size: 13px; max-width: 280px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 13px; padding: 5px 0; color: #aeb8c8; transition: .15s; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0; font-size: 12px; text-align: center; color: #7d8aa0; }
.footer-bottom a { color: #7d8aa0; }

/* ---------------- Mobile bottom tab ---------------- */
.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; height: var(--tab-h); background: #fff; border-top: 1px solid var(--line); z-index: 90; box-shadow: 0 -4px 16px rgba(0,0,0,.05); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-3); font-size: 11px; position: relative; }
.tabbar a .ti { font-size: 21px; }
.tabbar a.active { color: var(--brand); }

/* ---------------- Breadcrumb ---------------- */
.crumb { font-size: 13px; color: var(--text-3); padding: 16px 0; }
.crumb a:hover { color: var(--brand); }

/* ---------------- Goods list layout ---------------- */
.list-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.side-cat { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); position: sticky; top: 80px; }
.side-cat h3 { font-size: 15px; margin-bottom: 10px; padding-left: 6px; }
.side-cat a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text-2); font-size: 14px; transition: .15s; }
.side-cat a:hover, .side-cat a.active { background: #f2f6ff; color: var(--brand); font-weight: 600; }
.cat-group + .cat-group { margin-top: 4px; }
.cat-row { display: flex; align-items: center; }
.cat-row > a { flex: 1; min-width: 0; }
.cat-toggle { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 6px; cursor: pointer; color: var(--text-3); user-select: none; transition: .15s; }
.cat-toggle:hover { background: #f2f6ff; color: var(--brand); }
.cat-toggle::after { content: '▶'; font-size: 10px; }
.cat-toggle.open::after { content: '▼'; }
.list-main { min-width: 0; }
.list-tools { background: var(--card); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.list-tools .lt { font-size: 13px; color: var(--text-2); padding: 6px 12px; border-radius: 8px; }
.list-tools .lt.active, .list-tools .lt:hover { background: #f2f6ff; color: var(--brand); font-weight: 600; }
.list-tools .count { margin-left: auto; font-size: 13px; color: var(--text-3); }

/* ---------------- Detail ---------------- */
.detail { display: grid; grid-template-columns: 420px 1fr; gap: 28px; align-items: start; }
.detail-gallery { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.detail-gallery .main-img { aspect-ratio: 3 / 4; height: auto; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; }
.detail-gallery .thumbs { display: flex; gap: 10px; margin-top: 14px; }
.detail-gallery .thumbs .t { width: 70px; height: 70px; border-radius: 10px; cursor: pointer; border: 2px solid transparent; }
.detail-gallery .thumbs .t.active { border-color: var(--brand); }
.detail-info { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.detail-info h1 { font-size: 22px; margin-bottom: 10px; }
.detail-info .code { color: var(--text-3); font-size: 13px; margin-bottom: 16px; }
.detail-price { background: linear-gradient(135deg,#fff7ef,#fff); border: 1px solid #ffe3cc; border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.detail-price .row { display: flex; align-items: baseline; gap: 14px; }
.detail-price .now { color: var(--accent); font-size: 32px; font-weight: 800; }
.detail-price .now small { font-size: 16px; }
.detail-price .min { font-size: 13px; color: var(--text-3); }
.detail-price .meta { display: flex; gap: 18px; margin-top: 12px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.detail-price .meta b { color: var(--text); }
.spec { margin-bottom: 18px; }
.spec h4 { font-size: 14px; margin-bottom: 10px; }
.spec .opts { display: flex; flex-wrap: wrap; gap: 10px; }
.spec .opt { padding: 8px 16px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 14px; color: var(--text-2); transition: .15s; }
.spec .opt.active { border-color: var(--brand); color: var(--brand); background: #f2f6ff; font-weight: 600; }
.qty { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.qty .stepper { display: flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.qty .stepper button { width: 38px; height: 38px; font-size: 18px; color: var(--text-2); }
.qty .stepper input { width: 56px; height: 38px; text-align: center; border: none; border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); outline: none; }
.detail-actions { display: flex; gap: 14px; }
.detail-actions .btn { flex: 1; height: 50px; font-size: 16px; }
.detail-desc { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-top: 24px; }
.detail-desc h3 { font-size: 18px; margin-bottom: 14px; }
.detail-desc p { color: var(--text-2); margin-bottom: 10px; font-size: 14px; }
.detail-desc ul { padding-left: 18px; color: var(--text-2); font-size: 14px; }
.detail-desc ul li { margin: 6px 0; list-style: disc; }

/* ---------------- Cart ---------------- */
.cart-table { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cart-row { display: grid; grid-template-columns: 40px 80px 1fr 130px 130px 120px 60px; gap: 14px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.cart-row.head { background: #fafbfe; font-size: 13px; color: var(--text-2); font-weight: 600; }
.cart-row .ci-thumb { width: 70px; height: 70px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; }
.cart-row .ci-name { font-weight: 600; font-size: 14px; }
.cart-row .ci-code { font-size: 12px; color: var(--text-3); }
.cart-row .ci-price { color: var(--accent); font-weight: 700; }
.cart-row .ci-del { color: var(--text-3); font-size: 18px; }
.cart-row .ci-del:hover { color: #ff4d4f; }
.cart-foot { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px; margin-top: 16px; display: flex; align-items: center; gap: 20px; }
.cart-foot .total { margin-left: auto; font-size: 15px; color: var(--text-2); }
.cart-foot .total b { color: var(--accent); font-size: 26px; font-weight: 800; }
.cart-empty { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 60px 20px; text-align: center; color: var(--text-3); }
.cart-empty .big { font-size: 48px; margin-bottom: 12px; }

/* ---------------- Forms (login/checkout) ---------------- */
.auth-wrap { max-width: 420px; margin: 40px auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 24px; background: #f4f6fa; padding: 5px; border-radius: 12px; }
.auth-tabs button { flex: 1; height: 42px; border-radius: 9px; font-weight: 700; color: var(--text-2); }
.auth-tabs button.active { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 600; }
.field input { width: 100%; height: 46px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 14px; outline: none; transition: .2s; }
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(58,109,240,.12); }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.auth-alt { text-align: center; font-size: 13px; color: var(--text-3); margin-top: 16px; }
.auth-alt a { color: var(--brand); }

.checkout-layout { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
.checkout-box { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.checkout-box h3 { font-size: 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.checkout-box h3 .step { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-grad); color: #fff; font-size: 12px; display: grid; place-items: center; }
.pay-opt { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line-2); border-radius: 10px; margin-bottom: 10px; cursor: pointer; transition: .15s; }
.pay-opt.active { border-color: var(--brand); background: #f2f6ff; }
.pay-opt .pic { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; }
.pay-opt .pn { font-weight: 600; }
.pay-opt .pd { font-size: 12px; color: var(--text-3); }
.order-sum { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; position: sticky; top: 80px; }
.order-sum h3 { font-size: 16px; margin-bottom: 14px; }
.order-sum .li { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); padding: 6px 0; }
.order-sum .li b { color: var(--text); }
.order-sum .total { border-top: 1px dashed var(--line-2); margin-top: 10px; padding-top: 14px; display: flex; justify-content: space-between; align-items: baseline; }
.order-sum .total b { color: var(--accent); font-size: 26px; font-weight: 800; }

/* ---------------- Banner slider ---------------- */
.slider { position: relative; border-radius: var(--radius); overflow: hidden; margin-top: 22px; height: 200px; }
.slide { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px; font-weight: 800; opacity: 0; transition: opacity .6s; }
.slide.active { opacity: 1; }
.slider .dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 2; }
.slider .dots i { width: 9px; height: 9px; border-radius: 999px; background: rgba(255,255,255,.5); cursor: pointer; }
.slider .dots i.active { background: #fff; width: 22px; }
.slider .slide { pointer-events: none; }
.slider .slide.active { pointer-events: auto; }

/* ---------------- Modal ---------------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 400px; padding: 26px; animation: pop .25s ease; position: relative; overflow-x: hidden; box-sizing: border-box; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { font-size: 18px; margin-bottom: 8px; }
/* 右上角红色圆形关闭按钮，悬停在弹窗右上角外侧，醒目 */
.modal-close { position: absolute; top: -16px; right: -16px; width: 38px; height: 38px; border: 2px solid #e74c3c; background: #fff; border-radius: 50%; font-size: 24px; line-height: 1; font-weight: 700; color: #e74c3c; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.18); z-index: 10; transition: .15s; }
.modal-close:hover { background: #e74c3c; color: #fff; transform: scale(1.08); }
.modal .m-code { background: #f4f6fa; border-radius: 10px; padding: 16px; text-align: center; font-size: 20px; letter-spacing: 3px; font-weight: 800; color: var(--brand); margin: 14px 0; }
.modal .m-note { font-size: 12px; color: var(--text-3); text-align: center; }

/* ---------------- Toast ---------------- */
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(20,28,45,.92); color: #fff; padding: 11px 22px; border-radius: 999px; font-size: 14px; opacity: 0; transition: .3s; z-index: 300; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================
   Responsive — Tablet
   ========================================================= */
@media (max-width: 1100px) {
  .goods-grid { grid-template-columns: repeat(4, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(8, 1fr); }
  .cat-card { padding: 8px 4px; }
  .cat-main .ic { width: 40px; height: 40px; font-size: 19px; }
  .cat-main .title { font-size: 12px; }
  .reviews { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   Responsive — Mobile H5
   ========================================================= */
@media (max-width: 768px) {
  body { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); font-size: 13px; }
  .container { padding: 0 12px; }

  .nav {
    position: absolute; top: var(--hdr-h); left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; padding: 8px 16px 16px; box-shadow: var(--shadow); gap: 0; z-index: 90;
  }
  .nav a { padding: 12px 0; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav a:last-of-type { border-bottom: none; }
  .nav, .search, .header-actions .btn, .header-actions .txt { display: none; }
  .hamburger { display: grid; }
  .header-inner { height: 54px; gap: 10px; }
  .logo { font-size: 17px; }
  .logo .mark { width: 30px; height: 30px; font-size: 15px; }
  .m-only { display: flex; }

  .m-search { display: block; padding: 10px 12px; background: #fff; }
  .m-search .box { display: flex; background: #f4f6fa; border-radius: 999px; padding: 4px; }
  .m-search input { flex: 1; border: none; background: transparent; outline: none; padding: 0 14px; height: 36px; }
  .m-search button { background: var(--brand-grad); color: #fff; height: 36px; padding: 0 18px; border-radius: 999px; font-weight: 600; }

  .hero { padding: 28px 0 40px; }
  .hero-inner { flex-direction: column; gap: 22px; }
  .hero h1 { font-size: 24px; }
  .hero-card { width: 100%; }
  .hero-stats { gap: 20px; }
  .hero-stats .s b { font-size: 20px; }

  .cat-strip { margin-top: -18px; padding: 12px; position: relative; }
  .cat-strip::after {
    content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 36px;
    background: linear-gradient(to right, rgba(255,255,255,0), var(--card) 90%);
    pointer-events: none; border-radius: 0 var(--radius) var(--radius) 0;
  }
  .cat-grid {
    display: flex;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .cat-grid::-webkit-scrollbar { display: none; }
  .cat-page {
    flex: 0 0 100%;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 2px;
    scroll-snap-align: start;
  }
  .cat-item {
    padding: 8px 2px;
    min-width: 0;
  }
  .cat-item .ic { width: 40px; height: 40px; font-size: 19px; }
  .cat-item span { font-size: 11px; }
  .cat-card { padding: 6px 2px; gap: 4px; }
  .cat-main { gap: 4px; }
  .cat-main .ic { width: 36px; height: 36px; font-size: 17px; }
  .cat-main .title { font-size: 11px; }
  .cat-subs { gap: 2px; min-height: 18px; }
  .cat-subs a { font-size: 10px; padding: 1px 4px; border-radius: 8px; }

  .section { padding: 26px 0; }
  .section-head h2 { font-size: 19px; }
  .section-head h2::before { height: 18px; }

  .goods-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .good-name { font-size: 12.5px; height: 36px; }
  .good-price .now { font-size: 17px; }
  .good-buy .btn { height: 32px; font-size: 12px; padding: 0 6px; }

  .promo { flex-direction: column; padding: 22px; gap: 20px; border-radius: 16px; }
  .promo-text h2 { font-size: 21px; }
  .promo-ticket { width: 100%; }

  .feature-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .feature-card { padding: 16px; }
  .feature-card .fic { width: 42px; height: 42px; font-size: 20px; }

  .review-head { flex-direction: column; align-items: flex-start; gap: 14px; padding: 18px; }
  .reviews { grid-template-columns: 1fr; }
  .adv-grid { grid-template-columns: 1fr; }
  .partner-wrap { flex-direction: column; text-align: center; gap: 16px; }

  .footer-top { grid-template-columns: 1fr 1fr; gap: 20px; padding: 30px 0 20px; }
  .footer-top .f-brand { grid-column: 1 / -1; }

  .tabbar { display: flex; }

  /* list */
  .list-layout { grid-template-columns: 1fr; }
  .side-cat { display: none; }
  .list-tools .count { width: 100%; margin-left: 0; }

  /* detail */
  .detail { grid-template-columns: 1fr; gap: 16px; }
  .detail-info { padding: 18px; }
  .detail-info h1 { font-size: 19px; }
  .detail-price .now { font-size: 27px; }
  .detail-actions .btn { height: 46px; font-size: 15px; }

  /* cart */
  .cart-row { grid-template-columns: 60px 1fr 90px; gap: 10px; padding: 14px 12px; }
  .cart-row.head { display: none; }
  .cart-row .ci-price, .cart-row .col-qty, .cart-row .col-sub { display: none; }
  .cart-foot { flex-wrap: wrap; gap: 12px; }
  .cart-foot .total { width: 100%; margin-left: 0; text-align: right; }
  .cart-foot .total b { font-size: 22px; }

  /* checkout */
  .checkout-layout { grid-template-columns: 1fr; }
  .order-sum { position: static; }

  .auth-wrap { margin: 20px 12px; padding: 24px 18px; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 28px); }
}

@media (max-width: 380px) {
  .goods-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr; }
}
