/* You can add global styles to this file, and also import other style files */

/******** ant样式 ********/

// 布局
.ant-layout {
  height: 100%;
}

// 布局侧边栏
.ant-layout-sider {
  &:not([nztheme]) {
    background: transparent;
  }

  &>.ant-layout-sider-children {
    overflow: hidden;

    &:hover {
      overflow: auto;
    }
  }
}

// 布局内容
.ant-layout-content {
  flex: 1;
  overflow: auto;

  &>.ant-table-wrapper {
    height: 100%;

    &>.ant-spin-nested-loading {
      height: 100%;

      &>.ant-spin-container {
        height: 100%;
        display: flex;
        flex-direction: column;

        &>.ant-table {
          flex: 1;
          overflow: hidden;

          &>.ant-table-container {
            height: 100%;
            overflow: auto;

            &>.ant-table-content>table>thead>tr>th {
              position: sticky !important;
              top: 0;
              z-index: 998;

              &.ant-table-selection-column {
                z-index: 999;
              }
            }
          }

          &.ant-table-bordered {
            &>.ant-table-container {
              border: 1px solid #f0f0f0;

              &>.ant-table-content>table {
                &>tbody>.ant-table-placeholder>.nz-disable-td {
                  border: none;
                }
              }
            }
          }
        }

        &>.ant-table-pagination {
          margin-bottom: 0;
          overflow: hidden;
        }
      }
    }
  }

  &>.ant-tabs-top {
    height: 100%;

    .ant-tabs-nav {
      margin: 0;
    }

    .ant-tabs-tab-btn {
      font-weight: normal;
    }

    .ant-tabs-content {
      height: 100%;

      &:not(:empty) {
        border: 1px solid #f0f0f0;
        border-top: none;
      }
    }

    .ant-tabs-tabpane {
      padding: 16px;
      overflow: auto;
    }
  }
}

// 表格
.ant-table-wrapper {
  tr {

    th:last-child:empty,
    td:last-child:empty {
      border: none !important;
    }

    td:last-child:empty {
      background: transparent;
    }
  }

  .ant-table-placeholder {
    .nz-disable-td {
      text-align: left;

      .ant-empty {
        display: inline-block;
        position: sticky;
        left: 50%;
        transform: translateX(-50%);
      }
    }
  }

  .nz-resizable-resizing {
    z-index: 1000;
    pointer-events: none;
  }

  .nz-resizable-handle {
    display: flex;
    justify-content: center;

    &::before {
      content: '';
      width: 1px;
      background: #e8e8e8;
    }
  }

  .nz-resizable-preview {
    border-width: 0;
    border-right-width: 1px;
  }

  .ant-table-bordered .nz-resizable-handle::before {
    content: none;
  }
}

// 页头
.ant-page-header {
  padding: 16px 0 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;

  .ant-page-header-heading {
    padding: 0 24px;

    &+.ant-page-header-footer {
      margin-top: 0;
    }

    .ant-page-header-heading-extra .ant-btn+.ant-btn-group {
      margin-left: 12px;
    }
  }

  .ant-page-header-content {
    padding: 12px 24px 0;
  }

  .ant-page-header-footer {
    flex: 1;
    overflow: hidden;

    &>.ant-tabs-top {
      height: 100%;

      &>.ant-tabs-nav {
        padding: 0 24px;

        &::before {
          border-bottom: 1px solid #f0f0f0;
        }

        .ant-tabs-tab-btn {
          font-weight: normal;
        }
      }

      &>.ant-tabs-content-holder {
        overflow: auto;

        &>.ant-tabs-content {
          height: 100%;

          &>.ant-tabs-tabpane {
            height: 100%;
            overflow: auto;
          }
        }
      }
    }
  }
}

// 表单
.ant-form-item-control {

  .ant-input-number,
  .ant-picker {
    width: 100%;
  }
}

// 描述列表
.ant-descriptions {
  .ant-descriptions-view table {
    table-layout: fixed;
  }

  &.ant-descriptions-bordered .ant-descriptions-item-label {
    width: 120px;
  }
}

// 抽屉
.ant-drawer-content-wrapper {
  max-width: 100%;
  max-height: 100%;
}

// 排版
.ant-typography {
  margin: 0 !important;
}


/******** cortex样式 ********/

// 页面内容
.ctx-page-content {
  height: 100%;
  overflow: auto;
  padding: 24px;
  border-top: 1px solid #f0f0f0;
}

// 章节标题
.ctx-section-title {
  font-size: 18px;
  margin-bottom: 12px;
}

// 搜索栏
.ctx-search-bar {
  .ant-form {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px 8px;

    .ctx-search-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      padding: 0 12px;
      margin: -4px;
    }

    .ctx-search-action-item {
      padding: 4px;
    }
  }

  .ant-form-item {
    padding: 0 12px;
  }

  .ant-form-item-control {
    width: 240px;

    .ant-select[nzmode=tags] {
      &.ant-select .ant-select-selector {
        height: 32px;
        overflow: auto;
      }
    }
  }
}

// 列表操作栏
.ctx-list-action-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin: -4px -12px 12px;
}

// 底部操作栏
.ctx-foot-action-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin: 12px -12px -4px;
}

// 操作列表
.ctx-actions {
  display: flex;
  flex-wrap: wrap;
  padding: 0 8px;

  .ctx-action-item {
    padding: 4px;
  }
}

// 额外操作列表
.ctx-extra-actions {
  display: flex;
  flex-wrap: wrap;
  padding: 4px 12px;
}

// 加载中固定
.ctx-spin-fixed {
  height: 100%;

  &>div>.ant-spin {
    max-height: none;
  }

  &>.ant-spin-container {
    height: 100%;
  }
}

// 表格设置
.ctx-table-setting {
  .ant-popover-title {
    line-height: 32px;
  }

  .ant-popover-inner-content {
    padding: 8px 0;
    max-height: 560px;
    overflow: auto;
  }

  td {
    padding: 4px 8px !important;
    border-bottom: none !important;
  }

  [nz-icon] {
    cursor: move;
    color: rgba(0, 0, 0, .45);
    padding-right: 4px;
  }
}

// 表格树形切换器
.ctx-table-tree-switcher {
  a {
    display: flex;
    align-items: center;
    color: rgba(0, 0, 0, .85);

    &:hover {
      color: #40a9ff;
    }
  }

  .anticon {
    margin-right: 4px;
    width: 16px;
  }

  .anticon-caret-right {
    font-size: 10px;
  }
}
