/* ==========================================================================
 * docs-build PyData 路线品牌层（基础版）
 *
 * 与 immaterial 版 brand.css 的关系：那一份锚定 Material 的 --md-* 变量与
 * .md-* 类名；本文件只移植与主题无关的资产——设计 token、字体栈、Primer
 * 代码高亮、自定义页脚/弹窗样式——并映射到 PyData 的 --pst-* 变量体系。
 * 深度品牌打磨（表格/提示块/暗色全套换算）列为后续。
 * ========================================================================== */

/* ---------- 整页跳转不再白屏闪 ----------
 * 静态多页站点每次点左侧树都是一次完整文档加载，浏览器在旧文档卸载、
 * 新文档首帧之前会先刷白（本地实测首帧约 400ms），观感就是"很闪"。
 * 旧站没有这个问题是因为 Material 的 instant 导航走 SPA（只换正文 DOM）。
 *
 * 这里用跨文档 view transition（Chrome 126+）拿到同等效果：开启后浏览器
 * 会保留旧页快照直到新页就绪，再交叉淡出，期间不出现白帧。
 * 页头与左侧树用 view-transition-name 单独命名，于是它们在两页之间做
 * "形变"而不是跟着整屏一起淡——左侧树只会平滑更新选中态，正文区才淡出。
 *
 * 不支持的浏览器（Firefox/Safari 旧版）会忽略这两条规则，退回普通跳转，
 * 没有任何副作用。 */
@view-transition {
  navigation: auto;
}

#pst-header {
  view-transition-name: hi-header;
}

#pst-primary-sidebar {
  view-transition-name: hi-sidebar;
}

/* 尊重系统的"减少动态效果"：把过渡时长压到 0（对 ::view-transition-*
 * 伪元素设时长是跨文档过渡的标准做法；@view-transition 本身是顶层规则，
 * 不能再套进 @media 里）。 */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation-duration: 0.001s !important;
  }
}

/* ---------- 设计 token（原样保留） ---------- */
:root {
  --hi-red: #C7000B;
  --hi-red-hover: #A00009;
  --hi-red-light: rgba(199, 0, 11, 0.08);
  --hi-black: #1a1a1a;
  --hi-dark: #333333;
  --hi-gray: #666666;
  --hi-gray-light: #999999;
  --hi-border: rgba(223,223,223,1);
  --tree-border: #dfdfdf;
  --hi-bg: #f7f8fa;
  --hi-white: #ffffff;
  --hi-font: "HarmonyOS Sans SC 2025", "HarmonyOS Sans SC",
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --hi-font-hei: "HarmonyHeiTi";
  --sidebar-current-width: var(--sidebar-drag-width, 16.625rem);
  --hi-code-radius: 8px !important;
}

/* ---------- 字体映射（PyData 变量） ---------- */
html {
  --pst-font-family-base: var(--hi-font);
  --pst-font-family-heading: var(--hi-font);
  --pst-font-family-monospace: "Consolas", "Roboto Mono", "Monaco",
    "Courier New", monospace;
}

/* ---------- 品牌色映射 ---------- */
html {
  /* 交互主色 = 海思红（按钮/图标/选中态基调） */
  --pst-color-primary: var(--hi-red);
  --pst-color-primary-hover: var(--hi-red-hover);
  /* 正文链接沿用现网深灰（原 --md-accent-fg-color: #1a1a1a 的语义） */
  --pst-color-link: var(--hi-black);
  --pst-color-link-hover: var(--hi-red);
}

html[data-theme="light"] .highlight .c, html[data-theme="light"] .highlight .cm,
html[data-theme="light"] .highlight .c1, html[data-theme="light"] .highlight .cs {
  color: #316614;
}
html[data-theme="light"] .highlight .s, html[data-theme="light"] .highlight .s1,
html[data-theme="light"] .highlight .s2, html[data-theme="light"] .highlight .sa,
html[data-theme="light"] .highlight .sb, html[data-theme="light"] .highlight .sc,
html[data-theme="light"] .highlight .sd, html[data-theme="light"] .highlight .se,
html[data-theme="light"] .highlight .sh, html[data-theme="light"] .highlight .si,
html[data-theme="light"] .highlight .cpf,
html[data-theme="light"] .highlight .sr, html[data-theme="light"] .highlight .ss,
html[data-theme="light"] .highlight .sx {
  color: #127180;
}
html[data-theme="light"] .highlight .k, html[data-theme="light"] .highlight .kc,
html[data-theme="light"] .highlight .kd, html[data-theme="light"] .highlight .kn,
html[data-theme="light"] .highlight .kp, html[data-theme="light"] .highlight .kr,
html[data-theme="light"] .highlight .kt, html[data-theme="light"] .highlight .cp {
  color: #E61866;
}
html[data-theme="light"] .highlight .nf, html[data-theme="light"] .highlight .fm {
  color: #8A21BC;
}
html[data-theme="light"] .highlight .nb, html[data-theme="light"] .highlight .nc {
  color: #2070F3;
}
html[data-theme="light"] .highlight .m, html[data-theme="light"] .highlight .mf,
html[data-theme="light"] .highlight .mh, html[data-theme="light"] .highlight .mi,
html[data-theme="light"] .highlight .mo, html[data-theme="light"] .highlight .il {
  color: #0550ae;
}
html[data-theme="light"] .highlight .o, html[data-theme="light"] .highlight .ow {
  color: #651B8B;
}
html[data-theme="light"] .highlight .nv, html[data-theme="light"] .highlight .vc,
html[data-theme="light"] .highlight .vg, html[data-theme="light"] .highlight .vi {
  color: #C76207;
}
html[data-theme="light"] .highlight .p {
  color: #393939;
}
html[data-theme="light"] .highlight .n, html[data-theme="light"] .highlight .na,
html[data-theme="light"] .highlight .bp, html[data-theme="light"] .highlight .ne,
html[data-theme="light"] .highlight .no, html[data-theme="light"] .highlight .nd,
html[data-theme="light"] .highlight .ni, html[data-theme="light"] .highlight .nl,
html[data-theme="light"] .highlight .nn, html[data-theme="light"] .highlight .nx,
html[data-theme="light"] .highlight .py, html[data-theme="light"] .highlight .nt,
html[data-theme="light"] .highlight .w {
  /* 不额外着色（≈ 代码块正文色 --hi-text #191919），与旧站 #1f2328 一致 */
  color: #1f2328;
}

/* ---------- 代码块：语法高亮（暗色，PyData 原生 dark 切换） ----------
 * 第一段列出的暗色值：关键字/注释/字符串/函数/内置名/操作符/标点/配置键/数字/通用标识。
 * 注意：旧站暗色段没有"标点/操作符/配置键"这三组，亮色的 #393939/#651B8B/#C76207
 * 落在暗底上几乎看不清——本段按新色板补齐（本次修改的主要目的之一）。 */
html[data-theme="dark"] .highlight .c, html[data-theme="dark"] .highlight .cm,
html[data-theme="dark"] .highlight .c1, html[data-theme="dark"] .highlight .cs {
  color: #61B42E;
}
html[data-theme="dark"] .highlight .k, html[data-theme="dark"] .highlight .kc,
html[data-theme="dark"] .highlight .kd, html[data-theme="dark"] .highlight .kn,
html[data-theme="dark"] .highlight .kp, html[data-theme="dark"] .highlight .kr,
html[data-theme="dark"] .highlight .kt, html[data-theme="dark"] .highlight .cp {
  color: #F470AB;
}
html[data-theme="dark"] .highlight .s, html[data-theme="dark"] .highlight .s1,
html[data-theme="dark"] .highlight .s2, html[data-theme="dark"] .highlight .sa,
html[data-theme="dark"] .highlight .sb, html[data-theme="dark"] .highlight .sc,
html[data-theme="dark"] .highlight .sd, html[data-theme="dark"] .highlight .se,
html[data-theme="dark"] .highlight .sh, html[data-theme="dark"] .highlight .si,
html[data-theme="dark"] .highlight .cpf,
html[data-theme="dark"] .highlight .sr, html[data-theme="dark"] .highlight .ss,
html[data-theme="dark"] .highlight .sx {
  color: #2CB9C9;
}
html[data-theme="dark"] .highlight .nf, html[data-theme="dark"] .highlight .fm {
  color: #CB8EFB;
}
html[data-theme="dark"] .highlight .nb, html[data-theme="dark"] .highlight .nc {
  color: #8CA3FA;
}
html[data-theme="dark"] .highlight .m, html[data-theme="dark"] .highlight .mf,
html[data-theme="dark"] .highlight .mh, html[data-theme="dark"] .highlight .mi,
html[data-theme="dark"] .highlight .mo, html[data-theme="dark"] .highlight .il {
  color: #F9B766;
}
html[data-theme="dark"] .highlight .o, html[data-theme="dark"] .highlight .ow {
  color: #BF68FA;
}
html[data-theme="dark"] .highlight .nv, html[data-theme="dark"] .highlight .vc,
html[data-theme="dark"] .highlight .vg, html[data-theme="dark"] .highlight .vi {
  color: #F9B766;
}
html[data-theme="dark"] .highlight .p {
  color: #C9C9C9;
}
html[data-theme="dark"] .highlight .n, html[data-theme="dark"] .highlight .na,
html[data-theme="dark"] .highlight .bp, html[data-theme="dark"] .highlight .ne,
html[data-theme="dark"] .highlight .no, html[data-theme="dark"] .highlight .nd,
html[data-theme="dark"] .highlight .ni, html[data-theme="dark"] .highlight .nl,
html[data-theme="dark"] .highlight .nn, html[data-theme="dark"] .highlight .nx,
html[data-theme="dark"] .highlight .py, html[data-theme="dark"] .highlight .nt,
html[data-theme="dark"] .highlight .w {
  color: #c9c9c9;
}

/* ---------- 表格基础（对齐现网关键行为：14px/长词换行） ---------- */
.table.docutils, table.docutils {
  font-size: 14px;
}
table.docutils td, table.docutils th {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ---------- 海思页脚（移植自 extra.css，自定义类与主题无关） ---------- */
.bd-footer {
  padding: 0;
}

/* Spread the footer across the full page: drop the theme's 88rem page-width
 * cap and 1rem inner padding, then let footer-items__start own the row so
 * the Hisilicon footer-box spans bd-footer edge to edge. */
.bd-footer .bd-footer__inner.bd-page-width {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.bd-footer .footer-items__start {
  width: 100%;
  flex: 1 1 100%;
}

/* 正文右上角「查看源码」：view_source: true 且当前页有真实源文件时才渲染
 * （templates/view-source.html，URL 由 docs_ext.page_info 按页计算，
 *  槽位为 html_theme_options.article_header_end）
 *
 * PyData 0.21 的 _header-article.scss 只给 __end 写了 margin-left:auto，
 * 却没给 .header-article-items 设 display:flex——块级元素上 auto margin 为 0，
 * 结果 article_header_end 会贴左。这里补上 flex 容器，才真正右对齐
 * （同时让 article_header_start 的 breadcrumbs 保持左侧）。 */
.header-article-items {
  display: flex;
  align-items: baseline;
}

.footer-box {
  background: rgba(243, 243, 243, 1);
  width: 100%;
}

.footer-list {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* 对位旧站：列宽固定 --main-warp（1400px）居中，不是通栏。
   * 旧站 1600 视口实测 w=1400 / x=93，no-wrap、无 gap。 */
  max-width: 100%;
  width: var(--main-warp, 1400px);
  padding: 30px 0;
  background: rgba(243, 243, 243, 1);
  margin: 0 auto;
}

.footer-list-child {
  text-align: left;
  color: rgba(25, 25, 25, 1);
}

.footer-list-child:last-child {
  margin-right: 0;
}

.footer-nav-first {
  font-size: 16px;
  font-family: var(--hi-font);
  color: rgba(25, 25, 25, 1) !important;
  font-weight: 600;
  line-height: 24px;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.footer-nav-first:hover {
  text-decoration: none;
}

.footer-ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-fix {
  font-size: 12px;
  width: 100%;
  height: 40px;
  line-height: 40px;
  border-top: 1px solid var(--hi-border);
  box-sizing: border-box;
  background: rgba(243, 243, 243, 1);
  color: rgba(89, 89, 89, 1);
}

.footer-fix-content {
  max-width: 100%;
  width: var(--main-warp, 1400px);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-fix-content > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-copyright {
  color: rgba(89, 89, 89, 1);
}

.footer-fix > div:first-child {
  color: rgba(89, 89, 89, 1);
}

.footer-fix > div:first-child span {
  white-space: nowrap;
}

/* 注意选择器：.footer-fix 的直属首个子 div 就是 .footer-fix-content，
 * 因此这条同时命中备案链接与右侧 .footer-name 免责链接——旧站也是如此，
 * .footer-name 的左右外边距实际由这里决定（桌面 8px、≤1220px 4px）。 */
.footer-fix > div:first-child a {
  color: rgba(89, 89, 89, 1);
  text-decoration: none;
  transition: color 0.2s;
  margin: 0 8px;
}

.footer-fix > div:first-child a:hover {
  text-decoration: underline;
}

.footer-name {
  color: rgba(25, 25, 25, 1);
  text-decoration: none;
  margin-right: calc(48 * var(--flex-pc-px));
  transition: color 0.2s;
  white-space: nowrap;
}

.footer-name:first-child {
  margin-left: 0;
}

.footer-name:hover {
  text-decoration: underline;
}

html[data-theme="dark"] .bd-footer,
html[data-theme="dark"] .bd-footer__inner {
  background: var(--hi-surface);
}

html[data-theme="dark"] .footer-box,
html[data-theme="dark"] .footer-list,
html[data-theme="dark"] .footer-fix {
  background: #191919;
}

html[data-theme="dark"] .footer-fix,
html[data-theme="dark"] .footer-fix > div:first-child,
html[data-theme="dark"] .footer-fix > div:first-child a {
  color: #C9C9C9;
}

/* 旧站 slate：页脚链接列的文字与列标题是**白色**（不是灰色） */
html[data-theme="dark"] .footer-list-child,
html[data-theme="dark"] .footer-nav-first {
  color: #ffffff !important;
}

/* 旧站的暗色页脚由本文件上方的 #191919 / #C9C9C9 规则承担；
 * 此处原先用 --pst-color-on-background 作底色，该 token 在暗色下等于
 * --hi-text（白色），会把页脚刷成白底，与线上站不符，故移除。 */
html[data-theme="dark"] .footer-name,
html[data-theme="dark"] .footer-copyright {
  /* 旧站 slate：版权行文字 #C9C9C9 */
  color: #C9C9C9;
}

/* 旧站 slate 免责声明弹窗：底 --hi-white(#000)、标题 --hi-black(#fff)、正文 --hi-gray(#C9C9C9) */
html[data-theme="dark"] .disclaimer-dialog {
  background: var(--hi-white);
}

html[data-theme="dark"] .disclaimer-dialog__title {
  color: var(--hi-black);
}

html[data-theme="dark"] .disclaimer-dialog__body p {
  color: var(--hi-gray);
}

/* ---------- 免责声明弹窗（原样移植） ---------- */
.disclaimer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.disclaimer-dialog {
  background: #ffffff;
  border-radius: 4px;
  width: min(33%, 640px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 16px;
}

.disclaimer-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.disclaimer-dialog__title {
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
  color: #303133;
}

.disclaimer-dialog__close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999999;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
  line-height: 24px;
}

.disclaimer-dialog__close:hover {
  color: #c7000b;
}

.disclaimer-dialog__body {
  padding: 16px 0px 30px 0px;
  max-height: 60vh;
  overflow-y: auto;
}

.disclaimer-dialog__text-center {
  text-align: center;
  color: #606266;
  margin-bottom: 16px;
  font-family: var(--hi-font);
  font-size: 18px;
}

.disclaimer-dialog__body p {
  font-size: 16px;
  line-height: 1.8;
  color: #606266;
  text-align: left;
  margin: 0px !important;
}

.disclaimer-dialog__footer {
  text-align: right;
}

.disclaimer-dialog__btn {
  background: var(--hi-red);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 6px 20px;
  cursor: pointer;
}

.disclaimer-dialog__btn:hover {
  background: var(--hi-red-hover);
}

/* ==========================================================================\n * PyData component skin\n *\n * The selectors below target the DOM emitted by pydata-sphinx-theme.  They\n * intentionally do not use Material's .md-* classes, so the skin remains\n * usable after a PyData theme upgrade.\n * ========================================================================== */

:root {
  --hi-surface: #ffffff;
  --hi-surface-raised: #ffffff;
  --hi-surface-muted: #f7f8fa;
  --hi-code-bg: #f3f3f3;
  --hi-text: #191919;
  --hi-text-muted: #595959;
  --hi-text-subtle: #777777;
  --hi-border-strong: #d9d9d9;
  --hi-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  --hi-shadow-raised: 0 4px 16px rgba(0, 0, 0, 0.10);
  --hi-radius: 6px;
  --hi-code-radius: 16px;
  --hi-content-max: 1400px;
}

/* 主题用 html[data-theme=light] / html:not([data-theme]) 定义主色（PyData 青
 * #0a7d91），特异性高于 :root，会把下方映射压掉——表现为左右侧栏激活条目的
 * 左侧指示条（inset box-shadow 取 --pst-color-primary）变青蓝色。这里用同等
 * 特异性 + 更晚加载（html_js/css 顺序）把主色钉回海思红（暗色块同理）。 */
html,
html:not([data-theme]),
html[data-theme="light"] {
  --pst-color-background: var(--hi-surface);
  --pst-color-surface: var(--hi-surface-muted);
  --pst-color-border: var(--hi-border);
  --pst-color-text-base: var(--hi-text);
  --pst-color-text-muted: var(--hi-text-muted);
  --pst-color-primary: var(--hi-red);
  --pst-color-primary-bg: var(--hi-red-light);
  --pst-color-link: var(--hi-red);
  --pst-color-link-hover: var(--hi-red-hover);
  --pst-font-size-base: 16px;
  --pst-line-height-base: 1.5;
}

html[data-theme="dark"] {
  --hi-surface: #000000;
  --hi-surface-raised: #151515;
  --hi-surface-muted: #1a1a1a;
  --hi-code-bg: rgba(243, 243, 243, 0.1);
  --hi-text: #ffffff;
  --hi-text-muted: #b6b6b6;
  --hi-text-subtle: #8d8d8d;
  --hi-border: rgba(243, 243, 243, 0.15);
  --tree-border: #777777;
  /* 旧站 slate 段的 token 重定义（extra.css [data-md-color-scheme="slate"]）：
   * --hi-white/--hi-bg/--hi-black/--hi-gray 在暗色下整体反转，卡片/条纹/
   * 悬浮条等用这些 token 的规则会自动跟着变，不需要逐条写暗色覆盖。 */
  --hi-black: #ffffff;
  --hi-dark: #C9C9C9;
  --hi-gray: #C9C9C9;
  --hi-gray-light: #939393;
  --hi-bg: rgba(243, 243, 243, 0.05);
  --hi-white: #000000;
  --hi-border-strong: rgba(243, 243, 243, 0.28);
  --hi-red: #ee696f;
  --hi-red-hover: #E7434A;
  --hi-red-light: rgba(238, 105, 111, 0.16);
  --hi-shadow: 0 1px 6px rgba(0, 0, 0, 0.40);
  --hi-shadow-raised: 0 4px 18px rgba(0, 0, 0, 0.60);
  --pst-color-background: var(--hi-surface);
  --pst-color-surface: var(--hi-surface-muted);
  --pst-color-border: var(--hi-border);
  --pst-color-text-base: var(--hi-text);
  --pst-color-text-muted: var(--hi-text-muted);
  --pst-color-primary: var(--hi-red);
  --pst-color-primary-bg: var(--hi-red-light);
  --pst-color-link: var(--hi-red);
  --pst-color-link-hover: var(--hi-red-hover);
}

html,
body {
  background: var(--hi-surface);
  color: var(--hi-text);
}

body {
  font-family: var(--hi-font);
  font-size: 16px;
  line-height: 24px;
}

/* Header and top navigation */
/* 两侧栏的 sticky 偏移与最大高度都取自 --pst-header-height（主题默认 4rem），
 * 与本站 50px 头部不一致会导致分隔线顶部空开一段；对齐到实际头部高度。 */
html {
  --pst-header-height: 50px;
}

#pst-header.bd-header {
  min-height: 50px;
  height: 50px;
  padding: 0;
  background: var(--hi-surface) !important;
  border-bottom: 1px solid var(--hi-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#pst-header .bd-header__inner {
  min-height: 50px;
  height: 50px;
  max-width: var(--hi-content-max);
}

#pst-header .navbar-brand {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  margin-right: 24px;
}

#pst-header .logo__image {
  width: 133px;
  max-height: 34px;
  object-fit: contain;
}

#pst-header .navbar-header-items__center {
  min-width: 0;
}

#pst-header .bd-navbar-elements {
  align-items: stretch;
  height: 50px;
  gap: 2px;
}

