/* ===========================================================
   开发文档中心 · 统一视觉主题
   与站内新版页面（Element Plus / 蓝白卡片风格）保持一致
   加载顺序：style.css -> docView.css -> theme.css（本文件最后）
   =========================================================== */

:root {
    --doc-primary: #2563eb;
    --doc-primary-dark: #1d4ed8;
    --doc-primary-soft: #eff6ff;
    --doc-primary-border: #dbeafe;
    --doc-bg: #f5f7fb;
    --doc-border: #e6ebf3;
    --doc-text: #1f2937;
    --doc-muted: #64748b;
    --doc-sidebar-width: 272px;
    --doc-header-height: 60px;
}

/* 让原生控件（滚动条、下拉框等）也跟随当前主题，而不是只跟随系统 */
html[data-doc-theme="light"] { color-scheme: light; }

html, body {
    background: var(--doc-bg);
}

body {
    color: var(--doc-text);
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: padding-box; }
::-webkit-scrollbar-thumb:window-inactive { background: #cbd5e1; background-clip: padding-box; }

/* ---------- 顶部导航 ---------- */
#navbar {
    height: var(--doc-header-height);
    background: #fff;
    box-shadow: 0 1px 0 rgba(31, 41, 55, .04);
}
#navbar .bg-blur {
    background: #fff !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    border-bottom: 1px solid var(--doc-border);
    height: var(--doc-header-height);
    line-height: var(--doc-header-height);
}
#navbar .navbar-body {
    padding: 0 24px;
    box-sizing: border-box;
}
#navbar .layui-nav { background: transparent; }
#navbar .layui-nav .layui-nav-item { line-height: var(--doc-header-height); }
#navbar .logo { line-height: var(--doc-header-height); }
/* 后台可上传任意比例的 LOGO：限制最大宽度，保持等比不变形 */
#navbar .logo > img { height: 36px; width: auto; max-width: 190px; object-fit: contain; vertical-align: middle; }
.doc-logo-fallback { font-size: 16px; font-weight: 600; color: var(--doc-primary); }
html[data-doc-theme="dark"] .doc-logo-fallback { color: #93c5fd; }

/* 站点上传的横版 LOGO 常为「图标 + 白色文字」（与深色首页配套）。
   浅色顶栏下白字会隐形，因此给 LOGO 一块深色品牌背板；深色主题顶栏本就是
   深色，不需要背板。若以后上传的是深色文字 LOGO，删掉下面第一条规则即可。 */
#navbar .nav-menu .logo {
    display: inline-flex;
    align-items: center;
    height: 42px;
    padding: 0 11px;
    margin-top: 9px;
    border-radius: 11px;
    background: #101826;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .16);
    line-height: 1;
    vertical-align: top;
}
html[data-doc-theme="dark"] #navbar .nav-menu .logo {
    background: transparent;
    box-shadow: none;
}
@media screen and (max-width: 768px) {
    #navbar .nav-menu .logo { height: 38px; margin-top: 9px; padding: 0 9px; }
}
#navbar .navbar-body > .layui-nav .layui-nav-item a,
#navbar .navbar-body > .layui-nav .layui-nav-item a:hover,
#navbar .navbar-body > .layui-nav .layui-this a {
    color: var(--doc-muted);
    font-size: 14px;
}
#navbar .navbar-body > .layui-nav .layui-this:after,
#navbar .navbar-body > .layui-nav .layui-nav-bar { display: none; }
#navbar .navRight .layui-nav-item a {
    display: inline-block;
    line-height: 32px !important;
    height: 32px;
    margin-top: 14px;
    padding: 0 16px !important;
    border-radius: 999px;
    background: var(--doc-primary-soft);
    color: var(--doc-primary) !important;
    font-weight: 500;
    transition: all .2s ease;
}
#navbar .navRight .layui-nav-item a:hover {
    background: var(--doc-primary);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .24);
}
#navMenuLeft.active > i, #navMenuRight.active > i { color: var(--doc-primary); }

