/* components.css — 内页专用组件（环节 6）
 *
 * 复用 style.css 的：.wrap .site-header .main-nav .nav-toggle .site-footer
 *                   .section-head .material-table .guide-list
 * 本文件只放内页新增区块，颜色/字号/圆角一律 var(--…)。
 */

/* ------------------------------------------------------------ 面包屑 */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-1);
  color: var(--muted-2);
}
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--accent-soft); }
.crumb span[aria-current] { color: var(--muted); }
.crumb .sep { color: var(--muted-2); }

/* ------------------------------------------------------------ 内页 hero */
.page-hero {
  padding: 56px 0 44px;
  border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(720px 320px at 88% -10%, rgba(200, 169, 107, 0.1), transparent 68%),
    transparent;
}
.page-hero h1 {
  margin: 18px 0 14px;
  font-size: var(--fs-7);
  letter-spacing: 0.04em;
}
.page-hero .lead {
  max-width: 46em;
  color: var(--muted);
  font-size: var(--fs-3);
  line-height: 1.9;
}
.page-hero .page-note {
  margin-top: 18px;
  font-size: var(--fs-1);
  letter-spacing: 0.08em;
  color: var(--accent);
}

/* ------------------------------------------------------------ 工具条 */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 26px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}
.toolbar .count {
  font-size: var(--fs-1);
  letter-spacing: 0.06em;
  color: var(--accent-soft);
  white-space: nowrap;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.filters .filter-label {
  margin-right: 4px;
  font-size: var(--fs-1);
  color: var(--muted-2);
}
.chip {
  padding: 5px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  font-size: var(--fs-1);
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.chip:hover { color: var(--ink); border-color: var(--line); }
.chip[aria-pressed="true"] {
  color: #12161d;
  background: var(--accent);
  border-color: var(--accent);
}
.sort {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  font-size: var(--fs-1);
  color: var(--muted-2);
}
.sort select {
  padding: 7px 30px 7px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-1);
  font: inherit;
  font-size: var(--fs-1);
}
.sort select:hover { border-color: var(--line); }

/* ------------------------------------------------------------ 列表卡片 */
.list-section { padding: 34px 0 64px; }
.list-heading {
  margin-bottom: 20px;
  font-size: var(--fs-1);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  letter-spacing: 0.24em;
  color: var(--muted-2);
  font-weight: 400;
}
.list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.list-card {
  position: relative;
  display: flex;
  gap: 18px;
  padding: 24px 24px 22px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-top: 1px solid var(--line);
  border-radius: var(--r-1);
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
  scroll-margin-top: 96px;
}
.list-card:hover { border-color: var(--accent); background: var(--surface-2); }
.list-card:target { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.list-card .idx {
  flex: none;
  font-family: var(--font-serif);
  font-size: var(--fs-3);
  color: var(--accent);
  opacity: 0.7;
  letter-spacing: 0.06em;
}
.list-card .body { min-width: 0; }
.list-card h2 {
  font-size: var(--fs-4);
  line-height: 1.55;
  margin-bottom: 8px;
}
.list-card h2 a:hover { color: var(--accent-soft); }
.list-card p { color: var(--muted); font-size: var(--fs-2); line-height: 1.85; }
.list-card .tag {
  display: inline-block;
  margin-top: 12px;
  padding: 2px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  font-size: 12px;
  color: var(--muted-2);
  letter-spacing: 0.06em;
}
.list-empty {
  padding: 40px 0;
  color: var(--muted);
  font-size: var(--fs-2);
}

/* ------------------------------------------------------------ 列表说明 */
.list-seo {
  padding: 54px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.list-seo h2 {
  font-size: var(--fs-5);
  margin-bottom: 18px;
}
.list-seo .seo-body {
  max-width: 46em;
  color: var(--ink-body);
  font-size: var(--fs-3);
  line-height: 1.95;
}

/* ------------------------------------------------------------ 其他分类 */
.related-categories { padding: 44px 0 66px; }
.related-categories h2 {
  font-size: var(--fs-1);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-weight: 400;
  letter-spacing: 0.24em;
  color: var(--muted-2);
  margin-bottom: 18px;
}
.cat-links { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-links a {
  padding: 9px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-1);
  font-size: var(--fs-2);
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.cat-links a:hover { color: var(--accent-soft); border-color: var(--accent); }

/* ------------------------------------------------------------ 详情页 */
.article-hero { padding: 44px 0 30px; border-bottom: 1px solid var(--line-soft); }
.article-hero .article-head { max-width: 800px; }
.article-hero h1 {
  margin: 18px 0 16px;
  font-size: var(--fs-7);
  line-height: 1.3;
}
.article-hero .lead {
  color: var(--muted);
  font-size: var(--fs-3);
  line-height: 1.9;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 20px;
  font-size: var(--fs-1);
  color: var(--muted-2);
  letter-spacing: 0.06em;
}
.article-meta strong { color: var(--accent-soft); font-weight: 400; }

.article-wrap {
  display: grid;
  grid-template-columns: 210px minmax(0, 760px);
  gap: 54px;
  justify-content: center;
  padding: 46px 0 70px;
}

/* 目录 */
.toc {
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 18px 18px 16px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--line);
  border-radius: var(--r-1);
}
.toc .toc-title {
  margin-bottom: 10px;
  font-size: var(--fs-1);
  letter-spacing: 0.2em;
  color: var(--accent);
}
.toc ol { display: flex; flex-direction: column; }
.toc a {
  display: block;
  padding: 6px 0;
  font-size: var(--fs-1);
  color: var(--muted);
  line-height: 1.6;
  border-bottom: 1px solid transparent;
}
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--accent-soft); border-bottom-color: var(--line); }

/* 正文 */
.article {
  max-width: 760px;
  color: var(--ink-body);
  font-size: var(--fs-3);
  line-height: 1.95;
}
.article h2 {
  position: relative;
  margin: 46px 0 16px;
  padding-top: 18px;
  font-size: var(--fs-5);
  line-height: 1.4;
  color: var(--ink);
  scroll-margin-top: 96px;
}
.article h2:first-child { margin-top: 0; }
.article h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 1px;
  background: var(--accent);
}
.article p + p { margin-top: 16px; }
.article figure { margin: 26px 0 8px; }
.article figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-1);
}
.article figcaption { margin-top: 10px; font-size: var(--fs-1); color: var(--muted-2); }
.article .chain {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  font-size: var(--fs-1);
}
.article .chain li {
  padding: 4px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  color: var(--muted);
}
.article .chain li::after { content: "→"; margin-left: 12px; color: var(--accent); }
.article .chain li:last-child::after { content: ""; }
.article table {
  width: 100%;
  margin-top: 22px;
  border-collapse: collapse;
  font-size: var(--fs-2);
}
.article th,
.article td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}
.article th { color: var(--accent-soft); font-weight: 400; white-space: nowrap; }
.article td { color: var(--ink-body); }
.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}
.compare div {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-1);
}
.compare strong { display: block; margin-bottom: 6px; color: var(--accent-soft); font-weight: 400; }
.compare span { font-size: var(--fs-2); color: var(--muted); }

