/* components.css — 三页共用的组件与内页组件。
   首页专用布局在 style.css；这里只放跨页复用与列表/详情需要的组件。 */

/* ------------------------------------------------------ 首页卡片链接 */
.entry-link { display: block; color: inherit; text-decoration: none; }
.entry-link:hover h3 { color: var(--accent-deep); }

/* ------------------------------------------------------------ 面包屑 */
.crumb { padding: 16px 0 6px; }
.crumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.crumb li { font-size: 12px; color: var(--muted); }
.crumb a { color: var(--ink-soft); text-decoration: none; }
.crumb a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.crumb .sep { color: var(--line-strong); }
.crumb [aria-current="page"] { color: var(--brand); font-weight: 600; }

/* ------------------------------------------------------------ 列表页头 */
.page-head { padding: 8px 0 18px; border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 0 0 8px; font-size: 40px; line-height: 1.2; font-weight: 700; letter-spacing: 0.01em; }
.page-lead { max-width: 760px; font-size: 14px; line-height: 1.8; color: var(--ink-soft); }
.page-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.page-stats li {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 5px 13px; background: var(--paper-2); border-radius: var(--r-pill);
  font-size: 11.5px; color: var(--ink-soft);
}
.page-stats b { font-family: var(--font-serif); font-size: 16px; color: var(--accent-deep); }

/* ---------------------------------------------------------- 筛选与排序 */
.toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.toolbar-count { font-size: 12px; color: var(--ink-soft); }
.toolbar-count b { color: var(--accent-deep); font-size: 14px; }
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filters-label { font-size: 11.5px; color: var(--muted); letter-spacing: 0.06em; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: transparent; color: var(--ink-soft);
  font-family: inherit; font-size: 12px; line-height: 1;
  white-space: nowrap; text-decoration: none; cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent-deep); }
.chip[aria-pressed="true"] {
  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: 12px; color: var(--ink-soft); cursor: pointer; }
.sort select {
  height: 30px; padding: 0 8px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--paper-card);
  color: var(--ink); font-family: inherit; font-size: 12px; cursor: pointer;
}
.list-intro { margin: 14px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.empty-state { margin: 24px 0; padding: 22px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--r-1); color: var(--ink-soft); font-size: 13px; }

/* ------------------------------------------------------------ 列表网格 */
.list-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 18px 0 0; }
.list-card {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--r-1);
  overflow: hidden; transition: border-color .2s ease, background .2s ease;
}
.list-card:hover { border-color: var(--accent); background: var(--paper-2); }
.list-card > a { display: block; color: inherit; text-decoration: none; }
.list-card .thumb { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.list-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-body { display: block; padding: 14px 16px 16px; }
.list-tag {
  display: inline-block; margin-bottom: 6px;
  font-size: 10.5px; letter-spacing: 0.04em; color: var(--accent-deep);
}
.list-card h2 { margin: 0 0 6px; font-size: 16.5px; line-height: 1.42; font-weight: 700; }
.list-card p { margin: 0; font-size: 12.3px; line-height: 1.75; color: var(--ink-soft); }
.list-type { display: block; margin-top: 9px; font-size: 10.5px; color: var(--muted); }

/* ------------------------------------------------------------ 列表说明 */
.list-description { display: grid; grid-template-columns: 220px 1fr; gap: 34px; padding: 30px 0 44px; border-top: 1px solid var(--line); margin-top: 30px; }
.list-description h2 { margin: 0; font-size: 22px; line-height: 1.4; font-weight: 700; }
.list-description p { margin: 0 0 12px; font-size: 12.8px; line-height: 1.95; color: var(--ink-soft); }
.list-description .desc-body { max-width: 880px; }

/* ------------------------------------------------------------ 文章页 */
.article-head { padding: 6px 0 18px; border-bottom: 1px solid var(--line); }
.article-head h1 { margin: 0 0 10px; max-width: 900px; font-size: 42px; line-height: 1.24; font-weight: 700; letter-spacing: 0.01em; }
.article-head .lede { max-width: 800px; font-size: 14.5px; line-height: 1.85; color: var(--ink-soft); }
.article-meta { margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.article-layout { display: grid; grid-template-columns: minmax(0, 740px) 260px; gap: 56px; justify-content: center; padding: 26px 0 10px; align-items: start; }
.article-body { max-width: 740px; }
.article-body h2 {
  margin: 34px 0 12px; font-size: 23px; line-height: 1.4; font-weight: 700;
  scroll-margin-top: 24px; display: flex; align-items: baseline; gap: 10px;
}
.article-body h2 .no {
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; font-size: 12px; font-weight: 600;
  color: var(--accent); letter-spacing: 0.08em;
}
.article-body h2:first-of-type { margin-top: 10px; }
.article-body p { margin: 0 0 14px; font-size: 15px; line-height: 1.95; color: var(--ink); }
.article-figure { margin: 0 0 22px; }
.article-figure img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: var(--r-1); }
.article-figure figcaption { margin-top: 8px; font-size: 11.5px; line-height: 1.7; color: var(--muted); }
.callout {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 26px 0 0; padding: 16px 18px;
  background: var(--paper-3); border-left: 3px solid var(--danger); border-radius: 0 var(--r-1) var(--r-1) 0;
}
.callout svg { width: 22px; height: 22px; flex: 0 0 auto; color: var(--danger); margin-top: 2px; }
.callout p { margin: 0; font-size: 12.8px; line-height: 1.8; color: var(--ink-soft); }
.callout b { color: var(--ink); }

.toc { position: sticky; top: 20px; background: var(--paper-2); border-radius: var(--r-2); padding: 18px 18px 16px; }
.toc h2 { margin: 0 0 10px; font-size: 15px; letter-spacing: 0.04em; font-weight: 700; }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc li::before {
  content: counter(toc, decimal-leading-zero);
  font-size: 10px; color: var(--accent); margin-right: 7px;
}
.toc a {
  display: inline-block; padding: 3px 0;
  font-size: 12px; line-height: 1.6; color: var(--ink-soft); text-decoration: none;
}
.toc a:hover, .toc a.is-current { color: var(--accent-deep); font-weight: 600; }
.toc-extra { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line-strong); font-size: 11px; line-height: 1.75; color: var(--muted); }