/* ---------- 左侧目录 ---------- */
#leftbar {
    width: var(--doc-sidebar-width);
    top: var(--doc-header-height);
    bottom: 0;
    background: #fff;
    border-right: 1px solid var(--doc-border);
    box-shadow: 2px 0 14px rgba(31, 41, 55, .025);
}
#leftbar .layui-tab-title {
    height: 46px;
    border-bottom: 1px solid var(--doc-border);
    padding: 0 16px;
}
#leftbar .layui-tab-title li {
    height: 46px;
    line-height: 46px;
    padding: 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}
#leftbar .layui-tab-title li .layui-icon { color: var(--doc-primary); margin-right: 6px; }
#leftbar .layui-tab-title .layui-this:after {
    border-bottom: 2px solid var(--doc-primary) !important;
    height: 44px;
}
#leftbar .layui-tab-content { padding: 10px 8px 0; }
#leftbar .copyright {
    color: #94a3b8;
    font-size: 12px;
    line-height: 38px;
    background: #fff;
    border-top: 1px solid var(--doc-border);
    letter-spacing: .02em;
}

/* zTree 目录 */
.ztree * { font-family: inherit; font-size: 13.5px; }
.ztree li { line-height: 38px; padding-left: 0; margin-bottom: 0; }
.ztree li a {
    height: 38px;
    line-height: 38px;
    color: var(--doc-muted);
    padding-left: 14px !important;
    border-radius: 9px;
}
.ztree li a::before {
    height: 38px;
    left: 6px;
    width: calc(100% - 12px);
    border-radius: 9px;
    background: transparent;
    transition: background .18s ease;
}
.ztree li a:hover::before { background: #f3f6fb; font-weight: normal; }
.ztree li a:hover { color: var(--doc-primary); text-decoration: none; }
.ztree li.level0 > a {
    font-weight: 600;
    color: #334155;
    padding-left: 12px !important;
    margin-top: 6px;
}
.ztree li.level1 > a { padding-left: 30px !important; }
.ztree li.level2 > a { padding-left: 44px !important; }
.ztree li a.curSelectedNode {
    color: var(--doc-primary);
    font-weight: 600;
    background: transparent;
    border: 0;
}
.ztree li a.curSelectedNode::before { background: var(--doc-primary-soft); }
.ztree li a.curSelectedNode::after {
    content: '';
    display: block;
    position: absolute;
    left: 6px;
    top: 0;
    float: none;
    width: 3px;
    height: 38px;
    border-radius: 3px;
    background: var(--doc-primary);
}
.ztree li a.curSelectedNode span { color: var(--doc-primary); }
.ztree li span.button.switch { filter: saturate(.4) opacity(.65); }
.ztree li a.tmpTargetNode_inner::before { background: var(--doc-primary-soft); border-color: var(--doc-primary); }

/* 搜索 */
#searchForm { padding: 4px 4px 14px; border-bottom: 1px solid var(--doc-border); }
.inputBox .layui-input {
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--doc-border);
    background: #f8fafc;
    font-size: 13px;
    transition: all .2s ease;
}
.inputBox .layui-input:focus {
    border-color: var(--doc-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}
.inputBox .input-icon { color: #94a3b8; }
.inputBox .layui-input:focus + .input-icon { color: var(--doc-primary); }
#treeSearch > li { padding: 10px 8px; border-bottom: 1px solid var(--doc-border); }
#treeSearch h3 { font-size: 14px; line-height: 1.6; color: var(--doc-text); }
#treeSearch strong { color: var(--doc-primary); }
.searchResultNone { color: #cbd5e1; }

/* ---------- 内容区 ---------- */
#body {
    padding-left: var(--doc-sidebar-width);
    padding-top: var(--doc-header-height);
    background: var(--doc-bg);
}
#content_body { background: var(--doc-bg); }
#mask { background-color: rgba(15, 23, 42, .42); }

#article-content.markdown-body {
    max-width: 1000px;
    margin: 28px auto 64px;
    padding: 40px 48px 48px;
    background: #fff;
    border: 1px solid var(--doc-border);
    border-radius: 18px;
    box-shadow: 0 10px 36px rgba(31, 41, 55, .055);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.85;
    color: var(--doc-text);
    overflow: visible;
}

/* 标题 */
#article-content.markdown-body h1,
#article-content.markdown-body h2,
#article-content.markdown-body h3,
#article-content.markdown-body h4 {
    color: #0f172a;
    font-weight: 600;
    letter-spacing: -.01em;
}
#article-content.markdown-body h1 {
    font-size: 27px;
    line-height: 1.4;
    text-align: left;
    margin: 0 0 26px;
    padding: 0 0 18px;
    border-bottom: 1px solid var(--doc-border);
    position: relative;
}
#article-content.markdown-body h1:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 56px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--doc-primary), #38bdf8);
}
#article-content.markdown-body h2 {
    font-size: 20px;
    line-height: 1.5;
    margin: 38px 0 18px;
    padding: 0 0 0 14px;
    border-bottom: 0;
    border-left: 4px solid var(--doc-primary);
    border-radius: 2px;
}
#article-content.markdown-body h3 { font-size: 17px; margin: 28px 0 14px; }
#article-content.markdown-body h4 { font-size: 15px; margin: 22px 0 12px; }
#article-content.markdown-body h1 > a,
#article-content.markdown-body h2 > a,
#article-content.markdown-body h3 > a,
#article-content.markdown-body h4 > a,
#article-content.markdown-body h5 > a,
#article-content.markdown-body h6 > a {
    color: inherit;
    font-weight: inherit;
    border-bottom: 0;
}

