html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}
.cleartop {
    margin-top: 90px;
}
.wrapper {
    display: flex;
    flex-direction: row;
    height: 100%;
}

/* 左侧栏 */
.sidebar {
    background-color: #f9f9f9;
    width: 280px;
    min-width: 280px;
    overflow-y: auto;
    transition: margin-left .2s ease;
}

/* 右侧主区 */
.main {
    flex-grow: 1;
    overflow-y: auto;
}

footer {
    padding: 15px 0;
    margin-top: 15px;
    border-top: 1px solid #E4E4E4;
}

.sidebar-heading {
    height: 50px;
    line-height: 50px;
    padding-left: 10px;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    background-color: #F5F5F5;
    overflow: hidden;
}

.sidebar .nav li {
    padding: 0 10px;
}

.content {
    padding-top: 50px;
    margin-left: 25px;
}

.markdown {
    padding: 15px 0;
    margin-bottom: 60px;
}

.markdown pre {
    padding: 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.markdown pre code {
    font-size: inherit;
    word-wrap: normal;
}

.top-menu {
    line-height: 30px;
    position: fixed;
    top: 16px;            /* 下移，与正文标题基线视觉居中对齐（原 0 太贴顶部） */
    right: 62px;          /* 左移，与正文右边界对齐（原 20px 太贴边） */
    z-index: 9999;
}

.top-menu .btn {
    margin-bottom: 5px;
}

#sidebarToggle {
    position: fixed;
    margin: 10px 15px 0 0;
    z-index: 9999;
}

#sidebarToggle span {
    background-color: #d63384;
    display: block;
    margin-bottom: 4px;
    width: 16px;
    height: 2px;
}

/* 左栏收起状态（PC） */
.wrapper.sidebar-collapsed .sidebar {
    margin-left: -280px;
}

.wrapper.sidebar-collapsed .main {
    margin-left: 0 !important;
}

/* 目录分组基础 */
.nav-group .group-title {
    cursor: pointer;
    display: block;
}

.nav-group .caret {
    transition: transform .2s;
}

.nav-group.open .caret {
    transform: rotate(180deg);
}

/* 分组标题（button） */
.nav-tree .group-title {
    display: block;
    width: calc(100% - 16px);
    text-align: left;
    font-weight: 600;
    background: #f7f7f7;
    margin: 4px 8px;
    padding: 10px 12px;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
}

.nav-tree .group-title:hover,
.nav-tree .group-title:focus {
    background: #efefef;
    text-decoration: none;
}

.nav-tree .group-title .caret {
    float: right;
    margin-top: 8px;
    transition: transform .2s;
}

/* 子菜单 */
.nav-tree .nav-children {
    display: none;
    margin: 0 8px 6px 8px;
    padding-left: 0;
}

.nav-tree .nav-children > li {
    list-style: none;
    padding: 0;
}

.nav-tree .nav-children > li > a {
    display: block;
    padding: 8px 12px 8px 22px;
    border-radius: 4px;
}

.nav-tree .nav-children > li.active > a {
    background: #337ab7;
    color: #fff;
}

/* 文章目录 */
.article-toc-box {
    position: fixed;
    right: 20px;
    top: 90px;
    width: 240px;
    max-height: 70vh;
    overflow: auto;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 10px;
    z-index: 99;
}

