:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #1d2733;
  --muted: #687385;
  --line: #dce2ea;
  --soft: #eef3f7;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #b45309;
  --code-bg: #101820;
  --code-text: #eef7f7;
  --shadow: 0 12px 28px rgba(24, 39, 75, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  padding: 12px 28px;
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  min-width: 220px;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

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

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search span {
  position: absolute;
  left: 12px;
  color: var(--muted);
  font-size: 13px;
}

.search input {
  width: min(34vw, 420px);
  min-width: 220px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  outline: none;
  padding: 0 14px 0 48px;
}

.search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  padding: 0 14px;
}

.button:hover {
  background: var(--brand-dark);
  color: #fff;
  text-decoration: none;
}

.button.ghost {
  background: #fff;
  color: var(--brand-dark);
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 220px;
  gap: 28px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 30px 28px 56px;
}

.sidebar,
.toc {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.nav-group {
  margin-bottom: 18px;
}

.nav-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-link,
.toc a {
  display: block;
  border-radius: 8px;
  color: var(--text);
  line-height: 1.35;
  padding: 9px 11px;
}

.nav-link:hover,
.toc a:hover {
  background: var(--soft);
  text-decoration: none;
}

.nav-link.active {
  background: #dff4ef;
  color: var(--brand-dark);
  font-weight: 800;
}

.content {
  min-width: 0;
}

.doc-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 46px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 4.2vw, 58px);
}

h2 {
  margin: 34px 0 14px;
  font-size: 28px;
}

h3 {
  margin: 24px 0 10px;
  font-size: 20px;
}

p {
  color: var(--muted);
  line-height: 1.78;
}

.lead {
  max-width: 780px;
  font-size: 18px;
}

.notice {
  border-left: 4px solid var(--accent);
  background: #fff7ed;
  color: #713f12;
  padding: 14px 16px;
}

.section {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 28px;
}

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

.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.item strong {
  display: block;
  margin-bottom: 6px;
}

.item p {
  margin: 0;
}

code {
  border-radius: 6px;
  background: #edf2f5;
  color: #22303d;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  padding: 2px 5px;
}

pre {
  overflow: auto;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-text);
  line-height: 1.6;
  padding: 18px;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--soft);
  color: #334155;
}

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

.toc p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.toc a {
  color: var(--muted);
  font-size: 14px;
  padding: 7px 0;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 24px;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

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

  .search input {
    width: 100%;
    min-width: 0;
  }

  .layout {
    display: block;
    padding: 16px 14px 36px;
  }

  .sidebar {
    position: static;
    max-height: none;
    margin-bottom: 16px;
  }

  .sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section,
  .doc-hero {
    padding: 20px;
  }

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