/* 正文 */
#article-content.markdown-body p,
#article-content.markdown-body dl,
#article-content.markdown-body ul,
#article-content.markdown-body ol { margin-bottom: 16px; }
#article-content.markdown-body p,
#article-content.markdown-body li,
#article-content.markdown-body dd { color: #475569; }
#article-content.markdown-body a {
    color: var(--doc-primary);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid rgba(37, 99, 235, .28);
    transition: all .18s ease;
}
#article-content.markdown-body a:hover {
    color: var(--doc-primary-dark);
    border-bottom-color: var(--doc-primary-dark);
    text-decoration: none;
}
#article-content.markdown-body strong { color: #0f172a; font-weight: 600; }
#article-content.markdown-body hr {
    height: 1px;
    margin: 32px 0;
    border: 0;
    background: linear-gradient(90deg, var(--doc-border), transparent);
}
#article-content.markdown-body img { border-radius: 10px; box-shadow: 0 4px 16px rgba(31, 41, 55, .08); }

/* 行内代码 */
#article-content.markdown-body code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: .88em;
    padding: 2px 7px;
    margin: 0 2px;
    border-radius: 6px;
    background: var(--doc-primary-soft);
    border: 1px solid var(--doc-primary-border);
    color: var(--doc-primary-dark);
}
#article-content.markdown-body code:before,
#article-content.markdown-body code:after { content: ""; letter-spacing: normal; }

/* 列表 */
#article-content.markdown-body ul { list-style: none; padding-left: 1.4em; }
#article-content.markdown-body ol { list-style: decimal; padding-left: 1.8em; }
#article-content.markdown-body li { margin-bottom: 8px; position: relative; }
#article-content.markdown-body ul > li:before {
    content: '';
    position: absolute;
    left: -1em;
    top: .78em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--doc-primary);
    opacity: .55;
}
#article-content.markdown-body ol > li:before { display: none; }
#article-content.markdown-body li > p { margin-top: 8px; }

/* 表格 */
#article-content.markdown-body table,
#article-content.markdown-body table.layui-table {
    width: 100%;
    margin: 20px 0;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--doc-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    font-size: 14px;
}
#article-content.markdown-body table th,
#article-content.markdown-body table.layui-table th {
    background: #f8fafc;
    color: #334155;
    font-weight: 600;
    padding: 11px 14px;
    border-bottom: 1px solid var(--doc-border);
    text-align: left;
    white-space: nowrap;
}
#article-content.markdown-body table td,
#article-content.markdown-body table.layui-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}
#article-content.markdown-body table tr:last-child td { border-bottom: 0; }
#article-content.markdown-body table tbody tr:nth-child(even) { background: #fafbfe; }
#article-content.markdown-body table tbody tr:hover { background: var(--doc-primary-soft); }

