.image-uploader {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  &-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  // Ant Design 风格的上传按钮
  &-upload-button {
    width: 104px;
    height: 104px;
    border: 1px dashed #d9d9d9;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;

    &:hover {
      border-color: #1890ff;
      background: #f0f8ff;

      .image-uploader-upload-button-icon {
        color: #1890ff;
      }

      .image-uploader-upload-button-text {
        color: #1890ff;
      }
    }

    &-icon {
      font-size: 24px;
      color: #999;
      margin-bottom: 8px;
      transition: color 0.3s;
      width: 24px;
      height: 24px;
    }

    &-text {
      font-size: 14px;
      color: #666;
      transition: color 0.3s;
    }
  }

  // Ant Design 风格的图片预览项
  &-preview-item {
    width: 104px;
    height: 104px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #fff;
    transition: all 0.3s;

    &:hover {
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);

      .image-uploader-preview-item-mask {
        opacity: 1;
      }
    }

    &-image {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    &-mask {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      opacity: 0;
      transition: opacity 0.3s;
    }

    &-action {
      color: #fff;
      font-size: 16px;
      cursor: pointer;
      padding: 4px;
      border-radius: 4px;
      transition: all 0.3s;

      &:hover {
        color: #1890ff;
        background: rgba(255, 255, 255, 0.2);
      }
    }
  }

  // Loading 遮罩
  &-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;

    &-spinner {
      width: 24px;
      height: 24px;
      border: 3px solid rgba(255, 255, 255, 0.3);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

// 旧样式兼容（如果需要）
.image-space-item {
  display: inline-block;
  margin-right: 8px;
  padding-bottom: 8px;
}

.image-uploader-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 4px;
  overflow: hidden;
}

.uploader-add-icon,
.uploader-delete-icon {
  width: 32px;
  height: 32px;
}
