/* 水族宠物大全 · 内页组件
   约束：颜色 / 字号 / 圆角 / 阴影一律取自 tokens.css，不再新增字面量。
   首页专用版式（hero / cats / species / rows）不在这里复制。
*/

/* ---------- 面包屑 ---------- */

.crumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-4);
  color: var(--muted);
}
.crumb li { display: inline-flex; align-items: center; gap: 6px; }
.crumb li + li::before {
  content: "›";
  color: #9bb0c2;
}
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.crumb [aria-current="page"] { color: var(--ink); font-weight: 700; }
.crumb--page { margin-top: 18px; }

/* ---------- 分类页头 ---------- */

.page-hero {
  padding: 20px 0 22px;
  background: linear-gradient(180deg, #f7fafd 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.page-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: end;
  margin-top: 12px;
}
.page-hero h1 {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: .01em;
}
.page-hero__lead {
  max-width: 720px;
  margin-top: 8px;
  font-size: var(--fs-9);
  line-height: 1.7;
  color: var(--muted);
}
.page-hero__stats {
  display: flex;
  gap: 22px;
  padding: 12px 16px;
  border-radius: var(--r-7);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.page-hero__stats p {
  font-size: var(--fs-4);
  color: var(--muted);
  line-height: 1.4;
}
.page-hero__stats strong {
  display: block;
  font-size: var(--fs-14);
  font-weight: 800;
  color: var(--ink);
}

/* ---------- 筛选排序工具条 ---------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 12;
  background: rgba(236, 243, 249, .94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.toolbar__inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 10px 0;
}
.toolbar__label {
  font-size: var(--fs-4);
  font-weight: 700;
  color: var(--muted);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.chip {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-9);
  background: var(--surface);
  color: var(--ink);
  font: 600 var(--fs-4)/1.5 var(--font);
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink-invert);
}
.toolbar__sort {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}
.toolbar__sort label { cursor: pointer; }
.toolbar__sort select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-5);
  background: var(--surface);
  color: var(--ink);
  font: 400 var(--fs-4)/1.5 var(--font);
}
.toolbar__count {
  min-width: 92px;
  font-size: var(--fs-4);
  color: var(--muted);
  text-align: right;
}

/* ---------- 列表卡片 ---------- */

.list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.entry-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--r-7);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}
.entry-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(17, 49, 81, .13);
}
.entry-card__thumb img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.entry-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 14px;
}
.entry-card__tag {
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: var(--r-9);
  background: var(--surface-2);
  color: #2f5f8a;
  font-size: var(--fs-2);
  font-weight: 700;
}
.entry-card__title {
  font-size: var(--fs-11);
  font-weight: 800;
  line-height: 1.45;
}
.entry-card__sum {
  font-size: var(--fs-6);
  line-height: 1.6;
  color: var(--muted);
}
.entry-card__meta {
  display: flex;
  gap: 14px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-2);
  color: var(--muted);
}
.entry-card__meta b { color: var(--ink); font-weight: 700; }

.list-empty {
  display: none;
  padding: 30px 20px;
  border-radius: var(--r-7);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--fs-7);
  text-align: center;
}
.list-empty[data-visible="true"] { display: block; }

/* ---------- 分类说明 ---------- */

.list-note {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  margin-top: 26px;
  padding: 22px 24px;
  border-radius: var(--r-8);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.list-note__label {
  font-size: var(--fs-4);
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--accent);
}
.list-note p {
  font-size: var(--fs-9);
  line-height: 1.85;
  color: #33495e;
}

/* ---------- 二级分类 / 继续看 ---------- */

.subcats,
.related {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.subcat,
.related a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: var(--r-7);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .18s;
}
.subcat:hover,
.related a:hover { transform: translateY(-2px); }
.subcat__name,
.related__name {
  font-size: var(--fs-9);
  font-weight: 800;
}
.subcat__desc,
.related__desc {
  font-size: var(--fs-6);
  line-height: 1.6;
  color: var(--muted);
}
.subcat__count {
  margin-top: 2px;
  font-size: var(--fs-2);
  color: var(--accent);
  font-weight: 700;
}
.subcat__count::after { content: attr(data-count); }
.related a::after {
  content: "→";
  margin-top: 2px;
  color: var(--accent);
  font-weight: 700;
  font-size: var(--fs-9);
}