.article-toc-list { list-style: none; margin: 8px 0 0; padding: 0; }
.article-toc-list li { line-height: 1.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.article-toc-list .toc-h3 { padding-left: 14px; font-size: 12px; color: #666; }
.article-toc-list .toc-h2 { font-weight: 600; }
.article-toc-list a { color: #333; text-decoration: none; }
.article-toc-list a:hover { color: #337ab7; }

@media (max-width: 1200px) {
    .article-toc-box { display: none; }
}

@media (max-width: 768px) {
    .wrapper {
        position: relative;
    }

    .sidebar-heading {
        font-size: 14px;
        padding: 5px 10px;
    }

    .sidebar {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 220px;
        min-width: 220px;
        height: 100vh;
        z-index: 1001;
        background: #f9f9f9;
        margin-left: -220px;
        transition: margin-left .2s ease;
        box-shadow: 2px 0 8px rgba(0,0,0,.08);
    }

    .main {
        width: 100%;
    }

    .wrapper.mobile-sidebar-open .sidebar {
        margin-left: 0;
    }

    .mobile-mask {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .35);
        z-index: 1000;
    }

    .wrapper.mobile-sidebar-open .mobile-mask {
        display: block;
    }
}

/* 修复复制粘贴换行丢失 */
pre.prettyprint ol li::after {
    content: "\A";
    white-space: pre;
}

/* ===== 提示框 (Callout) ===== */
.callout {
    margin: 16px 0;
    max-width: 880px;
    border: 1px solid;
    border-radius: 8px;
    overflow: hidden;
}
.callout-header {
    padding: 8px 14px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid rgba(0,0,0,.08);
}
.callout-body {
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.7;
}
.callout-body p { margin: 4px 0; }
.callout-body ul, .callout-body ol { margin: 4px 0; padding-left: 20px; }
.callout-body code {
    background: rgba(0,0,0,.06);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 13px;
}
.callout-body pre {
    margin: 8px 0;
    padding: 8px 10px;
    background: rgba(0,0,0,.04);
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 4px;
}

/* 信息 - 蓝 */
.callout-info {
    background: #e8f4fd;
    border-color: #b6d4fe;
}
.callout-info .callout-header { color: #0c5da5; }

/* 提示 - 绿 */
.callout-tip {
    background: #d4edda;
    border-color: #badbcc;
}
.callout-tip .callout-header { color: #0f6e3a; }

/* 警告 - 黄 */
.callout-warning {
    background: #fff3cd;
    border-color: #ffecb5;
}
.callout-warning .callout-header { color: #856404; }

/* 注意 - 红 */
.callout-danger {
    background: #f8d7da;
    border-color: #f5c2c7;
}
.callout-danger .callout-header { color: #a11f2c; }

/* ===== 代码块复制按钮 ===== */
.markdown pre {
    position: relative;
}
.copy-btn {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    padding: 4px 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #666;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 0 4px 0 4px;
    cursor: pointer;
    user-select: none;
    transition: background .2s, color .2s;
}
.copy-btn:hover {
    background: #337ab7;
    color: #fff;
    border-color: #337ab7;
}

/* ===== 返回顶部按钮 ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 46px;
    height: 46px;
    background: rgb(24, 144, 255);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: rgba(24, 144, 255, 0.25) 0px 4px 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0s;
    opacity: 1;
    visibility: visible;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(0px) rotate(0deg);
    color: #fff;
    text-decoration: none;
    line-height: 1;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
/* 箭头图标：用 SVG 绘制，保证各浏览器字形一致、居中精准 */
.back-to-top .btt-icon {
    display: block;
    width: 20px;
    height: 20px;
    color: #fff;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) 0s;
}
.back-to-top:hover {
    background: rgb(64, 169, 255);
    color: #fff;
    text-decoration: none;
    box-shadow: rgba(24, 144, 255, 0.5) 0px 6px 20px;
    transform: translateY(-3px);
}
.back-to-top:hover .btt-icon {
    transform: translateY(-2px);
}
.back-to-top:active {
    transform: translateY(-1px);
}
.back-to-top:focus {
    outline: none;
}
.back-to-top:focus-visible {
    box-shadow: rgba(24, 144, 255, 0.5) 0px 6px 20px, 0 0 0 3px rgba(24, 144, 255, 0.35);
}

/* 小屏收敛位置与尺寸 */
@media (max-width: 767px) {
    .back-to-top {
        width: 42px;
        height: 42px;
        right: 16px;
        bottom: 20px;
    }
    .back-to-top .btt-icon {
        width: 18px;
        height: 18px;
    }
}


#docNavTree, #docNavTree ul{
    list-style:none;
    margin:0;
    padding:0;
}
#docNavTree > li{ margin:2px 0; }
#docNavTree a{
    display:block;
    text-decoration:none;
    border-radius:4px;
}
#docNavTree a.menu1{
    padding:8px 12px;
    font-weight:600;
    color:#333;
}
#docNavTree a.menu2{
    padding:7px 12px 7px 24px;
    color:#2a5ea8;
}
#docNavTree a.menu2.on{
    background:#2f74b5;
    color:#fff;
}
#docNavTree a:hover{
    background:#f2f6fb;
}

/* ===== 左侧目录树美化 ===== */
#docNavTree {
    margin: 0;
    padding: 0 0 10px 0;
}

