/* Markdown 文档：代码块、语法高亮、表格滚动
 * Python 配色参考 DeepSeek 代码生成风格（Ink / Sky / Aqua 色系）
 * 并按站点三套主题（星穹 / 玄墨 / 霁光）微调正文与代码对比度 */
:root {
  --xt-code-bg: #0b1526;
  --xt-code-border: rgba(106, 174, 242, 0.18);
  --xt-code-text: #c5d4e8;
  --xt-code-header-bg: rgba(0, 0, 0, 0.32);
  --xt-hl-keyword: #6aaef2;
  --xt-hl-string: #7ec8a4;
  --xt-hl-number: #36bbd4;
  --xt-hl-comment: #6b7a94;
  --xt-hl-function: #7dd3fc;
  --xt-hl-builtin: #3578e5;
  --xt-hl-params: #c5d4e8;
  --xt-hl-operator: #8ba4c7;
  --xt-hl-decorator: #d4b996;
  --xt-hl-constant: #36bbd4;
  --xt-doc-inline-code-bg: rgba(56, 189, 248, 0.1);
  --xt-doc-inline-code-border: rgba(56, 189, 248, 0.22);
  --xt-doc-inline-code-text: #7dd3fc;
  --xt-doc-link: #7dd3fc;
  --xt-doc-h2: #7dd3fc;
  --xt-doc-toc-text: #8892b0;
  --xt-doc-toc-hover: #e8edf5;
}

.xt-code-block {
  margin: 0.85rem 0 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--xt-code-border);
  background: var(--xt-code-bg);
  overflow: hidden;
  min-width: 0;
}

.xt-code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  min-height: 1.65rem;
  padding: 0.15rem 0.5rem 0.15rem 0.45rem;
  background: var(--xt-code-header-bg);
  border-bottom: 1px solid var(--xt-code-border);
}

.xt-code-block__lang {
  display: inline-flex;
  align-items: center;
  min-width: 1.5rem;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--xt-code-lang-text, rgba(255, 255, 255, 0.5));
  background: var(--xt-code-lang-bg, rgba(255, 255, 255, 0.06));
  font-family: var(--mono, "JetBrains Mono", ui-monospace, monospace);
  line-height: 1.35;
}

.xt-code-block__copy {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.42rem;
  border-radius: 5px;
  border: 1px solid var(--xt-code-copy-border, rgba(197, 205, 224, 0.22));
  background: var(--xt-code-copy-bg, rgba(197, 205, 224, 0.06));
  color: var(--xt-code-copy-text, rgba(255, 255, 255, 0.78));
  font-size: 0.68rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.xt-code-block__copy:hover {
  background: rgba(197, 205, 224, 0.12);
  border-color: rgba(197, 205, 224, 0.35);
  color: #fff;
}

.xt-code-block__copy.is-copied {
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
}

.xt-code-block pre {
  margin: 0;
  padding: 0.75rem 0.9rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: transparent;
  border: none;
  border-radius: 0;
}

.xt-code-block pre code.hljs,
.xt-code-block pre > code,
.markdown-body pre code,
.mine-doc-body pre code {
  display: block;
  padding: 0;
  border: none;
  background: transparent !important;
  color: var(--xt-code-text) !important;
  font-family: var(--mono, "JetBrains Mono", ui-monospace, monospace);
  font-size: clamp(0.72rem, 2.5vw, 0.8rem);
  line-height: 1.65;
  white-space: pre;
  word-break: normal;
}

/* 代码块语法色（!important 覆盖正文 color:inherit !important） */
.xt-code-block pre code.hljs .hljs-keyword,
.xt-code-block pre code.hljs .hljs-selector-tag {
  color: var(--xt-hl-keyword) !important;
  font-weight: 500;
}

.xt-code-block pre code.hljs .hljs-string,
.xt-code-block pre code.hljs .hljs-regexp,
.xt-code-block pre code.hljs .hljs-symbol {
  color: var(--xt-hl-string) !important;
}

.xt-code-block pre code.hljs .hljs-number,
.xt-code-block pre code.hljs .hljs-literal {
  color: var(--xt-hl-number) !important;
}

.xt-code-block pre code.hljs .hljs-comment,
.xt-code-block pre code.hljs .hljs-quote {
  color: var(--xt-hl-comment) !important;
  font-style: italic;
}

.xt-code-block pre code.hljs .hljs-title,
.xt-code-block pre code.hljs .hljs-title.function_,
.xt-code-block pre code.hljs .hljs-function .hljs-title {
  color: var(--xt-hl-function) !important;
}

.xt-code-block pre code.hljs .hljs-params,
.xt-code-block pre code.hljs .hljs-variable,
.xt-code-block pre code.hljs .hljs-template-variable,
.xt-code-block pre code.hljs .hljs-attr {
  color: var(--xt-hl-params) !important;
}

.xt-code-block pre code.hljs .hljs-operator,
.xt-code-block pre code.hljs .hljs-punctuation {
  color: var(--xt-hl-operator) !important;
}

.xt-code-block pre code.hljs .hljs-name,
.xt-code-block pre code.hljs .hljs-type,
.xt-code-block pre code.hljs .hljs-built_in {
  color: var(--xt-hl-builtin) !important;
}

.xt-code-block pre code.hljs .hljs-meta,
.xt-code-block pre code.hljs .hljs-meta .hljs-keyword,
.xt-code-block pre code.hljs .hljs-section {
  color: var(--xt-hl-decorator) !important;
}

.xt-code-block pre code.hljs .hljs-title.class_,
.xt-code-block pre code.hljs .hljs-class .hljs-title {
  color: var(--xt-hl-builtin) !important;
}

.xt-code-block pre code.hljs .hljs-subst,
.xt-code-block pre code.hljs .hljs-property {
  color: var(--xt-code-text) !important;
}

.xt-code-block pre code.hljs .hljs-constant {
  color: var(--xt-hl-constant) !important;
}

/* API 文档页头（与数据服务页 mine-doc-header 一致） */
.xt-api-doc-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(197, 205, 224, 0.12);
}

