/* components.css — 内页专用组件（颜色/字号/圆角一律 var(--…)，复用 tokens.css）

   首页已有的 .site-header / .site-footer / .container / .btn / .kicker 直接复用。
   本文件只放分类页与详情页新增的区块，避免把 hero / 分类卡等首页专用样式带进内页。
*/

/* ---------- 面包屑 ---------- */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.crumb a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: #c7dcea;
  text-underline-offset: 3px;
}

.crumb a:hover { color: var(--accent); }

.crumb .sep {
  color: #b4c8d6;
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 10px;
}

.crumb [aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- 分类页标题区 ---------- */
.page-hero {
  padding: 26px 0 22px;
  background:
    radial-gradient(900px 260px at 88% 0%, rgba(47, 138, 201, .12), transparent 70%),
    linear-gradient(180deg, #eaf3fa 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}

.page-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
  gap: 40px;
  align-items: end;
}

.hero-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--pill);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
}

.page-hero h1 {
  margin-top: 10px;
  color: var(--ink);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -.03em;
}

.page-hero .lead {
  margin-top: 10px;
  max-width: 640px;
  color: var(--body);
  font-size: 13.5px;
  line-height: 1.8;
}

.page-index {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .72);
  padding: 12px 14px;
}

.page-index p {
  color: var(--muted);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}

.page-index ol {
  margin-top: 7px;
  display: grid;
  gap: 4px;
}

.page-index a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--body);
  font-size: 12px;
  line-height: 1.6;
}

.page-index a:hover { color: var(--accent); }

.page-index .num {
  color: var(--faint);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 10px;
}

.page-index a[aria-current="true"] {
  color: var(--accent-deep);
  font-weight: 700;
}

.page-index a[aria-current="true"] .num { color: var(--accent); }

/* ---------- 筛选与排序 ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-label {
  color: var(--muted);
  font-size: 11.5px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--body);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.chip:hover { border-color: #b9d8ec; color: var(--accent-deep); }

.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--ink-invert);
}

.filter-sort label { cursor: pointer; }

.filter-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11.5px;
}

.filter-sort select {
  min-height: 34px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}

.result-count {
  color: var(--faint);
  font-size: 11px;
  white-space: nowrap;
}

/* ---------- 列表卡片 ---------- */
.list-section { padding: 22px 0 26px; }

.list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.list-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 178px;
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}

.list-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--accent), #8fd0f5);
}

.list-card:hover,
.list-card:focus-visible {
  transform: translateY(-3px);
  border-color: #b9d8ec;
}

.list-card[hidden] { display: none; }

.card-link { color: inherit; }

.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.list-card:focus-within {
  outline: 2px solid #7cc4f0;
  outline-offset: 2px;
}

.list-card .card-tag {
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: var(--pill);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: 600;
}

.list-card h3 {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  font-weight: 700;
}

.list-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.list-card .card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  color: var(--faint);
  font-size: 10.5px;
}

.list-card .card-arrow {
  color: var(--accent);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 14px;
  transition: transform .18s ease;
}

.list-card:hover .card-arrow { transform: translateX(3px); }

.list-card.is-note {
  border-style: dashed;
  background: #f7fbfe;
  box-shadow: none;
}

.list-card.is-note::before { background: #cfe4f2; }

.empty-state {
  display: none;
  padding: 22px;
  border: 1px dashed #c7dcea;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.empty-state.is-visible { display: block; }

/* ---------- 列表说明 ---------- */
.list-seo {
  padding: 26px 0 30px;
  background: linear-gradient(180deg, #eef4f9 0%, var(--bg) 100%);
  border-block: 1px solid #e3edf5;
}

.list-seo-inner {
  max-width: 900px;
}

.list-seo h2 {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.3;
  font-weight: 800;
}

.list-seo p {
  margin-top: 10px;
  color: var(--body);
  font-size: 13.5px;
  line-height: 1.9;
}

.list-seo a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-color: #b9d8ec;
  text-underline-offset: 3px;
}

.list-seo a:hover { color: var(--accent); }

.seo-links {
  margin-top: 12px;
  color: var(--faint);
  font-size: 11.5px;
}

.seo-links a {
  color: var(--accent-deep);
  font-weight: 600;
}

/* ---------- 其他分类 ---------- */
.related-cats {
  padding: 22px 0 26px;
}

.related-cats h2 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
}

.related-cats ul {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.related-cats a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color .18s ease, transform .18s ease;
}

.related-cats a:hover {
  border-color: #b9d8ec;
  transform: translateY(-2px);
}

.related-cats .num {
  color: var(--accent);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 10px;
  font-weight: 700;
}

.related-cats .name {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}

.related-cats .desc {
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.45;
}

/* ---------- 详情页 ---------- */
.article-hero {
  padding: 22px 0 18px;
  background: linear-gradient(180deg, #eaf3fa 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}

.article-head-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr);
  gap: 38px;
  align-items: start;
}
.article-head-grid.no-media { grid-template-columns: minmax(0, 1fr); }
.article-head-grid.no-media .article-head { max-width: 900px; }

.article-cat {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--pill);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
}

