@import './basic';

.pull-right {
  float: right;
}

.pull-left {
  float: left;
}

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

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

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

.clearfix {
  .clearfix();
}

.ant-layout-sider {
  background-color: @sider_bg;
}

.ant-menu-item {
  height: 80px;
  line-height: 80px;
  padding-bottom: 0;
  padding-top: 0;
}

.ant-menu-horizontal,
.ant-menu-vertical,
.ant-menu-vertical-left,
.ant-menu-vertical-right {
  .ant-menu-sub {
    min-width: 100px;
  }
  &.ant-menu-sub {
    min-width: 100px;
  }
}

.ant-table-body {
  background: @white_color;
}

.action.go-back {
  display: inline;
  cursor: pointer;
}

.ant-btn-primary {
  background-color: @primary_color;
  border-color: @primary_color;
}

.ant-btn-primary:hover {
  background-color: @primary_color_hover;
  border-color: @primary_color_hover;
}

.ant-btn-primary:active {
  background-color: @primary_color_active;
  border-color: @primary_color_active;
}

.ant-btn[disabled] {
  background-color: @gray-bg;
  border-color: @border_color-disabled;
  color: @primary_color_disabled;
}

.moria-box {
  background-color: @white_color;
  border-radius: @border_radius;
  border: @border_style;
  .moria-box-header {
    font-size: 24px;
    border-bottom: @border_style;
    background-color: @white_color;
    .action {
      display: inline;
      & + .moria-box-title {
        margin-left: 20px;
        display: inline;
      }
    }
  }
  .moria-box-content {
    padding: 40px 80px 50px;
  }
  .ant-form-item-label {
    text-align: left;
  }
}

.ant-input {
  font-size: 12px;
}

.ant-checkbox-input {
  z-index: 1;
}

.ant-transfer-list {
  text-align: left;
}

.ant-transfer-list-header {
  padding: 9px 12px;
  background-color: @table_main_bgc;
  text-align: left;
  font-size: 12px;
  .ant-transfer-list-header-selected {
    span {
      position: absolute;
      right: 12px;
    }
    .ant-transfer-list-header-title {
      position: relative;
      right: 0;
    }
  }
}

.ant-transfer-list-body-search-wrapper {
  padding: 20px 10px;
}

.ant-transfer-list-content {
  margin-top: 20px;
  font-size: 12px;
}

.ant-transfer-list-search {
  border-radius: 35px;
  padding: 0 10px;
}

.ant-transfer-list-search-action {
  top: 20px;
  right: 13px;
}

.ant-transfer-operation {
  margin: 0 10px;
  position: relative;
  .ant-btn:first-child {
    margin-top: 35px;
    padding-right: 17px;
    font-size: 12px;
  }
  .ant-btn:last-child {
    padding-left: 17px;
    position: absolute;
    padding-right: 19px;
    top: 0;
    font-size: 12px;
    i {
      position: absolute;
      right: 3px;
      top: 5px;
    }
    span {
      float: left;
    }
  }
}

.ant-table-pagination.ant-pagination {
  margin: 16px 0 0;
}

.ant-table-bordered .ant-table-tbody > tr > td,
.ant-table-bordered .ant-table-thead > tr > th {
  border-right: none;
}

.ant-table {
  //.ant-table-content {
  //  border: @border_style;
  //  border-bottom: none;
  //}
  .ant-table-thead > tr > th {
    background-color: #f3f5f6;
    color: @font_color;
    &:last-child {
      border-right: 1px solid @border_color;
    }
  }
  .ant-table-tbody > tr > td {
    color: @main_font_color;
    .ant-btn {
      height: 28px;
    }
    &:last-child {
        border-right: 1px solid @border_color;
      }
    }
  .table-name {
    color: @blue_primary_color;
  }
  .state-wrap {
    margin: 0;
    display: block;
    width: 78px;
    height: 28px;
    line-height: 28px;
    border-radius: 2px;
    //font-size: @font_size_normal;
    text-align: center;
    &.run {
      background-color: @tag_color;
      color: #009944;
    }
    &.fail {
      background-color: #ffe0dc;
      color: #e60012;
    }
  }

  .action-btn.ant-btn {
    border: none;
    .iconfont {
      margin-right: 6px;
    }
  }

  @media screen and (max-width: @screen-xm) {
    .ant-table-tbody > tr > td,
    .ant-table-thead > tr > th {
      font-size: 12px;
      padding-top: 10px;
      padding-bottom: 10px;
    }
    .ant-table-placeholder {
      font-size: 12px;
    }
  }
  @media screen and (min-width: (@screen-xm + 1)) and (max-width: @screen-md) {
    .ant-table-tbody > tr > td,
    .ant-table-thead > tr > th {
      font-size: 14px;
      padding-top: 12px;
      padding-bottom: 12px;
    }
    .ant-table-placeholder {
      font-size: 12px;
    }
  }
  @media screen and (min-width: (@screen-md + 1)) {
    .ant-table-tbody > tr > td,
    .ant-table-thead > tr > th {
      font-size: 14px;
      padding-top: 12px;
      padding-bottom: 12px;
    }
    .ant-table-placeholder {
      font-size: 14px;
    }
  }

}