.xt-api-doc-header__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.xt-api-doc-header__title i {
  color: var(--accent, #d4b996);
}

.xt-api-doc-header__sub {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.55);
}

body.cyber-theme .xt-api-doc-header {
  border-bottom-color: rgba(197, 205, 224, 0.12);
}

html.theme-palette-jiguang .xt-api-doc-header {
  border-bottom-color: rgba(148, 163, 184, 0.25);
}

html.theme-palette-jiguang .xt-api-doc-header__title {
  color: #0f172a;
}

html.theme-palette-jiguang .xt-api-doc-header__title i {
  color: #b45309;
}

html.theme-palette-jiguang .xt-api-doc-header__sub {
  color: #64748b;
}

/* 表格横向滚动（移动端） */
.xt-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.85rem 0 1.1rem;
  border-radius: 8px;
  border: 1px solid rgba(197, 205, 224, 0.12);
}

.xt-table-wrap table {
  margin: 0;
  min-width: 480px;
}

/* 文档目录（数据接口独立页） */
.xt-doc-toc-panel {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.sidebar-group--related {
  margin-top: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

body.cyber-theme .sidebar-group--related {
  border-top-color: rgba(197, 205, 224, 0.12);
}

.xt-doc-toc-panel__toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.xt-doc-toc-panel__toggle .fa-chevron-down {
  margin-left: auto;
  font-size: 0.68rem;
  transition: transform 0.2s ease;
}

.xt-doc-toc-panel.is-collapsed .xt-doc-toc-panel__body {
  display: none;
}

.xt-doc-toc-panel.is-collapsed .fa-chevron-down {
  transform: rotate(-90deg);
}

.xt-doc-toc-panel__body {
  max-height: 280px;
  overflow-y: auto;
  margin-top: 0.45rem;
  padding-right: 0.15rem;
}

.xt-doc-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.xt-doc-toc__item a {
  display: block;
  padding: 0.32rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--xt-doc-toc-text, var(--muted));
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.xt-doc-toc__item--l3 a {
  padding-left: 0.95rem;
  font-size: 0.74rem;
}

.xt-doc-toc__item a:hover,
.xt-doc-toc__item a.is-active {
  color: var(--text);
  background: rgba(26, 95, 74, 0.06);
  border-left-color: var(--primary);
}

/* API 文档正文 */
.jcdata-api-doc-body,
.user-guide-body {
  min-width: 0;
  font-size: clamp(0.88rem, 2.2vw, 0.92rem);
  line-height: 1.75;
}

.jcdata-api-doc-body h1,
.user-guide-body h1 {
  font-size: clamp(1.25rem, 3vw, 1.45rem);
  font-weight: 700;
  margin: 0 0 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.jcdata-api-doc-body h2,
.user-guide-body h2 {
  font-size: clamp(1rem, 2.5vw, 1.12rem);
  font-weight: 700;
  margin: 2rem 0 0.85rem;
  scroll-margin-top: 100px;
}

.jcdata-api-doc-body h3,
.user-guide-body h3 {
  font-size: clamp(0.92rem, 2.2vw, 0.98rem);
  font-weight: 600;
  margin: 1.35rem 0 0.65rem;
  scroll-margin-top: 100px;
}

.jcdata-api-doc-body h4,
.user-guide-body h4 {
  font-size: 0.88rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
}

.jcdata-api-doc-body p,
.jcdata-api-doc-body li,
.user-guide-body p,
.user-guide-body li {
  margin: 0 0 0.75rem;
}

.jcdata-api-doc-body ul,
.jcdata-api-doc-body ol,
.user-guide-body ul,
.user-guide-body ol {
  padding-left: 1.35rem;
  margin: 0 0 0.85rem;
}

.jcdata-api-doc-body hr,
.user-guide-body hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1.5rem 0;
}

.jcdata-api-doc-body :not(pre) > code,
.user-guide-body :not(pre) > code {
  font-family: var(--mono, "JetBrains Mono", ui-monospace, monospace);
  font-size: 0.86em;
  padding: 0.12em 0.38em;
  border-radius: 5px;
  background: var(--xt-doc-inline-code-bg);
  border: 1px solid var(--xt-doc-inline-code-border);
  color: var(--xt-doc-inline-code-text);
}

.jcdata-api-doc-body table,
.user-guide-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.78rem, 2vw, 0.84rem);
}

