:root {
  --bg: #f6faf7;
  --surface: #ffffff;
  --ink: #24372c;
  --muted: #71867a;
  --line: #e3eee6;
  --green: #4b8c6b;
  --green-dark: #356b51;
  --green-soft: #eaf5ed;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #eef7f0 0, #f8fbf8 460px, var(--bg) 100%) no-repeat;
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  z-index: 60;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #9cccab, var(--green-dark));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 250, 247, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(210, 229, 215, .8);
}

.header-inner {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  flex: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--green-dark);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
}

.brand-text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: .04em;
}

.brand-text small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: .12em;
  margin-top: 2px;
}

.chapter-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.chapter-nav a {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: background-color .25s ease, color .25s ease;
}

.chapter-nav a:hover,
.chapter-nav a.active {
  background: var(--green-soft);
  color: var(--green-dark);
}

.header-meta {
  flex: none;
  padding-left: 24px;
  border-left: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .06em;
}

.hero {
  padding: 116px 0 92px;
  text-align: center;
}

.hero-inner {
  max-width: 780px;
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: .3em;
  color: var(--green);
}

.hero h1 {
  margin: 20px 0 22px;
  font-size: clamp(42px, 7vw, 68px);
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.2;
}

.hero-desc {
  margin: 0 auto;
  max-width: 590px;
  font-size: 15px;
  line-height: 2;
  color: var(--muted);
}

.hero-stats {
  display: flex;
  justify-content: center;
  margin-top: 46px;
}

.stat {
  padding: 0 36px;
  border-right: 1px solid #dce9e0;
}

.stat:last-child { border-right: 0; }

.stat strong {
  display: block;
  font-size: 26px;
  font-weight: 600;
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

.stat span {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .14em;
}

.scroll-hint {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 56px;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--muted);
  text-decoration: none;
}

.scroll-hint span {
  font-size: 17px;
  color: var(--green);
  animation: drift 2.4s ease-in-out infinite;
}

@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.gallery { padding-bottom: 24px; }

.chapter {
  padding: 68px 0;
  border-top: 1px solid var(--line);
}

.chapter:first-child { border-top: 0; }

.chapter-head {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 34px;
}

.chapter-index {
  font-size: 44px;
  font-weight: 300;
  line-height: 1;
  color: #b8d7c3;
  font-variant-numeric: tabular-nums;
}

.chapter-kicker {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--green);
}

.chapter-heading h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .02em;
}

.chapter-count {
  margin-left: auto;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 11px;
  color: var(--muted);
}

.chapter-body {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 48px;
  align-items: start;
}

.chapter:nth-child(even) .preview-card { order: 2; }

.preview-card {
  margin: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(43, 92, 62, .05);
  cursor: zoom-in;
  transition: transform .35s ease, box-shadow .35s ease;
}

.preview-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 46px rgba(43, 92, 62, .09);
}

.preview-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fbfdfb;
  border-radius: 10px;
}

.preview-card figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--muted);
}

.chapter-info { padding-top: 8px; }

.chapter:nth-child(even) .chapter-info { padding-top: 8px; }

.chapter-desc {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 2;
  color: #5b7063;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 34px;
}

.tag-list li {
  padding: 5px 11px;
  border: 1px solid #dcecdf;
  border-radius: 999px;
  background: var(--green-soft);
  font-size: 11px;
  color: var(--green-dark);
}

.file-list {
  display: grid;
  gap: 10px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: border-color .25s ease, background-color .25s ease, transform .25s ease;
}

.file-row:hover {
  border-color: #a9cfb6;
  background: #fbfefb;
  transform: translateX(3px);
}

.file-icon {
  flex: 0 0 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
}

.file-icon.is-pdf { background: #e7f3ea; color: #3f7d5b; }
.file-icon.is-code { background: #f0f4f1; color: #61776a; }

.file-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.file-text strong {
  font-size: 14px;
  font-weight: 600;
}

.file-text small {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-arrow {
  margin-left: auto;
  font-size: 18px;
  color: var(--green);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.22, .61, .36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .55);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 32px 0;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
}

.footer-inner p { margin: 0; }

.footer-inner a {
  color: var(--green-dark);
  text-decoration: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 48px;
  background: rgba(239, 247, 241, .95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: min(1000px, 92vw);
  max-height: 82vh;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(33, 75, 50, .14);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 900px) {
  .header-meta { display: none; }
  .chapter-body { grid-template-columns: 1fr; gap: 28px; }
  .chapter:nth-child(even) .preview-card { order: 0; }
  .chapter-info, .chapter:nth-child(even) .chapter-info { padding-top: 0; }
}

@media (max-width: 620px) {
  .container { width: min(100% - 32px, 1120px); }
  .header-inner { height: 62px; gap: 14px; }
  .brand-text small { display: none; }
  .chapter-nav { gap: 2px; overflow-x: auto; }
  .chapter-nav a { width: 30px; height: 30px; font-size: 11px; }
  .hero { padding: 84px 0 64px; }
  .hero-stats { flex-wrap: wrap; gap: 20px 0; }
  .stat { padding: 0 18px; }
  .stat strong { font-size: 22px; }
  .scroll-hint { margin-top: 40px; }
  .chapter { padding: 48px 0; }
  .chapter-head { gap: 14px; margin-bottom: 26px; }
  .chapter-index { font-size: 36px; }
  .chapter-heading h2 { font-size: 21px; }
  .chapter-count { display: none; }
  .preview-card { padding: 10px; border-radius: 14px; }
  .preview-card img { aspect-ratio: 4 / 3; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .lightbox { padding: 20px; }
  .lightbox-close { top: 12px; right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint span { animation: none; }
}
