/* flex */
.flx-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.flx-start {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.flx-start-start {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
.flx-start-end {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}
.flx-end-start {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}
.flx-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.flx-end-end {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}
.flx-justify-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flx-align-center {
  display: flex;
  align-items: center;
}
.flx-col {
  display: flex;
  flex-direction: column;
}
.flx-shrink {
  flex-shrink: 0;
}
.flx {
  display: flex;
}
.user-sel-none {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* flex布局 */
@for $i from 1 through 5 {
  .flx-#{$i} {
    flex: #{$i};
  }
}

@for $i from 1 through 3 {
  .flx-grow-#{$i} {
    flex-grow: #{$i};
  }
}

.w-screen {
  width: 100vw;
}
.h-screen {
  height: 100vh;
}
.w-full {
  width: 100% !important;
}
.w-auto {
  width: auto !important;
}
.h-full {
  height: 100%;
}
.h-auto {
  height: auto !important;
}
.relative {
  position: relative;
}
.absolute {
  position: absolute;
}
.overflow-hidden {
  overflow: hidden;
}
.overflow-auto {
  overflow: auto;
}
.overflow-x-auto {
  overflow-x: auto;
}

/* clearfix */
.clearfix::after {
  display: block;
  height: 0;
  overflow: hidden;
  clear: both;
  content: "";
}

/* 文字单行省略号 */
.sle {
  overflow: idden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 文字多行省略号 */
.mle {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; /* 配合 -webkit-line-clamp 使用 */

  // display: box;
  line-clamp: 2;
  box-orient: vertical; /* 标准属性的兼容写法 */
  overflow: hidden;
}

/* 文字多了自动換行 */
.break-word {
  word-break: break-all;
  word-wrap: break-word;
}

/* 文字不換行 */
.white-nowrap-word {
  white-space: nowrap;
}

/* fade-transform */
.fade-transform-leave-active,
.fade-transform-enter-active {
  transition: all 0.2s;
}
.fade-transform-enter-from {
  opacity: 0;
  transition: all 0.2s;
  transform: translateX(-30px);
}
.fade-transform-leave-to {
  opacity: 0;
  transition: all 0.2s;
  transform: translateX(30px);
}

/* breadcrumb-transform */
.breadcrumb-enter-active {
  transition: all 0.2s;
}
.breadcrumb-enter-from,
.breadcrumb-leave-active {
  opacity: 0;
  transform: translateX(10px);
}

/* scroll bar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-thumb {
  background-color: var(--el-border-color-darker);
  border-radius: 20px;
}

/* nprogress */
#nprogress .bar {
  background: var(--lj-color-primary-300) !important;
  height: 6px !important;
}
#nprogress .spinner-icon {
  border-top-color: var(--lj-color-primary-300y) !important;
  border-left-color: var(--lj-color-primary-300y) !important;
}
#nprogress .peg {
  box-shadow: 0 0 10px var(--lj-color-primary-300y), 0 0 5px var(--lj-color-primary-300y) !important;
}

/* 外边距、内边距全局样式 */
@for $i from 0 through 40 {
  .mt-#{$i} {
    margin-top: #{$i}px !important;
  }
  .mr-#{$i} {
    margin-right: #{$i}px !important;
  }
  .mb-#{$i} {
    margin-bottom: #{$i}px !important;
  }
  .ml-#{$i} {
    margin-left: #{$i}px !important;
  }
  .pt-#{$i} {
    padding-top: #{$i}px !important;
  }
  .pr-#{$i} {
    padding-right: #{$i}px !important;
  }
  .pb-#{$i} {
    padding-bottom: #{$i}px !important;
  }
  .pl-#{$i} {
    padding-left: #{$i}px !important;
  }
  .top-#{$i} {
    top: #{$i}px !important;
  }
  .bottom-#{$i} {
    bottom: #{$i}px !important;
  }
  .left-#{$i} {
    left: #{$i}px !important;
  }
  .right-#{$i} {
    right: #{$i}px !important;
  }
}

/* 灰色颜色 */
@for $i from 1 through 13 {
  .color-gray-#{$i} {
    color: var(--lj-color-gray-#{$i});
  }
}

/* font color */
/* 2% */
.text-table-header {
  color: $color-text-table-header;
}
/* 4% */
.text-background {
  color: $color-text-background;
}
/* 6% */
.text-dividers {
  color: $color-text-dividers;
}
/* 15% */
.text-border {
  color: $color-text-border;
}
/* 25% */
.text-disable {
  color: $color-text-disable;
}
/* 45% */
.text-secondary-text {
  color: $color-text-secondary-text;
}
/* 85% */
.text-primary-text {
  color: $color-text-primary-text;
}
/* 85% */
.text-title {
  color: $color-text-title;
}

