/**
 * MarkTreeDoc Base Layout & Pure CSS Interactions (Zero JavaScript)
 */

:root {
  --mtd-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mtd-code-font: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  --mtd-bg: #ffffff;
  --mtd-card-bg: #f8fafc;
  --mtd-border: #e2e8f0;
  --mtd-border-hover: #cbd5e1;
  --mtd-text-main: #1e293b;
  --mtd-text-muted: #64748b;
  --mtd-text-light: #94a3b8;
  --mtd-primary: #2563eb;
  --mtd-primary-hover: #1d4ed8;
  --mtd-primary-light: #eff6ff;
  --mtd-sidebar-bg: #f8fafc;
  --mtd-sidebar-width: 280px;
  --mtd-toc-width: 240px;
  --mtd-topbar-height: 58px;
  --mtd-shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --mtd-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
  --mtd-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.05);
  --mtd-radius-sm: 6px;
  --mtd-radius-md: 10px;
  --mtd-radius-lg: 14px;
  --mtd-sticky-top: calc(var(--c-gc-header-height, 70px) + var(--admin-bar-height, 0px));
}

body.admin-bar {
  --mtd-sticky-top: calc(var(--c-gc-header-height, 70px) + 32px);
}

/* 移动端媒体查询兜底：无冻结 header 时紧贴屏幕顶端（0px），登录 WP 时紧贴 admin bar（46px） */
@media (max-width: 992px) {
  :root {
    --mtd-sticky-top: 0px;
  }
  body.admin-bar {
    --mtd-sticky-top: 46px;
  }
}

/* Screen reader only hidden controls */
.mtd-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Main Container Shell */
.mtd-container {
  box-sizing: border-box;
  font-family: var(--mtd-font);
  color: var(--mtd-text-main);
  background-color: var(--mtd-bg);
  border: 1px solid var(--mtd-border);
  border-radius: var(--mtd-radius-lg);
  box-shadow: var(--mtd-shadow-md);
  margin: 16px auto;
  max-width: 100%;
  width: 100%;
  overflow: visible;
  line-height: 1.65;
  position: relative;
}

.mtd-container * {
  box-sizing: border-box;
}

/* Top Bar (PC 端不冻结显示，随页面正常滚动；移动端保持冻结) */
.mtd-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--mtd-topbar-height, 52px);
  padding: 10px 24px;
  background: var(--mtd-bg, #ffffff);
  border-bottom: 1px solid var(--mtd-border);
  position: relative;
  z-index: 500;
  gap: 16px;
}

.mtd-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.mtd-btn-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--mtd-card-bg);
  border: 1px solid var(--mtd-border);
  border-radius: var(--mtd-radius-sm);
  color: var(--mtd-text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}

.mtd-btn-sidebar-toggle:hover {
  background: var(--mtd-primary-light);
  color: var(--mtd-primary);
  border-color: var(--mtd-primary);
}

.mtd-doc-brand {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--mtd-text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.mtd-topbar-divider {
  width: 1px;
  height: 16px;
  background: var(--mtd-border);
  flex-shrink: 0;
  margin: 0 4px;
}

.mtd-topbar-breadcrumbs-wrapper {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.mtd-topbar-breadcrumb-pane {
  display: none;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.mtd-bc-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  position: relative;
}

/* 1. 整条面包屑横向滑动视口 (包含祖先路径与当前章节按钮，支持移动端/PC端流畅左右平滑滑动) */
.mtd-bc-scroller,
.mtd-bc-ancestors-scroller {
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  padding: 4px 0;
  flex: 1;
  min-width: 0;
}

.mtd-bc-scroller::-webkit-scrollbar,
.mtd-bc-ancestors-scroller::-webkit-scrollbar {
  display: none;
}

.mtd-bc-track,
.mtd-bc-ancestors-track {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--mtd-text-muted);
  flex-shrink: 0;
}

.mtd-bc-item {
  color: var(--mtd-text-muted);
  white-space: nowrap;
}

/* 面包屑内部文档集标题项 (桌面端默认由外层大标题展示，移动端由内部整轨滑动) */
.mtd-bc-root-brand {
  display: none;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--mtd-text-main, #0f172a);
  white-space: nowrap;
  flex-shrink: 0;
}
.mtd-bc-brand-sep {
  display: none;
}

.mtd-bc-item.mtd-bc-link,
a.mtd-bc-item {
  color: var(--mtd-text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
  padding: 1px 4px;
  border-radius: 3px;
}

.mtd-bc-item.mtd-bc-link:hover,
a.mtd-bc-item:hover {
  color: var(--mtd-primary, #2563eb);
  background: rgba(37, 99, 235, 0.08);
  text-decoration: none;
}

.mtd-bc-sep {
  color: var(--mtd-text-light);
  user-select: none;
}

/* 2. 当前文章标题与 TOC 下拉层（独立于祖先滚动层，不受任何 overflow 截断） */
.mtd-bc-current-section {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

/* 触发按钮 */
.mtd-bc-current-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--mtd-radius-sm);
  background: var(--mtd-primary-light);
  color: var(--mtd-primary);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1.4;
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.mtd-bc-current-btn * {
  pointer-events: none;
}

.mtd-bc-current-btn:hover {
  background: var(--mtd-primary);
  color: #ffffff;
  border-color: var(--mtd-primary);
}

.mtd-bc-current-btn.no-toc {
  cursor: default;
  background: var(--mtd-card-bg);
  color: var(--mtd-text-main);
  border-color: var(--mtd-border);
}

.mtd-bc-toc-arrow {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.mtd-bc-toc-arrow-svg {
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.mtd-bc-toc-check:checked ~ .mtd-bc-current-btn .mtd-bc-toc-arrow,
.mtd-bc-toc-check:checked ~ .mtd-bc-current-btn .mtd-bc-toc-arrow-svg {
  transform: rotate(180deg);
}

/* 动态变动标题容器 */
.mtd-bc-title-viewport {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mtd-bc-title-active {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  line-height: inherit;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* 动态跟随阅读滚动的标题显示元素 */
.mtd-bc-title-display {
  display: inline-block;
  transition: opacity 0.15s ease;
}

.mtd-bc-title-display.is-changing {
  opacity: 0.3;
}

/* 隐藏章节元数据标签 */
.mtd-bc-title-sec {
  display: none !important;
}

/* TOC 弹窗大纲当前阅读章节高亮 */
.mtd-bc-toc-a.is-active {
  color: var(--mtd-primary, #2563eb) !important;
  font-weight: 700 !important;
  background: var(--mtd-primary-light, #eff6ff) !important;
  border-radius: 4px;
}

/* 全屏遮罩层：点击页面任意位置立即收起下拉，层级高于一切侧栏与普通元素 */
.mtd-bc-toc-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9998;
  background: transparent;
  cursor: default;
}

.mtd-bc-toc-check:checked ~ .mtd-bc-toc-backdrop {
  display: block;
}

/* TOC 章节大纲展开浮层：超高层叠等级，浮动在文档目录与一切内容上方，永不被遮挡 */
.mtd-bc-toc-popover {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  max-width: 380px;
  max-height: 440px;
  overflow-y: auto;
  background: var(--mtd-card-bg, #ffffff);
  border: 1px solid var(--mtd-border);
  border-radius: var(--mtd-radius-md);
  box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.22), 0 6px 16px -4px rgba(0, 0, 0, 0.12);
  padding: 0;
  z-index: 9999;
  animation: mtdScaleUp 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.mtd-bc-toc-check:checked ~ .mtd-bc-toc-popover {
  display: block;
}

.mtd-bc-toc-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--mtd-border);
  background: var(--mtd-bg);
  position: sticky;
  top: 0;
  z-index: 2;
}

.mtd-bc-toc-popover-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--mtd-text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mtd-bc-toc-close-btn {
  font-size: 18px;
  line-height: 1;
  color: var(--mtd-text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--mtd-radius-sm);
  transition: all 0.15s;
}

.mtd-bc-toc-close-btn:hover {
  color: var(--mtd-primary);
  background: var(--mtd-primary-light);
}

.mtd-bc-toc-list,
.mtd-bc-toc-ul,
ul.mtd-bc-toc-ul {
  list-style: none !important;
  list-style-type: none !important;
  margin: 0 !important;
  padding: 6px 0 10px !important;
}

.mtd-bc-toc-item,
.mtd-bc-toc-li,
li.mtd-bc-toc-li {
  list-style: none !important;
  list-style-type: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.mtd-bc-toc-item::before,
.mtd-bc-toc-item::after,
.mtd-bc-toc-li::before,
.mtd-bc-toc-li::after,
li.mtd-bc-toc-li::before,
li.mtd-bc-toc-li::after {
  content: none !important;
  display: none !important;
}

.mtd-bc-toc-a {
  display: flex;
  align-items: center;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--mtd-text-main);
  text-decoration: none;
  transition: all 0.12s ease;
  line-height: 1.4;
  white-space: normal;
}

.mtd-bc-toc-a:hover {
  background: var(--mtd-primary-light);
  color: var(--mtd-primary);
}

.mtd-bc-toc-li.mtd-bc-toc-top .mtd-bc-toc-a {
  font-weight: 700;
  color: var(--mtd-primary);
  border-bottom: 1px dashed var(--mtd-border);
  margin-bottom: 4px;
}

.mtd-bc-toc-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--mtd-primary-light);
  color: var(--mtd-primary);
  margin-left: auto;
  font-weight: 500;
}

.mtd-bc-toc-dash {
  color: var(--mtd-text-light);
  margin-right: 4px;
  user-select: none;
}

.mtd-bc-toc-li.depth-2 .mtd-bc-toc-a {
  padding-left: 20px;
  font-size: 12.5px;
  color: var(--mtd-text-muted);
}

.mtd-bc-toc-li.depth-3 .mtd-bc-toc-a {
  padding-left: 32px;
  font-size: 12px;
  color: var(--mtd-text-light);
}

.mtd-bc-toc-li.depth-4 .mtd-bc-toc-a {
  padding-left: 44px;
  font-size: 11.5px;
  color: var(--mtd-text-light);
}

/* Global Collapse Controls (Expand All / Collapse All) */
.mtd-global-collapse-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--mtd-card-bg);
  padding: 3px;
  border-radius: var(--mtd-radius-sm);
  border: 1px solid var(--mtd-border);
}

.mtd-btn-collapse-toggle {
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mtd-text-muted);
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.mtd-btn-collapse-toggle:hover {
  color: var(--mtd-text-main);
  background: rgba(0, 0, 0, 0.06);
}

/* Three Column Body Grid (Strict Flex Layout, No Floating Overlap) */
.mtd-body-grid {
  display: flex;
  min-height: 640px;
  position: relative;
  width: 100%;
  align-items: stretch;
  /* 核心：在 body-grid 左侧整列填充灰底背景，确保从顶到底整列无缝全灰 */
  background-image: linear-gradient(to right, var(--mtd-sidebar-bg, #f8fafc) var(--mtd-sidebar-width), transparent var(--mtd-sidebar-width));
  background-repeat: repeat-y;
}

/* Left Column: Tree Navigation (Pure Flex-based Collapse, Zero Covering) */
.mtd-sidebar-col {
  width: var(--mtd-sidebar-width);
  min-width: var(--mtd-sidebar-width);
  max-width: var(--mtd-sidebar-width);
  flex-shrink: 0;
  background-color: var(--mtd-sidebar-bg, #f8fafc);
  border-right: 1px solid var(--mtd-border);
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.28s, opacity 0.2s, padding 0.28s;
  position: relative;
}

.mtd-sidebar-inner {
  padding: 16px 14px;
  width: var(--mtd-sidebar-width);
}

.mtd-tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--mtd-text-muted);
  border-bottom: 1px dashed var(--mtd-border);
  margin-bottom: 12px;
}

.mtd-tree-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mtd-vscode-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--mtd-radius-sm);
  cursor: pointer;
  color: var(--mtd-text-muted);
  transition: all 0.15s ease;
  user-select: none;
}

.mtd-vscode-collapse-btn:hover {
  color: var(--mtd-primary);
  background: var(--mtd-primary-light);
}

/* 原生下载图标按钮样式 (零JS，原生HTML5 download触发) */
.mtd-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--mtd-radius-sm);
  cursor: pointer;
  color: var(--mtd-text-muted);
  text-decoration: none;
  transition: all 0.15s ease;
  user-select: none;
}

.mtd-tree-header-actions .mtd-download-btn {
  width: 24px;
  height: 24px;
}

.mtd-article-title-actions .mtd-download-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--mtd-border);
  background: var(--mtd-card-bg, #ffffff);
}

.mtd-download-btn:hover {
  color: var(--mtd-primary);
  border-color: var(--mtd-primary);
  background: var(--mtd-primary-light);
  transform: translateY(-1px);
}

.mtd-download-btn .mtd-svg-dl-icon {
  width: 15px;
  height: 15px;
}

