@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');

:root {
  --ink: #1f1f1f;
  --paper: #ffffff;
  --wash: #f5f5f5;
  --mute: #666666;
  --line: rgba(31, 31, 31, .12);
  --e1: 0 1px 2px rgba(31, 31, 31, .05), 0 2px 6px rgba(31, 31, 31, .05);
  --e2: 0 4px 10px rgba(31, 31, 31, .06), 0 12px 24px rgba(31, 31, 31, .06);
  --e3: 0 10px 22px rgba(31, 31, 31, .09), 0 24px 48px rgba(31, 31, 31, .08);
  --e4: 0 18px 40px rgba(31, 31, 31, .13), 0 44px 84px rgba(31, 31, 31, .11);
  --r: 28px;
  --bar: 108px;
  --shell: 1180px;
  --sans: "Inter", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Playfair Display", Georgia, "Songti SC", "SimSun", serif;
}

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

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

body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 84% -12%, #ffffff 0%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(880px 460px at -6% 26%, #ffffff 0%, rgba(255, 255, 255, 0) 58%),
    var(--wash);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
p { margin: 0 0 14px; }
img { max-width: 100%; height: auto; }

/* ---------- 顶部 ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid var(--line);
}

.mnav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 8px clamp(12px, 3vw, 28px);
}

.mnav-side {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.mnav-right { justify-content: flex-end; }

.mnav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 9px;
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}

.mnav-link:hover { background: var(--wash); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--e2);
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.brand-mark {
  width: 15px;
  height: 15px;
  border-radius: 5px;
  background: var(--ink);
  box-shadow: 4px 4px 0 rgba(31, 31, 31, .22), 8px 8px 0 rgba(31, 31, 31, .1);
}

.brand-logo { border-radius: 7px; object-fit: contain; }

.mnav-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-left: 6px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  text-decoration: none;
  box-shadow: var(--e2);
  transition: transform .2s ease, box-shadow .2s ease;
}

.mnav-cta:hover { transform: translateY(-1px); box-shadow: var(--e3); }

/* ---------- 锚点条 ---------- */
.subbar {
  position: sticky;
  top: 60px;
  z-index: 30;
  background: rgba(245, 245, 245, .88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.subnav {
  display: flex;
  gap: 6px;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 6px clamp(12px, 3vw, 28px);
  overflow-x: auto;
  scrollbar-width: none;
}

.subnav::-webkit-scrollbar { display: none; }

.subnav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--e1);
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease;
}

.subnav a:hover { transform: translateY(-1px); box-shadow: var(--e2); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 45vh;
  display: flex;
  align-items: center;
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 38px) clamp(16px, 4vw, 40px) clamp(30px, 5vw, 52px);
}

.hero-ghost {
  position: absolute;
  z-index: -1;
  right: -1.5vw;
  top: 50%;
  transform: translateY(-52%);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(88px, 20vw, 228px);
  font-weight: 700;
  line-height: .82;
  letter-spacing: -.05em;
  color: rgba(31, 31, 31, .07);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  will-change: transform;
}

.hero-body {
  display: flex;
  align-items: flex-start;
  gap: clamp(12px, 2vw, 22px);
  min-width: 0;
}

.hero-glyph {
  flex: 0 0 auto;
  transform: translateY(10px);
  filter: drop-shadow(0 12px 18px rgba(31, 31, 31, .16));
}

.hero-figure {
  flex: 0 0 auto;
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: var(--e3);
}

.hero-text { min-width: 0; }

h1 {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(34px, 6.2vw, 74px);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -.045em;
}

.hero-lead {
  margin: 16px 0 0;
  max-width: 46ch;
  font-size: 17px;
  line-height: 1.72;
  color: var(--mute);
}

/* ---------- 主体 ---------- */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  align-items: start;
  gap: clamp(18px, 3vw, 40px);
  max-width: var(--shell);
  margin: 0 auto;
  padding: 8px clamp(16px, 4vw, 40px) clamp(40px, 6vw, 76px);
}

.paper {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2.4vw, 30px);
}

.intro { padding: 4px 4px 0; }

.intro h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 46px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.035em;
}

.subtitle {
  margin: 0;
  max-width: 54ch;
  padding-left: 13px;
  border-left: 3px solid var(--ink);
  font-size: 17px;
  line-height: 1.7;
  color: var(--mute);
}

.paper > article {
  position: relative;
  margin-left: var(--shift, 0);
  padding: clamp(20px, 3vw, 42px);
  border-radius: var(--r);
  background: var(--paper);
  scroll-margin-top: calc(var(--bar) + 14px);
  transition: transform .35s cubic-bezier(.2, .7, .3, 1), box-shadow .35s ease;
}

.paper > article:nth-of-type(3n+1) { --shift: 0; z-index: 3; box-shadow: var(--e1); }
.paper > article:nth-of-type(3n+2) { --shift: 10px; z-index: 2; box-shadow: var(--e3); }
.paper > article:nth-of-type(3n) { --shift: 20px; z-index: 1; box-shadow: var(--e2); }

section.paper > article:hover {
  transform: translateY(-4px);
  box-shadow: var(--e4);
}

.paper article > *:first-child { margin-top: 0; }

