/* 标题定位与背景高亮 */
.article h1,
.article h2,
.article h3 {
  position: relative !important;
  display: block;
  width: -moz-fit-content;
  width: fit-content;
}

.article h1::after,
.article h2::after,
.article h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  margin: 5px;
  z-index: 1;
  width: 100%;
  height: 10px !important;
  opacity: 0.7;
  border-radius: 3px 8px 10px 6px;
  transform: skew(-35deg);
  /* 这里的背景高光保留了原来的 --heo-theme，如果需要也可以改为 --c-primary */
  background: linear-gradient(45deg, transparent, var(--heo-theme, #425AEF));
}

/* 锚点容器 */
.heading-anchor {
  display: inline-flex !important;
  align-items: center;
  position: relative;
  margin-right: 0.5em;
  user-select: none;
  z-index: 1;
}

/* 自动编号文字 */
.heading-anchor-number {
  font-weight: bold !important;
  color: var(--c-primary, #425AEF) !important;
  font-family: 'Courier New', monospace !important;
  font-size: inherit !important;
  line-height: inherit !important;
  display: inline !important;
  cursor: pointer !important;
  transition: opacity 0.2s ease;
}

.heading-anchor-number:hover {
  opacity: 0.7;
}

/* 复制按钮初始状态 */
.heading-copy-btn {
  opacity: 0;
  visibility: hidden;
  width: 1em;
  height: 1em;
  position: absolute !important;
  left: -1em;
  top: 50%;
  transform: translateY(-50%);
  fill: #aaa !important;
  transition: all 0.3s ease;
  cursor: pointer;
  z-index: 10;
}

/* 复制按钮显示状态 */
.heading-copy-btn.show {
  opacity: 1 !important;
  visibility: visible !important;
  fill: var(--c-primary, #425AEF) !important;
}

/* 复制成功后的动效与颜色 */
.heading-copy-btn.show.copied {
  fill: var(--c-primary, #425AEF) !important;
  color: var(--c-primary, #425AEF) !important;
  transform: translateY(-50%) scale(1.2) !important;
}

.heading-copy-btn.copied rect {
  fill: var(--c-primary, #425AEF) !important;
}

.heading-copy-btn.copied {
  --copy-btn-color: var(--c-primary, #425AEF);
  fill: var(--copy-btn-color) !important;
}