.highlight-wrap {
  position: relative;
}

.highlight-wrap:hover .copy-btn, .highlight-wrap .copy-btn:focus {
  opacity: 1;
}

.copy-btn {
  color: $black-dim;
  cursor: pointer;
  display: inline-block;
  font-weight: $font-weight-bolder;
  line-height: 1.6;
  opacity: 0;
  outline: 0;
  padding: 2px 6px;
  position: absolute;
  transition: opacity .3s ease-in-out;
  vertical-align: middle;
  white-space: nowrap;
  disable-user-select();

  if (hexo-config('codeblock.copy_button.style') == 'flat') {
    background-color: white;
    border: 0;
    font-size: $font-size-smaller;
    right: 0;
    top: 0;
  } else if (hexo-config('codeblock.copy_button.style') == 'mac') {
    color: white;
    font-size: 14px;
    right: 0;
    top: 2px;
  } else {
    background-color: $gainsboro;
    background-image: linear-gradient(#fcfcfc, $gainsboro);
    border: 1px solid #d5d5d5;
    border-radius: 3px;
    font-size: $font-size-smaller;
    right: 4px;
    top: 8px;
  }
}

if (hexo-config('codeblock.copy_button.style') == 'mac') {
  .highlight-wrap {
    background: #21252b;
    border-radius: 5px;
    box-shadow: 0 10px 30px 0 rgba(0, 0, 0, .4);
    padding-top: 30px;

    &::before {
      background: #fc625d;
      border-radius: 50%;
      box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
      content: ' ';
      height: 12px;
      left: 12px;
      margin-top: -20px;
      position: absolute;
      width: 12px;
    }
  }
}
