@keyframes rotation {
  0% {
    -webkit-transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
  }
}

.nut-toast {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  text-align: center;
  pointer-events: none;
  z-index: 9999;
  &__overlay-default {
    --nutui-overlay-bg-color: rgba(0, 0, 0, 0);
  }
  &-small {
    .nut-toast__inner {
      font-size: $font-size-small;
    }
  }
  &-large {
    .nut-toast__inner {
      font-size: $font-size-large;
    }
  }
  &-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    height: 100%;
    background: $toast-cover-bg-color;
  }
  &__inner {
    display: inline-block;
    font-size: $toast-text-font-size;
    min-width: 40%;
    max-width: 65%;
    text-align: $toast-inner-text-align;
    padding: $toast-inner-padding;
    word-break: break-all;
    background: $toast-inner-bg-color;
    border-radius: $toast-inner-border-radius;
    color: $toast-font-color;
    position: absolute;
    left: 50%;
    top: $toast-inner-top;
    transform: translate(-50%, -50%);
  }
  &-center {
    top: var(--nutui-toast-inner-top, 50%);
  }
  &-bottom {
    top: var(--nutui-toast-inner-top, 80%);
  }
  &-top {
    top: var(--nutui-toast-inner-top, 20%);
  }
  &-text {
    font-size: $toast-text-font-size;
    &:empty {
      margin-bottom: -8px;
    }
  }
  &-title {
    font-size: $toast-title-font-size;
    &:empty {
      margin-bottom: -8px;
    }
  }
  &-has-icon {
    .nut-toast__icon-wrapper {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 8px;
    }
  }
  &-loading {
    .nut-toast__inner {
      display: inline-flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }
    .nut-toast__icon-wrapper {
      animation: rotation 2s linear infinite;
    }
  }
}

.toast-fade-enter-active {
  transition: opacity 0.3s;
}

.toast-fade-leave-active {
  transition: opacity 0.3s;
}

.toast-fade-enter-from,
.toast-fade-leave-to {
  opacity: 0;
}