/* ------------------------------------------------------------ 相关推荐 */
.related { border-top: 1px solid var(--line); margin-top: 30px; padding: 26px 0 44px; }
.related h2 { margin: 0 0 14px; font-size: 22px; font-weight: 700; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.related-card {
  display: block; padding: 16px 18px;
  background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--r-1);
  color: inherit; text-decoration: none;
}
.related-card:hover { border-color: var(--accent); background: var(--paper-2); }
.related-tag { display: block; font-size: 10.5px; color: var(--accent-deep); margin-bottom: 6px; }
.related-card h3 { margin: 0 0 5px; font-size: 15px; line-height: 1.45; font-weight: 700; }
.related-card p { margin: 0; font-size: 11.8px; line-height: 1.7; color: var(--ink-soft); }

/* ------------------------------------------------------------ 响应式 */
@media (max-width: 1180px) {
  .list-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; gap: 24px; }
  .article-body { grid-row: 2; }
  .toc { position: static; grid-row: 1; }
  .toc ol { columns: 2; column-gap: 24px; }
}
@media (max-width: 900px) {
  .page-head h1 { font-size: 32px; }
  .article-head h1 { font-size: 30px; }
  .list-description { grid-template-columns: 1fr; gap: 12px; }
  .related-grid { grid-template-columns: 1fr; }
  .sort { margin-left: 0; }
}
@media (max-width: 620px) {
  .list-grid { grid-template-columns: 1fr; }
  .article-head h1 { font-size: 26px; }
  .article-body p { font-size: 14.5px; }
  .toc ol { columns: 1; }
  .chip { height: 34px; }
}

/* ------------------------------------------------------- 小标题与工具条 */
.page-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 7px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent-deep);
}
.page-kicker::before { content: ""; width: 18px; height: 1px; background: var(--accent); }
.toolbar-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent-deep);
}
.article-intro {
  margin: 0 0 20px !important;
  padding-left: 12px;
  border-left: 2px solid var(--line-strong);
  font-size: 12.8px !important;
  line-height: 1.8 !important;
  color: var(--muted) !important;
}

/* ---------------------------------------------------- 首页分类内容模块 */
.home-modules { padding: 26px 0 8px; }
.module-block { margin-bottom: 30px; }
.module-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.module-head h2 { margin: 0; font-family: var(--font-serif); font-size: 24px; font-weight: 700; color: var(--ink); }
.module-head-meta { display: flex; align-items: baseline; gap: 14px; font-size: 12px; color: var(--muted); }
.module-head-meta .more { color: var(--accent-deep); text-decoration: none; }
.module-head-meta .more:hover { text-decoration: underline; text-underline-offset: 3px; }
.module-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.module-grid .list-card h2 { font-size: 15px; }

/* ------------------------------------------------------------ 缩略图占位 */
.list-emoji {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: 38px;
  background: var(--paper-2, #eef0e4);
}

/* ------------------------------------------------------------ 正文配图 */
.article-body .article-figure { margin: 18px 0 6px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--paper-2, #eef0e4); }
.article-body .article-figure img { display: block; width: 100%; height: auto; }

/* ---------------------------------------------------------------- 分页 */
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 7px; margin: 26px 0 8px; }
.pager a, .pager .pager-gap {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 32px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  font-size: 12.5px; color: var(--ink-soft); text-decoration: none;
}
.pager a:hover { border-color: var(--accent); color: var(--accent-deep); }
.pager a.is-active { background: var(--brand); border-color: var(--brand); color: var(--ink-invert); font-weight: 600; }
.pager .pager-gap { border-color: transparent; }

@media (max-width: 1180px) {
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .module-grid { grid-template-columns: 1fr; }
  .module-head h2 { font-size: 20px; }
}