.block { padding: 24px 0 8px; }
.block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}
.block__head h2 {
  font-size: var(--fs-15);
  font-weight: 800;
}
.block__head .eyebrow { margin-right: 8px; }

/* ---------- 详情页头 ---------- */

.article-head {
  padding: 16px 0 14px;
  border-bottom: 1px solid var(--line);
}
.article-head__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 36px;
  align-items: start;
  margin-top: 12px;
}
.article-head h1 {
  font-size: 36px;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: .01em;
}
.article-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  font-size: var(--fs-4);
  color: var(--muted);
}
.article-head__lead {
  margin-top: 12px;
  font-size: var(--fs-9);
  line-height: 1.8;
  color: #33495e;
}
.article-head__media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--r-8);
  box-shadow: var(--shadow);
}

/* ---------- 正文与目录 ---------- */

.article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 720px);
  gap: 40px;
  padding: 22px 0 10px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 18px;
  padding: 14px 16px;
  border-radius: var(--r-7);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.toc__title {
  font-size: var(--fs-3);
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--accent);
}
.toc ol {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  counter-reset: toc;
}
.toc a {
  display: block;
  padding: 5px 0;
  font-size: var(--fs-5);
  color: var(--muted);
  border-left: 2px solid transparent;
  padding-left: 9px;
}
.toc a:hover { color: var(--accent); }
.toc a[aria-current="true"] {
  color: var(--ink);
  font-weight: 700;
  border-left-color: var(--accent);
}

.article__intro {
  max-width: 700px;
  font-size: var(--fs-9);
  line-height: 1.85;
  color: var(--muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.article section { padding-top: 22px; }
.article h2 {
  font-size: var(--fs-15);
  font-weight: 800;
  line-height: 1.4;
  scroll-margin-top: 18px;
}
.article p {
  margin-top: 9px;
  font-size: 15px;
  line-height: 1.9;
  color: #2b3f52;
}
.article strong { color: #0f5f8c; font-weight: 800; }

/* ---------- 相关条目 ---------- */

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.related-grid a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: var(--r-7);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .18s;
}
.related-grid a:hover { transform: translateY(-2px); }
.related-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-2);
}
.related-grid h3 {
  font-size: var(--fs-7);
  font-weight: 800;
  line-height: 1.45;
}
.related-grid p {
  font-size: var(--fs-2);
  line-height: 1.55;
  color: var(--muted);
}

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

@media (max-width: 1080px) {
  .page-hero__inner { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .page-hero__stats { justify-content: flex-start; }
  .list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-head__grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .article-head__media { order: -1; }
  .article-head__media img { aspect-ratio: 16 / 9; }
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .toc { position: static; }
  .toc ol { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
  .toc a { border-left: 0; padding-left: 0; }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .page-hero { padding-top: 14px; }
  .page-hero h1 { font-size: var(--fs-16); }
  .page-hero__stats { gap: 14px; padding: 10px 12px; }
  .toolbar__inner { gap: 8px 12px; }
  .toolbar__sort { margin-left: 0; }
  .toolbar__count { text-align: left; }
  .list-grid { grid-template-columns: minmax(0, 1fr); }
  .list-note { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 16px; }
  .subcats,
  .related { grid-template-columns: minmax(0, 1fr); }
  .article-head h1 { font-size: var(--fs-16); }
  .article p { font-size: var(--fs-9); line-height: 1.85; }
  .article h2 { font-size: var(--fs-14); }
  .related-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 数据对接补充（2026-11-13） ---------- */

a.chip {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
a.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink-invert);
}
.entry-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.entry-card__sum {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.subcat__name,
.related__name {
  word-break: break-word;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 22px 0 8px;
  font-size: var(--fs-6);
  color: var(--muted);
}
.pager a,
.pager__current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-5);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager__current {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink-invert);
  font-weight: 700;
}
.pager__dots { padding: 0 2px; }
.pager__step { font-weight: 600; }
.pager__info {
  margin-left: auto;
  font-size: var(--fs-4);
  color: var(--muted);
}

.article__figure {
  margin: 18px 0 6px;
}
.article__figure img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--r-7);
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .article-head__media img { aspect-ratio: 16 / 9; }
}
@media (max-width: 760px) {
  .pager__info { margin-left: 0; width: 100%; }
}