#docNavTree > li,
#docNavTree .nav-children > li {
    list-style: none;
}

/* 分组标题 */
#docNavTree .group-title {
    display: block;
    position: relative;
    padding: 10px 12px 10px 34px;
    color: #222;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    margin: 2px 8px;
    transition: background .2s;
}
#docNavTree .group-title:hover {
    background: #f1f3f5;
}

/* 折叠箭头（不用bootstrap caret，改成更细的箭头） */
#docNavTree .group-title::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 1.8px solid #666;
    border-bottom: 1.8px solid #666;
    transform: translateY(-60%) rotate(-45deg); /* 默认收起：向右 */
    transition: transform .2s ease, top .2s ease;
}

/* 展开状态：向下 */
#docNavTree .nav-group.open > .group-title::before {
    transform: translateY(-65%) rotate(45deg);
}

#docNavTree .group-title .caret {
    display: none; /* 隐藏原来的caret */
}

/* 子级容器 */
#docNavTree .nav-children {
    margin: 0;
    padding: 2px 0 6px 0;
    display: none;
}
#docNavTree .nav-group.open > .nav-children {
    display: block;
}

/* 子项 */
#docNavTree .nav-children > li > a,
#docNavTree > li > a {
    display: block;
    padding: 8px 12px 8px 34px;
    margin: 2px 8px;
    color: #1f2d3d;
    border-radius: 6px;
    text-decoration: none;
    line-height: 1.4;
    transition: background .2s, color .2s;
}
#docNavTree .nav-children > li > a:hover,
#docNavTree > li > a:hover {
    background: #eef3ff;
    color: #1f4fbf;
}

/* 当前激活 */
#docNavTree li.active > a {
    background: #2f6fdd;
    color: #fff !important;
}
#docNavTree li.active > a .text-success {
    color: #d4f8df !important;
}

/* 无分组的一级文档稍微左移，和分组视觉区分 */
#docNavTree > li:not(.nav-group) > a {
    padding-left: 20px;
}
/* 分组标题加箭头（匹配你现在的 menu-dir 结构） */
#docNavTree > li > a.menu-dir{
  position: relative;
  display: block;
  padding: 10px 12px 10px 34px;
  font-weight: 600;
  color: #222;
  text-decoration: none;
  border-radius: 6px;
  margin: 2px 8px;
}

#docNavTree > li > a.menu-dir::before{
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 2px solid #666;
  border-bottom: 2px solid #666;
  transform: rotate(-45deg); /* 收起：向右 */
  transition: transform .2s ease;
}

/* 展开状态（给li加 open） */
#docNavTree > li.open > a.menu-dir::before{
  transform: rotate(45deg); /* 展开：向下 */
}
/* ===== 顶栏图标按钮（主题 / 语言） ===== */
.nav-icon-btn { display: inline-block; }
.navbar-nav.navbar-right > .nav-icon-btn > .icon-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 50px; padding: 0 12px;
  background: transparent; border: 0; outline: 0;
  color: var(--zd-nav-text, #555);
  cursor: pointer; line-height: 50px;
  transition: color .18s ease, opacity .18s ease;
}
.navbar-nav.navbar-right > .nav-icon-btn > .icon-btn:hover { opacity: .72; }
.navbar-nav.navbar-right > .nav-icon-btn > .icon-btn svg { display: block; }
.navbar-nav.navbar-right > .nav-icon-btn > .icon-btn .lang-label {
  font-size: 12px; font-weight: 600; letter-spacing: .3px;
}
/* 月亮/太阳 按主题切换显示 */
#themeToggle .ico-sun { display: none; }
html[data-theme="dark"] #themeToggle .ico-moon { display: none; }
html[data-theme="dark"] #themeToggle .ico-sun { display: block; }

@media (max-width: 767px) {
  .navbar-nav.navbar-right > .nav-icon-btn { float: left; }
  .navbar-nav.navbar-right > .nav-icon-btn > .icon-btn { height: 44px; line-height: 44px; }
}