#pst-header .bd-navbar-elements > .nav-item > .nav-link {
  display: inline-flex;
  align-items: center;
  height: 50px;
  padding: 0 14px;
  color: var(--hi-text-muted);
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

#pst-header .bd-navbar-elements > .nav-item > .nav-link:hover,
#pst-header .bd-navbar-elements > .nav-item.current > .nav-link,
#pst-header .bd-navbar-elements > .nav-item.active > .nav-link {
  color: var(--hi-red);
  background: var(--hi-red-light);
  border-bottom-color: var(--hi-red);
}

#pst-header .navbar-header-items__end,
#pst-header .navbar-persistent--mobile {
  align-items: center;
  /* 旧站头部控件间距 16px（各控件 margin-right:16px / source-container gap:16px） */
  gap: 16px;
}

#pst-header .navbar-header-items__end .navbar-item,
#pst-header .navbar-persistent--mobile .navbar-item {
  margin: 0;
}

/* 页头操作区顺序：**返回旧版排第一**，搜索按钮紧随其后
 * （对位旧站头部：返回旧版 → 搜索 → 主题 → GitCode）。
 * PyData 把搜索按钮所在的 .navbar-persistent--container 硬编码成
 * __end 的第一个子项，navbar_end 里配的顺序只能排在它后面，
 * 所以只能靠 order 把它拨到"返回旧版"之后——桌面端搜索按钮整体隐藏，
 * 这一拨不产生可见变化；移动端则把 搜索/返回旧版 调成与旧站一致。
 *
 * 注：原生搜索（.search-button__button / #pst-search-dialog）已由
 * disable_search + Pagefind 取代，故不再把它并入下面的图标规则。 */
#pst-header .navbar-header-items__end > .navbar-item {
  order: 2;
}

#pst-header .navbar-header-items__end > .navbar-item:has(.header-link-button) {
  order: 0;
}

#pst-header .navbar-header-items__end > .navbar-item.navbar-persistent--container {
  order: 1;
}

#pst-header .pst-navbar-icon,
#pst-header .navbar-icon-links .nav-link {
  /* 旧站 .md-header__option：color #666、transition color .2s，无底色 */
  color: var(--hi-gray);
  border-radius: 0;
  transition: color 0.2s;
}

#pst-header .pst-navbar-icon:hover,
#pst-header .navbar-icon-links .nav-link:hover {
  /* 旧站 hover 只把图标加深到 #1a1a1a（暗色为 #fff），不加任何底色 */
  color: var(--hi-black);
  background: transparent;
}

/* 头部图标统一 20×20（旧站：调色板 20×20、GitCode 20×20、宽窄屏 img 20×20） */
#pst-header .theme-switch-button {
  width: 20px;
  height: 20px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* ---------- 页头"全文检索"图标（窄布局 ≤1219.98px 的搜索入口） ---------- */
.navbar-item:has(.hi-header-search) {
  display: none;
}

#pst-header .hi-header-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: var(--hi-gray);
  background: transparent;
  border: 0;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
}

#pst-header .hi-header-search:hover {
  color: var(--hi-black);
}

/* 旧站的调色板是纯图标，没有 Bootstrap 的下拉小三角 */
#pst-header .theme-switch-button::after {
  display: none !important;
}

#pst-header .theme-switch-button .svg-inline--fa,
#pst-header .theme-switch-button .theme-switch {
  width: 20px;
  height: 20px;
}

#pst-header .navbar-icon-links .nav-link img,
#pst-header .navbar-icon-links .nav-link svg {
  width: 20px;
  height: 20px;
}

@media (min-width: 1220px) {
  #pst-header .navbar-icon-links .nav-link img.icon-link-image {
    width: 16px;
    height: 16px;
  }
}

/* 旧站 .md-source 就是 20px 宽的纯图标链接，左右无内边距 */
#pst-header .navbar-icon-links .nav-link {
  min-width: 0;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}

#pst-header .navbar-end-item {
  display: inline-flex;
  align-items: center;
}

/* ---------- 页头"下载HTML"按钮（移植旧站 .header-download-button/.header-download-icon） ---------- */
#pst-header .header-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: var(--hi-gray);
  transition: color 0.2s;
}

#pst-header .header-download-button:hover {
  color: var(--hi-black);
}

#pst-header .header-download-icon {
  display: inline-block;
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: url("../images/download.svg") center / contain no-repeat;
  mask: url("../images/download.svg") center / contain no-repeat;
}

html[data-theme="dark"] #pst-header .header-download-icon {
  /* 旧站 slate：换成 dark-download.svg */
  -webkit-mask: url("../images/dark-download.svg") center / contain no-repeat;
  mask: url("../images/dark-download.svg") center / contain no-repeat;
}

#pst-header .header-link-button {
  height: 32px;
  min-height: 32px;
  /* 与右侧控件间距由 .navbar-header-items__end 的 gap:16px 提供
   * （旧站是各控件自身 margin-right:16px），此处不得再加 margin */
  margin: 0;
  padding: 5px 16px !important;
  border: 1px solid var(--hi-red) !important;
  color: var(--hi-red) !important;
  border-radius: 6px;
  font-size: 14px;
  line-height: 22px;
}

#pst-header .header-link-button:hover {
  border-color: rgba(224, 33, 40, 1) !important;
  color: rgba(224, 33, 40, 1) !important;
  background-color: transparent;
}

/* Search dialog
 * ⚠ 当前不生效：html_theme_options["disable_search"] = True 已关闭主题原生搜索
 * （#pst-search-dialog 与页头搜索按钮一并消失），检索入口与弹窗样式见
 * templates/sidebar-search.html（class="hi-sidebar-search"，触发 Pagefind 弹窗）
 * 与 css/pagefind.css（#search-modal，与下面的 id 无任何共用）。
 * 这一段保留自上游客端的实现，仅在被显式移除 disable_search、回退原生搜索时才生效。 */
#pst-search-dialog {
  width: min(720px, calc(100vw - 32px));
  padding: 0;
  color: var(--hi-text);
  /* 弹窗自身不画边框/圆角/阴影（旧站是透明容器 + 内部 6px 圆角白条），
   * 也不做背景变暗——原来的 rgba(0,0,0,.42) 遮罩色在旧站并不存在。 */
  background: transparent;
  border: none;
  box-shadow: none;
}

#pst-search-dialog .bd-search {
  min-height: 48px;
  padding: 8px 14px;
  color: var(--hi-text-muted);
}

#pst-search-dialog .bd-search .form-control {
  height: 40px;
  color: var(--hi-text);
  background: var(--hi-surface);
  border: 0;
  box-shadow: none;
  font-size: 16px;
}

#pst-search-dialog .bd-search .form-control:focus {
  box-shadow: none;
}

kbd {
  background-color: transparent;
}

#pst-search-dialog .kbd-shortcut,
#pst-search-dialog kbd {
  color: var(--hi-text-subtle);
  background: var(--hi-surface-muted);
  border: 1px solid var(--hi-border);
}

/* Primary/secondary navigation */
#pst-primary-sidebar.bd-sidebar-primary {
  flex: 0 0 var(--sidebar-current-width, 16.625rem);
  width: var(--sidebar-current-width, 16.625rem);
  min-width: var(--sidebar-current-width, 16.625rem);
  padding: 0px 16px 0px 0px;
  background: var(--hi-surface);
  border-right: 1px solid var(--hi-border);
}