/* 引用 / 提示 */
#article-content.markdown-body blockquote,
#article-content.markdown-body .layui-elem-quote {
    margin: 20px 0;
    padding: 14px 18px;
    border: 1px solid var(--doc-primary-border) !important;
    border-left: 4px solid var(--doc-primary) !important;
    border-radius: 0 12px 12px 0;
    background: var(--doc-primary-soft) !important;
    color: #1e40af;
    line-height: 1.8;
}
#article-content.markdown-body blockquote p:last-child { margin-bottom: 0; }

/* 代码块（SyntaxHighlighter） */
.syntaxhighlighter {
    margin: 20px 0 !important;
    padding: 12px 0 !important;
    background: #f8fafc !important;
    border: 1px solid var(--doc-border);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 #fff;
}
.syntaxhighlighter .line.alt1,
.syntaxhighlighter .line.alt2 { background: #f8fafc !important; }
.syntaxhighlighter .line.highlighted { background: var(--doc-primary-soft) !important; }
.syntaxhighlighter .gutter { color: #94a3b8 !important; background: #f8fafc !important; }
.syntaxhighlighter .gutter .line { border-right: 1px solid var(--doc-border) !important; }
.syntaxhighlighter .plain, .syntaxhighlighter .plain a { color: #334155 !important; }
.syntaxhighlighter .comments, .syntaxhighlighter .comments a { color: #94a3b8 !important; }
.syntaxhighlighter .string, .syntaxhighlighter .string a { color: #059669 !important; }
.syntaxhighlighter .keyword { color: #7c3aed !important; }
.syntaxhighlighter .variable { color: var(--doc-primary) !important; }
.syntaxhighlighter .functions { color: #db2777 !important; }
.syntaxhighlighter .constants { color: #ea580c !important; }
.layui-elem-quote > p:last-child { margin-bottom: 0; }

/* 右侧浮动目录 */
#content-toc-wrap {
    display: none;
    position: fixed;
    width: 220px;
    top: 92px;
    right: 28px;
    z-index: 99;
    border: 1px solid var(--doc-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 10px 30px rgba(31, 41, 55, .08);
    overflow: hidden;
}
.doc-toc-list { padding: 8px; max-height: calc(100vh - 180px); overflow: auto; }
.content-toc-title {
    padding: 11px 14px !important;
    border-bottom: 1px solid var(--doc-border);
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
}
#content-toc > ol { padding: 8px; }
#content-toc li { line-height: 30px; font-size: 12.5px; }
#content-toc a { color: var(--doc-muted); }
#content-toc a:hover { color: var(--doc-primary); }

/* ---------- 文档首页 Hero ---------- */
.doc-hero {
    position: relative;
    overflow: hidden;
    margin: 0 0 32px;
    padding: 32px 36px 34px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(125deg, #1d4ed8 0%, #2563eb 48%, #0ea5e9 100%);
    box-shadow: 0 14px 32px rgba(37, 99, 235, .22);
}
.doc-hero:before,
.doc-hero:after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .10);
    pointer-events: none;
}
.doc-hero:before { width: 230px; height: 230px; right: -50px; top: -110px; }
.doc-hero:after { width: 150px; height: 150px; right: 110px; bottom: -95px; background: rgba(255, 255, 255, .07); }
.doc-hero > * { position: relative; z-index: 1; }
.doc-hero__eyebrow {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .22);
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
}
#article-content.markdown-body .doc-hero__title {
    margin: 16px 0 8px;
    padding: 0;
    border: 0;
    color: #fff;
    font-size: 27px;
    font-weight: 600;
    line-height: 1.4;
}
/* 正文 p 的颜色规则特异性更高，这里需抬高选择器，
   否则浅色主题的蓝色横幅上会出现深灰文字，几乎看不清 */
#article-content.markdown-body .doc-hero__desc,
html[data-doc-theme="dark"] #article-content.markdown-body .doc-hero__desc {
    max-width: 620px;
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.8;
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(2, 32, 71, .22);
}
.doc-hero__links { display: flex; flex-wrap: wrap; gap: 10px; }
#article-content.markdown-body .doc-hero__links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .30);
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}
#article-content.markdown-body .doc-hero__links a:hover {
    background: #fff;
    color: var(--doc-primary-dark);
    border-color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .14);
}

/* ---------- 主题切换按钮 ---------- */
.doc-theme-item {
    position: relative;
    line-height: var(--doc-header-height);
    margin-right: 12px;
}
.doc-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font: inherit;
    line-height: 1;
    border-radius: 10px;
    border: 1px solid var(--doc-border);
    background: #fff;
    color: var(--doc-muted);
    vertical-align: middle;
    transition: all .2s ease;
}
.doc-theme-toggle:hover {
    color: var(--doc-primary);
    border-color: var(--doc-primary);
    background: var(--doc-primary-soft);
}
.doc-theme-toggle svg { width: 17px; height: 17px; display: block; }

