:root {
  color-scheme: light;
  --bg: #f3f6f4;
  --surface: #fdfffb;
  --surface-strong: #171a1f;
  --text: #191c20;
  --muted: #6f756f;
  --line: #d9e0da;
  --accent: #007f68;
  --accent-strong: #005f4d;
  --amber: #c98319;
  --danger: #c83e37;
  --code-bg: #11161b;
  --code-text: #e9f3ed;
  --shadow: 0 24px 70px rgba(40, 48, 42, 0.12);
  --topbar-height: 72px;
  font-family:
    "Avenir Next",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(120deg, rgba(0, 127, 104, 0.08), transparent 38%),
    repeating-linear-gradient(90deg, rgba(25, 28, 32, 0.035) 0 1px, transparent 1px 96px),
    var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

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

button,
input {
  font: inherit;
}

pre {
  margin: 0;
  overflow: auto;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.75;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr) 220px;
  grid-template-rows: var(--topbar-height) 1fr;
  grid-template-areas:
    "topbar topbar topbar"
    "sidebar content toc";
}

.topbar {
  grid-area: topbar;
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: 286px minmax(260px, 760px) 1fr;
  align-items: center;
  gap: 22px;
  padding: 0 24px;
  background: rgba(243, 246, 244, 0.86);
  border-bottom: 1px solid rgba(217, 224, 218, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #f8fff9;
  background: var(--surface-strong);
  border-radius: 10px;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(17, 22, 27, 0.18);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.search {
  position: relative;
}

.search input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 15px;
  color: var(--text);
  background: rgba(253, 255, 251, 0.86);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.search input:focus {
  border-color: rgba(0, 127, 104, 0.55);
  background: #fdfffb;
  box-shadow: 0 0 0 4px rgba(0, 127, 104, 0.1);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 60;
  max-height: min(430px, calc(100svh - 100px));
  overflow: auto;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.search-results a,
.empty-result {
  display: block;
  padding: 12px 13px;
  border-radius: 7px;
}

.search-results a:hover {
  background: rgba(0, 127, 104, 0.08);
}

.search-results strong,
.search-results span {
  display: block;
}

.search-results strong {
  font-size: 0.95rem;
}

.search-results span,
.empty-result {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.top-actions a,
.menu-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.top-actions a:hover,
.menu-button:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(253, 255, 251, 0.72);
}

.menu-button {
  display: none;
}

.sidebar {
  grid-area: sidebar;
  position: sticky;
  top: var(--topbar-height);
  height: calc(100svh - var(--topbar-height));
  overflow: auto;
  border-right: 1px solid rgba(217, 224, 218, 0.8);
}

.sidebar-inner {
  padding: 26px 18px 44px;
}

.nav-group + .nav-group {
  margin-top: 28px;
}

.nav-group h2 {
  margin: 0 0 10px;
  padding: 0 9px;
  color: #80857d;
  font-size: 0.76rem;
  font-weight: 800;
}

.nav-group a {
  display: block;
  border-radius: 8px;
  padding: 10px 9px;
  transition: background 160ms ease, color 160ms ease;
}

.nav-group a:hover,
.nav-group a.active {
  background: rgba(0, 127, 104, 0.09);
}

.nav-group a.active > .nav-title > span {
  color: var(--accent-strong);
}

.nav-group span,
.nav-group small {
  display: block;
}

.nav-group .nav-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.nav-title span {
  font-weight: 700;
  line-height: 1.35;
  min-width: 0;
}

.recommend-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(0, 127, 104, 0.22);
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--accent-strong);
  background: rgba(98, 225, 190, 0.18);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1.2;
}

.nav-group small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.content {
  grid-area: content;
  min-width: 0;
  padding: 34px clamp(22px, 4vw, 64px) 72px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.8fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  min-height: min(620px, calc(100svh - var(--topbar-height) - 34px));
  margin: -34px calc(clamp(22px, 4vw, 64px) * -1) 26px;
  padding: clamp(40px, 7vw, 96px) clamp(22px, 4vw, 64px);
  color: #f7fff9;
  background:
    linear-gradient(115deg, rgba(9, 18, 20, 0.92), rgba(9, 18, 20, 0.62) 52%, rgba(9, 18, 20, 0.2)),
    url("https://images.unsplash.com/photo-1518005020951-eccb494ad742?auto=format&fit=crop&w=1800&q=82") center/cover;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 120px;
  background: linear-gradient(transparent, rgba(243, 246, 244, 0.94));
  pointer-events: none;
}

.hero-copy,
.hero-visual {
  position: relative;
  z-index: 1;
}

.hero-copy {
  min-width: 0;
  max-width: 680px;
  overflow: hidden;
}

.eyebrow,
.doc-kicker {
  margin: 0 0 14px;
  color: #69d8bc;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 100%;
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.45rem, 3.75vw, 4.08rem);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}