/* 目录树缩进：线上站一级条目文字从 x≈18 起（= 外层 10px + 链接自身 8px 内边距），
 * 二级再缩进 12px。这层内边距只加在树容器上，不影响上面的选择器组。 */
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-docs-nav--global {
  padding-right: 0;
  padding-left: 0;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-docs-nav--global > .bd-toc-item {
  padding-left: 10px;
}

/* 侧栏收起：线上站 body.sidebar-collapsed 下 `.md-sidebar--primary { display:none }`
 * —— 侧栏完全隐藏、**不保留任何占位**，正文列随即占满释放出来的宽度。
 * （主题默认的 pst-squeeze 会把侧栏压成 4rem 的窄轨道，与此不符。）
 * 不能直接用 display:none / visibility:hidden：主题的展开逻辑挂在子元素宽度
 * 过渡的 transitionend 上，元素不渲染则过渡不跑、busy 标记会永久卡住。
 * 因此改为「宽度归零 + overflow 裁剪」——视觉上完全消失且不占位。 */
#pst-primary-sidebar.bd-sidebar-primary.pst-squeeze {
  flex: 0 0 0;
  width: 0;
  min-width: 0;
  max-width: 0;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .sidebar-header-items,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .sidebar-primary-items__start,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .sidebar-primary-items__end {
  background: var(--hi-surface);
}


:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-links__title {
  margin: 8px 8px 6px;
  color: var(--hi-text-subtle);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav {
  gap: 0;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav a {
  display: block;
  /* 行高对位旧站 .md-nav__link：整行 30px（线上实测 height/line-height 都是 30px），
   * 因此上下不留内边距，否则每行会变成 40px、比线上松一档 */
  padding: 0 8px 0 30px;
  height: 30px;
  color: var(--hi-text);
  border-radius: 4px;
  font-size: 14px;
  line-height: 30px;
  text-decoration: none;
  box-shadow: none;
  transition: color 160ms ease, background-color 160ms ease;
}


:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav a:hover {
  /* 旧站 extra.css 2919: .md-nav--primary .md-nav__link:hover = var(--hi-red) !important */
  color: var(--hi-red) !important;
  background: transparent;
  text-decoration: none;
}

/* "无 index 分区"的分组标题（旧站是 <label>：不可导航，点击只做展开/收起）：
 * 构建期 docs_ext.nav_stub_sections 把这些条目的 <a> 换成 .hi-nav-label，
 * 这里把行的盒子/字号/颜色补齐到与普通条目一致（对位上方 .bd-sidenav a），
 * 点击行为在 pydata-interactions.js（= 切换展开/收起）。 */
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav .hi-nav-label {
  display: block;
  padding: 0 8px 0 30px;
  height: 30px;
  color: var(--hi-text);
  border-radius: 4px;
  font-size: 14px;
  line-height: 30px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav .hi-nav-label:hover {
  color: var(--hi-red);
}

/* 祖先分区（当前路径上的目录）hover 也变为品牌红，确保选中子目录后悬停一级目录有明确反馈 */
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.current > a:not(.current):hover,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.active > a:not(.current):hover,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-docs-nav--global .toctree-l1.current > a:not(.current):hover,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-docs-nav--global .toctree-l1.active > a:not(.current):hover {
  color: var(--hi-red) !important;
  background: transparent;
}

/* 整行都是悬停热区：目录名是 <a>，箭头是叠在行首的绝对定位 summary，
 * 于是"行首那截"没有任何 hover 反馈——鼠标停在箭头上看起来就是
 * "悬停一级目录没反应"。这里把箭头热区（summary:hover）也算进来，
 * 与标题共用同一套变红规则。 */
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.has-children:has(> details > summary:hover) > a:not(.current),
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.has-children:has(> details > summary:focus-visible) > a:not(.current) {
  color: var(--hi-red) !important;
  background: transparent;
}


:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.current > a:not(.current),
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.active > a:not(.current) {
  color: var(--hi-text);
  background: transparent;
  font-weight: 400;
}

/* 当前页：品牌红 + 500 字重，无底色、无指示条（线上实测 background 透明、
 * box-shadow 无） */
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav a.current,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav a.current:hover {
  color: var(--hi-red);
  background: transparent;
  font-weight: 500;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav a,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav a.current {
  box-shadow: none !important;
}

/* 子级分组带一条竖向导引线 */
/* :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav ul {
  padding-left: 12px;
  border-left: 1px solid var(--tree-border);
} */

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav ul {
  position: relative;
  padding-left: 13px;
  border-left: 0;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav ul::before {
  content: "";
  position: absolute;
  top: -7px;
  bottom: 0;
  left: 14px;
  border-left: 1px solid var(--tree-border);
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav .caption,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav p.caption {
  margin: 12px 8px 6px;
  color: var(--hi-text-subtle);
  font-size: 12px;
  font-weight: 600;
}

/* 顶层条目与子项同色同字重（旧站未启用 navigation.sections，一级不是分组标题）；
 * 但一级条目**自身就是当前页**时（如站点首页的「概览」）仍是红字——
 * 故必须带 :not(.current)，否则会把当前页压回常规色。 */
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-docs-nav--global .toctree-l1 > a {
  font-weight: 400;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-docs-nav--global .toctree-l1.current > a:not(.current),
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-docs-nav--global .toctree-l1.active > a:not(.current) {
  color: var(--hi-text);
}

/* 可展开行：箭头覆盖在标题行**左侧**（对位 gitcode 文件树：箭头在行首、
 * 后面才是名称），summary 自身收缩为零高、不额外占一行。关键点：summary
 * 必须**自身**就是那块 28×30 的命中区——之前把命中区放在它内部的 span 上
 * （绝对定位），summary 的盒子是 0 高，点箭头落在空处、根本没有展开/折叠效果。
 * 横向位置：命中区贴 li 左缘（left:0），16px 图标被 flex 居中在 li 左缘 +6px
 * 处，右侧留出 30px 箭头槽（由上方 .bd-sidenav a / .hi-nav-label 的 padding-left
 * 让出）。嵌套层的 li 左缘由 .bd-sidenav ul 的缩进决定，箭头随之逐层右移。 */
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.has-children {
  position: relative;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.has-children > details > summary {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 30px;
  min-height: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  border-radius: 4px;
  list-style: none;
}

/* 主题给可展开行的链接留了 calc(30px + .1875rem) 右外边距——那是给贴在右缘的
 * 折叠箭头让位的。箭头挪到行首后，这段缺口只剩一条"悬停无反馈"的死区（整行
 * 热区靠的是 <a> 盒子，盒子窄了右端 30px 就没反应）。收回到与叶子行同档
 * （nav.bd-links li > a 的 .1875rem），让同层所有行宽度一致。 */
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.has-children > a,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.has-children > .hi-nav-label {
  margin-right: 0.1875rem;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.has-children > details > summary::-webkit-details-marker {
  display: none;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.has-children > details > summary .toctree-toggle {
  /* 主题给该元素设了 position:absolute; top:0; right:0（30×30 贴右上角），
   * 必须显式重置为静态，才能被 summary 的 flex 居中——否则箭头整体偏上偏右。 */
  position: static;
  top: auto;
  right: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: transparent; /* 隐藏主题的 FontAwesome 字形，改用旧站 chevron_down.svg */
  transition: transform 160ms ease, color 160ms ease, background-color 160ms ease;
}

/* 折叠箭头对位旧站 .md-nav__icon：chevron_down.svg（16×16 描边风格），
 * 展开态朝下（rotate 0）、折叠态朝右（rotate -90deg）。 */
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav .toctree-toggle::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  background: url("../images/chevron_down.svg") no-repeat center / 16px 16px;
}

/* 主题的折叠字形要彻底藏掉：PyData 加载时会把 <i class="fa-*"> 替换成
 * <svg class="svg-inline--fa">，只写 `i { display:none }` 会漏掉替换后的 svg，
 * 结果是「我的 chevron_down.svg 背景」与「主题 svg 箭头」两个字形挤在
 * 16px 盒子里互相顶开——正是箭头看起来偏上/偏右的原因。 */
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav .toctree-toggle > svg,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav .toctree-toggle > i {
  display: none !important;
}

/* 暗色：chevron_down.svg 是深色描边（stroke rgb(25,25,25)），按旧站做法反相 */
html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav .toctree-toggle::before {
  filter: invert(1) grayscale(1) brightness(1.5);
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.has-children > details:not([open]) > summary .toctree-toggle {
  transform: rotate(-90deg);
}

/* 会话记忆恢复期间抑制箭头过渡（对位旧站 html.nav-no-anim）：
 * 刷新时脚本按存储改写 details.open，若不抑制，箭头会从服务端默认态
 * 旋转到记忆态，产生"加载时箭头自己动"的闪动；用户手动点击不受影响。
 * 点击目录名会先切状态再跳转整页，这段窗口里的颜色/箭头过渡同样是
 * "折了一下页面就换了"的闪烁来源，故整棵左侧树一并抑制。 */
html.hi-nav-no-anim :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav .toctree-toggle,
html.hi-nav-no-anim :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav a {
  transition: none !important;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.has-children > details > summary:hover .toctree-toggle,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.has-children > details > summary:focus-visible .toctree-toggle {
  color: transparent;
  background: transparent;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.has-children > details > summary:focus-visible .toctree-toggle {
  outline: 2px solid var(--hi-red);
  outline-offset: -2px;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav a:focus-visible,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .sidebar-toggle:focus-visible {
  outline: 2px solid var(--hi-red);
  outline-offset: 2px;
}

/* Sidebar collapse control: 对位旧站 extra.css 的 .sidebar-toggle ——
 * 固定在侧栏右缘、垂直居中的 12×48 白色竖条（仅右半圆角、无左边框），
 * 图标用旧站的 toggle.svg（10×10），折叠时翻转 180°。
 * 选择器不挂 #pst-primary-sidebar：桌面端 pydata-interactions.js 会把该控件
 * 搬到 body 下（侧栏 overflow 会裁掉悬在侧栏之外的命中区，导致点不动），
 * 折叠态改用 body:has() 判定。 */
@media (min-width: 960px) {
  .pst-sidebar-collapse {
    position: fixed;
    top: 50%;
    left: calc(var(--sidebar-current-width, 16rem) - 1px);
    transform: translateY(-50%);
    z-index: 1080;
    width: 12px;
    height: 48px;
    margin: 0;
    padding: 0;
    transition: left 0.3s ease;
  }

  body:has(#pst-primary-sidebar.pst-squeeze) .pst-sidebar-collapse {
    left: 0;
  }

  /* 收缩关闭动画 */
  body.sidebar-dragging .pst-sidebar-collapse {
    transition: none;
  }

  #pst-collapse-sidebar-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 48px;
    min-width: 12px;
    margin: 0;
    padding: 0;
    color: var(--hi-text-muted);
    background: rgba(255, 255, 255, 1);
    border: 1px solid var(--hi-border);
    border-left: none;
    border-radius: 0 4px 4px 0;
    box-shadow: none;
    cursor: pointer;
    transition: background-color 0.2s;
  }

  #pst-collapse-sidebar-button:hover {
    color: var(--hi-text-muted);
    background: var(--hi-surface-muted);
    border-color: var(--hi-border);
  }

  #pst-collapse-sidebar-button .pst-collapse-sidebar-label,
  #pst-collapse-sidebar-button .pst-expand-sidebar-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  /* 主题的 SVG 折叠图标在 12px 宽的竖条里放不下，改用旧站 toggle.svg */
  #pst-collapse-sidebar-button .pst-icon {
    display: none;
  }

  #pst-collapse-sidebar-button::before {
    content: "";
    display: block;
    width: 10px;
    height: 10px;
    background: url("../images/toggle.svg") no-repeat center / contain;
    transition: transform 0.3s ease;
  }

  body:has(#pst-primary-sidebar.pst-squeeze) #pst-collapse-sidebar-button::before {
    transform: rotate(180deg);
  }
}

.pst-sidebar-collapse button,
.sidebar-toggle {
  color: var(--hi-text-muted);
}

/* 暗色对位旧站 slate 段：折叠条底色 rgba(25,25,25,.3)、边框 rgba(243,243,243,.15)，
 * toggle.svg 为深灰填充，用同一组 filter 反相变浅色 */
html[data-theme="dark"] #pst-collapse-sidebar-button {
  background: rgba(25, 25, 25, 0.3);
  border-color: rgba(243, 243, 243, 0.15);
}

html[data-theme="dark"] #pst-collapse-sidebar-button::before {
  filter: invert(1) grayscale(1) brightness(1.5);
}

#pst-primary-sidebar,
#pst-secondary-sidebar,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-docs-nav,
:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .bd-toc {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#pst-primary-sidebar::-webkit-scrollbar,
#pst-secondary-sidebar::-webkit-scrollbar,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-docs-nav::-webkit-scrollbar,
:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .bd-toc::-webkit-scrollbar {
  display: none;
}

#pst-secondary-sidebar.bd-sidebar-secondary {
  width: var(--hi-toc-width, 13rem) !important;
  min-width: var(--hi-toc-width, 13rem) !important;
  padding: 0;
  border-left: 1px solid var(--hi-border);
  background: var(--hi-surface);
}

/* 桌面端：拖动正文右缘 = 在正文与右目录之间重新分配宽度（分隔条语义）。 */
@media (min-width: 76.25em) {
  #pst-secondary-sidebar.bd-sidebar-secondary {
    width: var(--hi-toc-current-width, var(--hi-toc-width, 13rem)) !important;
    min-width: 8rem !important;
    max-width: calc(100% - 240px);
  }
}

:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .sidebar-secondary__inner {
  position: sticky;
  /* top 必须不大于自然位置距滚动容器顶部的偏移（= 侧栏 padding-top），
   * 否则 sticky 的最小距离约束会把内容整体向下推，顶部出现大段空白 */
  top: 16px;
  width: 100%;
  max-height: calc(100vh - 82px);
  margin-right: 0;
  padding-right: 0;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .sidebar-secondary__inner::-webkit-scrollbar {
  display: none;
}

:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .sidebar-secondary-item {
  width: 100%;
  box-sizing: border-box;
  margin-right: 0;
  padding-right: 0;
  border-left: 0; /* 分隔线由侧栏盒子自身绘制，避免双线 */
}

:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .sidebar-secondary-item:first-child {
  padding-top: 0; /* 首项贴顶，与左侧栏第一行对齐 */
}

:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc {
  width: 100%;
  box-sizing: border-box;
  border-left: 0;
}

:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .onthispage,
:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc .toc-entry > a,
:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc .toc-h2 > a,
:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc .toc-h3 > a,
:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc .toc-h4 > a {
  /* 对位旧站 .md-nav--secondary .md-nav__link：常规 #595959、14px、行高 30px */
  color: #595959;
  font-size: 14px;
  line-height: 30px;
}

:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .onthispage {
  padding: 0 0 8px 0;
  color: var(--hi-text);
  font-weight: 600;
}

:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc a {
  display: block;
  padding: 0 8px 0 12px;
  text-decoration: none;
  border-left: 0;
  transition: color 160ms ease, background-color 160ms ease;
}



/* 每条目录前加圆点 */
:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc a::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 14px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
}

/* 对位旧站：hover 与当前节都只是文字加深到 #191919（不是红字，也没有左缘红线） */
:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc a:hover,
:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc a.active {
  color: #191919;
  background: transparent;
}

/* 对位旧站：桌面端隐藏右目录的「当前页面」标题（线上 .md-nav__title
 * display:none），目录条目直接从侧栏顶部开始 */
:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .tocsection.onthispage {
  display: none;
}

/* Article layout and typography */
.bd-container__inner,
.bd-page-width {
  max-width: var(--hi-content-max);
}

/* The source Material layout keeps both side menus against the viewport edge.
 * PyData's default 88rem page-width centers the whole flex row and leaves
 * visible gutters on wide screens, so remove that outer constraint here. */
.bd-container__inner.bd-page-width,
#pst-header .bd-header__inner.bd-page-width {
  width: 100%;
  max-width: none;
  margin-right: 0;
  margin-left: 0;
}

.bd-container__inner.bd-page-width {
  padding-right: 0;
  padding-left: 0;
}

.bd-main {
  min-width: 0;
  background: var(--hi-surface);
}

.bd-content {
  min-width: 0;
  background: var(--hi-surface);
}

.bd-article-container {
  min-width: 0;
  max-width: none;
  width: 100%;
  padding: 0 24px;
}

/* Let the article occupy all space between the two side menus.  PyData's
 * default 60rem article cap is useful for book-like pages but leaves a large
 * blank strip in this product-documentation layout. */
.bd-content > .bd-article-container,
.bd-article-container {
  max-width: none;
  flex: 1 1 auto;
}

#main-content .bd-content .bd-article-container,
.bd-main .bd-content .bd-article-container {
  width: auto !important;
  max-width: none !important;
  flex: 1 1 auto !important;
  min-width: 0;
  /* 线上站正文左右留白实测 72px（.md-content__inner 的 28px + .md-typeset 的 44px）：
   * 这里拆成容器 28px + 正文 44px，合计与线上一致，正文列宽也随之对齐 */
  padding-right: 28px !important;
  padding-left: 28px !important;
}

/* 窄屏阅读模式：对位旧站 —— 收窄的是**整个主区**（左侧栏 + 正文 + 右侧目录）
 * 并按视口百分比计算（宽屏 100%，窄屏 60%，拖拽后的值也存百分比），整体左对齐，
 * 空白留在视口最右端；侧栏被挤压到最小宽度（旧站 7rem，文字省略号截断），
 * 右侧目录在窄屏收起（旧站窄屏实测右目录列宽为 0）。
 * 仅桌面（≥960px）：移动/平板端内容恒 100% 宽，忽略桌面存的窄屏值
 * （对位旧站 e8b1217「桌面状态不泄漏到移动端」）。 */
@media (min-width: 960px) {
  html.prefer-narrow .bd-container__inner.bd-page-width,
  body.narrow-screen .bd-container__inner.bd-page-width {
    max-width: var(--grid-max-width, 60%);
    /* 主题把容器居中，窄屏要左对齐（旧站窄屏主区从视口左边开始） */
    margin-right: auto;
    margin-left: 0;
  }

  /* 侧栏在窄屏固定收窄到 7rem（线上站窄屏实测 112px），文字截断不换行；
   * 右侧页内目录**保留**（线上站窄屏实测：112 + 正文 597 + 目录 242 = 60% 视口）。
   * 宽度同样只走 --sidebar-current-width：固定定位的收起箭头（.pst-sidebar-collapse）
   * 与拖拽手柄（.sidebar-drag-handle）跟着它对齐——否则窄屏下侧栏收到 112px，箭头/
   * 手柄还停在 266px 处（实测差 153px；≤1199.98px 再叠窄屏时差 112px）。
   * 选择器带 html./body. 类（特异性高于 :root），能压过上面媒体查询里的 14rem。 */
  html.prefer-narrow,
  body.narrow-screen {
    --sidebar-current-width: 7rem;
  }

  html.prefer-narrow #pst-primary-sidebar,
  body.narrow-screen :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) {
    flex: 0 0 var(--sidebar-current-width);
    width: var(--sidebar-current-width) !important;
    min-width: var(--sidebar-current-width);
  }

  /* 目录条目单行省略号（左右两棵树一致）：超出截断显示"…"，完整标题由
   * pydata-interactions.js 的 applyNavTitles 检测到截断后补 title 悬停提示。 */
  :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav a,
  :is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc a {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /* 右目录是 .nav flex 列表：nowrap 后 li 会被内容撑宽、溢出侧栏，
   * 限宽回容器宽度，上面 a 的省略号截断才能生效（左树无此问题）。 */
  :is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc li {
    max-width: 100%;
  }

  /* 页头同步收窄：logo 左侧不动，右侧图标组随主区右边界一起左移，
   * 与正文区保持同一条右边界线。宽屏不受影响。
   * 主题 .bd-header 自带 justify-content:center 会把受限的内层居中，
   * 需在窄屏改回 flex-start 让 logo 钉在视口左边。 */
  html.prefer-narrow #pst-header.bd-header,
  body.narrow-screen #pst-header.bd-header {
    justify-content: flex-start;
  }

  html.prefer-narrow #pst-header .bd-header__inner.bd-page-width,
  body.narrow-screen #pst-header .bd-header__inner.bd-page-width {
    max-width: var(--grid-max-width, 60%);
    margin-right: 0;
    margin-left: 0;
  }

  /* 拖动内容区右缘时**实时跟随** */
  body.grid-dragging .bd-container__inner.bd-page-width {
    max-width: var(--grid-max-width, 100%);
    margin-right: auto;
    margin-left: 0;
  }

  body.grid-dragging #pst-header.bd-header {
    justify-content: flex-start;
  }

  body.grid-dragging #pst-header .bd-header__inner.bd-page-width {
    max-width: var(--grid-max-width, 100%);
    margin-right: 0;
    margin-left: 0;
  }
}

#main-content .bd-content .bd-article-container .bd-article,
.bd-main .bd-content .bd-article-container .bd-article {
  width: 100%;
  max-width: none;
  padding: 0 44px 24px;
  height: 100%;
}

.bd-article {
  min-height: 60vh;
  max-width: 100%;
  /* 左右 44px 与容器 28px 相加 = 线上站正文两侧 72px 留白 */
  padding: 0 44px 24px;
  color: var(--hi-text);
  font-family: var(--hi-font);
  font-size: 16px;
  line-height: 24px;
}

.bd-article h1,
.bd-article h2,
.bd-article h3,
.bd-article h4,
.bd-article h5,
.bd-article h6 {
  color: var(--hi-text);
  font-weight: 600;
  scroll-margin-top: 66px;
}

/* 字体对位原站 extra.css：h1/h5/h6 与 strong 用黑体 HarmonyHeiTi，
 * h2-h4 单独用 HarmonyOS Sans SC 2025（原站即无回退栈）。 */
.bd-article h1,
.bd-article h5,
.bd-article h6 {
  font-family: var(--hi-font-hei);
}

.bd-article h2,
.bd-article h3,
.bd-article h4 {
  font-family: "HarmonyOS Sans SC 2025";
}

/* 标题间距对位旧站 extra.css：h1/h2 margin-top 64px，h3~h6 margin-top 32px，
 * 全部 margin-bottom 16px；h2 无下边框（旧站 .md-typeset h2 实测
 * border-bottom-width: 0，PyData 主题默认的下边框需压掉）。
 * h1 的 40px 为叠加 .bd-article 上内边距 24px 后合计 64px 的等效值。 */
.bd-article h1 {
  margin: 40px 0 16px;
  font-size: 32px;
  line-height: 48px;
}

.bd-article h2 {
  margin: 64px 0 16px;
  padding-bottom: 0;
  border-bottom: 0;
  font-size: 24px;
  line-height: 36px;
}

.bd-article h3 {
  margin: 32px 0 16px;
  font-size: 20px;
  line-height: 30px;
}

.bd-article h4 {
  margin: 32px 0 16px;
  font-size: 18px;
  line-height: 28px;
}

.bd-article h5,
.bd-article h6 {
  margin: 32px 0 16px;
  font-size: 16px;
  line-height: 24px;
}

.bd-article p,
.bd-article ul,
.bd-article ol,
.bd-article dl,
.bd-article blockquote {
  margin-top: 8px;
  margin-bottom: 8px;
  line-height: 24px;
}

.bd-article li {
  margin-bottom: 4px;
}

.view-source a,
.bd-article a {
  color: var(--hi-red);
  font-weight: 500;
  text-decoration: none;
}

.view-source a:hover,
.view-source a:focus,
.bd-article a:hover,
.bd-article a:focus {
  color: var(--hi-red-hover);
  text-decoration: underline;
}

a.headerlink {
  display: none;
}

.bd-article strong {
  color: inherit;
  font-family: var(--hi-font-hei);
  font-weight: 600;
}

.bd-article blockquote {
  margin-left: 0;
  /* 对位旧站 Material 默认渲染（线上实测）：透明底、4px 半透明黑左边框、
     54% 黑灰文字、无圆角，仅左侧 13px 内边距 */
  padding: 0 0 0 13px;
  color: rgba(0, 0, 0, 0.54);
  background: transparent;
  border-left: 4px solid rgba(0, 0, 0, 0.32);
  border-radius: 0;
}

/* "图 N + 须知/说明"是本套文档的固定搭配，而图片自身没有外边距、引用块的
   margin-top 又被上面第 1476 行的共用规则归零，两者会贴成 0 间距（线上实测：
   图片底边 = 引用块顶边，引用块的左边框直接压在图上）。这里补一档与
   "表格 → 引用块"（表格容器 margin-bottom: 16px）相同的间距。只针对裸 <img>
   紧贴引用块的情形；段落结尾的 markdown 图片（<img></p> 形态）自带 `p` 的
   下边距（同一条共用规则），不需要处理。 */
.bd-article img + blockquote {
  margin-top: 16px;
}

.bd-article hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--hi-border);
  opacity: 1;
}

/* 面包屑对位旧站 overrides/static/css/extra.css：
 * 分隔符为文本 "/"（颜色 rgba(201,201,201,1)），条目常规 #595959 / 400，
 * hover 加深到 #191919，最后一项（当前页）#191919 + 500 字重。
 * 主题的分隔符规则是
 *   ul.bd-breadcrumbs li.breadcrumb-item:not(.breadcrumb-home):before
 *   { content: var(--pst-breadcrumb-divider); font: var(--fa-font-solid) }
 * （FontAwesome 雪佛龙字形，优先级 0,4,2），因此这里用同等优先级 + 后加载覆盖，
 * 并把首项的分隔符去掉（模板已移除"首页"图标项，主题会给所有非 home 项加分隔符）。 */
.bd-breadcrumbs {
  margin: 12px 0 0;
  font-size: 14px;
}