/* ---------- 外观设置下拉菜单（跟随系统 / 浅色 / 深色） ---------- */
.doc-theme-menu {
    position: absolute;
    top: calc(var(--doc-header-height) - 4px);
    right: 0;
    z-index: 10000;
    width: 214px;
    padding: 8px;
    border: 1px solid var(--doc-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(15, 23, 42, .16);
    text-align: left;
    line-height: 1.5;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.doc-theme-menu.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.doc-theme-menu-title {
    padding: 4px 10px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--doc-muted);
    letter-spacing: .3px;
}
.doc-theme-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 10px;
    margin: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--doc-text);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.doc-theme-menu-item:hover { background: var(--doc-primary-soft); color: var(--doc-primary); }
.doc-theme-menu-item .dtm-icon { display: inline-flex; width: 16px; height: 16px; flex: none; }
.doc-theme-menu-item .dtm-icon svg { width: 16px; height: 16px; display: block; }
.doc-theme-menu-item .dtm-label { flex: 1; }
.doc-theme-menu-item .dtm-check { width: 14px; font-size: 13px; color: var(--doc-primary); opacity: 0; }
.doc-theme-menu-item.is-active { color: var(--doc-primary); background: var(--doc-primary-soft); font-weight: 600; }
.doc-theme-menu-item.is-active .dtm-check { opacity: 1; }
.doc-theme-menu-tip {
    margin-top: 6px;
    padding: 8px 10px 2px;
    border-top: 1px solid var(--doc-border);
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--doc-muted);
}

.doc-toc-link { display: block; padding: 2px 8px; border-radius: 6px; border: 0 !important; font-size: 12.5px; }
.doc-toc-link:hover { background: var(--doc-primary-soft); }
.doc-toc-link.toc-active { color: var(--doc-primary) !important; background: var(--doc-primary-soft); font-weight: 600; }
.doc-toc-link.toc-level-2 { padding-left: 18px; }
.doc-toc-link.toc-level-3 { padding-left: 28px; }