/* font style*/
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.text-ellipsis-one {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.text-ellipsis-one2 {
  text-overflow: -o-ellipsis-lastline;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
}
.text-ellipsis-two {
  text-overflow: -o-ellipsis-lastline;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 刷新按钮点击自传一圈*/
.refresh-btn {
  transform: scale(1);
  transition: 0.5s;
  box-shadow: none;
  .iconfont,
  .el-icon {
    transform: rotate(360deg);
    transition: 0.5s;
  }
  &:active {
    @include effect-style-shadow-1-2-down-inset();
    transform: scale(0.9);
    transition: 0s;
    .iconfont,
    .el-icon {
      transform: rotate(0);
      transition: 0s;
    }
  }
}
.default-btn {
  transform: scale(1);
  transition: 0.5s;
  box-shadow: none;
  &:active {
    @include effect-style-shadow-1-2-down-inset();
    transform: scale(0.9);
    transition: 0s;
  }
}

/* el-tabs flex布局*/
.flx-full {
  &.el-tabs {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .el-tabs__content {
    overflow: auto;
    flex: 1;
    padding: 0;
  }
  .el-tabs__header {
    flex-shrink: 0;
  }
  .el-tab-pane {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
}

/* table样式 */
.lj-table {
  thead {
    th {
      text-align: left;
      background-color: $color-gray-3;
      padding: $space-b1 $space-a1;
      color: $color-text-secondary-text;
    }
  }
  tbody {
    td {
      @include text-style-body-medium;
      line-height: 26px;
      padding: $space-a1;
      // user-select: none;
      .hide-switch {
        height: auto;
      }
    }
    tr {
      .hover-btn {
        display: none;
      }

      .handle {
        cursor: move;

        &.is-disable {
          opacity: 0.2;
          cursor: no-drop;
        }
      }

      &:nth-child(2n) {
        td {
          background-color: $color-gray-2;
        }
      }
      &:hover {
        .hover-btn {
          display: flex;
        }
        td {
          background-color: $color-primary-000;
        }
        .handle {
          opacity: 1;
        }
      }
      &.table-td-chosen {
        td {
          user-select: none;
        }
      }
      &.is-notvisible {
        td {
          color: $color-text-disable;
          background-color: $color-gray-4 !important;
        }
      }
      &.is-active {
        td {
          background-color: $color-primary-200 !important;
        }
      }
      &.is-hidden {
        display: none;
      }
    }
  }
}

/* 表格行高 */
.lj-table-row-height {
  .lj-table {
    tbody {
      tr {
        height: $space-a1;
      }
    }
  }
}

.lj-select__table {
  display: table;

  // & > div {
  //   display: table-cell;
  // }
  .table-tr {
    display: table-row;
    // height: 30px;
  }
  .table-td {
    display: table-cell;
    // padding: 0 5px;
  }
}

.lj-select__popper {
  .el-select-dropdown__list {
    .el-select-dropdown__item {
      display: table;
      table-layout: fixed;

      &:nth-child(2n) {
        background-color: $color-gray-2;

        &:hover {
          background-color: $color-primary-200 !important;
        }
      }

      &.hover,
      &:hover {
        background-color: $color-primary-200 !important;
      }

      &.is-hovering {
        background-color: $color-primary-200 !important;
      }
    }
  }
}

.keyboard-shortcut {
  /* Background and color */
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 0.25rem;
  color: rgba(0, 0, 0, 0.7);

  /* Bottom shadow */
  box-shadow: #d1d5db 0px -4px 0px inset, rgba(0, 0, 0, 0.4) 0px 1px 1px;

  /* Spacing */
  padding: 0.25rem 0.5rem;
}

/* 垂直按钮  */
.text-vertical {
  writing-mode: vertical-rl; /* 从上到下，从右到左 */
}

/* 浮动按钮 */
.btn-floating {
  position: fixed;
  cursor: move;
  z-index: 999;
}

/*  选择弹窗公共样式 */
.lj-file-dialog {
  .lj-dialog {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .el-dialog__header {
    flex-shrink: 0;
  }
  .el-dialog__body {
    flex: 1;
    overflow: hidden;
    padding: 0;
  }

  .longjoe-fold-layout {
    .card {
      border: unset;
    }
    .rapmoney-aside {
      .card {
        border-radius: 0;
        border-right: 1px solid var(--el-border-color-light);
      }
    }
  }
  .longjoe-fold-layout-main {
    .table-main {
      padding-top: 8px;
      padding-bottom: 8px;
    }
  }

  .el-collapse-item {
    display: flex;
    flex-direction: column;
    height: 100%;

    .el-collapse-item__wrap {
      flex: 1;
      overflow: auto;
    }
  }
}

.vxe-edit-col-middle {
  display: block !important;
  .el-checkbox__input {
    vertical-align: bottom;
  }
}

.lj-drawer-win {
  .el-drawer__body {
    padding: 0 !important;
  }
}