.jcdata-api-doc-body th,
.jcdata-api-doc-body td,
.user-guide-body th,
.user-guide-body td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.jcdata-api-doc-body th,
.user-guide-body th {
  background: rgba(197, 205, 224, 0.08);
  font-weight: 600;
}

.jcdata-api-doc-body a,
.user-guide-body a {
  color: var(--xt-doc-link);
  text-decoration: none;
}

.jcdata-api-doc-body a:hover,
.user-guide-body a:hover {
  text-decoration: underline;
}

.jcdata-api-doc-loading,
.jcdata-api-doc-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.jcdata-api-doc-error {
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.2);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 10px;
  justify-content: flex-start;
}

/* 赛博暗色主题（星穹默认）· DeepSeek Ink 底 + 天蓝强调 */
body.cyber-theme {
  --xt-doc-inline-code-bg: rgba(56, 189, 248, 0.12);
  --xt-doc-inline-code-border: rgba(56, 189, 248, 0.28);
  --xt-doc-inline-code-text: #7dd3fc;
  --xt-doc-link: #7dd3fc;
  --xt-doc-h2: #7dd3fc;
  --xt-doc-toc-text: #94a3b8;
  --xt-doc-toc-hover: #f1f5f9;
}

body.cyber-theme .xt-code-block {
  --xt-code-bg: #0b1526;
  --xt-code-border: rgba(106, 174, 242, 0.2);
  --xt-code-text: #c5d4e8;
  --xt-code-header-bg: rgba(0, 0, 0, 0.36);
  --xt-hl-keyword: #6aaef2;
  --xt-hl-string: #7ec8a4;
  --xt-hl-number: #36bbd4;
  --xt-hl-comment: #7a8ba8;
  --xt-hl-function: #7dd3fc;
  --xt-hl-builtin: #3578e5;
  --xt-hl-operator: #8ba4c7;
  --xt-hl-decorator: #d4b996;
  --xt-hl-constant: #36bbd4;
}

body.cyber-theme .jcdata-api-doc-body,
body.cyber-theme .user-guide-body {
  color: rgba(255, 255, 255, 0.82);
}