/* ---------- 深色主题（参考现代文档站：深色底 + 青绿强调色） ---------- */
html[data-doc-theme="dark"] { color-scheme: dark; }
html[data-doc-theme="dark"] body,
html[data-doc-theme="dark"] #body,
html[data-doc-theme="dark"] #content_body { background: #101215 !important; color: #e5e7eb !important; }
html[data-doc-theme="dark"] ::-webkit-scrollbar-thumb { background: #3a414c; background-clip: padding-box; }
html[data-doc-theme="dark"] #navbar,
html[data-doc-theme="dark"] #navbar .bg-blur { background: #161a1f !important; border-bottom-color: #272d36 !important; }
html[data-doc-theme="dark"] #navbar .navbar-body > .layui-nav .layui-nav-item a { color: #a1a1aa !important; }
html[data-doc-theme="dark"] #navbar .navRight .layui-nav-item a { background: rgba(16, 185, 129, .12) !important; color: #34d399 !important; }
html[data-doc-theme="dark"] #navbar .navRight .layui-nav-item a:hover { background: #10b981 !important; color: #08130f !important; }
html[data-doc-theme="dark"] .doc-theme-toggle { background: #1d2229; border-color: #3a4652; color: #cbd5e1; }
html[data-doc-theme="dark"] .doc-theme-toggle:hover { color: #34d399; border-color: #10b981; background: rgba(16, 185, 129, .12); }
html[data-doc-theme="dark"] .doc-theme-menu { background: #1d2229; border-color: #2d3540; box-shadow: 0 14px 40px rgba(0, 0, 0, .5); }
html[data-doc-theme="dark"] .doc-theme-menu-title,
html[data-doc-theme="dark"] .doc-theme-menu-tip { color: #8b949e; }
html[data-doc-theme="dark"] .doc-theme-menu-tip { border-top-color: #2d3540; }
html[data-doc-theme="dark"] .doc-theme-menu-item { color: #cbd5e1; }
html[data-doc-theme="dark"] .doc-theme-menu-item:hover { background: rgba(16, 185, 129, .12); color: #34d399; }
html[data-doc-theme="dark"] .doc-theme-menu-item.is-active { background: rgba(16, 185, 129, .14); color: #34d399; }
html[data-doc-theme="dark"] .doc-theme-menu-item .dtm-check { color: #34d399; }
html[data-doc-theme="dark"] #leftbar { background: #161a1f !important; border-right-color: #272d36 !important; box-shadow: none; }
html[data-doc-theme="dark"] #leftbar .layui-tab-title { border-bottom-color: #272d36 !important; }
html[data-doc-theme="dark"] #leftbar .layui-tab-title li { color: #e5e7eb !important; }
html[data-doc-theme="dark"] #leftbar .layui-tab-title li .layui-icon { color: #34d399 !important; }
html[data-doc-theme="dark"] #leftbar .layui-tab-title .layui-this:after { border-bottom-color: #10b981 !important; }
html[data-doc-theme="dark"] #leftbar .copyright { background: #161a1f !important; border-top-color: #272d36 !important; color: #71717a !important; }
html[data-doc-theme="dark"] .ztree li ul { background: transparent !important; }
html[data-doc-theme="dark"] .ztree li a { color: #a1a1aa !important; }
html[data-doc-theme="dark"] .ztree li.level0 > a { color: #e5e7eb !important; }
html[data-doc-theme="dark"] .ztree li a:hover { color: #34d399 !important; }
html[data-doc-theme="dark"] .ztree li a:hover::before { background: #1e242b !important; }
html[data-doc-theme="dark"] .ztree li a.curSelectedNode { color: #34d399 !important; }
html[data-doc-theme="dark"] .ztree li a.curSelectedNode::before { background: rgba(16, 185, 129, .12) !important; }
html[data-doc-theme="dark"] .ztree li a.curSelectedNode::after { background: #10b981 !important; }
html[data-doc-theme="dark"] .ztree li a.curSelectedNode span { color: #34d399 !important; }
html[data-doc-theme="dark"] .ztree li a span.button.switch { filter: invert(.7) saturate(.5); }
html[data-doc-theme="dark"] #searchForm,
html[data-doc-theme="dark"] #treeSearch > li { border-bottom-color: #272d36 !important; }
html[data-doc-theme="dark"] .inputBox .layui-input { background: #1b2027 !important; border-color: #2d3540 !important; color: #e5e7eb !important; }
html[data-doc-theme="dark"] .inputBox .layui-input:focus { border-color: #10b981 !important; background: #161a1f !important; box-shadow: 0 0 0 3px rgba(16, 185, 129, .12); }
html[data-doc-theme="dark"] #treeSearch h3 { color: #e5e7eb !important; }
html[data-doc-theme="dark"] #treeSearch strong { color: #34d399 !important; }
html[data-doc-theme="dark"] #mask { background-color: rgba(0, 0, 0, .62) !important; }
html[data-doc-theme="dark"] #article-content.markdown-body {
    background: #171b21 !important;
    border-color: #272d36 !important;
    box-shadow: 0 12px 38px rgba(0, 0, 0, .34) !important;
    color: #e5e7eb !important;
}
html[data-doc-theme="dark"] #article-content.markdown-body h1,
html[data-doc-theme="dark"] #article-content.markdown-body h2,
html[data-doc-theme="dark"] #article-content.markdown-body h3,
html[data-doc-theme="dark"] #article-content.markdown-body h4 { color: #fafafa !important; }
html[data-doc-theme="dark"] #article-content.markdown-body h1 { border-bottom-color: #272d36 !important; }
html[data-doc-theme="dark"] #article-content.markdown-body h1:after { background: linear-gradient(90deg, #10b981, #34d399) !important; }
html[data-doc-theme="dark"] #article-content.markdown-body h2 { border-left-color: #10b981 !important; }
html[data-doc-theme="dark"] #article-content.markdown-body p,
html[data-doc-theme="dark"] #article-content.markdown-body li,
html[data-doc-theme="dark"] #article-content.markdown-body dd { color: #b4bcc8 !important; }
html[data-doc-theme="dark"] #article-content.markdown-body a { color: #34d399 !important; border-bottom-color: rgba(52, 211, 153, .32) !important; }
html[data-doc-theme="dark"] #article-content.markdown-body h1 > a,
html[data-doc-theme="dark"] #article-content.markdown-body h2 > a,
html[data-doc-theme="dark"] #article-content.markdown-body h3 > a,
html[data-doc-theme="dark"] #article-content.markdown-body h4 > a { color: inherit !important; }
html[data-doc-theme="dark"] #article-content.markdown-body strong { color: #fafafa !important; }
html[data-doc-theme="dark"] #article-content.markdown-body hr { background: linear-gradient(90deg, #2d3540, transparent) !important; }
html[data-doc-theme="dark"] #article-content.markdown-body code {
    background: rgba(16, 185, 129, .10) !important;
    border-color: rgba(16, 185, 129, .22) !important;
    color: #5eead4 !important;
}
html[data-doc-theme="dark"] #article-content.markdown-body ul > li:before { background: #10b981 !important; }
html[data-doc-theme="dark"] #article-content.markdown-body table,
html[data-doc-theme="dark"] #article-content.markdown-body table.layui-table { background: #171b21 !important; border-color: #2d3540 !important; }
html[data-doc-theme="dark"] #article-content.markdown-body table th,
html[data-doc-theme="dark"] #article-content.markdown-body table.layui-table th { background: #1e242b !important; color: #e5e7eb !important; border-bottom-color: #2d3540 !important; }
html[data-doc-theme="dark"] #article-content.markdown-body table td,
html[data-doc-theme="dark"] #article-content.markdown-body table.layui-table td { border-bottom-color: #242a32 !important; color: #b4bcc8 !important; }
html[data-doc-theme="dark"] #article-content.markdown-body table tbody tr:nth-child(even) { background: #1b2026 !important; }
html[data-doc-theme="dark"] #article-content.markdown-body table tbody tr:hover { background: rgba(16, 185, 129, .07) !important; }
html[data-doc-theme="dark"] #article-content.markdown-body blockquote,
html[data-doc-theme="dark"] #article-content.markdown-body .layui-elem-quote {
    background: rgba(16, 185, 129, .08) !important;
    border-color: rgba(16, 185, 129, .20) !important;
    border-left-color: #10b981 !important;
    color: #a7f3d0 !important;
}
html[data-doc-theme="dark"] .syntaxhighlighter,
html[data-doc-theme="dark"] .syntaxhighlighter .line.alt1,
html[data-doc-theme="dark"] .syntaxhighlighter .line.alt2,
html[data-doc-theme="dark"] .syntaxhighlighter .gutter { background: #12161b !important; border-color: #2d3540 !important; }
html[data-doc-theme="dark"] .syntaxhighlighter .gutter { color: #6b7280 !important; }
html[data-doc-theme="dark"] .syntaxhighlighter .gutter .line { border-right-color: #2d3540 !important; }
html[data-doc-theme="dark"] .syntaxhighlighter .plain,
html[data-doc-theme="dark"] .syntaxhighlighter .plain a { color: #d4d4d8 !important; }
html[data-doc-theme="dark"] .syntaxhighlighter .comments { color: #6b7280 !important; }
html[data-doc-theme="dark"] .syntaxhighlighter .string { color: #34d399 !important; }
html[data-doc-theme="dark"] .syntaxhighlighter .keyword { color: #c084fc !important; }
html[data-doc-theme="dark"] .syntaxhighlighter .variable { color: #38bdf8 !important; }
html[data-doc-theme="dark"] .syntaxhighlighter .functions { color: #fb7185 !important; }
html[data-doc-theme="dark"] .syntaxhighlighter .constants { color: #fbbf24 !important; }
html[data-doc-theme="dark"] #content-toc-wrap { background: rgba(23, 27, 33, .96) !important; border-color: #2d3540 !important; box-shadow: 0 10px 30px rgba(0, 0, 0, .35) !important; }
html[data-doc-theme="dark"] .content-toc-title { background: #1e242b !important; border-bottom-color: #2d3540 !important; color: #e5e7eb !important; }
html[data-doc-theme="dark"] #content-toc a,
html[data-doc-theme="dark"] .doc-toc-link { color: #9ca3af !important; }
html[data-doc-theme="dark"] #content-toc a:hover,
html[data-doc-theme="dark"] .doc-toc-link:hover { color: #34d399 !important; background: rgba(16, 185, 129, .10) !important; }
html[data-doc-theme="dark"] .doc-toc-link.toc-active { color: #34d399 !important; background: rgba(16, 185, 129, .12) !important; }
html[data-doc-theme="dark"] .doc-hero { background: linear-gradient(125deg, #064e3b 0%, #0f766e 55%, #0e7490 100%) !important; box-shadow: 0 14px 32px rgba(0, 0, 0, .38) !important; }
html[data-doc-theme="dark"] #article-content.markdown-body .doc-hero__links a:hover { color: #064e3b !important; }

/* ---------- 响应式 ---------- */
@media screen and (max-width: 1100px) {
    #article-content.markdown-body { max-width: none; margin: 24px 24px 48px; }
}
@media screen and (max-width: 768px) {
    :root { --doc-header-height: 56px; }
    #navbar .navbar-body { padding: 0 12px; }
    #navbar .logo > img { height: 30px; }
    #leftbar { width: 280px; left: -280px !important; }
    #leftbar.show-item { left: 0 !important; }
    #body { padding-left: 0; }
    #navbar .navbar-body > .layui-nav.show-item { top: var(--doc-header-height); }
    #navbar .navRight .layui-nav-item a { margin-top: 0; }
    #article-content.markdown-body {
        margin: 16px 12px 36px;
        padding: 22px 18px 28px;
        border-radius: 14px;
        font-size: 14px;
    }
    #article-content.markdown-body h1 { font-size: 22px; }
    #article-content.markdown-body h2 { font-size: 18px; margin-top: 30px; }
    .doc-hero { padding: 24px 20px 26px; }
    #article-content.markdown-body .doc-hero__title { font-size: 21px; }
    .doc-hero__desc { font-size: 13px; }
    #content-toc-wrap { display: none; }
    #article-content.markdown-body table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* 宽屏三栏布局：正文按剩余宽度自适应铺开，右侧固定展示本页目录。
   容器右侧预留 TOC 空间，正文用 auto 宽度 + auto 边距在可用区内居中；
   2K/4K 超宽屏再限制最大宽度，避免正文单行过长影响阅读。 */
@media screen and (min-width: 1440px) {
    #content_body {
        box-sizing: border-box !important;
        padding-left: 40px;
        padding-right: 280px; /* 右侧 TOC 220 + 右距 28 + 间隙 32 */
    }
    #article-content.markdown-body {
        width: auto;
        max-width: 1400px;
        margin: 28px auto 64px;
    }
    #content-toc-wrap { display: block; }
}
