@mixin checkerboard($size:16px, $color:#ccc) {
  background-image: linear-gradient(45deg, $color 26%, transparent 26%, transparent 76%, $color 74%, $color),
  linear-gradient(45deg, $color 26%, transparent 26%, transparent 76%, $color 74%, $color);
  background-size: $size $size;
  background-position: 0 0, $size*0.5 $size*0.5;
}

.cos-upload {
  width: 64px;
  height: 64px;
  position: relative;
  border: 1px solid #f0f0f0;
  border-radius: 3px;
  margin-top: 8px;
  @include checkerboard(10px, #f3f3f3);

  .upload-file {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    opacity: 0;
  }

  .upload-icon {
    color: #ccc;
    display: flex;
    flex-direction: column;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    user-select: none;

    :global(.xiatu-rich) {
      font-size: 18px;
    }

    &:after {
      content: '上传图片';
      line-height: 1em;
      margin-top: .5em;
      font-size: 12px;
      white-space: nowrap;
    }
  }
}
