.yc-avatar {
  cursor: default;
  position: relative;
  background-color: var(--color-fill-4);
  color: var(--color-white);
  font-size: 20px;
  white-space: nowrap;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;

  &:hover .yc-avatar-trigger-icon-button {
    background-color: var(--color-neutral-3);
  }
  &:hover .yc-avatar-trigger-icon-mask {
    opacity: 1;
  }
  .yc-avatar-text {
    position: absolute;
    left: 50%;
    font-weight: 500;
    line-height: 1;
    transform-origin: 0 center;
  }
  .yc-avatar-image {
    overflow: hidden;
    display: inline-block;
    width: 100%;
    height: 100%;
    & > img {
      width: 100%;
      height: 100%;
    }
    .yc-avatar-image-icon {
      width: 100%;
      height: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
    }
  }
  .yc-avatar-trigger-icon-button {
    position: absolute;
    right: -4px;
    bottom: -4px;
    z-index: 1001;
    cursor: pointer;
    width: 20px;
    height: 20px;
    background-color: var(--color-neutral-2);
    border-radius: var(--border-radius-circle);
    color: var(--color-fill-4);
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    transition: background-color 0.1s cubic-bezier(0, 0, 1, 1);
  }
  .yc-avatar-trigger-icon-mask {
    z-index: 1001;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
    background-color: var(--color-mask-bg);
    opacity: 0;
    color: var(--color-white);
    font-size: 16px;
    transition: all 0.1s cubic-bezier(0, 0, 1, 1);
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

// shape
@shape: {
  round: var(--border-radius-circle);
  square: var(--border-radius-medium);
};
each(@shape,{
  .yc-avatar-shape-@{key}{
    border-radius: @value;
    .yc-avatar-image,
    .yc-avatar-trigger-icon-mask {
      border-radius: @value;
    }
  }
});
