/* ==========================================================
   车配家 PC 端样式 - 红色主色版（参考 etc-parts.com）
   ========================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px; color: #333;
  background: #f7f8fa;
  line-height: 1.5;
}
a { color: #d9363c; text-decoration: none; }
a:hover { color: #b62026; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; }
ul, li { list-style: none; }
input:focus, select:focus, textarea:focus { outline: none; }

/* ===================== 颜色变量（统一引用点，方便后续调）===================== */
:root {
  --primary: #d9363c;        /* 主红：按钮、分类栏 */
  --primary-hover: #b62026;
  --primary-soft: #fff1f1;
  --accent: #2c8eff;         /* 链接蓝、辅助按钮 */
  --accent-hover: #1a7ae0;
  --text-1: #222;            /* 标题深灰 */
  --text-2: #666;            /* 正文 */
  --text-3: #999;            /* 辅助文字 */
  --border: #eee;
  --border-2: #e5e5e5;
  --bg: #f7f8fa;
  --bg-w: #fff;
  --warn: #f69300;
  --ok: #38a169;
  --danger: #f56565;
}

/* ===================== L1：顶部灰色细条 ===================== */
.topbar {
  background: #f7f8fa;
  border-bottom: 1px solid #ececec;
  height: 36px;
  line-height: 36px;
  font-size: 12px;
  color: #666;
}
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; justify-content: space-between; align-items: center; }
.topbar .welcome { color: #999; }
.topbar .top-right { display: flex; align-items: center; gap: 16px; }
.topbar .top-right a { color: #666; }
.topbar .top-right a:hover { color: var(--primary); }
.topbar .divider { width: 1px; height: 12px; background: #d5d5d5; display: inline-block; vertical-align: middle; }
.topbar .phone-hot { color: var(--primary); font-weight: bold; }

/* ===================== L2：主头（logo + 搜索 + 功能）===================== */
.m-header { background: #fff; border-bottom: 1px solid #ececec; }
.m-header-inner { max-width: 1200px; margin: 0 auto; padding: 20px 24px; display: flex; align-items: center; gap: 32px; }
.m-header .m-logo {
  display: block; flex-shrink: 0;
  width: 220px;
}
.m-header .m-logo img { display: block; width: 100%; height: auto; }

.m-header .m-search { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.m-search-tabs { display: flex; gap: 12px; font-size: 13px; }
.m-search-tabs span { color: #666; padding: 2px 4px; cursor: pointer; }
.m-search-tabs span.active { color: var(--primary); font-weight: 500; border-bottom: 2px solid var(--primary); }

.m-search-box { display: flex; height: 42px; border: 2px solid var(--primary); border-radius: 2px; overflow: hidden; }
.m-search-box input {
  flex: 1; padding: 0 12px; border: none; font-size: 14px; background: #fff;
}
.m-search-box .cat-sel {
  display: none; /* 留钩子，以后加 VIN / OE 切换时启用 */
  width: 96px; padding: 0 8px; border: none; border-left: 1px solid var(--border-2); background: #fafbfc; color: #666; font-size: 13px;
}
.m-search-box button {
  width: 96px; background: var(--primary); color: #fff; font-size: 16px; font-weight: 500;
  transition: background .2s;
}
.m-search-box button:hover { background: var(--primary-hover); }

.m-search-hot { font-size: 12px; color: #999; }
.m-search-hot a { color: #666; margin: 0 6px; }
.m-search-hot a:hover { color: var(--primary); }

.m-header .m-right { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.m-right .icon-btn { display: flex; align-items: center; gap: 6px; color: #666; font-size: 13px; cursor: pointer; }
.m-right .icon-btn:hover { color: var(--primary); }
.m-right .icon-btn .big { font-size: 22px; }

.cart-entry {
  position: relative; display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--border-2); border-radius: 4px; background: #fff;
  color: #333; cursor: pointer; font-size: 13px;
}
.cart-entry:hover { color: var(--primary); border-color: var(--primary); }
.cart-entry .badge {
  position: absolute; top: -8px; right: -8px;
  min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px;
  background: var(--primary); color: #fff; border-radius: 9px; text-align: center; font-size: 11px; font-weight: bold;
}

/* ===================== L3：分类 + 轮播 两列（首页专属）===================== */
.home-hero { max-width: 1200px; margin: 16px auto 0; padding: 0 24px; display: grid; grid-template-columns: 240px 1fr; gap: 16px; }
/* 左：红色分类栏（三级分类，参考 etc-parts.com） */
.cat-menu {
  background: var(--primary); border-radius: 4px;
  display: flex; flex-direction: column;
  position: relative; z-index: 60;
}
.cat-menu .cat-head {
  padding: 12px 16px; color: #fff; font-size: 15px; font-weight: bold;
  display: flex; align-items: center; gap: 8px; border-bottom: 1px solid rgba(255,255,255,.15);
  border-radius: 4px 4px 0 0;
}
.cat-menu .cat-list { flex: 1; position: relative; }
.cat-menu .cat-list .cat-item:last-child { border-radius: 0 0 4px 4px; }
/* 一级分类项：图标 + （一级名/箭头 + 二级名平铺） */
.cat-menu .cat-item {
  padding: 8px 14px; color: #fff;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  cursor: pointer; transition: background .15s, color .15s;
}
.cat-menu .cat-item:hover, .cat-menu .cat-item.open { background: #fff; color: var(--primary); }
.cat-menu .cat-item:hover .cat-subs, .cat-menu .cat-item.open .cat-subs { color: #999; }
.cat-menu .cat-item:hover .arrow, .cat-menu .cat-item.open .arrow { color: var(--primary); opacity: 1; }
.cat-menu .cat-item .ico { width: 22px; text-align: center; font-size: 18px; flex-shrink: 0; }
.cat-menu .cat-item .cat-right { flex: 1; min-width: 0; }
.cat-menu .cat-item .cat-main { display: flex; align-items: center; justify-content: space-between; }
.cat-menu .cat-item .nm { font-size: 14px; font-weight: bold; line-height: 1.4; }
.cat-menu .cat-item .arrow { font-size: 14px; opacity: .7; transition: all .15s; }
.cat-menu .cat-item .cat-subs {
  color: rgba(255,255,255,.75); font-size: 12px; line-height: 1.5; margin-top: 2px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
/* hover 弹出的二三级面板 */
.cat-detail {
  display: none; position: absolute; left: 100%; top: 0;
  width: 660px; min-height: 100%; box-sizing: border-box;
  background: #fff; color: #333;
  box-shadow: 4px 4px 18px rgba(0,0,0,.18); border-radius: 0 4px 4px 0;
  padding: 18px 24px; z-index: 100; cursor: default;
  max-height: 440px; overflow-y: auto;
}
/* 透明桥：防止鼠标从左栏移向弹层时经过空隙导致 hover 断开 */
.cat-detail::before { content: ''; position: absolute; left: -20px; top: 0; width: 20px; height: 100%; }
.cat-item:hover .cat-detail, .cat-item.open .cat-detail { display: block; }
.cat-detail .cd-group { padding: 8px 0; }
.cat-detail .cd-group + .cd-group { border-top: 1px dashed #eee; }
.cat-detail .cd-second {
  font-size: 13px; font-weight: 700; color: #333; cursor: pointer; display: inline-block;
}
.cat-detail .cd-second:hover { color: var(--primary); }
.cat-detail .cd-third { font-size: 12px; color: #666; line-height: 1.9; margin-top: 2px; }
.cat-detail .cd-third a { color: #666; text-decoration: none; transition: color .1s; }
.cat-detail .cd-third a:hover { color: var(--primary); }
.cat-detail .cd-third .line { color: #ddd; margin: 0 8px; }
.cat-detail .cd-empty { color: #999; font-size: 13px; padding: 20px 0; text-align: center; }

/* 右：轮播（高和分类栏对齐 = 分类项数目 * 每项 44 + header） */
.hero-main { display: flex; flex-direction: column; gap: 12px; }
.hero-carousel { height: 420px; }
.carousel { position: relative; height: 100%; border-radius: 4px; overflow: hidden; background: #f0f0f0; }
.carousel .slide { display: none; width: 100%; height: 100%; }
.carousel .slide.active { display: block; }
.carousel .slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel .arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; line-height: 38px; text-align: center; background: rgba(0,0,0,.3); color: #fff; border-radius: 50%; cursor: pointer; user-select: none; font-size: 24px; z-index: 2; transition: background .2s; }
.carousel .arrow:hover { background: var(--primary); }
.carousel .arrow.prev { left: 12px; }
.carousel .arrow.next { right: 12px; }
.carousel .dots { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; z-index: 2; }
.carousel .dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; transition: all .2s; }
.carousel .dots span.active { background: var(--primary); width: 24px; border-radius: 5px; }

.carousel-empty { background: linear-gradient(135deg, #e9eaef, #dfe4ea); cursor: default; color: #888; }
.carousel-empty .inner { height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; }
.carousel-empty .big { font-size: 64px; opacity: .4; }
.carousel-empty .t1 { font-size: 18px; color: #555; font-weight: 500; }
.carousel-empty .t2 { font-size: 13px; color: #999; }

/* 英雄区入口条（会员专区/优惠券/限时特卖） */
.hero-entries { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hero-entries .entry {
  background: #fff; border-radius: 4px; padding: 16px 20px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); cursor: pointer; transition: box-shadow .2s, transform .2s;
}
.hero-entries .entry:hover { box-shadow: 0 6px 18px rgba(217,54,60,.15); transform: translateY(-2px); }
.hero-entries .entry .ico { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; flex-shrink: 0; }
.hero-entries .entry .ico.c1 { background: linear-gradient(135deg, #ff9a5a, #ff7043); }
.hero-entries .entry .ico.c2 { background: linear-gradient(135deg, #ff6b6b, var(--primary)); }
.hero-entries .entry .ico.c3 { background: linear-gradient(135deg, #667eea, #764ba2); }
.hero-entries .entry .ttl { font-size: 15px; color: #222; font-weight: 500; margin-bottom: 2px; }
.hero-entries .entry .desc { font-size: 12px; color: #999; }

/* ===================== 右侧悬浮工具栏 ===================== */
.right-tools {
  position: fixed; right: 8px; bottom: 60px; z-index: 90;
  display: flex; flex-direction: column; gap: 1px;
  background: #fff; border: 1px solid var(--border-2); border-radius: 4px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.right-tools .tool-item {
  width: 52px; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; cursor: pointer; color: #666; font-size: 12px; border-bottom: 1px solid var(--border-2); position: relative;
  transition: all .2s;
}
.right-tools .tool-item:last-child { border-bottom: none; }
.right-tools .tool-item:hover { background: var(--primary-soft); color: var(--primary); }
.right-tools .tool-item .big { font-size: 18px; }
.right-tools .tool-item .badge {
  position: absolute; top: 6px; right: 6px;
  min-width: 14px; height: 14px; line-height: 14px; padding: 0 3px;
  background: var(--primary); color: #fff; border-radius: 8px; text-align: center; font-size: 10px;
}

/* ===================== 主体容器（复用旧 .container，保证老页面兼容）===================== */
.container { max-width: 1200px; margin: 0 auto; padding: 20px 24px; }
.wrap-box { background: #fff; border-radius: 4px; padding: 20px 24px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 28px 0 16px;
}
.section-title h2 { font-size: 18px; color: #222; padding-left: 10px; border-left: 3px solid var(--primary); }
.section-title .more { color: #999; font-size: 13px; }
.section-title .more:hover { color: var(--primary); }

/* 旧分类导航（index.html 不再使用，但其他页面兼容） */
.cat-nav { background: #fff; border-radius: 4px; padding: 16px 24px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.cat-nav h3 { font-size: 16px; margin-bottom: 12px; }
.cat-nav .cats { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.cat-nav .cats a { padding: 4px 12px; border-radius: 16px; background: #f0f4fa; color: #555; font-size: 13px; }
.cat-nav .cats a:hover { background: var(--primary); color: #fff; }

/* 五大卖点条（登录页 & 首页共用） */
.feature-bar { display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-radius: 4px; padding: 16px 0; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.feature-bar .fi { display: flex; align-items: center; justify-content: center; gap: 12px; border-right: 1px solid #f0f0f0; padding: 4px 8px; }
.feature-bar .fi:last-child { border-right: none; }
.feature-bar .fi .ico { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--primary); flex-shrink: 0; }
.feature-bar .fi .nm { font-weight: 500; color: #222; }
.feature-bar .fi .ds { font-size: 12px; color: #999; }

/* 分类横幅（发动机/变速箱等大分类广告） */
.cat-banner { margin: 28px 0; position: relative; border-radius: 8px; overflow: hidden; height: 220px; background: linear-gradient(135deg, #2c3e50, #4ca1af); display: flex; align-items: center; justify-content: space-between; padding: 0 48px; color: #fff; }
.cat-banner .text h2 { font-size: 32px; margin-bottom: 8px; letter-spacing: 2px; }
.cat-banner .text p { opacity: .9; margin-bottom: 16px; }
.cat-banner .text a { display: inline-block; padding: 10px 24px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.45); color: #fff; border-radius: 4px; font-size: 14px; transition: all .2s; }
.cat-banner .text a:hover { background: var(--primary); border-color: var(--primary); }
.cat-banner .art { font-size: 160px; opacity: .18; }
.cat-banner.c2 { background: linear-gradient(135deg, #614385, #516395); }

/* ===================== 商品网格 & 卡片（6列布局，参考 etc-parts.com）===================== */
.product-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.product-card {
  background: #fff; border-radius: 2px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  transition: box-shadow .2s, transform .2s, border-color .2s;
  cursor: pointer; border: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: 0 6px 18px rgba(217,54,60,.15); transform: translateY(-2px); border-color: var(--primary); }
.product-card .wrap { position: relative; padding: 8px; background: #fff; }
.product-card .img { aspect-ratio: 1; overflow: hidden; background: #fafafa; border-radius: 2px; }
.product-card .img img { width: 100%; height: 100%; object-fit: contain; transition: transform .3s; }
.product-card:hover .img img { transform: scale(1.05); }
.product-card .info {
  padding: 8px 12px 12px;
  display: flex; flex-direction: column; gap: 3px;
  flex: 1; min-height: 0;
}
.product-card .name {
  font-size: 13px; color: #222; line-height: 1.45;
  max-height: 38px; overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  font-weight: 500;
}
.product-card:hover .name { color: var(--primary); }
.product-card .attrs {
  display: flex; flex-direction: column; gap: 1px;
  font-size: 12px; color: #666; line-height: 1.6;
  margin-top: 4px;
}
.product-card .attrs .row {
  display: flex; gap: 4px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.product-card .attrs .row .lb {
  color: #999; flex-shrink: 0;
}
.product-card .attrs .row .vl {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #555;
}
.product-card .attrs .remark-row .vl {
  color: #888;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1;
  white-space: normal;
}
.product-card .price-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed #f0f0f0;
}
.product-card .price { color: var(--primary); font-size: 17px; font-weight: bold; }
.product-card .cart-btn {
  flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
  transition: background .2s, transform .15s;
}
.product-card .cart-btn:hover { background: var(--primary-hover); transform: scale(1.1); }
.product-card .badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--primary); color: #fff;
  padding: 2px 8px; border-radius: 2px; font-size: 11px; font-weight: 500;
}
.product-card .promo-tag {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: var(--warn); color: #fff;
  padding: 2px 6px; border-radius: 2px; font-size: 10px;
  display: flex; align-items: center; gap: 3px;
}

/* ===================== 公告栏 ===================== */
.notice-bar {
  display: flex; align-items: center; background: #fff; border-radius: 4px;
  padding: 0 20px; height: 44px; margin: 16px 0 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); overflow: hidden;
}
.notice-bar .notice-label { color: var(--primary); font-weight: 500; margin-right: 10px; white-space: nowrap; }
.notice-bar .notice-list { flex: 1; position: relative; height: 44px; overflow: hidden; }
.notice-bar .notice-item { position: absolute; left: 0; top: 0; height: 44px; line-height: 44px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; opacity: 0; transition: opacity .4s; }
.notice-bar .notice-item.show { opacity: 1; }

/* ===================== 品牌墙 ===================== */
.brand-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; }
.brand-card {
  background: #fff; border-radius: 4px; text-align: center; padding: 14px 8px;
  font-size: 13px; color: #555; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); transition: all .2s;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  border: 1px solid transparent;
}
.brand-card:hover {
  color: var(--primary); border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(217,54,60,.12); transform: translateY(-2px);
}
.brand-card::before {
  content: attr(data-letter); display: block;
  width: 40px; height: 40px; line-height: 40px; margin: 0 auto 8px;
  background: linear-gradient(135deg, var(--primary), #ff7043); color: #fff; font-weight: bold; border-radius: 50%;
  font-size: 18px;
}
.brand-card.has-logo::before { display: none; }
.brand-card .brand-logo-img { display: block; width: 40px; height: 40px; object-fit: contain; margin: 0 auto 8px; border-radius: 50%; border: 1px solid #eee; background: #fff; }

/* ===================== 旧 header 兼容（老页面 login/register/detail/cart 等还用）===================== */
.header { background: #fff; border-bottom: 1px solid var(--border-2); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 32px; }
.header .logo {
  font-size: 24px; font-weight: 800; color: var(--primary); letter-spacing: 2px;
}
.header .search { flex: 1; display: flex; max-width: 600px; }
.header .search input { flex: 1; height: 38px; padding: 0 12px; border: 1px solid var(--border-2); border-right: none; border-radius: 4px 0 0 4px; font-size: 14px; }
.header .search input:focus { outline: none; border-color: var(--primary); }
.header .search button { width: 80px; background: var(--primary); color: #fff; border-radius: 0 4px 4px 0; font-size: 14px; transition: background .2s; }
.header .search button:hover { background: var(--primary-hover); }
.header .nav { display: flex; gap: 16px; align-items: center; font-size: 13px; }
.header .nav a { color: #666; }
.header .nav a:hover { color: var(--primary); }
.header .cart-link { position: relative; }
.header .cart-badge {
  position: absolute; top: -8px; right: -12px; min-width: 18px; height: 18px; line-height: 18px;
  background: var(--primary); color: #fff; border-radius: 9px; text-align: center; font-size: 11px; padding: 0 4px;
}

/* ===================== Footer（红色系深色底）===================== */
.footer { background: #2a2a2a; color: #aaa; padding: 32px 0 16px; margin-top: 40px; font-size: 13px; }
/* 页脚自适应列数：栏目增减自动均分一行，不固定列数 */
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; flex-wrap: wrap; gap: 24px 32px; }
.footer-inner > div { flex: 1 1 140px; min-width: 0; }
.footer-inner > div:first-child { flex: 1.8 1 220px; }
.footer h4 { color: #fff; font-size: 15px; margin-bottom: 12px; padding-left: 8px; border-left: 3px solid var(--primary); }
.footer ul li { line-height: 2; }
.footer ul li a { color: #aaa; transition: color .2s; }
.footer ul li a:hover { color: var(--primary); }
.footer .tel { color: var(--primary); font-size: 22px; font-weight: bold; margin: 6px 0; }
.footer .working { color: #999; font-size: 12px; }
.footer-copy {
  text-align: center; padding: 16px 24px 0; border-top: 1px solid #3a3a3a;
  margin-top: 24px; font-size: 12px; color: #888; line-height: 1.8;
}

/* ===================== 分页（按钮主色改为红）===================== */
.pager { display: flex; gap: 6px; justify-content: center; margin: 32px 0; }
.pager button { min-width: 36px; height: 36px; border: 1px solid var(--border-2); background: #fff; border-radius: 4px; color: #666; }
.pager button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager button:disabled { color: #ccc; }
.pager button:hover:not(:disabled):not(.active) { color: var(--primary); border-color: var(--primary); }

/* ===================== 详情页 ===================== */
.detail-wrap { display: flex; gap: 32px; background: #fff; padding: 32px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.detail-wrap .gallery { width: 460px; flex-shrink: 0; }
.detail-wrap .gallery .main { aspect-ratio: 1; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.detail-wrap .gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.detail-wrap .gallery .thumbs { display: flex; gap: 8px; margin-top: 12px; }
.detail-wrap .gallery .thumbs div { width: 70px; height: 70px; border: 2px solid var(--border); border-radius: 4px; cursor: pointer; overflow: hidden; }
.detail-wrap .gallery .thumbs div.active { border-color: var(--primary); }
/* 放大镜 */
.detail-wrap .gallery { position: relative; }
.detail-wrap .gallery .main { position: relative; cursor: crosshair; }
.detail-wrap .zoom-lens { position: absolute; display: none; background: rgba(255,255,255,.4); border: 1px solid var(--primary); box-sizing: border-box; pointer-events: none; z-index: 6; }
.detail-wrap .zoom-panel { position: absolute; top: 0; left: calc(100% + 16px); width: 660px; height: 560px; background-color: #fff; background-repeat: no-repeat; border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 2px 16px rgba(0,0,0,.15); display: none; pointer-events: none; z-index: 60; }
.detail-wrap .info { flex: 1; }
.detail-wrap .info h1 { font-size: 22px; margin-bottom: 16px; line-height: 1.4; color: var(--text-1); }
.detail-wrap .info .price {
  font-size: 28px; color: var(--primary); font-weight: bold; margin-bottom: 16px;
  background: var(--primary-soft); padding: 16px 20px; border-radius: 4px;
}
.detail-wrap .info .meta-row { display: flex; padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; color: var(--text-2); }
.detail-wrap .info .meta-row .label { width: 80px; color: var(--text-3); }
.detail-wrap .info .qty-row { display: flex; align-items: center; gap: 12px; margin: 24px 0; }
.detail-wrap .info .qty-ctrl { display: flex; align-items: center; }
.detail-wrap .info .qty-ctrl button { width: 36px; height: 36px; border: 1px solid var(--border-2); background: #fff; font-size: 16px; }
.detail-wrap .info .qty-ctrl input { width: 60px; height: 36px; border: 1px solid var(--border-2); text-align: center; font-size: 14px; border-left: none; border-right: none; }
.detail-wrap .info .actions { display: flex; gap: 12px; margin-top: 24px; }
.detail-wrap .info .btn-cart { padding: 12px 32px; background: #ff8800; color: #fff; border: none; border-radius: 4px; font-size: 15px; transition: background .2s; }
.detail-wrap .info .btn-cart:hover { background: #ee7800; }
.detail-wrap .info .btn-buy { padding: 12px 32px; background: var(--primary); color: #fff; border: none; border-radius: 4px; font-size: 15px; transition: background .2s; }
.detail-wrap .info .btn-buy:hover { background: var(--primary-hover); }
.detail-wrap .info .btn-fav { padding: 12px 20px; background: #fff; border: 1px solid var(--border-2); border-radius: 4px; color: var(--text-2); transition: all .2s; }
.detail-wrap .info .btn-fav:hover { color: var(--primary); border-color: var(--primary); }

.spec-table { background: #fff; padding: 24px; margin-top: 24px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.spec-table table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { padding: 10px 12px; border: 1px solid #f0f0f0; text-align: left; font-size: 13px; }
.spec-table th { background: #fafbfc; }

/* ===================== 表单（主色改为红）===================== */
.form-card { max-width: 400px; margin: 40px auto; background: #fff; padding: 36px; border-radius: 8px; box-shadow: 0 2px 16px rgba(0,0,0,.08); }
.form-card h1 { text-align: center; margin-bottom: 24px; color: var(--text-1); font-size: 22px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; color: var(--text-2); font-size: 13px; }
.form-row input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-2);
  border-radius: 4px; font-size: 14px; transition: border-color .2s;
}
.form-row input:focus { border-color: var(--primary); outline: none; }
.form-row .code-row { display: flex; gap: 8px; }
.form-row .code-row input { flex: 1; }
.form-row .code-row button {
  width: 120px; background: var(--primary); color: #fff; border-radius: 4px; font-size: 13px; transition: background .2s;
}
.form-row .code-row button:hover:not(:disabled) { background: var(--primary-hover); }
.form-row .code-row button:disabled { background: #aaa; }
.form-submit {
  width: 100%; height: 42px; background: var(--primary); color: #fff;
  border-radius: 4px; font-size: 15px; margin-top: 8px; font-weight: 500;
  transition: background .2s;
}
.form-submit:hover:not(:disabled) { background: var(--primary-hover); }
.form-submit:disabled { background: #aaa; cursor: not-allowed; }
.form-card .extra { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-3); }
.form-card .extra a { color: var(--primary); }

/* ===================== Toast（主色改红）===================== */
.cpj-toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-20px);
  padding: 10px 20px; border-radius: 4px; color: #fff; font-size: 14px;
  opacity: 0; transition: all .3s; z-index: 3000;
}
.cpj-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.cpj-toast-info { background: var(--accent); }
.cpj-toast-success { background: var(--ok); }
.cpj-toast-error { background: var(--primary); }

/* ===================== 通用按钮 ===================== */
.btn { display: inline-block; padding: 8px 18px; border: 1px solid var(--border-2); background: #fff; border-radius: 4px; font-size: 14px; color: var(--text-2); transition: all .2s; }
.btn:hover { color: var(--primary); border-color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; border-color: var(--primary-hover); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===================== 表格 ===================== */
.table { width: 100%; background: #fff; border-radius: 4px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05); border-collapse: collapse; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.table th { background: #fafbfc; color: var(--text-2); font-weight: 500; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag-success { background: #e6ffed; color: var(--ok); }
.tag-warn { background: #fff8e1; color: var(--warn); }
.tag-danger { background: #ffeef0; color: var(--primary); }
.tag-info { background: #e6f4ff; color: var(--accent); }
.tag-gray { background: #f0f0f0; color: var(--text-3); }

/* ===================== 空态 ===================== */
.empty { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty .ico { font-size: 48px; opacity: .3; margin-bottom: 8px; }

/* ===================== 支付页 ===================== */
.pay-wrap { max-width: 600px; margin: 40px auto; background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.05); text-align: center; }
.pay-wrap .amt { font-size: 36px; color: var(--primary); margin: 16px 0; }
.pay-wrap .methods { display: flex; gap: 16px; justify-content: center; margin: 24px 0; }
.pay-wrap .method { padding: 20px 32px; border: 2px solid var(--border-2); border-radius: 8px; cursor: pointer; font-size: 16px; transition: all .2s; }
.pay-wrap .method.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.pay-wrap .qrcode { width: 240px; height: 240px; margin: 24px auto; }

/* ===================== Tab 切换（主色改红）===================== */
.cpj-tabs { display: flex; background: #fff; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.05); margin-bottom: 20px; overflow: hidden; }
.cpj-tabs .tab-item { flex: 1; text-align: center; padding: 14px 0; cursor: pointer; color: var(--text-2); font-size: 14px; border-bottom: 2px solid transparent; transition: all .2s; }
.cpj-tabs .tab-item:hover { color: var(--primary); }
.cpj-tabs .tab-item.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--primary-soft); }

/* ===================== Modal ===================== */
.cpj-modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1500; display: flex; align-items: center; justify-content: center; }
.cpj-modal { background: #fff; border-radius: 8px; width: 480px; max-width: 92vw; max-height: 84vh; overflow-y: auto; padding: 24px; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.cpj-modal h3 { margin-bottom: 16px; color: var(--text-1); font-size: 16px; }
.cpj-modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* ===================== 表单补充 ===================== */
.form-row select { width: 100%; height: 40px; padding: 0 8px; border: 1px solid var(--border-2); border-radius: 4px; font-size: 14px; background: #fff; }
.form-row select:focus { border-color: var(--primary); outline: none; }
.form-row textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--border-2); border-radius: 4px; font-size: 14px; font-family: inherit; resize: vertical; }
.form-row textarea:focus { border-color: var(--primary); outline: none; }
.form-check { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; line-height: 1.6; }
.form-check input[type="checkbox"] { width: auto; height: auto; margin-top: 2px; accent-color: var(--primary); }
.form-check a { margin: 0 2px; }

/* 图形验证码 */
.captcha-row { display: flex; gap: 8px; align-items: center; }
.captcha-row input { flex: 1; }
.captcha-row .captcha-svg {
  width: 120px; height: 40px; border: 1px solid var(--border-2); border-radius: 4px; cursor: pointer;
  background: #fafbfc; flex-shrink: 0; overflow: hidden;
}
.captcha-row .captcha-svg svg { width: 100%; height: 100%; display: block; }

/* ===================== 收货地址卡片 ===================== */
.addr-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.addr-card { background: #fff; border-radius: 4px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.05); position: relative; border: 1px solid transparent; transition: all .2s; }
.addr-card.default { border-color: var(--primary); }
.addr-card:hover { border-color: var(--primary); }
.addr-card .addr-tag { position: absolute; top: 12px; right: 12px; }
.addr-card .addr-line { color: var(--text-1); line-height: 1.9; word-break: break-all; }
.addr-card .addr-region { color: var(--text-3); font-size: 12px; }
.addr-card .addr-ops { margin-top: 12px; display: flex; gap: 8px; }

/* ===================== 优惠券卡片 ===================== */
.coupon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.coupon-card {
  display: flex; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.05);
  overflow: hidden; border: 1px dashed transparent; transition: all .2s;
}
.coupon-card:hover { border-color: var(--primary); }
.coupon-card .amount-box {
  width: 120px; flex-shrink: 0; background: linear-gradient(135deg, var(--primary), #ff7043);
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 8px;
}
.coupon-card .amount-box .amt { font-size: 22px; font-weight: bold; }
.coupon-card .amount-box .thr { font-size: 12px; opacity: .92; margin-top: 4px; }
.coupon-card .coupon-info { flex: 1; padding: 14px 18px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.coupon-card .coupon-info .cname { font-weight: 500; color: var(--text-1); font-size: 14px; }
.coupon-card .coupon-info .cend { color: var(--text-3); font-size: 12px; }
.coupon-card .coupon-info .cp-btn { align-self: flex-start; }
.coupon-card.disabled { opacity: .55; }

/* ===================== 评价 ===================== */
.review-item { background: #fff; border-radius: 4px; padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.review-item .rv-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.review-item .rv-user { color: var(--text-1); font-weight: 500; }
.review-item .rv-time { color: var(--text-3); font-size: 12px; margin-left: auto; }
.review-item .rv-content { color: var(--text-2); line-height: 1.7; word-break: break-all; }
.review-item .rv-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.review-item .rv-imgs img { width: 88px; height: 88px; object-fit: cover; border-radius: 4px; border: 1px solid #eee; cursor: zoom-in; transition: transform .15s; background: #fafafa; }
.review-item .rv-imgs img:hover { transform: scale(1.03); border-color: var(--primary); }
.review-item .rv-reply { margin-top: 10px; background: var(--primary-soft); border-radius: 4px; padding: 10px 12px; color: var(--primary); font-size: 13px; line-height: 1.6; }
.review-item .rv-reply::before { content: '商家回复：'; font-weight: bold; }
.stars { color: var(--warn); letter-spacing: 2px; font-size: 13px; }
.stars .off { color: var(--border-2); }
/* 晒图大图查看器 */
.rv-big-mask { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; z-index: 9999; cursor: pointer; }
.rv-big-mask img { max-width: 92vw; max-height: 88vh; border-radius: 4px; box-shadow: 0 10px 60px rgba(0,0,0,.6); user-select: none; -webkit-user-drag: none; }
.rv-big-hint { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); color: #ddd; font-size: 13px; background: rgba(255,255,255,.08); padding: 7px 16px; border-radius: 20px; backdrop-filter: blur(4px); white-space: nowrap; }

/* =========================================================
   登录页专属：左右分栏（参考 etc-parts.com）
   ========================================================== */
.auth-body {
  background: #fff;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.auth-main { flex: 1; display: flex; }
.auth-left {
  width: 58%; flex-shrink: 0;
  background: linear-gradient(135deg, #b62026 0%, #d9363c 60%, #ff4d51 100%);
  color: #fff;
  padding: 60px 80px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-left::before {
  content: ''; position: absolute; right: -120px; top: -80px;
  width: 560px; height: 560px; border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.auth-left::after {
  content: ''; position: absolute; left: -160px; bottom: -200px;
  width: 500px; height: 500px; border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.auth-left .logo-area { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 4px; }
.auth-left .logo-area .big-logo { font-size: 36px; font-weight: 800; letter-spacing: 4px; }
.auth-left .logo-area .domain { font-size: 14px; opacity: .8; letter-spacing: 2px; }
.auth-left .hero { position: relative; z-index: 2; }
.auth-left .hero h1 { font-size: 56px; line-height: 1.15; font-weight: 900; letter-spacing: 4px; margin-bottom: 12px; }
.auth-left .hero h1 .sub { display: block; font-size: 28px; font-weight: 400; letter-spacing: 6px; opacity: .92; margin-top: 8px; }
.auth-left .hero p { font-size: 16px; opacity: .9; margin-top: 24px; line-height: 1.8; }
.auth-left .deco-art { font-size: 340px; opacity: .08; position: absolute; right: 40px; bottom: 20px; z-index: 1; }

.auth-left .auth-features {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
}
.auth-left .auth-features .fi {
  background: rgba(255,255,255,.1); padding: 12px 10px; border-radius: 6px; text-align: center;
  backdrop-filter: blur(10px);
}
.auth-left .auth-features .fi .ico { font-size: 24px; margin-bottom: 4px; }
.auth-left .auth-features .fi .t { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.auth-left .auth-features .fi .d { font-size: 11px; opacity: .85; }

/* 右侧登录卡片区 */
.auth-right {
  flex: 1; background: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.auth-right .form-card {
  max-width: 420px; width: 100%;
  box-shadow: none; margin: 0; padding: 0;
}
.auth-right .auth-title {
  margin-bottom: 28px;
}
.auth-right .auth-title h1 { font-size: 22px; color: var(--text-1); text-align: left; }
.auth-right .auth-title p { font-size: 13px; color: var(--text-3); margin-top: 6px; }

.auth-right .mode-switch {
  display: flex; gap: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--border);
}
.auth-right .mode-switch span {
  padding: 10px 0; font-size: 15px; color: var(--text-3); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.auth-right .mode-switch span.active {
  color: var(--primary); border-bottom-color: var(--primary); font-weight: 500;
}

.auth-footer {
  text-align: center; padding: 16px; color: var(--text-3); font-size: 12px;
  background: #fff; border-top: 1px solid var(--border-2);
}

/* ===================== 响应式兜底（不完美，但不破坏结构）===================== */
/* 中等屏（1081~1360）改为 5 列，防止 6 列信息挤得太密 */
@media (min-width: 1081px) and (max-width: 1360px) {
  .product-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 1080px) {
  /* 窄屏分类变单列堆叠，弹层空间不足：隐藏弹层，tap 一级/二级直接跳列表页 */
  .cat-detail { display: none !important; }
  .home-hero { grid-template-columns: 1fr; }
  .hero-carousel { height: 320px; }
  .feature-bar { grid-template-columns: repeat(2, 1fr); gap: 12px 0; padding: 12px 0; }
  .feature-bar .fi { border-right: none; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .brand-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-inner { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .hero-entries { grid-template-columns: 1fr; }
  .auth-main { flex-direction: column; }
  .auth-left { width: 100%; padding: 40px 32px; min-height: 420px; }
  .auth-left .hero h1 { font-size: 40px; }
  .auth-left .auth-features { grid-template-columns: repeat(3, 1fr); }
  .auth-right { padding: 32px 16px; }
  .m-header-inner { flex-wrap: wrap; gap: 16px; }
  .topbar-inner { flex-wrap: wrap; }
  /* 窄屏空间不足，隐藏放大镜镜片与浮层 */
  .detail-wrap .zoom-lens, .detail-wrap .zoom-panel { display: none !important; }
}
