/* components.css — 内页专用组件（分类页 / 详情页）
   颜色、字号、圆角一律取 tokens.css 的变量，不新增近似值。 */

/* ---------- breadcrumb ---------- */
.crumb { padding: 22px 0 0; }
.crumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  list-style: none;
  font-size: 12px;
  color: var(--ink-soft);
}
.crumb li { display: inline-flex; align-items: center; gap: 7px; }
.crumb li + li::before {
  content: "/";
  color: var(--line-strong);
}
.crumb a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.crumb a:hover { color: var(--accent); }
.crumb li[aria-current="page"] {
  max-width: 56ch;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- category hero ---------- */
.page-hero {
  padding-bottom: 34px;
  background:
    linear-gradient(180deg, rgba(237, 228, 210, .55), rgba(250, 245, 236, 0)),
    var(--bg);
}
.eyebrow-dark {
  margin-top: 26px;
  margin-bottom: 12px;
  color: var(--green);
}
.page-hero h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 4.4vw, 54px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: .03em;
}
.page-lead {
  max-width: 760px;
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink-soft);
}
.page-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
}
.stat-count {
  margin: 0;
  padding: 6px 14px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  letter-spacing: .04em;
}
.stat-tag {
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 11.5px;
}

/* ---------- toolbar ---------- */
.list-toolbar {
  position: sticky;
  top: 70px;
  z-index: 30;
  background: rgba(250, 245, 236, .96);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.toolbar-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 62px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.toolbar-title {
  flex: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--ink-soft);
}
.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.filter-label {
  margin-right: 3px;
  font-size: 12px;
  color: var(--ink-soft);
}
.chip {
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover,
.chip:focus-visible { border-color: var(--accent); color: var(--accent); }
.chip.is-on {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.sort-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.sort-select {
  min-height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
  cursor: pointer;
}

/* ---------- list ---------- */
.list-section { padding: 30px 0 10px; }
.list-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 18px;
}
.list-heading h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .03em;
}
.list-heading h2::before {
  content: "";
  width: 5px;
  height: 22px;
  background: var(--accent);
}
.list-heading p { font-size: 13px; color: var(--ink-soft); }
.result-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--green);
  letter-spacing: .04em;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.post-card {
  position: relative;
  min-height: 250px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.post-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px 22px 18px;
  color: inherit;
}
.post-card:hover,
.post-card:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.post-card[hidden] { display: none; }
.post-thumb {
  display: block;
  margin: -22px -22px 16px;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  aspect-ratio: 16 / 9;
  background: var(--surface-sand);
}
.post-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-num {
  position: absolute;
  top: 20px;
  right: 20px;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
  color: var(--line-strong);
}
.post-topic {
  align-self: flex-start;
  padding: 3px 9px;
  background: rgba(34, 75, 54, .1);
  color: var(--green);
  font-size: 11px;
  letter-spacing: .04em;
}
.post-card h3 {
  margin-top: 12px;
  padding-right: 26px;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.45;
  font-weight: 700;
}
.post-card p {
  margin-top: 9px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-soft);
}
.post-meta {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: .02em;
}
.post-meta::after {
  content: " →";
  color: var(--accent);
}
.empty-state {
  padding: 46px 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ---------- list description ---------- */
.list-description {
  margin-top: 34px;
  padding: 40px 0;
  background: var(--surface-sand);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.list-description h2 {
  margin-bottom: 12px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .03em;
}
.list-description p {
  max-width: 900px;
  font-size: 14.5px;
  line-height: 2;
  color: #4c463b;
}

.reading-path { padding: 32px 0 48px; }
.reading-path-inner {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.reading-path h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
}
.reading-path p {
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--ink-soft);
}

/* ---------- detail ---------- */
.article-wrap { padding-bottom: 54px; }
.article-head {
  max-width: 900px;
  padding: 30px 0 26px;
  border-bottom: 1px solid var(--line);
}
.article-cat {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(34, 75, 54, .1);
  color: var(--green);
  font-size: 11.5px;
  letter-spacing: .05em;
}
.article-head h1 {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: clamp(34px, 4.2vw, 48px);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: .02em;
}
.article-deck {
  max-width: 760px;
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink-soft);
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 20px;
  color: var(--ink-soft);
  font-size: 11.5px;
}
.meta-tag {
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  color: var(--accent);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) 250px;
  gap: 56px;
  align-items: start;
  padding-top: 34px;
}
.article-body { min-width: 0; }
.key-points {
  padding: 22px 24px;
  background: var(--surface-sand);
  border-left: 4px solid var(--accent);
}
.key-points h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
}
.key-points ul { margin-top: 10px; padding-left: 18px; list-style: disc; }
.key-points li {
  margin-top: 5px;
  font-size: 13.5px;
  line-height: 1.8;
  color: #4c463b;
}

