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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --hair: #d9d9d9;
  --soft: #333333;
  --rail-w: 17rem;
  --radius: 10px;
  --ease: 220ms cubic-bezier(.2, .6, .2, 1);
}

*,
*::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: "Archivo", "Space Grotesk", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
p { margin: 0 0 1.1rem; }

hr {
  border: 0;
  border-top: 1px solid var(--ink);
  margin: .85rem 0 1.75rem;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* ---------- 左侧固定栏 ---------- */

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

.brand {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  min-height: 44px;
  padding: .3rem 0;
  text-decoration: none;
}

.brand-name {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.15;
}

.brand-rule {
  display: block;
  width: 2.75rem;
  height: 2px;
  background: var(--paper);
  transition: width var(--ease);
}

.brand:hover .brand-rule { width: 4.25rem; }

.menu-btn {
  display: none;
  min-height: 44px;
  padding: 0 1rem;
  font: inherit;
  font-size: .9375rem;
  letter-spacing: .04em;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--paper);
  border-radius: var(--radius);
  cursor: pointer;
}

.rail-nav { margin-top: .25rem; }

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

.rail-nav a {
  display: block;
  min-height: 44px;
  padding: .72rem 0;
  font-size: 1rem;
  letter-spacing: .01em;
  text-decoration: none;
  border-top: 1px solid var(--soft);
  transition: padding-left var(--ease), opacity var(--ease);
}

.rail-nav li:last-child a { border-bottom: 1px solid var(--soft); }

.rail-nav a:hover {
  padding-left: .5rem;
  opacity: .72;
}

/* ---------- 主 CTA ---------- */

.cta {
  position: fixed;
  right: clamp(.9rem, 2vw, 2rem);
  bottom: clamp(.9rem, 2vw, 2rem);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .8rem 1.15rem;
  font-size: .9375rem;
  letter-spacing: .04em;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
  transition: background var(--ease), color var(--ease);
}

.cta:hover {
  background: var(--paper);
  color: var(--ink);
}

/* ---------- 主体网格 ---------- */

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
  max-width: 1200px;
  margin-left: var(--rail-w);
  padding: 0 clamp(1.25rem, 4vw, 4rem);
}

section {
  min-width: 0;
  counter-reset: sec;
}

section > article {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
  border-top: 1px solid var(--ink);
  scroll-margin-top: 5rem;
}

section > article:first-child { border-top: 0; }

section > article:not(.hero) { counter-increment: sec; }

/* ---------- 首屏 ---------- */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding-top: clamp(2rem, 7vh, 4.5rem);
  padding-bottom: clamp(1.5rem, 5vh, 3rem);
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.15rem;
  text-align: right;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5.6vw, 4.6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.045em;
  max-width: 22ch;
}

.hero-desc {
  margin: 0;
  max-width: 36rem;
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  font-weight: 300;
  line-height: 1.55;
  color: var(--soft);
}

.hero-fig {
  margin: 0;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
}

.hero-fig img {
  width: 100%;
  height: clamp(15rem, 38vh, 25rem);
  object-fit: cover;
}

/* ---------- 正文排版 ---------- */

section h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3.6vw, 2.75rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -.035em;
  max-width: 26ch;
}

section > article:not(.hero) h2::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  margin-bottom: .7rem;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .16em;
}

section h3 {
  margin: 2rem 0 .5rem;
  font-size: clamp(1.2rem, 2.1vw, 1.5rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.02em;
}

section p,
section ul,
section ol,
section blockquote,
section table { max-width: 40rem; }

section ul,
section ol { padding-left: 1.15rem; }

section li { margin: .35rem 0; }

section a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .25em;
  transition: opacity var(--ease);
}

section a:hover { opacity: .6; }

section blockquote {
  margin: 1.6rem 0;
  padding: .2rem 0 .2rem 1.15rem;
  border-left: 3px solid var(--ink);
  font-weight: 500;
}

section strong { font-weight: 600; }

section figure { margin: 1.6rem 0; }

section article > p:last-child,
section article > ul:last-child,
section article > ol:last-child { margin-bottom: 0; }

/* ---------- 右侧目录 ---------- */

.side {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
  padding: clamp(2.5rem, 9vh, 7rem) 0 3rem clamp(1rem, 2vw, 1.5rem);
  border-left: 1px solid var(--ink);
  font-size: .9375rem;
}

.side-title {
  margin: 0;
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: .1em;
}

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

.side li { border-top: 1px solid var(--hair); }
.side li:last-child { border-bottom: 1px solid var(--hair); }

.side a {
  display: block;
  min-height: 40px;
  padding: .6rem 0;
  text-decoration: none;
  transition: opacity var(--ease), padding-left var(--ease);
}

.side a:hover {
  opacity: .6;
  padding-left: .35rem;
}

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

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(1.5rem, 4vw, 3rem);
  max-width: 1200px;
  margin-left: var(--rail-w);
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.25rem, 4vw, 4rem) 3rem;
  border-top: 1px solid var(--ink);
}

.foot-brand {
  font-size: clamp(2.2rem, 7vw, 4.75rem);
  font-weight: 700;
  line-height: .92;
  letter-spacing: -.055em;
}

.foot-nav ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0;
  padding: 0;
}

.foot-nav a {
  display: inline-block;
  min-height: 40px;
  padding: .6rem 0;
  font-size: .9375rem;
  text-decoration: none;
  transition: opacity var(--ease);
}

.foot-nav a:hover { opacity: .6; }

.foot-copy {
  font-size: .8125rem;
  letter-spacing: .06em;
  color: var(--soft);
}

/* ---------- 滚动显现 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms cubic-bezier(.2, .6, .2, 1), transform 520ms cubic-bezier(.2, .6, .2, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

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

@media (max-width: 900px) {
  body { padding-top: 3.75rem; }

  .rail {
    inset: 0 0 auto 0;
    width: auto;
    height: 3.75rem;
    flex-direction: row;
    align-items: center;
    gap: .75rem;
    padding: 0 1rem;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .brand {
    flex: 1;
    flex-direction: row;
    align-items: center;
    gap: .5rem;
    min-height: 0;
    padding: 0;
  }

  .brand-name { font-size: 1.0625rem; }
  .brand-rule { display: none; }

  .menu-btn { display: inline-flex; align-items: center; }

  .rail-nav {
    position: absolute;
    top: 3.75rem;
    left: 0;
    right: 0;
    display: none;
    margin: 0;
    max-height: calc(100vh - 3.75rem);
    overflow-y: auto;
    background: var(--ink);
    border-bottom: 1px solid var(--ink);
  }

  .rail-nav.open { display: block; }

  .rail-nav a {
    padding: .95rem 1.25rem;
    border-top: 1px solid var(--soft);
  }

  .rail-nav a:hover { padding-left: 1.45rem; }

  main {
    grid-template-columns: minmax(0, 1fr);
    margin-left: 0;
    padding: 0 1.25rem;
    gap: 0;
  }

  .hero {
    min-height: calc(100vh - 3.75rem);
    padding-top: 2rem;
  }

  .hero-text {
    align-items: flex-start;
    text-align: left;
  }

  section > article { scroll-margin-top: 4.5rem; }

  .side {
    order: 2;
    position: static;
    max-height: none;
    overflow: visible;
    padding: 2rem 0 2.5rem;
    border-left: 0;
    border-top: 1px solid var(--ink);
  }

  .foot {
    margin-left: 0;
    padding: 2.5rem 1.25rem 5rem;
    gap: 1.5rem;
  }

  .cta {
    right: .9rem;
    bottom: .9rem;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

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

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