/* components.css — 可复用组件：按钮、事实条、分类卡、工序、阅读卡、清单、数据表 */

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border-radius: var(--r-pill);
  background: var(--moss);
  color: var(--white);
  font-size: var(--fs-4);
  font-weight: 500;
  line-height: 1;
  transition: background .18s ease, transform .18s ease;
}
.btn:hover { background: var(--moss-deep); transform: translateY(-1px); }

.btn-sm {
  min-height: 28px;
  padding: 0 18px;
  font-size: var(--fs-3);
}

.btn-cta {
  flex: 0 0 auto;
  min-height: 58px;
  padding: 0 32px;
  background: var(--cream);
  color: var(--ink);
  font-size: var(--fs-5);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .08);
}
.btn-cta::after {
  content: "→";
  margin-left: 14px;
  font-size: var(--fs-6);
}
.btn-cta:hover { background: var(--white); }

/* 首屏事实条 */
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 0;
  width: 790px;
  max-width: 100%;
  margin-top: 16px;
  padding: 10px 18px;
  background: rgba(243, 239, 220, .92);
  border: 1px solid rgba(214, 208, 189, .8);
  border-radius: 12px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.55;
}
.hero-facts > * {
  padding: 0 10px;
  border-left: 1px solid rgba(160, 152, 128, .45);
}
.hero-facts > *:first-child { border-left: 0; padding-left: 0; }
.fact-start { color: var(--ink); font-weight: 600; }
.fact-start:hover { color: var(--moss); }
.fact b { color: var(--ink); font-weight: 600; margin-right: 4px; }

/* 分类卡 */
.cat-card {
  display: flex;
  gap: 18px;
  height: 100%;
  padding: 16px 20px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.cat-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
}
.cat-thumb {
  flex: 0 0 160px;
  width: 160px;
  height: 160px;
  overflow: hidden;
  border-radius: 6px;
}
.cat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cat-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}
.cat-body h2 {
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: .01em;
}
.cat-body h2 a:hover { color: var(--moss); }
.cat-body p {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.55;
}
.cat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-top: 7px;
  color: var(--muted);
  font-size: var(--fs-2);
}
.cat-tags span { position: relative; }
.cat-tags span + span { padding-left: 11px; }
.cat-tags span + span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 50%;
  background: var(--line-strong);
}
.cat-body .btn { margin-top: auto; align-self: flex-start; }

/* 工序 */
.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 26px;
  position: relative;
  padding-top: 6px;
}
.steps::before {
  content: "";
  position: absolute;
  top: 23px;
  left: 16px;
  right: 16px;
  height: 1px;
  background: rgba(120, 134, 101, .35);
}
.step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-top: 0;
}
.step:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 2px;
  right: -19px;
  color: rgba(63, 85, 51, .55);
  font-size: var(--fs-4);
}
.step-num {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--moss);
  border-radius: 50%;
  background: var(--sage);
  color: var(--moss);
  font-family: var(--font-serif);
  font-size: var(--fs-3);
  font-weight: 700;
}
.step h3 {
  margin-top: 6px;
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-4);
  font-weight: 700;
  line-height: 1.4;
}
.step p {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.6;
}

/* 精选阅读卡 */
.read-card {
  position: relative;
  display: block;
  height: 156px;
  padding: 16px 105px 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  transition: border-color .18s ease, transform .18s ease;
}
.read-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.read-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brown);
  color: var(--white);
  font-family: var(--font-serif);
  font-size: var(--fs-3);
  font-weight: 700;
  vertical-align: middle;
}
.read-eyebrow {
  margin-left: 8px;
  color: var(--ink);
  font-size: var(--fs-4);
  font-weight: 600;
  vertical-align: middle;
}
.read-card h3 {
  margin-top: 7px;
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-4);
  font-weight: 700;
  line-height: 1.45;
}
.read-card p {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.55;
}
.read-card img {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 80px;
  height: 96px;
  border-radius: 6px;
  object-fit: cover;
}

/* 动手清单 */
.checklist h2,
.oil-table h2 {
  font-size: var(--fs-11);
  line-height: 1.3;
}
.checklist ul { margin-top: 16px; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
}
.check-label {
  position: relative;
  flex: 0 0 64px;
  padding-left: 34px;
  color: var(--ink);
  font-size: var(--fs-5);
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.check-label::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--moss);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
}
.checklist li p {
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.55;
}

