@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:wght@400;600;700&family=EB+Garamond:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #000000;
  --paper: #ffffff;
  --hair: rgba(0, 0, 0, 0.14);
  --hair-inv: rgba(255, 255, 255, 0.28);
  --soft: rgba(255, 255, 255, 0.72);
  --serif: 'EB Garamond', 'Crimson Text', 'Songti SC', 'Noto Serif CJK SC', 'Source Han Serif SC', serif;
  --radius: 28px;
  --shadow: 0 22px 60px -34px rgba(0, 0, 0, 0.62);
  --gutter: clamp(1.15rem, 4vw, 2.5rem);
  --page: 78rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.78;
  letter-spacing: 0.012em;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
hr { border: 0; border-top: 1px solid var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- 页头 ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 70;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.head-brand {
  display: flex;
  justify-content: center;
  padding: 0.7rem var(--gutter) 0.1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.head-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  padding: 0.1rem var(--gutter) 0.7rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.05rem;
}

.navlink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.1rem;
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.navlink:hover,
.navlink:focus-visible { border-bottom-color: var(--ink); }

.search { margin: 0; }
.search-field { display: block; }

.search input {
  width: 11.5rem;
  min-height: 44px;
  padding: 0.45rem 0.95rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 999px;
}

.search input::placeholder { color: rgba(0, 0, 0, 0.55); }

/* ---------- 首屏 ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.75rem, 4vw, 3rem);
  min-height: 100svh;
  padding: clamp(3rem, 8vw, 6rem) var(--gutter) clamp(2.5rem, 6vw, 4rem);
  text-align: center;
}

.hero h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(2.7rem, 8.6vw, 8.5rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.hero-figure {
  margin: 0;
  width: min(100%, 44rem);
  will-change: transform;
}

.hero-img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- 正文与右侧侧栏 ---------- */
.body-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: clamp(2rem, 5vw, 4.5rem);
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(4rem, 9vw, 7rem);
}

.prose {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  max-width: 46rem;
}

.toc {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  position: sticky;
  top: 10.5rem;
  padding: 1.5rem 1.4rem 1.1rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--paper);
}

.toc h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.toc hr { margin: 0.7rem 0 0.6rem; }

.toclink {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.1rem 0;
  font-size: 1rem;
  line-height: 1.35;
  text-decoration: none;
  border-bottom: 1px solid var(--hair);
}

.toclink:last-child { border-bottom: 0; }
.toclink:hover { text-decoration: underline; text-underline-offset: 0.22em; }

/* ---------- 正文排版 ---------- */
.prose div[id] {
  scroll-margin-top: 11rem;
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  border-top: 1px solid var(--ink);
}

.prose div[id]:first-child {
  padding-top: 0;
  border-top: 0;
}

.prose h2 {
  margin: 0 0 0.15rem;
  font-size: clamp(1.55rem, 3.4vw, 2.5rem);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -0.022em;
}

.prose h3 {
  margin: 2rem 0 0.2rem;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  line-height: 1.3;
  font-weight: 600;
}

.prose hr { margin: 0.85rem 0 1.55rem; }
.prose p { margin: 0 0 1.15rem; }
.prose ul,
.prose ol { margin: 0 0 1.25rem; padding-left: 1.35rem; }
.prose li { margin: 0.35rem 0; }
.prose a { text-decoration: underline; text-underline-offset: 0.2em; }

.prose blockquote {
  margin: 1.7rem 0;
  padding: 0.25rem 0 0.25rem 1.3rem;
  border-left: 3px solid var(--ink);
  font-size: 1.1rem;
}

.prose figure { margin: 1.8rem 0; }

.prose img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4rem;
  font-size: 1rem;
}

.prose th,
.prose td {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--hair);
  text-align: left;
}

.prose th { font-weight: 600; }

/* ---------- 页脚 ---------- */
.site-foot {
  background: var(--ink);
  color: var(--paper);
}

.site-foot div {
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter);
  border-top: 1px solid var(--hair-inv);
}

.site-foot div:first-child { border-top: 0; }

.foot-cta {
  text-align: center;
  padding-top: clamp(3rem, 8vw, 6rem) !important;
}

.cta-title {
  margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
  font-size: clamp(2.8rem, 11vw, 9rem);
  line-height: 0.92;
  font-weight: 800;
  letter-spacing: -0.05em;
  word-break: break-word;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.55rem 1.7rem;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid var(--paper);
  border-radius: 999px;
}

.cta-link:hover { background: var(--paper); color: var(--ink); }

.foot-nav { max-width: var(--page); margin: 0 auto; }

.foot-nav dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.15rem 2rem;
  margin: 0;
}

.foot-nav dt {
  grid-column: 1 / -1;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  color: var(--soft);
}

.foot-nav dd { margin: 0; }

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.02rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.foot-nav a:hover,
.foot-nav a:focus-visible { border-bottom-color: var(--paper); }

.foot-legal {
  text-align: center;
  font-size: 0.95rem;
  color: var(--soft);
}

.foot-legal p { margin: 0; }

/* ---------- 入场 ---------- */
.reveal-on [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-on [data-reveal].in {
  opacity: 1;
  transform: none;
}

/* ---------- 断点 ---------- */
@media (max-width: 920px) {
  .body-block { grid-template-columns: minmax(0, 1fr); }

  .prose,
  .toc {
    grid-column: 1;
    grid-row: auto;
  }

  .prose { max-width: none; }

  .toc {
    position: static;
    margin-bottom: clamp(1.75rem, 5vw, 2.75rem);
  }

  .toclink { min-height: 48px; }
  .prose div[id] { scroll-margin-top: 13rem; }
}

@media (max-width: 760px) {
  .head-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .nav { justify-content: center; }
  .search input { width: 100%; }
  .hero { min-height: 88svh; }
}

@media (max-width: 420px) {
  .foot-nav dl { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal-on [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-figure { transform: none !important; }
}

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