/* 标题复制链接按钮样式 */
.md-anchor-copy {
  position: absolute;
  left: -1.2rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  padding: 0.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--md-default-fg-color--lighter);
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 0.2rem;
}

.md-anchor-copy:hover {
  color: var(--md-primary-fg-color);
  background: var(--md-default-bg-color--lightest);
}

h1:hover .md-anchor-copy,
h2:hover .md-anchor-copy,
h3:hover .md-anchor-copy,
h4:hover .md-anchor-copy,
h5:hover .md-anchor-copy,
h6:hover .md-anchor-copy {
  opacity: 1;
}

.md-anchor-copy svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.md-anchor-copy:hover svg {
  opacity: 1;
}

.md-anchor-copy-tooltip {
  position: absolute;
  left: -3.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  padding: 0.3rem 0.6rem;
  border-radius: 0.3rem;
  font-size: 0.7rem;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 10;
  pointer-events: none;
}

/* 确保标题不缩进，按钮在标题左侧浮动 */
h1, h2, h3, h4, h5, h6 {
  position: relative;
  padding-left: 0 !important;
  margin-left: 0 !important;
}

/* 只在桌面端显示按钮，移动端隐藏 */
@media screen and (max-width: 76.1875em) {
  .md-anchor-copy {
    display: none;
  }
}

