/* 目录外观 */
#cnblogs_post_body .toc {
  box-sizing: border-box;
  padding: 16px;
  background: #fff;
  color: #333;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  font-size: 14px;
  line-height: 1.8;
}

#cnblogs_post_body .toc ul {
  margin: 0;
  padding-left: 18px;
}

#cnblogs_post_body .toc a {
  color: #444;
  text-decoration: none;
  overflow-wrap: anywhere;
}

#cnblogs_post_body .toc a:hover {
  color: #1677ff;
  text-decoration: underline;
}

/* 宽屏时固定在页面右侧，长目录可以独立滚动 */
@media (min-width: 1400px) {
  #cnblogs_post_body .toc {
    position: fixed;
    top: 100px;
    right: 20px;
    left: auto;
    width: 230px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    z-index: 1000;
  }
}

/* 点击目录后，为标题上方留出空间 */
#cnblogs_post_body :is(h1, h2, h3, h4, h5, h6) {
  scroll-margin-top: 80px;
}

/* 目录开关按钮 */
#cnblogs_post_body .toc-toggle {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1677ff;
  font: inherit;
  font-weight: bold;
  text-align: left;
  cursor: pointer;
}

#cnblogs_post_body .toc > ul[hidden] {
  display: none !important;
}