/* inner.css — 分类/列表页与详情页版式。只依赖 tokens.css 与 components.css，
   不重复首页的 hero / feature / fact 版式。 */

/* -------------------------------------------------------------- 页头区 */
.page-head { background: var(--paper-2); border-bottom: 1px solid var(--line); padding: 20px 0 34px; }
.page-head .breadcrumb { margin-bottom: 18px; }
.page-title {
  margin: 0 0 12px; font-family: var(--font-serif); font-weight: 700;
  font-size: var(--fs-2); line-height: 1.2; letter-spacing: 0.01em;
}
.page-lede { margin: 0; max-width: 880px; font-size: var(--fs-6); line-height: 1.85; color: var(--ink-soft); }

/* -------------------------------------------------------------- 筛选条 */
.toolbar-bar { position: sticky; top: var(--header-h); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.toolbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 0; min-height: 62px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  appearance: none; cursor: pointer; font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-9); line-height: 1.6; color: var(--ink-soft);
  background: transparent; border: 1px solid var(--line-2); border-radius: var(--radius-pill);
  padding: 6px 14px; transition: background .16s, color .16s, border-color .16s;
}
.chip:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--brand); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: var(--ink-invert); }
.sort { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: var(--fs-9); color: var(--muted); }
.sort select {
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; font-size: var(--fs-9); color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 6px 10px; cursor: pointer;
}
.count { font-size: var(--fs-9); color: var(--muted); min-width: 64px; text-align: right; }

/* -------------------------------------------------------------- 条目网格 */
.entries { padding: 40px 0 12px; }
.entry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 24px; }
.entry-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.entry-link { display: block; height: 100%; text-decoration: none; color: inherit; }
.entry-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow-hover); }
.entry-card .thumb { display: block; aspect-ratio: 16 / 10; }
.entry-card .tag { display: inline-block; margin: 4px 18px 0; }
.entry-title {
  margin: 8px 0 0; padding: 0 18px; font-family: var(--font-serif); font-weight: 700;
  font-size: var(--fs-5); line-height: 1.42; color: var(--brand-deep);
}
.entry-summary {
  margin: 8px 0 18px; padding: 0 18px; font-size: var(--fs-8); line-height: 1.75; color: var(--muted);
}
.entry-card[hidden] { display: none; }
.empty {
  margin: 12px 0 0; padding: 28px; text-align: center;
  background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius);
  color: var(--muted); font-size: var(--fs-8);
}

/* -------------------------------------------------------------- 分类说明 */
.list-description { background: var(--paper-2); border-top: 1px solid var(--line); margin-top: 34px; padding: 44px 0 50px; }
.list-description .wrap { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: start; }
.desc-title {
  margin: 0; padding-left: 16px; position: relative;
  font-family: var(--font-serif); font-weight: 700; font-size: var(--fs-4); line-height: 1.3;
}
.desc-title::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; background: var(--accent); border-radius: 2px; }
.desc-body { font-size: var(--fs-6); line-height: 1.95; color: var(--ink-soft); max-width: 900px; }
.desc-body p { margin: 0; }

/* -------------------------------------------------------------- 其他分类 */
.related { padding: 34px 0 46px; background: var(--paper); }
.related h2, .related-entries h2 { margin: 0 0 14px; font-family: var(--font-serif); font-size: var(--fs-4); font-weight: 700; }
.related-list { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: baseline; }
.related-list a {
  font-size: var(--fs-8); color: var(--ink-soft); text-decoration: none;
  padding-bottom: 2px; border-bottom: 1px solid transparent;
}
.related-list a:hover { color: var(--accent-deep); border-bottom-color: var(--line-2); }
.related-back { margin: 18px 0 0; font-size: var(--fs-9); }
.related-back a { color: var(--muted); text-decoration: none; }
.related-back a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }

/* -------------------------------------------------------------- 详情头 */
.article-wrap { background: var(--paper); padding: 22px 0 56px; }
.article-head { border-bottom: 1px solid var(--line); padding-bottom: 26px; margin-bottom: 30px; }
.article-head .breadcrumb { margin-bottom: 20px; }
.article-title {
  margin: 10px 0 14px; font-family: var(--font-serif); font-weight: 700;
  font-size: var(--fs-3); line-height: 1.28; letter-spacing: 0.01em; max-width: 900px;
}
.article-lede { margin: 0 0 18px; max-width: 820px; font-size: var(--fs-6); line-height: 1.85; color: var(--ink-soft); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-9); color: var(--muted); }
.meta-label { color: var(--accent-deep); font-weight: 600; }

