@charset "UTF-8";

@import "../../style/function";

//-----------------------------------------------------
// dialog
//-----------------------------------------------------

// 结构注释
//-----------------------------------------------------
// .im-dialog
//  .im-dialog-hd
//  .im-dialog-bd
//

.im-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  // 兼容ie9，待研究接入postcss
  -ms-transform: translate(-50%, -50%);
  background: $colorBg;
  border-top: 4px solid $primary;
  border-radius: 2px;
  min-width: 450px;
  box-sizing: border-box;

  // API调用的弹窗，不允许滚动
  &--api {
    .im-dialog-bd {
      overflow: hidden;
    }
  }

  &.small {
    width: 450px;
    min-height: 210px;
  }

  &.medium {
    width: 580px;
    min-height: 210px;
  }

  &.large {
    width: 800px;
    max-height: 600px;
    overflow: hidden;

    .im-dialog-ft {
      padding-bottom: 40px;
      text-align: left;
    }
  }

  &-mask {
    @include background-rgba(rgba(0, 0, 0, .6));
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: $zIndexOverlay;
  }

  &-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
    z-index: $zIndexOverlay + 1;
  }

  &-hd {
    //line-height: 45px;
    //height: 45px;
    color: $color9;
    position: relative;

    &-text,
    &-text-empty {
      margin: 0;
      line-height: 1;
      font-size: 16px;
      height: 15px;
      padding-left: 15px;
      padding-top: 11px;
    }

    &-text {
      padding-bottom: 30px;
    }

    &-text-empty {
      padding-bottom: 25px;
    }

    &-close {
      position: absolute !important;
      top: 15px;
      right: 15px;
      width: 15px;
      height: 15px;
      font-size: 16px;
      line-height: 14px;
      cursor: pointer;
      color: $colorC;

      &:hover {
        color: $color6;
      }
    }
  }

  &-bd {
    min-height: 65px;
    max-height: 440px;
    overflow: auto;
    color: $color3;
    padding: 0 40px;
    position: relative;

    &-icon {
      font-size: 36px;
      width: 36px;
      height: 36px;
      margin-right: 16px;
      vertical-align: top;

      &.i-info {
        color: $infoIcon;
      }

      &.i-alert {
        color: $alertIcon;
      }

      &.i-success {
        color: $succIcon;
      }

      &.i-question {
        color: $questionIcon;
      }
    }

    &.im-with-sub {
      height: 95px;

      .im-dialog-bd-msg-wrap {
        height: 57px;
      }
    }

    &-msg-wrap {
      text-align: center;
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      margin: auto;
      height: 36px;
    }

    $msgMaxWidth: 450px - 40px * 2 - 16px - 36px;

    &-msg {
      display: inline-block;
      line-height: 2;
      font-size: 18px;
      vertical-align: top;
      color: $color3;
      text-align: left;
      white-space: nowrap;
      max-width: $msgMaxWidth;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    &-msg-sub {
      display: block;
      color: $color6;
      font-size: 14px;
      line-height: 24px;
      padding-top: 7px;
      max-width: $msgMaxWidth;
      white-space: normal;
    }

    // 因为有些地方直接写在bd里，而不是通过button prop传入
    .im-dialog-ft {
      padding-left: 0;
      padding-right: 0;
    }
  }

  &-ft {
    padding: 30px 20px 20px;
    text-align: right;

    .im-btn {
      margin-left: 15px;

      &:first-child {
        margin-left: 0;
      }
    }
  }

}
