@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --rail: 132px;
  --font: "Plus Jakarta Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

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

body {
  margin: 0;
  padding-left: var(--rail);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 800; line-height: 1.12; }

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

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

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

/* ---------- 固定竖排导航 ---------- */

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.1rem 0.9rem 1.4rem;
  background: var(--paper);
  border-right: 2px solid var(--ink);
  overflow-y: auto;
}

.mark {
  align-self: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  text-decoration: none;
  overflow: hidden;
}

.mark-glyph {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.mark-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: var(--ink);
}

.pills {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1 1 auto;
}

.pill {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.7rem 0.4rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.pill:hover,
.pill:focus-visible {
  background: var(--ink);
  color: var(--paper);
  transform: translateX(3px);
}

.search { flex: 0 0 auto; }

.q {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.7rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.3;
}

.q::placeholder { color: var(--ink); opacity: 0.55; }

/* ---------- 头图 ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  border-bottom: 2px solid var(--ink);
}

.hero-media {
  margin: 0;
  position: relative;
  overflow: hidden;
  background-color: var(--paper);
  background-image: radial-gradient(var(--ink) 1.3px, transparent 1.3px);
  background-size: 22px 22px;
  border-right: 2px solid var(--ink);
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08);
  will-change: transform;
}

.hero-swatch {
  position: absolute;
  inset: 12%;
  background: var(--ink);
  border-radius: 4px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.8rem;
  padding: 4rem clamp(1.5rem, 5vw, 4.5rem);
  text-align: center;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.9rem, 8.5vw, 7.5rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1.02;
  word-break: break-word;
}

.lead {
  margin: 0;
  max-width: 32ch;
  padding-top: 1.3rem;
  border-top: 2px solid var(--ink);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.6;
}

/* ---------- 正文与侧栏 ---------- */

.split {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  border-bottom: 2px solid var(--ink);
}

.side {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
  padding: 3rem 1.6rem 3rem 1.2rem;
  border-right: 2px solid var(--ink);
}

.side h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  letter-spacing: -0.035em;
}

.subtitle {
  margin: 0.4rem 0 1.8rem;
  font-size: 16px;
  opacity: 0.6;
  letter-spacing: 0.02em;
}

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

.side-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  font-size: 16px;
  text-decoration: none;
  transition: padding-left 160ms ease;
}

.side-link:last-child { border-bottom: 1px solid rgba(0, 0, 0, 0.15); }

.side-link:hover { padding-left: 0.7rem; }

.doc {
  padding: 3.5rem clamp(1.2rem, 5vw, 5.5rem) 6rem;
  max-width: 76ch;
}

.doc div {
  border-top: 2px solid var(--ink);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}

.doc div:first-child {
  border-top: 0;
  padding-top: 0.5rem;
}

.doc h2 {
  margin: 0 0 1.3rem;
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.doc h3 {
  margin: 2rem 0 0.8rem;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.doc p { margin: 0 0 1.1rem; }

.doc ul,
.doc ol { margin: 0 0 1.2rem; padding-left: 1.35rem; }

.doc li { margin-bottom: 0.4rem; }

.doc a { text-underline-offset: 3px; }

.doc figure {
  margin: 1.8rem 0;
  background: var(--ink);
  border-radius: 4px;
  overflow: hidden;
}

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

.doc blockquote {
  margin: 1.8rem 0;
  padding: 0.4rem 0 0.4rem 1.3rem;
  border-left: 6px solid var(--ink);
  font-size: 1.15rem;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.doc th,
.doc td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  text-align: left;
  vertical-align: top;
}

.doc pre {
  overflow-x: auto;
  padding: 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  font-size: 16px;
  line-height: 1.6;
}

/* ---------- 页脚 ---------- */

.foot {
  background: var(--ink);
  color: var(--paper);
  padding: 4.5rem clamp(1.2rem, 5vw, 4.5rem) 2rem;
}

.foot-hero {
  margin: 0;
  font-size: clamp(3rem, 13vw, 10rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.92;
  word-break: break-word;
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
}

.foot dl { margin: 0; }

.foot dt {
  margin-bottom: 0.9rem;
  font-size: 0.875rem;
  letter-spacing: 0.16em;
  opacity: 0.65;
}

.foot dd {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  word-break: break-word;
}

.foot dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease;
}

.foot dd a:hover { border-color: var(--paper); }

.foot-bottom {
  margin: 3rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.95rem;
  opacity: 0.7;
}

/* ---------- 移动端 ---------- */

@media (max-width: 900px) {
  body {
    padding-left: 0;
    padding-bottom: 86px;
    font-size: 16px;
  }

  .rail {
    inset: auto 0 0 0;
    width: auto;
    height: 74px;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border-right: 0;
    border-top: 2px solid var(--ink);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .mark {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 60;
    border: 2px solid var(--ink);
    background: var(--paper);
    color: var(--ink);
  }

  .pills {
    flex-direction: row;
    flex: 0 0 auto;
    gap: 0.5rem;
  }

  .pill {
    flex: 0 0 auto;
    min-height: 46px;
    padding: 0 1.1rem;
    white-space: nowrap;
    transform: none;
  }

  .pill:hover { transform: none; }

  .search { display: none; }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 4.2rem;
  }

  .hero-copy {
    order: -1;
    padding: 1.5rem 1.2rem 2.2rem;
  }

  .hero-media {
    border-right: 0;
    border-top: 2px solid var(--ink);
    height: 46vh;
    min-height: 260px;
  }

  .split { grid-template-columns: 1fr; }

  .side {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 2rem 1.2rem;
    border-right: 0;
    border-bottom: 2px solid var(--ink);
  }

  .doc {
    padding: 2rem 1.2rem 3.5rem;
    max-width: none;
  }

  .doc div { padding: 2rem 0; }

  .foot { padding: 3rem 1.2rem 1.6rem; }

  .foot-cols {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}

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