/* components.css — 内页组件（分类页 / 详情页）
   颜色、字号、圆角一律使用 tokens.css 的变量；首页组件（header/footer/btn/tag）直接复用 style.css。 */

/* ---------- 面包屑 ---------- */
.crumb { padding: 22px 0 0; }
.crumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted-2); }
.crumb li + li::before { content: "/"; margin-right: 8px; color: var(--line-strong); }
.crumb a { color: var(--muted); }
.crumb a:hover { color: #fff; }
.crumb [aria-current="page"] { color: #cfdcf0; }

/* ---------- 列表页 hero ---------- */
.page-hero {
  background:
    radial-gradient(80% 120% at 85% 0%, rgba(47, 124, 246, .2), transparent 60%),
    linear-gradient(180deg, #0a1330 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.page-hero .container { padding-bottom: 34px; }
.page-hero h1 { font-size: 48px; letter-spacing: -.02em; margin: 18px 0 8px; }
.page-hero-sub { font-size: 20px; color: #a9c3e6; }
.page-hero-lede { max-width: 780px; margin-top: 14px; font-size: 15.5px; line-height: 1.9; color: var(--muted); }
.stat-row { display: flex; flex-wrap: wrap; gap: 34px; margin-top: 22px; }
.stat-row li { display: flex; align-items: baseline; gap: 7px; font-size: 12.5px; color: var(--muted-2); }
.stat-row strong { font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; font-size: 20px; font-weight: 700; color: var(--brand); }

/* ---------- 工具栏 ---------- */
.list-toolbar { background: #0c1835; border-bottom: 1px solid var(--line); }
.toolbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 0; }
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.chip:hover { color: #fff; border-color: var(--line-strong); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.sort-group { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.sort-select {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0a1730;
  color: #dbe6f7;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* ---------- 列表卡片 ---------- */
.list-main { padding: 26px 0 40px; }
.list-status { font-size: 12.5px; color: var(--muted-2); margin-bottom: 14px; }
.list-status strong { color: #dce8f8; font-weight: 600; }
.post-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .18s ease, transform .18s ease;
}
.post-card:hover, .post-card:focus-within { border-color: var(--line-strong); transform: translateY(-2px); }
.post-link { display: flex; flex-direction: column; height: 100%; }
.post-thumb { display: block; aspect-ratio: 16 / 7.4; overflow: hidden; background: #0a1730; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.post-card:hover .post-thumb img { transform: scale(1.03); }
.post-body { display: flex; flex-direction: column; flex: 1; padding: 13px 17px 15px; }
.post-body .tag { align-self: flex-start; margin-bottom: 6px; }
.post-title { font-size: 16.5px; font-weight: 700; line-height: 1.45; color: var(--ink); }
.post-summary { margin-top: 6px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.post-meta { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 11px; font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; font-size: 11.5px; color: var(--muted-2); }
.post-meta .dot { color: var(--line-strong); }
.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 42px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state p { margin-bottom: 14px; font-size: 14px; }

/* ---------- 列表说明 ---------- */
.list-desc { background: var(--bg-deep); border-top: 1px solid var(--line); }
.list-desc .container { padding: 40px 0 44px; }
.list-desc h2 { font-size: 24px; margin-bottom: 14px; }
.list-desc p { max-width: 780px; font-size: 14.5px; line-height: 1.95; color: #b3c2da; }
.list-desc p + p { margin-top: 12px; }

/* ---------- 相关分类 ---------- */
.cross-links { background: #0c1835; border-top: 1px solid var(--line); }
.cross-links .container { padding: 26px 0 32px; }
.cross-links h2 { font-size: 18px; margin-bottom: 14px; }
.cross-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cross-card {
  display: block;
  padding: 15px 17px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .18s ease, transform .18s ease;
}
.cross-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.cross-card strong { display: block; font-size: 15px; margin-bottom: 4px; }
.cross-card span { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* ---------- 详情页 ---------- */
.article-head { max-width: 860px; padding: 34px 0 26px; }
.article-head .tag { display: inline-block; }
.article-head h1 { font-size: 44px; line-height: 1.25; letter-spacing: -.02em; margin: 10px 0 14px; }
.article-lede { font-size: 17px; line-height: 1.85; color: #bdcbe0; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 18px; font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; font-size: 12px; color: var(--muted-2); }
.article-meta .dot { color: var(--line-strong); }
.article-note { margin-top: 14px; padding: 10px 14px; border-left: 2px solid var(--brand); background: rgba(47, 124, 246, .07); font-size: 12.5px; color: var(--muted); }

.article-layout { display: grid; grid-template-columns: minmax(0, 760px) 232px; gap: 56px; justify-content: space-between; padding-bottom: 52px; }
.article-toc {
  align-self: start;
  position: sticky;
  top: 76px;
  border-left: 1px solid var(--line);
  padding-left: 18px;
}
.article-toc h2 { font-size: 13px; letter-spacing: .12em; color: var(--muted-2); margin-bottom: 10px; }
.toc-toggle { display: none; cursor: pointer; }
.article-toc ol { display: grid; gap: 7px; counter-reset: toc; }
.article-toc a {
  display: block;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  padding: 2px 0 2px 4px;
  border-left: 2px solid transparent;
  margin-left: -20px;
  padding-left: 18px;
  transition: color .15s ease, border-color .15s ease;
}
.article-toc a:hover { color: #fff; }
.article-toc a.is-active { color: #fff; border-left-color: var(--brand); }

.article { max-width: 760px; }
.article-intro { font-size: 17px; line-height: 1.95; color: #c6d3e6; padding-bottom: 6px; }
.article-body section { margin-top: 34px; }
.article-body h2 {
  font-size: 27px;
  letter-spacing: -.01em;
  margin-bottom: 12px;
  padding-left: 14px;
  border-left: 3px solid var(--brand);
}
.article-body p { font-size: 15.5px; line-height: 1.95; color: #b8c6dc; }
.article-body p + p { margin-top: 12px; }

.related { background: #0c1835; border-top: 1px solid var(--line); }
.related .container { padding: 30px 0 38px; }
.related h2 { font-size: 20px; margin-bottom: 16px; }
.related h2 a { color: var(--brand); }
.related h2 a:hover { text-decoration: underline; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.related-card {
  display: block;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .18s ease, transform .18s ease;
}
.related-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.related-card strong { display: block; font-size: 15.5px; line-height: 1.45; margin-bottom: 5px; }
.related-card span { font-size: 12.5px; line-height: 1.65; color: var(--muted); }

/* ---------- 缩略图占位 / 正文配图 ---------- */
.post-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 40px;
  background: radial-gradient(120% 120% at 50% 20%, rgba(47, 124, 246, .18), #0a1730 70%);
}
.article-body .article-figure {
  margin: 20px 0 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a1730;
}
.article-body .article-figure img { display: block; width: 100%; height: auto; }

/* ---------- 分页 ---------- */
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 28px; }
.pager a, .pager .pager-gap {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--muted);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.pager a:hover { color: #fff; border-color: var(--line-strong); }
.pager a.is-active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager .pager-gap { border-color: transparent; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .article-toc { order: -1; position: static; border-left: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; margin-bottom: 24px; }
  .article-toc h2 { margin-bottom: 8px; }
  .toc-toggle { display: block; position: absolute; right: 0; top: 10px; width: 34px; height: 30px; border: 1px solid var(--line); border-radius: 6px; }
  .toc-toggle::before { content: "＋"; color: var(--muted); }
  .article-toc.is-open .toc-toggle::before { content: "－"; }
  .article-toc { position: relative; }
  .article-toc ol { display: none; }
  .article-toc.is-open ol { display: grid; }
  .article-toc a { margin-left: 0; padding-left: 0; border-left: 0; }
}

@media (max-width: 980px) {
  .page-hero h1 { font-size: 40px; }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cross-grid, .related-grid { grid-template-columns: 1fr; }
  .toolbar-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 640px) {
  .page-hero h1 { font-size: 32px; }
  .page-hero-sub { font-size: 16px; }
  .page-hero-lede { font-size: 14.5px; }
  .stat-row { gap: 20px; margin-top: 18px; }
  .post-grid { grid-template-columns: 1fr; }
  .article-head h1 { font-size: 30px; }
  .article-lede { font-size: 15px; }
  .article-intro { font-size: 15.5px; }
  .article-body h2 { font-size: 22px; }
  .article-body p { font-size: 15px; }
  .crumb { padding-top: 16px; }
  .list-main { padding-top: 20px; }
}
