/* ============================================================
   黔钠科技 · 服务号 H5 样式（由小程序 UI 规范迁移）
   设计基准：750rpx = 屏幕宽度 → H5 用 vw 换算（1rpx = 0.1333vw）
   为可读性，本文件统一用 px 并按 375px 视觉稿书写，
   字号/间距与原小程序 rpx 值 1:1 对应（rpx ÷ 2 = px）。
   ============================================================ */

:root {
  --blue: #3B82F6;
  --blue-deep: #2563EB;
  --blue-light: #4C8DF8;
  --green: #10B981;
  --teal: #0D9488;
  --ink: #1F2937;
  --ink-2: #475569;
  --ink-3: #6B7280;
  --ink-4: #94A3B8;
  --line: #EEF2F6;
  --bg: #F0F7FB;
  --card-shadow: 0 2px 10px rgba(59, 130, 246, 0.06);
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
input, button { font-family: inherit; font-size: inherit; outline: none; border: none; background: none; }
a { color: inherit; text-decoration: none; }

/* 页面容器：手机端满宽，桌面端居中限宽（服务号在 PC 微信里打开也好看） */
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; padding-bottom: 24px; }

/* ===== 卡片 ===== */
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px;
  box-shadow: var(--card-shadow);
}

/* ===== 按钮 ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #fff;
  border-radius: 24px;
  height: 44px;
  line-height: 44px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25);
  cursor: pointer;
  display: block;
  width: 100%;
}
.btn-primary:active { opacity: .88; }

.btn-ghost {
  background: #fff;
  color: var(--blue);
  border-radius: 24px;
  height: 44px;
  line-height: 42px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--blue);
  cursor: pointer;
  display: block;
  width: 100%;
}
.btn-ghost:active { background: #F5F9FF; }

.btn-blue {
  background: linear-gradient(135deg, var(--blue-light), var(--blue-deep));
  color: #fff;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 600;
  padding: 0 20px;
  height: 38px;
  line-height: 38px;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.3);
  cursor: pointer;
}
.btn-blue:active { opacity: .85; }

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  background: #E8F4FD;
  color: var(--blue);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 11px;
  margin: 0 6px 6px 0;
}

/* ===== 警示条 ===== */
.warn-bar {
  background: #FFFBEB;
  border-left: 3px solid #F59E0B;
  padding: 10px 12px;
  font-size: 12px;
  color: #92400E;
  line-height: 1.6;
  border-radius: 5px;
}

/* ===== 区块标题 ===== */
.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}
.section-title::before {
  content: '';
  width: 5px;
  height: 16px;
  background: linear-gradient(180deg, var(--blue), var(--green));
  border-radius: 3px;
  margin-right: 7px;
  flex-shrink: 0;
}
.section-title.no-mb { margin-bottom: 0; }

.text-sub { color: var(--ink-3); font-size: 12px; }
.text-green { color: var(--green); font-weight: 600; }

