.markdown.yui-toc-root {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.markdown.yui-toc-root > .markdown-body {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}
.yui-md-toc {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  will-change: transform;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 16px);
  height: calc(100dvh - 16px);
  min-width: 0;
  max-height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  overflow: hidden;
  z-index: 10;
}
.yui-md-toc-header {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0 14px;
}
.yui-md-toc-header strong { font-size: 14px; white-space: nowrap; }
.yui-md-toc button { font: inherit; color: inherit; cursor: pointer; }
.yui-md-toc-header button {
  border: 0;
  border-radius: 0;
  padding: 5px 7px;
  background: transparent;
  font-size: 12px;
  white-space: nowrap;
  opacity: .7;
}
.yui-md-toc-header button:hover { opacity: 1; }
.yui-md-toc ol {
  position: relative;
  flex: 1;
  min-height: 0;
  list-style: none;
  padding: 0 5px 16px 0;
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 138, 153, .4) transparent;
}
.yui-md-toc ol::-webkit-scrollbar { width: 4px; }
.yui-md-toc ol::-webkit-scrollbar-thumb { background: #808a9966; border-radius: 4px; }
.yui-md-toc ol::-webkit-scrollbar-track { background: transparent; }
.yui-md-toc li { margin: 0; padding: 0; }
.yui-md-toc li button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  font-size: 13px;
  line-height: 1.7;
  padding: 6px 8px;
  overflow-wrap: anywhere;
}
.yui-md-toc li button:hover { color: #477dde; }
.yui-md-toc li button[aria-current] { color: #285fc8; font-weight: inherit; }
.yui-md-toc button:focus-visible { outline: 2px solid #5689ed; outline-offset: -2px; }
.markdown.yui-toc-collapsed { grid-template-columns: 56px minmax(0, 1fr); }
.yui-md-toc.yui-toc-panel-collapsed { height: auto; }
.yui-toc-panel-collapsed .yui-md-toc-header { justify-content: center; padding: 8px 0; }
.yui-toc-panel-collapsed .yui-md-toc-header strong,
.yui-toc-panel-collapsed ol { display: none; }
.hope-ui-dark .yui-md-toc li button:hover,
.hope-ui-dark .yui-md-toc li button[aria-current] { color: #a4c1ff; }
@media (max-width: 900px) {
  .markdown.yui-toc-root,
  .markdown.yui-toc-collapsed { display: block; }
  .yui-md-toc {
    position: static;
    width: 100%;
    height: auto;
    max-height: none;
    z-index: auto;
  }
  .yui-md-toc ol { flex: none; max-height: 65vh; max-height: 65dvh; margin-bottom: 16px; }
  .yui-md-toc.yui-toc-panel-collapsed { width: 100%; }
  .yui-toc-panel-collapsed .yui-md-toc-header { justify-content: space-between; }
  .yui-toc-panel-collapsed .yui-md-toc-header strong { display: block; }
}

@media (min-width: 901px) {
  div:has(> .body):has(.markdown.yui-toc-root) {
    width: min(99%, 1120px) !important;
  }
}

.yui-md-toc-slot { grid-column: 1; grid-row: 1; align-self: stretch; min-width: 0; min-height: 0; contain: size; }
.hope-ui-light .yui-md-toc { color: #33415d; }
.hope-ui-dark .yui-md-toc { color: #d8dfed; }
@media (max-width: 900px) { .yui-md-toc-slot { display: block; contain: none; } .yui-md-toc { will-change: auto; } }
