@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300&display=swap');

:root {
  --ink: #121212;
  --green: #1E3A2F;
  --bone: #F2EFE6;
  --green-08: rgba(30, 58, 47, .08);
  --green-16: rgba(30, 58, 47, .16);
  --green-32: rgba(30, 58, 47, .32);
  --ink-62: rgba(18, 18, 18, .62);
  --line: rgba(18, 18, 18, .14);
  --bone-62: rgba(242, 239, 230, .62);
  --serif: "Playfair Display", "Source Serif 4", Georgia, "Songti SC", "Noto Serif SC", serif;
  --body: "Source Serif 4", Georgia, "Songti SC", "Noto Serif SC", serif;
  --mono: "JetBrains Mono", ui-monospace, "Courier New", monospace;
  --r: 10px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.78;
  font-weight: 400;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1.05em; }

/* ---------- 顶部横向条 ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 66px;
  padding: 4px clamp(12px, 3vw, 34px);
  background: rgba(242, 239, 230, .95);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--line);
  transition: min-height .25s ease, box-shadow .25s ease;
}

.bar--slim { box-shadow: 0 6px 22px rgba(18, 18, 18, .1); }

.bar__nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
}

.bar__nav--l { justify-content: flex-end; }
.bar__nav--r { justify-content: flex-start; }

.bar__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 9px;
  font-size: 15px;
  line-height: 1.2;
  border-radius: var(--r);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.bar__link:hover,
.bar__link:focus-visible {
  color: var(--green);
  background: var(--green-08);
  border-bottom-color: var(--green);
}

.dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: .7;
}

.bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: var(--r);
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(15px, 1.9vw, 20px);
  letter-spacing: .02em;
  color: var(--green);
  white-space: nowrap;
}

.bar__mark { width: 26px; height: 26px; border-radius: 6px; }

.bar__cta {
  flex: 0 0 auto;
  padding: 11px 17px;
  margin-left: 6px;
  border: 1px solid var(--green);
  border-radius: var(--r);
  color: var(--green);
  font-size: 15px;
  line-height: 1.3;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}

.bar__cta:hover,
.bar__cta:focus-visible { background: var(--green); color: var(--bone); }

/* ---------- 满屏序章 ---------- */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 96px 20px 84px;
  overflow: hidden;
  isolation: isolate;
  perspective: 1px;
  background: var(--green);
  color: var(--bone);
}

.hero__figure {
  position: absolute;
  inset: -6% 0;
  z-index: 1;
  will-change: transform;
}

.hero__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(.2) contrast(1.06) brightness(.62);
}

.hero__figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 18, 18, .5), rgba(30, 58, 47, .72) 55%, var(--green) 100%);
}

.hero__ghost {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%) translateZ(-1px) scale(1.02);
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(3.4rem, 16.5vw, 15rem);
  line-height: .86;
  letter-spacing: -.03em;
  color: rgba(242, 239, 230, .14);
  white-space: nowrap;
  pointer-events: none;
  will-change: transform;
}

.hero__mid {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 40ch;
}

.hero__h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(1.9rem, 6.2vw, 4.2rem);
  line-height: 1.1;
  letter-spacing: -.015em;
  text-wrap: balance;
}

.hero__sub {
  margin: 20px auto 0;
  max-width: 34em;
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.65;
  color: var(--bone-62);
}

.hero__cue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 3;
  transform: translateX(-50%);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  letter-spacing: .32em;
  color: var(--bone-62);
}

.hero__cue span {
  display: block;
  width: 1px;
  height: 34px;
  background: linear-gradient(180deg, transparent, var(--bone-62));
}

/* ---------- 主体网格 ---------- */
main { padding: clamp(42px, 7vw, 98px) clamp(14px, 4vw, 40px); }

.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 262px;
  gap: clamp(26px, 4vw, 56px);
  align-items: start;
  max-width: 1130px;
  margin: 0 auto;
}

.col { min-width: 0; }

/* ---------- 正文 ---------- */
.prose { counter-reset: sec; }

.prose > section {
  position: relative;
  padding-bottom: clamp(34px, 4.6vw, 60px);
  margin-bottom: clamp(34px, 4.6vw, 60px);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 104px;
}

.prose > section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

.prose > section::before {
  counter-increment: sec;
  content: counter(sec, decimal-leading-zero);
  display: block;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .3em;
  color: var(--green-32);
}

.prose small {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: .26em;
  color: var(--green);
}

.prose h2 {
  margin: .08em 0 .5em;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -.012em;
  color: var(--green);
}

.prose h3 {
  margin: 1.5em 0 .45em;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.28rem;
  line-height: 1.35;
  color: var(--ink);
}

.prose h4 {
  margin: 1.3em 0 .4em;
  font-size: 1.05rem;
  line-height: 1.4;
}