/* VS Code 风格折叠/展开图标切换 */
.mtd-tree-collapse-all-check ~ * .mtd-vscode-collapse-btn .mtd-icon-col-all {
  display: inline-block;
}
.mtd-tree-collapse-all-check ~ * .mtd-vscode-collapse-btn .mtd-icon-exp-all {
  display: none;
}

.mtd-tree-collapse-all-check:checked ~ * .mtd-vscode-collapse-btn .mtd-icon-col-all {
  display: none;
}
.mtd-tree-collapse-all-check:checked ~ * .mtd-vscode-collapse-btn .mtd-icon-exp-all {
  display: inline-block;
}

/* 全部折叠激活时：隐藏所有子文档列表，并复位右侧指示箭头 */
.mtd-tree-collapse-all-check:checked ~ * .mtd-tree-details > ul {
  display: none !important;
}
.mtd-tree-collapse-all-check:checked ~ * .mtd-tree-details > summary .mtd-tree-expand-icon {
  transform: rotate(0deg) !important;
}

.mtd-sidebar-close-btn {
  font-size: 18px;
  cursor: pointer;
  color: var(--mtd-text-muted);
  line-height: 1;
}

.mtd-sidebar-close-btn:hover {
  color: var(--mtd-text-main);
}

/* Sidebar Toggle via pure CSS (Completely slides out, ZERO OVERLAY OCCLUSION) */
.mtd-control-sidebar-toggle:checked ~ .mtd-layout-shell .mtd-sidebar-col,
.mtd-container .mtd-control-sidebar-toggle:checked ~ .mtd-layout-shell .mtd-sidebar-col {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-right: none !important;
  overflow: hidden !important;
  overflow-y: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Tree Menu Nodes (No icons, pure clean doc tree) */
.mtd-tree-ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mtd-tree-ul.depth-1 {
  padding-left: 14px;
  border-left: none;
  margin-left: 0;
}

.mtd-tree-ul.depth-2 {
  padding-left: 14px;
  border-left: none;
  margin-left: 0;
}

.mtd-tree-li {
  margin-bottom: 4px;
}

.mtd-tree-item-row {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.mtd-tree-summary {
  display: block;
  padding: 0;
  border-radius: var(--mtd-radius-sm);
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background 0.15s ease;
}

.mtd-tree-summary::-webkit-details-marker {
  display: none;
}

.mtd-tree-summary-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.mtd-tree-summary-main:hover {
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--mtd-radius-sm);
}

/* 标题右侧出现允许展开符号 */
.mtd-tree-expand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--mtd-text-muted);
  transition: transform 0.2s ease, color 0.15s ease;
  flex-shrink: 0;
  cursor: pointer;
}

.mtd-tree-expand-icon:hover {
  color: var(--mtd-primary);
}

/* 展开时右侧箭头旋转 180 度 */
.mtd-tree-details[open] > .mtd-tree-summary .mtd-tree-expand-icon {
  transform: rotate(180deg);
  color: var(--mtd-primary);
}

/* 保证左侧目录树永远保持极简自然树状结构，彻底杜绝外层卡片框包裹与多余箭头干扰 */
.mtd-tree-details {
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.mtd-tree-details > summary {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.mtd-tree-details > summary::before {
  display: none !important;
  content: none !important;
}

.mtd-tree-tab-btn,
.mtd-tree-url-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 13.5px;
  color: var(--mtd-text-muted);
  border-radius: var(--mtd-radius-sm);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  flex: 1;
  min-width: 0;
}

.mtd-tree-parent-text {
  padding: 6px 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mtd-text-main);
  flex: 1;
  min-width: 0;
}

.mtd-tree-tab-btn:hover,
.mtd-tree-url-link:hover {
  color: var(--mtd-primary);
  background: var(--mtd-primary-light);
}

.mtd-tree-url-link.is-active {
  color: var(--mtd-primary);
  background: var(--mtd-primary-light);
  font-weight: 600;
}

.mtd-tree-ext-arrow {
  font-size: 11px;
  opacity: 0.7;
  margin-left: 2px;
}

.mtd-tree-label-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Center Content Column */
.mtd-content-col {
  flex: 1;
  min-width: 0;
  background: var(--mtd-bg);
  padding: 24px 38px 60px 32px; /* 右侧38px为外部悬挂TOC预留精致槽位 */
}

/* Articles inside panes - Hidden by default */
.mtd-article-pane {
  display: none;
  animation: mtdFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Fallback: if no radio checked, show first article */
.mtd-container .mtd-article-pane:first-child {
  display: block;
}

/* Radio selector rule: each tab index */
.mtd-control-tab-radio:checked ~ .mtd-layout-shell .mtd-article-pane {
  display: none !important;
}

/* Generate dynamic tabs via attribute selector pairing */
input[id*="-tab-0"]:checked ~ .mtd-layout-shell [id*="-pane-0"],
input[id*="-tab-1"]:checked ~ .mtd-layout-shell [id*="-pane-1"],
input[id*="-tab-2"]:checked ~ .mtd-layout-shell [id*="-pane-2"],
input[id*="-tab-3"]:checked ~ .mtd-layout-shell [id*="-pane-3"],
input[id*="-tab-4"]:checked ~ .mtd-layout-shell [id*="-pane-4"],
input[id*="-tab-5"]:checked ~ .mtd-layout-shell [id*="-pane-5"],
input[id*="-tab-6"]:checked ~ .mtd-layout-shell [id*="-pane-6"],
input[id*="-tab-7"]:checked ~ .mtd-layout-shell [id*="-pane-7"],
input[id*="-tab-8"]:checked ~ .mtd-layout-shell [id*="-pane-8"],
input[id*="-tab-9"]:checked ~ .mtd-layout-shell [id*="-pane-9"],
input[id*="-tab-10"]:checked ~ .mtd-layout-shell [id*="-pane-10"],
input[id*="-tab-11"]:checked ~ .mtd-layout-shell [id*="-pane-11"],
input[id*="-tab-12"]:checked ~ .mtd-layout-shell [id*="-pane-12"],
input[id*="-tab-13"]:checked ~ .mtd-layout-shell [id*="-pane-13"],
input[id*="-tab-14"]:checked ~ .mtd-layout-shell [id*="-pane-14"],
input[id*="-tab-15"]:checked ~ .mtd-layout-shell [id*="-pane-15"] {
  display: block !important;
}

/* Active Tab Navigation Item Highlight */
input[id*="-tab-0"]:checked ~ .mtd-layout-shell label[for*="-tab-0"],
input[id*="-tab-1"]:checked ~ .mtd-layout-shell label[for*="-tab-1"],
input[id*="-tab-2"]:checked ~ .mtd-layout-shell label[for*="-tab-2"],
input[id*="-tab-3"]:checked ~ .mtd-layout-shell label[for*="-tab-3"],
input[id*="-tab-4"]:checked ~ .mtd-layout-shell label[for*="-tab-4"],
input[id*="-tab-5"]:checked ~ .mtd-layout-shell label[for*="-tab-5"],
input[id*="-tab-6"]:checked ~ .mtd-layout-shell label[for*="-tab-6"],
input[id*="-tab-7"]:checked ~ .mtd-layout-shell label[for*="-tab-7"],
input[id*="-tab-8"]:checked ~ .mtd-layout-shell label[for*="-tab-8"],
input[id*="-tab-9"]:checked ~ .mtd-layout-shell label[for*="-tab-9"],
input[id*="-tab-10"]:checked ~ .mtd-layout-shell label[for*="-tab-10"],
input[id*="-tab-11"]:checked ~ .mtd-layout-shell label[for*="-tab-11"],
input[id*="-tab-12"]:checked ~ .mtd-layout-shell label[for*="-tab-12"],
input[id*="-tab-13"]:checked ~ .mtd-layout-shell label[for*="-tab-13"],
input[id*="-tab-14"]:checked ~ .mtd-layout-shell label[for*="-tab-14"],
input[id*="-tab-15"]:checked ~ .mtd-layout-shell label[for*="-tab-15"] {
  background: var(--mtd-primary-light) !important;
  color: var(--mtd-primary) !important;
  font-weight: 600 !important;
}

/* Topbar Breadcrumb Pane Toggle by Active Tab */
.mtd-topbar-breadcrumb-pane:first-child {
  display: inline-flex;
}
.mtd-control-tab-radio:checked ~ .mtd-layout-shell .mtd-topbar-breadcrumb-pane {
  display: none !important;
}
input[id*="-tab-0"]:checked ~ .mtd-layout-shell .mtd-bc-pane-0,
input[id*="-tab-1"]:checked ~ .mtd-layout-shell .mtd-bc-pane-1,
input[id*="-tab-2"]:checked ~ .mtd-layout-shell .mtd-bc-pane-2,
input[id*="-tab-3"]:checked ~ .mtd-layout-shell .mtd-bc-pane-3,
input[id*="-tab-4"]:checked ~ .mtd-layout-shell .mtd-bc-pane-4,
input[id*="-tab-5"]:checked ~ .mtd-layout-shell .mtd-bc-pane-5,
input[id*="-tab-6"]:checked ~ .mtd-layout-shell .mtd-bc-pane-6,
input[id*="-tab-7"]:checked ~ .mtd-layout-shell .mtd-bc-pane-7,
input[id*="-tab-8"]:checked ~ .mtd-layout-shell .mtd-bc-pane-8,
input[id*="-tab-9"]:checked ~ .mtd-layout-shell .mtd-bc-pane-9,
input[id*="-tab-10"]:checked ~ .mtd-layout-shell .mtd-bc-pane-10,
input[id*="-tab-11"]:checked ~ .mtd-layout-shell .mtd-bc-pane-11,
input[id*="-tab-12"]:checked ~ .mtd-layout-shell .mtd-bc-pane-12,
input[id*="-tab-13"]:checked ~ .mtd-layout-shell .mtd-bc-pane-13,
input[id*="-tab-14"]:checked ~ .mtd-layout-shell .mtd-bc-pane-14,
input[id*="-tab-15"]:checked ~ .mtd-layout-shell .mtd-bc-pane-15,
input[id*="-tab-16"]:checked ~ .mtd-layout-shell .mtd-bc-pane-16,
input[id*="-tab-17"]:checked ~ .mtd-layout-shell .mtd-bc-pane-17,
input[id*="-tab-18"]:checked ~ .mtd-layout-shell .mtd-bc-pane-18,
input[id*="-tab-19"]:checked ~ .mtd-layout-shell .mtd-bc-pane-19,
input[id*="-tab-20"]:checked ~ .mtd-layout-shell .mtd-bc-pane-20 {
  display: inline-flex !important;
}

/* 目录节点介绍弹出浮窗 (位于标题外部左侧，保证所有文章标题左边100%垂直对齐，叹号与标题间留白极小) */
.mtd-tree-intro-trigger {
  position: absolute;
  right: calc(100% + 2px); /* 位于标题按钮外侧左边，间隙仅 2px */
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  margin: 0;
  z-index: 10;
  flex-shrink: 0;
}

.mtd-tree-intro-icon {
  font-size: 11px;
  color: var(--mtd-text-muted);
  background: var(--mtd-card-bg, #ffffff);
  border: 1px solid var(--mtd-border);
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  line-height: 1;
  transition: all 0.15s ease;
  user-select: none;
}

.mtd-tree-intro-trigger:hover .mtd-tree-intro-icon,
.mtd-tree-intro-trigger:focus .mtd-tree-intro-icon {
  color: var(--mtd-primary);
  border-color: var(--mtd-primary);
  background: var(--mtd-primary-light);
}

.mtd-tree-intro-popover {
  display: none;
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #0f172a;
  color: #f8fafc;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
  width: max-content;
  max-width: 220px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  pointer-events: none;
}

.mtd-tree-intro-popover::after {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: transparent #0f172a transparent transparent;
}

.mtd-tree-intro-trigger:hover .mtd-tree-intro-popover,
.mtd-tree-intro-trigger:focus .mtd-tree-intro-popover,
.mtd-tree-intro-trigger:focus-within .mtd-tree-intro-popover {
  display: block;
  animation: mtdFadeIn 0.15s ease;
}

/* 侧栏吸顶跟随页面滚动 (Sticky 紧密贴合在上方冻结元素下方，0 缓冲绝不留空) */
.mtd-sidebar-col.mtd-sidebar-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: var(--mtd-sticky-top, 0px);
  max-height: calc(100vh - var(--mtd-sticky-top, 0px));
  overflow-y: auto;
  overflow-x: hidden;
  align-self: flex-start;
  z-index: 40;
  background-color: var(--mtd-sidebar-bg, #f8fafc);
}

.mtd-sidebar-col.mtd-sidebar-sticky .mtd-sidebar-inner {
  padding-top: 8px; /* 吸顶时上内边距紧贴，消除假性空隙 */
}

/* Breadcrumbs (保留兼容旧结构) */
.mtd-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--mtd-text-muted);
  margin-bottom: 20px;
  padding: 8px 14px;
  background: var(--mtd-card-bg);
  border-radius: var(--mtd-radius-sm);
  border: 1px solid var(--mtd-border);
}