/* -------------------------------------------------------------- 正文 + 目录 */
.article-layout {
  display: grid; grid-template-columns: minmax(0, 780px) 260px;
  gap: 60px; align-items: start;
}
.article-layout .article { grid-column: 1; grid-row: 1; }
.article-layout .toc { grid-column: 2; grid-row: 1; }
.article {
  font-size: var(--fs-6); line-height: 1.95; color: var(--ink);
}
.article h2 {
  margin: 40px 0 12px; font-family: var(--font-serif); font-weight: 700;
  font-size: var(--fs-4); line-height: 1.35; scroll-margin-top: calc(var(--header-h) + 24px);
}
.article h2:first-of-type { margin-top: 8px; }
.article p { margin: 0 0 16px; }
.article figure { margin: 26px 0 8px; }
.article figure img { width: 100%; height: auto; max-height: 420px; object-fit: cover; border-radius: var(--radius); }
.article figcaption { margin-top: 8px; font-size: var(--fs-9); color: var(--muted); }

.toc { position: sticky; top: calc(var(--header-h) + 24px); }
.toc h2 {
  margin: 0 0 12px; padding-left: 12px; position: relative;
  font-family: var(--font-serif); font-size: var(--fs-7); font-weight: 700;
}
.toc h2::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 3px; background: var(--accent); border-radius: 2px; }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc li + li { margin-top: 2px; }
.toc a {
  display: block; padding: 7px 10px 7px 30px; position: relative;
  font-size: var(--fs-9); line-height: 1.6; color: var(--ink-soft); text-decoration: none;
  border-radius: 6px; border-left: 1px solid var(--line);
}
.toc a::before {
  content: counter(toc, decimal-leading-zero); position: absolute; left: 10px;
  color: var(--line-2); font-size: var(--fs-10);
}
.toc a:hover { color: var(--accent-deep); background: var(--surface); }
.toc a.is-active { color: var(--brand); background: var(--surface); border-left-color: var(--accent); font-weight: 600; }

/* -------------------------------------------------------------- 提示卡 */
.risk-note {
  margin: 0 0 26px; padding: 18px 22px 18px 24px;
  background: var(--paper-3); border-left: 4px solid var(--danger); border-radius: 0 var(--radius) var(--radius) 0;
}
.risk-note h2 {
  margin: 0 0 6px; font-family: var(--font-serif); font-weight: 700;
  font-size: var(--fs-7); color: var(--danger); scroll-margin-top: calc(var(--header-h) + 24px);
}
.risk-note p { margin: 0; font-size: var(--fs-8); line-height: 1.85; color: var(--ink-emergency); }

/* -------------------------------------------------------------- 相关条目 */
.related-entries { border-top: 1px solid var(--line); margin-top: 46px; padding: 34px 0 56px; background: var(--paper-2); }
.related-entries .related-list a { font-size: var(--fs-7); }

/* -------------------------------------------------------------- 响应式 */
@media (max-width: 1180px) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 232px; gap: 36px; }
  .entry-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .page-head { padding: 14px 0 26px; }
  .page-title { font-size: 32px; }
  .toolbar { gap: 10px; padding: 10px 0; }
  .sort { margin-left: 0; }
  .article-layout { grid-template-columns: 1fr; gap: 20px; }
  .article-layout .article { grid-column: 1; grid-row: 2; }
  .article-layout .toc { grid-column: 1; grid-row: 1; position: static; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
  .toc ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; }
  .toc a { padding: 6px 8px 6px 28px; border-left: 0; }
  .list-description .wrap { grid-template-columns: 1fr; gap: 12px; }
  .article-title { font-size: 28px; }
}
@media (max-width: 620px) {
  .page-title { font-size: 27px; }
  .entry-grid { grid-template-columns: 1fr; gap: 20px; }
  .chip { padding: 6px 11px; }
  .toc ol { grid-template-columns: 1fr; }
  .article { font-size: 16px; }
  .article h2 { font-size: 21px; margin-top: 32px; }
  .entries { padding-top: 26px; }
  .list-description { padding: 32px 0 38px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------- 数据化补充（v1.1） */
/* 13 项导航在桌面端横向滚动，避免挤压页头 */
@media (min-width: 901px) {
  .site-header .wrap { gap: 16px; }
  .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: 900px) {
  .site-nav.is-open { max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
}

/* 12 个分类：桌面 6 列两行 */
@media (min-width: 1181px) {
  .cat-grid { grid-template-columns: repeat(6, 1fr); }
}

/* 卡片两行截断，保证等高 */
.cat-name, .entry-title, .feature-title { word-break: break-word; }
.cat-desc,
.entry-title,
.entry-summary {
  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(--surface);
  color: var(--ink-soft);
  font-size: var(--fs-8);
  text-decoration: none;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.pager-btn:hover,
.pager-btn.is-active { border-color: var(--accent); background: var(--brand); color: var(--ink-invert); }
.pager-gap { padding: 0 6px; color: var(--muted); }

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