/* ==========================================================================
   inner.css — 分类页（category.html）与详情页（detail.html）布局
   复用 tokens.css / style.css 的页头页脚与色彩，只写内页专属区块。
   设计基准宽度 1440，内容栏与首页一致（--wrap 1376）。
   ========================================================================== */

/* ------------------------------------------------------------- 页首区 */
.page-hero {
  padding: 8px 0 26px;
  border-bottom: 1px solid var(--line);
}
.page-hero .breadcrumb { padding-top: 14px; }
.page-hero h1 {
  margin-top: 18px;
  font-size: 38px;
  line-height: 1.24;
  letter-spacing: -0.02em;
}
.page-hero-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.page-hero-lead {
  margin-top: 14px;
  max-width: 820px;
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink-body);
}

/* --------------------------------------------------------- 筛选工具条 */
.toolbar {
  position: sticky;
  top: var(--h-header);
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.toolbar-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 62px;
  padding-block: 8px;
  flex-wrap: wrap;
}
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-label {
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.toolbar-count {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.toolbar-count strong { color: var(--green); }
.sort-btn {
  padding: 5px 11px;
  font-size: 12px;
  font-family: inherit;
  color: var(--ink-body);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}
.sort-btn:hover { color: var(--green); background: var(--green-tint); }
.sort-btn[aria-pressed="true"] { color: var(--green); border-color: var(--green-soft); font-weight: 600; }

/* ------------------------------------------------------------ 卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 26px;
}
.entry-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.entry-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 10px 24px rgba(26, 34, 48, 0.08);
}
.entry-thumb {
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
  overflow: hidden;
}
.entry-thumb img { width: 100%; height: 100%; object-fit: cover; }
.entry-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.entry-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.entry-title { font-size: 17px; line-height: 1.4; }
.entry-summary {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-muted);
  flex: 1;
}
.entry-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-faint);
}
.entry-more { color: var(--green); font-weight: 600; }

/* -------------------------------------------------------- 列表说明区 */
.list-description {
  margin-top: 44px;
  padding: 32px 36px;
  background: var(--bg-soft);
  border-radius: var(--radius-card);
}
.list-description h2 { font-size: 22px; }
.list-description h3 {
  margin-top: 20px;
  font-size: 15.5px;
  color: var(--ink);
}
.list-description p {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-body);
  max-width: 1040px;
}

/* ---------------------------------------------------------- 交叉链接 */
.cross-links {
  margin-top: 40px;
  padding-bottom: 8px;
}
.cross-links h2 { font-size: 22px; }
.cross-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.cross-card {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  transition: border-color .16s ease, background .16s ease;
}
.cross-card:hover { border-color: var(--green-soft); background: var(--green-tint); }
.cross-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.cross-desc { margin-top: 4px; font-size: 12.5px; color: var(--ink-muted); line-height: 1.6; }

/* ============================================================== 详情页 */
.article-head {
  padding: 8px 0 24px;
  border-bottom: 1px solid var(--line);
}
.article-head .breadcrumb { padding-top: 14px; }
.article-head h1 {
  margin-top: 18px;
  max-width: 900px;
  font-size: 40px;
  line-height: 1.22;
  letter-spacing: -0.02em;
}
.article-meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 12px;
  color: var(--ink-faint);
}
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* 关键结论 */
.key-points {
  margin-top: 26px;
  padding: 20px 24px;
  background: var(--bg-panel);
  border-left: 3px solid var(--green-soft);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
}
.key-points-title {
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--green);
  text-transform: uppercase;
}
.key-points ul { margin-top: 10px; display: grid; gap: 7px; }
.key-points li {
  position: relative;
  padding-left: 16px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-body);
}
.key-points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green-mid);
}