.mtd-bc-sep {
  color: var(--mtd-text-light);
  user-select: none;
}

.mtd-bc-current {
  color: var(--mtd-text-main);
  font-weight: 600;
}

/* Article Header */
.mtd-article-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid var(--mtd-border);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.mtd-article-title-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mtd-article-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.mtd-vscode-box-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--mtd-radius-sm);
  cursor: pointer;
  color: var(--mtd-text-muted);
  border: 1px solid var(--mtd-border);
  background: var(--mtd-card-bg, #ffffff);
  transition: all 0.15s ease;
  user-select: none;
}

.mtd-vscode-box-btn:hover {
  color: var(--mtd-primary);
  border-color: var(--mtd-primary);
  background: var(--mtd-primary-light);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mtd-vscode-box-btn .mtd-svg-box-icon {
  width: 15px;
  height: 15px;
}

/* 文章顶部单按钮折叠/展开图标切换 */
.mtd-article-collapse-all-check ~ * .mtd-article-col-toggle-btn .mtd-icon-col-all {
  display: inline-block;
}
.mtd-article-collapse-all-check ~ * .mtd-article-col-toggle-btn .mtd-icon-exp-all {
  display: none;
}

.mtd-article-collapse-all-check:checked ~ * .mtd-article-col-toggle-btn .mtd-icon-col-all {
  display: none;
}
.mtd-article-collapse-all-check:checked ~ * .mtd-article-col-toggle-btn .mtd-icon-exp-all {
  display: inline-block;
}
.mtd-article-collapse-all-check:checked ~ * .mtd-article-col-toggle-btn {
  color: var(--mtd-primary);
  border-color: var(--mtd-primary);
  background: var(--mtd-primary-light);
  box-shadow: inset 0 1px 2px rgba(37, 99, 235, 0.1);
}

/* 当勾选全部折叠时，高亮激活折叠按钮 */
.mtd-control-collapse-all:checked ~ * .mtd-vscode-box-btn.mtd-act-col {
  color: var(--mtd-primary);
  border-color: var(--mtd-primary);
  background: var(--mtd-primary-light);
  box-shadow: inset 0 1px 2px rgba(37, 99, 235, 0.1);
}

/* 当勾选全部展开时，高亮激活展开按钮 */
.mtd-control-expand-all:checked ~ * .mtd-vscode-box-btn.mtd-act-exp {
  color: var(--mtd-primary);
  border-color: var(--mtd-primary);
  background: var(--mtd-primary-light);
  box-shadow: inset 0 1px 2px rgba(37, 99, 235, 0.1);
}

.mtd-article-main-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: var(--mtd-text-main);
  letter-spacing: -0.5px;
}

.mtd-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 9999px;
  background: var(--mtd-primary-light);
  color: var(--mtd-primary);
}

/* Article Content Layout (Center Doc + Right TOC) */
.mtd-article-content-flex {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  position: relative;
}

.mtd-article-markdown-flow {
  flex: 1;
  min-width: 0;
}

/* -------------------------------------------------------------
   Right Column: Dedicated Right Sidebar TOC (三栏布局之右栏)
   ------------------------------------------------------------- */
.mtd-right-toc-sidebar {
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  flex-shrink: 0;
  border-left: 1px solid var(--mtd-border);
  padding-left: 18px;
  box-sizing: border-box;
  align-self: flex-start;
}

/* 子选项: 跟随页面滚动 (Sticky 浮动在文章右侧视野内，避让站点 Header) */
.mtd-right-toc-sidebar.mtd-toc-is-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: var(--mtd-sticky-top, 0px);
  max-height: calc(100vh - var(--mtd-sticky-top, 0px) - 20px);
  overflow-y: auto;
}

/* -------------------------------------------------------------
   中间文章主题设置: 隐藏式 TOC (Notion 横条，漂浮在页面之上，避让 Header)
   ------------------------------------------------------------- */
.mtd-notion-dock-anchor {
  position: -webkit-sticky;
  position: sticky;
  top: var(--mtd-sticky-top, 0px);
  float: right;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  z-index: 999;
  pointer-events: none;
}

.mtd-notion-float-toc {
  position: absolute;
  top: 10px;
  right: -32px; /* 移到文章主体外部右侧 padding 的位置里，完全不遮挡正文 */
  pointer-events: auto;
  width: 28px;
  min-width: 28px;
  max-height: calc(100vh - var(--mtd-sticky-top, 0px) - 30px);
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--mtd-radius-md);
  box-shadow: none;
  padding: 6px 2px;
  cursor: pointer;
  opacity: 0.8; /* 透明度 80% */
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, padding 0.25s ease, background 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

/* 清除隐藏式 TOC 内部所有层级虚线与列表缩进，无任何相同层关系虚线 */
.mtd-notion-float-toc .mtd-toc-sublist,
.mtd-notion-float-toc .mtd-toc-loose-sub {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border-left: none !important;
}

.mtd-notion-float-toc details,
.mtd-notion-float-toc summary {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  list-style: none !important;
}

.mtd-notion-float-toc summary::-webkit-details-marker {
  display: none !important;
}

.mtd-notion-float-toc .mtd-toc-subitem,
.mtd-notion-float-toc .mtd-toc-item {
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
}

/* 未展开时：隐藏标题与文字，仅展现纯净的右靠齐长短横线条 (完全参考 Notion) */
.mtd-notion-float-toc .mtd-toc-title,
.mtd-notion-float-toc .mtd-toc-text {
  display: none;
}

.mtd-notion-float-toc .mtd-toc-link {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  width: 100% !important;
  padding: 2.5px 0 !important;
  text-decoration: none !important;
  border-radius: 2px !important;
}

.mtd-notion-float-toc .mtd-notion-bar {
  display: block !important;
  margin-left: auto !important; /* 强制所有横线条绝对右靠齐 */
  margin-right: 0 !important;
}

/* 悬停展开时：平滑向左展开完整目录卡片与文字 */
.mtd-notion-float-toc:hover {
  width: 250px;
  min-width: 250px;
  padding: 14px 16px;
  background: var(--mtd-card-bg, #ffffff);
  border-color: var(--mtd-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  opacity: 1;
  z-index: 99;
}

.mtd-notion-float-toc:hover .mtd-toc-title {
  display: flex;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--mtd-text-muted);
  margin-bottom: 10px;
  align-items: center;
  gap: 6px;
}

.mtd-notion-float-toc:hover .mtd-toc-link {
  justify-content: flex-start !important;
  padding: 5px 8px !important;
  border-radius: var(--mtd-radius-sm) !important;
}

.mtd-notion-float-toc:hover .mtd-notion-bar {
  margin-left: 0 !important;
  margin-right: 8px !important;
}

.mtd-notion-float-toc:hover .mtd-toc-link:hover {
  background: var(--mtd-primary-light);
}

.mtd-notion-float-toc:hover .mtd-toc-text {
  display: inline-block;
  opacity: 1;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--mtd-text-main);
  margin-left: 6px;
}

/* TOC 标题层级横线条固定槽位（保证横条绝对右对齐） */
.mtd-notion-bar-slot {
  width: 28px;
  min-width: 28px;
  display: inline-flex;
  justify-content: flex-end; /* 横条向右靠齐！*/
  align-items: center;
  margin-right: 8px;
  flex-shrink: 0;
}

.mtd-notion-float-toc:not(:hover) .mtd-notion-bar-slot {
  width: 100% !important;
  display: flex !important;
  justify-content: flex-end !important;
  margin-right: 0 !important;
}

.mtd-notion-float-toc:hover .mtd-notion-bar-slot {
  width: 28px !important;
  min-width: 28px !important;
  display: inline-flex !important;
  justify-content: flex-end !important;
  margin-right: 8px !important;
}

/* Notion 迷你地图横线条基础尺寸 (Minimap Bars) */
.mtd-notion-bar {
  display: inline-block;
  height: 2.5px;
  border-radius: 2px;
  background: #cbd5e1;
  vertical-align: middle;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

/* 不同标题级别的横线长度阶梯 (右靠齐显示不同等级，完全参考 Notion 图) */
.mtd-bar-l1 { width: 26px; }
.mtd-bar-l2 { width: 20px; }
.mtd-bar-l2.mtd-bar-var-0 { width: 22px; }
.mtd-bar-l2.mtd-bar-var-1 { width: 18px; }
.mtd-bar-l2.mtd-bar-var-2 { width: 20px; }
.mtd-bar-l2.mtd-bar-var-3 { width: 17px; }
.mtd-bar-l3 { width: 13px; }
.mtd-bar-l4 { width: 8px; }
.mtd-bar-l5, .mtd-bar-l6 { width: 5px; }

/* 随页面阅读滚动实时激活对应小节横线 (高亮为主题强调色，其它保持半透明浅灰) */
.mtd-toc-link.is-active {
  color: var(--mtd-primary, #2563eb) !important;
  font-weight: 600 !important;
}

.mtd-toc-link.is-active .mtd-notion-bar {
  background: var(--mtd-primary, #2563eb) !important;
  height: 3px !important;
  opacity: 1 !important;
  box-shadow: 0 0 3px rgba(37, 99, 235, 0.4) !important;
}

.mtd-toc-link:hover .mtd-notion-bar {
  background: var(--mtd-primary, #2563eb) !important;
}

.mtd-right-toc-sidebar,
.mtd-sticky-toc-box {
  font-size: 11.5px !important;
}

.mtd-toc-title {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  color: var(--mtd-text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Article Start TOC Card */
.mtd-toc-start-card {
  background: var(--mtd-card-bg);
  border: 1px solid var(--mtd-border);
  border-radius: var(--mtd-radius-md);
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 11.5px !important;
}

.mtd-toc-start-card .mtd-toc-title {
  margin-bottom: 6px;
  font-size: 11px !important;
}

/* TOC Links & Collapsible groups */
.mtd-toc-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mtd-toc-group {
  margin-bottom: 4px;
}

.mtd-toc-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 4px;
}

.mtd-toc-summary::-webkit-details-marker {
  display: none !important;
}

.mtd-toc-summary::marker,
.mtd-toc-group > summary::marker,
.mtd-toc-nav summary::marker,
.mtd-notion-float-toc summary::marker,
.mtd-right-toc-sidebar summary::marker {
  display: none !important;
  content: "" !important;
  font-size: 0 !important;
}

.mtd-toc-summary:hover {
  background: rgba(0, 0, 0, 0.04);
}

.mtd-toc-link,
.mtd-right-toc-sidebar .mtd-toc-link,
.mtd-toc-start-card .mtd-toc-link {
  color: var(--mtd-text-muted);
  text-decoration: none;
  flex: 1;
  transition: color 0.15s, background-color 0.15s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  font-size: 11.5px !important;
  line-height: 1.4 !important;
  padding: 2px 0;
  border-radius: 3px;
}

.mtd-toc-link:hover,
.mtd-right-toc-sidebar .mtd-toc-link:hover,
.mtd-toc-start-card .mtd-toc-link:hover {
  color: var(--mtd-primary);
}

.mtd-toc-l1, .mtd-right-toc-sidebar .mtd-toc-l1, .mtd-toc-start-card .mtd-toc-l1 { font-size: 12px !important; font-weight: 600 !important; color: var(--mtd-text-main); }
.mtd-toc-l2, .mtd-right-toc-sidebar .mtd-toc-l2, .mtd-toc-start-card .mtd-toc-l2 { font-size: 11.5px !important; font-weight: 500 !important; }
.mtd-toc-l3, .mtd-right-toc-sidebar .mtd-toc-l3, .mtd-toc-start-card .mtd-toc-l3 { font-size: 11px !important; font-weight: 400 !important; }
.mtd-toc-l4, .mtd-right-toc-sidebar .mtd-toc-l4, .mtd-toc-start-card .mtd-toc-l4 { font-size: 10.5px !important; font-weight: 400 !important; }
.mtd-toc-l5, .mtd-toc-l6, .mtd-right-toc-sidebar .mtd-toc-l5, .mtd-right-toc-sidebar .mtd-toc-l6, .mtd-toc-start-card .mtd-toc-l5, .mtd-toc-start-card .mtd-toc-l6 { font-size: 10.5px !important; font-weight: 400 !important; }

.mtd-toc-sublist,
.mtd-toc-loose-sub {
  list-style: none;
  margin: 2px 0 4px 10px;
  padding-left: 8px;
  border-left: 1px dashed var(--mtd-border);
}

.mtd-toc-subitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
}

/* Heading Sections with Folding / Collapsible Support (All Levels) */
.mtd-heading-fold-unit {
  margin-top: 1.6em;
  margin-bottom: 0.8em;
  position: relative;
}

.mtd-heading-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.mtd-heading-fold-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  font-size: 14px;
  line-height: 1;
  color: var(--mtd-text-muted);
  background: var(--mtd-card-bg);
  border: 1px solid var(--mtd-border);
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.mtd-heading-fold-btn:hover {
  background: var(--mtd-primary-light);
  color: var(--mtd-primary);
  border-color: var(--mtd-primary);
  transform: scale(1.08);
}

.mtd-heading-fold-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
  line-height: 1;
}

.mtd-heading-fold-content {
  padding-left: 32px;
  margin-top: 8px;
  transition: opacity 0.2s;
}

/* Headings with Anchor Copy Tag */
.mtd-heading,
.mtd-heading-fold-unit {
  scroll-margin-top: calc(var(--mtd-sticky-top, 70px) + 16px);
}

.mtd-heading {
  margin: 0 !important;
  font-weight: 700;
  color: var(--mtd-text-main);
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.mtd-heading-title-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  user-select: none;
}

.mtd-heading-title-label:hover .mtd-heading-text {
  color: var(--mtd-primary);
}

.mtd-h1 { font-size: 24px; border-bottom: 1px solid var(--mtd-border); padding-bottom: 8px; width: 100%; }
.mtd-heading-header-row .mtd-h1 { border-bottom: none !important; padding-bottom: 0 !important; }
.mtd-h2 { font-size: 20px; }
.mtd-h3 { font-size: 17px; }
.mtd-h4 { font-size: 15px; }

/* Copy Anchor Tag H1~H6 (Click to copy full link to clipboard) */
.mtd-anchor-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--mtd-text-light);
  text-decoration: none;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.45;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--mtd-code-font);
  background: rgba(0, 0, 0, 0.04);
  vertical-align: middle;
  letter-spacing: 0.5px;
  user-select: none;
}