/* 相关条目 */
.related {
  padding: 0 0 74px;
}
.related .related-title {
  font-size: var(--fs-1);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-weight: 400;
  letter-spacing: 0.24em;
  color: var(--muted-2);
  margin-bottom: 18px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.related-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-1);
  font-size: var(--fs-2);
  color: var(--ink);
  min-height: 118px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.related-card:hover { border-color: var(--accent); background: var(--surface-2); }
.related-card::after { content: "→"; color: var(--accent); font-size: var(--fs-1); }

/* ------------------------------------------------------------ 响应式 */
@media (max-width: 1100px) {
  .article-wrap { grid-template-columns: 1fr; gap: 26px; padding: 34px 0 56px; }
  .toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 14px 16px;
  }
  .toc .toc-title { margin: 0 6px 0 0; }
  .toc ol { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; }
  .toc a { padding: 2px 0; border-bottom: 0; }
  .toc a.is-active { border-bottom: 0; color: var(--accent-soft); }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .page-hero { padding: 38px 0 30px; }
  .page-hero h1 { font-size: var(--fs-6); }
  .list-grid { grid-template-columns: 1fr; }
  .sort { margin-left: 0; }
  .article-hero h1 { font-size: var(--fs-6); }
}

@media (max-width: 620px) {
  .page-hero h1 { font-size: 30px; }
  .article-hero h1 { font-size: 28px; }
  .article { font-size: var(--fs-2); }
  .article h2 { font-size: var(--fs-4); margin-top: 38px; }
  .compare { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .list-card { padding: 20px 18px; gap: 12px; }
  .toolbar { gap: 12px 16px; }
  .filters { gap: 6px; }
  .chip { padding: 5px 11px; }
  .article th,
  .article td { padding: 10px 8px; }
}

/* ---------- 数据对接补充 ---------- */
.chip { display: inline-flex; align-items: center; justify-content: center; line-height: 1; text-decoration: none; white-space: nowrap; }
.chip.is-active, .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #141d2b; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 34px 0 12px; }
.page-num { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 2px; color: var(--ink); font-size: 13px; text-decoration: none; }
.page-num:hover { border-color: var(--accent); color: var(--accent); }
.page-num.is-active { background: var(--accent); border-color: var(--accent); color: #141d2b; }
.page-gap { display: inline-flex; align-items: center; padding: 0 4px; color: var(--muted); }
.empty-state { padding: 46px 0; text-align: center; color: var(--muted); }
.article-nav { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.article-nav-item { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 2px; color: var(--ink); text-decoration: none; }
.article-nav-item span { font-size: 12px; color: var(--muted); }
.article-nav-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.article-nav-item:hover { border-color: var(--accent); color: var(--accent); }
.article-nav-next { text-align: right; }
.section-figure, .article figure { margin: 18px 0; }
.section-figure img, .article img { max-width: 100%; height: auto; }
@media (max-width: 700px) { .article-nav { grid-template-columns: 1fr; } .article-nav-next { text-align: left; } }
