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

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

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

body {
  margin: 0;
  background: #ffffff;
  color: #000000;
  font-family: Inter, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, ol, ul, figure, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; border-radius: 4px; }
a { color: #000000; }

:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 3px;
}

/* 左侧固定竖栏 */
.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 220px;
  padding: 22px 18px 26px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: #ffffff;
  border-right: 2px solid #000000;
  z-index: 30;
}

.mark {
  align-self: flex-start;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid #000000;
  border-radius: 4px;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: 21px;
  line-height: 1;
  text-decoration: none;
  overflow: hidden;
  transition: background 220ms ease, color 220ms ease;
}
.mark:hover { background: #000000; color: #ffffff; }

.menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.menu li {
  opacity: 0;
  transform: translateY(6px);
  animation: railIn 420ms ease forwards;
  animation-delay: calc(var(--d, 0ms) + 90ms);
}
@keyframes railIn { to { opacity: 1; transform: none; } }

.menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 8px;
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
  border-radius: 4px;
  transition: background 220ms ease, color 220ms ease, padding-left 220ms ease;
}
.menu a svg { width: 13px; height: 13px; flex: 0 0 auto; }
.menu a:hover,
.menu a:focus-visible {
  background: #000000;
  color: #ffffff;
  padding-left: 14px;
}

.find { margin-top: auto; }
.find-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  color: #000000;
  background: #ffffff;
  border: 1px solid #000000;
  border-radius: 4px;
  transition: background 220ms ease;
}
.find-input::placeholder { color: #6b6b6b; }
.find-input:focus { background: #f4f4f4; }

/* 内容区 */
.shell {
  margin-left: 220px;
  max-width: 1120px;
  padding: 0 44px;
}

main { display: block; }

.hero {
  min-height: 70vh;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 40px;
  padding: 56px 0 48px;
  border-bottom: 2px solid #000000;
}
.hero-fig {
  width: 132px;
  color: #000000;
}
.hero-fig svg { width: 100%; height: auto; }

small {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.22em;
  color: #000000;
  margin-bottom: 8px;
}

h1 {
  font-family: "Playfair Display", Inter, Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(38px, 6.4vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  overflow-wrap: break-word;
}

.lede {
  max-width: 44ch;
  font-size: 17px;
  line-height: 1.7;
  color: #1a1a1a;
}

/* 目录 + 正文 */
.sheet {
  display: grid;
  grid-template-columns: 206px minmax(0, 1fr);
  gap: 48px;
  padding: 40px 0 0;
}

.index {
  align-self: start;
  position: sticky;
  top: 24px;
  border: 1px solid #000000;
  border-radius: 4px;
  padding: 16px 14px 18px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  background: #ffffff;
}
.index h2 {
  font-size: 19px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
.toc li + li { border-top: 1px solid #e4e4e4; }
.toc a {
  display: block;
  padding: 9px 0;
  min-height: 40px;
  font-size: 16px;
  line-height: 1.45;
  text-decoration: none;
  transition: padding-left 200ms ease, font-weight 200ms ease;
}
.toc a:hover { padding-left: 6px; text-decoration: underline; text-underline-offset: 3px; }

.jump {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 14px;
  padding: 6px 12px;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-decoration: none;
  border: 1px solid #000000;
  border-radius: 4px;
  transition: background 220ms ease, color 220ms ease;
}
.jump:hover { background: #000000; color: #ffffff; }

.prose { min-width: 0; }
.prose > div {
  border-top: 1px solid #dcdcdc;
  margin-top: 44px;
  padding-top: 30px;
  scroll-margin-top: 24px;
}
.prose > div:first-child { border-top: 0; margin-top: 0; padding-top: 0; }

.prose h2 {
  font-family: "Playfair Display", Inter, Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.prose h3 {
  font-size: 20px;
  line-height: 1.4;
  font-weight: 700;
  margin: 26px 0 10px;
}
.prose p {
  max-width: 66ch;
  margin-bottom: 1.1em;
}
.prose > div > p:last-child { margin-bottom: 0; }
.prose ul, .prose ol {
  max-width: 64ch;
  margin: 0 0 1.2em;
  padding-left: 1.3em;
}
.prose ul { list-style: square; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.5em; }
.prose a { text-underline-offset: 3px; }
.prose figure { margin: 24px 0; }
.prose figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: #3a3a3a;
}
.prose blockquote {
  border-left: 3px solid #000000;
  padding-left: 18px;
  margin: 22px 0;
  font-size: 18px;
}
.prose strong { font-weight: 700; }

/* 页脚 */
footer {
  border-top: 2px solid #000000;
  margin-top: 76px;
  padding: 34px 0 46px;
  display: grid;
  gap: 30px;
  grid-template-columns: 1fr;
}
footer > div { min-width: 0; }

.huge {
  font-family: "Playfair Display", Inter, Georgia, serif;
  font-style: italic;
  font-size: clamp(38px, 9.5vw, 104px);
  line-height: 0.96;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.foot-toc h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
}
.toc.flat {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}
.toc.flat li + li { border-top: 0; }
.toc.flat a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 6px 0;
}
.toc.flat a:hover { padding-left: 0; }

.colophon {
  border-top: 1px solid #000000;
  padding-top: 18px;
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.06em;
}
.copy { margin-bottom: 8px; }
.colophon .jump { margin-top: 4px; }

/* 滚动显现 */
.rv {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 520ms ease, transform 520ms ease;
}
.rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .menu li { opacity: 1; transform: none; animation: none; }
  .menu a, .jump, .toc a, .mark { transition: none; }
}

/* 平板 */
@media (max-width: 980px) {
  .rail { width: 190px; }
  .shell { margin-left: 190px; padding: 0 28px; }
  .sheet { grid-template-columns: 1fr; gap: 28px; }
  .index { position: static; }
  .hero { grid-template-columns: 96px minmax(0, 1fr); gap: 26px; min-height: 56vh; }
  .hero-fig { width: 96px; }
}

/* 移动端 */
@media (max-width: 720px) {
  body { font-size: 17px; }
  .rail {
    position: static;
    width: auto;
    border-right: 0;
    border-bottom: 2px solid #000000;
    padding: 14px 18px 16px;
    gap: 12px;
  }
  .mark { width: 40px; height: 40px; font-size: 19px; }
  .menu {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .menu li { flex: 0 0 auto; }
  .menu a {
    min-height: 44px;
    border: 1px solid #000000;
    border-radius: 4px;
    padding: 10px 12px;
    white-space: nowrap;
  }
  .menu a:hover, .menu a:focus-visible { padding-left: 12px; }
  .find { margin-top: 2px; }

  .shell { margin-left: 0; max-width: none; padding: 0 18px; }

  .hero {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 26px 0 22px;
  }
  .hero-fig { width: 68px; }
  h1 { font-size: clamp(32px, 10vw, 46px); }
  .lede { font-size: 16px; }

  .sheet { padding-top: 24px; }
  .index { padding: 14px 14px 16px; box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06); }

  .prose > div {
    margin-top: 34px;
    padding-top: 22px;
    scroll-margin-top: 14px;
  }
  .prose p, .prose li { font-size: 17px; }

  footer { margin-top: 52px; padding-bottom: 36px; }
  .toc.flat { gap: 2px 18px; }
}

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