.mtd-heading:hover .mtd-anchor-tag,
.mtd-anchor-tag:hover {
  opacity: 1;
  color: var(--mtd-primary);
  background: var(--mtd-primary-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Inline links with anchor preview badge (ONLY on human written anchor links) */
.mtd-link {
  color: var(--mtd-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.mtd-inline-preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 7px;
  margin-left: 5px;
  background: var(--mtd-primary-light);
  color: var(--mtd-primary);
  border-radius: 9999px;
  text-decoration: none;
  transition: transform 0.15s, background 0.15s;
  vertical-align: baseline;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.mtd-inline-preview-btn:hover {
  transform: scale(1.05);
  background: var(--mtd-primary);
  color: #ffffff;
}

/* Accordion & Native <details> / <summary> Foldable Blocks */
.mtd-accordion,
details.mtd-details {
  margin: 18px 0;
  border: 1px solid var(--mtd-border);
  border-radius: var(--mtd-radius-md);
  background: var(--mtd-card-bg);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mtd-accordion-summary,
details.mtd-details > summary,
summary.mtd-summary {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 12px 16px !important;
  font-weight: 600 !important;
  font-size: 14.5px !important;
  cursor: pointer !important;
  user-select: none !important;
  background: var(--mtd-card-bg) !important;
  list-style: none !important;
  list-style-type: none !important;
  outline: none !important;
  transition: background 0.15s ease;
}

/* 彻底清除一切 details / summary 原生浏览器默认黑三角 marker，防止双箭头 */
.mtd-container details summary,
details.mtd-details summary,
summary.mtd-summary,
.mtd-accordion-summary,
details summary {
  list-style: none !important;
  list-style-type: none !important;
}

.mtd-container details summary::-webkit-details-marker,
details.mtd-details summary::-webkit-details-marker,
details summary::-webkit-details-marker,
summary::-webkit-details-marker {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.mtd-container details summary::marker,
details.mtd-details summary::marker,
details summary::marker,
summary::marker {
  display: none !important;
  content: "" !important;
  font-size: 0 !important;
  color: transparent !important;
}

.mtd-accordion-summary:hover,
details.mtd-details > summary:hover,
summary.mtd-summary:hover {
  background: rgba(0, 0, 0, 0.03) !important;
}

/* 折叠面板的小三角箭头，与文章标题的 .mtd-heading-fold-arrow 保持 100% 相同样式与旋转机制 */
.mtd-summary-icon,
.mtd-summary-arrow {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
  line-height: 1 !important;
  color: var(--mtd-text-muted, #64748b) !important;
  transition: transform 0.2s ease !important;
  transform-origin: center center !important;
  transform: rotate(-90deg) !important; /* 默认闭合状态：指向右侧 */
}

/* 折叠面板展开状态：小三角旋转到 0deg 指向下方 ▾，与文章标题展开完全一致 */
details.mtd-details[open] > summary .mtd-summary-icon,
details.mtd-details[open] > summary .mtd-summary-arrow,
details[open] > summary .mtd-summary-arrow,
input.mtd-accordion-checkbox:checked ~ .mtd-accordion-summary .mtd-summary-icon,
input.mtd-accordion-checkbox:checked ~ .mtd-accordion-summary .mtd-summary-arrow {
  transform: rotate(0deg) !important;
}

/* 兜底保障：即使遇到任何未被转换的纯原生 details，也统一渲染展开小三角 ▾ 与卡片边框，彻底杜绝箭头丢失（严格排除左侧文档目录树 .mtd-tree-details） */
.mtd-article-markdown-flow details:not(.mtd-details):not(.mtd-tree-details),
details:not(.mtd-details):not(.mtd-tree-details):not(.mtd-docset-io-panel details) {
  margin: 14px 0;
  border: 1px solid var(--mtd-border);
  border-radius: var(--mtd-radius-md);
  background: var(--mtd-card-bg);
  overflow: hidden;
}

.mtd-article-markdown-flow details:not(.mtd-details):not(.mtd-tree-details) > summary,
details:not(.mtd-details):not(.mtd-tree-details):not(.mtd-docset-io-panel details) > summary {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  background: rgba(0, 0, 0, 0.015);
}

.mtd-article-markdown-flow details:not(.mtd-details):not(.mtd-tree-details) > summary::before,
details:not(.mtd-details):not(.mtd-tree-details):not(.mtd-docset-io-panel details) > summary::before {
  content: "▾";
  display: inline-flex;
  font-size: 13px;
  color: var(--mtd-text-muted, #64748b);
  transition: transform 0.2s ease;
  transform: rotate(-90deg);
}

.mtd-article-markdown-flow details:not(.mtd-details):not(.mtd-tree-details)[open] > summary::before,
details:not(.mtd-details):not(.mtd-tree-details):not(.mtd-docset-io-panel details)[open] > summary::before {
  transform: rotate(0deg);
}

.mtd-accordion-body,
.mtd-details-content {
  display: none;
  padding: 16px 18px;
  border-top: 1px solid var(--mtd-border);
  background: var(--mtd-bg);
}

details.mtd-details[open] > .mtd-details-content,
details.mtd-details[open] > .mtd-accordion-body {
  display: block !important;
}

/* -------------------------------------------------------------
   Heading & Accordion / Details Foldable Mechanics (Pure CSS Tri-State)
   ------------------------------------------------------------- */

/* Default State: Heading content is visible, Arrow points down (0deg) */
.mtd-heading-fold-content {
  display: block;
  padding-left: 32px;
  margin-top: 8px;
  transition: opacity 0.2s;
}

.mtd-heading-fold-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
  line-height: 1;
  transform: rotate(0deg);
}

/* 1. Default Mode: Clicking individual checkbox toggles folded state */
input.mtd-heading-fold-check:checked ~ .mtd-heading-fold-content {
  display: none;
}

input.mtd-heading-fold-check:checked ~ .mtd-heading-header-row .mtd-heading-fold-arrow {
  transform: rotate(-90deg);
}

input.mtd-accordion-checkbox:checked ~ .mtd-accordion-body {
  display: block;
}

input.mtd-accordion-checkbox:checked ~ .mtd-accordion-summary .mtd-summary-icon {
  transform: rotate(90deg);
}

/* 2. When 'Expand All' is active:
      Default is expanded for all headings and accordions.
      Clicking an individual item folds it! */
.mtd-control-expand-all:checked ~ .mtd-layout-shell .mtd-heading-fold-content,
.mtd-control-expand-all:checked ~ .mtd-layout-shell .mtd-accordion-body,
.mtd-control-expand-all:checked ~ .mtd-layout-shell details.mtd-details > .mtd-details-content,
.mtd-control-expand-all:checked ~ .mtd-layout-shell details.mtd-details > .mtd-accordion-body {
  display: block !important;
}

.mtd-control-expand-all:checked ~ .mtd-layout-shell .mtd-heading-fold-arrow {
  transform: rotate(0deg) !important;
}

.mtd-control-expand-all:checked ~ .mtd-layout-shell .mtd-summary-icon,
.mtd-control-expand-all:checked ~ .mtd-layout-shell .mtd-summary-arrow {
  transform: rotate(0deg) !important;
}

.mtd-control-expand-all:checked ~ .mtd-layout-shell input.mtd-heading-fold-check:checked ~ .mtd-heading-fold-content,
.mtd-control-expand-all:checked ~ .mtd-layout-shell input.mtd-accordion-checkbox:checked ~ .mtd-accordion-body {
  display: none !important;
}

.mtd-control-expand-all:checked ~ .mtd-layout-shell input.mtd-heading-fold-check:checked ~ .mtd-heading-header-row .mtd-heading-fold-arrow {
  transform: rotate(-90deg) !important;
}

.mtd-control-expand-all:checked ~ .mtd-layout-shell input.mtd-accordion-checkbox:checked ~ .mtd-accordion-summary .mtd-summary-icon,
.mtd-control-expand-all:checked ~ .mtd-layout-shell input.mtd-accordion-checkbox:checked ~ .mtd-accordion-summary .mtd-summary-arrow {
  transform: rotate(-90deg) !important;
}

/* 3. When 'Collapse All' is active:
      Default is collapsed for all headings and accordions.
      Clicking an individual item expands it! */
.mtd-control-collapse-all:checked ~ .mtd-layout-shell .mtd-heading-fold-content,
.mtd-control-collapse-all:checked ~ .mtd-layout-shell .mtd-accordion-body,
.mtd-control-collapse-all:checked ~ .mtd-layout-shell details.mtd-details > .mtd-details-content,
.mtd-control-collapse-all:checked ~ .mtd-layout-shell details.mtd-details > .mtd-accordion-body {
  display: none !important;
}

.mtd-control-collapse-all:checked ~ .mtd-layout-shell .mtd-heading-fold-arrow {
  transform: rotate(-90deg) !important;
}

.mtd-control-collapse-all:checked ~ .mtd-layout-shell .mtd-summary-icon,
.mtd-control-collapse-all:checked ~ .mtd-layout-shell .mtd-summary-arrow {
  transform: rotate(-90deg) !important;
}

.mtd-control-collapse-all:checked ~ .mtd-layout-shell input.mtd-heading-fold-check:checked ~ .mtd-heading-fold-content,
.mtd-control-collapse-all:checked ~ .mtd-layout-shell input.mtd-accordion-checkbox:checked ~ .mtd-accordion-body,
.mtd-control-collapse-all:checked ~ .mtd-layout-shell details.mtd-details[open] > .mtd-details-content,
.mtd-control-collapse-all:checked ~ .mtd-layout-shell details.mtd-details[open] > .mtd-accordion-body {
  display: block !important;
}

.mtd-control-collapse-all:checked ~ .mtd-layout-shell input.mtd-heading-fold-check:checked ~ .mtd-heading-header-row .mtd-heading-fold-arrow {
  transform: rotate(0deg) !important;
}

.mtd-control-collapse-all:checked ~ .mtd-layout-shell input.mtd-accordion-checkbox:checked ~ .mtd-accordion-summary .mtd-summary-icon,
.mtd-control-collapse-all:checked ~ .mtd-layout-shell details.mtd-details[open] > summary .mtd-summary-icon,
.mtd-control-collapse-all:checked ~ .mtd-layout-shell details.mtd-details[open] > summary .mtd-summary-arrow {
  transform: rotate(0deg) !important;
}

/* 4. 单按钮切换文章全部折叠:
      勾选时默认折叠正文所有标题和所有 <details> 折叠面板卡片，点击单个标题或折叠面板可单独展开；
      取消勾选时恢复默认展开状态 */
.mtd-article-collapse-all-check:checked ~ .mtd-layout-shell .mtd-heading-fold-content,
.mtd-article-collapse-all-check:checked ~ .mtd-layout-shell .mtd-accordion-body,
.mtd-article-collapse-all-check:checked ~ .mtd-layout-shell details.mtd-details:not([open]) > .mtd-details-content,
.mtd-article-collapse-all-check:checked ~ .mtd-layout-shell details.mtd-details:not([open]) > .mtd-accordion-body {
  display: none !important;
}

.mtd-article-collapse-all-check:checked ~ .mtd-layout-shell .mtd-heading-fold-arrow {
  transform: rotate(-90deg) !important;
}

.mtd-article-collapse-all-check:checked ~ .mtd-layout-shell .mtd-summary-icon,
.mtd-article-collapse-all-check:checked ~ .mtd-layout-shell .mtd-summary-arrow {
  transform: rotate(-90deg) !important;
}

.mtd-article-collapse-all-check:checked ~ .mtd-layout-shell input.mtd-heading-fold-check:checked ~ .mtd-heading-fold-content,
.mtd-article-collapse-all-check:checked ~ .mtd-layout-shell input.mtd-accordion-checkbox:checked ~ .mtd-accordion-body,
.mtd-article-collapse-all-check:checked ~ .mtd-layout-shell details.mtd-details[open] > .mtd-details-content,
.mtd-article-collapse-all-check:checked ~ .mtd-layout-shell details.mtd-details[open] > .mtd-accordion-body {
  display: block !important;
}

.mtd-article-collapse-all-check:checked ~ .mtd-layout-shell input.mtd-heading-fold-check:checked ~ .mtd-heading-header-row .mtd-heading-fold-arrow {
  transform: rotate(0deg) !important;
}

.mtd-article-collapse-all-check:checked ~ .mtd-layout-shell input.mtd-accordion-checkbox:checked ~ .mtd-accordion-summary .mtd-summary-icon,
.mtd-article-collapse-all-check:checked ~ .mtd-layout-shell details.mtd-details[open] > summary .mtd-summary-icon,
.mtd-article-collapse-all-check:checked ~ .mtd-layout-shell details.mtd-details[open] > summary .mtd-summary-arrow {
  transform: rotate(0deg) !important;
}

/* Markdown typography & standard elements */
.mtd-p {
  margin: 1em 0;
  line-height: 1.7;
}

.mtd-blockquote,
blockquote.mtd-blockquote,
.mtd-article-markdown-flow blockquote {
  margin: 1.4em 0;
  padding: 12px 18px !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  border-left: 4px solid var(--mtd-primary, #3b82f6) !important;
  background: #f8fafc !important;
  border-radius: 0 6px 6px 0 !important;
  color: #475569;
  quotes: none !important;
  box-sizing: border-box;
}

/* 彻底重置并消除宿主主题（如 Gecko/PeepSo 主题）强制注入的 blockquote::before/::after 双引号图标 */
.mtd-blockquote::before,
.mtd-blockquote::after,
blockquote.mtd-blockquote::before,
blockquote.mtd-blockquote::after,
.mtd-article-markdown-flow blockquote::before,
.mtd-article-markdown-flow blockquote::after {
  content: none !important;
  display: none !important;
}

.mtd-blockquote p,
.mtd-blockquote .mtd-p,
blockquote.mtd-blockquote p,
.mtd-article-markdown-flow blockquote p {
  margin: 0.4em 0;
  line-height: 1.65;
  color: inherit;
}

.mtd-blockquote p:first-child,
.mtd-blockquote .mtd-p:first-child,
blockquote.mtd-blockquote p:first-child,
.mtd-article-markdown-flow blockquote p:first-child {
  margin-top: 0;
}

.mtd-blockquote p:last-child,
.mtd-blockquote .mtd-p:last-child,
blockquote.mtd-blockquote p:last-child,
.mtd-article-markdown-flow blockquote p:last-child {
  margin-bottom: 0;
}

/* 暗黑模式适配 */
[data-theme="dark"] .mtd-blockquote,
.dark .mtd-blockquote,
.mtd-dark-theme .mtd-blockquote,
[data-theme="dark"] .mtd-article-markdown-flow blockquote,
.dark .mtd-article-markdown-flow blockquote,
.mtd-dark-theme .mtd-article-markdown-flow blockquote {
  border-color: rgba(255, 255, 255, 0.1) !important;
  border-left-color: var(--mtd-primary, #60a5fa) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: #94a3b8 !important;
}

/* 列表与多级嵌套列表多态符号 (Bullet Polymorphism) */
.mtd-ul, .mtd-ol {
  margin: 0.8em 0;
  padding-left: 24px;
}

.mtd-ul li, .mtd-ol li {
  margin-bottom: 5px;
  line-height: 1.65;
}

/* 无序列表多级符号多态化：实心圆 -> 空心圆 -> 实心小方块 */
.mtd-ul {
  list-style-type: disc;
}

.mtd-ul .mtd-ul {
  list-style-type: circle;
  margin: 4px 0 6px 0;
  padding-left: 20px;
}

.mtd-ul .mtd-ul .mtd-ul {
  list-style-type: square;
  margin: 4px 0 6px 0;
  padding-left: 20px;
}

/* 有序列表多级标号多态化：阿拉伯数字 -> 小写字母 -> 小写罗马数字 */
.mtd-ol {
  list-style-type: decimal;
}

.mtd-ol .mtd-ol {
  list-style-type: lower-alpha;
  margin: 4px 0 6px 0;
  padding-left: 20px;
}

.mtd-ol .mtd-ol .mtd-ol {
  list-style-type: lower-roman;
  margin: 4px 0 6px 0;
  padding-left: 20px;
}

/* 混合嵌套优化 (有序套无序 / 无序套有序) */
.mtd-ol .mtd-ul,
.mtd-ul .mtd-ol {
  margin: 4px 0 6px 0;
  padding-left: 20px;
}

/* 嵌套多层引用块 (Nested Blockquotes) */
.mtd-blockquote .mtd-blockquote {
  margin: 8px 0;
  padding: 6px 14px;
  border-left: 3.5px solid var(--mtd-primary, #3b82f6);
  background: rgba(0, 0, 0, 0.02);
  border-radius: 0 var(--mtd-radius-sm) var(--mtd-radius-sm) 0;
}

.mtd-divider {
  border: 0;
  height: 1px;
  background: var(--mtd-border);
  margin: 32px 0;
}

.mtd-inline-code {
  font-family: var(--mtd-code-font);
  font-size: 0.88em;
  padding: 2px 6px;
  background: var(--mtd-card-bg);
  border: 1px solid var(--mtd-border);
  border-radius: 4px;
  color: #c026d3;
}

/* Tables */
.mtd-table-wrapper {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--mtd-border, #e2e8f0);
  border-radius: var(--mtd-radius-md, 8px);
}

.mtd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.mtd-table th,
.mtd-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--mtd-border, #e2e8f0);
  border-right: 1px solid var(--mtd-border, #f1f5f9);
  text-align: left;
}

.mtd-table th:last-child,
.mtd-table td:last-child {
  border-right: none;
}

.mtd-table tr:last-child td {
  border-bottom: none;
}

.mtd-table th {
  background: var(--mtd-card-bg, #f8fafc);
  font-weight: 600;
}

.mtd-table tr:hover td {
  background: rgba(0, 0, 0, 0.015);
}

/* 提高特异性防御外部主题的 table reset */
.mtd-container .mtd-table-wrapper {
  border: 1px solid var(--mtd-border, #e2e8f0);
}
.mtd-container .mtd-table th,
.mtd-container .mtd-table td {
  border-bottom: 1px solid var(--mtd-border, #e2e8f0);
  border-right: 1px solid var(--mtd-border, #f1f5f9);
}
.mtd-container .mtd-table th:last-child,
.mtd-container .mtd-table td:last-child {
  border-right: none;
}

/* Pure CSS :target Modal Dialogs (Zero JavaScript) */
.mtd-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.mtd-modal-overlay:target {
  display: flex;
  animation: mtdFadeIn 0.2s ease-out;
}

.mtd-modal-card {
  background: var(--mtd-bg);
  border-radius: var(--mtd-radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 620px;
  width: 100%;
  border: 1px solid var(--mtd-border);
  overflow: hidden;
  animation: mtdScaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mtd-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--mtd-border);
  background: var(--mtd-card-bg);
}

.mtd-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--mtd-text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mtd-modal-close-btn {
  text-decoration: none;
  font-size: 24px;
  line-height: 1;
  color: var(--mtd-text-muted);
  cursor: pointer;
  transition: color 0.15s;
}

.mtd-modal-close-btn:hover {
  color: #ef4444;
}

.mtd-modal-body {
  padding: 20px;
  color: var(--mtd-text-main);
  font-size: 14.5px;
  line-height: 1.7;
  max-height: 62vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

.mtd-modal-body::-webkit-scrollbar {
  width: 6px;
}

.mtd-modal-body::-webkit-scrollbar-thumb {
  background: var(--mtd-border);
  border-radius: 4px;
}

/* 外部超链接实时网页内容内嵌预览卡片 */
.mtd-modal-card.mtd-ext-modal-card {
  max-width: 980px !important;
  width: 95vw !important;
  height: 86vh !important;
  max-height: 850px !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 12px !important;
}

.mtd-modal-body.mtd-ext-modal-body {
  flex: 1 !important;
  height: 100% !important;
  max-height: none !important;
  padding: 0 !important;
  position: relative !important;
  overflow: hidden !important;
  background: #f8fafc !important;
  display: flex !important;
  flex-direction: column !important;
}

.mtd-iframe-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  font-size: 11.5px;
  color: #475569;
}

.mtd-iframe-wrapper {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
}

.mtd-preview-iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 480px !important;
  border: none !important;
  display: block !important;
  background: #ffffff !important;
}

.mtd-iframe-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: #0284c7;
  font-size: 13.5px;
  font-weight: 600;
  z-index: 10;
  transition: opacity 0.25s ease;
}

.mtd-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e0f2fe;
  border-top-color: #0284c7;
  border-radius: 50%;
  animation: mtdSpin 0.7s linear infinite;
}

@keyframes mtdSpin {
  to { transform: rotate(360deg); }
}

/* GFM Task Lists */
.mtd-ul.mtd-task-list {
  list-style: none;
  padding-left: 2px;
}
.mtd-task-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.mtd-task-check {
  margin: 0;
  cursor: default;
  accent-color: var(--mtd-primary);
  width: 15px;
  height: 15px;
}

/* =============================================================
   GFM Alerts / Callout Boxes (Note, Tip, Important, Warning, Caution)
   ============================================================= */
.mtd-alert {
  margin: 18px 0;
  padding: 12px 18px;
  border-radius: 6px;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.mtd-alert-header {
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.mtd-alert-icon {
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.mtd-alert-title {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mtd-alert-content {
  font-size: 14px;
  line-height: 1.65;
  color: inherit;
}

.mtd-alert-content > p:first-child {
  margin-top: 0;
}

.mtd-alert-content > p:last-child {
  margin-bottom: 0;
}

/* 1. Note (Blue) */
.mtd-alert-note {
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-left: 4px solid #3b82f6;
  background: #f0f7ff;
}
.mtd-alert-note .mtd-alert-header {
  color: #1d4ed8;
}

/* 2. Tip (Green) */
.mtd-alert-tip {
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-left: 4px solid #10b981;
  background: #f0fdf4;
}
.mtd-alert-tip .mtd-alert-header {
  color: #047857;
}

/* 3. Important (Purple) */
.mtd-alert-important {
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-left: 4px solid #8b5cf6;
  background: #f5f3ff;
}
.mtd-alert-important .mtd-alert-header {
  color: #6d28d9;
}

/* 4. Warning (Amber) */
.mtd-alert-warning {
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-left: 4px solid #f59e0b;
  background: #fffbeb;
}
.mtd-alert-warning .mtd-alert-header {
  color: #b45309;
}

/* 5. Caution (Red) */
.mtd-alert-caution {
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-left: 4px solid #ef4444;
  background: #fef2f2;
}
.mtd-alert-caution .mtd-alert-header {
  color: #b91c1c;
}

/* Dark Mode Adaptation */
[data-theme="dark"] .mtd-alert-note,
.dark .mtd-alert-note,
.mtd-dark-theme .mtd-alert-note {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.12);
}
[data-theme="dark"] .mtd-alert-note .mtd-alert-header,
.dark .mtd-alert-note .mtd-alert-header,
.mtd-dark-theme .mtd-alert-note .mtd-alert-header {
  color: #93c5fd;
}

[data-theme="dark"] .mtd-alert-tip,
.dark .mtd-alert-tip,
.mtd-dark-theme .mtd-alert-tip {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
}
[data-theme="dark"] .mtd-alert-tip .mtd-alert-header,
.dark .mtd-alert-tip .mtd-alert-header,
.mtd-dark-theme .mtd-alert-tip .mtd-alert-header {
  color: #6ee7b7;
}

[data-theme="dark"] .mtd-alert-important,
.dark .mtd-alert-important,
.mtd-dark-theme .mtd-alert-important {
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.12);
}
[data-theme="dark"] .mtd-alert-important .mtd-alert-header,
.dark .mtd-alert-important .mtd-alert-header,
.mtd-dark-theme .mtd-alert-important .mtd-alert-header {
  color: #c4b5fd;
}

[data-theme="dark"] .mtd-alert-warning,
.dark .mtd-alert-warning,
.mtd-dark-theme .mtd-alert-warning {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
}
[data-theme="dark"] .mtd-alert-warning .mtd-alert-header,
.dark .mtd-alert-warning .mtd-alert-header,
.mtd-dark-theme .mtd-alert-warning .mtd-alert-header {
  color: #fcd34d;
}

[data-theme="dark"] .mtd-alert-caution,
.dark .mtd-alert-caution,
.mtd-dark-theme .mtd-alert-caution {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
}
[data-theme="dark"] .mtd-alert-caution .mtd-alert-header,
.dark .mtd-alert-caution .mtd-alert-header,
.mtd-dark-theme .mtd-alert-caution .mtd-alert-header {
  color: #fca5a5;
}


.mtd-preview-level-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--mtd-primary-light);
  color: var(--mtd-primary);
  margin-bottom: 12px;
}

.mtd-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--mtd-border);
  background: var(--mtd-card-bg);
}

.mtd-modal-goto-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--mtd-primary);
  color: #ffffff;
  border-radius: var(--mtd-radius-sm);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.15s;
}

.mtd-modal-goto-btn:hover {
  background: var(--mtd-primary-hover);
}

.mtd-modal-cancel-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  background: transparent;
  color: var(--mtd-text-muted);
  border-radius: var(--mtd-radius-sm);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s;
}

.mtd-modal-cancel-btn:hover {
  color: var(--mtd-text-main);
}

/* Animations */
@keyframes mtdFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes mtdScaleUp {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Responsive adjustments */
.mtd-show-mobile {
  display: none !important;
}

/* 默认情况下：正文章节标题行为正常自然文档流 */
.mtd-heading-fold-unit {
  position: relative;
  width: 100%;
}

.mtd-heading-header-row {
  position: static;
  width: 100%;
  background: transparent;
  padding: 4px 0;
}

/* 仅在开启“启用当前阅读标题冻结显示 (Sticky)”时才生效吸顶 (PC 端紧密贴合在站点 Header 下方，0 缓冲空隙) */
.mtd-has-sticky-headings .mtd-heading-header-row,
.mtd-article-pane.mtd-has-sticky-headings .mtd-heading-header-row,
.mtd-has-sticky-headings .mtd-heading:not(.mtd-heading-header-row *),
.mtd-article-pane.mtd-has-sticky-headings .mtd-heading:not(.mtd-heading-header-row *) {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: var(--mtd-sticky-top, 0px) !important;
  z-index: 50 !important;
  background: var(--mtd-bg, #ffffff) !important;
  border-bottom: 1px solid var(--mtd-border) !important;
  padding: 8px 0 !important;
  box-shadow: none !important;
}

/* 坚决杜绝标题下方出现两条横线：折叠标题行内部的 h 标题标签全面去除边框、阴影和背景 */
.mtd-heading-header-row,
.mtd-heading-header-row * {
  box-shadow: none !important;
}
.mtd-heading-header-row .mtd-heading,
.mtd-heading-header-row h1,
.mtd-heading-header-row h2,
.mtd-heading-header-row h3,
.mtd-heading-header-row h4,
.mtd-heading-header-row h5,
.mtd-heading-header-row h6,
.mtd-heading-header-row .mtd-h1,
.mtd-heading-header-row .mtd-h2,
.mtd-heading-header-row .mtd-h3,
.mtd-heading-header-row .mtd-h4,
.mtd-heading-header-row .mtd-h5,
.mtd-heading-header-row .mtd-h6,
.mtd-heading-header-row .mtd-heading-title-label,
.mtd-heading-header-row .mtd-heading-text {
  border-bottom: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* 单文档独立设置明确禁用吸顶 */
.mtd-article-pane.mtd-no-sticky-headings .mtd-heading-header-row,
.mtd-article-pane.mtd-no-sticky-headings .mtd-heading {
  position: static !important;
  border-bottom: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 4px 0 !important;
}

/* 单文档独立设置禁用左侧栏折叠 (仅隐藏桌面端折叠按钮，移动端全屏抽屉菜单始终保留可用) */
.mtd-container.mtd-disable-sidebar-collapse .mtd-btn-sidebar-toggle.mtd-hide-mobile,
.mtd-container.mtd-disable-sidebar-collapse .mtd-sidebar-close-btn.mtd-hide-mobile,
.mtd-layout-shell.mtd-disable-sidebar-collapse .mtd-btn-sidebar-toggle.mtd-hide-mobile,
.mtd-layout-shell.mtd-disable-sidebar-collapse .mtd-sidebar-close-btn.mtd-hide-mobile {
  display: none !important;
}

/* 单文档独立设置禁用面包屑 (特异性压制 input:checked) */
.mtd-topbar-breadcrumb-pane.mtd-bc-disabled,
input:checked ~ .mtd-layout-shell .mtd-topbar-breadcrumb-pane.mtd-bc-disabled,
.mtd-layout-shell .mtd-topbar-breadcrumb-pane.mtd-bc-disabled {
  display: none !important;
}

@media (max-width: 992px) {
  /* 移动端默认隐藏页面右侧栏（避免挤占正文空间） */
  .mtd-right-toc-sticky,
  .mtd-toc-is-sticky,
  .mtd-layout-shell.has-right-toc .mtd-right-toc-sidebar {
    display: none !important;
  }

  /* 移动端正文 Notion 横条大纲 (迷你地图)：恢复显示并适配触控悬浮 */
  .mtd-notion-dock-anchor {
    position: sticky !important;
    top: calc(var(--mtd-sticky-top, 0px) + 54px) !important;
    float: right !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 9999 !important;
    pointer-events: none !important;
  }

  .mtd-notion-float-toc {
    display: block !important;
    position: fixed !important;
    top: calc(var(--mtd-sticky-top, 0px) + 64px) !important;
    right: 4px !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
    width: 30px !important;
    min-width: 30px !important;
    max-height: 65vh !important;
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid var(--mtd-border) !important;
    border-radius: 8px !important;
    padding: 6px 3px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    opacity: 0.85 !important;
    overflow: hidden !important;
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, opacity 0.2s ease !important;
  }

  /* 移动端未展开(缩小/迷你横条)状态：严格绝对右对齐且阶梯化展示标题等级 */
  .mtd-notion-float-toc:not(.is-expanded) {
    width: 34px !important;
    min-width: 34px !important;
    box-sizing: border-box !important;
    padding: 6px 4px !important;
    cursor: pointer !important;
  }

  .mtd-notion-float-toc:not(.is-expanded) * {
    cursor: pointer !important;
  }

  .mtd-notion-float-toc:not(.is-expanded) .mtd-notion-toc-box,
  .mtd-notion-float-toc:not(.is-expanded) .mtd-toc-nav,
  .mtd-notion-float-toc:not(.is-expanded) .mtd-toc-item {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .mtd-notion-float-toc:not(.is-expanded) .mtd-toc-title,
  .mtd-notion-float-toc:not(.is-expanded) .mtd-toc-text,
  .mtd-notion-float-toc:not(.is-expanded):hover .mtd-toc-title,
  .mtd-notion-float-toc:not(.is-expanded):hover .mtd-toc-text {
    display: none !important;
  }

  .mtd-notion-float-toc:not(.is-expanded) .mtd-toc-link,
  .mtd-notion-float-toc:not(.is-expanded):hover .mtd-toc-link {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: 100% !important;
    padding: 2.5px 0 !important;
    margin: 0 !important;
    background: transparent !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
  }

  .mtd-notion-float-toc:not(.is-expanded) .mtd-notion-bar-slot,
  .mtd-notion-float-toc:not(.is-expanded):hover .mtd-notion-bar-slot {
    width: 100% !important;
    min-width: unset !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    margin: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .mtd-notion-float-toc:not(.is-expanded) .mtd-notion-bar,
  .mtd-notion-float-toc:not(.is-expanded):hover .mtd-notion-bar {
    display: block !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    float: none !important;
    flex-shrink: 0 !important;
    height: 2.5px !important;
    border-radius: 2px !important;
  }

  /* 移动端缩小状态下的各标题等级横线长度 (阶梯绝对向右靠齐，长短落差明显) */
  .mtd-notion-float-toc:not(.is-expanded) .mtd-bar-l1,
  .mtd-notion-float-toc:not(.is-expanded):hover .mtd-bar-l1 { width: 24px !important; }
  .mtd-notion-float-toc:not(.is-expanded) .mtd-bar-l2,
  .mtd-notion-float-toc:not(.is-expanded):hover .mtd-bar-l2 { width: 17px !important; }
  .mtd-notion-float-toc:not(.is-expanded) .mtd-bar-l2.mtd-bar-var-0,
  .mtd-notion-float-toc:not(.is-expanded):hover .mtd-bar-l2.mtd-bar-var-0 { width: 18px !important; }
  .mtd-notion-float-toc:not(.is-expanded) .mtd-bar-l2.mtd-bar-var-1,
  .mtd-notion-float-toc:not(.is-expanded):hover .mtd-bar-l2.mtd-bar-var-1 { width: 15px !important; }
  .mtd-notion-float-toc:not(.is-expanded) .mtd-bar-l2.mtd-bar-var-2,
  .mtd-notion-float-toc:not(.is-expanded):hover .mtd-bar-l2.mtd-bar-var-2 { width: 17px !important; }
  .mtd-notion-float-toc:not(.is-expanded) .mtd-bar-l2.mtd-bar-var-3,
  .mtd-notion-float-toc:not(.is-expanded):hover .mtd-bar-l2.mtd-bar-var-3 { width: 14px !important; }
  .mtd-notion-float-toc:not(.is-expanded) .mtd-bar-l3,
  .mtd-notion-float-toc:not(.is-expanded):hover .mtd-bar-l3 { width: 11px !important; }
  .mtd-notion-float-toc:not(.is-expanded) .mtd-bar-l4,
  .mtd-notion-float-toc:not(.is-expanded):hover .mtd-bar-l4 { width: 7px !important; }
  .mtd-notion-float-toc:not(.is-expanded) .mtd-bar-l5,
  .mtd-notion-float-toc:not(.is-expanded):hover .mtd-bar-l5,
  .mtd-notion-float-toc:not(.is-expanded) .mtd-bar-l6,
  .mtd-notion-float-toc:not(.is-expanded):hover .mtd-bar-l6 { width: 4px !important; }

  /* 移动端展开状态：向左展开抽屉并展现完整标题大纲 */
  .mtd-notion-float-toc.is-expanded {
    width: min(260px, calc(100vw - 32px)) !important;
    min-width: min(260px, calc(100vw - 32px)) !important;
    padding: 12px 14px !important;
    background: var(--mtd-card-bg, #ffffff) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18) !important;
    opacity: 1 !important;
    right: 8px !important;
    overflow-y: auto !important;
  }

  .mtd-notion-float-toc.is-expanded .mtd-toc-title {
    display: flex !important;
    cursor: pointer !important;
  }

  .mtd-notion-float-toc.is-expanded .mtd-toc-text {
    display: inline-block !important;
    opacity: 1 !important;
    font-size: 13px !important;
    color: var(--mtd-text-main, #334155) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: calc(100% - 36px) !important;
  }

  .mtd-notion-float-toc.is-expanded .mtd-toc-link {
    justify-content: flex-start !important;
    padding: 5px 8px !important;
  }

  .mtd-notion-float-toc.is-expanded .mtd-notion-bar-slot {
    width: 28px !important;
    min-width: 28px !important;
    display: inline-flex !important;
    justify-content: flex-end !important;
    margin-right: 8px !important;
  }

  .mtd-notion-float-toc.is-expanded .mtd-notion-bar {
    margin-left: 0 !important;
    margin-right: 8px !important;
  }

  .mtd-theme-dark-slate .mtd-notion-float-toc,
  .mtd-theme-minimal-dark .mtd-notion-float-toc {
    background: rgba(30, 41, 59, 0.88) !important;
  }

  .mtd-content-columns {
    display: block !important;
    grid-template-columns: 100% !important;
  }

  .mtd-article-pane {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* 移动端坚决隐藏带文字的桌面端菜单按钮，仅保留无文字的纯图标抽屉按钮，杜绝出现双按钮 */
  .mtd-hide-mobile,
  .mtd-container .mtd-hide-mobile,
  .mtd-layout-shell .mtd-hide-mobile,
  .mtd-layout-shell .mtd-btn-sidebar-toggle.mtd-hide-mobile,
  .mtd-layout-shell .mtd-sidebar-close-btn.mtd-hide-mobile,
  [id^="marktreedoc_"] ~ .mtd-layout-shell .mtd-btn-sidebar-toggle.mtd-hide-mobile,
  [id^="marktreedoc_"] ~ .mtd-layout-shell .mtd-sidebar-close-btn.mtd-hide-mobile {
    display: none !important;
  }

  .mtd-show-mobile,
  .mtd-container .mtd-show-mobile,
  .mtd-layout-shell .mtd-show-mobile,
  .mtd-layout-shell .mtd-btn-sidebar-toggle.mtd-show-mobile {
    display: inline-flex !important;
  }

  /* 移动端菜单按钮仅显示图标，不显示文字以节约横向宽度 */
  .mtd-btn-sidebar-toggle.mtd-show-mobile {
    padding: 6px 9px !important;
    min-width: 34px !important;
    height: 32px !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }
  .mtd-btn-sidebar-toggle.mtd-show-mobile .mtd-btn-text {
    display: none !important;
  }

  /* 移动端右侧大纲与侧栏固定隐藏，不受任何设置项干扰 */
  .mtd-right-toc-sidebar,
  .mtd-sticky-toc-box,
  .mtd-notes-sidebar,
  .mtd-toc-col,
  .mtd-toc-inner {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    border: none !important;
  }

  /* 移动端正文内容区全宽展开 */
  .mtd-article-content-flex {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .mtd-article-markdown-flow {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }

  /* 移动端外层固定文档集标题彻底隐藏，将文档集标题统一合并进面包屑横向滑动容器 */
  .mtd-has-breadcrumbs .mtd-doc-brand,
  .mtd-has-breadcrumbs .mtd-topbar-divider,
  .mtd-layout-shell .mtd-has-breadcrumbs .mtd-doc-brand,
  .mtd-layout-shell .mtd-has-breadcrumbs .mtd-topbar-divider,
  [id^="marktreedoc_"] ~ .mtd-layout-shell .mtd-has-breadcrumbs .mtd-doc-brand,
  [id^="marktreedoc_"] ~ .mtd-layout-shell .mtd-has-breadcrumbs .mtd-topbar-divider,
  [id^="marktreedoc_"] ~ .mtd-layout-shell .mtd-doc-brand,
  [id^="marktreedoc_"] ~ .mtd-layout-shell .mtd-topbar-divider {
    display: none !important;
  }

  /* 移动端显示面包屑内部的文档集标题，跟随整条面包屑一起滑动 */
  .mtd-bc-root-brand,
  .mtd-bc-brand-sep,
  .mtd-layout-shell .mtd-bc-root-brand,
  .mtd-layout-shell .mtd-bc-brand-sep {
    display: inline-flex !important;
  }

  /* 移动端触屏标题锚点 H1~H6 触摸优化 (默认可见，增加轻触热区) */
  .mtd-anchor-tag {
    opacity: 0.75 !important;
    padding: 4px 8px !important;
    min-height: 24px !important;
    min-width: 26px !important;
    touch-action: manipulation !important;
  }

  /* 移动端整条面包屑平滑滑动 */
  .mtd-topbar-breadcrumbs-wrapper {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    display: flex !important;
  }
  .mtd-bc-nav {
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
  }
  .mtd-bc-scroller,
  .mtd-bc-ancestors-scroller {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
    scrollbar-width: none !important;
  }
  .mtd-bc-scroller::-webkit-scrollbar,
  .mtd-bc-ancestors-scroller::-webkit-scrollbar {
    display: none !important;
  }
  .mtd-bc-track,
  .mtd-bc-ancestors-track {
    display: inline-flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    min-width: max-content !important;
  }

  /* 移动端外层容器紧贴视口顶部，杜绝任何外部 margin 导致的缝隙 */
  .mtd-container {
    margin: 0 auto !important;
    border-radius: 0 !important;
  }

  /* 移动端文章内容列两侧 padding 极致精简 (由原先 32px 减至 8px，最大化移动端屏幕利用率) */
  .mtd-content-col {
    padding: 14px 8px 40px !important;
  }

  .mtd-article-pane,
  .mtd-article-body {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* 移动版冻结顶栏面包屑与防裁切可见性 (两侧 padding 缩减至 8px 与正文齐平，保留下方浅灰细线) */
  .mtd-topbar {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: var(--mtd-sticky-top, 0px) !important;
    z-index: 1000 !important;
    background: var(--mtd-bg, #ffffff) !important;
    border-bottom: 1px solid var(--mtd-border, #e5e7eb) !important; /* 保留面包屑下方细线 */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    padding: 8px 8px !important;
    min-height: unset !important;
    height: auto !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    display: flex !important;
    align-items: center !important;
  }

  .mtd-topbar::-webkit-scrollbar {
    display: none !important;
  }

  .mtd-topbar-left {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 !important;
    gap: 8px !important;
    overflow: visible !important;
  }

  .mtd-topbar-breadcrumbs-wrapper {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  .mtd-topbar-breadcrumb-pane {
    overflow: visible !important;
  }

  .mtd-bc-nav {
    overflow: visible !important;
  }

  .mtd-bc-current-section {
    position: relative !important;
    overflow: visible !important;
  }

  /* 移动端正文章节标题吸顶在冻结面包屑正下方 (0 像素紧贴，杜绝 12px 空隙) */
  .mtd-has-sticky-headings .mtd-heading-header-row {
    top: calc(var(--mtd-sticky-top, 0px) + var(--mtd-topbar-height, 36px)) !important;
    z-index: 90 !important;
    background: var(--mtd-bg, #ffffff) !important;
    margin: 0 !important;
  }

  /* 移动端主体网格采用块级流排版，正文区严格占据 100% 视口，杜绝被横向挤压顶偏导致页面出现横向滚动条 */
  .mtd-body-grid,
  .mtd-layout-shell .mtd-body-grid,
  [id^="marktreedoc_"] ~ .mtd-layout-shell .mtd-body-grid {
    display: block !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .mtd-content-col,
  .mtd-layout-shell .mtd-content-col,
  [id^="marktreedoc_"] ~ .mtd-layout-shell .mtd-content-col {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }

  /* 移动版默认隐藏侧栏文档目录 (定位在面包屑栏下方，展开最多只顶到面包屑，仅侧栏内部独立滚动) */
  .mtd-sidebar-col,
  .mtd-layout-shell .mtd-sidebar-col,
  [id^="marktreedoc_"] ~ .mtd-layout-shell .mtd-sidebar-col {
    display: none !important;
    position: fixed !important;
    top: var(--mtd-mobile-sidebar-top, calc(var(--mtd-sticky-top, 0px) + var(--mtd-topbar-height, 42px))) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    height: var(--mtd-mobile-sidebar-height, calc(100vh - var(--mtd-sticky-top, 0px) - var(--mtd-topbar-height, 42px))) !important;
    max-height: var(--mtd-mobile-sidebar-height, calc(100vh - var(--mtd-sticky-top, 0px) - var(--mtd-topbar-height, 42px))) !important;
    z-index: 99999 !important;
    background: var(--mtd-sidebar-bg, #ffffff) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
  }

  /* 移动版点击目录按钮：展开全屏抽屉覆盖在正文上方（挡住文章正文），绝对不顶偏文章 */
  .mtd-control-mobile-sidebar:checked ~ .mtd-layout-shell .mtd-sidebar-col,
  [id^="marktreedoc_"] ~ .mtd-control-mobile-sidebar:checked ~ .mtd-layout-shell .mtd-sidebar-col {
    display: block !important;
    position: fixed !important;
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    top: var(--mtd-mobile-sidebar-top, calc(var(--mtd-sticky-top, 0px) + var(--mtd-topbar-height, 42px))) !important;
    left: 0 !important;
    right: 0 !important;
    height: var(--mtd-mobile-sidebar-height, calc(100vh - var(--mtd-sticky-top, 0px) - var(--mtd-topbar-height, 42px))) !important;
    max-height: var(--mtd-mobile-sidebar-height, calc(100vh - var(--mtd-sticky-top, 0px) - var(--mtd-topbar-height, 42px))) !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    z-index: 99999 !important;
    animation: mtdFadeIn 0.2s ease !important;
  }

  /* 移动版打开侧栏目录时：保持文章页面自然高度与滚动条完全不变，仅禁用正文指针交互与手势滑动避免误触穿透 */
  .mtd-control-mobile-sidebar:checked ~ .mtd-layout-shell .mtd-content-col {
    pointer-events: none !important;
    user-select: none !important;
    touch-action: none !important;
  }

  .mtd-control-mobile-sidebar:checked ~ .mtd-layout-shell .mtd-sidebar-inner {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 16px 20px 60px !important;
  }

  .mtd-sidebar-close-btn.mtd-show-mobile {
    font-size: 28px !important;
    padding: 2px 10px !important;
    cursor: pointer !important;
    color: var(--mtd-text-main) !important;
  }

  /* 移动版展开目录时：彻底隐藏页面全局滚动条，消灭上方断层滚动条，只保留下方目录本身的滚动条 */
  html.mtd-hide-page-scrollbar,
  body.mtd-hide-page-scrollbar,
  html:has(.mtd-control-mobile-sidebar:checked),
  body:has(.mtd-control-mobile-sidebar:checked) {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  html.mtd-hide-page-scrollbar::-webkit-scrollbar,
  body.mtd-hide-page-scrollbar::-webkit-scrollbar,
  html:has(.mtd-control-mobile-sidebar:checked)::-webkit-scrollbar,
  body:has(.mtd-control-mobile-sidebar:checked)::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
  }

  /* 移动端大纲弹出浮层：屏幕水平绝对居中、尺寸自适应且不受任何局部滚动条与正文浮层影响 */
  .mtd-bc-toc-popover,
  .mtd-bc-toc-check:checked ~ .mtd-bc-toc-popover {
    display: none;
    position: fixed !important;
    top: calc(var(--mtd-sticky-top, 0px) + var(--mtd-topbar-height, 46px) + 8px) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: min(440px, calc(100vw - 28px)) !important;
    min-width: min(300px, calc(100vw - 28px)) !important;
    max-width: calc(100vw - 28px) !important;
    max-height: 72vh !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border-radius: 14px !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid var(--mtd-border) !important;
    z-index: 100001 !important; /* 彻底高于正文一切浮层与 Notion TOC */
    background: var(--mtd-card-bg, #ffffff) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .mtd-bc-toc-check:checked ~ .mtd-bc-toc-popover {
    display: block !important;
    animation: mtdPopInCenter 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  /* 移动端大纲半透明背景遮罩：覆盖全屏，层级高于一切正文浮层与 Notion TOC */
  .mtd-bc-toc-backdrop,
  .mtd-bc-toc-check:checked ~ .mtd-bc-toc-backdrop {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 100000 !important;
    background: rgba(0, 0, 0, 0.32) !important;
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    cursor: pointer !important;
  }

  .mtd-bc-toc-check:checked ~ .mtd-bc-toc-backdrop {
    display: block !important;
  }

  /* 移动版面包屑大纲展开时，压制正文 Notion TOC 浮条，防止重叠遮挡与干扰 */
  .mtd-layout-shell:has(.mtd-bc-toc-check:checked) .mtd-notion-dock-anchor,
  .mtd-layout-shell:has(.mtd-bc-toc-check:checked) .mtd-notion-float-toc,
  body:has(.mtd-bc-toc-check:checked) .mtd-notion-dock-anchor,
  body:has(.mtd-bc-toc-check:checked) .mtd-notion-float-toc {
    z-index: 100 !important;
    pointer-events: none !important;
    opacity: 0.15 !important;
  }
}

@keyframes mtdSlideUpMobile {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 内部文档跳转与小节定位 named-anchor 零偏移定位点 */
.mtd-named-anchor {
  position: relative;
  top: calc(-1 * var(--mtd-admin-bar-offset, 0px) - 10px);
  display: block;
  visibility: hidden;
  height: 0;
  width: 0;
  pointer-events: none;
}

/* 跨文档/小节跳转高亮脉冲特效 */
.mtd-target-pulse {
  animation: mtdTargetPulseAnim 1.8s ease-out;
}

@keyframes mtdTargetPulseAnim {
  0% { background-color: rgba(56, 189, 248, 0.35); border-radius: 4px; }
  50% { background-color: rgba(56, 189, 248, 0.18); }
  100% { background-color: transparent; }
}

/* 现代化矢量线框图标统一规范 (与下载/折叠按钮风格高度统一) */
.mtd-icon-svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  pointer-events: none;
}
.mtd-inline-preview-btn .mtd-icon-svg {
  margin-right: 3px;
  vertical-align: -1px;
}
.mtd-bc-toc-icon .mtd-icon-svg {
  vertical-align: -2px;
  margin-right: 4px;
  color: var(--mtd-text-muted);
}
.mtd-bc-toc-li:hover .mtd-bc-toc-icon .mtd-icon-svg {
  color: var(--mtd-primary);
}
.mtd-sidebar-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mtd-sidebar-close-btn .mtd-icon-svg {
  color: var(--mtd-text-muted);
  transition: color 0.15s;
}
.mtd-sidebar-close-btn:hover .mtd-icon-svg {
  color: var(--mtd-text-main);
}



/* -------------------------------------------------------------
   LaTeX 数学公式排版样式 (Inline & Block Display Math)
   ------------------------------------------------------------- */
.mtd-latex-block {
  margin: 18px 0;
  padding: 16px 20px;
  background: var(--mtd-card-bg, #f8fafc);
  border: 1px solid var(--mtd-border, #e2e8f0);
  border-radius: var(--mtd-radius-md, 8px);
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.mtd-latex-actions {
  position: absolute;
  top: 8px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}
.mtd-latex-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--mtd-primary-light, rgba(37, 99, 235, 0.1));
  color: var(--mtd-primary, #2563eb);
  letter-spacing: 0.5px;
  user-select: none;
}
.mtd-latex-copy-btn {
  background: transparent;
  border: 1px solid var(--mtd-border, #e2e8f0);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--mtd-text-muted, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}
.mtd-latex-copy-btn:hover {
  background: var(--mtd-bg, #ffffff);
  color: var(--mtd-primary, #2563eb);
  border-color: var(--mtd-primary, #2563eb);
}
.mtd-latex-math {
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: KaTeX_Math, 'Cambria Math', 'MathJax_Math', 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--mtd-text-main, #0f172a);
  min-height: 32px;
  text-align: center;
}
.mtd-latex-inline {
  display: inline-block;
  font-family: KaTeX_Math, 'Cambria Math', 'MathJax_Math', 'Times New Roman', serif;
  font-size: 15px;
  line-height: normal;
  padding: 1px 5px;
  margin: 0 2px;
  background: var(--mtd-card-bg, #f8fafc);
  border-radius: 3px;
  color: var(--mtd-text-main, #0f172a);
  vertical-align: baseline;
}

/* -------------------------------------------------------------
   Mermaid 可视化图表排版样式 (Flowchart, Sequence, Class, etc.)
   ------------------------------------------------------------- */
.mtd-mermaid-block {
  margin: 20px 0;
  border: 1px solid var(--mtd-border, #e2e8f0);
  border-radius: var(--mtd-radius-md, 8px);
  background: var(--mtd-card-bg, #ffffff);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.mtd-mermaid-block:hover {
  border-color: var(--mtd-primary, #0284c7);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}
.mtd-mermaid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: var(--mtd-code-header-bg, #f8fafc);
  border-bottom: 1px solid var(--mtd-border, #e2e8f0);
  user-select: none;
}
.mtd-mermaid-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #0284c7;
  letter-spacing: 0.3px;
}
.mtd-mermaid-icon {
  font-size: 13px;
  color: #0ea5e9;
}
.mtd-mermaid-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mtd-mermaid-toggle-btn,
.mtd-mermaid-copy-btn {
  background: var(--mtd-card-bg, #ffffff);
  border: 1px solid var(--mtd-border, #cbd5e1);
  border-radius: 4px;
  padding: 2.5px 8px;
  font-size: 11px;
  color: var(--mtd-text-muted, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}
.mtd-mermaid-toggle-btn:hover,
.mtd-mermaid-copy-btn:hover {
  background: var(--mtd-bg, #f0f9ff);
  color: var(--mtd-primary, #0284c7);
  border-color: var(--mtd-primary, #0284c7);
}
.mtd-mermaid-viewport {
  padding: 16px 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--mtd-card-bg, #ffffff);
}
.mtd-mermaid-render {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  width: 100%;
}
.mtd-mermaid-element {
  display: flex;
  justify-content: center;
  width: 100%;
}
.mtd-mermaid-element svg {
  max-width: 100%;
  height: auto;
  overflow: visible;
}
.mtd-mermaid-element svg text,
.mtd-mermaid-element svg .nodeLabel,
.mtd-mermaid-element svg .label {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 13.5px !important;
  line-height: 1.2 !important;
}
.mtd-mermaid-raw {
  margin: 14px 0 0 0 !important;
  padding: 12px 16px !important;
  background: #0f172a !important;
  border-radius: 6px !important;
  border: 1px solid #1e293b !important;
  color: #e2e8f0 !important;
  font-family: var(--mtd-font-mono, monospace) !important;
  font-size: 12.5px !important;
  line-height: 1.5 !important;
  overflow-x: auto;
}
.mtd-mermaid-raw code {
  color: #38bdf8 !important;
  background: transparent !important;
  padding: 0 !important;
}

/* === Markdown 注释与脚注样式系统 === */
.mtd-footnote-ref {
  font-size: 11.5px;
  font-weight: 600;
  vertical-align: super;
  line-height: 0;
  margin: 0 2px;
}
.mtd-footnote-ref a.mtd-fn-link {
  color: var(--mtd-primary, #0969da);
  text-decoration: none;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(9, 105, 218, 0.08);
  transition: all 0.2s ease;
}
.mtd-footnote-ref a.mtd-fn-link:hover {
  background: var(--mtd-primary, #0969da);
  color: #ffffff;
}

/* 行内气泡注释 (Inline Comment / Popover) */
.mtd-inline-comment {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0 3px;
  cursor: pointer;
  vertical-align: middle;
}
.mtd-comment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  transition: transform 0.15s ease;
}
.mtd-inline-comment:hover .mtd-comment-badge,
.mtd-inline-comment:focus .mtd-comment-badge {
  transform: scale(1.1);
  background: #fde68a;
}
.mtd-comment-popover {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1e293b;
  color: #f8fafc;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.45;
  white-space: normal;
  width: max-content;
  max-width: 280px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.mtd-comment-popover::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1e293b;
}
.mtd-inline-comment:hover .mtd-comment-popover,
.mtd-inline-comment:focus .mtd-comment-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* 文末脚注列表区域 (Footnotes Area) */
.mtd-footnotes-area {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px dashed var(--mtd-border, #e5e7eb);
}
.mtd-footnotes-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--mtd-text-muted, #64748b);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.mtd-footnotes-list {
  padding-left: 20px;
  margin: 0;
  color: var(--mtd-text-main, #334155);
  font-size: 13.5px;
  line-height: 1.6;
}
.mtd-footnote-item {
  margin-bottom: 10px;
}
.mtd-footnote-item:target {
  background: rgba(9, 105, 218, 0.08);
  border-radius: 4px;
  padding: 4px 8px;
}
.mtd-fn-backlink {
  color: var(--mtd-primary, #0969da);
  text-decoration: none;
  margin-left: 6px;
  font-weight: bold;
  font-size: 14px;
}
.mtd-fn-backlink:hover {
  text-decoration: underline;
}

/* 原生 HTML 图片与 Markdown 图片响应式美化支持 */
.mtd-article-pane img,
.mtd-content-col img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  vertical-align: middle;
  box-sizing: border-box;
}

/* =============================================================
   右侧面板：隐藏备忘注释 (Margin Notes / Aside Notes)
   ============================================================= */
.mtd-right-toc-sidebar.mtd-notes-sidebar {
  position: relative;
  width: 350px;
  min-width: 350px;
  max-width: 350px;
  min-height: 100%;
  border-left: 1px dashed var(--mtd-border, #e2e8f0);
}

.mtd-layout-shell.has-notes-right .mtd-right-toc-sidebar.mtd-notes-sidebar {
  width: 350px;
  min-width: 350px;
  max-width: 350px;
}

@media (min-width: 1440px) {
  .mtd-right-toc-sidebar.mtd-notes-sidebar,
  .mtd-layout-shell.has-notes-right .mtd-right-toc-sidebar.mtd-notes-sidebar {
    width: 360px;
    min-width: 360px;
    max-width: 360px;
  }
}

@media (max-width: 1280px) and (min-width: 993px) {
  .mtd-right-toc-sidebar.mtd-notes-sidebar,
  .mtd-layout-shell.has-notes-right .mtd-right-toc-sidebar.mtd-notes-sidebar {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
  }
}

.mtd-margin-notes-box {
  position: relative;
  width: 100%;
}

.mtd-margin-note-card {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 3.5px solid #f59e0b;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #334155;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  z-index: 5;
}

.mtd-margin-note-card:hover {
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.18);
  transform: translateY(-1px);
}

.mtd-margin-note-header {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #d97706;
}

.mtd-margin-note-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.mtd-margin-note-body {
  font-size: 12px;
  color: #475569;
  word-break: break-word;
}

.mtd-margin-note-body p,
.mtd-margin-note-body .mtd-p {
  margin: 0 0 5px 0;
  font-size: 12px;
  line-height: 1.5;
}
.mtd-margin-note-body p:last-child,
.mtd-margin-note-body .mtd-p:last-child {
  margin-bottom: 0;
}
.mtd-margin-note-body h1,
.mtd-margin-note-body h2,
.mtd-margin-note-body h3,
.mtd-margin-note-body h4,
.mtd-margin-note-body h5,
.mtd-margin-note-body h6,
.mtd-margin-note-body .mtd-heading {
  font-size: 12.5px;
  font-weight: 700;
  margin: 4px 0 3px 0;
  color: #1e293b;
  border-bottom: none;
  padding: 0;
}
.mtd-margin-note-body code,
.mtd-margin-note-body .mtd-inline-code {
  font-size: 11px;
  padding: 1px 4px;
  background: #f1f5f9;
  border-radius: 3px;
  color: #0f172a;
}
.mtd-margin-note-body pre,
.mtd-margin-note-body .mtd-pre {
  margin: 4px 0;
  padding: 6px 8px;
  font-size: 11px;
  background: #f8fafc;
  border-radius: 4px;
  overflow-x: auto;
}
.mtd-margin-note-body a,
.mtd-margin-note-body .mtd-link {
  color: #2563eb;
  text-decoration: underline;
}
.mtd-margin-note-body strong {
  font-weight: 600;
  color: #0f172a;
}
.mtd-margin-note-body del {
  color: #94a3b8;
}
.mtd-margin-note-body ul,
.mtd-margin-note-body ol,
.mtd-margin-note-body .mtd-ul,
.mtd-margin-note-body .mtd-ol {
  margin: 3px 0 4px 16px;
  padding: 0;
  font-size: 11.5px;
}
.mtd-margin-note-body .mtd-table-wrap,
.mtd-margin-note-body table {
  width: 100%;
  margin: 4px 0;
  font-size: 11px;
  border-collapse: collapse;
}
.mtd-margin-note-body th,
.mtd-margin-note-body td {
  padding: 3px 5px;
}
.mtd-margin-note-body .mtd-alert,
.mtd-margin-note-body blockquote {
  margin: 4px 0;
  padding: 5px 8px;
  font-size: 11.5px;
  border-radius: 4px;
}
.mtd-margin-note-body .mtd-details {
  margin: 4px 0;
  font-size: 11.5px;
}
.mtd-margin-note-body .mtd-code-block {
  margin: 4px 0;
}
.mtd-margin-note-body .mtd-latex-block {
  margin: 4px 0;
  padding: 4px 6px;
}
.mtd-margin-note-body .mtd-mermaid-block {
  margin: 4px 0;
}

.mtd-margin-note-anchor {
  display: inline-block;
  width: 0;
  height: 0;
  overflow: hidden;
  vertical-align: baseline;
  pointer-events: none;
}

/* 气泡注释内部多格式渲染美化 */
.mtd-comment-popover-inner {
  display: inline-block;
}
.mtd-comment-popover-inner strong {
  font-weight: 700;
  color: #0f172a;
}
.mtd-comment-popover-inner code {
  font-size: 11px;
  padding: 1px 4px;
  background: #f1f5f9;
  border-radius: 3px;
}
.mtd-comment-popover-inner a {
  color: #2563eb;
  text-decoration: underline;
}
.mtd-comment-popover-inner del {
  color: #94a3b8;
}

/* 单文档独立设置禁用左侧栏折叠 (仅隐藏桌面端折叠按钮，移动端全屏抽屉菜单始终保留可用) */
.mtd-container.mtd-disable-sidebar-collapse .mtd-btn-sidebar-toggle.mtd-hide-mobile,
.mtd-container.mtd-disable-sidebar-collapse .mtd-sidebar-close-btn.mtd-hide-mobile,
.mtd-layout-shell.mtd-disable-sidebar-collapse .mtd-btn-sidebar-toggle.mtd-hide-mobile,
.mtd-layout-shell.mtd-disable-sidebar-collapse .mtd-sidebar-close-btn.mtd-hide-mobile {
  display: none !important;
}

/* 单文档独立设置禁用面包屑 (特异性压制 input:checked) */
.mtd-topbar-breadcrumb-pane.mtd-bc-disabled,
input:checked ~ .mtd-layout-shell .mtd-topbar-breadcrumb-pane.mtd-bc-disabled,
.mtd-layout-shell .mtd-topbar-breadcrumb-pane.mtd-bc-disabled {
  display: none !important;
}

@keyframes mtdPopInCenter {
  from {
    opacity: 0;
    transform: translate(-50%, -10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}
