/* ============================================================
   LI-XIANG TECH — 首页品牌入口 + 产品目录页（/catalog/）样式
   依赖 styles.css 的设计变量，不覆盖原有模块
   ============================================================ */

/* ---------- 首页：品牌入口卡 ---------- */
.be-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.be-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 18px 18px 15px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.be-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--yellow);
  opacity: 0;
  transition: opacity .18s ease;
}
.be-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: var(--shadow-md);
}
.be-card:hover::after { opacity: 1; }
.be-idx {
  font-family: var(--font-h);
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--muted);
}
.be-name {
  font-family: var(--font-h);
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  text-transform: uppercase;
}
.be-count { font-size: 13px; color: var(--muted); }
.be-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 4px 0 2px;
}
.be-thumbs img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px;
}
.be-pts {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  min-height: 36px;
}
.be-go {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--font-h);
  font-size: 15px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.be-go .ico { width: 15px; height: 15px; transition: transform .18s ease; }
.be-card:hover .be-go { color: #8a6100; }
.be-card:hover .be-go .ico { transform: translateX(3px); }

/* ---------- 产品目录页 ---------- */
.cat-hero {
  background: var(--navy);
  color: #fff;
  padding: 34px 0 38px;
  background-image: linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
                    linear-gradient(180deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px, 48px 48px;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #9aa5b1;
  margin-bottom: 12px;
}
.crumbs a { color: #c9d1d9; }
.crumbs a:hover { color: var(--yellow); }
.crumbs .sep { opacity: .5; }
.crumbs b { color: var(--yellow); font-weight: 600; }
.cat-hero h1 {
  font-family: var(--font-h);
  font-weight: 700;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.cat-lede {
  margin-top: 10px;
  max-width: 760px;
  color: #b7c0ca;
  font-size: 15px;
}

.cat-nav-wrap {
  position: static;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--line);
}
.cat-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1.5px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--font-h);
  font-size: 15px;
  letter-spacing: .03em;
  transition: .15s;
  white-space: nowrap;
}
.cat-chip b { font-weight: 600; }
.cat-chip i {
  font-style: normal;
  font-family: var(--font-b);
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border-radius: 999px;
  padding: 1px 7px;
}
.cat-chip:hover { border-color: var(--navy); }
.cat-chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.cat-chip.on i { background: rgba(255,255,255,.16); color: #fff; }

.cat-search {
  flex: none;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1.5px solid var(--line-2);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
}
.cat-search:focus-within { border-color: var(--yellow); }
.cat-search .ico { width: 16px; height: 16px; }
.cat-search input {
  border: 0;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  width: 215px;
}

.cat-body { background: var(--paper); }
/* 目录页产品网格加密：桌面 5 列（原 4 列两边留白偏多） */
.cat-body .prod-grid { grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 1280px) {
  .cat-body .prod-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
  .cat-body .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-body .p-card .p-name { font-size: 15px; }
}

/* 宽屏自适应：版心拉宽 + 列数递增，产品铺满两侧（图片比例不变） */
@media (min-width: 1440px) {
  body[data-page="catalog"] .wrap { max-width: 1320px; }
  .cat-body .prod-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (min-width: 1800px) {
  body[data-page="catalog"] .wrap { max-width: 1480px; }
  .cat-body .prod-grid { grid-template-columns: repeat(7, 1fr); gap: 13px; }
}

/* 首页宽屏自适应：版心拉宽，Hero 左右铺满、品牌入口卡加密 */
@media (min-width: 1440px) {
  body[data-page="home"] .wrap { max-width: 1320px; }
  body[data-page="home"] .be-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 1800px) {
  body[data-page="home"] .wrap { max-width: 1480px; }
  body[data-page="home"] .be-grid { grid-template-columns: repeat(7, 1fr); gap: 13px; }
}
.bsec {
  padding: 44px 0 14px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--hdr, 72px) + 14px);
}
.bsec:last-of-type { border-bottom: 0; }
.bsec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--ink);
}
.bsec-t h2 {
  font-family: var(--font-h);
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.bsec-pts { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.bsec-n {
  flex: none;
  font-family: var(--font-h);
  font-size: 15px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 4px;
}

.cat-empty {
  display: none;
  text-align: center;
  padding: 70px 20px 90px;
}
.cat-empty.on { display: block; }
.cat-empty h4 { font-family: var(--font-h); font-size: 26px; text-transform: uppercase; }
.cat-empty p { color: var(--muted); margin: 8px 0 16px; }

.totop {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 60;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: .2s;
}
.totop.on { opacity: 1; pointer-events: auto; transform: none; }
.totop .ico { width: 20px; height: 20px; transform: rotate(-90deg); }
.totop:hover { background: var(--yellow); color: var(--yellow-ink); }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .be-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-search { margin-left: 0; }
  .cat-search input { width: 170px; }
}
@media (max-width: 640px) {
  .be-grid { grid-template-columns: 1fr; }
  .be-thumbs { grid-template-columns: repeat(3, 84px); }
  .be-name { font-size: 23px; }
  .cat-hero { padding: 24px 0 26px; }
  .bsec { padding: 30px 0 6px; }
  .bsec-head { flex-direction: column; align-items: flex-start; gap: 6px; }
}