ul.bd-breadcrumbs li.breadcrumb-item:first-child::before {
  content: none;
}

html[data-theme="dark"] ul.bd-breadcrumbs li.breadcrumb-item:not(:first-child)::before {
  /* 旧站 slate：面包屑分隔符取 --hi-gray-light(#939393) */
  color: var(--hi-gray-light);
}

ul.bd-breadcrumbs li.breadcrumb-item:not(:first-child)::before {
  content: "/";
  float: none;
  margin: 0 6px;
  padding: 0;
  color: rgba(201, 201, 201, 1);
  font: inherit;
  font-size: 14px;
  line-height: inherit;
}

ul.bd-breadcrumbs li.breadcrumb-item,
ul.bd-breadcrumbs li.breadcrumb-item .ellipsis,
ul.bd-breadcrumbs li.breadcrumb-item a,
ul.bd-breadcrumbs li.breadcrumb-item .nav-link {
  margin: 0;
  color: #595959;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
}

ul.bd-breadcrumbs li.breadcrumb-item a:hover,
ul.bd-breadcrumbs li.breadcrumb-item .nav-link:hover {
  color: #191919;
  text-decoration: none;
}

ul.bd-breadcrumbs li.breadcrumb-item.active,
ul.bd-breadcrumbs li.breadcrumb-item.active .ellipsis {
  color: #191919;
  font-weight: 500;
}

/* 暗色：常规 --hi-gray(#C9C9C9)，hover --hi-black(#fff)，末项 #fff（旧站 slate 段） */
html[data-theme="dark"] ul.bd-breadcrumbs li.breadcrumb-item,
html[data-theme="dark"] ul.bd-breadcrumbs li.breadcrumb-item a,
html[data-theme="dark"] ul.bd-breadcrumbs li.breadcrumb-item .ellipsis {
  color: var(--hi-gray);
}

html[data-theme="dark"] ul.bd-breadcrumbs li.breadcrumb-item a:hover {
  color: var(--hi-black);
}

html[data-theme="dark"] ul.bd-breadcrumbs li.breadcrumb-item.active,
html[data-theme="dark"] ul.bd-breadcrumbs li.breadcrumb-item.active .ellipsis {
  color: #ffffff;
}

/* Content components（行内代码：对齐旧站 7cf111a —— 正文无衬线字体、
 * 16px、2px 6px 内边距、2px 圆角；不再用等宽字体） */
.bd-article code.literal,
.bd-article code.docutils.literal,
.bd-article :not(pre) > code {
  padding: 2px 6px;
  color: var(--hi-text);
  background: var(--hi-surface-muted);
  border: none;
  border-radius: 2px;
  font-family: var(--hi-font);
  font-size: 16px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.bd-article pre code,
.bd-article .highlight code {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  /* 与旧站一致：代码块内用等宽栈，末位带 HarmonyOS 兜底 */
  font-family: "Consolas", "Roboto Mono", "Monaco", "Courier New",
    "HarmonyOS Sans SC 2025", monospace;
}

.bd-article img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.bd-article img.hi-image {
  cursor: zoom-in;
}

/* ---------- 图片规格（三档，按**原图像素宽**） ----------
 * 类名由 pydata-interactions.js 的 enhanceImages 在图片就绪（含 load 事件、SPA 换页
 * 后重新扫描）时按 naturalWidth 打上：
 *   < 200px    不动（行内小图标/标记，保持原尺寸）
 *   200–500px  .hi-image--sm → 统一 400px 宽
 *   > 500px    .hi-image--lg → 统一 700px 宽
 * 例外：源码里显式写成 <200px 的图（width 属性，如 DOCX 转来的行内小标记）不打类。
 * 宽度是固定值，靠上面 .bd-article img 的 max-width: 100% 兜底，窄视口不溢出；
 * 注意这是"固定宽度"而不是"上限"——原图比目标宽度小的会被放大（--sm 档里原宽
 * 200–400px 的那批会放大，最多 2 倍）。双击预览走灯箱的 90vw/90vh，不受影响
 * （灯箱 img 不在 .bd-article 内）。 */
.bd-article img.hi-image--sm {
  width: 400px;
  display: block;
  margin: 12px 0px;
}

.bd-article img.hi-image--lg {
  width: 700px;
  display: block;
  margin: 12px 0px;
}


.bd-article figure {
  margin: 20px 0;
}

/* image 指令产出的块级图片（<section> 直接子元素）同样按「独占一行 + margin
 * 定位」处理：docutils 给 align 生成的 float/inline 会让图片盖住下一个标题、
 * 或多张图挤在同一行。行内图片（<p> 里的 <img>）不受影响，仍可浮动绕排。 */
/* image 指令的图被包在 <a class="image-reference"> 里，<a> 默认是行内元素，
 * 会让图片的 margin:auto 失效。display:contents 让 <a> 不生成盒子，图片回到
 * section 的直接流中，下面的对齐规则才能生效（链接语义与点击行为不变）。 */
.bd-article section > a.image-reference {
  display: contents;
}

.bd-article section > img,
.bd-article section > a > img {
  display: block;
}

.bd-article section > img.align-left,
.bd-article section > a > img.align-left,
.bd-article section > img.align-center,
.bd-article section > a > img.align-center,
.bd-article section > img.align-right,
.bd-article section > a > img.align-right {
  float: none;
}

.bd-article section > img.align-left,
.bd-article section > a > img.align-left {
  margin-left: 0;
  margin-right: auto;
}

.bd-article section > img.align-center,
.bd-article section > a > img.align-center {
  margin-left: auto;
  margin-right: auto;
}

.bd-article section > img.align-right,
.bd-article section > a > img.align-right {
  margin-left: auto;
  margin-right: 0;
}

/* docutils 官方语义里 align-left/right 会让图片浮动、文字绕排。本站在块级
 * 图上取消了浮动（上下文不被推到图片侧面），需要官方绕排效果时加
 * :class: float-left 或 :class: float-right 显式开启。 */
.bd-article figure.float-left,
.bd-article section > img.float-left {
  float: left;
  margin-right: 16px;
  max-width: 50%;
}

.bd-article figure.float-right,
.bd-article section > img.float-right {
  float: right;
  margin-left: 16px;
  max-width: 50%;
}

/* 题注跟随图片对齐：默认（不写 :align:，图在左侧）题注左对齐；
 * :align: center / right 时题注跟着居中 / 右对齐（原先写死居中，
 * 与左对齐的图对不上）。 */
.bd-article figcaption {
  margin-top: 8px;
  color: var(--hi-text-muted);
  font-size: 14px;
  line-height: 20px;
  text-align: left;
}

.bd-article figure.align-center figcaption {
  text-align: center;
}

.bd-article figure.align-right figcaption {
  text-align: right;
}

/* 图片自己的对齐：图外层 <a class="image-reference"> 是满宽块级元素，
 * figure 上的 text-align 管不到它，需要收缩到图片宽度再用 margin 定位。
 *
 * 同时必须取消 Sphinx 给 align-left/align-right 加的 float——浮动会让相邻段落
 * 绕到图片另一侧（align-left 时下文挤到右侧、align-right 时上文被挤到左侧），
 * 图文混排不是这里的预期，图块应独占一行。 */
.bd-article figure.align-left,
.bd-article figure.align-right,
.bd-article figure.align-center {
  float: none;
}

.bd-article figure.align-center > .image-reference,
.bd-article figure.align-center > img,
.bd-article figure.align-left > .image-reference,
.bd-article figure.align-left > img,
.bd-article figure.align-right > .image-reference,
.bd-article figure.align-right > img {
  width: fit-content;
}

.bd-article figure.align-center > .image-reference,
.bd-article figure.align-center > img {
  margin-left: auto;
  margin-right: auto;
}

.bd-article figure.align-left > .image-reference,
.bd-article figure.align-left > img {
  margin-left: 0;
  margin-right: auto;
}

.bd-article figure.align-right > .image-reference,
.bd-article figure.align-right > img {
  margin-left: auto;
  margin-right: 0;
}

.bd-article .sd-card,
.bd-article .sd-tab-set,
.bd-article details.sd-dropdown {
  border-color: var(--hi-border);
  border-radius: var(--hi-radius);
  /* 卡片自带 .sd-shadow-sm（!important），必须同级压回站点阴影 */
  box-shadow: var(--hi-shadow) !important;
}

/* 主题给卡片/折叠块上了带 !important 的阴影，且卡片那条选择器带
 * html[data-theme]（特异性 0,2,1）——这里用「.sd-card.sd-shadow-*」叠加类名
 * 把权重提到 0,3,0 才能压回站点的 --hi-shadow / --hi-shadow-raised */
.bd-article details.sd-dropdown,
.bd-article .sd-card.sd-shadow,
.bd-article .sd-card.sd-shadow-sm,
.bd-article .sd-card.sd-shadow-lg,
.bd-article .sd-card.sd-shadow-hover {
  box-shadow: var(--hi-shadow) !important;
}

/* 悬浮：与本文件里的卡片/按钮保持一致——抬升阴影（不改文字颜色） */
.bd-article .sd-card:hover,
.bd-article .sd-card.sd-shadow-sm:hover,
.bd-article .sd-card.sd-shadow-lg:hover,
.bd-article details.sd-dropdown:hover {
  box-shadow: var(--hi-shadow-raised) !important;
}

/* 标签页：主题画成 2px 品牌红描边且选择器为 .bd-content .sd-tab-set .sd-tab-content，
 * 这里用同等特异性 + 更晚加载换成与卡片一致的中性描边 */
.bd-article .sd-tab-set .sd-tab-content {
  border: 1px solid var(--hi-border);
  border-radius: 0 0 var(--hi-radius) var(--hi-radius);
  box-shadow: none;
  padding: 16px;
  background-color: var(--hi-surface);
}

.bd-article .sd-tab-set > input:not(:checked) + label {
  background-color: var(--hi-surface-muted);
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: var(--hi-radius) var(--hi-radius) 0 0;
  font-size: 16px;
  line-height: 40px;
  padding: 0 16px;
  margin-inline-end: 8px;
  color: var(--hi-text-muted);
  font-weight: 400;
  transform: none;
}

/* 未选中标签悬浮：站点惯用浅底 + 品牌红文字 */
.bd-article .sd-tab-set > input:not(:checked):not(:focus-visible) + label:hover {
  background-color: var(--hi-surface);
  border-color: var(--hi-border) var(--hi-border) transparent;
  color: var(--hi-red);
  text-decoration-line: none;
}

/* 选中标签：白底 + 品牌红文字，与内容区连成一体 */
.bd-article .sd-tab-set > input:checked + label {
  background-color: var(--hi-surface);
  border: 1px solid var(--hi-border);
  border-bottom: 0;
  border-radius: var(--hi-radius) var(--hi-radius) 0 0;
  color: var(--hi-red);
  font-size: 16px;
  font-weight: 600;
  line-height: 40px;
  padding: 0 16px;
  margin-inline-end: 8px;
  transform: none;
}

/* 折叠块标题条：与卡片标题条同一套内边距与圆角，左侧改中性描边（不再用主题灰色粗条） */
.bd-article details.sd-dropdown > summary.sd-card-header {
  border-left: 1px solid var(--hi-border) !important;
  border-radius: var(--hi-radius) var(--hi-radius) 0 0;
  font-size: 16px;
  line-height: 24px;
  padding: 12px 16px;
}

.bd-article details.sd-dropdown > .sd-summary-content {
  border-radius: 0 0 var(--hi-radius) var(--hi-radius);
  padding: 12px 16px 16px;
}

/* 卡片标题条与正文内边距对齐折叠块 */
.bd-article .sd-card-header {
  border-radius: var(--hi-radius) var(--hi-radius) 0 0;
  font-size: 16px;
  line-height: 24px;
  padding: 12px 16px;
}

.bd-article .sd-card-body,
.bd-article .sd-card-footer {
  padding: 16px;
}

.bd-article .sd-btn,
.bd-article a.btn {
  border-radius: var(--hi-radius);
  font-size: 14px;
  font-weight: 500;
}

.bd-article .sd-btn-primary,
.bd-article a.btn-primary {
  color: #ffffff;
  background: var(--hi-red);
  border-color: var(--hi-red);
}

.bd-article .sd-btn-primary:hover,
.bd-article a.btn-primary:hover {
  color: #ffffff;
  background: var(--hi-red-hover);
  border-color: var(--hi-red-hover);
}

/* 正文里的 toctree（未用 :hidden: 隐藏时）——参照 docs.hisilicon.com
 * （hispark_ai 站点）的正文目录树：普通嵌套列表 + disc 项目符号 + 层级缩进，
 * 链接沿用站点超链接色（--hi-red）、不加下划线，仅靠缩进与符号区分层级。
 * 主题默认给一级条目 1.3em 字号、嵌套 ul 无符号零行距，中文长标题会挤在一起，
 * 这里统一为 16px 字号 + 6px 行距。 */
.bd-article .toctree-wrapper > ul {
  margin: 16px 0;
  padding-left: 1.5em;
  list-style-type: disc;
}

.bd-article .toctree-wrapper li {
  margin: 6px 0;
  list-style: inherit;
}

.bd-article .toctree-wrapper li[class^="toctree-l"] > a {
  color: var(--hi-red);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 0;
}

.bd-article .toctree-wrapper li[class^="toctree-l"] > a:hover,
.bd-article .toctree-wrapper li[class^="toctree-l"] > a:focus {
  color: var(--hi-red-hover);
  text-decoration: none;
}

/* 嵌套层级：继续缩进并保留项目符号，不用竖线/卡片 */
.bd-article .toctree-wrapper li > ul {
  margin: 6px 0;
  padding-left: 1.5em;
  border-left: 0;
  list-style-type: disc;
}

/* Admonitions —— 配色沿用 PyData 主题（类型色左边条 + 类型色标题条 + 类型图标），
 * 外框/圆角/阴影/字号/间距与站点其它组件（卡片、标签页、折叠块）保持同一套 token：
 *   边框 1px var(--hi-border)（左侧保留 4px 类型色条）
 *   圆角 var(--hi-radius)（6px）
 *   阴影 var(--hi-shadow)
 *   正文 16px / 24px，标题 16px / 600
 *
 * 主题用 --pst-color-on-background 作告警框正文底色，本文件不再重映射该 token
 * （原先映射成文字色 --hi-text，会让告警框/卡片/标签页/折叠块的底色与文字同色）。
 *
 * 注意：Material 专有类型（info/success/question/failure/bug/example/quote/
 * abstract）主题不认识，会退化成与 note 相同的默认蓝色外观；需要区分配色时
 * 改用 9 种内置类型之一。 */
.bd-article div.admonition,
.bd-article details.admonition {
  margin: 16px 0;
  padding: 0 16px;
  /* 只改上/右/下三边，左边保留主题按类型设置的 4px 实线颜色 */
  border-top: 1px solid var(--hi-border);
  border-right: 1px solid var(--hi-border);
  border-bottom: 1px solid var(--hi-border);
  border-left-width: 4px;
  border-left-style: solid;
  border-radius: var(--hi-radius);
  /* 主题对告警框阴影用了 !important，需同级压回站点阴影 */
  box-shadow: var(--hi-shadow) !important;
  font-size: 16px;
  line-height: 24px;
}

/* 标题条：满宽（负外边距抵消容器内边距），下边线与容器描边同色 */
.bd-article div.admonition > .admonition-title,
.bd-article details.admonition > summary {
  margin: 0 -16px 12px;
  padding: 8px 16px 8px 32px;
  border-bottom: 1px solid var(--hi-border);
  border-radius: calc(var(--hi-radius) - 1px) calc(var(--hi-radius) - 1px) 0 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

/* 正文首段紧贴标题条，末段留出与容器一致的下内边距 */
.bd-article div.admonition > .admonition-title + *,
.bd-article details.admonition > summary + * {
  margin-top: 0;
}

.bd-article div.admonition > :last-child,
.bd-article details.admonition > :last-child {
  margin-bottom: 16px;
}

/* Code blocks */
.bd-article .highlight {
  position: relative;
  margin:0;
  background: transparent;
}

.bd-article .highlight pre,
.bd-article pre.literal-block {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  color: var(--hi-text);
  background: var(--hi-code-bg);
  border: 1px solid var(--hi-border);
  border-radius: var(--hi-code-radius);
  font-family: var(--pst-font-family-monospace);
  font-size: 14px;
  line-height: 1.7; /* 对齐旧站 7cf111a */
  scrollbar-width: thin;
}

.bd-article .highlight pre::-webkit-scrollbar {
  height: 8px;
}

.bd-article .highlight pre::-webkit-scrollbar-thumb {
  background: var(--hi-border-strong);
  border-radius: 8px;
}

.bd-article .copybtn {
  top: 8px;
  right: 8px;
  color: var(--hi-text-muted);
  background: var(--hi-surface);
  border: 1px solid var(--hi-border);
  border-radius: 4px;
}

.bd-article .copybtn:hover {
  color: var(--hi-red);
  border-color: var(--hi-red);
}

/* Tables */
.bd-article .table-wrapper,
.bd-article .table-container {
  max-width: 100%;
  overflow-x: auto;
}

/* 表格：逐条对位线上站（fbb_ws63 master）实测规则 ——
 * Material 基座 + overrides/static/css/extra.css：auto 布局、内容自适应宽度、
 * 整表外框 rgba(0,0,0,.12) + 2px 圆角、HarmonyOS Sans 字体栈、
 * 表头 min-width 5rem、行过渡 125ms、hover 中性浅灰（非品牌红）。
 * 选择器覆盖 .bd-article 内**所有** table：MyST/docutils 产出的
 * `<table class="table">` 与源文档里的裸 `<table>`（无 class）—— 原规则只写
 * table.docutils/table.table，裸表格会退回 PyData 的无边框居中样式。 */
.bd-article table {
  /* 宽表格横向滚动*/
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  /* 主题用 `table { margin: auto }` 把表格水平居中，线上站左对齐、上下留白 */
  margin: 0;
  color: var(--hi-text);
  background: var(--hi-surface);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 2px;
  border-collapse: collapse;
  font-family: "HarmonyOS Sans SC 2025", "HarmonyOS Sans SC",
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  font-weight: 400;
  /* 对位旧站表格单元格实测行高 24px（品牌层原为 20px） */
  line-height: 24px;
  table-layout: auto;
}

.bd-article table tr {
  height: 40px;
  transition: background-color 125ms ease;
}

.table thead tr {
  border-bottom: none;
  background-color: rgba(25, 25, 25, 0.05);
}

.bd-article table th,
.bd-article table td {
  padding: 0 0.5em;
  color: var(--hi-text);
  font-size: 14px;
  border: 1px solid var(--hi-border);
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: middle;
}

.bd-article table th {
  padding: 4px 0.5em;
  font-weight: 500;
  font-style: normal;
  min-width: 110px;
  text-align: left;
  border: 1px solid var(--hi-border);
  background: rgba(25,25,25,0.05);
}

/* 单元格内容包 <p>（默认 16px 底边距把文字顶离垂直中线，线上站单元格为裸文本）；
 * 首尾子元素边距清零恢复垂直居中 */
.bd-article table :is(td, th) > :first-child {
  margin-top: 0;
}

.bd-article table :is(td, th) > :last-child {
  margin-bottom: 0;
}

.bd-article table :is(td, th) > pre:first-of-type {
  margin: 6px 0px !important;
}

/* PyData 主题给表格自带隔行条纹（zebra-high 映射 --pst-color-on-background
 * 即文字色：亮色近黑、暗色近白），线上站无条纹——统一透明透出表底 */
.bd-article table tbody tr:nth-child(odd),
.bd-article table tbody tr:nth-child(2n) {
  background-color: transparent;
}

/* hover = --md-typeset-table-color--light（中性灰，线上实测 rgba(0,0,0,.035)） */
.bd-article table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.035);
}

