@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --paper: #fdfbf7;
  --mist: #f5f5f5;
  --ink: #1a1a1a;
  --line: #e0e0e0;
  --soft: #4b4b4b;
  --ui: "Space Grotesk", "Inter", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --read: "Songti SC", "Noto Serif SC", Georgia, "SimSun", serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.26;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.32'/%3E%3C/svg%3E");
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  z-index: 120;
  text-decoration: none;
  font-size: 16px;
}

.skip:focus {
  left: 12px;
  top: 12px;
}

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

.strip {
  margin: 0;
  padding: 6px 14px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.28em;
  color: #5c5c5c;
  background: var(--mist);
  border-bottom: 1px solid var(--line);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px 14px;
  padding: 4px 18px;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 4px;
  flex: 1 1 0;
  margin: 0;
  min-width: 0;
}

.nav-r {
  justify-content: flex-end;
}

.nav-side a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 16px;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.nav-side a:hover,
.nav-side a[aria-current="true"] {
  border-bottom-color: var(--ink);
}

.brand {
  flex: 0 0 auto;
  font-family: var(--ui);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 0.06em;
  text-decoration: none;
  padding: 10px 6px;
  white-space: nowrap;
}

/* 主区 */
main {
  display: block;
}

.hero {
  position: relative;
  min-height: 45vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: 56px 20px 64px;
  border-bottom: 1px solid var(--line);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 44px));
  background-color: var(--mist);
  background-image: radial-gradient(var(--ink) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0;
}

.hero-fig {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: -1;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(1.04);
  opacity: 0.2;
  mix-blend-mode: multiply;
}

.hero-fig figcaption {
  position: absolute;
  right: 16px;
  bottom: 20px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--soft);
}

.hero-copy {
  position: relative;
  max-width: 760px;
  text-align: center;
  background: rgba(253, 251, 247, 0.86);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 26px 24px 28px;
  box-shadow: 0 18px 40px -32px rgba(26, 26, 26, 0.55);
  animation: rise 0.3s steps(4, end) both;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 6vw, 3.1rem);
  line-height: 1.14;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.lede {
  margin: 0;
  font-family: var(--read);
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--soft);
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 44px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 22px 72px;
  align-items: start;
}

/* 正文：由 page.content 插入的 section 落成纸卡 */
.prose > section,
.prose > div,
.prose > article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 26px 26px 30px;
  margin: 0 0 26px;
  box-shadow: 0 22px 40px -34px rgba(26, 26, 26, 0.7);
  scroll-margin-top: 132px;
  animation: rise 0.34s steps(4, end) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

.prose > section:last-child,
.prose > div:last-child,
.prose > article:last-child {
  margin-bottom: 0;
}

.prose h2 {
  margin: 0 0 6px;
  font-size: clamp(1.28rem, 3.2vw, 1.62rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.prose h3 {
  margin: 26px 0 4px;
  font-size: 1.16rem;
  line-height: 1.4;
}

.prose p,
.prose li {
  font-family: var(--read);
  font-size: 1.02rem;
  line-height: 1.85;
  color: #232323;
}

.prose p {
  margin: 0 0 14px;
}

.prose ul,
.prose ol {
  margin: 0 0 16px;
  padding-left: 1.25em;
}

.prose li {
  margin: 0 0 6px;
}

.prose a {
  text-decoration: underline;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.prose blockquote {
  margin: 0 0 16px;
  padding: 12px 18px;
  border-left: 3px solid var(--ink);
  background: var(--mist);
  border-radius: 0 18px 18px 0;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose figure {
  margin: 0 0 18px;
}

.prose figcaption {
  font-size: 14px;
  color: var(--soft);
  margin-top: 8px;
}

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

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 9px 11px;
  text-align: left;
}

.prose th {
  background: var(--mist);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 12px 0 18px;
}

/* 侧栏 */
.side {
  position: sticky;
  top: 126px;
  align-self: start;
  padding-left: 20px;
  border-left: 1px solid var(--line);
  font-size: 16px;
}

.side h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.22em;
  color: var(--soft);
}

.side hr {
  margin: 10px 0 6px;
}

.side-links {
  display: flex;
  flex-direction: column;
}

.side-links a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 0;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
}

.side-links a:hover,
.side-links a[aria-current="true"] {
  text-decoration: underline;
}

.side-back {
  margin: 16px 0 0;
}

.side-back a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  font-size: 16px;
}

/* 页脚 */
.site-foot {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 0.8fr;
  gap: 26px 30px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 22px 0;
  border-top: 2px solid var(--ink);
}

.site-foot article {
  min-width: 0;
}

.mega {
  margin: 0;
  font-size: clamp(2rem, 5.4vw, 3.1rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.mega a {
  text-decoration: none;
}

.foot-col h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.22em;
  color: var(--soft);
  font-weight: 500;
}

.foot-col hr {
  margin: 8px 0 4px;
}

.foot-col p {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.foot-col a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 0;
  font-size: 16px;
  text-decoration: none;
}

.foot-col a:hover {
  text-decoration: underline;
}

.foot-up a {
  text-decoration: underline;
}

.foot-bottom {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding: 18px 0 34px;
  text-align: center;
}

.copy {
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--soft);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero-copy,
  .prose > article,
  .prose > div,
  .prose > section {
    animation: none;
  }
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }
  .side {
    position: static;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px 0 0;
  }
  .site-foot {
    grid-template-columns: 1fr 1fr;
  }
  .mega {
    font-size: 2rem;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }
  .site-nav {
    flex-wrap: wrap;
    padding: 6px 12px 8px;
    gap: 2px 10px;
  }
  .brand {
    order: -1;
    flex: 1 1 100%;
    text-align: center;
    padding: 8px 0 2px;
    border-bottom: 1px solid var(--line);
  }
  .nav-side {
    flex: 1 1 100%;
    gap: 0 2px;
  }
  .nav-r {
    justify-content: flex-start;
  }
  .nav-side a {
    padding: 8px 9px;
    font-size: 16px;
  }
  .hero {
    min-height: 40vh;
    padding: 40px 16px 56px;
  }
  .hero-copy {
    padding: 20px 16px 22px;
    border-radius: 22px;
  }
  .shell {
    padding: 30px 14px 56px;
  }
  .prose > article,
  .prose > div,
  .prose > section {
    padding: 20px 16px 24px;
    border-radius: 22px;
    scroll-margin-top: 168px;
  }
  .site-foot {
    padding: 34px 16px 0;
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .mega {
    font-size: 2.2rem;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }
  .foot-bottom {
    padding: 16px 0 30px;
  }
}

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