:root {
  --green: #f9771b;
  --green-dark: #f9771b;
  --text: #1f2937;
  --muted: #7b8794;
  --line: #e8edf2;
  --bg: #f6f8fa;
  --panel: #ffffff;
  --code-bg: #f7f9fb;
  --shadow: 0 8px 24px rgba(31, 41, 55, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 1180px;
  color: var(--text);
  background: var(--bg);
  font: 14px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

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

button {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14.5%;
  background: var(--panel);
  border-top: 3px solid var(--green);
  border-bottom: 1px solid #edf0f4;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 22px;
  font-weight: 700;
}

.brand-title {
  color: #30343b;
  font-size: 25px;
  font-weight: 500;
}

.brand-divider {
  width: 1px;
  height: 20px;
  background: #d7dde3;
  margin: 0 6px;
}

.brand-subtitle {
  color: #30343b;
  font-size: 16px;
  font-weight: 600;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 40px;
  color: #222832;
  font-size: 14px;
}

.main-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 52px;
}

.main-nav .workbench-link {
  color: #222832;
  font-weight: 600;
}

.main-nav a.is-active {
  color: var(--green);
}

.main-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  background: var(--green);
}

.section-tabs {
  position: sticky;
  top: 92px;
  z-index: 25;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 72px;
  padding: 0 14.5%;
  background: var(--panel);
  border-bottom: 1px solid #edf0f4;
  box-shadow: 0 6px 18px rgba(31, 41, 55, 0.04);
}

.section-tabs a {
  position: relative;
  height: 68px;
  display: inline-flex;
  align-items: center;
  color: #3f4652;
  font-size: 16px;
}

.section-tabs a.is-active {
  color: var(--green);
}

.section-tabs a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--green);
}

.layout {
  display: grid;
  grid-template-columns: 284px minmax(620px, 1fr) 260px;
  gap: 26px;
  max-width: 1580px;
  margin: 0 auto;
  padding: 22px 24px 48px;
}

.sidebar,
.toc-panel {
  position: sticky;
  top: 182px;
  align-self: start;
  max-height: calc(100vh - 204px);
  overflow: auto;
  background: var(--panel);
}

.sidebar {
  padding: 22px 0;
  border-right: 1px solid #eef2f6;
}

.sidebar-title,
.toc-title {
  padding: 0 24px 12px;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
}

.sidebar-group {
  margin-bottom: 8px;
}

.sidebar-group-title {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 24px;
  color: #202631;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-align: left;
}

.sidebar-group-title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1px solid #48505a;
  border-bottom: 1px solid #48505a;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.16s ease;
}

.sidebar-group.is-collapsed .sidebar-group-title::before {
  transform: rotate(-45deg);
}

.sidebar-group.is-collapsed .sidebar-group-links {
  display: none;
}

.sidebar-link {
  display: block;
  min-height: 36px;
  padding: 7px 22px 7px 50px;
  color: #4d5968;
  border-left: 3px solid transparent;
  line-height: 1.55;
}

.sidebar-link:hover {
  color: var(--green-dark);
  background: #f4fbf7;
}

.sidebar-link.is-active {
  color: var(--green);
  border-left-color: var(--green);
  background: #f4fbf7;
  font-weight: 700;
}

.content {
  min-width: 0;
}

.doc-card {
  min-height: calc(100vh - 210px);
  padding: 4px 32px 64px;
  background: var(--panel);
}

.doc-header {
  padding: 2px 0 28px;
  border-bottom: 1px solid transparent;
}

.doc-header h1 {
  margin: 0 0 14px;
  color: #111827;
  font-size: 31px;
  line-height: 1.35;
  font-weight: 800;
}

.doc-meta {
  margin: 0 0 12px;
  color: var(--muted);
}

.doc-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.doc-actions button,
.doc-actions a {
  padding: 0;
  color: #005bea;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.doc-actions button + button::before,
.doc-actions a + button::before,
.doc-actions button + a::before,
.doc-actions a + a::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 14px;
  margin: 0 14px 0 0;
  vertical-align: -2px;
  background: #dce2e8;
}