/* 皂化价表 */
.oil-table { display: flex; flex-direction: column; min-width: 0; }
.oil-table table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  border: 1px solid var(--line-strong);
  background: rgba(255, 254, 249, .38);
  font-size: 13.5px;
  line-height: 1.4;
}
.oil-table th,
.oil-table td {
  padding: 8px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.oil-table thead th {
  background: rgba(232, 236, 218, .55);
  color: var(--ink);
  font-weight: 700;
}
.oil-table tbody th { color: var(--ink); font-weight: 500; }
.oil-table tbody td:nth-child(2) {
  font-family: var(--font-serif);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.table-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.fact-break {
  flex: 1 0 100%;
  height: 0;
}

/* ================= 内页：分类列表 ================= */
.page-hero {
  padding: 46px 0 40px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.page-hero .eyebrow { margin-bottom: 14px; font-size: var(--fs-5); }
.crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: var(--fs-3);
  list-style: none;
}
.crumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--line-strong);
}
.crumb a:hover { color: var(--moss); }
.crumb [aria-current="page"] { color: var(--ink); }

.page-hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}
.page-hero h1 {
  font-size: 54px;
  line-height: 1.15;
  letter-spacing: .01em;
}
.page-lead {
  margin-top: 12px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: var(--fs-8);
}
.page-intro {
  max-width: 760px;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: var(--fs-4);
}
.page-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: var(--fs-3);
}
.page-count b {
  color: var(--moss);
  font-family: var(--font-serif);
  font-size: 64px;
  line-height: 1;
}
.page-count span { margin-top: 6px; }

.filter-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  background: rgba(248, 247, 242, .97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.filter-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  min-height: 60px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  gap: 8px;
}
.filter-label {
  color: var(--muted);
  font-size: var(--fs-3);
  white-space: nowrap;
}
.filter-count {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--fs-3);
  white-space: nowrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-soft);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-3);
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.chip:hover { border-color: var(--moss); color: var(--moss); }
.chip.is-active {
  background: var(--moss);
  border-color: var(--moss);
  color: var(--white);
}

.list-wrap { padding-top: 34px; }
.list-top {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 18px;
}
.list-top h2 { font-size: var(--fs-9); }
.list-note { color: var(--muted); font-size: var(--fs-4); }

.list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.entry-card {
  display: flex;
  flex-direction: column;
  min-height: 246px;
  padding: 20px 22px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.entry-media {
  display: block;
  margin: -20px -22px 14px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--r-card) var(--r-card) 0 0;
  background: var(--surface-2);
}
.entry-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.entry-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.entry-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.entry-cat {
  padding: 2px 10px;
  background: var(--sage);
  border-radius: 4px;
  color: var(--moss);
  font-size: var(--fs-2);
  font-weight: 600;
}
.entry-num {
  color: var(--brown);
  font-family: var(--font-serif);
  font-size: var(--fs-5);
}
.entry-card h3 {
  margin-top: 12px;
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-6);
  font-weight: 700;
  line-height: 1.5;
}
.entry-card h3 a:hover { color: var(--moss); }
.entry-card > p {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.entry-card h3 {
  word-break: break-word;
}
.entry-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
}
.entry-tag { color: var(--muted); font-size: var(--fs-2); }
.entry-arrow {
  color: var(--moss);
  font-size: var(--fs-3);
  font-weight: 600;
}
.entry-arrow:hover { color: var(--moss-deep); }

.empty-state {
  margin: 20px 0;
  padding: 36px;
  background: var(--surface-3);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-card);
  color: var(--muted);
  text-align: center;
}

.subcat-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.list-desc {
  max-width: 760px;
  padding: 40px 0 30px;
}
.list-desc h2 {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-10);
}
.list-desc p {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: var(--fs-5);
  line-height: 1.9;
}
.list-status {
  padding-bottom: 26px;
  color: var(--muted);
  font-size: var(--fs-3);
  text-align: center;
}

/* ================= 内页：详情长文 ================= */
.article-head {
  padding: 46px 0 40px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.article-head .container.article-head-inner {
  max-width: 1036px;
  padding-left: 276px;
  padding-right: 0;
}
.article-head h1 {
  margin-top: 18px;
  font-size: 46px;
  line-height: 1.22;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--muted);
  font-size: var(--fs-3);
}
.article-meta span + span::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 12px 3px 0;
  border-radius: 50%;
  background: var(--line-strong);
}
.article-lede {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: var(--fs-5);
  line-height: 1.8;
}