.prose p { max-width: 64ch; }
.prose strong { font-weight: 600; }
.prose em { font-style: italic; }

.prose a {
  color: var(--green);
  border-bottom: 1px solid var(--green-32);
  transition: border-color .2s ease, background .2s ease;
}

.prose a:hover { border-bottom-color: var(--green); background: var(--green-08); }

.prose ul,
.prose ol { margin: 0 0 1.15em; padding-left: 1.3em; max-width: 60ch; }
.prose li { margin-bottom: .5em; }

.prose blockquote {
  margin: 1.4em 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--green);
  color: var(--ink-62);
  font-style: italic;
}

.prose figure {
  margin: 1.6em 0;
  border-bottom: 3px solid var(--green);
  border-radius: var(--r);
  overflow: hidden;
}

.prose figure img,
.prose > section > img { border-radius: var(--r); }

.prose figcaption {
  padding: 9px 12px;
  font-size: 15px;
  color: var(--ink-62);
  background: var(--green-08);
}

.prose table {
  width: 100%;
  margin: 1.4em 0;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th { background: var(--green-08); font-weight: 600; color: var(--green); }

.prose code {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--green-08);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ---------- 右侧栏 ---------- */
.side {
  position: sticky;
  top: 92px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--green);
  border-radius: var(--r);
  background: #EDE9DE;
}

.side__kicker {
  display: block;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: .3em;
  color: var(--green);
}

.side__title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink);
}

.side__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.side__list a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 11px;
  font-size: 15px;
  line-height: 1.35;
  border-radius: var(--r);
  border-bottom: 2px solid var(--green-16);
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.side__list a:hover,
.side__list a:focus-visible { background: var(--green-08); border-bottom-color: var(--green); color: var(--green); }

.side__dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 1px;
  background: var(--green-32);
}

/* ---------- 页脚 ---------- */
.foot {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.35fr) auto;
  gap: clamp(20px, 4vw, 52px);
  align-items: start;
  padding: clamp(30px, 5vw, 56px) clamp(14px, 4vw, 40px) clamp(26px, 4vw, 44px);
  background: var(--ink);
  color: var(--bone);
}

.foot__word {
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(1.65rem, 4.2vw, 2.9rem);
  line-height: 1.02;
  letter-spacing: -.015em;
  word-break: break-word;
  color: var(--bone);
}

.foot__nav dl {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.foot__nav dt {
  width: 100%;
  margin-bottom: 2px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .28em;
  color: rgba(242, 239, 230, .5);
}

.foot__nav dd { margin: 0; }

.foot__nav a {
  display: inline-block;
  min-height: 40px;
  padding: 9px 11px;
  font-size: 15px;
  line-height: 1.3;
  border-radius: var(--r);
  border-bottom: 2px solid rgba(242, 239, 230, .18);
  color: var(--bone-62);
  transition: color .2s ease, border-color .2s ease;
}

.foot__nav a:hover,
.foot__nav a:focus-visible { color: var(--bone); border-bottom-color: var(--bone); }

.foot__end { text-align: right; }

.foot__copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(242, 239, 230, .55);
}

/* ---------- 滚动触发 ---------- */
html.js .prose > section,
html.js .side {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1);
}

html.js .prose > section.in,
html.js .side.in { opacity: 1; transform: none; }

html.js.rm .prose > section,
html.js.rm .side { opacity: 1; transform: none; transition: none; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

/* ---------- 断点 ---------- */
@media (max-width: 1080px) {
  .bar__link { font-size: 14px; padding: 12px 7px; }
  .bar__cta { padding: 11px 13px; }
}

@media (max-width: 920px) {
  html { scroll-padding-top: 128px; }

  .bar {
    flex-wrap: wrap;
    gap: 0 8px;
    min-height: 0;
    padding: 4px 12px 6px;
  }

  .bar__brand { order: 1; flex: 1 1 auto; justify-content: flex-start; padding: 12px 4px; }
  .bar__cta { order: 2; margin-left: 0; padding: 11px 14px; }

  .bar__nav {
    order: 3;
    flex: 1 1 100%;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .bar__nav::-webkit-scrollbar { display: none; }
  .bar__link { font-size: 15px; padding: 11px 8px; }

  .hero { padding: 92px 18px 78px; }
  .prose > section { scroll-margin-top: 132px; }

  .wrap { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }

  .foot { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .foot__end { text-align: left; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  .bar__brand { font-size: 15px; padding: 12px 2px; }
  .hero__ghost { font-size: clamp(2.6rem, 15vw, 4rem); }
  .hero__cue { font-size: 14px; letter-spacing: .22em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .prose > section,
  html.js .side { opacity: 1; transform: none; transition: none; }
  .hero__figure,
  .hero__ghost { will-change: auto; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
