/* —— GitBook / Cherry docs (match docs.cherryai.com.cn) —— */
.app-shell--docs,
.site-main--docs {
  background: #fff;
}

/* 桌面：中间内容默认高度约为原可视区的 2 倍；整页滚动，页脚在下方 */
.app-shell--docs {
  height: auto;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
}

.app-shell--docs .site-footer {
  flex-shrink: 0;
}

.site-main--docs {
  padding: 0;
  width: 100%;
  max-width: none;
  flex: 1 0 auto;
  /* 扣除顶栏与统一页脚后，中间区按约 2 倍可视高度扩展 */
  min-height: calc(2 * (100dvh - var(--gb-header, 6.25rem) - 18rem));
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.gb-docs {
  /* 文档强调色 RGB(52, 81, 178) */
  --primary-9: 52 81 178;
  --primary-2: 239 242 252;
  --primary-10: 41 64 142;
  --gb-nav-active: 52 81 178;
  --tint-1: 255 255 255;
  --tint-4: 246 241 240;
  --tint-6: 236 227 226;
  --tint-12: 31 28 28;
  --gb-side: 18rem;
  --gb-content: 48rem;
  --gb-toc: 14rem;
  --gb-gap: 2rem;
  /* 对齐原有 ProductNavBar（产品行 + 栏目行）高度 */
  --gb-header: 6.25rem;
  --gb-font: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  flex: 1 0 auto;
  min-height: 100%;
  height: auto;
  overflow: visible;
  background: rgb(var(--tint-1));
  color: rgb(var(--tint-12));
  font-family: var(--gb-font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Body：与顶栏 ProductNavBar 同宽同左右边距，保证「使用文档」与「前微软件」左对齐 */
.gb-frame {
  display: grid;
  grid-template-columns: var(--gb-side) minmax(0, 1fr) var(--gb-toc);
  column-gap: var(--gb-gap);
  width: 100%;
  max-width: var(--max-features);
  margin-inline: auto;
  padding: 1.5rem 1.25rem 1.5rem;
  align-items: start;
  box-sizing: border-box;
  height: auto;
  min-height: calc(2 * (100dvh - var(--gb-header, 6.25rem) - 18rem) - 3rem);
}

.gb-sidebar {
  position: sticky;
  top: calc(var(--gb-header) + 0.75rem);
  max-height: calc(100dvh - var(--gb-header) - 1.5rem);
  height: auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: #f6f6f6;
  border-right: 0;
  border-radius: 0.75rem;
  padding: 0.75rem 0.65rem;
  box-sizing: border-box;
  /* 各级菜单统一字号（与正文一致） */
  --gb-nav-fs: 1rem;
  /* 层级左缩进（加大区分度） */
  --gb-indent-1: 0.4rem;
  --gb-indent-2: 1.35rem;
  --gb-indent-3: 2.35rem;
  font-size: var(--gb-nav-fs);
}

.gb-sidebar__space {
  margin: 0 0 0.85rem;
  padding: 0;
  font-size: var(--gb-nav-fs);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, rgb(var(--tint-12)) 45%, transparent);
}

.gb-toc {
  position: sticky;
  top: calc(var(--gb-header) + 0.75rem);
  max-height: calc(100dvh - var(--gb-header) - 1.5rem);
  height: auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.gb-section + .gb-section {
  margin-top: 0.35rem;
}

.gb-section__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.55rem 0.5rem var(--gb-indent-1);
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: rgb(var(--tint-12));
  font-family: inherit;
  font-size: var(--gb-nav-fs);
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
  text-align: left;
}

.gb-section__toggle:hover {
  background: rgba(255, 255, 255, 0.65);
}

.gb-section__label {
  min-width: 0;
  font-size: inherit;
  font-weight: inherit;
}

.gb-section.is-open > .gb-section__toggle > .gb-chevron {
  transform: rotate(90deg);
}

.gb-section__body {
  padding: 0.1rem 0 0.4rem;
}

.gb-group + .gb-group {
  margin-top: 0.15rem;
}

.gb-group__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem 0.4rem var(--gb-indent-2);
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: rgb(var(--tint-12));
  font-family: inherit;
  font-size: var(--gb-nav-fs);
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
  text-align: left;
}

.gb-group__toggle:hover {
  background: rgba(255, 255, 255, 0.65);
}

.gb-group__label {
  min-width: 0;
  font-size: inherit;
  font-weight: inherit;
}

.gb-chevron {
  width: 0.875rem;
  height: 0.875rem;
  color: color-mix(in srgb, rgb(var(--tint-12)) 40%, transparent);
  display: inline-flex;
  flex: 0 0 auto;
  transition: transform 0.15s ease;
}

.gb-chevron svg {
  width: 100%;
  height: 100%;
}

.gb-group.is-open > .gb-group__toggle > .gb-chevron {
  transform: rotate(90deg);
}

.gb-pages {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.05rem 0 0.35rem;
}

/* 二级：直接挂在 section 下的页面（如协议） */
.gb-section__body > .gb-pages .gb-page {
  padding-left: var(--gb-indent-2);
}

/* 三级：分组下的页面 */
.gb-group .gb-pages .gb-page {
  padding-left: var(--gb-indent-3);
}

.gb-page {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.4rem 0.55rem 0.4rem var(--gb-indent-2);
  border-radius: 0.375rem;
  color: rgb(var(--tint-12));
  font-size: var(--gb-nav-fs);
  font-weight: 400;
  line-height: 1.5;
  text-decoration: none;
  text-wrap: balance;
}

.gb-page:hover {
  background: rgba(255, 255, 255, 0.7);
  color: rgb(var(--tint-12));
  text-decoration: none;
}

.gb-page.router-link-active {
  background: rgb(var(--primary-2));
  color: rgb(var(--gb-nav-active));
  font-weight: 400;
}

.gb-page__icon {
  width: 1.25em;
  height: 1.25em;
  margin-top: 0.08em;
  color: currentColor;
  opacity: 1;
  display: inline-flex;
  flex: 0 0 auto;
}

.gb-page__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.gb-page:hover .gb-page__icon {
  color: currentColor;
}

.gb-page.router-link-active .gb-page__icon {
  color: rgb(var(--gb-nav-active));
}

.gb-breadcrumb {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  color: color-mix(in srgb, rgb(var(--tint-12)) 50%, transparent);
}

.gb-breadcrumb__sep {
  margin: 0 0.35rem;
}

.gb-docs .gb-prose a {
  color: rgb(var(--primary-9));
}

.gb-article {
  min-width: 0;
  min-height: 0;
  max-width: var(--gb-content);
  width: 100%;
  height: auto;
  padding: 0.15rem 0.25rem 2.5rem 0;
  overflow-x: hidden;
  overflow-y: visible;
  overscroll-behavior: auto;
  touch-action: pan-y;
}

.gb-article::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.gb-article .gb-prose :is(h1,
h2,
h3,
h4) {
  scroll-margin-top: 0.75rem;
}

.gb-article__title {
  margin: 0 0 1rem;
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: rgb(var(--tint-12));
}

.gb-toc__label {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: color-mix(in srgb, rgb(var(--tint-12)) 55%, transparent);
}

.gb-toc__list {
  --gb-toc-rail: 2px;
  display: flex;
  flex-direction: column;
  border-left: var(--gb-toc-rail) solid color-mix(in srgb, rgb(var(--tint-12)) 10%, transparent);
}

.gb-toc__link {
  position: relative;
  display: block;
  padding: 0.35rem 0 0.35rem 0.85rem;
  margin-left: calc(var(--gb-toc-rail) * -1);
  border-left: var(--gb-toc-rail) solid transparent;
  box-sizing: border-box;
  /* 与左侧导航默认文字色一致 */
  color: rgb(var(--tint-12));
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  text-decoration: none;
}

.gb-toc__link.is-h3 {
  padding-left: 1.35rem;
}

.gb-toc__link:hover {
  color: rgb(var(--tint-12));
  text-decoration: none;
}

.gb-toc__link.is-active {
  color: rgb(var(--gb-nav-active));
  border-left-color: transparent;
  font-weight: 400;
}

/* 蓝色竖线仅与文字行高对齐，不拉满整行 padding */
.gb-toc__link.is-active::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: var(--gb-toc-rail);
  height: 1em;
  background: rgb(var(--gb-nav-active));
  border-radius: 1px;
}

