/* style.css — 三页版式（首页 / 分类页 / 详情页） */

/* ================= 首页 ================= */

/* --- M1 首屏 --- */
.hero {
  background: linear-gradient(118deg, var(--hero-a) 0%, var(--hero-b) 52%, #dde8f8 100%);
  overflow: hidden;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  align-items: center;
  gap: 40px;
  min-height: 385px;
  padding-top: 26px;
  padding-bottom: 26px;
}
.hero__copy { max-width: 620px; }
.hero__eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--accent-deep);
}
.hero__title {
  font-size: var(--fs-h1);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -.01em;
  color: #243f74;
}
.hero__subtitle {
  margin-top: 10px;
  font-size: 20px;
  line-height: 1.5;
  font-weight: 700;
  color: #2b4a80;
}
.hero__lead {
  margin-top: 12px;
  max-width: 30em;
  font-size: var(--fs-body);
  line-height: 1.8;
  color: #3f5372;
}
.hero__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.hero__stats {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 22px;
  font-size: var(--fs-xs);
  color: #445a7c;
}
.hero__stats li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero__stats li + li::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(47, 79, 138, .45);
}
.hero__media {
  position: relative;
  align-self: stretch;
  min-height: 300px;
  border-radius: var(--radius-l) 0 0 var(--radius-l);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(47, 79, 138, .16);
}
.hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 78%;
}

/* --- 首页区块通用 --- */
.section { padding-top: 36px; }
.section:last-of-type { padding-bottom: 0; }

/* 分区预算：来自 03-ui/home-ui-desktop.png 的逐区 y 区间（1440 归一） */
#categories { padding-top: 45px; }
#categories .section-head { margin-bottom: 52px; }
.section--featured { padding-top: 46px; }
.section--featured .section-head { margin-bottom: 17px; }
.section--row1 { padding-top: 27px; }
.section--row1 .section-head { margin-bottom: 25px; }
.section--row2 { padding-top: 70px; }
.section--row2 .section-head { margin-bottom: 31px; }

/* --- M2 分类索引 --- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 14px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 15px 14px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cat-card:hover {
  transform: translateY(-3px);
  border-color: #c6d5ee;
  box-shadow: var(--shadow);
}
.cat-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  color: var(--accent);
  background: var(--tint-soft);
  border-radius: 12px;
}
.cat-card__icon svg { width: 26px; height: 26px; }
.cat-card__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.cat-card__desc {
  margin-top: 4px;
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--muted);
}

/* --- M3 精选条目 --- */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.feat-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.feat-card:hover {
  transform: translateY(-3px);
  border-color: #c6d5ee;
  box-shadow: var(--shadow);
}
.feat-card__media {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--tint);
}
.feat-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.feat-card__title {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 700;
  color: var(--ink);
}
.feat-card__summary {
  margin-top: 6px;
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--body);
}
.feat-card .tag { align-self: flex-start; margin-top: 10px; }

/* --- M4 / M5 / M6 / M7 双栏行 --- */
.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.duo--pair { grid-template-columns: 1.22fr 1fr; gap: 28px; }

/* 开本对照表 */
.size-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.size-table th,
.size-table td {
  padding: 6px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.size-table thead th {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--body);
  background: #f4f4f5;
}
.size-table tbody th { font-weight: 700; color: var(--ink); width: 22%; }
.size-table td { color: var(--body); }
.size-table td:nth-child(2) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.size-table tbody tr:last-child th,
.size-table tbody tr:last-child td { border-bottom: 0; }
.size-table tbody tr:hover td,
.size-table tbody tr:hover th { background: #f7faff; }

/* 纸张克重 */
.weight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 18px;
  align-items: start;
}
.weight__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.weight__list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 12px;
  background: var(--tint);
  border-radius: 10px;
}
.weight__gsm {
  flex: none;
  width: 74px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}
.weight__use { font-size: var(--fs-xs); color: var(--body); }
.weight__note {
  position: relative;
  padding: 20px 18px 18px;
  font-size: var(--fs-xs);
  line-height: 1.85;
  color: #6b5a3f;
  background: #fdf6e8;
  border: 1px solid #f0e3c9;
  border-radius: 6px;
  box-shadow: var(--shadow-s);
  transform: rotate(-1.4deg);
}
.weight__note::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 34px;
  height: 12px;
  margin-left: -17px;
  background: rgba(240, 227, 201, .9);
  border-radius: 2px;
  transform: rotate(-2deg);
}

