
/* 移除顶栏，让它不占空间 */
html body #header {
  position: fixed !important;
  top: 16px !important;
  left: 16px !important;
  right: auto !important;
  bottom: auto !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  z-index: 1000 !important;
}

/* 只保留导航按钮 */
html body #header > :not(#left-pane-toggle-button) {
  display: none !important;
}

/* 悬浮导航按钮 */
html body #header #left-pane-toggle-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  padding: 8px !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 12px !important;
  background: var(--background-secondary, #fff) !important;
  color: var(--text-menu, #333) !important;
  box-shadow: 0 4px 16px rgb(0 0 0 / 18%) !important;
  cursor: pointer !important;
}

html body #left-pane-toggle-button svg {
  width: 24px !important;
  height: 24px !important;
}

/* 避免按钮挡住正文标题 */
html body #main {
  padding-top: 76px !important;
}

/* 菜单按钮 */
html body #header #left-pane-toggle-button {
  color: #6b879b !important;
  background: rgb(225 239 250 / 35%) !important;
  border: none !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: background-color 150ms ease;
}

html body #header #left-pane-toggle-button:hover,
html body #header #left-pane-toggle-button:focus-visible {
  background: rgb(225 239 250 / 65%) !important;
  box-shadow: none !important;
}

html body #header #left-pane-toggle-button {
  width: 22px !important;
  height: 22px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 4px !important;
  box-sizing: border-box !important;
  border-radius: 4px !important;
}

html body #header #left-pane-toggle-button svg {
  width: 12px !important;
  height: 12px !important;
}

/* 页面目录 */
@media (min-width: 48.01em) {
  html:not(.toc-pane-collapsed) #toc-pane {
    width: var(--share-toc-width, 250px);
    box-sizing: border-box;
    padding-left: 12px;
    transition: none;
  }

  #toc-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    touch-action: none;
  }

  #toc-resize-handle:hover,
  #toc-resize-handle:active {
    background: rgb(140 190 230 / 25%);
  }
}

@media (max-width: 48em) {
  #toc-resize-handle {
    display: none;
  }
}

/* 解决手机端菜单键无效问题 */
@media (max-width: 48em) {
  html body #left-pane {
    width: 80% !important;
    max-width: 300px !important;
    margin-left: 0 !important;
    overflow-y: auto !important;
  }
}
