@import "../../base.less";

@import "./_var.less";

@import "../../mixins/_index.less";

.@{prefix}-toast {
  position: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  max-width: 188px;
  border-radius: @radius-small;
  color: @toast-text-color;
  background: rgba(0, 0, 0, 60%);
  text-align: center;
  padding: calc(@spacer * 2.5);
  z-index: @toast-z-index;

  &:not(&--text)&--column {
    border-radius: calc(@radius-small * 2);
  }

  .@{prefix}-icon {
    color: inherit;
    font-size: 48px;
  }

  &__text {
    font-size: @toast-font-size-base;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 22px;
    margin-top: @spacer-1;
    min-width: 82px;
  }

  &--text {
    width: fit-content;
    padding-top: 14px;
    padding-bottom: 14px;

    .@{prefix}-toast__text {
      margin-top: 0;
      min-width: auto;
    }
  }

  /** 有无icon判断 */
  &--icononly {
    padding-top: @spacer-1;
    padding-bottom: @spacer-1;
    min-width: 88px;
    min-height: 88px !important; // stylelint-disable-line
    flex-direction: initial;
  }

  &--middle {
    left: 50%;
    top: 50%;
    transform: translate3d(-50%, -50%, 0);
  }

  &--top {
    left: 50%;
    top: @spacer-1;
    transform: translateX(-50%);
  }

  &--bottom {
    left: 50%;
    bottom: @spacer-1;
    transform: translateX(-50%);
  }

  &--row {
    flex-direction: row;
    padding: 14px 24px;

    .@{prefix}-icon {
      color: inherit;
      font-size: 24px;
    }

    .@{prefix}-toast__text {
      margin-top: 0;
      margin-left: @spacer;
      min-width: auto;
      line-height: 24px;
    }
  }
}
