/* ==========================================================================
   products.css — 产品列表页（product_category 分类归档 + /products/ 聚合页）
   1 面包屑 / 2 分类头部 / 3 主体布局 / 4 侧栏筛选 / 5 产品卡
   6 空分类 / 7 相关分类 / 8 分页 / 9 技术介绍 / 10 相关应用 / 11 FAQ
   依赖 tokens.css 的变量与按钮；颜色、圆角、间距不在本文件另立一套。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 面包屑
   -------------------------------------------------------------------------- */

.crumb {
  margin-bottom: var(--sp-6);
}

.crumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 10px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
}

.crumb__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.crumb__item + .crumb__item::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  border-top: 1px solid #b9c4cf;
  border-right: 1px solid #b9c4cf;
  transform: rotate(45deg);
}

.crumb__item a {
  color: var(--muted);
  transition: color 0.16s var(--ease);
}

.crumb__item a:hover,
.crumb__item a:focus-visible {
  color: var(--navy);
}

.crumb__item[aria-current="page"] {
  color: var(--navy);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60ch;
}

/* --------------------------------------------------------------------------
   2. 分类头部
   -------------------------------------------------------------------------- */

.cat-hero {
  position: relative;
  padding: var(--sp-7) 0 var(--sp-8);
  background: var(--white);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

/* 极淡工程网格：与首页 hero 同一套纹理，右淡出 */
.cat-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(21, 40, 61, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(21, 40, 61, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(100deg, #000 0%, transparent 58%);
  mask-image: linear-gradient(100deg, #000 0%, transparent 58%);
  pointer-events: none;
}

.cat-hero > .container {
  position: relative;
  z-index: 1;
}

.cat-hero__title {
  margin-top: var(--sp-3);
  max-width: 22ch;
}

.cat-hero__intro {
  margin-top: var(--sp-4);
  max-width: 62ch;
}

.cat-hero__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: var(--sp-5);
}

.cat-hero__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: var(--sp-7);
  border-top: 1px solid var(--line);
}

.cat-hero__stat {
  padding: var(--sp-4) var(--sp-5) 0 0;
  border-left: 1px solid var(--line);
  padding-left: var(--sp-5);
}

.cat-hero__stat:first-child {
  border-left: 0;
  padding-left: 0;
}

.cat-hero__stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.cat-hero__stat-value {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   3. 主体布局：侧栏 + 产品列
   -------------------------------------------------------------------------- */

.cat-catalog {
  padding: var(--sp-8) 0 var(--sp-9);
  background: var(--white);
}

.cat-layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: var(--sp-8);
  align-items: start;
}

/* grid 子项默认 min-width:auto，横向滚动的分类条会把整页撑宽，
   必须显式归零，overflow-x 才会在容器内生效 */
.cat-layout > * {
  min-width: 0;
}

.cat-main {
  min-width: 0;
}

/* --------------------------------------------------------------------------
   4. 侧栏分类筛选
   -------------------------------------------------------------------------- */

.cat-side__inner {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-5));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  overflow: hidden;
}

.cat-side__title {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--navy);
}

.cat-side__list {
  padding: 6px;
}

.cat-side__item a {
  display: block;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text);
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease);
}

.cat-side__item a:hover,
.cat-side__item a:focus-visible {
  background: var(--bg);
  color: var(--navy);
}

.cat-side__item--child a {
  padding-left: 26px;
  position: relative;
  font-size: 0.8125rem;
  color: var(--muted);
}

.cat-side__item--child a::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 50%;
  width: 5px;
  height: 1px;
  background: #c6d0d9;
}

/* 当前分类：橙色左边线 + 深色文字 */
.cat-side__item.is-current a {
  background: rgba(242, 140, 40, 0.1);
  box-shadow: inset 2px 0 0 var(--orange);
  color: var(--navy);
  font-weight: 650;
}

.cat-side__item.is-open a {
  color: var(--navy);
  font-weight: 650;
}

.cat-side__cta {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.cat-side__cta-text {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted);
}

.cat-side__cta .btn {
  margin-top: 12px;
  width: 100%;
}

/* --------------------------------------------------------------------------
   5. 产品列 + 产品卡
   -------------------------------------------------------------------------- */

