:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --panel: #ffffff;
  --text: #202124;
  --muted: #58616a;
  --line: #d9dee3;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --code: #162034;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  background: rgba(246, 247, 248, 0.92);
  border-bottom: 1px solid var(--line);
}

.topbar-shell {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: 280px minmax(0, 1fr) auto;
  min-height: 64px;
  padding: 0 24px;
}

.topbar-brand {
  align-items: center;
  color: inherit;
  display: inline-flex;
  gap: 12px;
  text-decoration: none;
}

.topbar-brand-mark {
  align-items: center;
  background: #e6f2ef;
  border-radius: 10px;
  color: var(--accent-strong);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.topbar-brand-text {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.top-nav {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.top-nav-link {
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 14px;
  padding: 8px 12px;
  text-decoration: none;
  white-space: nowrap;
}

.top-nav-link.active {
  background: #e6f2ef;
  color: var(--accent-strong);
  font-weight: 700;
}

.top-nav-link.disabled {
  opacity: 0.45;
}

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

.topbar-version {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 10px;
}

.sidebar {
  position: fixed;
  inset: 65px auto 0 0;
  width: 320px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  overflow-y: auto;
}

.sidebar-shell {
  padding: 28px 22px 36px;
}

.brand {
  display: grid;
  gap: 6px;
}

.brand-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand strong {
  font-size: 21px;
  line-height: 1.2;
}

.brand-copy {
  color: var(--muted);
  font-size: 14px;
  margin: 6px 0 0;
}

.language-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.sidebar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.meta-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 10px;
}

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}

button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.nav {
  display: grid;
  gap: 12px;
}

.nav-group {
  display: grid;
  gap: 2px;
}

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

.nav a {
  border-radius: 7px;
  color: var(--muted);
  display: block;
  line-height: 1.35;
  padding: 6px 10px;
  text-decoration: none;
}

.nav a.active {
  background: #e6f2ef;
  color: var(--accent-strong);
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 32px;
  margin-left: 320px;
  padding: 96px 26px 0 0;
}

.page {
  min-height: 100vh;
  padding: 0 min(7vw, 84px) 56px;
}

.page-header {
  max-width: 860px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
  padding-bottom: 18px;
}

.page-path {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}

.page-header p {
  color: var(--muted);
  font-size: 18px;
  margin: 0;
}

.content {
  max-width: 860px;
}

.content h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 4.2vw, 54px);
  line-height: 1.08;
  margin: 0 0 24px;
}

.content h2 {
  font-size: 28px;
  line-height: 1.25;
  margin: 40px 0 12px;
}

.content h3 {
  font-size: 20px;
  line-height: 1.3;
  margin: 26px 0 8px;
}

.content p,
.content li {
  font-size: 17px;
}

.content ul {
  padding-left: 22px;
}

.content code {
  background: #edf1f3;
  border-radius: 5px;
  padding: 2px 5px;
}

.content pre {
  background: var(--code);
  border-radius: 8px;
  color: #eef7f4;
  overflow-x: auto;
  padding: 16px;
}

.content pre code {
  background: transparent;
  padding: 0;
}

.content blockquote {
  border-left: 3px solid var(--line);
  color: var(--muted);
  margin: 18px 0;
  padding: 2px 0 2px 16px;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 18px 0 26px;
  overflow-x: auto;
}

.content table {
  border-collapse: collapse;
  min-width: 100%;
  width: 100%;
}

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

.content th {
  background: rgba(230, 242, 239, 0.6);
  font-weight: 700;
}

.page-outline {
  padding: 38px 0 40px;
}

.outline-shell {
  position: sticky;
  top: 22px;
}

.outline-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 14px;
  text-transform: uppercase;
}

.outline {
  display: grid;
  gap: 8px;
}

.outline a {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
}

.outline a:hover,
.outline a:focus-visible {
  color: var(--accent-strong);
}

.outline-level-3 {
  padding-left: 12px;
}

.outline-empty {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.page-pagination {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 42px;
  max-width: 860px;
}

.page-link {
  border: 1px solid var(--line);
  border-radius: 10px;
  color: inherit;
  display: grid;
  gap: 6px;
  min-height: 88px;
  padding: 16px 18px;
  text-decoration: none;
}

.page-link:hover,
.page-link:focus-visible {
  border-color: var(--accent);
}

.page-link-label {
  color: var(--muted);
  font-size: 13px;
}

.page-link.ghost {
  visibility: hidden;
}

@media (max-width: 1080px) {
  .topbar-shell {
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }

  .top-nav {
    flex-wrap: wrap;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-outline {
    padding: 0 56px 40px;
  }

  .outline-shell {
    position: static;
  }
}

@media (max-width: 820px) {
  .topbar {
    position: static;
  }

  .sidebar {
    position: static;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .layout {
    display: block;
    margin-left: 0;
    padding: 0;
  }

  .page {
    padding: 28px 20px 48px;
  }

  .page-outline {
    padding: 0 20px 40px;
  }

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