.ant-tag {
  &.status {
    height: 28px;
    line-height: 28px;
    text-align: center;
    border: none;
    cursor: default;
    &:not(:empty) {
      min-width: 70px;
    }
    &.running,
    &.success {
      background-color: @success_tag_bg !important;
      color: @success_tag_text_color !important;
    }
    &.fail {
      background-color: @error_tag_bg !important;
      color: @error_tag_text_color !important;
    }
    .anticon-loading {
      margin-left: 3px;
    }
  }
  &.tags {
    height: 32px;
    line-height: 32px;
    padding: 0 15px;
    border-radius: 999px;
    background-color: @font_color;
    color: @white_color;
    border: none;
    margin-bottom: 10px;
  }
}

.common-layout {
  .ant-layout-header {
    padding: 0;
    font-size: 16px;
    height: (@menu_item_height_sm - 1);
    line-height: (@menu_item_height_sm - 1);
    font-weight: 600;
    @media screen and (max-width: @screen-xm) {
    }
    @media (min-width: (@screen-xm + 1)) and (max-width: @screen-md) {
      height: (@menu_item_height_md - 1);
      line-height: (@menu_item_height_md - 1);
      font-size: 22px;
    }
    @media (min-width: (@screen-md + 1)) {
      height: (@menu_item_height - 1);
      line-height: (@menu_item_height - 1);
      font-size: 22px;
    }

    .action .iconfont {
      @media screen and (min-width: (@screen-xm + 1)) {
        font-size: 22px;
      }
    }
  }
  .ant-table {
    td,
    th {
      white-space: nowrap;
    }
  }
}

.add-layout,
.detail-layout {
  & > .ant-layout-header {
    .action + span {
      margin-left: 10px;
    }
  }
}

.add-layout {
  margin-bottom: 20px;
  & > .ant-layout-content {
    background-color: @white_color;
    padding: 30px 70px 40px;
    .ant-form {
      max-width: 900px;
      margin: auto;
      .ant-form-item-label {
        text-align: left;
      }
      .ant-input-number {
        width: 100%;
      }
    }
  }
}

.list-layout {
  color: @main_font_color; // &,
  .ant-btn + .ant-btn,
  .ant-btn + .action-tips {
    margin-left: @gap_width;
  }
  .ant-layout-content {
    padding: 18px 29px;
    background-color: @white_color;
  }
  .ant-table-wrapper {
    margin-top: 20px;
  }
}

.action-tips {
  color: @sub_font_color;
  vertical-align: middle;
  font-size: 12px;
}

.detail-layout {
  .row-item {
    margin-bottom: 26px;
    .ant-card {
      padding: 0 32px;
      .ant-card-head {
        padding: 0;
        border-bottom: 1px solid @main_border_color;
        .ant-card-extra,
        .ant-card-head-title {
          padding: 0;
          font-size: 18px;
          height: (@menu_item_height - 1);
          line-height: (@menu_item_height - 1);
        }
        .ant-card-extra .action-icon {
          cursor: pointer;
        }
      }
      .ant-card-body {
        padding: 28px 0;
      }
    }
    .row-list-item {
      margin-bottom: 24px;
      &:last-child {
        margin-bottom: 0;
      }
      div:not('.ant-tag') {
        padding: 0;
        word-break: break-all;
        &:first-child {
          color: @font_color;
        }
        &:last-child {
          color: @main_font_color;
        }
      }
    }
    @media screen and (max-width: @screen-xm) {
      margin-bottom: 14px;
      .ant-card {
        padding: 0 20px;
        .ant-card-head {
          .ant-card-extra,
          .ant-card-head-title {
            font-size: 14px;
            height: (@menu_item_height_sm - 1);
            line-height: (@menu_item_height_sm - 1);
          }
        }
        .ant-card-body {
          padding: 24px 0;
        }
      }
      .row-list-item {
        margin-bottom: 20px;
        font-size: 12px;
      }
    }
    @media screen and (min-width: (@screen-xm + 1)) and (max-width: @screen-md) {
      margin-bottom: 20px;
      .ant-card {
        padding: 0 26px;
        .ant-card-head {
          .ant-card-extra,
          .ant-card-head-title {
            font-size: 16px;
            height: (@menu_item_height_md - 1);
            line-height: (@menu_item_height_md - 1);
          }
        }
        .ant-card-body {
          padding: 26px 0;
        }
      }
      .row-list-item {
        margin-bottom: 22px;
      }
    }
    @media screen and (min-width: (@screen-md + 1)) {
      margin-bottom: 26px;
      .ant-card {
        padding: 0 32px;
        .ant-card-head {
          .ant-card-extra,
          .ant-card-head-title {
            font-size: 18px;
            height: (@menu_item_height - 1);
            line-height: (@menu_item_height - 1);
          }
        }
        .ant-card-body {
          padding: 28px 0;
        }
      }
      .row-list-item {
        margin-bottom: 24px;
      }
    }
  }
}