/* M6 一页里的分工 */
.pair {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 18px 4px;
  background: var(--tint-soft);
  border-radius: var(--radius);
}
.pair li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4px 12px;
}
.pair li + li { border-left: 1px solid rgba(71, 129, 225, .16); }
.pair__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 8px;
  color: var(--accent);
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-s);
}
.pair__icon svg { width: 22px; height: 22px; }
.pair__name { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); }
.pair__desc {
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--body);
}

/* M7 三步上手 */
.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.steps li {
  counter-increment: step;
  padding: 14px 14px 16px;
  background: var(--tint-soft);
  border: 1px solid #dbe6f7;
  border-radius: 10px;
}
.steps li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
}
.step__label { font-size: var(--fs-sm); font-weight: 700; color: var(--accent-deep); }
.step__text {
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--body);
}

/* M8 收录说明 */
.note-band { padding-top: 22px; }
.note-band__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 32px;
  padding: 30px 32px;
  background: var(--tint);
  border-radius: var(--radius-l);
}
.note-band__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.note-band__head h2 {
  position: relative;
  padding-left: 14px;
  font-size: var(--fs-h2);
  font-weight: 700;
}
.note-band__head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 2px;
  background: var(--accent);
}
.note-band__head p { font-size: var(--fs-sm); color: #56688a; }
.note-band__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 24px;
  grid-column: 1 / -1;
}
.note-band__cols h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--accent-deep);
}
.note-band__cols h3::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #5b9a6f;
  border-radius: 50%;
}
.note-band__cols > div:nth-child(2) h3::before { content: "✕"; background: #c97b6b; }
.note-band__cols > div:nth-child(1) h3::before { content: "✓"; }
.note-band__cols p {
  margin-top: 6px;
  font-size: var(--fs-sm);
  line-height: 1.85;
  color: #44536b;
}

/* ================= 分类页 ================= */

.page-head {
  padding: 22px 0 26px;
  background: linear-gradient(180deg, #edf3fc 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
}
.page-head__grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 36px;
  align-items: end;
  margin-top: 18px;
}
.page-head__eyebrow {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--accent);
}
.page-head__title {
  margin-top: 6px;
  font-size: 38px;
  line-height: 1.2;
  font-weight: 800;
  color: #243f74;
}
.page-head__desc {
  font-size: var(--fs-body);
  line-height: 1.85;
  color: #43577a;
}
.page-head__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: var(--fs-xs);
  color: var(--accent-deep);
}
.page-head__meta span + span::before {
  content: "·";
  margin-right: 10px;
  color: #9fb0c9;
}

.list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.entry-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.entry-card:hover {
  transform: translateY(-3px);
  border-color: #c6d5ee;
  box-shadow: var(--shadow);
}
.entry-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line-strong);
}
.entry-card__size {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .01em;
  color: var(--accent-deep);
}
.entry-card__mm {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.entry-card__title {
  margin-top: 12px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.entry-card__title a:hover { color: var(--accent); }
.entry-card__summary {
  margin-top: 8px;
  font-size: var(--fs-sm);
  line-height: 1.75;
  color: var(--body);
}
.entry-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.entry-card__more { color: var(--accent-deep); font-weight: 700; }
.entry-card__more::after { content: " →"; font-weight: 400; }
.entry-card__media {
  display: block;
  margin: -18px -18px 14px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: var(--tint-soft);
}
.entry-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- 分页 ---------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
  font-size: var(--fs-sm);
}
.pager a,
.pager-current,
.pager-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: #fff;
  color: var(--accent-deep);
}
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager-current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}
.pager-gap { border: 0; background: transparent; color: var(--muted); }
.pager-info { margin-left: 6px; font-size: var(--fs-xs); color: var(--muted); }

.list-desc {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.list-desc h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  margin-bottom: 12px;
}
.list-desc p {
  max-width: 720px;
  font-size: var(--fs-body);
  line-height: 1.95;
  color: var(--body);
}

/* ================= 详情页 ================= */