body.cyber-theme .jcdata-api-doc-body h1,
body.cyber-theme .user-guide-body h1,
body.cyber-theme .jcdata-api-doc-body h3,
body.cyber-theme .user-guide-body h3,
body.cyber-theme .jcdata-api-doc-body strong,
body.cyber-theme .user-guide-body strong {
  color: #fff;
}

body.cyber-theme .jcdata-api-doc-body h2,
body.cyber-theme .user-guide-body h2 {
  color: var(--xt-doc-h2, #7dd3fc);
}

body.cyber-theme .jcdata-api-doc-body h4,
body.cyber-theme .user-guide-body h4 {
  color: rgba(255, 255, 255, 0.75);
}

body.cyber-theme .jcdata-api-doc-body th,
body.cyber-theme .user-guide-body th {
  background: rgba(197, 205, 224, 0.08);
  color: #fff;
}

body.cyber-theme .jcdata-api-doc-body td,
body.cyber-theme .user-guide-body td {
  color: rgba(255, 255, 255, 0.78);
}

body.cyber-theme .jcdata-api-doc-body th,
body.cyber-theme .jcdata-api-doc-body td,
body.cyber-theme .user-guide-body th,
body.cyber-theme .user-guide-body td {
  border-color: rgba(197, 205, 224, 0.18);
}

body.cyber-theme .xt-doc-toc__item a {
  color: var(--xt-doc-toc-text, #94a3b8);
}

body.cyber-theme .xt-doc-toc__item a:hover,
body.cyber-theme .xt-doc-toc__item a.is-active {
  color: var(--xt-doc-toc-hover, #f1f5f9);
  background: rgba(106, 174, 242, 0.1);
  border-left-color: #6aaef2;
}

body.cyber-theme .xt-doc-toc-panel {
  border-top-color: rgba(197, 205, 224, 0.12);
}

body.cyber-theme .xt-doc-toc-panel__toggle {
  border-color: rgba(197, 205, 224, 0.2);
  color: rgba(255, 255, 255, 0.78);
}

body.cyber-theme .xt-table-wrap {
  border-color: rgba(197, 205, 224, 0.12);
}

/* 玄墨主题：暖银底 + DeepSeek 蓝关键词 */
html.theme-palette-xuanmo body.cyber-theme {
  --xt-doc-inline-code-bg: rgba(196, 184, 168, 0.12);
  --xt-doc-inline-code-border: rgba(196, 184, 168, 0.28);
  --xt-doc-inline-code-text: #e4e4e7;
  --xt-doc-link: #a8c4e8;
  --xt-doc-h2: #c4b8a8;
  --xt-doc-toc-text: #a1a1aa;
  --xt-doc-toc-hover: #f4f4f5;
}

html.theme-palette-xuanmo .xt-code-block {
  --xt-code-bg: #121218;
  --xt-code-border: rgba(161, 161, 170, 0.22);
  --xt-code-text: #d4d4d8;
  --xt-code-header-bg: rgba(0, 0, 0, 0.4);
  --xt-hl-keyword: #9bb8d9;
  --xt-hl-string: #8fbcbb;
  --xt-hl-number: #d08770;
  --xt-hl-comment: #8a8a96;
  --xt-hl-function: #c4b8a8;
  --xt-hl-builtin: #a8c4e8;
  --xt-hl-operator: #a1a1aa;
  --xt-hl-decorator: #c4b8a8;
  --xt-hl-constant: #d08770;
}

/* 霁光浅色主题：代码块浅色底，与页面风格一致 */
html.theme-palette-jiguang body.cyber-theme {
  --xt-doc-inline-code-bg: rgba(3, 105, 161, 0.08);
  --xt-doc-inline-code-border: rgba(3, 105, 161, 0.22);
  --xt-doc-inline-code-text: #0369a1;
  --xt-doc-link: #0369a1;
  --xt-doc-h2: #5b6fd6;
  --xt-doc-toc-text: #64748b;
  --xt-doc-toc-hover: #5b6fd6;
}

html.theme-palette-jiguang .xt-code-block {
  --xt-code-bg: #f4f6fa;
  --xt-code-border: rgba(91, 111, 214, 0.2);
  --xt-code-text: #1e293b;
  --xt-code-header-bg: rgba(91, 111, 214, 0.07);
  --xt-code-lang-text: #5b6fd6;
  --xt-code-lang-bg: rgba(91, 111, 214, 0.1);
  --xt-code-copy-border: rgba(30, 41, 59, 0.12);
  --xt-code-copy-bg: rgba(255, 255, 255, 0.85);
  --xt-code-copy-text: #475569;
  --xt-hl-keyword: #0550ae;
  --xt-hl-string: #0a7c42;
  --xt-hl-number: #116329;
  --xt-hl-comment: #6e7781;
  --xt-hl-function: #5b6fd6;
  --xt-hl-builtin: #953800;
  --xt-hl-params: #1e293b;
  --xt-hl-operator: #57606a;
  --xt-hl-decorator: #cf222e;
  --xt-hl-constant: #0550ae;
}

/* 霁光：Markdown 文档正文（覆盖 body.cyber-theme 白字） */
html.theme-palette-jiguang body.cyber-theme .jcdata-api-doc-body,
html.theme-palette-jiguang body.cyber-theme .user-guide-body {
  color: #334155 !important;
}

html.theme-palette-jiguang body.cyber-theme .jcdata-api-doc-body h1,
html.theme-palette-jiguang body.cyber-theme .user-guide-body h1,
html.theme-palette-jiguang body.cyber-theme .jcdata-api-doc-body h3,
html.theme-palette-jiguang body.cyber-theme .user-guide-body h3,
html.theme-palette-jiguang body.cyber-theme .jcdata-api-doc-body strong,
html.theme-palette-jiguang body.cyber-theme .user-guide-body strong {
  color: #0f172a !important;
}

html.theme-palette-jiguang body.cyber-theme .jcdata-api-doc-body h2,
html.theme-palette-jiguang body.cyber-theme .user-guide-body h2 {
  color: #5b6fd6 !important;
}

html.theme-palette-jiguang body.cyber-theme .jcdata-api-doc-body h4,
html.theme-palette-jiguang body.cyber-theme .user-guide-body h4 {
  color: #475569 !important;
}

html.theme-palette-jiguang body.cyber-theme .jcdata-api-doc-body th,
html.theme-palette-jiguang body.cyber-theme .user-guide-body th {
  background: #f1f0ec !important;
  color: #334155 !important;
}

html.theme-palette-jiguang body.cyber-theme .jcdata-api-doc-body td,
html.theme-palette-jiguang body.cyber-theme .user-guide-body td {
  color: #475569 !important;
}

html.theme-palette-jiguang body.cyber-theme .jcdata-api-doc-body th,
html.theme-palette-jiguang body.cyber-theme .jcdata-api-doc-body td,
html.theme-palette-jiguang body.cyber-theme .user-guide-body th,
html.theme-palette-jiguang body.cyber-theme .user-guide-body td {
  border-color: rgba(30, 41, 59, 0.12) !important;
}

html.theme-palette-jiguang body.cyber-theme .jcdata-api-doc-body hr,
html.theme-palette-jiguang body.cyber-theme .user-guide-body hr {
  border-top-color: rgba(30, 41, 59, 0.1) !important;
}

html.theme-palette-jiguang body.cyber-theme .xt-doc-toc__item a:hover,
html.theme-palette-jiguang body.cyber-theme .xt-doc-toc__item a.is-active {
  color: #5b6fd6 !important;
  background: rgba(91, 111, 214, 0.08) !important;
  border-left-color: #5b6fd6 !important;
}

html.theme-palette-jiguang body.cyber-theme .xt-doc-toc-panel__toggle {
  border-color: rgba(30, 41, 59, 0.12) !important;
  color: #475569 !important;
}

/* 霁光：侧栏目录与加载态 */
html.theme-palette-jiguang body.cyber-theme .xt-doc-toc__item a {
  color: #64748b !important;
}

html.theme-palette-jiguang body.cyber-theme .jcdata-api-doc-loading,
html.theme-palette-jiguang body.page-faq.cyber-theme .jcdata-api-doc-loading {
  color: #64748b !important;
}

html.theme-palette-jiguang body.cyber-theme .xt-doc-toc-panel {
  border-top-color: rgba(30, 41, 59, 0.1) !important;
}

html.theme-palette-jiguang body.cyber-theme .jcdata-api-doc-body h1,
html.theme-palette-jiguang body.cyber-theme .user-guide-body h1 {
  border-bottom-color: rgba(30, 41, 59, 0.1) !important;
}

html.theme-palette-jiguang body.cyber-theme .jcdata-api-doc-body p,
html.theme-palette-jiguang body.cyber-theme .jcdata-api-doc-body li,
html.theme-palette-jiguang body.cyber-theme .user-guide-body p,
html.theme-palette-jiguang body.cyber-theme .user-guide-body li {
  color: #334155 !important;
}

/* 玄墨：文档正文与目录对比度 */
html.theme-palette-xuanmo body.cyber-theme .jcdata-api-doc-body,
html.theme-palette-xuanmo body.cyber-theme .user-guide-body {
  color: #d4d4d8 !important;
}

html.theme-palette-xuanmo body.cyber-theme .jcdata-api-doc-body h1,
html.theme-palette-xuanmo body.cyber-theme .user-guide-body h1,
html.theme-palette-xuanmo body.cyber-theme .jcdata-api-doc-body h3,
html.theme-palette-xuanmo body.cyber-theme .user-guide-body h3,
html.theme-palette-xuanmo body.cyber-theme .jcdata-api-doc-body strong,
html.theme-palette-xuanmo body.cyber-theme .user-guide-body strong {
  color: #f4f4f5 !important;
}

html.theme-palette-xuanmo body.cyber-theme .jcdata-api-doc-body h2,
html.theme-palette-xuanmo body.cyber-theme .user-guide-body h2 {
  color: #c4b8a8 !important;
}

html.theme-palette-xuanmo body.cyber-theme .jcdata-api-doc-body h4,
html.theme-palette-xuanmo body.cyber-theme .user-guide-body h4 {
  color: #e4e4e7 !important;
}

html.theme-palette-xuanmo body.cyber-theme .jcdata-api-doc-body p,
html.theme-palette-xuanmo body.cyber-theme .jcdata-api-doc-body li,
html.theme-palette-xuanmo body.cyber-theme .user-guide-body p,
html.theme-palette-xuanmo body.cyber-theme .user-guide-body li {
  color: #d4d4d8 !important;
}

html.theme-palette-xuanmo body.cyber-theme .jcdata-api-doc-body th,
html.theme-palette-xuanmo body.cyber-theme .user-guide-body th {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f4f4f5 !important;
}

html.theme-palette-xuanmo body.cyber-theme .jcdata-api-doc-body td,
html.theme-palette-xuanmo body.cyber-theme .user-guide-body td {
  color: #c4c4cc !important;
}

html.theme-palette-xuanmo body.cyber-theme .jcdata-api-doc-body th,
html.theme-palette-xuanmo body.cyber-theme .jcdata-api-doc-body td,
html.theme-palette-xuanmo body.cyber-theme .user-guide-body th,
html.theme-palette-xuanmo body.cyber-theme .user-guide-body td {
  border-color: rgba(161, 161, 170, 0.22) !important;
}

html.theme-palette-xuanmo body.cyber-theme .jcdata-api-doc-body hr,
html.theme-palette-xuanmo body.cyber-theme .user-guide-body hr {
  border-top-color: rgba(161, 161, 170, 0.2) !important;
}

html.theme-palette-xuanmo body.cyber-theme .jcdata-api-doc-body h1,
html.theme-palette-xuanmo body.cyber-theme .user-guide-body h1 {
  border-bottom-color: rgba(161, 161, 170, 0.22) !important;
}

html.theme-palette-xuanmo body.cyber-theme .xt-doc-toc__item a {
  color: #a1a1aa !important;
}

html.theme-palette-xuanmo body.cyber-theme .xt-doc-toc__item a:hover,
html.theme-palette-xuanmo body.cyber-theme .xt-doc-toc__item a.is-active {
  color: #f4f4f5 !important;
  background: rgba(196, 184, 168, 0.1) !important;
  border-left-color: #c4b8a8 !important;
}

html.theme-palette-xuanmo body.cyber-theme .xt-doc-toc-panel__toggle {
  color: #d4d4d8 !important;
  border-color: rgba(161, 161, 170, 0.28) !important;
}

html.theme-palette-xuanmo body.cyber-theme .jcdata-api-doc-loading {
  color: #a1a1aa !important;
}

html.theme-palette-xuanmo .xt-api-doc-header__title {
  color: #f4f4f5;
}

html.theme-palette-xuanmo .xt-api-doc-header__title i {
  color: #c4b8a8;
}

html.theme-palette-xuanmo .xt-api-doc-header__sub {
  color: #a1a1aa;
}

html.theme-palette-jiguang .xt-code-block__copy:hover {
  background: #ffffff;
  border-color: rgba(91, 111, 214, 0.28);
  color: #5b6fd6;
}

html.theme-palette-jiguang .xt-code-block__copy.is-copied {
  color: #047857;
  border-color: rgba(5, 150, 105, 0.35);
  background: rgba(16, 185, 129, 0.1);
}

@media (max-width: 767px) {
  .xt-code-block__header {
    padding: 0.12rem 0.4rem;
  }

  .xt-code-block pre {
    padding: 0.65rem 0.75rem;
  }

  .xt-doc-toc-panel__body {
    max-height: 220px;
  }
}

/* 数据服务：滚动条隐藏 + 侧栏目录样式（布局见 site-theme.css 末尾） */
body.page-data-service {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.page-data-service::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* 数据服务页：隐藏全部滚动条，保留滚轮/触控滚动 */
html:has(body.page-data-service) {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html:has(body.page-data-service)::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body.page-data-service,
body.page-data-service * {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.page-data-service *::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body.page-data-service .ds-sidebar-nav {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: none;
  overflow: hidden;
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--line);
  box-shadow: none;
}

body.page-data-service .ds-sidebar-nav > .jcdata-api-doc-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.5rem 0.65rem 0.3rem;
  margin: 0;
  font-size: 0.82rem;
  justify-content: flex-start;
}

body.page-data-service .ds-sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

body.page-data-service .ds-sidebar-scroll .sidebar-items {
  padding-top: 0.15rem;
}

body.page-data-service .ds-nav-group {
  margin: 0;
}

body.page-data-service .ds-nav-group__head {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

body.page-data-service .ds-nav-group__toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  margin-left: 0.2rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
}

body.page-data-service .ds-nav-group__toggle:hover {
  color: var(--primary);
  background: rgba(26, 95, 74, 0.06);
}

body.page-data-service .ds-nav-group__toggle .fa-chevron-down {
  font-size: 0.6rem;
  transition: transform 0.2s ease;
}

body.page-data-service .ds-nav-group:not(.is-open) .ds-nav-group__toggle .fa-chevron-down {
  transform: rotate(-90deg);
}

body.page-data-service .ds-nav-group__toggle-spacer {
  flex-shrink: 0;
  width: 1.5rem;
  margin-left: 0.2rem;
}

body.page-data-service .ds-nav-group__head > .sidebar-link {
  flex: 1;
  min-width: 0;
  padding: 0.48rem 0.65rem 0.48rem 0.35rem;
  font-size: 0.9rem;
}

body.page-data-service .ds-nav-group__body .sidebar-sublink {
  font-size: 0.8rem;
  line-height: 1.42;
  padding: 0.3rem 0.7rem 0.3rem 1.65rem;
  white-space: normal;
  word-break: break-word;
}

body.cyber-theme.page-data-service .ds-sidebar-nav {
  background: rgba(18, 26, 40, 0.96);
  border-right-color: rgba(148, 163, 184, 0.22);
  backdrop-filter: blur(12px);
}

html.theme-palette-jiguang body.page-data-service .ds-sidebar-nav {
  background: #ffffff !important;
  border-right-color: rgba(30, 41, 59, 0.1) !important;
}

html.theme-palette-xuanmo body.page-data-service .ds-sidebar-nav {
  background: rgba(12, 12, 16, 0.97) !important;
  border-right-color: rgba(113, 113, 122, 0.35) !important;
}

body.page-faq.cyber-theme.page-data-service .ds-nav-group__toggle:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

html.theme-palette-jiguang body.page-data-service .ds-nav-group__toggle {
  color: #64748b !important;
}

html.theme-palette-jiguang body.page-data-service .ds-nav-group__toggle:hover {
  color: #5b6fd6 !important;
  background: rgba(91, 111, 214, 0.08) !important;
}

html.theme-palette-jiguang body.page-data-service .ds-sidebar-scroll .sidebar-link,
html.theme-palette-jiguang body.page-data-service .ds-sidebar-scroll .sidebar-sublink {
  color: #64748b !important;
}

html.theme-palette-jiguang body.page-data-service .ds-sidebar-scroll .sidebar-link:hover,
html.theme-palette-jiguang body.page-data-service .ds-sidebar-scroll .sidebar-link.active,
html.theme-palette-jiguang body.page-data-service .ds-sidebar-scroll .sidebar-sublink:hover,
html.theme-palette-jiguang body.page-data-service .ds-sidebar-scroll .sidebar-sublink.active {
  color: #5b6fd6 !important;
}

html.theme-palette-xuanmo body.page-data-service .ds-nav-group__toggle:hover {
  color: #d4d4d8 !important;
  background: rgba(168, 162, 158, 0.1) !important;
}

@media (max-width: 768px) {
  body.page-data-service .ds-sidebar-nav {
    border-radius: 6px;
    border: 1px solid var(--line) !important;
  }

  body.page-data-service .ds-sidebar-scroll {
    max-height: min(52vh, 360px);
  }
}

/* ========== 数据服务：多章节流式加载 ========== */
/* 表格按内容宽度收缩，不拉满正文区；过宽时仍可横向滚动 */
body.page-data-service .jcdata-api-doc-body .xt-table-wrap {
  width: fit-content;
  max-width: 100%;
}

body.page-data-service .jcdata-api-doc-body table {
  width: auto;
  min-width: 0;
}

body.page-data-service .doc-content-area {
  padding: 1.25rem clamp(1rem, 3vw, 2.25rem) 3rem;
}

body.page-data-service .ds-page-boot {
  min-height: 4rem;
}

body.page-data-service .ds-doc-hero {
  margin: 0 0 1.75rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line, rgba(148, 163, 184, 0.22));
}

body.page-data-service .ds-doc-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}

body.page-data-service .ds-doc-hero p {
  margin: 0;
  max-width: 46rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

body.page-data-service .ds-doc-hero code {
  font-size: 0.88em;
}

body.page-data-service .ds-doc-section {
  margin: 0 0 2.5rem;
  scroll-margin-top: 5.5rem;
  opacity: 1;
  transition: opacity 0.25s ease;
}

body.page-data-service .ds-doc-section.is-loading .ds-doc-section__body:empty {
  display: none;
}

body.page-data-service .ds-doc-section.is-streaming .ds-doc-section__body {
  opacity: 0.92;
}

body.page-data-service .ds-doc-section.is-ready {
  animation: ds-section-in 0.35s ease both;
}

@keyframes ds-section-in {
  from {
    opacity: 0.55;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

body.page-data-service .ds-doc-section__head {
  margin-bottom: 0.85rem;
}

body.page-data-service .ds-doc-section__title {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 700;
  scroll-margin-top: 5.5rem;
}

body.page-data-service .ds-doc-section__loading {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

body.page-data-service .ds-doc-section__loading.hidden {
  display: none !important;
}

body.page-data-service .ds-doc-section__error {
  margin: 0.5rem 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.18);
  border: 1px solid rgba(248, 113, 113, 0.28);
  font-size: 0.9rem;
}

body.page-data-service .ds-doc-section__body > h2:first-child {
  margin-top: 0.35rem;
}

body.page-data-service .ds-nav-pending {
  display: inline-block;
  padding: 0.25rem 0.85rem 0.35rem 1.85rem;
  color: var(--muted);
  font-size: 0.78rem;
}

body.page-data-service .ds-nav-pending.is-error {
  color: #f87171;
}

html.theme-palette-jiguang body.page-data-service .ds-doc-hero h1,
html.theme-palette-jiguang body.page-data-service .ds-doc-section__title {
  color: #0f172a;
}

html.theme-palette-jiguang body.page-data-service .ds-doc-section__error {
  color: #b91c1c;
  background: rgba(254, 226, 226, 0.7);
  border-color: rgba(248, 113, 113, 0.35);
}
