/* 行内代码复制功能样式 */
.inline-code-wrapper {
  position: relative;
  display: inline-block;
  margin: 0 0px;
}

/* 行内代码基础样式和交互效果 */
.inline-code-wrapper code {
  cursor: pointer;
  position: relative;
}

/* 显示复制按钮时的背景色变化 */
.inline-code-wrapper.show-copy code {
  background-color: rgba(147, 197, 253, 0.3) !important; /* 更纯的浅蓝色 light-blue-300 */
}

/* 复制成功时的背景色 */
.inline-code-wrapper.success code {
  background-color: rgba(34, 197, 94, 0.15) !important;
}

/* 复制失败时的背景色 */
.inline-code-wrapper.error code {
  background-color: rgba(239, 68, 68, 0.15) !important;
}

/* 行内代码复制按钮（圆形，仅显示作用） */
.inline-code-wrapper .inline-copy-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 20px;
  height: 20px;
  border-radius: 50%; /* 圆形 */
  background: linear-gradient(
    135deg,
    rgba(147, 197, 253, 0.9),
    /* 浅蓝色 */ rgba(125, 185, 232, 0.9) /* 稍深的浅蓝色 */
  );
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 2px 8px rgba(147, 197, 253, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.7);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  pointer-events: none; /* 只作为显示，不接收点击事件 */
}

/* 显示复制按钮 */
.inline-code-wrapper.show-copy .inline-copy-btn {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  pointer-events: none;
}

/* 复制按钮图标 */
.inline-code-wrapper .inline-copy-btn i {
  font-size: 10px;
  color: #ffffff;
  transition: all 0.2s ease;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

/* 复制成功时的按钮样式 */
.inline-code-wrapper.success .inline-copy-btn {
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.9),
    rgba(22, 163, 74, 0.9)
  );
  box-shadow:
    0 2px 8px rgba(34, 197, 94, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.inline-code-wrapper.success .inline-copy-btn i {
  color: #ffffff;
  animation: inlineSuccessPulse 1s ease-out;
}

/* 复制失败时的按钮样式 */
.inline-code-wrapper.error .inline-copy-btn {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.9),
    rgba(220, 38, 38, 0.9)
  );
  box-shadow:
    0 2px 8px rgba(239, 68, 68, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.inline-code-wrapper.error .inline-copy-btn i {
  color: #ffffff;
  animation: inlineErrorShake 1s ease-out;
}

/* 复制成功动画 */
@keyframes inlineSuccessPulse {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 复制失败动画 */
@keyframes inlineErrorShake {
  0%,
  100% {
    transform: translateX(0) scale(1);
  }
  25% {
    transform: translateX(-3px) scale(1.05);
  }
  75% {
    transform: translateX(3px) scale(1.05);
  }
}