*,
*:before,
*:after {
  box-sizing: border-box;
}

body {
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  font-size: $--font-size-base;
  line-height: $base--line-height;
  color: $--color-text-primary;
  background-color: unset;
}

a {
  color: mix(#fff, $--color-primary, 20%);
  text-decoration: none;

  &:focus,
  &:hover {
    color: $--color-primary;
    text-decoration: underline;
  }
}

img {
  vertical-align: middle;
}

:focus,
:hover {
  outline: none;
}

/* Utils
------------------------------ */
[v-cloak] {
  display: none;
}

.clearfix:before,
.clearfix:after {
  content: " ";
  display: table;
}

.clearfix:after {
  clear: both;
}

.fr {
  float: right !important;
}

.fl {
  float: left !important;
}

.fi {
  float: initial !important;
}

.m-auto {
  margin: auto !important;
}

.mt-auto {
  margin-top: auto !important;
}

.mr-auto {
  margin-right: auto !important;
}

.mb-auto {
  margin-bottom: auto !important;
}

.ml-auto {
  margin-left: auto !important;
}

.text-right {
  text-align: right !important;
}

.text-center {
  text-align: center !important;
}

.text-left {
  text-align: left !important;
}

.w-percent-100 {
  width: 100% !important;
}

.base-line-height {
  line-height: $base--line-height !important;
}


/* Reset element-ui
------------------------------ */
.aui-wrapper {
  .el-card+.el-card {
    margin-top: 15px;
  }

  .el-input__prefix .el-input__icon {
    display: inline-block;
    vertical-align: middle;
  }

  .el-date-editor .el-range-separator {
    width: 8%;
  }

  .el-table th {
    color: $--color-text-primary;
    background-color: $--background-color-base;
  }

  .el-pagination {
    margin-top: 15px;
    text-align: right;
  }

  .el-table__expand-icon {
    display: inline-block;
    width: 14px;
    vertical-align: middle;
    margin-right: 5px;
  }
}


/* Common
------------------------------ */
// 图标
.icon-svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
  vertical-align: middle;
  overflow: hidden;
}

// 卡片
.aui-card--fill .el-card__header {
  height: $content--card-header-height;
  line-height: $content--card-header-height - 36px;
}

.aui-card__title {
  font-size: 16px;
}

// 表单
.aui-form__label-icon {
  display: inline-block;
  margin: 0 3px;
  vertical-align: middle;
  font-size: 18px;
  color: $--color-text-secondary;
}

// 按钮
.aui-button--dashed {
  border-style: dashed;

  &:focus,
  &:hover {
    background-color: transparent;
  }

  &-add {

    >span>*[class*="el-icon-"],
    >span>*[class*="icon"] {
      vertical-align: middle;
      font-size: 18px;
      margin-right: 5px;
    }
  }
}


/* Layout
------------------------------ */
.aui-wrapper {
  position: relative;
  padding-top: 0;
  height: 100%;
  width: 100%;
}


