/* ========== readthedocs 主题增强 ========== */

/* 1) 加宽正文区域：默认 800px → 950px。再大就让位给右侧 TOC。 */
.wy-nav-content {
  max-width: 950px;
}

/* 2) 右侧浮动当前页目录（仿 Material 主题的 “在此页上”）。 */
.right-toc {
  display: none; /* 默认隐藏，宽屏才显示 */
}

@media (min-width: 1500px) {
  .right-toc {
    display: block;
    position: fixed;
    top: 80px;
    right: 32px;
    width: 240px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 14px 16px;
    border-left: 3px solid #e1e4e5;
    background: rgba(252, 252, 252, 0.97);
    font-size: 13px;
    line-height: 1.55;
    z-index: 50;
    box-sizing: border-box;
  }
}

.right-toc-title {
  font-weight: 600;
  color: #404040;
  margin: 0 0 8px 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.right-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.right-toc li {
  margin: 0;
  padding: 0;
}

.right-toc li.right-toc-h3 {
  padding-left: 12px;
}

.right-toc li.right-toc-h3 a {
  font-size: 12px;
  color: #777;
}

.right-toc a {
  display: block;
  padding: 3px 8px;
  color: #555;
  text-decoration: none;
  border-radius: 3px;
  word-break: break-word;
  border-left: 2px solid transparent;
}

.right-toc a:hover {
  background: #f0f0f0;
  color: #2980b9;
}

.right-toc a.active {
  color: #2980b9;
  font-weight: 600;
  border-left-color: #2980b9;
  background: #f3f7fa;
}

/* 滚动条收窄，避免突兀 */
.right-toc::-webkit-scrollbar {
  width: 6px;
}
.right-toc::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 3px;
}