.gb-toc__empty {
  margin: 0;
  color: color-mix(in srgb, rgb(var(--tint-12)) 40%, transparent);
  font-size: 1rem;
}

.gb-prose {
  font-size: 1rem;
  line-height: 1.75;
  color: color-mix(in srgb, rgb(var(--tint-12)) 88%, transparent);
}

.gb-prose h1,
.gb-prose h2,
.gb-prose h3,
.gb-prose h4 {
  scroll-margin-top: 5.5rem;
  color: rgb(var(--tint-12));
  font-weight: 650;
  letter-spacing: -0.015em;
}

.gb-prose h2 {
  margin: 2rem 0 0.75rem;
  padding-top: 1.25rem;
  font-size: 1.5rem;
  border-top: 1px solid color-mix(in srgb, rgb(var(--tint-12)) 8%, transparent);
}

.gb-prose h2:first-child {
  border-top: 0;
  margin-top: 0.35rem;
  padding-top: 0;
}

.gb-prose h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.2rem;
}

.gb-prose h4 {
  margin: 1.15rem 0 0.4rem;
  font-size: 1.05rem;
}

.gb-prose p {
  margin: 0.75rem 0;
}

.gb-prose strong {
  color: rgb(var(--tint-12));
  font-weight: 600;
}

.gb-prose a {
  color: rgb(var(--primary-9));
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-color: color-mix(in srgb, rgb(var(--primary-9)) 35%, transparent);
}

