/* 文档精选：沿用文档布局，增加图文推荐和置顶全文。 */
:root {
  --bg: #fff;
  --surface: #fff;
  --text: #243446;
  --muted: #718093;
  --line: #e1e7ed;
  --accent: #386cd5;
  --soft: #eef3fd;
  --code: #f4f6f9;
  --scrollbar: #c1cbd7;
  --radius: 7px;
  --docs-rail: #f8f9fb;
}
:root.dark {
  --bg: #000;
  --surface: #1c222b;
  --text: #e1e6ef;
  --muted: #9caabc;
  --line: #323c49;
  --accent: #91b6ff;
  --soft: #26344c;
  --code: #212b38;
  --scrollbar: #4c5d73;
  --docs-rail: #000;
}
:root.dark body.theme-gitbook {
  background-color: var(--bg);
  background-image: none;
}
.theme-gitbook .site-header {
  background: none;
  border: 0;
  box-shadow: none;
}
.theme-gitbook .header-inner {
  background: none;
  border: 0;
  box-shadow: none;
  max-width: 1560px;
  min-height: 70px;
  padding: 14px 30px;
}
.theme-gitbook .brand {
  font-size: 21px;
  font-weight: 650;
}
.theme-gitbook .theme-toggle,
.theme-gitbook .search-toggle {
  border-radius: 7px;
  border-color: transparent;
}
.theme-gitbook .theme-toggle:hover,
.theme-gitbook .search-toggle:hover {
  background: var(--soft);
}
.gitbook-workspace {
  max-width: 1500px;
  width: calc(100% - 48px);
  padding-top: 0;
  padding-bottom: 0;
}
.docs-workspace {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr) 214px;
  gap: 36px;
  min-height: calc(100vh - 165px);
}
/* 关闭首页文章后同时隐藏文章导航，并收回左侧栏占用的空间。 */
.docs-workspace.docs-without-index {
  grid-template-columns: minmax(0, 1fr) 214px;
}
.theme-archive .docs-workspace {
  display: block;
  max-width: 860px;
  min-height: 0;
  margin: auto;
}
.theme-gitbook .breadcrumbs {
  margin: 22px 0 18px;
}
.docs-content {
  padding: 34px 0 52px;
  min-width: 0;
}
.docs-workspace > .reading-index {
  padding: 32px 20px 36px 2px;
  border-right: 1px solid var(--line);
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--docs-rail));
}
.docs-workspace > .home-rail,
.docs-workspace > .article-rail {
  border-left: 1px solid var(--line);
  padding: 36px 0 28px 24px;
  gap: 30px;
}
.docs-workspace .home-sidebar {
  font-size: 12px;
}
.docs-workspace .category-list a {
  font-size: 12px;
  padding: 6px 0;
}
.docs-workspace .sidebar-section h2 {
  font-size: 11px;
  letter-spacing: 0;
  color: var(--muted);
}
.docs-workspace .sidebar-section + .sidebar-section {
  margin-top: 24px;
  padding-top: 20px;
}
.docs-welcome {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  margin-bottom: 26px;
}
.docs-welcome h1 {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.docs-welcome .intro-kicker {
  font-size: 11px;
  letter-spacing: 0.08em;
}
.docs-welcome .intro-description {
  font-size: 14px;
}
.docs-summary {
  display: flex;
  gap: 10px 20px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
  margin-top: 20px;
}
.docs-summary > span::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--accent);
  display: inline-block;
  margin-right: 7px;
  border-radius: 50%;
}
.gitbook-workspace .theme-list-title {
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0;
}
.gitbook-workspace .theme-list-heading {
  margin-bottom: 18px;
}
.gitbook-entries {
  display: grid;
  gap: 14px;
}
.gitbook-workspace .docs-chapter {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 22px;
  gap: 16px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 22px;
  background: var(--bg);
}
.docs-chapter:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 18px rgba(30, 71, 140, 0.045);
}
.chapter-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 34px;
  color: var(--accent);
}
.docs-chapter h2 {
  font-size: 20px;
  letter-spacing: 0;
  margin: 0 0 8px;
}
.docs-chapter .card-summary {
  font-size: 13px;
  -webkit-line-clamp: 2;
  margin-bottom: 13px;
  line-height: 1.9;
}
.chapter-arrow {
  color: var(--muted);
  font-size: 21px;
  align-self: center;
}
.docs-chapter .card-meta {
  font-size: 11px;
}
.docs-reading {
  min-height: 0;
}
.docs-reading .docs-content {
  padding-top: 10px;
}
.docs-reading > .reading-index,
.docs-reading > .article-rail {
  padding-top: 12px;
}
.docs-reading .article-header {
  padding-bottom: 24px;
}
.docs-reading .article-header h1 {
  font-size: 38px;
  font-weight: 700;
}
.docs-reading .prose {
  font-size: 15px;
  line-height: 1.95;
}
.docs-reading .prose h2 {
  font-size: 25px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 36px;
}
.docs-reading .prose h3 {
  font-size: 20px;
}
.docs-reading .prose blockquote {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--soft);
  padding: 14px 20px;
  border-radius: 6px;
}
.gitbook-workspace .ad-copy {
  padding: 14px;
  font-size: 12px;
}
.gitbook-workspace .toc {
  font-size: 12px;
}
.gitbook-workspace .toc > div {
  font-size: 11px;
  color: var(--muted);
}
.theme-gitbook .site-footer {
  max-width: 1500px;
  padding: 16px 0;
}
@media (max-width: 1160px) {
  .docs-workspace {
    grid-template-columns: 180px minmax(0, 1fr) 184px;
    gap: 24px;
  }
  .docs-workspace > .home-rail,
  .docs-workspace > .article-rail {
    padding-left: 18px;
  }
  .docs-workspace > .reading-index {
    padding-right: 14px;
  }
}
@media (max-width: 980px) {
  .docs-workspace.docs-without-index {
    display: block;
  }
  .docs-workspace {
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 24px;
  }
  .docs-workspace > .home-rail,
  .docs-workspace > .article-rail {
    grid-column: 2;
    border: 0;
    padding: 0 0 28px;
    margin: 0;
  }
  .docs-workspace > .home-rail .home-sidebar {
    display: none;
  }
  .docs-workspace .reading-index {
    grid-row: 1/3;
  }
  .docs-workspace > .article-rail .ad-slot {
    grid-template-columns: minmax(0, 1fr);
  }
  .docs-workspace {
    min-height: 0;
  }
  .docs-content {
    padding-bottom: 28px;
  }
}
@media (max-width: 760px) {
  .gitbook-workspace {
    width: calc(100% - 36px);
  }
  .docs-workspace {
    display: block;
  }
  .docs-content {
    padding: 24px 0;
  }
  .docs-welcome h1 {
    font-size: 32px;
  }
  .gitbook-workspace .docs-chapter {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 12px;
    padding: 18px 16px;
  }
  .chapter-arrow {
    display: none;
  }
  .docs-chapter h2 {
    font-size: 21px;
  }
  .docs-workspace > .home-rail,
  .docs-workspace > .article-rail {
    padding: 0 0 24px;
  }
  .docs-reading .article-header h1 {
    font-size: 30px;
  }
  .docs-reading .prose h2 {
    font-size: 23px;
  }
  .gitbook-workspace .article-rail {
    margin: 0;
  }
}