/* 主题的横向滚动容器：与表格一起左对齐（主题默认块级宽度会让表格居中） */
.bd-article .pst-scrollable-table-container {
  max-width: 100%;
  margin: 16px 0;
  overflow-x: auto;
}

.bd-article .pst-scrollable-table-container > table {
  margin-bottom: 0;
}

/* Previous/next navigation and source links */
.bd-article-container .prev-next-footer {
  margin: 0;
  padding-top: 0;
  border-top: 1px solid var(--hi-border);
}

/* 上一页/下一页：对位旧站 .md-footer__link 实测 —— "上一页/下一页"小标签与
 * 页面标题同为 14px / #666 / 400 字重（品牌层原为标题 17.6px 红色 600）。 */
.bd-article-container .prev-next-area a {
  color: #666666;
  text-decoration: none;
}

.bd-article-container .prev-next-area a:hover,
.bd-article-container .prev-next-area a:focus {
  color: var(--hi-red-hover);
  text-decoration: none;
}

.bd-article-container .prev-next-area .prev-next-subtitle,
.bd-article-container .prev-next-area .prev-next-subtitle p {
  color: #666666;
  font-size: 14px;
  font-weight: 400;
  line-height: 30px;
  margin: 0;
}

.bd-article-container .prev-next-area .prev-next-title,
.bd-article-container .prev-next-area .prev-next-title p {
  color: #666666;
  font-size: 14px;
  font-weight: 400;
  line-height: 30px;
  margin: 0;
  text-decoration:none !important;
}

html[data-theme="dark"] .bd-article-container .prev-next-area a,
html[data-theme="dark"] .bd-article-container .prev-next-area .prev-next-subtitle,
html[data-theme="dark"] .bd-article-container .prev-next-area a,
html[data-theme="dark"] .bd-article-container .prev-next-area .prev-next-subtitle,
html[data-theme="dark"] .bd-article-container .prev-next-area .prev-next-title {
  /* 旧站 slate：翻页标签与标题都是纯白 */
  color: #ffffff;
}

html[data-theme="dark"] .bd-article-container .prev-next-area a:hover,
html[data-theme="dark"] .bd-article-container .prev-next-area a:hover .prev-next-title,
html[data-theme="dark"] .bd-article-container .prev-next-area a:hover .prev-next-subtitle {
  color: #E7434A;
}

/* 旧站翻页：hover 时整条链接（标签 + 标题）变品牌红 */
.bd-article-container .prev-next-area a:hover,
.bd-article-container .prev-next-area a:hover .prev-next-title,
.bd-article-container .prev-next-area a:hover .prev-next-subtitle {
  color: var(--hi-red);
}

/* 旧站翻页箭头是 26px 圆形描边按钮（.md-footer__button 内的圆形 SVG），
 * 新框架改为模板静态输出 Material 风格细箭头（.hi-pn-ring + .hi-pn-arrow）。
 * 为防止任何意外或旧 HTML 中遗留的 FontAwesome 图标（<i> 或 fontawesome.js 异步替换出的 <svg>）
 * 露出与并存，对 prev-next-area 内部直接子代 i / svg 显式隐藏。 */
.bd-article-container .prev-next-area a > i,
.bd-article-container .prev-next-area a > svg {
  display: none !important;
}

/* 翻页箭头（由 JS 注入 .hi-pn-ring + .hi-pn-arrow）：26px 圆环 + Material 细箭头
 * （24 viewBox，mask 上色 → currentColor，亮/暗/悬停自动跟随） */
.bd-article-container .prev-next-area .hi-pn-ring {
  /* 按使用反馈：不再画圆环边框，只保留一个 20px 的图标位 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border: 0;
  transition: color 0.2s;
}

.bd-article-container .prev-next-area .hi-pn-arrow {
  display: block;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11z'/%3E%3C/svg%3E")
    no-repeat center / 20px 20px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11z'/%3E%3C/svg%3E")
    no-repeat center / 20px 20px;
}

.bd-article-container .prev-next-area .hi-pn-ring.is-prev .hi-pn-arrow {
  transform: rotate(180deg);
}


.bd-article-container .sourcelink a {
  color: var(--hi-text-muted);
}

.bd-article-container .sourcelink a:hover {
  color: var(--hi-red);
}

/* Back-to-top restored to the source Material geometry (right-edge round
 * arrow button, icon only) while keeping the brand red colors.  The theme's
 * display toggling (block/none via inline style) stays in charge. */
#pst-back-to-top {
  top: auto;
  bottom: 180px;
  right: 25px;
  left: auto;
  z-index: 9999;
  width: 44px;
  height: 44px;
  padding: 0;
  overflow: hidden;
  font-size: 0;
  line-height: 44px;
  text-align: center;
  transform: none;
  color: #ffffff;
  background: var(--hi-red);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(199, 0, 11, 0.1);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 回顶图标对位旧站 Material 的 .md-top svg（viewBox 0 0 24 24、渲染 20×20）：
 * FontAwesome 的 fa-arrow-up 是粗箭头，形状与线上站不同，这里改用同一条
 * path 做 mask 上色（currentColor，亮暗两态都正确）。 */
#pst-back-to-top .svg-inline--fa,
#pst-back-to-top .fa-arrow-up {
  display: none !important;
}

#pst-back-to-top::before {
  content: "";
  display: block;
  width: 20px;
  height: 44px;
  margin: 0 auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z'/%3E%3C/svg%3E")
    no-repeat center / 20px 20px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z'/%3E%3C/svg%3E")
    no-repeat center / 20px 20px;
}

#pst-back-to-top:hover {
  opacity: 0.85;
  background: var(--hi-red-hover);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Dark mode component overrides */
html[data-theme="dark"] #pst-header.bd-header {
  /* 旧站 slate：页头下阴影加深到 rgba(0,0,0,.3) */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] #pst-header.bd-header,
html[data-theme="dark"] #pst-primary-sidebar.bd-sidebar-primary,
html[data-theme="dark"] #pst-secondary-sidebar.bd-sidebar-secondary,
html[data-theme="dark"] .bd-main,
html[data-theme="dark"] .bd-content,
html[data-theme="dark"] .bd-article,
html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .sidebar-header-items,
html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .sidebar-primary-items__start,
html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .sidebar-primary-items__end {
  color: var(--hi-text);
  background: var(--hi-surface);
}

html[data-theme="dark"] .bd-article code.literal,
html[data-theme="dark"] .bd-article code.docutils.literal,
html[data-theme="dark"] .bd-article :not(pre) > code,
html[data-theme="dark"] .bd-article .copybtn {
  /* 旧站 slate 实测：底 rgba(243,243,243,.1)、字色 rgba(213,216,226,.82) */
  color: rgba(213, 216, 226, 0.82);
  background: rgba(243, 243, 243, 0.1);
  border-color: rgba(213, 216, 226, 0.82);
}

/* 暗色 blockquote 对位旧站 slate：浅色块的反色（54% 白字 + 32% 白左边框） */
html[data-theme="dark"] .bd-article blockquote {
  /* 旧站 slate 实测：rgba(226,228,233,.56) + 左边框 rgba(226,228,233,.32) */
  color: rgba(226, 228, 233, 0.56);
  background: transparent;
  border-left: 4px solid rgba(226, 228, 233, 0.32);
}

/* 暗色表格对位线上 extra.css：表头半透明白底、边框 rgba(243,243,243,.15) */
/* 旧站 slate 内容按钮：.md-button 用 #E7434A 描边+字色、透明底；hover 提亮到
 * #EE696F；--primary 保持填充底，边框降为 rgba(231,67,74,.9) */
html[data-theme="dark"] .bd-article .md-button {
  border: 1px solid #E7434A !important;
  color: #E7434A !important;
  background-color: transparent !important;
}

html[data-theme="dark"] .bd-article .md-button:hover {
  border: 1px solid #EE696F !important;
  color: #EE696F !important;
  background-color: transparent !important;
}

html[data-theme="dark"] .bd-article .md-button--primary {
  color: rgba(255, 255, 255, 1) !important;
  border: 1px solid rgba(231, 67, 74, 0.9) !important;
}

html[data-theme="dark"] .bd-article .md-button--primary:hover {
  color: rgba(255, 255, 255, 1) !important;
  border: 1px solid rgba(238, 105, 111, 0.95) !important;
}

html[data-theme="dark"] .bd-article strong {
  /* 旧站 slate：加粗文字略淡于正文（正文纯白） */
  color: rgba(226, 228, 233, 0.82);
}

html[data-theme="dark"] .bd-article table th {
  background: rgba(243, 243, 243, 0.1);
}

html[data-theme="dark"] .bd-article table,
html[data-theme="dark"] .bd-article table th,
html[data-theme="dark"] .bd-article table td {
  border-color: rgba(243, 243, 243, 0.15);
}

html[data-theme="dark"] .bd-article table tbody tr:hover {
  background-color: rgba(243, 243, 243, 0.035);
}

html[data-theme="dark"] .bd-article .highlight pre,
html[data-theme="dark"] .bd-article pre.literal-block {
  /* 旧站 slate：底 rgba(243,243,243,.1)（token 已改）、字色 rgba(213,216,226,.82) */
  color: rgba(213, 216, 226, 0.82);
  background: var(--hi-code-bg);
}

html[data-theme="dark"] #pst-header .bd-navbar-elements > .nav-item > .nav-link,
html[data-theme="dark"] #pst-header .pst-navbar-icon,
html[data-theme="dark"] #pst-header .navbar-icon-links .nav-link {
  /* 旧站暗色头部图标取 --hi-gray（slate 下 #C9C9C9） */
  color: var(--hi-gray);
}

html[data-theme="dark"] #pst-header .search-button__button:hover,
html[data-theme="dark"] #pst-header .pst-navbar-icon:hover,
html[data-theme="dark"] #pst-header .navbar-icon-links .nav-link:hover {
  color: var(--hi-black);
  background: transparent;
}

/* 旧站 slate：返回旧版按钮换成暗色品牌红 */
html[data-theme="dark"] #pst-header .header-link-button {
  color: #E7434A !important;
  border-color: #E7434A !important;
}

html[data-theme="dark"] #pst-header .header-link-button:hover {
  color: #EE696F !important;
  border-color: #EE696F !important;
}

/* 旧站 slate：宽窄屏图标（深色 PNG）反相显示 */
html[data-theme="dark"] .navbar-item .wide-screen-toggle .wide-screen-icon {
  filter: invert(1);
}

html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav a,
html[data-theme="dark"] :is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc a {
  color: var(--hi-text-muted);
}

html[data-theme="dark"] #pst-header .bd-navbar-elements > .nav-item > .nav-link:hover,
html[data-theme="dark"] #pst-header .bd-navbar-elements > .nav-item.current > .nav-link,
html[data-theme="dark"] #pst-header .bd-navbar-elements > .nav-item.active > .nav-link {
  color: var(--hi-red);
  background: var(--hi-red-light);
}

/* 侧栏暗色对位旧站 slate 段：
 *   左树  常规 #ffffff、hover #E7434A、当前页 #EE696F（祖先保持常规色）
 *   右目录 常规 #C9C9C9、hover/当前节 #ffffff
 * 并清掉 PyData 给 .current>a / TOC 激活项的 3px inset 左边条与任何底色。 */
html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav a {
  color: #ffffff;
}

html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav a:hover {
  /* 旧站 slate：hover / 当前项都是 #EE696F */
  color: #EE696F;
  background: transparent;
}

html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.current > a:not(.current):hover,
html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.active > a:not(.current):hover {
  color: #EE696F;
  background: transparent;
}

html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.current > a:not(.current),
html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav li.active > a:not(.current) {
  color: #ffffff;
  background: transparent;
  font-weight: 400;
}

html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav a.current,
html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav a.current:hover {
  color: #EE696F;
  background: transparent;
  font-weight: 500;
}

html[data-theme="dark"] :is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc a {
  color: #C9C9C9;
}

html[data-theme="dark"] :is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc a:hover,
html[data-theme="dark"] :is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc a.active,
html[data-theme="dark"] :is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc a[aria-current="true"] {
  color: #ffffff;
  background: transparent;
}

/* 主题给当前项画的 3px inset 指示条（取 --pst-color-primary）在旧站没有，
 * 左树（bd-sidenav）仍按旧站清掉；右目录树（page-toc）也进行隐藏 保留指示条
 TOC 的 aria-current 变体优先级较高，用 !important 兜底。 */
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .bd-sidenav a {
  box-shadow: none !important;
}

:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc a {
  box-shadow: none !important;
}

/* 右侧页内目录选中项：添加提示竖线 指示条*/
/* :is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc a.active,
:is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .page-toc a[aria-current="true"] {
  box-shadow: inset max(3px, 0.1875rem, 0.12em) 0 0 currentColor !important;
} */

html[data-theme="dark"] .bd-article a {
  /* 旧站 slate 段源码：.md-typeset a = --hi-red(#EE696F)，hover = --hi-red-hover(#E7434A) */
  color: var(--hi-red);
}

html[data-theme="dark"] .bd-article a:hover,
html[data-theme="dark"] .bd-article a:focus {
  color: var(--hi-red-hover);
}

/* Responsive layout */
@media (max-width: 1199.98px) {

  :root {
    --sidebar-current-width: 14rem;
  }

  #pst-secondary-sidebar.bd-sidebar-secondary {
    width: 11rem;
    min-width: 11rem;
  }

  .bd-article-container {
    padding: 0 20px;
  }
}

@media (max-width: 991.98px) {
  #pst-header.bd-header,
  #pst-header .bd-header__inner,
  #pst-header .bd-navbar-elements {
    height: 56px;
    min-height: 56px;
  }

  #pst-header .bd-navbar-elements > .nav-item > .nav-link {
    height: 46px;
  }

  #pst-header .logo__image {
    width: 124px;
  }

  /* ---------- 移动端左树抽屉（#pst-primary-sidebar-modal）----------
   * PyData 把抽屉做成 showModal() 的全屏 <dialog>：top:0、height:100%，
   * 于是展开时整块压在页头上，汉堡按钮被盖住、点不回去关。
   * 旧站移动端抽屉是顶在页头下方的，这里对齐：top 让出页头高度
   * （本断点页头 56px），高度取剩余视口。 */
  #pst-primary-sidebar-modal[open],
  #pst-secondary-sidebar-modal[open] {
    top: 56px;
    bottom: 0;
    height: auto;
    max-height: calc(100vh - 56px);
  }


  #pst-secondary-sidebar.bd-sidebar-secondary {
    width: auto;
    min-width: 0;
    padding-left: 0;
    border-top: 1px solid var(--hi-border);
  }

  :is(#pst-secondary-sidebar, #pst-secondary-sidebar-modal) .sidebar-secondary__inner {
    position: static;
    max-height: none;
  }

  .bd-article-container {
    padding: 0 16px;
  }
}

/* 抽屉里的"收起侧栏"控件一律隐藏（不限断点）：它是常驻侧栏的控件，
 * PyData 打开抽屉时会把侧栏内容整体搬进 <dialog>，控件跟着进去；但抽屉里
 * 没有"收起"这回事，而且它的图标是给桌面 12×48 竖条准备的，在抽屉里会显示
 * 成一条莫名其妙的细棒。桌面常驻侧栏上的那个照常保留（JS 已把它移到 body）。 */
#pst-primary-sidebar-modal .pst-sidebar-collapse {
  display: none;
}

/* 992–1219px 的右栏抽屉：该区间页头是 50px（56px 那条只在 ≤991.98px），
 * 抽屉同样要让出页头。写成独立媒体查询是为了不与 ≤1220 断点里的
 * backdrop 规则抢同一条 top。 */
@media (min-width: 992px) and (max-width: 1219.98px) {
  #pst-secondary-sidebar-modal[open] {
    top: 50px;
    bottom: 0;
    height: auto;
    max-height: calc(100vh - 50px);
  }
}

/* Keep PyData's theme switcher usable even when Bootstrap dropdown is not
 * toggled by the host browser.  The actual mode change still uses PyData's
 * native .theme-change-button handlers. */
#pst-header .theme-switch-container {
  position: relative;
}

/* 主题切换菜单只由点击（Bootstrap dropdown）展开：
 * 旧站调色板是"点一下切换"、根本没有悬停展开的菜单；此前这里用 :hover 强制
 * display:block 与 Bootstrap 的点击展开同时生效，鼠标划过时菜单被两套逻辑
 * 反复开合，表现为闪烁。移除悬停展开即可（菜单仍可用键盘 focus + 点击打开）。 */
