/* components.css — 内页专用组件（列表页 / 详情页）。
   颜色、字号、圆角、阴影一律取自 tokens.css，不新增字面量。 */

/* ── 面包屑 ─────────────────────────────────────────────── */
.crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--fs-2);
  color: var(--muted);
}
.crumb a { text-decoration: none; color: var(--ink-3); }
.crumb a:hover { color: var(--accent); }
.crumb .sep::before { content: "/"; color: var(--line); }
.crumb [aria-current="page"] { color: var(--accent); }

/* ── 列表页标题区 ───────────────────────────────────────── */
.list-head { padding: 36px 0 24px; }
.list-head h1 {
  margin-top: 18px;
  font-family: var(--font-serif);
  font-size: var(--fs-10);
  line-height: 1.2;
  font-weight: 700;
  color: var(--ink);
}
.list-count {
  margin-top: 10px;
  font-size: var(--fs-3);
  color: var(--accent);
  font-weight: 600;
}
.list-lead {
  margin-top: 8px;
  max-width: 820px;
  font-size: var(--fs-4);
  line-height: 1.85;
  color: var(--ink-3);
}

/* ── 筛选与排序 ─────────────────────────────────────────── */
.filters {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.filters-inner { padding-top: 14px; padding-bottom: 14px; }
.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.filter-row + .filter-row { margin-top: 10px; }
.filter-label {
  font-family: var(--font-serif);
  font-size: var(--fs-3);
  font-weight: 700;
  color: var(--ink);
}
.filter-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 34px;
  padding: 5px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--ink-3);
  font-size: var(--fs-2);
  cursor: pointer;
  transition: background var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.sort-label { margin-left: 10px; font-size: var(--fs-2); color: var(--ink-3); cursor: pointer; }
.select-wrap { position: relative; display: inline-flex; align-items: center; }
.sort-select {
  min-height: 34px;
  padding: 4px 32px 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-2);
  appearance: none;
  cursor: pointer;
}
.select-wrap svg {
  position: absolute;
  right: 11px;
  width: 11px;
  height: 7px;
  color: var(--muted);
  pointer-events: none;
}
.filter-count {
  margin-left: auto;
  font-size: var(--fs-2);
  color: var(--muted);
  white-space: nowrap;
}

/* ── 列表网格与卡片 ─────────────────────────────────────── */
.list-section { padding: 26px 0 0; }
.list-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
}
.list-bar h2 {
  font-family: var(--font-serif);
  font-size: var(--fs-8);
  font-weight: 700;
  color: var(--ink);
}
.list-bar p { font-size: var(--fs-2); color: var(--muted); }
.list-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.list-card {
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--dur) ease, box-shadow var(--dur) ease, transform var(--dur) ease;
}
.list-card:hover { border-color: var(--accent); box-shadow: var(--shadow-card); transform: translateY(-2px); }
.list-card-link { display: block; height: 100%; text-decoration: none; color: inherit; }
.list-thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.list-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.list-card:hover .list-thumb img { transform: scale(1.03); }
.list-thumb--emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  font-size: 40px;
  line-height: 1;
  background: var(--surface-2);
}
.list-card-body { display: block; padding: 14px 18px 18px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--band-soft);
  color: var(--ink-3);
  font-size: var(--fs-1);
  line-height: 1.7;
}
.tag-soft { background: var(--accent-soft); color: var(--accent); }
.list-card-title {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: var(--fs-7);
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}
.list-card-summary {
  margin-top: 6px;
  font-size: var(--fs-2);
  line-height: 1.8;
  color: var(--ink-3);
}
.list-card-meta {
  display: block;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  font-size: var(--fs-1);
  color: var(--muted);
}
.empty {
  margin: 12px 0 0;
  padding: 42px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--r-2);
  background: var(--surface);
  text-align: center;
  font-size: var(--fs-3);
  color: var(--ink-3);
}

/* ── 列表页说明 ─────────────────────────────────────────── */
.list-seo {
  max-width: 860px;
  margin: 40px auto 0;
  padding: 30px 0 10px;
  border-top: 1px solid var(--line);
}
.list-seo h2 {
  font-family: var(--font-serif);
  font-size: var(--fs-8);
  font-weight: 700;
  color: var(--ink);
}
.list-seo p {
  margin-top: 12px;
  font-size: var(--fs-4);
  line-height: 1.95;
  color: var(--ink-3);
}