/* Navbar
------------------------------ */
.aui-navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  height: .8rem;
  background-color: #001646;
  box-shadow: 0px 5px 10px 2px rgba(153, 153, 153, 0.2);

  &__header {
    position: relative;
    height: auto;
    width: auto;
    transition: width .3s;
  }

  &__brand {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 .3rem;
    margin: 0;
    width: 100%;
    height: 100%;
    font-size: .2rem;
    text-transform: uppercase;
    white-space: nowrap;
    color: #fff;
    overflow: hidden;
    transition: width .3s;

    img {
      width: .4rem;
      margin-right: .15rem;
    }

    span {
      font-size: .3rem;
      line-height: .375rem;
      letter-spacing: 2px;
      font-family: "黑体";
    }
  }

  &__body {
    position: relative;
    display: flex;
    flex: 1;
    overflow: hidden;
  }

  &__menu {
    display: flex;
    text-align: center;
    background-color: transparent;
    border-right: 0;

    a:focus,
    a:hover {
      text-decoration: none;
    }

    .el-menu-item,
    .el-submenu>.el-submenu__title {
      height: .8rem;
      padding: 0 .3rem;
      padding-left: .3rem !important;
      line-height: .8rem;
      border-color: transparent !important;
    }

    .el-menu-item:focus,
    .el-menu-item:hover {
      background: linear-gradient(360deg, #2E69EB 0%, #5BA2F7 100%);
      color: #ffffff;
    }


    .el-menu-item.is-active,
    .el-submenu.is-active>.el-submenu__title {
      background: linear-gradient(360deg, #2E69EB 0%, #5BA2F7 100%);
      color: #ffffff;

      &:focus,
      &:hover {
        background: linear-gradient(360deg, #2E69EB 0%, #5BA2F7 100%);
        color: #ffffff;
      }
    }

    .el-menu-item {
      // margin: 0 .25rem 0 0;

      &:focus,
      &:hover {
        .aui-navbar__icon-menu {
          color: #d8d8d8;
        }

        .el-dropdown {
          color: $--color-text-primary;

          .el-icon-arrow-down {
            transform: rotateZ(180deg);
          }
        }
      }

      * {
        vertical-align: initial;
      }

      .aui-navbar__icon-menu {
        vertical-align: middle;
        font-size: .2rem;
      }

      .el-dropdown {
        color: $--color-text-secondary;

        .el-icon-arrow-down {
          width: auto;
          font-size: .15rem;
          margin: 0 0 0 .0625rem;
          transition: transform .3s;
        }
      }
    }

    .el-badge {
      display: inline;
      z-index: 2;

      &__content {
        line-height: 16px;
      }
    }
  }

  &__search {

    >*[class*="el-icon-"],
    >*[class*="icon"] {
      display: inline-block;
      vertical-align: middle;
    }

    &-txt {
      width: 0;
      transition: width .3s, margin-left .3s;

      &.is-show {
        width: 210px;
        margin-left: 8px;
      }

      .el-input__inner {
        height: $navbar--height - 20px;
        padding: 0;
        line-height: $navbar--height - 20px;
        border-color: $--color-text-primary;
        border-top: 0;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        background: transparent;
      }
    }
  }

  &__avatar {
    .el-dropdown-link {
      cursor: pointer;
      color: #d8d8bb;

      >img {
        width: .45rem;
        height: auto;
        margin-right: 5px;
        border-radius: 100%;
        vertical-align: middle;
      }

      >span {
        font-size: .175rem;
      }
    }
  }
}


/* Sidebar
------------------------------ */
.aui-sidebar {
  width: 240px;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  background-color: #fff;
  box-shadow: 1px 0 2px 0 rgba(0, 0, 0, .05);
  overflow: hidden;
  transition: width .3s;
  z-index: 201;
  border-right: 1px solid #E5E7EB;

  &__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    transition: width .3s;
  }

  &__menu {
    width: 100%;
    border-right: 0;
    transition: width .3s;

    .el-menu-item,
    .el-submenu__title {
      font-size: .2rem;
      font-weight: 600;
      color: #374059;
      height: .6rem;
      line-height: .6rem;
    }

    .el-submenu {
      .el-submenu__title {
        font-weight: 600;
      }

      .el-menu-item {
        font-weight: 400;
      }
    }

    .el-menu-item:not(.exit):focus,
    .el-menu-item:not(.exit):hover {
      background-color: rgba(118,30,106,0.06);
      color: #761E6A;
    }

    .el-submenu__title:focus,
    .el-submenu__title:hover {
      background-color: #e9f0ff;
      color: #2e69eb;
    }

    .el-menu-item.is-active,
    .el-submenu.is-active>.el-submenu__title {
      background-color: #e9f0ff;
      color: #2e69eb;

      &:focus,
      &:hover {
        background-color: #e9f0ff;
        color: #2e69eb;
      }
    }
  }

  &__menu-icon {
    display: inline-block;
    vertical-align: middle;
    width: .3rem !important;
    margin-right: .0625rem;
    text-align: center;
    font-size: .2rem;
    color: inherit !important;
    transition: font-size .3s;
  }
}


/* Content
------------------------------ */
.aui-content {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: auto;

  &__wrapper {
    width: calc(100% - 240px);
    height: 100%;
    position: fixed;
    left: 0;
    top: 0;
    overflow: hidden;
    transition: width .3s;
    background-color: #FAFAFA;
    z-index: 100;
  }

  &__footer {
    width: 100%;
    height: .425rem;
    display: flex;
    align-items: center;
    justify-content: center;

    span {
      font-size: .15rem;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #999999;
    }
  }

  >.aui-card--fill>.el-card__body {
    min-height: calc(#{$content--fill-height} - 2px);
  }

  >.aui-card--fill>.el-card__header+.el-card__body {
    min-height: calc(#{$content--fill-height} - #{$content--card-header-height} - 2px);
  }

  &--tabs {
    padding: $content--tabs-header-height 0 0;
  }

  &--tabs-tools {
    position: fixed;
    top: $navbar--height;
    right: 0;
    z-index: 931;
    min-width: $content--tabs-header-height;
    height: $content--tabs-header-height;
    padding: 0 12px;
    text-align: center;
    font-size: 16px;
    line-height: $content--tabs-header-height;
    background-color: $--background-color-base;
    cursor: pointer;
  }

  &--tabs-icon-nav {
    display: inline-block;
    vertical-align: middle;
    font-size: 16px;
  }

  >.el-tabs {
    >.el-tabs__header {
      position: fixed;
      top: $navbar--height;
      left: $sidebar--width;
      right: 0;
      z-index: 930;
      padding: 0 55px 0 15px;
      margin: 0;
      box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .05);
      background-color: #fff;
      transition: left .3s;

      >.el-tabs__nav-wrap {
        margin-bottom: 0;

        &:after {
          display: none;
        }

        >.el-tabs__nav-next,
        >.el-tabs__nav-prev {
          line-height: $content--tabs-header-height;
        }

        >.el-tabs__nav-scroll>.el-tabs__nav {
          &>.el-tabs__active-bar {
            display: none;
          }

          &>.el-tabs__item {
            height: $content--tabs-header-height;
            padding: 0 15px;
            line-height: $content--tabs-header-height;
            border: 0;
            color: $--color-text-regular;

            &:focus,
            &:hover,
            &.is-active {
              color: $--color-text-primary;
              background-color: $--background-color-base;

              &:after {
                display: block;
              }

              >.el-icon-close {
                color: $--color-text-primary;
              }
            }

            &:after {
              display: none;
              position: absolute;
              bottom: 0;
              left: 0;
              content: '';
              width: 100%;
              height: 2px;
              background-color: $--color-primary;
            }

            +.el-tabs__item {
              margin-left: 1px;
            }

            >.el-icon-close {
              width: 14px;
              margin-left: 15px;
              color: $--color-text-secondary;
            }

            >i.icon {
              display: inline-block;
              vertical-align: middle;
              font-size: 18px;
            }
          }
        }
      }
    }

    >.el-tabs__content {
      padding: $content--padding;

      .el-loading-mask {
        z-index: 830;
      }

      >.el-tab-pane {
        min-height: calc(#{$content--fill-height-tabs});

        >.aui-card--fill>.el-card__body {
          min-height: calc(#{$content--fill-height-tabs} - 2px);
        }

        >.aui-card--fill>.el-card__header+.el-card__body {
          min-height: calc(#{$content--fill-height-tabs} - #{$content--card-header-height} - 2px);
        }

        &.is-iframe {
          height: calc(#{$content--fill-height-tabs} + #{$content--padding * 2});
          margin: -$content--padding;
          min-height: auto;

          >.aui-card--fill {
            background-color: transparent;
          }

          >.aui-card--fill>.el-card__header {
            background-color: #fff;
          }

          >.aui-card--fill>.el-card__body {
            height: calc(#{$content--fill-height-tabs} - 2px);
            margin: $content--padding;
            min-height: auto;
            border: $--border-base;
            border-color: $--border-color-lighter;
            border-radius: $--border-radius-base;
            background-color: #fff;
          }

          >.aui-card--fill>.el-card__header+.el-card__body {
            height: calc(#{$content--fill-height-tabs} - #{$content--card-header-height} - 2px);
          }
        }
      }
    }
  }

  // quill富文本编辑器
  .ql-toolbar {
    line-height: 20px;

    &.ql-snow {
      border-color: $--border-color-base;
    }

    .ql-formats {
      margin: 0 5px;
    }
  }

  .ql-container {
    height: 150px;

    &.ql-snow {
      border-color: $--border-color-base;
    }
  }
}


/* Page
------------------------------ */
*[class*="aui-page__"] {
  padding-top: 0;

  .aui-content {
    &__wrapper {
      min-height: 100vh;
      margin-left: 0;
    }

    >.aui-card--fill>.el-card__body {
      min-height: calc(100vh - #{$content--padding * 2} - 2px);
    }

    >.aui-card--fill>.el-card__header+.el-card__body {
      min-height: calc(100vh - #{$content--padding * 2} - #{$content--card-header-height} - 2px);
    }
  }
}