#pst-header .theme-switch-container > .dropdown-menu {
  margin-top: 0;
  z-index: 1100;
}

#pst-header .theme-switch-container .dropdown-menu {
  color: var(--hi-text);
  background: var(--hi-surface-raised);
  border: 1px solid var(--hi-border-strong);
  border-radius: 8px;
  box-shadow: var(--hi-shadow-raised);
}

#pst-header .theme-switch-container .dropdown-item {
  color: var(--hi-text-muted);
  font-size: 14px;
}

#pst-header .theme-switch-container .dropdown-item:hover,
#pst-header .theme-switch-container .dropdown-item:focus,
#pst-header .theme-switch-container .dropdown-item.active {
  color: var(--hi-red);
  background: var(--hi-red-light);
}

/* PyData-compatible image preview and in-page find */
.hi-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 旧站 .image-lightbox 实测遮罩 rgba(0,0,0,.85) */
  background: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
}

.hi-lightbox__image {
  /* 旧站 .image-lightbox img：90vw/90vh，无圆角、无阴影 */
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  cursor: grab;
  transition: transform 80ms ease-out;
  user-select: none;
}

.hi-lightbox__image.is-dragging {
  cursor: grabbing;
  transition: none;
}

.hi-lightbox__close {
  position: fixed;
  /* 旧站 .image-lightbox-close：top/right 20px、40×40、白 20% 圆底、
   * 无边框、24px 图标、hover 提亮到 30%（不是变红）。
   * 图标改用内联 SVG（原 "×" 字形在字体盒里天然偏下，flex 居中也压不正，
   * 详见 pydata-interactions.js 的说明），所以这里没有 font-size/line-height。 */
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.hi-lightbox__close svg {
  /* 20px 视框下的叉形墨迹约 12px，与旧站 24px 字号的 "×" 视觉等大 */
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.hi-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.hi-inpage-find {

  position: fixed;
  top: 54px;
  left: calc(var(--sidebar-current-width, 16.625rem) + 28px);
  right: auto;
  z-index: 18;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--hi-black);
  background: var(--hi-white);
  border: 1px solid var(--hi-border);
  border-radius: 6px;
  box-shadow: var(--hi-card-shadow, 0 1px 6px rgba(0, 0, 0, 0.06));
  font-size: 14px;
}

body.inpage-find-active {
  scroll-padding-top: 120px;
}

.hi-inpage-find__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--hi-gray);
}

.hi-inpage-find__icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.hi-inpage-find__input {
  /* 对位旧站 .inpage-find__input：灰底、2px 透明边框、2px 圆角、max-width 480px */
  flex: 1 1 auto;
  min-width: 120px;
  max-width: 480px;
  height: 32px;
  padding: 0 12px;
  color: var(--hi-black);
  background: var(--hi-bg);
  border: 2px solid transparent;
  border-radius: 2px;
  outline: none;
  font-size: 14px;
  transition: all 0.2s;
}

.hi-inpage-find__input:hover {
  background: var(--hi-border);
}

.hi-inpage-find__input:focus {
  background: var(--hi-white);
  border-color: var(--hi-red);
}

.hi-inpage-find__count {
  /* 对位旧站 .inpage-find__count：min-width 56px、13px、#666 */
  flex: 0 0 auto;
  min-width: 56px;
  color: var(--hi-gray);
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
}

.hi-inpage-find__sep {
  /* 对位旧站 .inpage-find__sep：1×20 竖分隔线 */
  flex: 0 0 auto;
  width: 1px;
  height: 20px;
  margin: 0 2px;
  background: var(--hi-border);
}

.hi-inpage-find button {
  /* 对位旧站 .inpage-find__btn：无底色无边框的图标按钮，hover 变红 */
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  color: var(--hi-gray);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
}

.hi-inpage-find button svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.hi-inpage-find button:hover:not(:disabled) {
  color: var(--hi-red);
}

.hi-inpage-find button:active:not(:disabled) {
  color: var(--hi-red-hover);
}

.hi-inpage-find button:disabled {
  color: var(--hi-gray-light);
  cursor: not-allowed;
  opacity: 0.5;
}

.hi-inpage-find__btn--close {
  margin-left: 4px;
}

/* 命中高亮对位旧站：底色沿用 Material 的默认高亮色 #ffff0080（旧站未改写），
 * 只有"当前命中项"加一圈品牌红描边用于定位，不改变底色。 */
.hi-find-mark {
  color: inherit;
  background: #ffff0080;
}

.hi-find-mark.is-active {
  outline: 2px solid var(--hi-red);
  outline-offset: 1px;
  border-radius: 2px;
}

/* 移动端：只保留旧站移动端真正改过的东西（字号、圆角、表格宽度旧站都不改），
 * 断点与旧站一致用 600px。 */
@media (max-width: 600px) {
  .bd-article-container,
  .bd-article {
    padding-right: 20px;
    padding-left: 20px;
  }

  /* 旧站 .inpage-find 移动端：gap 4px、内边距 6px 8px、输入框不限宽、计数 44px/12px、
   * 放大镜图标隐藏 */
  .hi-inpage-find {
    gap: 4px;
    padding: 6px 8px;
  }

  .hi-inpage-find__input {
    max-width: none;
  }

  .hi-inpage-find__count {
    min-width: 44px;
    font-size: 12px;
  }

  .hi-inpage-find__icon {
    display: none;
  }

  .disclaimer-overlay {
    padding: 16px;
  }
}

@media (max-width: 942px){
  .bd-sidebar-primary .sidebar-primary-items__start {
    border-top: none !important;
  }
  .bd-sidebar-primary .sidebar-primary-items__start .sidebar-primary-item{
    padding: 0px 16px 0px 0px !important;
  }

  .bd-sidebar-primary {
    padding: 0px !important;
  }


  #pst-header .navbar-header-items__start {
    display: none;
  }

  .pst-sidebar-collapse,
  #pst-primary-sidebar-modal .pst-sidebar-collapse {
    display: none !important;
  }
}

/* ---------- 窄布局（≤1220px，对位旧站 @media max-width: 76.234375em） ----------
 * 旧站这个断点同时承担三件事：页脚改纵排、回顶/反馈按钮缩小并重新贴边、
 * 页头搜索图标接管搜索入口（侧栏"全文检索"隐藏）。宽度阈值用 px 写死，
 * 与旧站 em 断点（76.234375em × 16px 初始字号 = 1219.75px）等价——
 * 媒体查询的 em 只认初始字号，与 html 自身 font-size 无关。 */
@media (max-width: 1219.98px) {
  /* 页脚：链接列由横排改为纵排居中，字号与行高同步降一档
   * （旧站实测 1100/544 两档：list pad 30px 20px + nav-first 14px；
   * fix 行高 2.5→30px；fix-content 纵排、pad 12px 20px、行高 21.6px） */
  .bd-footer {
    font-size: 12px;
  }

  .footer-list {
    flex-direction: column;
    width: 100%;
    padding: 30px 20px;
  }

  .footer-list-child {
    margin-right: 0;
    margin-bottom: 30px;
  }

  .footer-nav-first {
    font-size: 14px;
  }

  .footer-fix {
    height: auto;
    line-height: 2.5;
    font-size: 12px;
  }

  .footer-fix-content {
    width: 100%;
    padding: 12px 20px;
    flex-direction: column;
    line-height: 1.8;
  }

  .footer-fix > div:first-child {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .footer-fix > div:first-child a {
    margin: 0 4px;
  }

  .footer-name {
    margin-left: 12px;
    font-size: 11px;
  }

  .footer-name:first-child {
    margin-left: 0;
  }

  .footer-copyright {
    text-align: center;
    white-space: nowrap;
  }

  .footer-name-list {
    margin-top: 12px;
  }

  /* 页头入口交接：侧栏"全文检索"让位给页头搜索图标（见上方 1219.98px 规则）。
   * 旧站这个断点下 .sidebar-search 整体 display:none。 */
  :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .hi-sidebar-search {
    display: none !important;
  }

  /* 交接的另一半：页头图标在这一段显示（templates/navbar-search.html，
   * 同一断点下旧站是 .md-header__button--search 接管搜索入口） */
  .navbar-item:has(.hi-header-search) {
    display: flex;
  }

  /* 页头按钮只留在页头：PyData 会把 navbar_end 的模板在侧栏里再渲染一遍
   * （.sidebar-header-items），窄布局下抽屉里就出现第二套"返回旧版/主题/
   * 下载/GitCode/宽窄屏"。旧站窄布局没有这套副本，这里一并隐藏；
   * 相应地页头那套必须在窄布局可见（见下面的恢复规则）。 */
  :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .sidebar-header-items {
    display: none;
  }

  /* 关掉两侧抽屉的遮罩：旧站移动端抽屉展开时背景不变暗，只靠抽屉自身白底
   * 区分层级（PyData 默认给 <dialog> 叠了一层 rgba(0,0,0,.5) 的 ::backdrop）。
   * 右侧页内目录抽屉在 992–1219px 也能打开，所以这条写在 1220 断点里。 */
  #pst-primary-sidebar-modal::backdrop,
  #pst-secondary-sidebar-modal::backdrop {
    background: transparent;
    opacity: 1;
  }

  /* 992–1219px 页头是 50px，右栏抽屉的让位高度写在该断点之后的独立媒体
   * 查询里（见文件下方），避免同一元素两条 top 规则按源序打架。 */

  /* PyData 在 <960px 把 .navbar-header-items 整块 display:none（只留汉堡 +
   * logo + 搜索图标），操作项就被挪进抽屉了。旧站窄布局实测头部仍然保留
   * 返回旧版 / 搜索图标 / 主题 / GitCode（544 与 1100 两档都是），故恢复。 */
  #pst-header .bd-header__inner .navbar-header-items {
    display: flex;
    /* basis 0 + grow 1：吃掉 logo 之后的全部剩余宽度。
     * 主题只在 ≥960px 给 flex-grow，且 <992px 时 Bootstrap 的 col-lg-9
     * 不生效（容器只有内容宽），900px 一带操作组会紧贴 logo、与右侧的
     * 右栏切换按钮之间空出一大截；这里改成撑满 + 右对齐，各断点表现一致。 */
    flex: 1 1 0;
    justify-content: flex-end;
    min-width: 0;
  }

  #pst-header .navbar-header-items__end {
    column-gap: 16px;
  }

  /* 窄布局下页头操作项不参与收缩：旧站 544/1100 实测"返回旧版"都是固定
   * 90×32 单行，不会折成"返回/旧版"两行；空间不足时让 logo 先缩。 */
  #pst-header .navbar-header-items__end > .navbar-item {
    flex-shrink: 0;
  }

  #pst-header .header-link-button {
    white-space: nowrap;
  }

  #pst-header .logo__image {
    max-width: 100%;
  }

  /* 页头搜索在窄布局收成纯图标（旧站实测 24×24、无文字与 Ctrl+K 提示）。
   * 两条渲染路径都要管：≥960px 走 __end 里的 .navbar-persistent--container，
   * <960px 走独立的 .navbar-persistent--mobile。 */
  #pst-header .navbar-persistent--container {
    display: flex;
  }

  #pst-header .navbar-persistent--mobile {
    display: none !important;
  }

  #pst-header .search-button__default-text,
  #pst-header .search-button__kbd-shortcut {
    display: none;
  }

  #pst-header .search-button__button {
    background: transparent;
    border: none;
    padding: 0px !important;
  }

  #pst-header .search-button__button > i,
  #pst-header .search-button__button > svg,
  #pst-header .search-button__button .svg-inline--fa {
    width: 24px;
    height: 24px;
    font-size: 24px;
  }

  #pst-header .hi-header-search,
  #pst-header .hi-header-search > svg {
    width: 24px;
    height: 24px;
    font-size: 24px;
  }

  /* 窄布局页头图标统一 24px、控件间距统一 16px（旧站移动端头部实测
   * 搜索图标 24×24；桌面端那套 20px 图标在触屏上偏小）。 */
  #pst-header .theme-switch-button,
  #pst-header .theme-switch-button .svg-inline--fa,
  #pst-header .theme-switch-button .theme-switch {
    width: 24px;
    height: 24px;
  }

  #pst-header .header-download-icon {
    width: 24px;
    height: 24px;
    background-size: 24px 24px;
  }

  #pst-header .navbar-icon-links .nav-link img,
  #pst-header .navbar-icon-links .nav-link svg {
    width: 24px;
    height: 24px;
  }

  #pst-header .navbar-icon-links .nav-link {
    height: 24px;
    font-size: 24px;
  }

  #pst-header .primary-toggle > .svg-inline--fa,
  #pst-header .primary-toggle > span,
  #pst-header .secondary-toggle > .svg-inline--fa,
  #pst-header .secondary-toggle > span {
    width: 24px;
    height: 24px;
    font-size: 24px;
    line-height: 24px;
  }

  /* 间距只有 16px：__end 内部靠 column-gap，汉堡与右栏切换靠自身外边距，
   * 两者统一到 16px，且不再额外叠加。 */
  #pst-header .primary-toggle,
  #pst-header .secondary-toggle {
    width: 24px;
    height: 24px;
    min-width: 0;
    padding: 0;
  }

  #pst-header .secondary-toggle {
    margin-right: 0;
  }

  /* 宽窄屏切换在窄布局无意义（旧站 ≤1220px 实测 .wide-screen-toggle
   * display:none）。注意要连外层 .navbar-item 一起隐藏：只藏按钮的话，
   * 那个空壳仍是 __end 的 flex 子项，会多吃掉一个 16px 的 column-gap，
   * 右栏切换按钮与 GitCode 图标之间就变成 32px。 */
  #pst-header .wide-screen-toggle,
  .navbar-item .wide-screen-toggle,
  #pst-header .navbar-header-items__end > .navbar-item:has(.wide-screen-toggle) {
    display: none !important;
  }
}

/* 回顶/反馈按钮的窄布局规格写在 .feedback-fab 基类之后（见文件下方
 * "意见反馈悬浮按钮" 段），否则同特异度下基类因为更靠后而反超。 */