.article-head {
  padding: 20px 0 26px;
  background: linear-gradient(180deg, #eef4fc 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
}
.article-head__inner {
  max-width: 860px;
  margin: 0 auto;
  padding-top: 16px;
}
.article-head__eyebrow {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--accent);
}
.article-head__title {
  margin-top: 8px;
  font-size: 36px;
  line-height: 1.35;
  font-weight: 800;
  color: #243f74;
}
.article-head__source {
  margin-top: 14px;
  font-size: var(--fs-sm);
  line-height: 1.85;
  color: var(--body);
}
.article-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
  font-size: var(--fs-xs);
  color: var(--muted);
}

.article-layout {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 44px;
  padding-top: 32px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 16px;
  background: var(--tint-soft);
  border: 1px solid #dce7f7;
  border-radius: var(--radius);
}
.toc__title {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--accent-deep);
  margin-bottom: 10px;
}
.toc__toggle {
  display: none;
  width: 100%;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--accent-deep);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 12px;
  cursor: pointer;
}
.toc__toggle::after { content: "▾"; }
.toc__list li + li { margin-top: 6px; }
.toc__list a {
  display: block;
  padding: 4px 8px;
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--body);
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
}
.toc__list a:hover { background: #fff; color: var(--accent-deep); }
.toc__list a.is-active {
  color: var(--accent-deep);
  font-weight: 700;
  border-left-color: var(--accent);
  background: #fff;
}

.article-body { max-width: 720px; }
.article-body figure {
  margin: 0 0 26px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-s);
}
.article-body figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.article-body section + section { margin-top: 30px; }
.article-body h2 {
  font-size: 24px;
  line-height: 1.45;
  font-weight: 700;
  color: var(--ink);
  scroll-margin-top: 92px;
}
.article-body h2::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 18px;
  margin-right: 10px;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: -1px;
}
.article-body p {
  margin-top: 12px;
  font-size: var(--fs-body);
  line-height: 1.95;
  color: var(--body);
}

.related { padding-top: 40px; }
.related__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.related__card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.related__card:hover {
  transform: translateY(-3px);
  border-color: #c6d5ee;
  box-shadow: var(--shadow);
}
.related__card strong { font-size: var(--fs-body); color: var(--ink); }
.related__card span { font-size: var(--fs-xs); color: var(--muted); }

/* ================= 响应式 ================= */

@media (max-width: 1100px) {
  .hero__inner { gap: 28px; min-height: 340px; }
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .duo { gap: 26px; }
  .list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 28px; }
}

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; min-height: 0; padding: 28px 0 0; }
  .hero__media {
    order: -1;
    min-height: 0;
    aspect-ratio: 16 / 9;
    margin: 0;
    border-radius: 0 0 var(--radius-l) var(--radius-l);
  }
  .hero__copy { padding: 0 var(--gutter) 28px; }
  .duo,
  .duo--pair { grid-template-columns: 1fr; }
  .weight { grid-template-columns: minmax(0, 1fr) 200px; }
  .note-band__inner { grid-template-columns: 1fr; gap: 0; }
  .page-head__grid { grid-template-columns: 1fr; gap: 14px; align-items: start; }
  .article-layout { grid-template-columns: 1fr; gap: 20px; padding-top: 24px; }
  .toc { position: static; max-height: none; padding: 12px; }
  .toc__toggle { display: flex; }
  .toc__title { display: none; }
  .toc__list { display: none; margin-top: 10px; }
  .toc.is-open .toc__list { display: block; }
  .article-body { max-width: none; }
  .related__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .hero__title { font-size: 34px; }
  .hero__subtitle { font-size: 17px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .feat-grid { grid-template-columns: 1fr; }
  .list-grid { grid-template-columns: 1fr; }
  .pair { grid-template-columns: 1fr 1fr; gap: 12px 4px; }
  .pair li:nth-child(3) { border-left: 0; }
  .steps { grid-template-columns: 1fr; }
  .weight { grid-template-columns: 1fr; }
  .weight__note { transform: none; }
  .note-band__inner { padding: 22px 18px; }
  .note-band__cols { grid-template-columns: 1fr; gap: 18px; }
  .page-head__title { font-size: 30px; }
  .article-head__title { font-size: 26px; }
  .related__grid { grid-template-columns: 1fr; }
  .article-body h2 { font-size: 21px; }
  .size-table { font-size: var(--fs-xs); }
  .size-table th,
  .size-table td { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .cat-card:hover,
  .feat-card:hover,
  .entry-card:hover,
  .related__card:hover { transform: none; }
}