.article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  justify-content: center;
  gap: 56px;
  padding-top: 50px;
  padding-bottom: 46px;
}
.article-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 18px 20px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  font-size: var(--fs-3);
}
.article-toc summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
  list-style: none;
}
.article-toc summary::-webkit-details-marker { display: none; }
.article-toc summary::after { content: " ▾"; color: var(--muted); }
.article-toc[open] summary::after { content: " ▴"; }
.article-toc ol { margin-top: 12px; }
.article-toc li + li { margin-top: 8px; }
.article-toc a {
  display: block;
  padding: 2px 0 2px 10px;
  border-left: 2px solid transparent;
  color: var(--ink-soft);
  line-height: 1.5;
}
.article-toc a:hover { color: var(--moss); }
.article-toc a.is-active {
  border-left-color: var(--moss);
  color: var(--moss);
  font-weight: 600;
}

.article {
  min-width: 0;
  color: var(--ink-soft);
  font-size: var(--fs-6);
  line-height: 1.95;
}
.article-intro {
  font-size: var(--fs-6);
}
.article section { margin-top: 40px; scroll-margin-top: 90px; }
.article h2 {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-9);
  line-height: 1.4;
}
.article section p { color: var(--ink-soft); }
.article-intro { color: var(--ink-soft); }
.article figure {
  margin: 22px 0;
}
.article figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--r-card);
  background: var(--surface-2);
}
.article figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: var(--fs-2);
  text-align: center;
}

/* 分页 */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 34px;
}
.pager a,
.pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: var(--fs-3);
}
.pager a:hover { border-color: var(--moss); color: var(--moss); }
.pager .is-current {
  background: var(--moss);
  border-color: var(--moss);
  color: var(--white);
  font-weight: 600;
}
.pager .is-gap {
  border-color: transparent;
  color: var(--muted);
}

.key-points {
  margin-top: 30px;
  padding: 22px 24px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.key-points h2 {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  font-size: var(--fs-7);
}
.key-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.key-grid b {
  display: block;
  color: var(--moss);
  font-family: var(--font-serif);
  font-size: var(--fs-6);
}
.key-grid p {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.65;
}

.related {
  padding: 44px 0 50px;
  background: var(--surface-3);
  border-top: 1px solid var(--line);
}
.related > .container > h2 { font-size: var(--fs-10); }
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.related-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 112px;
  padding: 20px 48px 20px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  transition: border-color .16s ease, transform .16s ease;
}
.related-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.related-card span { color: var(--brown); font-size: var(--fs-2); font-weight: 600; }
.related-card h3 {
  margin-top: 8px;
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-5);
  font-weight: 700;
  line-height: 1.5;
}
.related-card p { margin-top: 6px; color: var(--muted); font-size: var(--fs-3); line-height: 1.6; }
.related-card::after {
  content: "→";
  position: absolute;
  right: 20px;
  bottom: 20px;
  color: var(--moss);
  font-size: var(--fs-5);
}

/* CTA 通栏（内页变体） */
.cta-band {
  padding: 58px 0;
  background: var(--moss-dark);
}
.cta-band .cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  height: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.cta-band .cta-copy h2 {
  color: var(--white);
  font-size: var(--fs-12);
}
.cta-band .cta-copy p {
  margin-top: 6px;
  color: rgba(255, 254, 249, .8);
  font-size: var(--fs-4);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .page-hero { padding: 34px 0 28px; }
  .page-hero h1 { font-size: 40px; }
  .article-head h1 { font-size: 34px; }
  .article-head .container.article-head-inner { max-width: none; padding-left: var(--gutter); padding-right: var(--gutter); }
  .list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding-top: 30px;
  }
  .article-toc { position: static; }
  .related-grid { grid-template-columns: 1fr; }
  .cta-band .cta-inner { padding-left: var(--gutter); padding-right: var(--gutter); }
}

@media (max-width: 640px) {
  .page-hero-row { display: block; }
  .page-hero h1 { font-size: 34px; }
  .page-count { display: none; }
  .filter-inner { flex-wrap: wrap; gap: 10px 16px; padding: 12px 16px; }
  .filter-count { margin-left: 0; }
  .list-grid { grid-template-columns: 1fr; }
  .entry-card { min-height: 0; }
  .article-head h1 { font-size: 28px; }
  .article-meta { font-size: var(--fs-2); }
  .article { font-size: var(--fs-5); }
  .article h2 { font-size: var(--fs-8); }
  .key-grid { grid-template-columns: 1fr; gap: 12px; }
  .cta-band { padding: 36px 0; }
  .cta-band .cta-inner { flex-direction: column; align-items: flex-start; }
  .cta-band .cta-copy h2 { font-size: var(--fs-8); }
}