.cat-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--line);
}

.cat-toolbar__title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.cat-toolbar__count {
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange-dark);
}

.cat-toolbar__note {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
}

.mcard {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.2s var(--ease), box-shadow 0.24s var(--ease), transform 0.24s var(--ease);
}

.mcard:hover,
.mcard:focus-within {
  border-color: #c4ced8;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.mcard__media {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg);
}

.mcard__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.mcard:hover .mcard__media img {
  transform: scale(1.035);
}

.mcard__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 18px 18px 20px;
}

.mcard__title {
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.008em;
  color: var(--navy);
}

.mcard__title a {
  transition: color 0.16s var(--ease);
}

.mcard:hover .mcard__title a {
  color: var(--orange-dark);
}

.mcard__desc {
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
}

.mcard__more {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 7px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  width: 100%;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--navy);
  transition: color 0.16s var(--ease);
}

.mcard__more svg {
  width: 13px;
  height: 13px;
  transition: transform 0.2s var(--ease);
}

.mcard__more:hover,
.mcard:hover .mcard__more {
  color: var(--orange-dark);
}

.mcard:hover .mcard__more svg {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   6. 空分类（按需定制）
   -------------------------------------------------------------------------- */

.cat-empty {
  display: flex;
  align-items: center;
  min-height: 320px;
  padding: var(--sp-6);
  border: 1px dashed #c6d0d9;
  border-radius: var(--r-md);
  background: var(--bg);
}

.cat-empty__body {
  max-width: 56ch;
}

.cat-empty__body .h3 {
  margin-top: var(--sp-3);
  font-size: 1.1875rem;
}

.cat-empty__body p {
  margin-top: var(--sp-3);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--muted);
}

.cat-empty__body .btn {
  margin-top: var(--sp-5);
}

/* --------------------------------------------------------------------------
   7. 相关分类内链
   -------------------------------------------------------------------------- */

.cat-related {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
}

.cat-related__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.cat-related__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-related__list a {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
  transition: border-color 0.16s var(--ease), background-color 0.16s var(--ease);
}

.cat-related__list a:hover,
.cat-related__list a:focus-visible {
  border-color: var(--navy);
  background: rgba(21, 40, 61, 0.04);
}

/* --------------------------------------------------------------------------
   8. 分页
   -------------------------------------------------------------------------- */

.cat-pagination {
  margin-top: var(--sp-6);
}

.cat-pagination .page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cat-pagination .page-numbers li {
  display: block;
}

.cat-pagination .page-numbers a,
.cat-pagination .page-numbers span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease);
}

.cat-pagination .page-numbers a:hover,
.cat-pagination .page-numbers a:focus-visible {
  border-color: var(--navy);
  color: var(--navy);
}

.cat-pagination .page-numbers .current {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* --------------------------------------------------------------------------
   9. 技术介绍
   -------------------------------------------------------------------------- */

.cat-tech__lead {
  margin-top: var(--sp-4);
}

.cat-prose {
  margin-top: var(--sp-5);
  font-size: 0.9375rem;
  line-height: 1.72;
  color: var(--text);
}

.cat-prose > * + * {
  margin-top: var(--sp-4);
}

.cat-prose h3,
.cat-prose h4 {
  margin-top: var(--sp-6);
  font-size: 1.0625rem;
  color: var(--navy);
}

.cat-prose ul,
.cat-prose ol {
  padding-left: 20px;
  list-style: disc;
}

.cat-prose ol {
  list-style: decimal;
}

.cat-prose li + li {
  margin-top: 6px;
}

.cat-prose a {
  color: var(--orange-dark);
  border-bottom: 1px solid rgba(221, 122, 22, 0.35);
  padding-bottom: 1px;
  transition: border-color 0.16s var(--ease);
}

.cat-prose a:hover,
.cat-prose a:focus-visible {
  border-color: var(--orange-dark);
}

.cat-prose strong {
  color: var(--navy);
  font-weight: 650;
}

/* 规格卡（深色，与左侧正文形成层级） */
.spec-card {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-5));
  padding: 26px;
  border-radius: var(--r-md);
  background: var(--navy);
  color: var(--on-dark);
}

.spec-card__title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark);
}