@media screen and (max-width: @screen-xm) {
  .ant-tabs-nav,
  .ant-tabs-nav-scroll {
    height: 46px;
  }
  .ant-tabs-tab {
    line-height: 22px;
  }
  a.ant-btn {
    height: 32px;
    line-height: 32px;
  }
  a.ant-btn,
  .ant-btn,
  .ant-input,
  .ant-input-number,
  .ant-select-selection--single {
    font-size: 12px;
  }
  .ant-form-explain {
    padding: 2px 0;
    font-size: 12px;
  }
  .ant-select-selection__rendered {
    line-height: 30px;
  }
  .ant-input-number-input {
    height: 30px;
  }
  .ant-select-selection__placeholder,
  .ant-select-search__field__placeholder {
    font-size: 12px;
  }
  .ant-select-selection--multiple > ul > li,
  .ant-select-selection--multiple .ant-select-selection__rendered > ul > li {
    font-size: 12px;
    height: 24px;
    line-height: 24px;
  }
  .ant-form-item-label,
  .ant-form-item-control {
    line-height: 32px;
    label {
      font-size: 14px;
    }
  }
}
@media screen and (min-width: (@screen-xm + 1)) and (max-width: @screen-md) {
  .ant-tabs-nav,
  .ant-tabs-nav-scroll {
    height: 52px;
  }
  .ant-tabs-tab {
    line-height: 28px;
  }
  a.ant-btn {
    line-height: 36px;
  }
  a.ant-btn,
  .ant-btn,
  .ant-input,
  .ant-input-number,
  .ant-select-selection--single {
    height: 36px;
    font-size: 12px;
  }
  .ant-form-explain {
    padding: 4px 0;
    font-size: 12px;
  }
  .ant-select-selection__rendered {
    line-height: 34px;
  }
  .ant-input-number-input {
    height: 34px;
  }
  .ant-select-selection__placeholder,
  .ant-select-search__field__placeholder {
    font-size: 12px;
  }
  .ant-select-selection--multiple > ul > li,
  .ant-select-selection--multiple .ant-select-selection__rendered > ul > li {
    font-size: 12px;
    height: 28px;
    line-height: 28px;
  }
}
@media screen and (min-width: (@screen-md + 1)) {
  .ant-tabs-nav,
  .ant-tabs-nav-scroll {
    height: 58px;
  }
  .ant-tabs-tab {
    line-height: 34px;
  }
  a.ant-btn {
    line-height: 42px;
  }
  a.ant-btn,
  .ant-btn,
  .ant-input,
  .ant-input-number,
  .ant-select-selection--single {
    height: 42px;
    font-size: 14px;
  }
  .ant-form-explain {
    padding: 6px 0;
    font-size: 14px;
  }
  .ant-select-selection__rendered {
    line-height: 40px;
  }
  .ant-input-number-input {
    height: 40px;
  }
  .ant-select-selection__placeholder,
  .ant-select-search__field__placeholder {
    font-size: 14px;
  }
  .ant-select-selection--multiple > ul > li,
  .ant-select-selection--multiple .ant-select-selection__rendered > ul > li {
    font-size: 14px;
    height: 34px;
    line-height: 34px;
  }
  .ant-form-item-label,
  .ant-form-item-control {
    label {
      font-size: 16px;
    }
  }
}

.ant-form:not(.ant-form-hide-required-mark) {
  .ant-form-item {
    label {
      padding-left: 11px;
    }
    .ant-form-item-required {
      padding: 0;
    }
  }
}

.modal-form {
  .ant-form-item-label {
    text-align: left;
    text-overflow: ellipsis;
  }
  .ant-input-number {
    width: 100%;
  }
}
