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

:root {
  --paper: #ffffff;
  --mist: #f5f5f5;
  --ink: #1f1f1f;
  --soft: #66666c;
  --line: #e7e7ea;
  --rail: 262px;
  --card: 10px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-up: 0 12px 26px rgba(0, 0, 0, 0.09);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding-left: var(--rail);
  background: var(--mist);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.68;
  overflow-x: hidden;
}

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

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 左侧固定竖排 ---------- */

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px 28px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.rail-brand a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--ink);
  color: #fff;
  font-family: Calistoga, Georgia, serif;
  font-size: 21px;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s var(--ease);
}

.rail-brand a:hover {
  transform: translateY(-2px);
}

.rail-brand img {
  width: 46px;
  height: 46px;
  object-fit: cover;
}

.rail-search input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: 999px;
  appearance: none;
}

.rail-search input::placeholder {
  color: #93939a;
}

.rail-nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rail-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 11px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  transition: background 0.18s var(--ease), transform 0.18s var(--ease);
}

.rail-nav a:hover {
  background: var(--mist);
  transform: translateX(3px);
}

.rail-nav .num {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #a2a2a9;
}

.rail-nav a[aria-current="page"] {
  background: var(--ink);
  color: #fff;
}

.rail-nav a[aria-current="page"] .num {
  color: rgba(255, 255, 255, 0.62);
}

/* ---------- 版心 ---------- */

.page {
  max-width: 1320px;
  margin: 0 auto;
}

/* ---------- Hero ---------- */

.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  align-items: center;
  gap: 48px;
  padding: 92px 48px 72px;
}

.hero-copy h1 {
  font-family: Calistoga, Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.15rem, 4.8vw, 3.9rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 20px;
}

.lede {
  margin: 0 0 28px;
  max-width: 36ch;
  font-size: 17px;
  color: var(--soft);
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-up);
}

.hero-art {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  max-height: 74vh;
  border-radius: 26px;
  overflow: hidden;
  background: #ebebee;
  box-shadow: var(--shadow);
}

.hero-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.75s var(--ease);
}

.hero-art img:first-child,
.hero-art img.is-on {
  opacity: 1;
}

/* ---------- 正文 + 右栏 ---------- */

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  align-items: start;
  gap: 30px;
  padding: 0 48px 84px;
}

.prose {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.prose > * {
  grid-column: span 6;
  min-width: 0;
}

.prose > article {
  background: var(--paper);
  border-radius: var(--card);
  border-bottom: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 28px 26px;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.prose > article:nth-child(3n + 2) {
  grid-column: span 4;
}

.prose > article:hover {
  transform: scale(1.012);
  box-shadow: var(--shadow-up);
}

.prose h2 {
  font-family: Calistoga, Georgia, serif;
  font-weight: 400;
  font-size: 1.55rem;
  line-height: 1.28;
  margin: 0 0 12px;
}

.prose h3 {
  font-family: Calistoga, Georgia, serif;
  font-weight: 400;
  font-size: 1.18rem;
  margin: 22px 0 8px;
}

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

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

.prose ul,
.prose ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.prose li {
  margin-bottom: 6px;
}

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

.prose blockquote {
  margin: 0 0 14px;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--ink);
  color: var(--soft);
}

.prose figure,
.prose img {
  margin: 0 0 14px;
  border-radius: 10px;
}

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

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

.prose :is(article, div)[id] {
  scroll-margin-top: 96px;
}

.side {
  position: sticky;
  top: 24px;
  background: var(--paper);
  border-radius: var(--card);
  border-bottom: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 22px 18px;
}

.side h2 {
  font-family: Calistoga, Georgia, serif;
  font-weight: 400;
  font-size: 1.15rem;
  margin: 0 0 4px;
}

.side .subtitle {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--soft);
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.side-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 6px;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  border-radius: 8px;
  transition: background 0.18s var(--ease);
}

.side-list li:last-child a {
  border-bottom: 0;
}

.side-list a:hover {
  background: var(--mist);
}

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

.foot {
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 56px 48px 26px;
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  max-width: 1220px;
}

.foot dl {
  margin: 0;
}

.foot dt {
  font-family: Calistoga, Georgia, serif;
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.foot dd {
  margin: 0;
  font-size: 16px;
  color: var(--soft);
}

.foot dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 0;
  text-decoration: none;
  color: var(--ink);
}

.foot dd a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.foot-brand dd {
  max-width: 34ch;
}

.foot-mark {
  font-family: Calistoga, Georgia, serif;
  font-size: clamp(2.6rem, 11vw, 8.6rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin: 46px 0 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.foot-copy {
  margin: 0;
  font-size: 16px;
  color: var(--soft);
}

/* ---------- 入场 ---------- */

.has-js .prose > article,
.has-js .side {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), box-shadow 0.22s var(--ease);
}

.has-js .prose > article.in,
.has-js .side.in {
  opacity: 1;
  transform: none;
}

.has-js .prose > article:nth-child(2n).in {
  transition-delay: 60ms;
}

.has-js .prose > article:nth-child(3n).in {
  transition-delay: 110ms;
}

.has-js .prose > article.in:hover {
  transform: scale(1.012);
}

/* ---------- 窄屏 ---------- */

@media (max-width: 1080px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) 258px;
    padding: 0 32px 72px;
  }

  .hero {
    padding: 80px 32px 60px;
    gap: 32px;
  }
}

@media (max-width: 900px) {
  body {
    padding-left: 0;
    padding-top: 116px;
  }

  .rail {
    inset: 0 0 auto 0;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    padding: 11px 14px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .rail-brand a,
  .rail-brand img {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    font-size: 18px;
  }

  .rail-search {
    flex: 1 1 130px;
  }

  .rail-search input {
    height: 40px;
  }

  .rail-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .rail-nav ol {
    flex-direction: row;
    gap: 8px;
  }

  .rail-nav a {
    white-space: nowrap;
    padding: 8px 13px;
  }

  .hero {
    min-height: calc(100vh - 116px);
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 26px;
    padding: 14px 18px 44px;
  }

  .hero-art {
    aspect-ratio: 3 / 2;
    max-height: none;
    border-radius: 18px;
  }

  .lede {
    max-width: none;
  }

  .stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 0 18px 56px;
  }

  .side {
    position: static;
    order: -1;
  }

  .prose {
    grid-template-columns: minmax(0, 1fr);
  }

  .prose > *,
  .prose > article:nth-child(3n + 2) {
    grid-column: 1 / -1;
  }

  .prose > article {
    padding: 22px 18px;
  }

  .prose :is(article, div)[id] {
    scroll-margin-top: 126px;
  }

  .foot {
    padding: 42px 18px 22px;
  }

  .foot-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .foot-mark {
    margin-top: 32px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }

  .has-js .prose > article,
  .has-js .side {
    opacity: 1;
    transform: none;
  }
}

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