/* 推荐数据只来自首页侧边广告位；没有条目时模板不输出空栏。 */
.featured-recommendations {
  min-width: 0;
  align-self: start;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.featured-recommendations .index-heading { font-size: 13px; margin-top: 0; }
.recommendations-scroll { min-width: 0; min-height: 0; }
.featured-recommendations .ad-slot { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.featured-recommendations .ad-card { border-radius: 8px; background: var(--bg); }
.featured-recommendations .ad-image { display: block; width: 100%; height: auto; max-height: none; object-fit: contain; }
.featured-recommendations .ad-copy { overflow-wrap: anywhere; padding: 14px; line-height: 1.8; }
.featured-recommendations .ad-copy > :first-child { margin-top: 0; }
.featured-recommendations .ad-copy > :last-child { margin-bottom: 0; }
.home-feature {
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  padding: 26px;
  background: var(--bg);
}
.feature-header { padding-bottom: 22px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.feature-eyebrow { color: var(--accent); font-size: 11px; letter-spacing: .08em; margin-bottom: 12px; }
.feature-header h2 { font-size: 25px; line-height: 1.5; margin: 0 0 14px; overflow-wrap: anywhere; }
.feature-header h2 a { color: var(--text); }
.feature-header h2 a:hover { color: var(--accent); }
.feature-header .card-meta { font-size: 11px; }
.home-feature-body { font-size: 15px; line-height: 1.95; overflow-wrap: anywhere; white-space: pre-wrap; }
.home-feature-body.is-rendered { white-space: normal; }
.home-feature-body > :first-child { margin-top: 0; }
.home-feature-body h3 { font-size: 21px; margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line); }
.home-feature-body h4 { font-size: 18px; }
.home-feature-body img { display: block; max-width: 100%; height: auto; border-radius: 7px; margin: 20px auto; }
.home-feature-body figure { margin: 24px 0; }
.home-feature-body figcaption { font-size: 12px; color: var(--muted); text-align: center; }
.home-feature-body pre { overflow-x: auto; max-width: 100%; }
.home-feature-body table { display: block; max-width: 100%; overflow-x: auto; }
.home-feature-body blockquote { margin-inline: 0; background: var(--soft); padding: 12px 18px; border-left: 3px solid var(--accent); border-radius: 5px; }
.feature-footer { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 18px; font-size: 13px; }
.feature-image-fallback { display: block; padding: 12px; border: 1px dashed var(--line); }

/* 首页大横幅独立排版，兼容独立图片以及 Markdown 文案中的图片。 */
.featured-home-banner { --banner-logo-size: 88px; --banner-logo-gap: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 0 28px; min-width: 0; }
.featured-banner-card { position: relative; display: block; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
.featured-banner-card:only-child { grid-column: 1 / -1; }
.featured-banner-card:hover { border-color: var(--accent); color: var(--text); }
.featured-banner-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.featured-banner-image { display: block; width: 100%; height: auto; max-width: 100%; object-fit: contain; }
.featured-banner-copy { min-width: 0; padding: 16px 18px; overflow-wrap: anywhere; font-size: 14px; line-height: 1.8; }
.featured-banner-copy > :first-child { margin-top: 0; }
.featured-banner-copy > :last-child { margin-bottom: 0; }
.featured-banner-copy h1, .featured-banner-copy h2, .featured-banner-copy h3, .featured-banner-copy h4 { font-size: 18px; line-height: 1.5; }
.featured-banner-copy img { display: block; max-width: 100%; height: auto; }
.featured-banner-copy figure { margin: 0; }
.featured-banner-copy ul, .featured-banner-copy ol { padding-left: 1.4em; }
.featured-banner-copy pre, .featured-banner-copy table { display: block; max-width: 100%; overflow: auto; }
@media (max-width: 760px) {
  .featured-home-banner { grid-template-columns: minmax(0, 1fr); }
  .featured-banner-copy { padding: 14px 16px; }
}
@media (max-width: 1160px) {
  .home-feature { padding: 22px; }
}
@media (min-width: 761px) {
  .docs-home > .docs-content { grid-column: 2; grid-row: 1; }
  .docs-home > .featured-recommendations { grid-column: 1; grid-row: 1 / 3; }
  .docs-home.docs-without-index > .docs-content { grid-column: 1; }
  .docs-home.docs-without-index > .home-rail { grid-column: 2; }
}
@media (max-width: 980px) and (min-width: 761px) {
  .docs-home.docs-without-index { display: block; }
}
@media (max-width: 760px) {
  .docs-home { display: flex; flex-direction: column; }
  .docs-home > .docs-content { order: 1; width: 100%; }
  .featured-recommendations { order: 2; width: 100%; padding: 16px; }
  .docs-home > .home-rail { order: 3; }
  .featured-recommendations .ad-slot { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .home-feature { padding: 20px 16px; }
  .feature-header h2 { font-size: 23px; }
  .home-feature-body { font-size: 15px; }
}
@media (max-width: 480px) {
  .featured-recommendations .ad-slot { grid-template-columns: minmax(0, 1fr); }
}

/* 推广图案保留原比例与原有品牌配色，只统一承载它们的卡片。 */
.promotion-card,
.featured-banner-card { border-radius: 14px; box-shadow: 0 4px 18px rgb(20 40 70 / 4%); }
.featured-home-banner > .featured-banner-card:not(:only-child) { display: flex; flex-direction: column; }
.featured-home-banner > .featured-banner-card:not(:only-child) > .featured-banner-copy { flex: 1; }
.promotion-media { display: block; padding: 14px 14px 0; }
.promotion-media:only-child { padding-bottom: 12px; }
.promotion-media .ad-image { width: 100%; height: auto; max-height: 180px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; }
.promotion-card .ad-copy { padding: 16px; font-size: 13px; line-height: 1.75; }
.promotion-card .ad-copy h2 { margin: 16px 0 6px; font-size: 21px; letter-spacing: -.02em; }
.promotion-card .ad-copy h3 { margin: 6px 0 10px; color: var(--accent); font-size: 14px; }
.promotion-card .ad-copy p { margin: 8px 0; }
.promotion-card .ad-copy > p:first-child:has(> img:only-child),
.featured-banner-copy > p:first-child:has(> img:only-child) { margin: 0 0 16px; }
.promotion-card .ad-copy > p:first-child > img:only-child,
.featured-banner-copy > p:first-child > img:only-child { display: block; width: 100%; height: auto; max-height: 180px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; margin: 0; }
.promotion-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.featured-banner-copy h2 { margin: 0 0 8px; font-size: 22px; }
.featured-banner-copy h3 { font-size: 15px; color: var(--accent); }
.featured-banner-copy p { margin: 8px 0; }

/* 正文中独立品牌图与紧随其后的注册链接组成一个完整入口。 */
.prose p:has(> img:only-child):has(+ p > strong > a[href*="#/register?code="]) { max-width: 420px; margin: 30px auto 12px; }
.prose p:has(> img:only-child):has(+ p > strong > a[href*="#/register?code="]) > img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 6px 20px rgb(20 40 70 / 6%); margin: 0; }
.prose p:has(> strong > a[href*="#/register?code="]) { text-align: center; margin: 12px 0 28px; }
.prose p > strong > a[href*="#/register?code="] { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 24px; border: 1px solid var(--accent); border-radius: 9px; background: var(--soft); color: var(--accent); text-decoration: none; line-height: 1.5; }
.prose p > strong > a[href*="#/register?code="]:hover { text-decoration: underline; text-underline-offset: 4px; }
.prose p > strong > a[href*="#/register?code="]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.docs-welcome h1 { line-height: 1.25; }
.docs-welcome .intro-description { max-width: 58em; line-height: 1.85; }
.home-feature { border-radius: 14px; }
.home-feature-body { font-size: 16px; line-height: 1.9; }
.home-feature-body h3 { line-height: 1.55; }
.gitbook-workspace .docs-chapter { border-radius: 12px; }
.chapter-cover { grid-column: 1 / -1; margin: 0 0 4px; min-width: 0; }
.chapter-cover img { display: block; width: 100%; max-height: 260px; height: auto; object-fit: contain; border-radius: 8px; background: var(--soft); }

@media (max-width: 760px) {
  .docs-welcome { margin-bottom: 22px; }
  .featured-home-banner { gap: 14px; }
  .home-feature-body { font-size: 15px; }
}

/* 首页收回右栏，左侧推荐更窄；文章详情继续使用自己的阅读布局。 */
@media (min-width: 761px) {
  .docs-home { grid-template-columns: 172px minmax(0, 1fr); gap: 28px; }
  .docs-home.docs-without-index { grid-template-columns: minmax(0, 1fr); display: grid; }
  .docs-home > .featured-recommendations { position: sticky; top: 24px; grid-row: 1; display: flex; flex-direction: column; margin-top: 34px; max-height: min(680px, calc(100vh - 160px)); max-height: min(680px, calc(100dvh - 160px)); }
  .featured-recommendations .index-heading { flex: 0 0 auto; margin-bottom: 14px; }
  .featured-recommendations .recommendations-scroll { flex: 0 1 auto; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-gutter: stable; }
}
.featured-recommendations .promotion-card .ad-copy { padding: 12px; font-size: 12px; line-height: 1.7; text-align: center; }
.featured-recommendations .promotion-card .ad-copy h2 { margin-top: 12px; font-size: 18px; }
.featured-recommendations .promotion-card .ad-copy h3 { font-size: 12px; }
.featured-recommendations .promotion-media { padding: 12px 12px 0; }
.featured-recommendations .promotion-media .ad-image,
.featured-recommendations .ad-copy > p:first-child > img:only-child { width: 76px; height: 76px; max-height: none; object-fit: cover; object-position: center; aspect-ratio: 1; border-radius: 18px; margin: 0 auto; }
.featured-recommendations .ad-copy > p:first-child:has(> img:only-child) { margin-bottom: 12px; }

/* 首图独立占据左侧，兼容 Markdown 图片与文字同段；文案高度自然扩展。 */
.featured-banner-copy { position: relative; padding: 14px; font-size: 13px; line-height: 1.65; }
.featured-banner-copy h2 { margin: 0 0 4px; font-size: 20px; }
.featured-banner-copy h3 { margin: 0 0 6px; font-size: 13px; }
.featured-banner-copy p { margin: 6px 0; }
.featured-banner-copy:is(:has(> img:first-child), :has(> p:first-child img), :has(> figure:first-child img)) { display: flex; flex-direction: column; justify-content: center; min-height: calc(var(--banner-logo-size) + 28px); padding-left: calc(14px + var(--banner-logo-size) + var(--banner-logo-gap)); }
.featured-banner-copy > p:first-child:has(img) { margin: 0; }
.featured-banner-copy > p:first-child:has(> img:only-child),
.featured-banner-copy > figure:first-child:has(> img:only-child) { display: contents; }
.featured-banner-copy > img:first-child,
.featured-banner-copy > p:first-child img:first-of-type,
.featured-banner-copy > figure:first-child img:first-of-type { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); width: var(--banner-logo-size); height: var(--banner-logo-size); max-height: none; object-fit: cover; border: 1px solid var(--line); border-radius: 14px; margin: 0; }
.featured-banner-copy > p:first-child:has(img) > img + br,
.featured-banner-copy > p:first-child:has(img) > strong:first-of-type + br { display: none; }
.featured-banner-copy > p:first-child:has(img) > strong:first-of-type { display: block; font-size: 20px; line-height: 1.5; margin-bottom: 4px; }
.featured-banner-copy > :is(h1, h2, h3, h4):first-child,
.featured-banner-copy > :is(p, figure):first-child:has(img) + :is(h1, h2, h3, h4),
.featured-banner-copy > img:first-child + :is(h1, h2, h3, h4) { font-size: 20px; line-height: 1.5; color: var(--text); }
.featured-banner-copy > p:first-child > strong:only-child,
.featured-banner-copy > p:first-child:has(img) + p > strong:only-child,
.featured-banner-copy > img:first-child + p > strong:only-child { font-size: 20px; line-height: 1.5; }
.featured-home-banner > .featured-banner-card.featured-banner-mixed { display: grid; grid-template-columns: var(--banner-logo-size) minmax(0, 1fr); gap: var(--banner-logo-gap); padding: 14px; align-items: center; }
.featured-banner-mixed > .featured-banner-image { width: var(--banner-logo-size); height: var(--banner-logo-size); object-fit: cover; object-position: center; border: 1px solid var(--line); border-radius: 14px; }
.featured-banner-mixed > .featured-banner-copy { padding: 0; }
.featured-banner-card:not(.featured-banner-mixed) > .featured-banner-image { max-height: 120px; }


.docs-welcome .intro-description { font-size: 14px; }
.docs-welcome .docs-summary { margin-top: 18px; }
@media (max-width: 1000px) {
  .featured-home-banner { --banner-logo-size: 64px; --banner-logo-gap: 10px; }
}
@media (max-width: 760px) {
  .docs-welcome h1 { font-size: 29px; }
  .featured-home-banner { --banner-logo-size: 72px; --banner-logo-gap: 14px; }
  .docs-home .banner-with-image:not(.banner-with-overlay) { min-height: 0; }
  .docs-home .banner-with-image:not(.banner-with-overlay) > .banner-image { position: static; height: auto; object-fit: contain; }
}
