/* 强制侧边栏出现滚动条，并优化滚动体验 */
.md-sidebar__scrollwrap {
  overflow-y: auto !important;
  scroll-behavior: smooth;
  /* 确保侧边栏不会超出屏幕高度，减去顶栏和底部间隙 */
  max-height: calc(100vh - 100px) !important;
}

/* 针对集成式导航列表的滚动优化 */
.md-nav--primary,
.md-nav--integrated {
  height: auto !important;
}

/* 针对 Webkit 核心（Chrome, Edge, Safari）定制滚动条样式，使其更容易被察觉 */
.md-sidebar__scrollwrap::-webkit-scrollbar {
  width: 6px;
  background-color: transparent;
}

.md-sidebar__scrollwrap::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.4);
}

/* 暗色模式下的滚动条适配 */
[data-md-color-scheme="slate"] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
}

[data-md-color-scheme="slate"] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.4);
}