/* ===== 型号徽章 ===== */
.model-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #fff;
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== 蓝色渐变头图 ===== */
.hero-blue {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 26px 20px 21px;
  background:
    radial-gradient(280px 210px at 88% 12%, rgba(255,255,255,0.16), transparent 62%),
    radial-gradient(260px 200px at 6% 108%, rgba(45,212,191,0.20), transparent 62%),
    linear-gradient(148deg, #55A1FF 0%, #3B82F6 46%, #2563EB 100%);
}
.hero-blue::before {
  content: '';
  position: absolute; right: -45px; bottom: -55px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.hero-blue::after {
  content: '';
  position: absolute; left: -25px; top: -30px;
  width: 95px; height: 95px; border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.22);
}
.hero-title { font-size: 27px; font-weight: 800; letter-spacing: 2px; }
.hero-slogan { font-size: 15px; font-weight: 600; margin-top: 7px; letter-spacing: 1px; }
.hero-sub { font-size: 11px; opacity: .86; margin-top: 5px; letter-spacing: .5px; }
.hero-sphere { position: absolute; right: 75px; top: 15px; width: 98px; height: 98px; }
.hero-side {
  position: absolute; right: 14px; top: 22px;
  font-size: 9px; line-height: 2; opacity: .85; text-align: center;
}
.hero-side span { display: block; }

/* Na+ 球体 */
.na-sphere {
  position: absolute; width: 74px; height: 74px; border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #FFF 0%, #E3F0FF 38%, #A8CBFF 76%, #8AB6FB 100%);
  box-shadow: 0 6px 16px rgba(9,48,135,0.35), inset -5px -6px 13px rgba(125,173,255,0.6);
  display: flex; align-items: center; justify-content: center;
}
.na-sphere .na-txt {
  color: #2E6FF2; font-size: 23px; font-weight: 800;
  text-shadow: 0 1px 4px rgba(255,255,255,0.9);
}
.na-orbit {
  position: absolute; left: 0; top: 0; width: 98px; height: 98px;
  border-radius: 50%; border: 1px dashed rgba(255,255,255,0.35);
  animation: spin 18s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.na-dot { position: absolute; border-radius: 50%; background: #fff; box-shadow: 0 0 5px rgba(255,255,255,0.9); }
.na-dot.d1 { width: 6px; height: 6px; left: 3px; top: 48px; }
.na-dot.d2 { width: 4px; height: 4px; right: 1px; top: 17px; opacity: .85; }
.na-dot.d3 { width: 5px; height: 5px; right: 34px; bottom: 1px; opacity: .7; }
.hero-sphere .na-sphere { left: 12px; top: 12px; }

/* ===== 分段切换 ===== */
.seg-wrap { padding: 13px 12px 3px; }
.seg-tabs {
  display: flex; background: #fff; border-radius: 999px; padding: 3.5px;
  box-shadow: 0 4px 12px rgba(59,130,246,0.12);
}
.seg-tab {
  flex: 1; text-align: center; padding: 8.5px 0; font-size: 14.5px;
  font-weight: 600; color: var(--ink-2); border-radius: 999px;
  transition: all .2s; cursor: pointer;
}
.seg-tab.on {
  background: linear-gradient(135deg, var(--blue-light), var(--blue-deep));
  color: #fff; box-shadow: 0 3px 8px rgba(37,99,235,0.35);
}

/* ===== 匹配搜索卡片 ===== */
.match-card {
  background: #fff; border-radius: var(--radius); margin: 9px 12px 0; padding: 15px 14px;
  box-shadow: 0 4px 12px rgba(59,130,246,0.08);
}
.match-row { display: flex; align-items: center; margin-top: 2px; gap: 10px; }
.match-hint { font-size: 11px; color: var(--ink-4); margin-top: 10px; }
.search-pill {
  flex: 1; display: flex; align-items: center; background: #F1F5FA;
  border-radius: 999px; height: 38px; padding: 0 13px;
}
.search-pill input { flex: 1; font-size: 13.5px; color: var(--ink); background: none; }
.search-pill input::placeholder { color: #B6C2D4; }
.search-ico {
  width: 14px; height: 14px; border: 2px solid #9FB3CC; border-radius: 50%;
  position: relative; flex-shrink: 0; margin-right: 7px;
}
.search-ico::after {
  content: ''; position: absolute; width: 6px; height: 2px; background: #9FB3CC;
  border-radius: 1px; right: -5px; bottom: -1px; transform: rotate(45deg);
}

/* ===== 区块 ===== */
.section { padding: 0 12px; margin-top: 15px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.sec-sub { font-size: 10.5px; color: var(--ink-4); }
.sec-more { font-size: 11.5px; color: var(--blue); font-weight: 600; cursor: pointer; }

/* ===== 分类 2x2 ===== */
.cat-grid { display: flex; flex-wrap: wrap; justify-content: space-between; }
.cat-card {
  width: 48.6%; background: #fff; border-radius: 11px; padding: 13px 12px;
  margin-bottom: 10px; display: flex; align-items: center;
  box-shadow: 0 3px 10px rgba(59,130,246,0.07); transition: transform .15s; cursor: pointer;
}
.cat-card:active { transform: scale(.96); }
.cat-img {
  width: 54px; height: 54px; border-radius: 9px; flex-shrink: 0;
  background: #EAF3FF; border: 1px solid #D9E7FA; object-fit: cover;
}
.cat-info { flex: 1; margin-left: 10px; overflow: hidden; }
.cat-name { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.cat-count { margin-top: 5px; font-size: 11px; color: var(--teal); display: flex; align-items: center; }
.cc-num { font-size: 14px; font-weight: 700; color: var(--teal); margin-right: 1px; }
.cc-arrow { margin-left: 4px; color: var(--teal); font-size: 13px; }

/* ===== 热门型号 3 列 ===== */
.hot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; }
.hot-card {
  width: 32.2%; height: 98px; background: #fff; border-radius: 10px; margin-bottom: 8px;
  padding: 10px 6px; position: relative; overflow: hidden;
  box-shadow: 0 3px 10px rgba(59,130,246,0.07); transition: transform .15s;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; cursor: pointer;
}
.hot-card:active { transform: scale(.95); }
.hot-model { font-size: 18px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.hot-spec { font-size: 11px; color: var(--ink-4); margin-top: 5px; white-space: nowrap; }
.hot-cca {
  display: inline-block; font-size: 10px; color: #059669; font-weight: 700;
  margin-top: 7px; background: #E4F8EE; border-radius: 999px; padding: 1px 9px; white-space: nowrap;
}

/* ===== 优势 / 亮点 ===== */
.adv-item { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.adv-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.adv-title { font-size: 14px; font-weight: 700; color: var(--blue); margin-bottom: 5px; }
.adv-point { font-size: 12px; color: #4B5563; line-height: 1.8; }
.hl-item { display: flex; align-items: center; font-size: 13px; line-height: 2.1; color: var(--ink); }
.hl-check {
  width: 17px; height: 17px; border-radius: 50%; background: #D1FAE5;
  flex-shrink: 0; position: relative; margin-right: 7px; align-self: center;
}
.hl-check::after {
  content: ''; position: absolute; left: 5px; top: 4.5px;
  width: 6.5px; height: 3.5px; border-left: 2px solid var(--green);
  border-bottom: 2px solid var(--green); transform: rotate(-45deg);
}

/* ===== 页脚 ===== */
.foot-link { text-align: center; color: var(--blue); font-size: 13px; padding: 15px 0 5px; font-weight: 600; cursor: pointer; }
.page-footer { text-align: center; font-size: 10px; color: #BBBBBB; padding: 10px 0 15px; }

/* ===== 搜索页 ===== */
.search-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: #fff; position: sticky; top: 0; z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.search-input-wrap {
  flex: 1; display: flex; align-items: center; background: #F1F5FA;
  border-radius: 999px; height: 38px; padding: 0 13px;
}
.search-input { flex: 1; font-size: 14px; color: var(--ink); }
.search-input::placeholder { color: #B6C2D4; }
.search-clear { color: #B6C2D4; font-size: 14px; padding: 0 4px; cursor: pointer; }
.search-cancel { color: var(--blue); font-size: 14px; font-weight: 600; cursor: pointer; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.card-action { font-size: 12px; color: var(--ink-4); cursor: pointer; }
.tag-wrap { display: flex; flex-wrap: wrap; }
.tag-wrap .tag { cursor: pointer; }
.tag.hot { background: #E7F9F1; color: #059669; }
.brand-grid { display: flex; flex-wrap: wrap; }
.brand-item {
  width: 23%; margin: 0 2% 8px 0; text-align: center; font-size: 12px;
  padding: 8px 0; background: #F1F5FA; border-radius: 8px; cursor: pointer;
}
.brand-item:active { background: #E2ECFA; }

/* ===== 结果页 ===== */
.info-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 12px 4px; font-size: 13px; color: #333;
}
.re-search { color: var(--blue); font-size: 12px; cursor: pointer; }
.warn-wrap { padding: 6px 12px 0; }
.sec-title {
  padding: 10px 12px 4px; font-size: 16px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center;
}
.sec-title::before {
  content: ''; width: 5px; height: 15px;
  background: linear-gradient(180deg, var(--blue), var(--green));
  border-radius: 3px; margin-right: 7px;
}
.veh-card { margin-top: 8px; }
.veh-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.veh-name { font-size: 16px; font-weight: 700; color: var(--ink); }
.veh-bay {
  display: flex; align-items: center; flex-wrap: wrap; background: #F0F7FB;
  border-radius: 7px; padding: 8px 10px; margin-bottom: 5px; gap: 8px;
}
.veh-bay-label { font-size: 11px; color: var(--ink-3); }
.veh-baydim { font-size: 12px; color: var(--ink-2); margin: 1px 0 5px; }
.veh-bay-size { font-size: 14px; font-weight: 700; color: var(--blue); }
.veh-bay-v { font-size: 12px; color: #333; }
.veh-bay-cca { font-size: 12px; color: #059669; font-weight: 600; }
.veh-ss { font-size: 10px; color: #B45309; background: #FEF3C7; border-radius: 3px; padding: 1px 6px; }
.veh-decode { font-size: 10px; color: #B91C1C; background: #FEE2E2; border-radius: 3px; padding: 1px 6px; }
.veh-term { font-size: 11px; color: var(--ink-3); margin-bottom: 6px; }
.veh-decode-note {
  font-size: 11px; color: #B91C1C; background: #FEF2F2; border-left: 3px solid #EF4444;
  border-radius: 4px; padding: 6px 8px; margin-bottom: 6px; line-height: 1.5;
}

/* 可装电池列表 */
.fit-list { border-top: 1px solid var(--line); }
.fit-item {
  padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer;
  transition: background .15s;
}
.fit-item:last-child { border-bottom: none; padding-bottom: 0; }
.fit-item:active { background: #F7FBFF; }
.fit-main { display: flex; align-items: center; margin-bottom: 5px; gap: 8px; }
.fit-level { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 2px 8px; }
.fit-perfect { background: #E7F9F1; color: #059669; }
.fit-fit { background: #E8F4FD; color: #2563EB; }
.fit-loose { background: #FEF3C7; color: #B45309; }
.fit-tight { background: #F3E8FF; color: #7C3AED; }
.fit-no { background: #FEE2E2; color: #DC2626; }
.fit-spec { font-size: 12px; color: #333; margin-bottom: 3px; }
.fit-size { font-size: 11px; color: #888; }
.fit-note { color: #B45309; }
.fit-none { font-size: 12px; color: #888; padding: 8px 0; }
.fit-suggest {
  margin-left: auto; font-size: 10.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #4A7CF7, #2563EB);
  border-radius: 999px; padding: 2px 9px;
  box-shadow: 0 2px 5px rgba(37,99,235,0.25);
}

/* 适用年款 */
.veh-year { display: flex; align-items: center; flex-wrap: wrap; margin-bottom: 6px; gap: 6px; }
.veh-year-label { font-size: 10.5px; color: #fff; background: #94A3B8; border-radius: 3px; padding: 1px 6px; }
.veh-year-val { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.veh-year-ok { font-size: 10.5px; color: #059669; background: #E7F9F1; border-radius: 3px; padding: 1px 6px; }
.veh-year-warn { font-size: 10.5px; color: #B45309; background: #FEF3C7; border-radius: 3px; padding: 1px 6px; }
.veh-year-note { font-size: 10.5px; color: #33518C; background: #EEF4FF; border-radius: 3px; padding: 1px 6px; }
.year-tip {
  margin: 0 12px 8px; padding: 8px 10px; background: #EEF4FF;
  border-left: 3px solid #4A7CF7; border-radius: 5px;
  font-size: 11.5px; color: #33518C; line-height: 1.5;
}

/* 结果卡（兜底） */
.result-card { margin-top: 10px; cursor: pointer; }
.result-top { display: flex; align-items: center; margin-bottom: 10px; gap: 10px; }
.result-cat { font-size: 13px; color: #888; }
.result-specs {
  display: flex; flex-wrap: wrap; background: #F0F7FB; border-radius: 8px; padding: 8px 10px;
}
.spec { width: 50%; padding: 4px 0; font-size: 12px; }
.spec-label { color: #888; margin-right: 6px; }
.spec-value { color: #333; }
.result-brands { margin-top: 10px; }
.result-more {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--blue); text-align: right;
}

/* 空状态 */
.empty-state { padding: 50px 20px; text-align: center; color: var(--ink-3); }
.empty-icon { font-size: 50px; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.empty-btns { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.empty-btn { max-width: 200px; margin: 0 auto; width: 100%; }

/* ===== 商品详情页 ===== */
.goods-hero { background: #fff; padding: 20px 12px; text-align: center; }
.goods-img { width: 180px; height: 180px; object-fit: contain; margin: 0 auto 12px; }
.goods-model { font-size: 22px; font-weight: 800; color: var(--ink); }
.goods-name { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.param-table { width: 100%; }
.param-row { display: flex; padding: 9px 0; border-bottom: 1px solid var(--line); }
.param-row:last-child { border-bottom: none; }
.param-label { width: 110px; color: var(--ink-3); font-size: 13px; flex-shrink: 0; }
.param-value { flex: 1; color: var(--ink); font-size: 13px; word-break: break-all; }
.goods-bar {
  position: fixed; left: 0; right: 0; bottom: 0; background: #fff;
  padding: 10px 12px; box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
  max-width: 480px; margin: 0 auto; display: flex; gap: 10px; align-items: center; z-index: 30;
}

/* ===== 商品价格 ===== */
.hot-price { color: #E4393C; font-weight: 700; font-size: 15px; margin-top: 4px; }
.goods-price {
  margin-top: 8px; color: #E4393C; font-weight: 700;
  display: flex; align-items: baseline; justify-content: center; gap: 2px;
}
.goods-price .price-sym { font-size: 15px; }
.goods-price { font-size: 26px; }
.goods-price .price-unit { font-size: 12px; font-weight: 400; color: var(--ink-3); margin-left: 3px; }
.goods-price.ask { font-size: 15px; font-weight: 500; color: var(--ink-3); }
.price-ask { color: var(--ink-3); }

/* ===== 下单页 ===== */
.summary-row { display: flex; align-items: center; gap: 10px; padding: 4px 0 12px; }
.summary-info { flex: 1; min-width: 0; }
.summary-name { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.summary-price { color: #E4393C; font-weight: 700; font-size: 17px; flex-shrink: 0; }
.qty-row {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--line); padding-top: 12px;
}
.qty-label { color: var(--ink-3); font-size: 13px; }
.qty-ctrl { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.qty-btn {
  width: 32px; height: 30px; line-height: 30px; text-align: center;
  font-size: 17px; color: var(--blue); background: #F5F9FF; cursor: pointer; user-select: none;
}
.qty-btn:active { background: #E4EFFD; }
.qty-num { width: 46px; height: 30px; line-height: 30px; text-align: center; font-size: 14px; color: var(--ink); }
.form-row { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.form-row:last-child { border-bottom: none; }
.form-label { width: 76px; color: var(--ink-3); font-size: 13px; flex-shrink: 0; }
.form-input {
  flex: 1; border: none; outline: none; font-size: 14px; color: var(--ink);
  background: transparent; font-family: inherit;
}
.form-input::placeholder { color: #B9C4D4; }
.order-bar {
  position: fixed; left: 0; right: 0; bottom: 0; background: #fff;
  padding: 10px 12px; box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
  max-width: 480px; margin: 0 auto; display: flex; gap: 10px; align-items: center; z-index: 30;
}
.order-total { flex-shrink: 0; color: var(--ink-3); font-size: 13px; }
.order-total b { color: #E4393C; font-size: 17px; }
.order-bar .btn-primary { flex: 1; }
.success-card { text-align: center; padding: 26px 16px; }
.success-icon { font-size: 44px; margin-bottom: 10px; }
.success-title { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }

/* ===== 加载态 ===== */
.loading { text-align: center; padding: 40px 0; color: var(--ink-4); font-size: 13px; }
.spinner {
  width: 24px; height: 24px; margin: 0 auto 10px; border-radius: 50%;
  border: 3px solid #E2ECFA; border-top-color: var(--blue);
  animation: sp .8s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }

/* 工具：隐藏 */
.hide { display: none !important; }

/* 桌面端轻微放大，保证可读性 */
@media (min-width: 600px) {
  html, body { font-size: 15px; }
  #app { box-shadow: 0 0 30px rgba(0,0,0,0.06); }
}