.markdown-source {
  white-space: pre-wrap;
  padding: 18px;
  margin: 0 0 28px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  color: #374151;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 13px;
  line-height: 1.65;
}

.markdown-body {
  color: #0f172a;
  font-size: 16px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  color: #030712;
  scroll-margin-top: 180px;
}

.markdown-body h1 {
  margin: 34px 0 16px;
  font-size: 28px;
  line-height: 1.35;
}

.markdown-body h2 {
  margin: 36px 0 12px;
  font-size: 25px;
  line-height: 1.4;
}

.markdown-body h3 {
  margin: 28px 0 10px;
  font-size: 18px;
}

.markdown-body h4 {
  margin: 22px 0 8px;
  font-size: 16px;
}

.markdown-body p {
  margin: 8px 0 12px;
}

.markdown-body ul,
.markdown-body ol {
  margin: 10px 0 16px;
  padding-left: 24px;
}

.markdown-body li {
  margin: 5px 0;
}

.markdown-body table {
  width: 100%;
  margin: 18px 0 28px;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid #d9e0e8;
  font-size: 14px;
}

.markdown-body th,
.markdown-body td {
  padding: 11px 12px;
  border: 1px solid #d9e0e8;
  vertical-align: top;
  word-break: break-word;
}

.markdown-body th {
  color: #111827;
  background: #f3f6fa;
  font-weight: 700;
}

.markdown-body pre {
  overflow: auto;
  margin: 14px 0 24px;
  padding: 16px;
  border: 1px solid #e1e7ee;
  border-radius: 4px;
  background: var(--code-bg);
  line-height: 1.6;
}

.markdown-body code {
  padding: 2px 5px;
  border-radius: 3px;
  background: #eef3f8;
  color: #0f3860;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 0.92em;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.markdown-body blockquote {
  margin: 16px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--green);
  background: #f3fbf7;
  color: #394556;
}

.markdown-body hr {
  margin: 30px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.toc-panel {
  padding: 28px 0;
}

.toc-nav {
  padding: 0 20px 0 26px;
  border-left: 2px solid #e8edf2;
}

.toc-link {
  display: block;
  padding: 6px 0 6px 14px;
  color: #697586;
  border-left: 2px solid transparent;
  transform: translateX(-28px);
  line-height: 1.55;
}

.toc-link:hover,
.toc-link.is-active {
  color: var(--green);
  border-left-color: var(--green);
}

.toc-link.level-3 {
  padding-left: 28px;
  font-size: 13px;
}

.empty-state {
  padding: 48px 0;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1280px) {
  body {
    min-width: 960px;
  }

  .topbar,
  .section-tabs {
    padding-left: 40px;
    padding-right: 40px;
  }

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

  .toc-panel {
    display: none;
  }
}



.layout.no-toc {
  grid-template-columns: 284px minmax(620px, 1fr) 260px;
}

.layout.no-sidebar.no-toc {
  grid-template-columns: 284px minmax(620px, 1fr) 260px;
}

.layout.no-toc:not(.no-sidebar) .content {
  grid-column: 2 / 4;
}

.layout.no-sidebar .content {
  grid-column: 1 / 4;
}

.layout.no-toc .toc-panel,
.layout.no-sidebar .sidebar {
  display: none;
}

.page-menu-link {
  padding-left: 24px;
}

.site-footer {
  max-width: 1580px;
  margin: 0 auto;
  padding: 0 24px 34px;
  color: #697586;
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 28px;
  padding: 22px 0 12px;
  border-top: 1px solid #e8edf2;
}

.footer-links a:hover,
.copyright a:hover {
  color: var(--green);
}

.copyright {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 18px;
}

@media (max-width: 1280px) {
  .layout.no-toc,
  .layout.no-sidebar.no-toc {
    grid-template-columns: 250px minmax(520px, 1fr);
  }

  .layout.no-toc:not(.no-sidebar) .content {
    grid-column: 2;
  }

  .layout.no-sidebar .content {
    grid-column: 1 / -1;
  }
}