/* ── 详情页 ─────────────────────────────────────────────── */
.detail-main { padding-bottom: 8px; }
.detail-head { padding: 30px 0 0; }
.detail-head h1 {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: var(--fs-10);
  line-height: 1.2;
  font-weight: 700;
  color: var(--ink);
}
.detail-spec {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: var(--fs-3);
  color: var(--muted);
}
.detail-spec .tag { font-size: var(--fs-1); }
.detail-lead {
  margin-top: 14px;
  max-width: 820px;
  font-size: var(--fs-5);
  line-height: 1.9;
  color: var(--ink-2);
}
.detail-lead + .detail-lead { margin-top: 6px; }
.detail-cover {
  margin: 26px 0 0;
  aspect-ratio: 2.6 / 1;
  border-radius: var(--r-3);
  overflow: hidden;
  background: var(--surface-2);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }

.spec-block {
  margin: 30px 0 0;
  padding: 18px 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
}
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table caption {
  padding-bottom: 8px;
  font-family: var(--font-serif);
  font-size: var(--fs-7);
  font-weight: 700;
  color: var(--ink);
  text-align: left;
}
.spec-table th,
.spec-table td {
  padding: 8px 10px;
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-2);
  text-align: left;
  vertical-align: top;
}
.spec-table th { width: 26%; font-weight: 600; color: var(--ink); }
.spec-table td { color: var(--ink-3); }
.spec-note {
  margin-top: 8px;
  font-size: var(--fs-1);
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 48px;
  max-width: 1120px;
  margin: 34px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.detail-grid--single { grid-template-columns: minmax(0, 1fr); }
.detail-grid--single .article-body { max-width: 760px; }
.toc { position: sticky; top: 96px; align-self: start; }
.toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.toc h2 {
  font-family: var(--font-serif);
  font-size: var(--fs-5);
  font-weight: 700;
  color: var(--ink);
}
.toc-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.toc-nav { margin-top: 10px; border-left: 2px solid var(--line); }
.toc-nav a {
  display: block;
  padding: 7px 0 7px 14px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  font-size: var(--fs-2);
  line-height: 1.5;
  color: var(--ink-3);
  text-decoration: none;
}
.toc-nav a:hover { color: var(--accent); }
.toc-nav a.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

.article-body { max-width: 760px; }
.article-body section + section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}
.article-body h2 {
  font-family: var(--font-serif);
  font-size: var(--fs-8);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  scroll-margin-top: 92px;
}
.article-body h2:focus { outline: none; }
.article-body p {
  margin-top: 10px;
  font-size: var(--fs-5);
  line-height: 1.95;
  color: var(--ink-2);
}
.article-figure {
  margin-top: 16px;
  border-radius: var(--r-2);
  overflow: hidden;
  background: var(--surface-2);
}
.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: cover;
}

.related { margin-top: 46px; padding-top: 28px; border-top: 1px solid var(--line); }
.related h2 {
  font-family: var(--font-serif);
  font-size: var(--fs-8);
  font-weight: 700;
  color: var(--ink);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 16px;
}
.related-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface);
  text-decoration: none;
  transition: border-color var(--dur) ease, box-shadow var(--dur) ease;
}
.related-card:hover { border-color: var(--accent); box-shadow: var(--shadow-card); }
.related-thumb {
  flex: none;
  width: 78px;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-1);
  overflow: hidden;
  background: var(--surface-2);
}
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-thumb--emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  line-height: 1;
}
.related-name {
  display: block;
  font-family: var(--font-serif);
  font-size: var(--fs-4);
  font-weight: 700;
  color: var(--ink);
}
.related-desc {
  display: block;
  margin-top: 3px;
  font-size: var(--fs-1);
  line-height: 1.7;
  color: var(--muted);
}

/* 复用首页 CTA 通栏，仅调整内页上下留白 */
.page-cta { padding: 36px 0 10px; }

@media (max-width: 1080px) {
  .list-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .detail-grid { grid-template-columns: 1fr; gap: 18px; }
  .toc { position: static; padding-bottom: 4px; }
  .toc-toggle { display: inline-flex; }
  .toc-nav { display: none; }
  .toc.is-open .toc-nav { display: block; }
  .toc-nav { border-left: 1px solid var(--line); }
  .article-body { max-width: 100%; }
}

@media (max-width: 860px) {
  .list-head h1, .detail-head h1 { font-size: var(--fs-9); }
  .filter-count { margin-left: 0; }
  .sort-label { margin-left: 0; }
  .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .list-grid { grid-template-columns: 1fr; }
  .list-head { padding-top: 26px; }
  .filter-row { gap: 8px; }
  .chip { min-height: 32px; padding: 4px 12px; }
  .detail-spec { font-size: var(--fs-2); }
  .detail-lead { font-size: var(--fs-4); }
  .detail-cover { aspect-ratio: 4 / 3; }
  .spec-block { padding: 14px; }
  .spec-table th { width: 34%; }
  .article-body p { font-size: var(--fs-4); }
}