.spec-card__list {
  margin: 14px 0 0;
}

.spec-card__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--on-dark-line);
}

.spec-card__row dt {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--on-dark-muted);
}

.spec-card__row dd {
  margin: 0;
  text-align: right;
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--on-dark);
  font-variant-numeric: tabular-nums;
}

.spec-card__note {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--on-dark-line);
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--on-dark-muted);
}

.spec-card__link {
  margin-top: var(--sp-4);
  color: var(--on-dark);
}

.spec-card__link:hover,
.spec-card__link:focus-visible {
  color: var(--orange);
}

/* --------------------------------------------------------------------------
   10. 相关应用卡
   -------------------------------------------------------------------------- */

.applink {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--navy);
  border-radius: var(--r-md);
  background: var(--white);
  transition: border-color 0.2s var(--ease), box-shadow 0.24s var(--ease);
}

.applink:hover,
.applink:focus-visible {
  border-color: #c4ced8;
  border-top-color: var(--orange);
  box-shadow: var(--shadow-md);
}

.applink__title {
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.4;
  color: var(--navy);
}

.applink__desc {
  flex: 1;
  margin-top: 8px;
  font-size: 0.875rem;
  line-height: 1.62;
  color: var(--muted);
}

.applink__more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  transition: color 0.16s var(--ease);
}

.applink__more svg {
  width: 13px;
  height: 13px;
  transition: transform 0.2s var(--ease);
}

.applink:hover .applink__more {
  color: var(--orange-dark);
}

.applink:hover .applink__more svg {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   11. FAQ
   -------------------------------------------------------------------------- */

.qa {
  height: 100%;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--orange);
  border-radius: var(--r-sm);
  background: var(--white);
}

.qa__q {
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.45;
  color: var(--navy);
}

.qa__a {
  margin-top: 8px;
  font-size: 0.875rem;
  line-height: 1.68;
  color: var(--muted);
}

/* 分类页 CTA 尾注直接跟在按钮组下面（首页的尾注在 .cta__actions 内，不吃这条） */
.cat-page .cta__aside {
  margin-top: var(--sp-4);
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1199.98px) {
  .cat-layout {
    grid-template-columns: 232px minmax(0, 1fr);
    gap: var(--sp-6);
  }

  .cat-hero__stat {
    padding-left: var(--sp-4);
  }
}

@media (max-width: 991.98px) {
  .cat-hero {
    padding: var(--sp-6) 0 var(--sp-7);
  }

  .cat-hero__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
  }

  .cat-hero__stat {
    padding: var(--sp-4) var(--sp-4) 0 0;
    border-left: 0;
  }

  .cat-hero__stat:nth-child(n + 3) {
    margin-top: var(--sp-4);
    border-top: 1px solid var(--line);
    padding-top: var(--sp-4);
  }

  .cat-hero__stat:nth-child(even) {
    padding-left: var(--sp-4);
    border-left: 1px solid var(--line);
  }

  .cat-hero__actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-top: var(--sp-5);
  }

  /* 侧栏在移动端变成横向滚动的分类条，不占纵向空间 */
  .cat-layout {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }

  .cat-side__inner {
    position: static;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }

  .cat-side__title {
    padding: 0 0 10px;
    border-bottom: 0;
    background: none;
    font-size: 0.6875rem;
  }

  .cat-side__list {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 0 0 4px;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .cat-side__item {
    flex: none;
  }

  .cat-side__item a,
  .cat-side__item--child a {
    display: block;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 100px;
    font-size: 0.8125rem;
    color: var(--text);
    white-space: nowrap;
  }

  .cat-side__item--child a::before {
    display: none;
  }

  .cat-side__item.is-current a {
    background: var(--navy);
    border-color: var(--navy);
    box-shadow: none;
    color: var(--white);
  }

  .cat-side__cta {
    display: none;
  }

  .spec-card {
    position: static;
  }
}

@media (max-width: 575.98px) {
  .cat-toolbar__note {
    display: none;
  }

  .cat-empty {
    padding: var(--sp-5);
  }

  .mcard__body {
    padding: 16px;
  }

  .cat-hero__stat-value {
    font-size: 1rem;
  }

  .spec-card {
    padding: 20px;
  }
}
