@modal-cls: ~"@{prefix}-modal";

.@{modal-cls}-container {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 999;

  .@{modal-cls}-mask {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.4);
  }

  .@{modal-cls}-wrapper {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: auto;

    .@{modal-cls} {
      position: relative;
      min-width: 300px;
      max-width: 100%;
      margin: 0 auto;
      background-color: @gary-1;
      border-radius: 8px;
      vertical-align: middle;

      &-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-sizing: border-box;
        padding: 14px 24px;

        &-title {
          flex: 1;
          font-size: 14px;
          font-weight: 500;
          color: @gary-9;
        }

        &-close {
          fill: @gary-7;
          cursor: pointer;
          padding: 2px;
          border-radius: 10px;
          transition: all 0.2s ease;

          &:hover {
            fill: @gary-8;
            background-color: @gary-4;
            transition: all 0.2s ease;
          }
        }
      }

      &-body {
        position: relative;
        font-size: 14px;
        color: @gary-10;
        padding: 10px 24px;
        overflow: auto;
      }

      .no-footer {
        padding: 10px 24px 24px 24px;
      }

      &-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 14px 24px;
        box-sizing: border-box;
      }
    }

    // 边框处理
    .@{modal-cls}-border {
      .@{modal-cls}-header {
        border-bottom: 1px solid @gary-4;
      }
      .@{modal-cls}-footer {
        border-top: 1px solid @gary-4;
      }
    }

    // 标题对齐方式
    .@{modal-cls}-title-left {
      .@{modal-cls}-header-title {
        text-align: left;
      }
    }

    .@{modal-cls}-title-center {
      .@{modal-cls}-header-title {
        text-align: center;
      }
    }

    .@{modal-cls}-title-right {
      .@{modal-cls}-header-title {
        text-align: right;
      }
    }
  }
}

.fade-modal-mask-enter-from,
.fade-modal-mask-appear-from {
  opacity: 0;
}

.fade-modal-mask-enter-to,
.fade-modal-mask-appear-to {
  opacity: 1;
}

.fade-modal-mask-enter-active,
.fade-modal-mask-appear-active {
  transition: all 0.2s cubic-bezier(0, 0, 1, 1);
}

.fade-modal-mask-leave-from {
  opacity: 1;
}

.fade-modal-mask-leave-to {
  opacity: 0;
}

.fade-modal-mask-leave-active {
  transition: all 0.2s cubic-bezier(0, 0, 1, 1);
}

.modal-fade-enter-active {
  animation: modal-fade-in 0.2s;
}

.modal-fade-leave-active {
  animation: modal-fade-out 0.2s;
}

@keyframes modal-fade-in {
  0% {
    transform: scale(0.5, 0.5);
    opacity: 0;
  }

  100% {
    transform: scale(1, 1);
    opacity: 1;
  }
}

@keyframes modal-fade-out {
  0% {
    transform: scale(1, 1);
    opacity: 1;
  }

  100% {
    transform: scale(0.5, 0.5);
    opacity: 0;
  }
}
