.page-products{
  --cat-rule: rgba(216,201,168,.22);
  --cat-rule-strong: rgba(216,201,168,.46);
  --cat-panel: rgba(22,34,74,.72);
  --cat-panel-soft: rgba(22,34,74,.44);
  --cat-pad: clamp(16px, 3vw, 24px);
  padding-block: 20px clamp(56px, 9vw, 96px);
}

.page-products .shell{
  max-width: var(--content-max);
}

/* ---------------- 首屏 ---------------- */

.cat-hero{
  position: relative;
  overflow: hidden;
  margin: 6px 0 clamp(40px, 6vw, 64px);
  padding: clamp(22px, 4vw, 38px) clamp(18px, 3.4vw, 34px);
  border: 2px solid var(--gold);
  background:
    linear-gradient(128deg, rgba(140,31,63,.5) 0%, rgba(10,18,48,.94) 58%),
    var(--ink-800);
  box-shadow: var(--shadow-hard);
}

.cat-hero::before{
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(216,201,168,.22) 1px, transparent 1px);
  background-size: 13px 13px;
  opacity: .45;
  pointer-events: none;
}

.cat-hero::after{
  content: "";
  position: absolute;
  left: -10%;
  bottom: -60%;
  width: 78%;
  height: 150%;
  background: linear-gradient(90deg, rgba(63,216,200,.18), rgba(255,194,74,0) 72%);
  transform: rotate(-14deg);
  pointer-events: none;
}

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

.cat-hero__kicker{
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--cyan);
}

.cat-hero h1{
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 6.4vw, 50px);
  line-height: 1.14;
  letter-spacing: -.01em;
  color: var(--paper);
  text-shadow: 3px 3px 0 var(--wine-deep), 0 0 18px rgba(255,194,74,.28);
}

.cat-hero__lede{
  max-width: 66ch;
  margin: 0 0 24px;
  font-size: clamp(14.5px, 2.4vw, 16.5px);
  line-height: 1.88;
  color: var(--paper);
}

.cat-stats{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cat-stats li{
  padding-left: 11px;
  border-left: 2px solid var(--wine);
}

.cat-stats__num{
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(20px, 3.6vw, 26px);
  line-height: 1.1;
  color: var(--gold-soft);
}

.cat-stats__label{
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  letter-spacing: .02em;
  color: var(--mist);
}

/* ---------------- 章节 ---------------- */

.cat-section{
  margin-bottom: clamp(46px, 7vw, 76px);
  scroll-margin-top: calc(var(--topbar-h) + 20px);
}

.page-products .section-head{
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0 14px;
  align-items: start;
  margin-bottom: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--cat-rule);
}

.page-products .section-head__num{
  grid-row: 1 / span 2;
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.03em;
  color: var(--gold);
}

.page-products .section-head__body{
  min-width: 0;
}

.page-products .section-head__kicker{
  margin: 0 0 5px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cyan);
}

.page-products .section-head h2{
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(20px, 3.8vw, 30px);
  line-height: 1.28;
  color: var(--paper);
}

.cat-lead{
  max-width: 70ch;
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.88;
  color: var(--mist);
}

.cat-note{
  max-width: 74ch;
  margin: 20px 0 0;
  padding-left: 14px;
  border-left: 2px solid var(--cyan);
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--mist);
}

.cat-note a{
  color: var(--gold-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- 图片容器 ---------------- */

.page-products .media{
  --media-ratio: 16 / 9;
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--cat-rule);
  background: var(--ink-800);
}

.page-products .media img{
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
}

.page-products .media__caption{
  padding: 10px 13px;
  border-top: 1px solid var(--cat-rule);
  background: var(--cat-panel-soft);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--mist);
}

.cat-figure{
  width: 100%;
}

/* ---------------- 01 目录总览 ---------------- */

.cat-overview{
  display: grid;
  gap: 20px;
}

.cluster-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
}

.cluster-card{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 15px;
  border: 2px solid var(--cat-rule);
  background: var(--cat-panel);
  box-shadow: var(--shadow-soft);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}

.cluster-card:hover{
  transform: translate(-2px, -2px);
  border-color: var(--gold);
  box-shadow: var(--shadow-hard);
}

.cluster-card__head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.cluster-card__head h3{
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 19px;
  line-height: 1.3;
  color: var(--paper);
}

.cluster-card__count{
  flex: none;
  padding: 2px 8px;
  border: 1px solid var(--gold);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(255,194,74,.08);
}

.cluster-card__desc{
  margin: 0;
  font-size: 13.8px;
  line-height: 1.82;
  color: var(--mist);
}

.cluster-card__meta{
  margin: auto 0 0;
  padding-top: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--cyan);
}

/* ---------------- 02 标签索引 ---------------- */

.tag-index{
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.tag-row{
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--cat-rule);
  background: var(--cat-panel-soft);
}

.tag-row__head{
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.tag-row__name{
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  color: var(--paper);
}

.tag-row__count{
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--gold);
}

.tag-row__tags{
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-products .tag{
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--cat-rule-strong);
  border-radius: var(--radius);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--paper);
  white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}

.page-products .tag:hover{
  border-color: var(--gold);
  color: var(--gold-soft);
}

.page-products .tag[aria-pressed="true"]{
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink-900);
  font-weight: 700;
}

.page-products [data-filtered="out"]{
  display: none;
}

/* ---------------- 03 格式表 ---------------- */