.hero h1 a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
  text-decoration: none;
  transition: color 180ms ease, text-shadow 180ms ease;
}

.hero h1 a:hover {
  color: #62e1be;
  text-shadow: 0 0 34px rgba(98, 225, 190, 0.26);
}

.hero p:not(.eyebrow) {
  max-width: 620px;
  margin: 24px 0 0;
  color: rgba(247, 255, 249, 0.84);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-action,
.secondary-action {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.primary-action {
  color: #06201b;
  background: #62e1be;
}

.secondary-action {
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-2px);
}

.terminal-window {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(13, 19, 22, 0.88);
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.terminal-dots {
  display: flex;
  gap: 7px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #62e1be;
}

.terminal-dots span:nth-child(2) {
  background: #f4b44d;
}

.terminal-dots span:nth-child(3) {
  background: #ef6f65;
}

.terminal-window pre {
  padding: 20px;
}

.terminal-window code {
  color: #dffcf0;
}

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

.signal-strip span {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: rgba(247, 255, 249, 0.82);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  font-weight: 800;
}

.doc-panel {
  max-width: 920px;
  margin: 0 auto;
}

.doc-article {
  padding: clamp(24px, 4vw, 42px);
  background: rgba(253, 255, 251, 0.76);
  border: 1px solid rgba(217, 224, 218, 0.78);
  border-radius: 12px;
  box-shadow: 0 18px 80px rgba(40, 48, 42, 0.08);
}

.doc-kicker {
  color: var(--accent);
}

.doc-article > h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 4vw, 3.7rem);
  line-height: 1.04;
}

.doc-summary {
  margin: 16px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.8;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag-row span {
  border: 1px solid rgba(0, 127, 104, 0.18);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--accent-strong);
  background: rgba(0, 127, 104, 0.07);
  font-size: 0.82rem;
  font-weight: 800;
}

.doc-lead {
  margin: 34px 0 0;
  color: #353a37;
  font-size: 1.05rem;
  line-height: 1.9;
}

.content-block {
  margin-top: 34px;
}

.content-block h2,
.code-heading h2 {
  margin: 0 0 14px;
  scroll-margin-top: calc(var(--topbar-height) + 18px);
  font-size: 1.34rem;
  line-height: 1.35;
}

