@charset "utf-8";
.mc-button {
  @include radius;
  @extend %transition-all;
  display: inline-block;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  background: #fff;
  border: 1px solid $line;
  color: $gray;
  -webkit-appearance: none;
  text-align: center;
  box-sizing: border-box;
  outline: 0;
  margin: 0;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  height: $height-m;
  padding: 0 10px;
  font-size: 14px;
  &+& {
    margin-left: 10px;
  }
  &:hover {
    color: $blue;
    border-color: $blue;
  }
  &.is-active,
  &:active {
    color: $d-blue;
    border-color: $d-blue;
    outline: 0;
  }
  [class*=mc-icon-]+span {
    margin-left: 5px;
  }
  &.is-loading {
    position: relative;
    pointer-events: none;
  }
  &.is-loading:before {
    pointer-events: none;
    content: '';
    position: absolute;
    left: -1px;
    top: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: inherit;
    background-color: rgba(255, 255, 255, .35);
  }
  &.is-disabled,
  &.is-disabled:hover {
    color: $disable-color;
    cursor: not-allowed;
    background-image: none;
    background-color: $disable-bg;
    border-color: $disable-line;
  }
  &.is-disabled.mc-button_text {
    background-color: transparent;
  }
}

// 颜色按钮
.mc-button_primary {
  color: #fff;
  background-color: $blue;
  border-color: $blue;
  &:hover {
    background: $l-blue;
    border-color: $l-blue;
    color: #fff;
  }
  &.is-active,
  &:active {
    background: $d-blue;
    border-color: $d-blue;
    color: #fff;
    outline: 0;
  }
}

.mc-button_success {
  color: #fff;
  background-color: $green;
  border-color: $green;
  &:hover {
    background: $l-green;
    border-color: $l-green;
    color: #fff;
  }
  &.is-active,
  &:active {
    background: $d-green;
    border-color: $d-green;
    color: #fff;
    outline: 0;
  }
}

.mc-button_warning {
  color: #fff;
  background-color: $yellow;
  border-color: $yellow;
  &:hover {
    background: $l-yellow;
    border-color: $l-yellow;
    color: #fff;
  }
  &.is-active,
  &:active {
    background: $d-yellow;
    border-color: $d-yellow;
    color: #fff;
    outline: 0;
  }
}

.mc-button_danger {
  color: #fff;
  background-color: $red;
  border-color: $red;
  &:hover {
    background: $l-red;
    border-color: $l-red;
    color: #fff;
  }
  &.is-active,
  &:active {
    background: $d-red;
    border-color: $d-red;
    color: #fff;
    outline: 0;
  }
}

.mc-button_large {
  height: $height-l;
  padding: 0 19px;
  font-size: 16px;
}

.mc-button_small {
  height: $height-s;
  padding: 0 9px;
  font-size: 12px;
}

.mc-button_text {
  border: none;
  color: $blue;
  background: 0 0;
  &:hover {
    color: $l-blue;
  }
  &:active {
    color: $d-blue;
  }
}


.mc-button-group {
  display: inline-block;
  vertical-align: middle;
  &:after,
  &:before {
    display: table;
    content: "";
  }
  &:after {
    clear: both;
  }
  .mc-button_primary,
  .mc-button_success,
  .mc-button_warning,
  .mc-button_danger,
  .mc-button_info {
    &:first-child {
      border-right-color: rgba(255, 255, 255, .5);
    }
    &:last-child {
      border-left-color: rgba(255, 255, 255, .5);
    }
    &:not(:first-child):not(:last-child) {
      border-left-color: rgba(255, 255, 255, .5);
      border-right-color: rgba(255, 255, 255, .5);
    }
  }
  .mc-button {
    @include float;
    position: relative;
    &:first-child {
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }
    &:last-child {
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }
    &:not(:first-child):not(:last-child) {
      border-radius: 0;
    }
    &:not(:last-child) {
      margin-right: -1px;
    }
    &.is-active,
    &:active,
    &:focus,
    &:hover {
      z-index: 1;
    }
  }
  .mc-button+.mc-button{
    margin-left: 0;
  }
}