:root {
  color-scheme: dark;
  --bg: #161719;
  --ink: #ecedeb;
  --muted: #a9aeac;
  --faint: #7e8482;
  --line: rgba(236, 237, 235, 0.09);
  --accent: #83d7a1;
  --brand: #5cc984;
  --font-body: "Noto Serif SC", "Songti SC", "Source Han Serif SC", serif;
  --font-display: "Fraunces", "Songti SC", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* 氛围：左上品牌绿光斑 + 右下深绿余光 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(52rem 34rem at 12% -8%, rgba(92, 201, 132, 0.14), transparent 62%),
    radial-gradient(44rem 28rem at 98% 110%, rgba(59, 130, 85, 0.12), transparent 60%);
}

/* 工作台网格 + 噪点，向中心聚拢后淡出 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E"),
    linear-gradient(rgba(236, 237, 235, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 237, 235, 0.026) 1px, transparent 1px);
  background-size:
    180px 180px,
    32px 32px,
    32px 32px;
  mask-image: radial-gradient(130% 100% at 50% 32%, #000 28%, transparent 78%);
  -webkit-mask-image: radial-gradient(130% 100% at 50% 32%, #000 28%, transparent 78%);
}

/* 上下工作台横杆 */
.rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem var(--gutter);
}

header.rail {
  border-bottom: 1px solid var(--line);
}

footer.rail {
  border-top: 1px solid var(--line);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  color: var(--faint);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(92, 201, 132, 0.14);
}

.rail a {
  color: inherit;
  text-decoration: none;
}

.rail a:hover {
  color: var(--accent);
}

.rail a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.links {
  display: inline-flex;
  gap: 1.25rem;
}

.links a[aria-current="page"] {
  color: var(--muted);
}

/* 文档页：条款 / 隐私 */
.doc {
  width: min(42rem, 100% - 2 * var(--gutter));
  justify-content: flex-start;
  align-items: stretch;
  padding-block: clamp(3rem, 8vh, 5.5rem);
}

.doc .kicker {
  margin: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
}

.doc h1 {
  margin: 0.9rem 0 0;
  font-size: clamp(1.9rem, 4.5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.doc .updated {
  margin: 0.9rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  color: var(--faint);
}

.doc h2 {
  margin: 2.5rem 0 0;
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.doc p,
.doc li {
  margin: 0.9rem 0 0;
  font-size: 0.98rem;
  line-height: 2;
  color: var(--muted);
}

.doc ul {
  margin: 0.9rem 0 0;
  padding-left: 1.3rem;
  display: grid;
  gap: 0.35rem;
}

.doc li {
  margin: 0;
}

.doc li::marker {
  color: var(--faint);
}

.doc a {
  color: var(--ink);
  text-decoration-color: rgba(236, 237, 235, 0.32);
  text-underline-offset: 4px;
}

.doc a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.doc code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--ink);
}

main {
  width: min(72rem, 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-block: clamp(3.5rem, 10vh, 8rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.wordmark {
  display: flex;
  align-items: baseline;
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 430;
  font-size: clamp(4.25rem, 15vw, 9.5rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
}

.caret {
  display: inline-block;
  width: 0.13em;
  height: 0.56em;
  margin-left: 0.05em;
  border-radius: 2px;
  background: var(--accent);
}

.tagline {
  margin: clamp(1.75rem, 5vh, 2.75rem) 0 0;
  font-size: clamp(1.3rem, 3.2vw, 1.9rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.lede {
  margin: 1.1rem 0 0;
  max-width: 34em;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 2;
}

.mantras {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: clamp(2.5rem, 7vh, 3.75rem) 0 0;
  padding: 0;
  list-style: none;
  color: var(--faint);
  font-size: 0.92rem;
  letter-spacing: 0.06em;
}

.mantras li + li::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 0.85em;
  margin-right: 1.25rem;
  background: rgba(236, 237, 235, 0.16);
  vertical-align: -0.08em;
}

::selection {
  background: rgba(92, 201, 132, 0.3);
  color: #fff;
}

@media (max-width: 640px) {
  .rail {
    padding-block: 0.9rem;
  }

  .mantras {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .mantras li + li::before {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  header.rail {
    animation: fade 0.7s ease both;
  }

  .wordmark {
    animation: rise 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.05s both;
  }

  .tagline {
    animation: rise 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.15s both;
  }

  .lede {
    animation: rise 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.24s both;
  }

  .mantras {
    animation: rise 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.34s both;
  }

  footer.rail {
    animation: fade 0.9s ease 0.45s both;
  }

  .caret {
    animation: blink 1.15s steps(1, end) infinite;
  }

  .dot {
    animation: pulse 2.6s ease-in-out infinite;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes blink {
  0%,
  54% {
    opacity: 1;
  }

  55%,
  100% {
    opacity: 0;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}