/* top-menu 内的图标按钮（文档页右上角） */
.top-menu .nav-icon-btn {
  display: inline-block;
  float: none;
}
.top-menu .nav-icon-btn > .icon-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 30px; line-height: 30px;
  padding: 0 8px; margin: 0 2px;
  background: transparent; border: 0; outline: 0;
  color: #555; cursor: pointer; vertical-align: middle;
  border-radius: 4px;
  transition: background-color .18s ease, color .18s ease;
}
.top-menu .nav-icon-btn > .icon-btn:hover { background: rgba(0,0,0,.06); }
.top-menu .nav-icon-btn > .icon-btn svg { display: block; }
.top-menu .nav-icon-btn > .icon-btn .lang-label {
  font-size: 12px; font-weight: 600; letter-spacing: .3px; white-space: nowrap;
}
.top-menu #themeToggle .ico-sun { display: none; }
html[data-theme="dark"] .top-menu #themeToggle .ico-moon { display: none; }
html[data-theme="dark"] .top-menu #themeToggle .ico-sun { display: block; }
html[data-theme="dark"] .top-menu .nav-icon-btn > .icon-btn { color: #c9d1d9; }
html[data-theme="dark"] .top-menu .nav-icon-btn > .icon-btn:hover { background: rgba(255,255,255,.09); }

/* ============================================================
   深色主题（data-theme="dark"）
   采用覆盖式，不改动原浅色规则
   ============================================================ */
html[data-theme="dark"] {
  color-scheme: dark;
}
html[data-theme="dark"] body {
  background-color: #14171c;
  color: #c9d1d9;
}
/* 顶栏 */
html[data-theme="dark"] .navbar-default {
  background-color: #1b1f26;
  border-color: #262c36;
}
html[data-theme="dark"] .navbar-default .navbar-nav > li > a,
html[data-theme="dark"] .navbar-default .navbar-brand,
html[data-theme="dark"] .navbar-default .navbar-nav > li > a:hover,
html[data-theme="dark"] .navbar-default .navbar-nav > li > a:focus {
  color: #c9d1d9;
}
html[data-theme="dark"] .navbar-default .navbar-toggle {
  border-color: #39414d;
}
html[data-theme="dark"] .navbar-default .navbar-toggle .icon-bar {
  background-color: #c9d1d9;
}
html[data-theme="dark"] .navbar-default .navbar-collapse,
html[data-theme="dark"] .navbar-default .navbar-form {
  border-color: #262c36;
}
/* 左栏 */
html[data-theme="dark"] .sidebar {
  background-color: #1a1e25;
  border-right: 1px solid #262c36;
}
html[data-theme="dark"] .sidebar-heading,
html[data-theme="dark"] .sidebar-heading a {
  color: #e6edf3;
}
html[data-theme="dark"] .sidebar .nav > li > a,
html[data-theme="dark"] .nav-tree a {
  color: #a9b4c0;
}
html[data-theme="dark"] .sidebar .nav > li > a:hover,
html[data-theme="dark"] .nav-tree a:hover {
  background-color: #232a34;
  color: #e6edf3;
}
html[data-theme="dark"] .nav-tree .group-title {
  background: #20262f;
  color: #d4dde6;
}
html[data-theme="dark"] .nav-tree .group-title:hover,
html[data-theme="dark"] .nav-tree .group-title:focus {
  background: #29313c;
}
html[data-theme="dark"] .nav-tree .active > a,
html[data-theme="dark"] .nav-tree li.active > a {
  background-color: #1f3a5f;
  color: #8ec5ff;
}
/* 正文 */
html[data-theme="dark"] .main { background-color: #14171c; }
html[data-theme="dark"] .markdown { color: #c9d1d9; }
html[data-theme="dark"] .markdown h1,
html[data-theme="dark"] .markdown h2,
html[data-theme="dark"] .markdown h3,
html[data-theme="dark"] .markdown h4,
html[data-theme="dark"] .markdown h5,
html[data-theme="dark"] .markdown h6,
html[data-theme="dark"] .markdown strong { color: #f0f6fc; }
html[data-theme="dark"] .markdown a { color: #6cb6ff; }
html[data-theme="dark"] .markdown hr { border-color: #30363d; }
html[data-theme="dark"] .markdown blockquote {
  color: #9aa7b4;
  border-left-color: #3b4652;
  background: #1b212a;
}
html[data-theme="dark"] .markdown table th,
html[data-theme="dark"] .markdown table td { border-color: #30363d; }
html[data-theme="dark"] .markdown table tr:nth-child(2n) { background: #1b212a; }
html[data-theme="dark"] .markdown table th { background: #20262f; color: #e6edf3; }
/* 代码块 */
html[data-theme="dark"] .markdown pre {
  background: #161b22;
  border-color: #30363d;
  color: #c9d1d9;
}
html[data-theme="dark"] .markdown pre code { color: #c9d1d9; }
html[data-theme="dark"] .markdown code {
  background: #21262d;
  color: #ff9b8a;
  border-color: #30363d;
}
/* callout 提示块 */
html[data-theme="dark"] .callout-info    { background: #12283d; border-color: #1f4b73; }
html[data-theme="dark"] .callout-info .callout-header    { color: #6cb6ff; }
html[data-theme="dark"] .callout-tip     { background: #14291d; border-color: #245c39; }
html[data-theme="dark"] .callout-tip .callout-header     { color: #7ee2a8; }
html[data-theme="dark"] .callout-warning { background: #33290f; border-color: #6b5316; }
html[data-theme="dark"] .callout-warning .callout-header { color: #f2cc60; }
/* 右侧目录 */
html[data-theme="dark"] .article-toc-list a { color: #a9b4c0; }
html[data-theme="dark"] .article-toc-list a:hover { color: #6cb6ff; }
html[data-theme="dark"] .article-toc-list .toc-h3 { color: #8b98a5; }
/* 页脚与上一篇/下一篇 */
html[data-theme="dark"] footer,
html[data-theme="dark"] footer a { color: #8b98a5; }
/* 表单、下拉 */
html[data-theme="dark"] .dropdown-menu {
  background-color: #1b1f26;
  border-color: #30363d;
}
html[data-theme="dark"] .dropdown-menu > li > a { color: #c9d1d9; }
html[data-theme="dark"] .dropdown-menu > li > a:hover,
html[data-theme="dark"] .dropdown-menu > li > a:focus {
  background-color: #232a34;
  color: #fff;
}
html[data-theme="dark"] .dropdown-menu .divider { background-color: #30363d; }
/* 平滑过渡 */
html[data-theme="dark"] body,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .navbar-default,
html[data-theme="dark"] .markdown pre {
  transition: background-color .25s ease, color .25s ease;
}

/* ============================================================
   深色主题修正（v2）
   解决：侧栏底部露白、正文区白底、分组标题不可见
   ============================================================ */

/* 1) 整页底色铺满，避免侧栏/正文露出白底 */
html[data-theme="dark"],
html[data-theme="dark"] body {
  background-color: #0f1318 !important;
  color: #c9d1d9;
}
html[data-theme="dark"] .wrapper {
  background-color: #0f1318;
  min-height: 100vh;
}

/* 2) 侧栏：撑满高度 + 深色底 */
html[data-theme="dark"] .sidebar {
  background-color: #171b22 !important;
  border-right: 1px solid #242a33;
  min-height: 100vh;
}
html[data-theme="dark"] #sidebar {
  background-color: #171b22 !important;
}

/* 3) 正文区：深色底，禁止白底透出 */
html[data-theme="dark"] .main,
html[data-theme="dark"] .content {
  background-color: #0f1318 !important;
}
html[data-theme="dark"] .markdown,
html[data-theme="dark"] #content-editormd {
  background-color: transparent !important;
  color: #c9d1d9 !important;
}

/* 4) 分组标题（menu-dir）在深色下要清晰可见 */
html[data-theme="dark"] .nav-tree a.menu-dir,
html[data-theme="dark"] a.menu1.menu-dir {
  color: #e6edf3 !important;
  font-weight: 600;
}
html[data-theme="dark"] a.menu1.menu-dir:hover {
  color: #6cb6ff !important;
}

/* 5) 文章链接统一浅色 */
html[data-theme="dark"] .nav-tree a.menu2,
html[data-theme="dark"] .sidebar .nav a {
  color: #a9b4c0 !important;
}
html[data-theme="dark"] .nav-tree a.menu2:hover,
html[data-theme="dark"] .sidebar .nav a:hover {
  color: #e6edf3 !important;
  background-color: #222833 !important;
}
html[data-theme="dark"] a.menu2.on,
html[data-theme="dark"] .nav-tree li.active > a {
  background-color: #1d4ed8 !important;
  color: #fff !important;
}

/* 6) 正文标题过白问题（截图里 H1/H2 几乎看不见）—— 提亮为高对比白 */
html[data-theme="dark"] .markdown h1,
html[data-theme="dark"] .markdown h2,
html[data-theme="dark"] .markdown h3,
html[data-theme="dark"] .markdown h4 {
  color: #ffffff !important;
}
html[data-theme="dark"] .markdown p,
html[data-theme="dark"] .markdown li,
html[data-theme="dark"] .markdown span,
html[data-theme="dark"] .markdown td {
  color: #c9d1d9 !important;
}

/* 7) 搜索框深色化 */
html[data-theme="dark"] .sidebar-search input,
html[data-theme="dark"] #menuFilter {
  background-color: #0f1318 !important;
  border: 1px solid #2b333f !important;
  color: #c9d1d9 !important;
}
html[data-theme="dark"] .sidebar-search input::placeholder,
html[data-theme="dark"] #menuFilter::placeholder {
  color: #6b7785 !important;
}

/* 8) 顶部图标按钮在深色下的可见度 */
html[data-theme="dark"] .top-menu .nav-icon-btn > .icon-btn {
  color: #c9d1d9 !important;
}
html[data-theme="dark"] .top-menu .nav-icon-btn > .icon-btn:hover {
  background: rgba(255,255,255,.1) !important;
}

/* 9) 滚动条深色化 */
html[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #0f1318; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #2b333f; border-radius: 5px;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #3a4552; }

/* 10) 侧栏顶部标题栏：深色下不能露白 */
html[data-theme="dark"] .sidebar-heading {
  background-color: #171b22 !important;
  border-bottom: 1px solid #242a33;
  color: #e6edf3 !important;
}
html[data-theme="dark"] .sidebar-heading a {
  color: #e6edf3 !important;
}

/* 11) 正文内嵌图片：深色下加柔和边框，避免纯白刺眼 */
html[data-theme="dark"] .markdown img {
  border-radius: 6px;
  border: 1px solid #2b333f;
  opacity: .94;
}
html[data-theme="dark"] .markdown img:hover { opacity: 1; }

/* 12) 代码块内的行内高亮不刺眼 */
html[data-theme="dark"] .markdown pre code,
html[data-theme="dark"] .markdown pre code * {
  color: #c9d1d9 !important;
}
/* 13) 表格斑马纹与边框 */
html[data-theme="dark"] .markdown table {
  border-color: #30363d;
}
html[data-theme="dark"] .markdown table thead th {
  background: #1b212a !important;
  color: #e6edf3 !important;
}

/* 14) 正文内嵌截图（本身白底）在深色下柔化，避免大面积刺眼 */
html[data-theme="dark"] .markdown img {
  filter: brightness(.88) contrast(.96);
}
html[data-theme="dark"] .markdown img:hover {
  filter: none;
}

/* ============================================================
   深色主题修正 v3：代码块 / 表格 / 复制按钮
   根因：editormd.css 的 li.L1..L9 斑马纹(#eee)、github.css 表格浅底、
        doc.css 的 .copy-btn(#f0f0f0)，均未做深色适配
   ============================================================ */

/* 1) 代码块斑马纹：去掉交替浅色底，统一深色 */
html[data-theme="dark"] .markdown pre ol.linenums,
html[data-theme="dark"] .markdown pre ol.linenums > li,
html[data-theme="dark"] pre.prettyprint ol.linenums,
html[data-theme="dark"] pre.prettyprint ol.linenums > li {
  background: transparent !important;
  background-color: transparent !important;
}
/* 奇数行原本是 #eee，单独压制 */
html[data-theme="dark"] li.L0, html[data-theme="dark"] li.L1,
html[data-theme="dark"] li.L2, html[data-theme="dark"] li.L3,
html[data-theme="dark"] li.L4, html[data-theme="dark"] li.L5,
html[data-theme="dark"] li.L6, html[data-theme="dark"] li.L7,
html[data-theme="dark"] li.L8, html[data-theme="dark"] li.L9 {
  background: transparent !important;
  background-color: transparent !important;
  color: #c9d1d9 !important;
}

/* 2) 代码块整体容器 + 行号颜色 */
html[data-theme="dark"] .markdown pre {
  background: #161b22 !important;
  border: 1px solid #30363d !important;
  color: #c9d1d9 !important;
}
html[data-theme="dark"] .markdown pre ol.linenums {
  color: #56606b !important;   /* 行号数字 */
}
html[data-theme="dark"] .markdown pre code,
html[data-theme="dark"] .markdown pre code *,
html[data-theme="dark"] .markdown pre .pln,
html[data-theme="dark"] .markdown pre .pun,
html[data-theme="dark"] .markdown pre .com,
html[data-theme="dark"] .markdown pre .str,
html[data-theme="dark"] .markdown pre .kwd,
html[data-theme="dark"] .markdown pre .typ,
html[data-theme="dark"] .markdown pre .lit,
html[data-theme="dark"] .markdown pre .tag,
html[data-theme="dark"] .markdown pre .atn,
html[data-theme="dark"] .markdown pre .atv {
  color: #c9d1d9 !important;
  background: transparent !important;
}
/* 轻微区分 token：注释变灰绿、字符串变浅橙、关键字变蓝 */
html[data-theme="dark"] .markdown pre .com,
html[data-theme="dark"] .markdown pre .com * { color: #7d8794 !important; font-style: italic; }
html[data-theme="dark"] .markdown pre .str,
html[data-theme="dark"] .markdown pre .atv,
html[data-theme="dark"] .markdown pre .str * { color: #a5d6a7 !important; }
html[data-theme="dark"] .markdown pre .kwd,
html[data-theme="dark"] .markdown pre .typ { color: #79b8ff !important; }
html[data-theme="dark"] .markdown pre .lit,
html[data-theme="dark"] .markdown pre .pun { color: #f0b37e !important; }

/* 3) 复制按钮 */
html[data-theme="dark"] .copy-btn {
  background: #21262d !important;
  border: 1px solid #30363d !important;
  color: #c9d1d9 !important;
}
html[data-theme="dark"] .copy-btn:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
  color: #fff !important;
}

/* 4) 表格：奇偶行都深色，仅用微弱差异区分 */
html[data-theme="dark"] .markdown table {
  background: #0f1318 !important;
  border-color: #30363d !important;
}
html[data-theme="dark"] .markdown table tr,
html[data-theme="dark"] .markdown table tbody tr:nth-child(2n),
html[data-theme="dark"] .markdown table tbody tr:nth-child(odd),
html[data-theme="dark"] .markdown table tr:nth-child(2n) {
  background: #161b22 !important;
}
html[data-theme="dark"] .markdown table tbody tr:nth-child(2n) {
  background: #1b212a !important;
}
html[data-theme="dark"] .markdown table th,
html[data-theme="dark"] .markdown table thead th {
  background: #1f2630 !important;
  color: #e6edf3 !important;
  border-color: #30363d !important;
}
html[data-theme="dark"] .markdown table td,
html[data-theme="dark"] .markdown table th {
  border-color: #30363d !important;
  color: #c9d1d9 !important;
}
/* 表格内行内代码 */
html[data-theme="dark"] .markdown table code {
  background: #21262d !important;
  color: #ffa198 !important;
  border: 1px solid #30363d !important;
}

/* 5) 行内代码统一深色 */
html[data-theme="dark"] .markdown :not(pre) > code {
  background: #21262d !important;
  color: #ffa198 !important;
  border: 1px solid #30363d !important;
  padding: 1px 5px;
  border-radius: 4px;
}
/* 6) github.css 的 .bg-white 等工具类 */
html[data-theme="dark"] .markdown .bg-white { background-color: #161b22 !important; }
html[data-theme="dark"] .markdown .bg-gray-light { background-color: #1b212a !important; }