.article-section { padding-top: 34px; }
.article-section h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.45;
  font-weight: 700;
  letter-spacing: .02em;
}
.sec-num {
  flex: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .1em;
}
.article-section p {
  margin-top: 14px;
  font-size: 15.5px;
  line-height: 2;
  color: #2c2923;
  text-align: justify;
}
.article-section.is-target h2 { color: var(--accent); }

.toc {
  position: sticky;
  top: 104px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.toc-head h2 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
}
.toc ol {
  margin-top: 12px;
  padding-left: 16px;
  list-style: decimal;
}
.toc li { margin-top: 8px; }
.toc a {
  display: block;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  transition: color .2s;
}
.toc a:hover,
.toc a:focus-visible,
.toc a.is-active { color: var(--accent); }
.toc a.is-active { font-weight: 600; }
.toc-toggle {
  display: none;
  width: 100%;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
}

.related {
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.related h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
}
.related h2::before {
  content: "";
  width: 5px;
  height: 20px;
  background: var(--accent);
}
.related ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.related li {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
}
.related li::after {
  content: attr(data-cat);
  display: block;
  padding: 0 18px 16px;
  color: var(--green);
  font-size: 11px;
}
.related a {
  display: block;
  padding: 18px 18px 10px;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 700;
  transition: color .2s;
}
.related a:hover,
.related a:focus-visible { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .toc { position: static; order: -1; }
  .toc-toggle { display: block; }
  .toc ol { margin-top: 10px; }
  .toc.is-collapsed ol { display: none; }
}

@media (max-width: 780px) {
  .list-toolbar { top: 62px; }
  .toolbar-inner { flex-wrap: wrap; gap: 10px 18px; padding: 12px 0; }
  .toolbar-title { width: 100%; }
  .sort-group { margin-left: 0; }
  .post-grid { grid-template-columns: 1fr; }
  .post-card { min-height: 0; }
  .list-heading h2 { font-size: 23px; }
  .result-count { margin-left: 0; }
  .reading-path-inner { grid-template-columns: 1fr; gap: 10px; }
  .article-head { padding-top: 22px; }
  .article-section h2 { font-size: 23px; }
  .article-section p { font-size: 15px; text-align: left; }
  .related ul { grid-template-columns: 1fr; }
  .crumb li[aria-current="page"] { white-space: normal; }
}

/* ---------- list pagination ---------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 34px 0 8px;
}
.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: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}
.page-num:hover,
.page-num:focus-visible { border-color: var(--accent); color: var(--accent); }
.page-num.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-gap { display: inline-flex; align-items: center; padding: 0 4px; color: var(--ink-soft); }

/* ---------- article prev / next ---------- */
.article-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 38px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.article-nav-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}
.article-nav-item span { font-size: 12px; color: var(--ink-soft); }
.article-nav-item strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.article-nav-item:hover,
.article-nav-item:focus-visible { border-color: var(--accent); color: var(--accent); }
.article-nav-next { text-align: right; }

/* ---------- article figure ---------- */
.section-figure { margin: 16px 0; }
.section-figure img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); }

/* ---------- home module more link ---------- */
.section-more {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.section-more:hover { text-decoration: underline; }
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-decoration: none;
}

@media (max-width: 640px) {
  .article-nav { grid-template-columns: 1fr; }
  .article-nav-next { text-align: left; }
}