.steps {
  counter-reset: step;
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.steps li {
  position: relative;
  min-height: 46px;
  padding: 12px 14px 12px 58px;
  border: 1px solid rgba(217, 224, 218, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  line-height: 1.65;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 12px;
  left: 14px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #f8fff9;
  background: var(--accent);
  font-size: 0.86rem;
  font-weight: 900;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.feature {
  min-height: 152px;
  padding: 18px;
  border: 1px solid rgba(217, 224, 218, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.feature h3 {
  margin: 0;
  font-size: 1rem;
}

.feature p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.75;
}

.callout {
  margin-top: 24px;
  padding: 17px 18px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: rgba(0, 127, 104, 0.08);
}

.callout.warn {
  border-left-color: var(--amber);
  background: rgba(201, 131, 25, 0.1);
}

.callout.danger {
  border-left-color: var(--danger);
  background: rgba(200, 62, 55, 0.1);
}

.callout strong,
.callout p {
  display: block;
}

.callout p {
  margin: 7px 0 0;
  color: #464b47;
  line-height: 1.75;
}

.code-block {
  border: 1px solid #222b31;
  border-radius: 10px;
  background: var(--code-bg);
  overflow: hidden;
}

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

.code-heading h2 {
  margin: 0;
  color: #f0fff8;
  font-size: 0.96rem;
}

.copy-button {
  min-width: 62px;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  color: #dffcf0;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.copy-button:hover {
  background: rgba(98, 225, 190, 0.16);
}

.code-block pre {
  padding: 18px;
}

.code-block code {
  color: var(--code-text);
  white-space: pre;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(217, 224, 218, 0.92);
  border-radius: 9px;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.54);
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(217, 224, 218, 0.86);
  text-align: left;
  vertical-align: top;
  line-height: 1.65;
}

th {
  color: #3f453f;
  background: rgba(0, 127, 104, 0.08);
  font-size: 0.88rem;
}

td {
  color: #3c413e;
}

tr:last-child td {
  border-bottom: 0;
}

.toc {
  grid-area: toc;
  position: sticky;
  top: var(--topbar-height);
  height: calc(100svh - var(--topbar-height));
  overflow: auto;
  padding: 30px 18px 40px 0;
}

.toc-inner {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.toc strong {
  display: block;
  margin-bottom: 10px;
  color: #747a72;
  font-size: 0.78rem;
}

.toc a {
  display: block;
  padding: 7px 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

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

@media (prefers-reduced-motion: no-preference) {
  .hero-copy {
    animation: riseIn 700ms ease both;
  }

  .hero-visual {
    animation: riseIn 820ms 90ms ease both;
  }

  .doc-article {
    animation: softFade 260ms ease both;
  }

  @keyframes riseIn {
    from {
      opacity: 0;
      transform: translateY(18px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes softFade {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 260px minmax(0, 1fr);
    grid-template-areas:
      "topbar topbar"
      "sidebar content";
  }

  .topbar {
    grid-template-columns: 240px minmax(240px, 1fr) auto;
  }

  .toc {
    display: none;
  }

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

  .hero h1 {
    max-width: 100%;
    font-size: clamp(2.4rem, 7.8vw, 5rem);
  }
}

@media (max-width: 820px) {
  :root {
    --topbar-height: 64px;
  }

  .app-shell {
    display: block;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    gap: 10px;
    height: auto;
    min-height: var(--topbar-height);
    padding: 10px 14px;
  }

  .brand small,
  .top-actions a {
    display: none;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .search {
    grid-column: 1 / -1;
    order: 3;
  }

  .top-actions {
    justify-content: flex-end;
  }

  .menu-button {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 80;
    width: min(84vw, 330px);
    height: 100svh;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(17, 22, 27, 0.24);
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .content {
    padding: 28px 14px 54px;
  }

  .hero {
    min-height: auto;
    margin: -28px -14px 18px;
    padding: 46px 16px 70px;
  }

  .hero h1 {
    font-size: clamp(2.05rem, 9.8vw, 4.5rem);
  }

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

  .terminal-window pre,
  .code-block pre {
    padding: 15px;
  }

  code {
    font-size: 0.82rem;
  }

  .signal-strip,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .doc-article {
    border-radius: 10px;
    padding: 22px 16px;
  }

  .steps li {
    padding-right: 12px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }
}

@media (max-width: 440px) {
  .brand strong {
    font-size: 0.94rem;
  }

  .doc-article > h1 {
    font-size: 2rem;
  }

  .hero p:not(.eyebrow),
  .doc-summary,
  .doc-lead {
    font-size: 0.98rem;
  }
}
