/* components.css — 内页与共享组件（全部走 tokens.css 的变量）
   首页专用区块（hero / topics / breed / grading / latest / check / faq / notice）留在 style.css。
   本文件只放：面包屑、页头、筛选条、条目网格、列表说明、文章头、目录、正文、要点、相关条目。 */

/* ---------- 面包屑 ---------- */
.crumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--dim); padding: 14px 0 0;
}
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--red-bright); }
.crumb .sep { color: var(--dim); }
.crumb [aria-current="page"] { color: var(--body); }

/* ---------- 分类页头 ---------- */
.page-hero { padding: 14px 0 24px; border-bottom: 1px solid var(--line-soft); }
.page-hero .eyebrow { margin-bottom: 8px; }
.page-hero h1 { font-size: 44px; line-height: 1.08; letter-spacing: .01em; }
.page-hero .subline { margin-top: 8px; font-size: 18px; font-weight: 600; color: var(--red); }
.page-hero .lead {
  max-width: 760px; margin-top: 12px;
  font-size: 13.5px; line-height: 1.8; color: var(--body);
}
.page-stats {
  display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 18px;
  font-size: 11px; color: var(--muted);
}
.page-stats b {
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; font-size: 15px; color: var(--text);
  margin-right: 6px; font-weight: 600;
}

/* ---------- 筛选与排序 ---------- */
.filter-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  padding: 16px 0; border-bottom: 1px solid var(--line-soft);
}
.chip-group { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.filter-label { font-size: 10.5px; color: var(--dim); letter-spacing: .08em; margin-right: 2px; }
.chip {
  padding: 5px 12px; border: 1px solid var(--line); border-radius: var(--r-pill);
  font-size: 12px; color: var(--body); background: transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.chip:hover { color: var(--text); border-color: rgba(224, 35, 31, .55); }
.chip[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: var(--ink-invert); font-weight: 600; }
.chip[aria-selected="true"] { color: var(--red-bright); border-color: var(--red-deep); }
.filter-count { margin-left: auto; font-size: 11.5px; color: var(--muted); }

/* ---------- 条目网格 ---------- */
.entries { padding: 6px 0 4px; }
.entries-head h2 { font-size: 20px; }
.entries-head p { font-size: 12px; color: var(--muted); margin-top: 5px; }
.entry-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap-card); margin-top: 16px;
}
.entry-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.entry-link { display: block; color: inherit; }
.entry-card:hover { border-color: rgba(224, 35, 31, .5); transform: translateY(-2px); }
.entry-thumb { display: block; aspect-ratio: 16 / 6.4; overflow: hidden; }
.entry-thumb img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.9) saturate(.95); }
.entry-body { padding: 11px 14px 13px; }
.entry-group { display: block; font-size: 10px; color: var(--red-bright); letter-spacing: .04em; }
.entry-card h3 { font-size: 15px; margin: 3px 0 5px; }
.entry-card p { font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.entry-empty {
  margin: 22px 0; padding: 18px; border: 1px dashed var(--line);
  border-radius: var(--radius); font-size: 12px; color: var(--muted); text-align: center;
}

/* ---------- 列表说明 ---------- */
.list-description { padding: 26px 0 34px; border-top: 1px solid var(--line-soft); margin-top: 10px; }
.list-description p {
  max-width: 880px; font-size: 13px; line-height: 1.95; color: var(--body);
}
.list-description p + p { margin-top: 12px; }

/* ---------- 详情页头 ---------- */
.article-head { padding: 14px 0 20px; border-bottom: 1px solid var(--line-soft); }
.article-tag {
  display: inline-block; font-size: 10.5px; color: var(--red-bright);
  border: 1px solid rgba(224, 35, 31, .45); border-radius: var(--r-pill);
  padding: 2px 10px; margin-bottom: 10px;
}
.article-head h1 { font-size: 46px; line-height: 1.1; letter-spacing: .01em; }
.article-lead { max-width: 780px; margin-top: 10px; font-size: 13.5px; line-height: 1.8; color: var(--body); }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 14px;
  font-size: 11.5px; color: var(--muted);
}
.article-meta b { color: var(--text); font-weight: 600; margin-left: 5px; }