.gb-prose a:hover {
  text-decoration-color: rgb(var(--primary-9));
}

.gb-prose ul,
.gb-prose ol {
  margin: 0.65rem 0 1rem;
  padding-left: 1.4rem;
}

.gb-prose li + li {
  margin-top: 0.3rem;
}

.gb-prose blockquote {
  margin: 1rem 0;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 2px solid rgb(var(--primary-9));
  color: color-mix(in srgb, rgb(var(--tint-12)) 75%, transparent);
}

.gb-prose hr {
  border: 0;
  border-top: 1px solid color-mix(in srgb, rgb(var(--tint-12)) 8%, transparent);
  margin: 2rem 0;
}

.gb-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.25rem;
  font-size: 0.9rem;
  overflow: hidden;
  border: 1px solid rgb(var(--tint-6));
  border-radius: 0.5rem;
}

.gb-prose th,
.gb-prose td {
  border: 1px solid rgb(var(--tint-6));
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.gb-prose th {
  background: rgb(var(--tint-4));
  font-weight: 600;
  color: rgb(var(--tint-12));
}

.gb-prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: rgb(var(--tint-4));
  color: rgb(var(--tint-12));
  padding: 0.1em 0.35em;
  border-radius: 0.3rem;
}

.gb-prose pre {
  background: #1f1c1c;
  color: #f5f5f5;
  padding: 0.95rem 1.05rem;
  border-radius: 0.6rem;
  overflow: auto;
}

.gb-prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

@media (max-width: 1100px) {.gb-frame {
    grid-template-columns: var(--gb-side) minmax(0, 1fr);
  }

.gb-toc { display: none; }}

@media (max-width: 800px) {.app-shell--docs {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

.site-main--docs {
    flex: none;
    min-height: 0;
    overflow: visible;
    display: block;
  }

.gb-docs {
    --gb-header: 7.5rem;
    height: auto;
    flex: none;
    overflow: visible;
  }

.gb-frame {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    padding: 1rem 1.25rem 3rem;
    row-gap: 1rem;
  }

.gb-sidebar {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 0.75rem;
    border: 1px solid rgb(var(--tint-6));
    border-radius: 0.75rem;
    background: #f8f6f6;
  }

.gb-toc {
    position: static;
    max-height: none;
  }

.gb-article {
    height: auto;
    overflow: visible;
    padding-bottom: 1.5rem;
  }

.gb-article__title { font-size: 1.75rem; }}

.gb-page__icon { display: inline-flex; width: 1.05em; height: 1.05em; flex: 0 0 auto; }

.gb-section__body,
.gb-group > .gb-pages { display: none; }

.gb-section.is-open > .gb-section__body,
.gb-group.is-open > .gb-pages { display: block; }