/* ==========================================================================
 * 项目/版本下拉框（迁移自 overrides/static/css/version-selector.css，
 * 作用域限定左侧栏；暗色段由 [data-md-color-scheme="slate"] 转换为
 * PyData 的 html[data-theme="dark"]）
 * ========================================================================== */
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .sidebar-selectors {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  /* 对位旧站 .sidebar-selectors 实测内边距 13.2px、间距 8px、底部 1px 分隔线；
   * 全文检索按钮作为该组的第三个子项，左对齐（宽度贴合内容） */
  padding: 13.2px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--hi-border);
  /* 滚动左侧树时钉在侧栏顶部 */
  position: sticky;
  top: 0;
  background: var(--hi-surface);
  z-index: 2;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .custom-select {
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 22px;
  width: 100%;
  height: 30px;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(201, 201, 201, 1);
  border-radius: 0.25rem;
  background-color: rgba(255, 255, 255, 1);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .select-label {
  color: rgba(174, 174, 174, 1);
  font-family: "HarmonyOS Sans SC 2025";
  font-style: normal;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  letter-spacing: 0px;
  white-space: nowrap;
  pointer-events: none;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .repo-selector,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .version-selector {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(25, 25, 25, 1);
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

/* 下拉箭头 */
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .custom-select::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid rgba(153, 153, 153, 1);
  transition: transform 0.2s;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .custom-select.active::after {
  transform: translateY(-50%) rotate(180deg);
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .repo-readOnly,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .version-readOnly {
  color: rgba(25, 25, 25, 1);
  font-family: var(--hi-font);
  font-style: normal;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  letter-spacing: 0px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  padding-right: 4px;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .select-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  list-style: none;
  padding: 4px 0;
  background: rgba(255, 255, 255, 1);
  border: 1px solid rgba(201, 201, 201, 1);
  border-radius: 0.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  cursor: not-allowed;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .select-options .opTitle {
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
  color: rgba(201, 201, 201, 1);
  border-bottom: 1px solid rgba(201, 201, 201, 1);
  pointer-events: none;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .select-options .option {
  padding: 4px 8px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  color: #191919;
  transition: background-color 0.15s, color 0.15s;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .select-options .option:hover {
  background-color: rgba(25, 25, 25, 0.05);
  color: #191919;
}

/* 暗色模式 */
html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .custom-select {
  border-color: rgba(243, 243, 243, 0.15);
  background-color: var(--hi-surface);
}

html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .select-options {
  background: var(--hi-surface);
  border-color: rgba(243, 243, 243, 0.15);
}

html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .select-options .option:hover {
  background-color: rgba(245, 245, 245, 0.05);
}

html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .repo-readOnly,
html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .version-readOnly {
  color: #ffffff;
}

html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .select-label {
  color: #939393;
}

html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .custom-select::after {
  border-top-color: #939393;
}

html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .select-options .option {
  color: #c9c9c9;
}

html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .select-options .option:hover {
  color: #ffffff;
}

html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .select-options .opTitle {
  color: #939393;
  border-bottom-color: var(--hi-border);
}

html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .sidebar-selectors {
  border-bottom-color: var(--hi-border);
}

/* ---------- 全文检索入口（对位旧站 .sidebar-search__button） ----------
 * 旧站实测：红描边空心按钮，高度 30px、内边距 9px 14px 9px 10px、圆角 0.25rem、
 * 文字与图标均为品牌红、图标 20×20、宽度贴合内容（fit-content），位于
 * 「项目 / 版本」下拉下方的同一组（.sidebar-selectors）内。 */
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .hi-sidebar-search,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .search-button__button {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  /* 旧站 .sidebar-search__button 实测 gap 2px；宽度贴合内容，但侧栏被拖到
   * 最小宽度（7rem）时不得撑破侧栏——上限取 min(100%, fit-content)，
   * 文字由 .hi-sidebar-search__label 省略号收住（与线上站同款处理） */
  gap: 2px;
  width: auto;
  /* 注意不能用 min(100%, fit-content)——min() 不接受 fit-content 关键字，
   * 整条会被判无效而忽略，按钮就撑出侧栏；用 100% 即可（宽屏下不影响）。 */
  max-width: 100%;
  height: 30px;
  flex-shrink: 0;
  margin: 0;
  padding: 9px 14px 9px 10px;
  color: var(--hi-red);
  background: transparent;
  border: 1px solid var(--hi-red);
  border-radius: 0.25rem;
  font-family: "HarmonyOS Sans SC 2025", "HarmonyOS Sans SC",
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.hi-sidebar-search__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .hi-sidebar-search:hover,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .search-button__button:hover {
  color: rgba(224, 33, 40, 1);
  border-color: rgba(224, 33, 40, 1);
  background: transparent;
}

:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .hi-sidebar-search:focus-visible {
  outline: 2px solid var(--hi-red);
  outline-offset: 2px;
}

/* 图标 20×20 红色（旧站 .sidebar-search__button svg { width/height: 20px; fill: #C7000B }） */
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .hi-sidebar-search svg,
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .hi-sidebar-search .svg-inline--fa {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--hi-red);
}

/* 对位旧站 .sidebar-search__button span：文字超宽时省略号，不换行不溢出 */
:is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .hi-sidebar-search__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* 搜索入口的"交接"发生在 1220px（对位旧站 76.234375em 断点）：
 * 宽布局只在左侧给"全文检索"、页头不放搜索图标；窄布局反过来——页头出现
 * 搜索图标后，左侧那个入口就多余了，直接隐藏（旧站 ≤1220px 实测
 * .sidebar-search 为 display:none、.md-header__button--search 为 flex）。 */
@media (min-width: 1219.98px) {
  #pst-header .navbar-header-items__end .navbar-persistent--container {
    display: none;
  }
}

html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .hi-sidebar-search,
html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .search-button__button {
  color: #E7434A;
  border-color: #E7434A;
  background: transparent;
}

html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .hi-sidebar-search svg,
html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .hi-sidebar-search .svg-inline--fa {
  color: #E7434A;
}

html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .hi-sidebar-search:hover,
html[data-theme="dark"] :is(#pst-primary-sidebar, #pst-primary-sidebar-modal) .search-button__button:hover {
  color: #EE696F;
  border-color: #EE696F;
}

/* ---------- 搜索弹窗（在主体内容区正中展示） ----------
 * 用户反馈：全文检索的弹框太宽了（在主体内容中间就可），且此前没有居中。
 * 居中不能用纯 CSS 推导：主体内容列的右边界取决于「右侧页内目录是否存在」
 * 以及左侧栏被拖拽后的实际宽度，只有运行时量得到。因此由
 * pydata-interactions.js 在弹窗 open 时把内容列中心的视口坐标写进
 * --hi-search-center；此处只做 calc，缺值时退回视口居中。
 * （left 的百分比对 fixed 元素解析为不含滚动条的视口宽，正好是视觉中心。） */
#pst-search-dialog[open] {
  position: fixed;
  top: 54px;
  left: calc(var(--hi-search-center, 50%) - var(--hi-search-width, 50%) / 2);
  right: auto;
  margin: 0;
  width: var(--hi-search-width,50%);
  max-width: calc(100% - 32px);
  max-height: 80vh;
  padding: 2.2px 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* 平板/移动端搜索改为通栏居中 */
@media (max-width: 1219.98px) {
  #pst-search-dialog[open] {
    top: 54px;
    left: 16px;
    right: 16px;
    margin: 0 auto;
    width: auto;
    max-width: calc(100vw - 32px);
  }
}

/* 旧站打开搜索时背景不变暗（无遮罩） */
#pst-search-dialog[open]::backdrop {
  background: transparent;
  opacity: 0;
}

.bd-search {
  border-radius: 8px;
}

#pst-search-dialog[open] form.bd-search {
  display: flex;
  align-items: center;
  height: 40px;
  /* 主题给表单 min-height: 48px，会撑高到 48px（旧站为 40px 输入行） */
  min-height: 40px;
  padding: 0 12px;
  color: var(--hi-black);
  background: var(--hi-surface);
  /* 旧站是 border:1px solid transparent + 柔和光晕阴影；纯白页面上加一条极淡
   * 描边更"立得住"（视觉上仍与旧站一致，只是边缘更清晰） */
  border: 1px solid rgba(25, 25, 25, 0.08);
  border-radius: 8px;
  box-shadow: 0 0 13.2px rgba(0, 0, 0, 0.07);
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* 聚焦时给一圈柔和的品牌红光圈，比旧站的"无任何反馈"更精致 */
form.bd-search:focus-within,.search-button-field:hover {
  box-shadow: none;
  border-color: rgba(199, 0, 11, 0.35);
}

/* 搜索框前的放大镜：旧站是 20×20 的灰色细线图标；FontAwesome 的 SVG 默认
 * 按 1em 撑成 28×24 且继承近黑色，显得又大又重，这里钉死尺寸与颜色 */
#pst-search-dialog[open] form.bd-search > svg,
#pst-search-dialog[open] form.bd-search > i {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: var(--hi-gray);
}

html[data-theme="dark"] #pst-search-dialog[open] form.bd-search > svg,
html[data-theme="dark"] #pst-search-dialog[open] form.bd-search > i {
  /* 旧站 slate：搜索框前的放大镜 rgba(255,255,255,.54) */
  color: #ffffff8a;
}

#pst-search-dialog[open] form.bd-search input {
  height: 40px;
  /* 线上站输入框左右各留 48.4px：左侧放放大镜、右侧放检索图标，
   * 文字（含占位符）从 x≈338 起。这里放大镜已是独立 flex 项，故清掉左内边距，
   * 让文字起点与线上对齐（旧站实测文字起点 338）。 */
  padding: 0 0 0 12px;
  color: var(--hi-black);
  background: transparent;
  border: none;
  border-radius: 1px;
  font-family: "HarmonyOS Sans SC 2025", "HarmonyOS Sans SC",
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 40px;
}

/* 旧站末端那个放大镜其实是 Material 的"点击搜索"按钮；新框架回车即提交、
 * 没有对应控件，留一个不能点的图标反而像残留，故移除。 */
#pst-search-dialog[open] form.bd-search::after {
  content: none;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-left: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999999' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.6-3.6'/%3E%3C/svg%3E")
    no-repeat center / 20px 20px;
}

#pst-search-dialog[open] form.bd-search input::placeholder {
  color: var(--hi-gray-light, #999999);
}

/* 主题的紫罗兰聚焦环（--pst-color-accent）在旧站不存在，改回品牌红细描边 */
#pst-search-dialog[open] form.bd-search input:focus {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  outline: none;
}

#pst-search-dialog[open] form.bd-search .btn-close {
  display: none;
}

html[data-theme="dark"] #pst-search-dialog[open] form.bd-search {
  /* 旧站 slate 实测：弹窗黑底、圆角 6px 6px 2.2px 2.2px、无阴影；
   * 输入框是浅灰半透明条 rgba(243,243,243,.1)，与亮色的白底不同 */
  background: var(--hi-surface);
  border-radius: 6px 6px 2.2px 2.2px;
  box-shadow: none;
}

html[data-theme="dark"] #pst-search-dialog[open] form.bd-search input {
  color: #ffffff;
  background: rgba(243, 243, 243, 0.1);
}

/* ---------- 搜索结果页（search.html） ----------
 * 主题只给 .bd-search-container 一个裸容器：标题用 42px 的 h1、表单拉满
 * 内容宽度、input 自带圆框嵌在带边框的表单里（"框里套框"），结果列表还是
 * 浏览器默认的 ul 缩进 + 无卡片样式。这里沿用弹窗那套视觉语言（40px 高、
 * 8px 圆角、淡描边 + 品牌红聚焦环、结果卡片化），但**宽度取满内容列**——
 * 搜索页是独立整页，结果条目多、上下文长，收成弹窗那么窄会既"没满屏"
 * 又让长上下文贴边。弹窗本身仍是 560px 居中（--hi-search-width）。 */
.bd-search-container {
  max-width: 100%;
}

.bd-search-container > h1 {
  /* 搜索页不是正文页，42px 的章标题过重；对位旧站搜索结果的标题层级 */
  margin: 0 0 16px;
  font-size: 28px;
  line-height: 1.3;
}

.bd-search-container form.bd-search {
  display: flex;
  align-items: center;
  height: 40px;
  min-height: 40px;
  width: 100%;
  padding: 0 12px;
  color: var(--hi-black);
  background: var(--hi-surface);
  border: 1px solid rgba(25, 25, 25, 0.08);
  border-radius: 8px;
  box-shadow: 0 0 13.2px rgba(0, 0, 0, 0.07);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.bd-search-container form.bd-search > svg,
.bd-search-container form.bd-search > i {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: var(--hi-gray);
}

.bd-search-container form.bd-search input {
  height: 40px;
  padding: 0 8px;
  color: var(--hi-black);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 16px;
}

.bd-search-container form.bd-search input:focus {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  outline: none;
}

.bd-search-container form.bd-search input::placeholder {
  color: var(--hi-gray-light, #999999);
}

/* 搜索页是独立整页，Ctrl+K 提示没有意义（焦点本就在输入框里） */
.bd-search-container form.bd-search .search-button__kbd-shortcut {
  display: none;
}

/* --- 结果列表 --- */
#search-results h2 {
  margin: 24px 0 12px;
  font-size: 20px;
  font-weight: 600;
}

#search-results p.search-summary {
  margin: 0 0 12px;
  color: var(--hi-gray);
  font-size: 14px;
}

#search-results ul.search {
  margin: 0;
  padding: 0;
  list-style: none;
}

#search-results ul.search > li {
  margin: 0 0 12px;
  padding: 16px;
  background: var(--hi-surface);
  border: 1px solid rgba(25, 25, 25, 0.08);
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#search-results ul.search > li:hover {
  border-color: rgba(25, 25, 25, 0.16);
  box-shadow: var(--hi-card-hover-shadow);
}

#search-results ul.search > li > a {
  display: block;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--hi-black);
  text-decoration: none;
}

#search-results ul.search > li > a:hover {
  color: var(--hi-red);
}

#search-results ul.search > li > a .context,
#search-results ul.search > li > a span {
  display: block;
  margin-top: 6px;
  color: var(--hi-gray);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  /* Sphinx 的命中片段是从正文里切出来的裸文本，常带长路径 / 长标识符
   * （include/middleware/utils/at.h、CONFIG_ENABLE_BT_SAMPLE=y 之类），
   * 没有任何断行机会时会顶破卡片右边界。卡片是定宽+内边距的，这里允许
   * 任意位置断行，保证内容始终留在框内。 */
  overflow-wrap: anywhere;
  word-break: break-word;
}

#search-results ul.search > li > a .context {
  /* 命中片段里的高亮关键词（Sphinx 用 <span class="highlighted">/em 包出来） */
  color: var(--hi-text);
}

#search-results ul.search > li > a .context .highlighted,
#search-results ul.search > li > a .context em {
  color: var(--hi-red);
  font-style: normal;
  font-weight: 500;
}

/* 结果列表与输入条同栏宽（都取满内容列），保证"搜索框—结果"左右对齐 */
#search-results ul.search {
  max-width: 100%;
}

html[data-theme="dark"] .bd-search-container form.bd-search,
html[data-theme="dark"] #search-results ul.search > li {
  background: var(--hi-surface);
  border-color: rgba(243, 243, 243, 0.15);
}

html[data-theme="dark"] .bd-search-container form.bd-search input,
html[data-theme="dark"] #search-results ul.search > li > a {
  color: #ffffff;
}

/* ==========================================================================
 * 旧站交互迁移（overrides extra.css / custom.js 中与主题无关的部分）
 *  1. 视口比例缩放变量（--flex-pc-px）与页脚基准宽 --main-warp
 *  2. 宽窄屏切换（body.wide/narrow-screen + --grid-max-width）
 *  3. 左侧栏拖拽宽度（--sidebar-drag-width + .sidebar-drag-handle）
 *  4. 内容区右缘拖拽热区（.bd-article-container::after + body.grid-dragging）
 *  5. 意见反馈悬浮按钮（.feedback-fab）
 *  6. 内容侧自有类（.md-button / hero / section-nav-card / quick-start）
 * ========================================================================== */

/* ---------- 1. 视口比例缩放（原样保留旧站断点） ---------- */
:root {
  --flex-pc-px: 1px;
  --main-warp: 1400px;
  /* 补齐旧站使用但本文件此前缺失的 token */
  --hi-red-lighter: rgba(199, 0, 11, 0.04);
  --hi-header-bg: #ffffff;
  --hi-card-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  --hi-card-hover-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  /* 宽窄屏与侧栏拖拽的驱动变量（值由 head 防闪脚本 / pydata-interactions.js 写入） */
  --grid-max-width: 100%;
  /* 线上站左侧栏实测宽 266px（Material 根字号 20px 下的 13.3rem） */
  --sidebar-default-width: 16.625rem;
  --sidebar-drag-width: var(--sidebar-default-width);
  --sidebar-max-width: var(--sidebar-default-width);
  /* 右侧目录列宽：线上站在 1600px 视口实测 242px（窄屏时页头右边界同源引用） */
  --hi-toc-width: 15.125rem;
}

@media screen and (min-width: 2400px) {
  :root { --flex-pc-px: 1.25px; }
}

@media screen and (min-width: 1920px) and (max-width: 2399px) {
  :root { --flex-pc-px: 1px; }
}

@media screen and (min-width: 1746px) and (max-width: 1919px) {
  :root { --flex-pc-px: 0.909091px; }
}

@media screen and (min-width: 1536px) and (max-width: 1745px) {
  :root { --flex-pc-px: 0.8px; }
}

@media screen and (min-width: 1280px) and (max-width: 1535px) {
  :root { --flex-pc-px: 0.66666px; }
}

@media screen and (max-width: 1279px) {
  :root { --flex-pc-px: 0.5625px; }
}

/* ---------- 2. 宽窄屏切换 ----------
 * 宽屏 = 现行全宽布局（侧栏贴边）；窄屏 = 只收窄正文阅读列并居中
 * （规则见上文 .bd-article-container 处），页面容器与侧栏位置不变。
 * 首帧（JS 未跑时）由 html.prefer-narrow 提前命中，避免闪烁。 */

/* ---------- 3. 左侧栏拖拽 ---------- */
.sidebar-drag-handle {
  position: fixed;
  top: 50px;
  left: var(--sidebar-current-width, 16rem);
  width: 2px;
  height: calc(100vh - 50px);
  cursor: col-resize;
  background: transparent;
  transition: background 0.15s;
  z-index: 1070;
}

.sidebar-drag-handle:hover,
.sidebar-drag-handle.active {
  background: var(--hi-border);
}

/* 主题收起（pst-squeeze）时隐藏拖拽手柄 */
body:has(#pst-primary-sidebar.pst-squeeze) .sidebar-drag-handle {
  display: none;
}

/* 首帧防闪：head 内联脚本读到折叠记忆时先在 <html> 打标记，
 * DOMContentLoaded 后 pydata-interactions.js 换算成主题真实状态（仅桌面） */
@media (min-width: 960px) {
  html.hi-sidebar-collapsed #pst-primary-sidebar.bd-sidebar-primary {
    flex-basis: 4rem;
    width: 4rem;
    min-width: 4rem;
    overflow: hidden;
  }

  html.hi-sidebar-collapsed #pst-primary-sidebar.bd-sidebar-primary
    .sidebar-primary-item:not(.pst-sidebar-collapse) {
    opacity: 0;
    visibility: hidden;
  }
}

/* ---------- 移动/平板端（<960px）：拖拽/折叠/宽窄屏均为桌面功能，
 * 忽略桌面存下的状态（对位旧站 e8b1217） ---------- */
@media (max-width: 959.98px) {
  .sidebar-drag-handle {
    display: none !important;
  }

  /* 侧栏宽度回默认（忽略 --sidebar-drag-width 桌面拖拽值） */
  #pst-primary-sidebar.bd-sidebar-primary {
    flex-basis: auto;
    width: auto;
    min-width: 0;
  }

  html,
  body {
    overflow-x: clip;
  }
}

/* ---------- 4. 内容区右缘拖拽热区 ----------
 * 边框本身不可交互，用 ::after 透明热区覆盖右缘 8px；hover 微红提示。 */
.bd-article-container {
  position: relative;
}

/* 无右侧目录（首页/分区首页）时不提供拖动热区——拖动本就为调整正文与右目录的
 * 相对宽度，没有右目录则无意义（JS 侧也做了同样判断） */
body:has(#pst-secondary-sidebar) .bd-article-container::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  z-index: 5;
  transition: background-color 0.15s ease;
}

.bd-article-container::after:hover {
  background-color: var(--hi-red-lighter);
}

/* 移动端禁用拖拽热区 */
@media screen and (max-width: 76.2344em) {
  .bd-article-container::after {
    display: none;
  }
}

/* 拖动期间关闭相关元素的 transition，宽度实时跟随鼠标 */
body.grid-dragging .bd-article-container,
body.grid-dragging .bd-content,
body.grid-dragging .bd-main,
body.grid-dragging .bd-sidebar-primary,
body.grid-dragging .bd-container__inner.bd-page-width {
  transition: none !important;
}

/* ---------- 宽窄屏切换按钮（navbar 槽位） ---------- */
/* navbar_center 为空时主题的 __end 容器不撑满，图标组会挤在搜索框后；
 * 撑满后配合主题自带的 justify-content:end 右对齐（对齐旧站页头布局）。 */
@media (min-width: 960px) {
  .bd-header .navbar-header-items__end {
    flex-grow: 1;
  }
}

/* 对位旧站 .wide-screen-toggle：20×24、无内边距、hover 不变底色
 * （旧站只有 background-color .2s 过渡，没有任何 :hover 规则） */
.navbar-item .wide-screen-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.2s;
}