/* ---------- 详情布局与目录 ---------- */
.article-layout {
  display: grid; grid-template-columns: 208px minmax(0, 1fr);
  gap: 36px; padding: 24px 0 8px;
}
.toc { align-self: start; position: sticky; top: 88px; }
.toc-toggle {
  display: block; width: 100%; text-align: left;
  font-size: 10.5px; letter-spacing: .18em; color: var(--dim);
  padding: 0 0 8px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.toc-toggle:hover { color: var(--muted); }
.toc-nav { padding-top: 8px; }
.toc-nav a {
  display: block; font-size: 11.5px; line-height: 1.5; color: var(--muted);
  padding: 5px 0 5px 11px; border-left: 1px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.toc-nav a:hover { color: var(--text); }
.toc-nav a.is-active { color: var(--red-bright); border-left-color: var(--red); }

/* ---------- 正文 ---------- */
.article h2 { font-size: 22px; line-height: 1.35; margin: 30px 0 10px; scroll-margin-top: 92px; }
.article h2:first-child { margin-top: 6px; }
.article p { font-size: 14px; line-height: 1.95; color: var(--body); margin-bottom: 13px; }
.article p:last-child { margin-bottom: 0; }
.article strong { color: var(--text); font-weight: 600; }

/* ---------- 要点卡 ---------- */
.key-points {
  margin-top: 26px; background: var(--card); border: 1px solid var(--line);
  border-left: 2px solid var(--red); border-radius: var(--radius); padding: 13px 18px 15px;
}
.key-points h2 { font-size: 13px; letter-spacing: .06em; color: var(--text); margin: 0 0 6px; }
.key-points ul { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.key-points li { position: relative; padding: 4px 0 4px 12px; font-size: 11.5px; color: var(--muted); }
.key-points li::before {
  content: ""; position: absolute; left: 0; top: 11px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--red);
}

/* ---------- 相关条目 ---------- */
.related { padding: 30px 0 40px; border-top: 1px solid var(--line-soft); }
.related h2 { font-size: 20px; margin-bottom: 14px; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-card); }
.related-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 16px 15px;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.related-card:hover { border-color: rgba(224, 35, 31, .5); transform: translateY(-2px); }
.related-card h3 { font-size: 14px; }
.related-card p { font-size: 11.5px; line-height: 1.6; color: var(--muted); margin-top: 5px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: 176px minmax(0, 1fr); gap: 26px; }
}

@media (max-width: 900px) {
  .page-hero h1 { font-size: 34px; }
  .article-head h1 { font-size: 34px; }
  .article-layout { grid-template-columns: 1fr; gap: 0; }
  .toc {
    position: static; top: auto; border: 1px solid var(--line);
    border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px;
  }
  .toc-toggle { border-bottom: 0; padding-bottom: 0; }
  .toc-nav { padding-top: 10px; }
  .toc-nav a { padding-left: 0; border-left: 0; }
  .toc-nav a.is-active { border-left: 0; }
  .key-points ul { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .entry-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .page-hero h1, .article-head h1 { font-size: 28px; }
  .filter-count { margin-left: 0; width: 100%; }
  .article p { font-size: 13.5px; }
}

/* ---------------------------------------------------- 数据化补充（v1.1） */
/* 15 项导航在桌面端横向滚动，避免挤压页头 */
@media (min-width: 981px) {
  .header-inner { gap: 14px; }
  .site-nav { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { flex: none; }
}
@media (max-width: 980px) {
  .site-nav.is-open { max-height: calc(100vh - 62px); overflow-y: auto; }
}

/* 14 个分类：桌面 7 列两行 */
@media (min-width: 1241px) {
  .topic-grid { grid-template-columns: repeat(7, 1fr); }
}

/* 卡片两行截断 */
.topic-card h3,
.entry-body h3,
.latest-card h3,
.related-card h3 { word-break: break-word; }
.entry-body h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.entry-body p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 服务端分页 */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 30px 0 4px;
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--body);
  font-size: 12.5px;
  text-decoration: none;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.pager-btn:hover,
.pager-btn.is-active { border-color: var(--red-bright); color: var(--red-bright); }
.pager-gap { padding: 0 6px; color: var(--dim); }

/* 正文配图 */
.article .article-figure { margin: 20px 0 6px; }
.article .article-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  object-fit: cover;
}