.cat-table-wrap{
  margin-top: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--cat-rule);
  background: var(--cat-panel-soft);
}

.cat-table{
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 14px;
}

.cat-table th{
  padding: 12px 14px;
  border-bottom: 2px solid var(--wine);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-align: left;
  text-transform: uppercase;
  color: var(--mist);
  white-space: nowrap;
}

.cat-table td{
  padding: 12px 14px;
  border-bottom: 1px solid var(--cat-rule);
  line-height: 1.75;
  color: var(--paper);
  vertical-align: top;
}

.cat-table tbody tr:nth-child(even){
  background: rgba(216,201,168,.05);
}

.cat-table tbody tr:last-child td{
  border-bottom: 0;
}

.cat-table td:first-child{
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.cat-table td:last-child{
  font-family: var(--font-mono);
  color: var(--gold-soft);
  white-space: nowrap;
}

/* ---------------- 04 授权阶梯 ---------------- */

.auth-stack{
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.auth-card{
  padding: 18px 16px 20px;
  border: 2px solid var(--cat-rule);
  border-top-width: 6px;
  border-top-color: var(--mist);
  background: var(--cat-panel);
  box-shadow: var(--shadow-soft);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}

.auth-card:nth-child(2){
  border-top-color: var(--wine);
}

.auth-card:nth-child(3){
  border-top-color: var(--gold);
}

.auth-card:hover{
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hard);
}

.auth-card__tier{
  margin: 0 0 6px;
  font-size: 11.5px;
  letter-spacing: .18em;
  color: var(--cyan);
}

.auth-card__name{
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  line-height: 1.25;
  color: var(--paper);
}

.auth-card__scene{
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--mist);
}

.auth-card__list{
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--cat-rule);
  font-size: 13.5px;
  line-height: 1.75;
}

.auth-card__list dt{
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--gold);
}

.auth-card__list dt:first-child{
  margin-top: 0;
}

.auth-card__list dd{
  margin: 2px 0 0;
  color: var(--paper);
}

/* ---------------- 05 下载步骤 ---------------- */

.steps{
  display: grid;
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.step{
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 15px;
  border: 1px solid var(--cat-rule);
  border-left: 4px solid var(--gold);
  background: var(--cat-panel-soft);
}

.step__body{
  min-width: 0;
}

.step__idx{
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--gold);
}

.step__body h3{
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  line-height: 1.35;
  color: var(--paper);
}

.step__body p{
  margin: 0;
  font-size: 14px;
  line-height: 1.88;
  color: var(--mist);
}

/* ---------------- 06 使用场景 ---------------- */

.scene-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
  margin-top: 20px;
}

.scene-card{
  padding: 16px 15px;
  border: 1px solid var(--cat-rule);
  background:
    linear-gradient(180deg, rgba(140,31,63,.16), rgba(22,34,74,0) 60%),
    var(--cat-panel-soft);
}

.scene-card__name{
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 19px;
  line-height: 1.3;
  color: var(--gold-soft);
}

.scene-card__need{
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--paper);
}

.scene-card__pick,
.scene-card__lic{
  margin: 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--mist);
}

.scene-card__lic{
  margin-top: 4px;
  font-family: var(--font-mono);
  letter-spacing: .04em;
  color: var(--cyan);
}

/* ---------------- 07 版本与更新 ---------------- */

.version-list{
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.version-list li{
  display: grid;
  gap: 6px;
  padding: 15px 0;
  border-bottom: 1px solid var(--cat-rule);
}

.version-list li:first-child{
  border-top: 1px solid var(--cat-rule);
}

.version-key{
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--gold);
}

.version-list p{
  margin: 0;
  font-size: 14px;
  line-height: 1.88;
  color: var(--mist);
}

.version-list a{
  color: var(--gold-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- 收尾行动区 ---------------- */

.cat-cta{
  display: grid;
  gap: 18px;
  margin-top: clamp(34px, 6vw, 56px);
  padding: clamp(20px, 3.4vw, 30px);
  border: 2px solid var(--gold);
  background:
    linear-gradient(120deg, rgba(140,31,63,.42), rgba(10,18,48,.9) 65%),
    var(--ink-800);
  box-shadow: var(--shadow-soft);
}

.cat-cta__text h2{
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(19px, 3.4vw, 25px);
  line-height: 1.3;
  color: var(--paper);
}

.cat-cta__text p{
  margin: 0;
  max-width: 62ch;
  font-size: 14px;
  line-height: 1.88;
  color: var(--mist);
}

.cat-cta__actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------------- 断点 ---------------- */

@media (min-width: 640px){
  .cluster-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cat-stats{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .version-list li{
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }
}

@media (min-width: 760px){
  .tag-row{
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }
}

@media (min-width: 920px){
  .auth-stack{
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .auth-card:nth-child(2){
    margin-top: 30px;
  }

  .auth-card:nth-child(3){
    margin-top: 60px;
  }

  .cat-cta{
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
  }
}

@media (min-width: 1040px){
  .cat-overview{
    grid-template-columns: minmax(0, 1.6fr) minmax(250px, .8fr);
    gap: 22px;
    align-items: start;
  }

  .cluster-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cat-overview .cat-figure{
    position: sticky;
    top: calc(var(--topbar-h) + 24px);
  }
}

@media (prefers-reduced-motion: reduce){
  .cluster-card,
  .auth-card,
  .page-products .tag{
    transition: none;
  }

  .cluster-card:hover,
  .auth-card:hover{
    transform: none;
  }
}
