.pre {
  position: relative;

  .copy {
    opacity: 0;
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    display: block;
    border-radius: 4px;
    border: 2px solid #c3c5c6;
    width: 40px;
    height: 40px;
    cursor: pointer;
    background-position: 50%;
    background-size: 20px;
    background-repeat: no-repeat;
    background-color: rgba(255, 255, 255, 0.05);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' height='20' width='20' stroke='rgba(128,128,128,1)' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2M9 5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2'/%3E%3C/svg%3E");
    transition: opacity 0.4s;
  }

  .copied {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' height='20' width='20' stroke='rgba(128,128,128,1)' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2M9 5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2m-6 9 2 2 4-4'/%3E%3C/svg%3E");

    &::before {
      position: absolute;
      display: inline-block;
      right: 120%;
      top: 50%;
      transform: translate(0, -50%);
      color: #999988;
      font-size: 12px;
      font-weight: 500;
      font-family: consolas;
      white-space: nowrap;
      content: 'Copied';
    }
  }

  &:hover {
    .copy {
      opacity: 1;
    }
  }
}
