:root {
  --paper: #fbf4e6;
  --paper-2: #f4ecd9;
  --ink: #0b1020;
  --muted: rgba(11, 16, 32, 0.72);
  --muted-2: rgba(11, 16, 32, 0.55);
  --line: rgba(11, 16, 32, 0.14);
  --card: rgba(255, 255, 255, 0.72);
  --card-2: rgba(255, 255, 255, 0.5);
  --shadow: 0 22px 60px rgba(11, 16, 32, 0.16);
  --accent: #0f766e;
  --accent-2: #2563eb;
  --accent-3: #f97316;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--ink);
  background:
    radial-gradient(1200px 560px at 10% -10%, rgba(15, 118, 110, 0.18), transparent 62%),
    radial-gradient(1000px 520px at 90% 10%, rgba(37, 99, 235, 0.14), transparent 58%),
    radial-gradient(900px 520px at 85% 110%, rgba(249, 115, 22, 0.12), transparent 55%),
    linear-gradient(180deg, var(--paper), var(--paper-2));
  font-family: "Space Grotesk", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

.fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.fx-noise {
  opacity: 0.08;
  background-image:
    linear-gradient(transparent 50%, rgba(0, 0, 0, 0.03) 50%),
    linear-gradient(90deg, transparent 50%, rgba(0, 0, 0, 0.025) 50%);
  background-size: 3px 3px, 4px 4px;
}

.fx-grid {
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(11, 16, 32, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 16, 32, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(900px 620px at 50% 20%, rgba(0, 0, 0, 0.9), transparent 70%);
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(251, 244, 230, 0.72);
  border-bottom: 1px solid rgba(11, 16, 32, 0.08);
}

.topbar-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Fraunces", "Songti SC", "STSong", ui-serif, Georgia, serif;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: 20px;
}

.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 7px 10px;
  border-radius: 999px;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(11, 16, 32, 0.1);
  color: rgba(11, 16, 32, 0.92);
}

.nav-link.is-active {
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.25);
  color: rgba(11, 16, 32, 0.92);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(11, 16, 32, 0.14);
  background: rgba(255, 255, 255, 0.45);
}

.lang-chip {
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  min-height: 28px;
  min-width: 42px;
  border-radius: 999px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(11, 16, 32, 0.74);
}

.lang-chip:hover {
  background: rgba(255, 255, 255, 0.72);
  color: rgba(11, 16, 32, 0.92);
}

.lang-chip.is-active {
  background: linear-gradient(120deg, rgba(15, 118, 110, 0.9), rgba(37, 99, 235, 0.9));
  color: #ffffff;
}

.hero {
  padding: 62px 0 18px;
}

.kicker {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
  font-size: 12px;
  text-transform: uppercase;
  color: rgba(11, 16, 32, 0.68);
  margin: 0 0 14px;
}

h1 {
  margin: 0;
  font-family: "Fraunces", "Songti SC", "STSong", ui-serif, Georgia, serif;
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: clamp(2.4rem, 4.4vw, 4.1rem);
  line-height: 1.03;
  text-wrap: balance;
}

.lead {
  margin: 14px 0 0;
  max-width: 70ch;
  color: var(--muted);
  font-size: 1.12rem;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(11, 16, 32, 0.14);
  background: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-weight: 700;
  color: rgba(11, 16, 32, 0.9);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 40px rgba(11, 16, 32, 0.1);
}

.btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.25);
  outline-offset: 2px;
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(120deg, rgba(15, 118, 110, 0.9), rgba(37, 99, 235, 0.9));
  color: #ffffff;
  box-shadow: 0 18px 50px rgba(15, 118, 110, 0.22);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.3);
}

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

.hero-card {
  padding: 18px 18px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(11, 16, 32, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.48));
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease;
}

.hero-card:hover {
  transform: translateY(-2px);
  border-color: rgba(11, 16, 32, 0.22);
}

.hero-card h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.hero-card p {
  margin: 0;
  color: var(--muted);
}

.section {
  padding: 30px 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.01em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

.pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.pill {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(11, 16, 32, 0.14);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 12px 34px rgba(11, 16, 32, 0.08);
}

.pill h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.pill p {
  margin: 0;
  color: var(--muted);
}

.code-card {
  border-radius: var(--radius);
  border: 1px solid rgba(11, 16, 32, 0.16);
  background: rgba(11, 16, 32, 0.92);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.code-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.muted {
  color: var(--muted-2);
}

code,
pre {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  line-height: 1.5;
  font-size: 13px;
}

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

.callout {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(11, 16, 32, 0.14);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 12px 34px rgba(11, 16, 32, 0.08);
}

.callout h3 {
  margin: 0 0 8px;
}

.callout p {
  margin: 0 0 10px;
  color: var(--muted);
}

.callout pre {
  border-radius: 12px;
  border: 1px solid rgba(11, 16, 32, 0.1);
  background: rgba(255, 255, 255, 0.35);
  color: rgba(11, 16, 32, 0.92);
}

.mini-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(11, 16, 32, 0.12);
  background: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-weight: 700;
  color: rgba(11, 16, 32, 0.9);
}

.refs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ref {
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(11, 16, 32, 0.14);
  background: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-weight: 700;
  color: rgba(11, 16, 32, 0.9);
}

.ref:hover {
  border-color: rgba(11, 16, 32, 0.24);
}

.footer {
  margin-top: 26px;
  border-top: 1px solid rgba(11, 16, 32, 0.1);
  background: rgba(251, 244, 230, 0.6);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 26px;
}

.footer-brand {
  font-weight: 800;
  letter-spacing: 0.01em;
}

.footer-note {
  color: var(--muted-2);
  max-width: 70ch;
  font-size: 14px;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 800;
  font-size: 12px;
  padding: 7px 10px;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.copy-wrap {
  position: relative;
}

.page {
  padding: 42px 0 26px;
}

.page h1 {
  font-size: clamp(2rem, 3.6vw, 3.2rem);
}

.page-intro {
  margin-top: 12px;
  color: var(--muted);
  max-width: 82ch;
}

.content {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.card {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(11, 16, 32, 0.14);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 12px 34px rgba(11, 16, 32, 0.08);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.card h3 {
  margin: 16px 0 8px;
  font-size: 1rem;
}

.card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.card li {
  margin: 6px 0;
}

.inline-code {
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid rgba(11, 16, 32, 0.12);
  background: rgba(255, 255, 255, 0.5);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}

.alert {
  border-left: 4px solid rgba(249, 115, 22, 0.85);
  background: rgba(249, 115, 22, 0.12);
}

.alert strong {
  color: rgba(11, 16, 32, 0.92);
}

@media (max-width: 980px) {
  .topbar-inner {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .nav {
    justify-content: start;
  }

  .lang-switch {
    margin-left: 0;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .pill-grid {
    grid-template-columns: 1fr;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .refs {
    grid-template-columns: 1fr;
  }
}