/* 正文 + 目录两栏 */
.article-layout {
  margin-top: 30px;
  display: grid;
  grid-template-columns: minmax(0, 232px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding-bottom: 40px;
}
.toc {
  position: sticky;
  top: calc(var(--h-header) + 22px);
  padding: 16px 18px;
  background: var(--bg-soft);
  border-radius: var(--radius-card);
}
.toc-title {
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.toc ol { margin-top: 10px; display: grid; gap: 3px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: block;
  padding: 5px 0 5px 22px;
  position: relative;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-muted);
  transition: color .16s ease;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 5px;
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 10px;
  color: var(--ink-faint);
}
.toc a:hover, .toc a.is-active { color: var(--green); }
.toc a.is-active::before { color: var(--green); }

.article-body { max-width: 792px; }
.article-body .article-lede {
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--ink-body);
}
.article-body h2 {
  margin-top: 34px;
  padding-top: 4px;
  font-size: 24px;
  line-height: 1.4;
  scroll-margin-top: calc(var(--h-header) + 20px);
}
.article-body h2:first-of-type { margin-top: 26px; }
.article-body p {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.95;
  color: var(--ink-body);
}
.article-body a { color: var(--green); border-bottom: 1px solid var(--green-soft); }

/* 相关条目 */
.related {
  margin-top: 34px;
  padding: 26px 0 10px;
  border-top: 1px solid var(--line);
}
.related h2 { font-size: 20px; }
.related-list {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.related-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  transition: border-color .16s ease, background .16s ease;
}
.related-card:hover { border-color: var(--green-soft); background: var(--green-tint); }
.related-thumb {
  width: 72px;
  height: 56px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.related-desc { margin-top: 3px; font-size: 11.5px; line-height: 1.55; color: var(--ink-muted); }

/* ============================================================ 响应式 */
@media (max-width: 1240px) {
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .article-layout { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 32px; }
}

@media (max-width: 1024px) {
  .page-hero h1 { font-size: 32px; }
  .article-head h1 { font-size: 32px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cross-grid, .related-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
  .list-description { padding: 24px; }
}

@media (max-width: 720px) {
  .page-hero h1 { font-size: 26px; }
  .article-head h1 { font-size: 25px; }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .cross-grid, .related-list { grid-template-columns: minmax(0, 1fr); }
  .toolbar { position: static; }
  .toolbar-inner { gap: 10px; }
  .toolbar-count { margin-left: 0; width: 100%; }
  .article-body h2 { font-size: 20px; }
  .related-card { grid-template-columns: 64px minmax(0, 1fr); }
  .related-thumb { width: 64px; height: 52px; }
}

/* ================================================== 数据对接补充（v1.2） */
/* chips 计数徽标（列表页分类条） */
.chip-num {
  font-size: 10.5px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
}
.chip.is-active .chip-num { opacity: 0.85; }

/* 分页（列表页服务端分页） */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.pager a,
.pager-step,
.pager-current,
.pager-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--ink-body);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.pager a:hover { border-color: var(--green-soft); color: var(--green); }
.pager-current {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
  font-weight: 600;
}
.pager-gap { border-color: transparent; background: transparent; color: var(--ink-faint); }
.pager-info {
  margin-left: 8px;
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* 详情页正文配图 */
.article-body figure {
  margin: 26px 0;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--bg-soft);
}
.article-body figure img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}
.article-body figure figcaption {
  padding: 8px 12px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-muted);
}
.article-body p strong { color: var(--ink); }

/* 首页/内页占位图标（无图时的 emoji 位） */
.topic-emoji,
.pick-emoji,
.read-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 26px;
  line-height: 1;
  background: var(--bg-soft);
}
.topic-emoji { height: 106px; font-size: 34px; }

/* 季节卡片后的「查看全部」入口 */
.seasons-more {
  display: inline-block;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--green);
  border-bottom: 1px solid var(--green-soft);
}

@media (max-width: 720px) {
  .pager-info { margin-left: 0; width: 100%; text-align: center; }
  .pager a, .pager-step, .pager-current, .pager-gap { min-width: 30px; height: 30px; padding: 0 8px; font-size: 12px; }
  .article-body figure { margin: 20px 0; }
  .topic-emoji { height: 84px; font-size: 28px; }
}

