/* 缩略图样式：鼠标悬停时显示放大镜图标 */
.md-zoom-trigger {
  display: inline-block;
  cursor: zoom-in;
}

/* 全屏遮罩层：默认隐藏 */
.md-zoom-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

/* 核心：当 URL hash 匹配到该 id 时，显示遮罩 */
.md-zoom-overlay:target {
  display: flex;
}

/* 放大后的图片 */
.md-zoom-overlay img {
  width: 95vw;
  height: 95vh;
  object-fit: contain;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
  animation: mdZoomIn 0.3s ease;
}

@keyframes mdZoomIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* 关闭按钮 */
.md-zoom-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2.5rem;
  line-height: 1;
  color: #fff;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.md-zoom-close:hover {
  opacity: 1;
}

/* 点击遮罩空白处关闭 */
.md-zoom-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.content-with-toc {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.main-content {
  flex: 1;
  min-width: 0;
}

.toc-sidebar {
  flex-shrink: 0;
  width: 240px;
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  font-size: 0.9rem;
  order: -1; /* 目录放右侧；想放左侧改成 -1 */
}

/* Hugo 生成的目录结构 */
#TableOfContents ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

#TableOfContents ul ul {
  padding-left: 1rem;
}

#TableOfContents li {
  margin: 0.35rem 0;
}

#TableOfContents a {
  display: block;
  padding: 0.2rem 0.4rem;
  color: #666;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s;
}

#TableOfContents a:hover {
  color: #1a73e8;
  background: #f0f4ff;
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

h2, h3, h4 {
  scroll-margin-top: 1rem;
}

/* 移动端：隐藏目录 */
@media (max-width: 900px) {
  .toc-sidebar {
    display: none;
  }
}

  .title h2 {
  font-size: 2rem !important;
  margin-bottom: 1.5rem; /* 标题下方增加空行 */
  line-height: 1.3;
}
