@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;
  --maxw: 1520px;
  --pad: clamp(1.15rem, 4vw, 4.5rem);
  --font: "Archivo", "Space Grotesk", "Helvetica Neue", Arial, "Noto Sans SC", system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  letter-spacing: -0.01em;
  padding-bottom: calc(5.6rem + env(safe-area-inset-bottom));
}

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

a {
  color: inherit;
}

::selection {
  background: #000;
  color: #fff;
}

:focus-visible {
  outline: 3px solid #000;
  outline-offset: 3px;
}

/* ---------- 主体网格：aside 在左，正文在右 ---------- */
main {
  display: grid;
  grid-template-columns: minmax(10rem, 15vw) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4.5rem);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1.25rem, 3.5vw, 3.5rem) var(--pad) 0;
}

.doc {
  min-width: 0;
}

/* ---------- 左侧栏 ---------- */
.rail {
  align-self: start;
  position: sticky;
  top: 1.5rem;
  border-top: 2px solid var(--ink);
  padding-top: 0.9rem;
}

.rail small {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  line-height: 1.1;
}

.rail h2 {
  margin: 0.3rem 0 1rem;
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1;
}

.rail ol {
  counter-reset: sec;
  display: grid;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail li {
  counter-increment: sec;
}

.rail a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.25rem 0.1rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.16);
}

.rail a::before {
  content: counter(sec, decimal-leading-zero);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.rail a:hover,
.rail a:focus-visible {
  background: #000;
  color: #fff;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4rem) 0;
}

.hero-ghost {
  position: absolute;
  right: -0.04em;
  bottom: -0.05em;
  z-index: 0;
  font-size: clamp(8rem, 30vw, 20rem);
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 0.78;
  color: rgba(0, 0, 0, 0.07);
  pointer-events: none;
  user-select: none;
}

.hero-art {
  position: relative;
  z-index: 1;
  margin: 0;
  aspect-ratio: 4 / 5;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.1rem;
  text-align: right;
}

.hero-kicker {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.3em;
}

.hero h1 {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(2.6rem, 8vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.92;
}

.hero-desc {
  margin: 0;
  max-width: 28ch;
}

.hero-jump {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 46px;
  padding: 0.7rem 1.7rem;
  border-radius: 18px;
  background: #000;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.hero-jump::after {
  content: "↓";
  font-size: 1.1rem;
  line-height: 1;
}

.hero-jump:hover {
  background: #000;
  transform: translateY(2px);
}

/* ---------- 正文分区 ---------- */
div[id] {
  scroll-margin-block: 3rem 8rem;
}

article > div:not(.hero) {
  padding: clamp(2.5rem, 7vw, 6rem) 0;
  border-top: 2px solid var(--ink);
}

article > div:not(.hero) > * {
  max-width: 64ch;
}

article small {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  line-height: 1.2;
}

article h2 {
  margin: 0.4rem 0 1rem;
  font-size: clamp(1.9rem, 4.6vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.02;
}

article h3 {
  margin: 2rem 0 0.6rem;
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

article p {
  margin: 0 0 1rem;
}

article ul,
article ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

article li {
  margin: 0.35rem 0;
}

article strong {
  font-weight: 800;
}

article a {
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

article blockquote {
  margin: 1.6rem 0;
  padding: 1.1rem 1.3rem;
  border-radius: 18px;
  background: #000;
  color: #fff;
}

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

article img {
  border-radius: 18px;
  margin: 1.2rem 0;
}

/* ---------- 底部固定导航 ---------- */
.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: #fff;
  border-top: 2px solid var(--ink);
  padding: 0.3rem 0 calc(0.3rem + env(safe-area-inset-bottom));
}

.bar ol {
  display: flex;
  gap: 0.15rem;
  margin: 0 auto;
  padding: 0 0.5rem;
  max-width: var(--maxw);
  overflow-x: auto;
  scrollbar-width: none;
}

.bar ol::-webkit-scrollbar {
  display: none;
}

.bar li {
  flex: 0 0 auto;
}

.bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 48px;
  padding: 0.4rem 0.75rem;
  border-radius: 18px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.bar a svg {
  width: 16px;
  height: 16px;
}

.bar a:hover,
.bar a.is-active {
  background: #000;
  color: #fff;
}

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-top: clamp(3rem, 8vw, 7rem);
  padding: clamp(1.5rem, 4vw, 2.6rem) var(--pad);
  background: #000;
  color: #fff;
}

.foot-mark {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
}

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

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #fff;
  font-weight: 500;
  text-decoration: none;
}

.foot-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.foot-copy {
  margin: 0;
  font-weight: 500;
}

/* ---------- 动效 ---------- */
.js .bar li,
.js .rail li,
.js .foot-nav li,
.js article > div {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  transition-delay: calc(var(--i, 0) * 55ms);
}

.js article > div {
  transition-delay: 0ms;
  transition-duration: 0.7s;
}

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

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

  .js .bar li,
  .js .rail li,
  .js .foot-nav li,
  .js article > div {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-jump:hover {
    transform: none;
  }
}

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  main {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding-top: 1rem;
  }

  .doc {
    order: -1;
  }

  .rail {
    order: 1;
    position: static;
    top: auto;
  }

  .rail ol {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 1rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    min-height: 100svh;
    padding-top: 1rem;
    gap: 1.5rem;
  }

  .hero-copy {
    gap: 0.9rem;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 12vw, 5rem);
  }

  .hero-art {
    aspect-ratio: 16 / 11;
  }

  .foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .foot-copy {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .bar a {
    padding: 0.4rem 0.6rem;
  }

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

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