@import '../../../design/index';
@prefix-cls: ~'@{tkcspace}-background';
.@{prefix-cls} {
  width: auto;
  &__square {
    width: 39px;
    height: 39px;
    padding: 0;
    margin: 0;
  }

  &__square_item {
    float: left;
    box-sizing: border-box;
    width: calc(100% / 3);
    height: calc(100% / 3);
    border: 1px solid #ededed;
    margin-top: -1px;
    margin-left: -1px;
    list-style: none;
    cursor: pointer;
  }

  &__square_item:hover {
    background-color: #d1d8f4;
  }

  &__square_item--active,
  &__square_item--active:hover {
    background-color:  @primary-color;
  }

  &__avatar {
    &-preview {
      width: 90px;
      height: 90px;
      margin: 8px 6px 0 0;
      position: relative;

      &:before {
        position: absolute;
        z-index: 1;
        width: 100%;
        height: 100%;
        background-color: #00000080;
        opacity: 0;
        transition: all 0.3s;
        border-radius: 4px;
        content: ' ';
      }

      &:hover {
        &:before {
          opacity: 1;
        }
        .showImgs {
          .actions {
            opacity: 1;
            color: #ffffff;
          }
          .action-del {
            opacity: 1;
          }
        }
      }

      .showImgs {
        display: flex;
        align-items: center;
        position: relative;
        box-sizing: border-box;
        width: 100%;
        height: 100%;
        padding: 4px;
        border: 1px solid #d9d9d9;
        border-radius: 4px;
        .action-del{
          width: 16px;
          height: 16px;
          opacity: 0;
          z-index: 999;
          cursor: pointer;
          background-color: #f5222d;
          border-radius: 100px;
          display: flex;
          justify-content: center;
          align-items: center;
          .del-icon{
            color: #fff; font-size: 10px;
          }
        }
        .actions {
          position: absolute;
          top: 50%;
          left: 50%;
          z-index: 10;
          white-space: nowrap;
          transform: translate(-50%, -50%);
          opacity: 0;
          transition: all 0.3s;
          .action-icon{
            margin: 0;
            padding: 0;
            font-size: 16px;
            color: #fff;
          }
        }
      }

      .action-btn{
        color: #ffffff;
      }
    }

    &-uploader {
      width: 90px;
      height: 90px;
      margin-right: 8px;
      margin-bottom: 8px;
      text-align: center;
      vertical-align: top;
      background-color: #fafafa;
      border: 1px dashed #d9d9d9;
      border-radius: 2px;
      cursor: pointer;
      transition: border-color 0.3s;
      display: flex;
      align-items: center;
      justify-content: center;

      .upload-box {
      }

      .upload-icon {
        font-size: 24px;
        color: #919191;
        font-weight: lighter;
      }

      &:hover {
        border-color: @primary-color;
      }
    }
  }
}