.article-head h1 {
  margin-top: 10px;
  color: var(--ink);
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -.03em;
}

.article-head .lead {
  margin-top: 10px;
  max-width: 700px;
  color: var(--body);
  font-size: 14px;
  line-height: 1.8;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  color: var(--faint);
  font-size: 11px;
}

.article-meta .tag {
  padding: 2px 9px;
  border-radius: var(--pill);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
}

.article-thumb {
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  background: #d7e6f0;
}

.article-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.article-wrap { padding: 24px 0 28px; }

.article-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.article-toc {
  position: sticky;
  top: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.article-toc p {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.article-toc ol {
  margin-top: 8px;
  display: grid;
  gap: 3px;
  counter-reset: toc;
}

.article-toc li { counter-increment: toc; }

.article-toc a {
  display: block;
  padding: 5px 7px;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.article-toc a::before {
  content: counter(toc, decimal-leading-zero) " ";
  color: var(--faint);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 9.5px;
}

.article-toc a:hover,
.article-toc a.is-active {
  border-left-color: var(--accent);
  background: #f1f8fd;
  color: var(--accent-deep);
}

.article-body {
  max-width: 760px;
  color: var(--body);
  font-size: 14.5px;
  line-height: 1.95;
}

.article-body section {
  scroll-margin-top: 0;
}

.article-body section + section {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid #e7eff6;
}

.article-body h2 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -.02em;
}

.article-body p { margin-top: 8px; }

.article-body a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-color: #b9d8ec;
  text-underline-offset: 3px;
}

.keyfact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}

.keyfact div {
  padding: 10px 12px;
  border: 1px solid #d3e7f4;
  border-radius: 10px;
  background: #f4fafe;
}

.keyfact dt {
  color: var(--accent-deep);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.keyfact dd {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.related-posts {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e7eff6;
}

.related-posts h2 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
}

.related-posts ul {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.related-posts a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.5;
  transition: border-color .18s ease, transform .18s ease;
}

.related-posts a::after {
  content: "→";
  color: var(--accent);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
}

.related-posts a:hover {
  border-color: #b9d8ec;
  transform: translateX(2px);
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .page-hero-grid,
  .article-head-grid { grid-template-columns: 1fr; gap: 18px; }
  .page-index { max-width: 520px; }
  .list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .related-cats ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: 1fr; gap: 18px; }
  .article-toc { position: static; }
  .article-toc ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    display: grid;
  }
}

@media (max-width: 640px) {
  .page-hero { padding: 20px 0 18px; }
  .filter-bar { align-items: flex-start; }
  .filter-chips { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; padding-bottom: 2px; }
  .chip { flex: none; }
  .list-grid { grid-template-columns: 1fr; }
  .related-cats ul { grid-template-columns: 1fr 1fr; }
  .article-cat {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--pill);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
}

.article-head h1 { font-size: 27px; }
  .article-body { font-size: 14px; line-height: 1.9; }
  .keyfact { grid-template-columns: 1fr; }
  .article-toc ol { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------- 首页分类内容模块 */
.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-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: 16px; }
.module-grid .list-card { min-height: 0; }
.module-grid .list-card h3 { font-size: 15px; }

/* 列表卡片缩略图 */
.card-thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #e8f2f9; border-radius: 8px; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.entry-emoji { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 36px; background: #e8f2f9; }

/* ------------------------------------------------------------ 正文配图 */
.article-body .article-figure { margin: 18px 0 8px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #e8f2f9; }
.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); border-radius: 8px; font-size: 12.5px; color: var(--body); text-decoration: none; }
.pager a:hover { border-color: var(--accent); color: var(--accent-deep); }
.pager a.is-active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pager .pager-gap { border-color: transparent; }

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