.paper article h2 {
  margin: 0 0 14px;
  font-size: clamp(23px, 3.2vw, 36px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.022em;
}

.paper article h3 {
  margin: 26px 0 10px;
  font-size: clamp(19px, 2.4vw, 23px);
  font-weight: 700;
  line-height: 1.4;
}

.paper article h4 {
  margin: 20px 0 8px;
  font-size: 18px;
  font-weight: 700;
}

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

.paper article ul,
.paper article ol {
  margin: 0 0 14px;
  padding-left: 1.35em;
}

.paper article li { margin-bottom: 8px; }

.paper article a {
  text-underline-offset: 3px;
  text-decoration-color: rgba(31, 31, 31, .35);
}

.paper article a:hover { text-decoration-color: var(--ink); }

.paper article img {
  border-radius: 18px;
  box-shadow: var(--e2);
}

.paper article blockquote {
  margin: 18px 0;
  padding: 14px 20px;
  border-left: 3px solid var(--ink);
  border-radius: 0 18px 18px 0;
  background: var(--wash);
}

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

.paper article table {
  width: 100%;
  margin: 0 0 16px;
  border-collapse: collapse;
  font-size: 16px;
}

.paper article th,
.paper article td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.paper article th { font-weight: 700; }

.paper article code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--wash);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 15px;
}

/* ---------- 侧栏 ---------- */
.rail {
  position: sticky;
  top: calc(var(--bar) + 14px);
  min-width: 0;
}

.rail-card {
  padding: 20px;
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--e3);
}

.rail-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--mute);
}

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

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 11px;
  border-radius: 12px;
  font-size: 16px;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease;
}

.rail-list a:hover {
  background: var(--wash);
  transform: translateX(2px);
}

.rail-top {
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  background: var(--wash);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: background .2s ease;
}

.rail-top:hover { background: #ebebeb; }

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(20px, 4vw, 48px);
  padding: clamp(28px, 4vw, 50px) clamp(16px, 4vw, 40px) clamp(24px, 3vw, 34px);
  border-radius: var(--r) var(--r) 0 0;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--e4);
}

.foot-brand {
  flex: 1 1 250px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.foot-logo {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #fff;
  text-decoration: none;
}

.foot-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.foot-form label {
  font-size: 16px;
  opacity: .78;
}

.foot-form input {
  flex: 1 1 160px;
  min-width: 0;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  color: #fff;
  font: inherit;
  font-size: 16px;
}

.foot-form input::placeholder { color: rgba(255, 255, 255, .58); }

.foot-form input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.foot-form button {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.foot-note { margin: 0; font-size: 16px; opacity: .82; }
.foot-note:empty { display: none; }

.fnav { flex: 1 1 250px; min-width: 0; }

.fnav dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 14px;
  margin: 0;
}

.fnav dt,
.fnav dd { margin: 0; }

.fnav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  font-size: 16px;
  color: rgba(255, 255, 255, .9);
  text-decoration: none;
}

.fnav a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.foot-end { flex: 0 0 auto; }

.copy {
  margin: 0;
  font-size: 16px;
  opacity: .7;
}

/* ---------- 动效 ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .3, 1);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

section.paper > article.is-in:hover { transform: translateY(-4px); }

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

.foot :focus-visible { outline-color: #fff; }

/* ---------- 窄屏 ---------- */
@media (max-width: 960px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
  .rail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paper > article { --shift: 0; }
  .paper > article:nth-of-type(3n+2),
  .paper > article:nth-of-type(3n) { margin-left: 0; }
}

@media (max-width: 760px) {
  :root { --bar: 56px; }

  .masthead { position: static; }

  .mnav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    padding: 10px 12px;
  }

  .brand {
    order: -1;
    flex: 1 0 100%;
    justify-content: center;
    min-height: 40px;
    padding: 0 0 6px;
    background: transparent;
    box-shadow: none;
  }

  .mnav-side {
    flex: 1 1 auto;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
  }

  .mnav-right { justify-content: center; }

  .mnav-link { min-height: 40px; padding: 0 7px; font-size: 16px; }

  .mnav-cta { min-height: 40px; padding: 0 13px; margin-left: 4px; }

  .subbar { top: 0; }

  .hero { min-height: 0; padding-top: 20px; }

  .hero-ghost { font-size: clamp(72px, 26vw, 120px); right: -4vw; }

  .hero-glyph { width: 40px; height: 40px; }

  .hero-figure { width: 68px; height: 68px; border-radius: 18px; }

  h1 { font-size: clamp(32px, 9.4vw, 46px); max-width: 100%; }

  .paper > article { --shift: 0; padding: 20px; border-radius: 22px; }
  .paper > article:nth-of-type(3n+2),
  .paper > article:nth-of-type(3n) { margin-left: 0; }

  .paper article h2 { font-size: 24px; }

  .foot { border-radius: 22px 22px 0 0; gap: 22px; }

  .foot-brand,
  .fnav,
  .foot-end { flex: 1 0 100%; }

  .fnav dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .foot-form input { flex: 1 1 120px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .paper > article,
  .mnav-cta,
  .subnav a,
  .rail-list a { transition: none; }
}

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