.navbar-item .wide-screen-toggle .wide-screen-icon {
  display: none;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* 当前宽屏时显示“切换窄屏”（close）图标，反之显示 open */
.navbar-item .wide-screen-toggle .wide-screen-close {
  display: block;
}

.navbar-item .wide-screen-toggle .wide-screen-open {
  display: none;
}

.navbar-item .wide-screen-toggle:not(.wide-screen-active) .wide-screen-open {
  display: block;
}

.navbar-item .wide-screen-toggle:not(.wide-screen-active) .wide-screen-close {
  display: none;
}

@media screen and (max-width: 959.98px) {
  .navbar-item .wide-screen-toggle {
    display: none !important;
  }
}

/* ---------- 5. 意见反馈悬浮按钮 ---------- */
.feedback-fab {
  position: fixed;
  right: 24px;
  bottom: 120px;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--hi-red);
  color: #fff !important;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(199, 0, 11, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none !important;
  letter-spacing: 0.3px;
  user-select: none;
  overflow: hidden;
}

.feedback-fab:hover,
.feedback-fab:active {
  width: 118px;
  padding: 0 18px;
  border-radius: 24px;
  transform: translateY(-2px);
  gap: 6px;
  opacity: 0.85 !important;
  background: #cd131c !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

.feedback-fab .fab-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.feedback-fab .fab-label {
  line-height: 1;
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feedback-fab:hover .fab-label,
.feedback-fab:active .fab-label {
  opacity: 1;
  width: 60px;
}

/* ---------- 回顶 / 反馈悬浮按钮的窄布局（对位旧站 76.234375em 断点） ----------
 * 必须放在 .feedback-fab 基类之后：同特异度下后写的规则胜出，基类里的
 * 44px / right 24px / bottom 120px 否则会把这里的窄布局规格盖掉。
 * 旧站实测（1100 与 544 两档一致）：两枚按钮都是 40×40 —— 回顶
 * right 5px / bottom 140px，反馈 right 4px / bottom 80px，垂直留 20px 空隙。
 * 注意旧站回顶写的是 right: -15px，那是配合基类 transform: translate(-50%)
 * 的原始值（净视觉右边距 = -15 + 20 = 5px）；本文件的重置里没有那个
 * transform，所以这里直接写净值的 5px——照抄 -15px 会把按钮推出视口，
 * 与反馈按钮差出 31px，窄屏上就是"两个球错位"。 */
@media screen and (max-width: 1219.98px) {
  #pst-back-to-top {
    right: 5px;
    bottom: 140px;
    width: 40px;
    height: 40px;
    line-height: 40px;
  }

  .feedback-fab {
    right: 4px;
    bottom: 80px;
    width: 40px;
    height: 40px;
  }

  /* 悬停展开成胶囊的交互在窄屏取消（旧站同样在窄布局复位成圆）：
   * 40px 宽根本放不下图标 + 60px 文字。 */
  .feedback-fab:hover,
  .feedback-fab:active {
    width: 40px;
    padding: 0;
    border-radius: 50%;
    gap: 0;
  }

  .feedback-fab .fab-icon {
    font-size: 20px;
  }

  .feedback-fab .fab-label {
    display: none;
  }
}

/* ---------- 6. 内容侧自有类（Markdown 中直接使用，作用域换到 .bd-article） ---------- */
.bd-article .md-button {
  width: fit-content;
  height: 40px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 9px 20px;
  border-radius: 6px !important;
  font-size: 14px;
  line-height: 22px;
  border: 1px solid rgba(199, 0, 11, 1) !important;
  color: rgba(199, 0, 11, 1) !important;
}

.bd-article .md-button:hover {
  border: 1px solid rgba(224, 33, 40, 1) !important;
  color: rgba(224, 33, 40, 1) !important;
  text-decoration: none !important;
}

.bd-article .md-button:active,
.bd-article .md-button:focus {
  background-color: #fff !important;
}

.bd-article .md-button--primary {
  background-color: rgba(199, 0, 11, 1) !important;
  color: rgba(255, 255, 255, 1) !important;
}

.bd-article .md-button--primary:hover {
  background-color: rgba(224, 33, 40, 1) !important;
  color: rgba(255, 255, 255, 1) !important;
}

.bd-article .md-button--primary:active,
.bd-article .md-button--primary:focus {
  background-color: rgba(199, 0, 11, 1) !important;
}

.bd-article .hero-actions p {
  display: flex;
  gap: 10px;
  margin: 0;
}

/* 首页 Hero 区域 */
.bd-article .hero-section {
  background: linear-gradient(135deg, #1a1a1a 0%, #333333 50%, #1a1a1a 100%);
  border-radius: 10px;
  padding: 40px 48px;
  margin: 0 -48px 32px;
  color: white;
  text-align: center;
}

.bd-article .hero-section h1 {
  color: white !important;
  border-bottom: none !important;
  font-size: 32px !important;
  font-family: var(--hi-font-hei);
  font-weight: 600 !important;
  line-height: 48px !important;
  margin-bottom: 8px;
  padding-bottom: 0 !important;
}

.bd-article .hero-section .hero-subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
  margin-bottom: 28px;
  line-height: 1.6;
}

.bd-article .hero-cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

.bd-article .hero-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
}

.bd-article .hero-cta-btn.primary {
  background-color: var(--hi-red);
  color: white !important;
  box-shadow: 0 4px 12px rgba(199, 0, 11, 0.3);
}

.bd-article .hero-cta-btn.primary:hover {
  background-color: var(--hi-red-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(199, 0, 11, 0.4);
}

.bd-article .hero-cta-btn.secondary {
  background-color: rgba(255, 255, 255, 0.1);
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.bd-article .hero-cta-btn.secondary:hover {
  background-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  color: white !important;
  border-color: rgba(255, 255, 255, 0.4);
}

/* Material grid cards 直迁（源文件 <nav class="grid cards" markdown>）。
 * 列宽下限用 20rem：Material 的根字号是 20px（16rem → 320px 有效值），
 * PyData 根字号 16px，直接照抄 16rem 会从 3 列变成 4 列，与线上不一致。 */
.bd-article .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  /* 线上 extra.css：.md-typeset .cards { grid-gap: 24px !important } */
  grid-gap: 24px;
  margin: 1em 0;
}

.bd-article .grid.cards > ul,
.bd-article .grid.cards > ol {
  display: contents;
}

.bd-article .grid.cards > ul > li,
.bd-article .grid.cards > ol > li {
  display: block;
  margin: 0;
  /* 线上实测：内边距 17.6px、边框 1px rgba(0,0,0,.07)、圆角 2.2px */
  padding: 17.6px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 2.2px;
  transition: border-color 0.25s, box-shadow 0.25s;
  overflow-wrap: anywhere;
}

.bd-article .grid.cards > ul > li:hover,
.bd-article .grid.cards > ul > li:focus-within,
.bd-article .grid.cards > ol > li:hover,
.bd-article .grid.cards > ol > li:focus-within {
  border-color: transparent;
  box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.25), 0 0 0.05rem rgba(0, 0, 0, 0.25);
}

.bd-article .grid.cards > ul > li > hr,
.bd-article .grid.cards > ol > li > hr {
  margin: 1em 0;
}

.bd-article .grid.cards > ul > li > :first-child,
.bd-article .grid.cards > ol > li > :first-child {
  margin-top: 0;
}

.bd-article .grid.cards > ul > li > :last-child,
.bd-article .grid.cards > ol > li > :last-child {
  margin-bottom: 0;
}

.bd-article .grid.cards img {
  max-width: 100%;
  height: auto;
  border-radius: 2px;
}

/* 首页 hero-banner：线上站静态资源里**没有** .hero-banner 样式，
 * `<div class="hero-banner"><div class="hero-left">**…**</div></div>` 就是
 * 普通块级文本（副标题为一行加粗黑字，无底色无圆角）。品牌层此前给它加了
 * 深色渐变横幅，与线上不一致，故整段样式移除。 */

html[data-theme="dark"] .bd-article .grid.cards > ul > li,
html[data-theme="dark"] .bd-article .grid.cards > ol > li {
  border-color: var(--hi-border-strong);
}

html[data-theme="dark"] .bd-article .grid.cards > ul > li:hover,
html[data-theme="dark"] .bd-article .grid.cards > ul > li:focus-within,
html[data-theme="dark"] .bd-article .grid.cards > ol > li:hover,
html[data-theme="dark"] .bd-article .grid.cards > ol > li:focus-within {
  box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.6), 0 0 0.05rem rgba(0, 0, 0, 0.6);
}

/* 首页导航卡片（大板块按钮） */
.bd-article .section-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 2em 0 3em;
}

.bd-article .section-nav-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  background: var(--hi-white);
  border: 1px solid var(--hi-border);
  border-radius: 8px;
  box-shadow: var(--hi-card-shadow);
  transition: all 0.25s ease;
  text-decoration: none !important;
  color: var(--hi-black) !important;
  position: relative;
  overflow: hidden;
}

.bd-article .section-nav-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--hi-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.bd-article .section-nav-card:hover {
  box-shadow: var(--hi-card-hover-shadow);
  border-color: #d0d0d0;
  transform: translateY(-2px);
}

.bd-article .section-nav-card:hover::before {
  transform: scaleX(1);
}

.bd-article .section-nav-card .card-icon {
  font-size: 26px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--hi-bg);
  border-radius: 8px;
}

.bd-article .section-nav-card .card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--hi-black);
  margin: 0 0 6px;
  line-height: 1.3;
}

.bd-article .section-nav-card .card-desc {
  font-size: 12px;
  color: var(--hi-gray-light);
  margin: 0;
  line-height: 1.5;
}

.bd-article .section-nav-card .card-arrow {
  margin-top: 10px;
  font-size: 14px;
  color: var(--hi-gray-light);
  transition: all 0.2s ease;
}

.bd-article .section-nav-card:hover .card-arrow {
  color: var(--hi-red);
  transform: translateX(4px);
}

/* 快速上手快捷入口区 */
.bd-article .quick-start-strip {
  background: linear-gradient(90deg, var(--hi-red-lighter) 0%, var(--hi-white) 100%);
  border: 1px solid rgba(199, 0, 11, 0.12);
  border-left: 4px solid var(--hi-red);
  border-radius: 8px;
  padding: 20px 24px;
  margin: 1.5em 0 2em;
}

.bd-article .quick-start-strip h3 {
  color: var(--hi-red) !important;
  font-size: 20px !important;
  margin: 0 0 12px !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bd-article .quick-start-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.bd-article .quick-start-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--hi-white);
  border: 1px solid var(--hi-border);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--hi-dark) !important;
  transition: all 0.2s ease;
  text-decoration: none !important;
}

.bd-article .quick-start-links a:hover {
  background: var(--hi-red-light);
  border-color: var(--hi-red);
  color: var(--hi-red) !important;
  box-shadow: 0 2px 8px rgba(199, 0, 11, 0.12);
}

.bd-article .quick-start-links a .qs-icon {
  font-size: 15px;
}

/* ---------- 暗色适配（新增交互部分） ---------- */
#pst-back-to-top {
  color: #ffffff;
}

html[data-theme="dark"] #pst-back-to-top {
  /* 旧站 slate：回顶按钮取 #E7434A + 同色阴影（与反馈 FAB 一致） */
  background: #E7434A;
  box-shadow: 0 4px 14px rgba(231, 67, 74, 0.3);
}

html[data-theme="dark"] #pst-back-to-top:hover {
  background: #EE696F;
}

html[data-theme="dark"] .feedback-fab {
  background: #E7434A !important;
  box-shadow: 0 4px 14px rgba(231, 67, 74, 0.3) !important;
}

html[data-theme="dark"] .feedback-fab:hover,
html[data-theme="dark"] .feedback-fab:active {
  background: #EE696F !important;
  box-shadow: 0 6px 20px rgba(238, 105, 111, 0.4) !important;
}

/* 暗色下这些组件的配色由上方 token 重定义承担（与旧站一致），
 * 不再逐条写覆盖；旧站只有一个拖拽条高亮色需要额外指定。 */
html[data-theme="dark"] .sidebar-drag-handle:hover,
html[data-theme="dark"] .sidebar-drag-handle.active {
  background: rgba(243, 243, 243, 0.15);
}

/* ---------- Mermaid：消除加载闪动 ----------
 * 1) 源码 <pre class="mermaid"> 在客户端渲染完成前以代码块样式短暂可见
 *    （源码文本 + 深色底 + 184px 高），随后被 SVG 替换 —— 文本闪现 + 布局
 *    跳动都来自这里。渲染完成的标志是 pre 内出现 svg，用 :has 揭示。
 * 2) 扩展注入的 svg { height: 500px } 会把小图强行拉成
 *    500px 高（实测 viewBox 1012x70 的横向流程图上下大量留白），改成按
 *    viewBox 比例自适应，渲染前后的高度差也随之收窄。
 * 3) 淡入过渡柔化 SVG 出现的瞬间。visibility:hidden 不影响 IntersectionObserver
 *    的懒渲染判定（元素仍占位可交叉），display:none 才会出问题。 */

.mermaid-container {
  margin: 16px 0px;
 }

.bd-article pre.mermaid {
  visibility: hidden;
  opacity: 0;
  min-height: 120px; /* 渲染前占位，收窄布局跳动 */
  margin: 0;
  /* 揭示时淡入 */
  transition: opacity 0.2s ease;
}

.bd-article pre.mermaid:has(svg) {
  visibility: visible;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .bd-article pre.mermaid {
    transition: none;
  }
}

/* mermaid v11 会把 svg 包进一层 div，用后代选择器；
 * 全屏时 pre 会被移出 .bd-article（弹层挂 body），此规则自然失效不干扰。
 * 尺寸语义（对齐旧 mkdocs 站，小图紧凑、长图铺开）：
 * - conf.py 配了 useMaxWidth:false，svg 携带像素 width/height 属性（自然尺寸），
 *   width:auto 放行该属性——本选择器 (0,2,2) 同时压过注入 CSS 的 width:100%；
 * - max-width:100% 只在自然宽度超出内容列时等比缩小，不放大；
 * - 高度不限：此前 max-height:640px 会把长时序图等比压成 ~150px 宽的窄条
 *   （hello-connect 回调生命周期图实测），大图细看交给全屏查看器
 *   （pydata-interactions.js：等比适配 + 滚轮缩放 + 拖拽平移） */
.bd-article pre.mermaid svg {
  height: auto;
  width: auto;
  max-width: 100%;
}


.bd-main .bd-content .bd-article-container .bd-article :target>:is(h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5) {
  background-color: transparent;
}

.bd-header .pst-navbar-icon:hover:before {
  display: none;
}

.bd-sidebar-primary .sidebar-primary-items__start .sidebar-primary-item {
  padding: 0px
}

div.highlight {
  border-radius: var(--hi-code-radius);
}

html[data-theme="dark"] .highlight {
  background: rgba(243,243,243,0.1);
}

.header-article__inner .header-article-item {
  min-height: auto;
}

/* ⛶ 全屏按钮 sticky 化：sphinxcontrib-mermaid 默认把它 absolute 定在图容器
 * **顶部**——长图（时序图可达数千像素高）滚到中段按钮就出了视口，想放大
 * 还得先滚回顶部。sticky 让按钮随滚动停在视口上缘，滚过整张图期间始终
 * 可点。按钮的定位样式来自运行期注入的 <style>（晚于本文件加载）与元素
 * 内联 top/right，必须靠更高优先级选择器 + !important 才压得过。
 * 容器是 flex 行布局，按钮留在文档流里排在 pre 之后（右侧一列），不再
 * 叠在图的右上角上。 */
.bd-article .mermaid-container .mermaid-fullscreen-btn {
  position: sticky !important;
  top: 12px !important;
  right: auto !important;
  align-self: flex-start;
  flex: 0 0 auto;
  margin-left: 8px;
  z-index: 5;
}

/* 全屏弹层：平移/缩放由 pydata-interactions.js 以 svg transform 实现，
 * 容器自身不吃滚动条（transform 不产生滚动溢出） */
.mermaid-container-fullscreen {
  overflow: hidden !important
}

/* ---------- FA 图标（svg-inline--fa）核心尺寸兜底 ----------
 * 与 fontawesome.js kit 运行时注入的规则**逐字一致**（曾短暂移除 kit 改为
 * 构建期内联图标，下拉菜单等只依赖 kit 注入样式的上下文失去尺寸约束——
 * 图标撑到 66~94px，已回退）。kit 在场时本段是纯冗余；保留它作为兜底：
 * kit 加载失败/被 CSP 拦截时图标仍有正确尺寸，将来若再去 kit 也以此为
 * 尺寸来源。各上下文更 specific 的尺寸规则照常覆盖。本站图标仅用到
 * fa-lg / fa-fw 修饰类（fa-fw 的固定宽度即核心默认值 1.25em）。 */
/* 加载期防跳（主题切换按钮）：主题 CSS 让当前模式的 <i> display:inline——
 * inline 元素 width/height 不生效，fontawesome.js 替换前图标占位 0×0，
 * 替换后的 svg 才占 20×20。按钮框虽有固定尺寸，仍把 pre/post 占位统一成
 * inline-block 20×20，杜绝任何由图标替换时机、行高/字体参与造成的瞬时
 * 高度差（用户反馈：刷新时主题按钮与其他按钮高度不一致，加载完恢复）。
 * 注意不能无条件给 .theme-switch 设 display：会覆盖主题的显隐规则
 * （非当前模式的图标必须保持 display:none），需按 data-mode 逐模式复写 */
#pst-header .theme-switch-button .theme-switch {
  display: none;
}

html[data-mode="light"] #pst-header .theme-switch-button .theme-switch[data-mode="light"],
html[data-mode="dark"] #pst-header .theme-switch-button .theme-switch[data-mode="dark"],
html[data-mode="auto"] #pst-header .theme-switch-button .theme-switch[data-mode="auto"] {
  display: inline-block;
}

.svg-inline--fa {
  box-sizing: content-box;
  display: var(--fa-display, inline-block);
  height: 1em;
  overflow: visible;
  vertical-align: -0.125em;
  width: var(--fa-width, 1.25em);
}

.svg-inline--fa.fa-lg {
  vertical-align: -0.2em;
}