/* ==========================================================================
   运动防护穿戴用品 · 内页组件（category.html / detail.html 专用）
   只消费 04-site/css/tokens.css 的变量；首页组件（.site-header/.site-footer/
   .sec-head/.spec-table…）一律复用 style.css，不在此重复定义。
   区块顺序：01 面包屑 02 列表页头 03 筛选条 04 条目网格 05 空态 06 列表说明
             07 相邻分类 08 详情页头 09 关键信息 10 目录 11 正文 12 相关条目 13 上下篇
   ========================================================================== */

/* ---------------------------------------------------------------- 01 面包屑 */
.crumb {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 18px var(--gutter) 0;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.crumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.crumb li { display: flex; align-items: center; gap: 8px; }
.crumb li + li::before {
  content: "";
  width: 5px; height: 5px;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  transform: rotate(-45deg);
}
.crumb a { color: var(--muted); }
.crumb a:hover, .crumb a:focus-visible { color: var(--accent-ink); text-decoration: underline; }
.crumb [aria-current="page"] { color: var(--ink-soft); }

/* ------------------------------------------------------------- 02 列表页头 */
.page-hero {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 16px var(--gutter) 22px;
}
.page-hero__h1 {
  font-size: var(--fs-h1);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
}
.page-hero__lead {
  margin-top: 10px;
  max-width: 760px;
  font-size: var(--fs-body);
  line-height: 1.8;
  color: var(--muted);
}

/* --------------------------------------------------------------- 03 筛选条 */
.toolbar {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter) 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  border-bottom: 1px solid var(--line);
}
.toolbar__group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar__label {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--muted-2);
}
.chip {
  padding: 5px 12px;
  font-size: var(--fs-xs);
  font-family: inherit;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background-color .16s ease;
}
.chip:hover { border-color: var(--line-strong); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip[aria-pressed="true"] {
  color: #fff;
  background: var(--navy-700);
  border-color: var(--navy-700);
}
.toolbar__sort { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.toolbar__sort label { cursor: pointer; }
.select {
  padding: 6px 10px;
  font-size: var(--fs-xs);
  font-family: inherit;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.toolbar__count {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.toolbar__count strong { color: var(--ink); font-weight: 700; }

/* ------------------------------------------------------------- 04 条目网格 */
.item-grid {
  max-width: var(--wrap);
  margin: 22px auto 0;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.item-card {
  display: flex;
  flex-direction: column;
  padding: 16px 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.item-card:hover, .item-card:focus-within { transform: translateY(-2px); border-color: var(--accent); }
.item-card__media {
  display: block;
  margin: -16px -16px 14px;
  aspect-ratio: 240 / 150;
  overflow: hidden;
  background: var(--bg-soft);
  border-radius: var(--radius) var(--radius) 0 0;
}
.item-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.item-card:hover .item-card__media img { transform: scale(1.04); }
.item-card__name {
  font-size: var(--fs-card);
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.item-card__name a { color: inherit; }
.item-card__name a:hover, .item-card__name a:focus-visible { color: var(--accent-ink); }
.item-card__desc {
  margin-top: 8px;
  font-size: var(--fs-2xs);
  line-height: 1.7;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.tag-row { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 2px 8px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}
.tag--grade { color: var(--accent-ink); background: var(--accent-soft); font-weight: 700; }

.item-grid__more {
  max-width: var(--wrap);
  margin: 20px auto 0;
  padding-inline: var(--gutter);
  text-align: center;
}
.btn-ghost {
  padding: 9px 22px;
  font-size: var(--fs-xs);
  font-family: inherit;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease;
}
.btn-ghost:hover { color: var(--accent-ink); border-color: var(--accent); }
.btn-ghost:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-ghost[hidden] { display: none; }

/* 服务端分页 */
.pager {
  max-width: var(--wrap);
  margin: 22px auto 0;
  padding-inline: var(--gutter);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.pager__link, .pager__cur, .pager__gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding-inline: 10px;
  font-size: var(--fs-xs);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
}
.pager__link:hover, .pager__link:focus-visible { color: var(--accent-ink); border-color: var(--accent); }
.pager__cur { color: #fff; background: var(--navy-700); border-color: var(--navy-700); font-weight: 700; }
.pager__gap { border-color: transparent; background: transparent; color: var(--muted-2); }

/* ------------------------------------------------------------------ 05 空态 */
.empty {
  max-width: var(--wrap);
  margin: 22px auto 0;
  padding: 34px var(--gutter);
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.empty[hidden] { display: none; }
.empty__title { font-size: var(--fs-card); font-weight: 700; color: var(--ink); }
.empty__hint { margin-top: 6px; font-size: var(--fs-xs); color: var(--muted); }
.empty .btn-ghost { margin-top: 14px; }

/* ------------------------------------------------------------- 06 列表说明 */
.list-description {
  max-width: var(--wrap);
  margin: 38px auto 0;
  padding: 26px var(--gutter) 0;
  border-top: 1px solid var(--line);
}
.list-description__title {
  position: relative;
  padding-left: 12px;
  font-size: var(--fs-h2);
  line-height: 1.25;
  font-weight: 700;
  color: var(--ink);
}
.list-description__title::before {
  content: ""; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 22px; border-radius: 2px;
  background: var(--accent);
}
.list-description p {
  margin-top: 12px;
  max-width: 940px;
  font-size: var(--fs-body);
  line-height: 1.95;
  color: var(--ink-soft);
}
.list-description a { color: var(--accent-ink); border-bottom: 1px solid var(--accent-soft); }
.list-description a:hover, .list-description a:focus-visible { border-bottom-color: var(--accent); }

/* ------------------------------------------------------------- 07 相邻分类 */
.related {
  max-width: var(--wrap);
  margin: 34px auto 0;
  padding-inline: var(--gutter);
}
.related__title {
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--ink);
}
.related__grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.related__item {
  display: block;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .18s ease, border-color .18s ease;
}
.related__item:hover, .related__item:focus-visible { transform: translateY(-2px); border-color: var(--accent); }
.related__name { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); }
.related__desc { margin-top: 5px; font-size: var(--fs-2xs); line-height: 1.65; color: var(--muted); }

/* ------------------------------------------------------------- 08 详情页头 */
.article-head {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 16px var(--gutter) 0;
}
.article-head__h1 {
  font-size: var(--fs-h1);
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
}
.article-head__lead {
  margin-top: 12px;
  max-width: 880px;
  font-size: var(--fs-body);
  line-height: 1.9;
  color: var(--ink-soft);
}
.article-head__meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.article-head__meta .tag--grade { font-size: 10.5px; }
.article-head__dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }

/* ------------------------------------------------------------- 09 关键信息 */
.keyfact {
  max-width: var(--wrap);
  margin: 20px auto 0;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.keyfact__item { padding: 13px 16px; background: var(--surface); }
.keyfact__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--muted-2);
}
.keyfact__value { margin-top: 6px; font-size: var(--fs-sm); font-weight: 700; line-height: 1.5; color: var(--ink); }

/* ----------------------------------------------------------------- 10 目录 */
.article-layout {
  max-width: var(--wrap);
  margin: 26px auto 0;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.toc {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.toc__title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--accent-ink);
}
.toc ol { margin-top: 10px; display: grid; gap: 7px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: block;
  padding-left: 20px;
  position: relative;
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--muted);
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted-2);
}
.toc a:hover, .toc a:focus-visible { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--accent-ink); font-weight: 700; }
.toc a[aria-current="true"]::before { color: var(--accent); }

/* ----------------------------------------------------------------- 11 正文 */
.article { max-width: 760px; }
.article__lead {
  padding: 16px 20px;
  font-size: var(--fs-body);
  line-height: 1.95;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article section { margin-top: 30px; }
.article h2 {
  position: relative;
  padding-left: 13px;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.article h2::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 4px; height: 18px; border-radius: 2px;
  background: var(--accent);
}
.article p {
  margin-top: 12px;
  font-size: var(--fs-body);
  line-height: 2.0;
  color: var(--ink-soft);
}
.article a { color: var(--accent-ink); border-bottom: 1px solid var(--accent-soft); }
.article a:hover, .article a:focus-visible { border-bottom-color: var(--accent); }
.article figure { margin: 20px 0 0; }
.article figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: var(--bg-soft);
}

/* ------------------------------------------------------------- 12 相关条目 */
.related-items {
  max-width: 760px;
  margin: 36px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.related-items__title { font-size: var(--fs-h3); font-weight: 700; color: var(--ink); }
.related-items__list { margin-top: 12px; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.related-items__item {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  padding: 13px 16px;
  background: var(--surface);
}
.related-items__item:hover { background: var(--surface-alt); }
.related-items__name { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); }
.related-items__desc { font-size: var(--fs-xs); line-height: 1.6; color: var(--muted); }

/* --------------------------------------------------------------- 13 上下篇 */
.prev-next {
  max-width: 760px;
  margin: 26px auto 0;
  display: flex;
  gap: 12px;
}
.prev-next a {
  flex: 1;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .16s ease, transform .18s ease;
}
.prev-next a:hover, .prev-next a:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.prev-next__label { font-size: 10px; font-weight: 700; letter-spacing: .12em; color: var(--muted-2); }
.prev-next__name { margin-top: 5px; font-size: var(--fs-sm); font-weight: 700; color: var(--ink); }
.prev-next a:last-child { text-align: right; }

/* -------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 28px; }
}

@media (max-width: 1024px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .keyfact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .item-grid, .related__grid { grid-template-columns: minmax(0, 1fr); }
  .keyfact { grid-template-columns: minmax(0, 1fr); }
  .toolbar { gap: 10px; }
  .toolbar__sort { margin-left: 0; }
  .toc ol { grid-template-columns: minmax(0, 1fr); }
  .related-items__item { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .prev-next { flex-direction: column; }
  .prev-next a:last-child { text-align: left; }
  .page-hero__h1, .article-head__h1 { font-size: 26px; }
  .list-description p, .article p { font-size: 14px; }
}
