:root {
  color-scheme: light;
  --brand: #1479d7;
  --brand-dark: #075aa8;
  --text: #253041;
  --muted: #6c7888;
  --line: #e5eaf0;
  --surface: #f6f8fb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: #fff;
  line-height: 1.7;
}

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

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

.layout {
  display: grid;
  min-height: calc(100vh - 72px);
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  padding: 24px 18px 48px 32px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.sidebar-search input,
.hero-search input,
.search-form input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #cdd5df;
  border-radius: 7px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.sidebar-search input:focus,
.hero-search input:focus,
.search-form input:focus {
  border-color: var(--brand);
  outline: 3px solid rgb(20 121 215 / 12%);
}

.docs-nav {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.docs-nav ul {
  padding-left: 14px;
  list-style: none;
}

.docs-nav a {
  display: block;
  margin: 2px 0;
  padding: 7px 10px;
  border-radius: 6px;
  color: #465264;
  font-size: 14px;
  line-height: 1.45;
}

.nav-group {
  display: block;
  padding: 10px 10px 4px;
  color: #273548;
  font-size: 14px;
  font-weight: 700;
}

.docs-nav a:hover,
.docs-nav a.active {
  color: var(--brand);
  background: #e5f2ff;
  text-decoration: none;
}

.main {
  width: min(100%, 1040px);
  padding: 48px 56px 80px;
}

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

.doc-header h1,
.doc-list h1,
.search-page h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.3;
}

.doc-meta,
.muted {
  color: var(--muted);
}

.doc-content {
  overflow-wrap: anywhere;
}

.doc-content img {
  max-width: 100%;
  height: auto;
}

.doc-content pre {
  overflow: auto;
  padding: 16px;
  border-radius: 8px;
  background: #17202e;
  color: #eef4ff;
}

.doc-content code {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.doc-content table {
  display: block;
  overflow-x: auto;
  width: max-content;
  max-width: 100%;
  border-collapse: collapse;
}

.doc-content th,
.doc-content td {
  padding: 8px 12px;
  border: 1px solid var(--line);
  text-align: left;
}

.hero {
  padding: 24px 0 52px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 64px);
  line-height: 1.15;
}

.hero > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
}

.hero-search,
.search-form {
  display: flex;
  max-width: 680px;
  gap: 10px;
  margin-top: 24px;
}

.hero-search button,
.search-form button {
  flex: 0 0 auto;
  padding: 0 22px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--brand);
  font: inherit;
  cursor: pointer;
}

.recent ul,
.doc-list ul,
.search-results {
  padding: 0;
  list-style: none;
}

.recent li {
  display: grid;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 100px 1fr;
}

.recent time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.doc-list li,
.search-results li {
  margin: 12px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.search-results h2 {
  margin: 0;
  font-size: 18px;
}

.search-results p {
  margin: 8px 0 0;
  color: var(--muted);
}

.site-footer {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

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

@media (max-width: 800px) {
  .layout {
    display: block;
  }

  .sidebar {
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main {
    padding: 32px 20px 56px;
  }

  .site-footer {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
}
