@import url('https://fonts.googleapis.com/css2?family=Lexend+Mega:wght@100..900&family=Public+Sans:wght@100..900&display=swap');

:root {
  --ink: #000000;
  --paper: #ffffff;
  --ui: 'Lexend Mega', 'Helvetica Neue', Arial, sans-serif;
  --txt: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pad: clamp(1rem, 4.5vw, 4rem);
  --bar: 104px;
}

*,
*::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(--txt);
  font-size: 16px;
  line-height: 1.6;
  padding-bottom: calc(var(--bar) + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--ink);
}

div[id] {
  scroll-margin-top: 1.5rem;
}

/* 底部固定条 */
.hdr {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--ink);
  color: var(--paper);
  border-top: 2px solid var(--ink);
  padding: 0.5rem 0.85rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

.mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-family: var(--ui);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.03em;
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.3rem 0.25rem;
}

.hdr-nav {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.hdr-nav::-webkit-scrollbar {
  display: none;
}

.hdr-nav p {
  display: flex;
  gap: 0.35rem;
  margin: 0;
  justify-content: flex-end;
}

.hdr-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.45rem 0.85rem;
  border: 1.5px solid var(--paper);
  border-radius: 999px;
  color: var(--paper);
  text-decoration: none;
  font-family: var(--ui);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.hdr-nav a:hover,
.hdr-nav a:focus-visible {
  background: var(--paper);
  color: var(--ink);
  outline: none;
}

/* 头图 */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 3px solid var(--ink);
}

.hero-plain {
  background: repeating-linear-gradient(135deg, #000 0 22px, #111 22px 44px);
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: grayscale(1) contrast(1.12);
  transition: opacity 1.1s ease;
}

.hero-media img.on {
  opacity: 1;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(205deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.55) 52%, rgba(0, 0, 0, 0.92) 100%);
}

.hero-in {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 52rem;
  margin-left: auto;
  text-align: right;
  padding: clamp(1.5rem, 5vw, 4rem) clamp(1.25rem, 5vw, 4rem)
    calc(clamp(1.5rem, 5vw, 4rem) + 5.5rem);
}

.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--ui);
  font-weight: 800;
  font-size: clamp(2.1rem, 7.4vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  word-break: break-word;
}

.hero-lede {
  margin: 0 0 1.6rem auto;
  max-width: 30ch;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.65;
}

.hero-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.6rem 1.6rem;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--paper);
  font-family: var(--ui);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: background 0.18s ease, color 0.18s ease;
}

.hero-go:hover,
.hero-go:focus-visible {
  background: transparent;
  color: var(--paper);
  outline: none;
}

/* 主体栅格 */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.spread {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15.5rem;
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: start;
  padding: clamp(2rem, 5vw, 4.5rem) 0;
}

.prose {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  overflow-wrap: break-word;
}

.rail {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 1.5rem;
  border-left: 4px solid var(--ink);
  padding-left: 1rem;
}

.rail small {
  display: block;
  font-family: var(--ui);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.24em;
  margin-bottom: 0.2rem;
}

.rail-title {
  margin: 0 0 0.85rem;
  font-family: var(--ui);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 40px;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--ink);
  text-decoration: none;
  font-size: 1rem;
  line-height: 1.4;
}

.toc a:hover,
.toc a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  outline: none;
}

.toc span {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.65;
  flex: 0 0 1.5em;
}

/* 正文 */
.prose > div {
  background: var(--paper);
  border-top: 6px solid var(--ink);
  box-shadow: 0 22px 40px -28px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(0, 0, 0, 0.08);
  padding: clamp(1.25rem, 3vw, 2.75rem);
  margin: 0 0 clamp(1.75rem, 3.5vw, 2.75rem);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.prose > div.pre {
  opacity: 0;
  transform: translateY(24px);
}

.prose > div.in {
  opacity: 1;
  transform: none;
}

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

.prose small {
  display: block;
  font-family: var(--ui);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  margin-bottom: 0.3rem;
}

.prose h2 {
  margin: 0 0 1rem;
  font-family: var(--ui);
  font-weight: 800;
  font-size: clamp(1.55rem, 3.6vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.prose h3 {
  margin: 1.6rem 0 0.7rem;
  font-family: var(--ui);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.prose p {
  margin: 0 0 1.1em;
  max-width: 68ch;
  line-height: 1.78;
}

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

.prose div > p:first-of-type::first-letter {
  float: left;
  font-family: var(--ui);
  font-weight: 800;
  font-size: 3.3em;
  line-height: 0.82;
  padding: 0.06em 0.14em 0 0;
}

.prose a {
  text-underline-offset: 0.2em;
}

.prose ul,
.prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.35rem;
  max-width: 68ch;
}

.prose li {
  margin-bottom: 0.45em;
  line-height: 1.7;
}

.prose blockquote {
  margin: 1.4rem 0;
  padding: 0.4rem 0 0.4rem 1.2rem;
  border-left: 6px solid var(--ink);
  font-family: var(--ui);
  font-weight: 600;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.5;
  letter-spacing: -0.015em;
}

.prose blockquote p {
  margin-bottom: 0.6em;
}

.prose figure {
  margin: 1.4rem 0;
}

.prose figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
  border-top: 1px solid var(--ink);
  padding-top: 0.4rem;
}

.prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin-bottom: 1.1em;
  font-size: 0.95rem;
}

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

/* 页脚 */
.ftr {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(2rem, 5vw, 4rem) var(--pad) 1.25rem;
  border-top: 3px solid var(--ink);
}

.ftr-top {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
}

.ftr-mark {
  margin: 0 0 1rem;
  font-family: var(--ui);
  font-weight: 800;
  font-size: clamp(2.3rem, 11vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  word-break: break-word;
}

.ftr address {
  font-style: normal;
  max-width: 34ch;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.86);
}

.ftr-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 1.5rem;
}

.ftr-links li {
  break-inside: avoid;
}

.ftr-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: 0.35rem;
}

.ftr-links a:hover,
.ftr-links a:focus-visible {
  background: var(--paper);
  color: var(--ink);
  outline: none;
}

.ftr-legal {
  max-width: 1240px;
  margin: 2rem auto 0;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.32);
  font-size: 1rem;
  line-height: 1.5;
}

@media (min-width: 760px) {
  .ftr-top {
    grid-template-columns: 1.35fr 1fr;
    align-items: start;
  }
}

@media (max-width: 880px) {
  .spread {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    grid-column: 1;
    grid-row: 1;
    position: static;
  }
  .prose {
    grid-row: 2;
  }
  .toc {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1rem;
  }
}

@media (max-width: 620px) {
  :root {
    --bar: 116px;
  }
  .hdr {
    flex-wrap: wrap;
    row-gap: 0.2rem;
    padding: 0.45rem 0.7rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  }
  .mark {
    order: 1;
  }
  .hdr-nav {
    order: 2;
    flex-basis: 100%;
  }
  .hdr-nav p {
    justify-content: flex-start;
  }
  .hero-in {
    text-align: left;
    padding-bottom: calc(1.5rem + 7rem);
  }
  .hero-lede {
    margin-left: 0;
    max-width: 32ch;
  }
  .toc {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .prose > div {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-media img {
    transition: none;
  }
}

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