// -------- ant-design样式 -----------

// Colors
@primary-color: #0283b5;

// Input
@input-disabled-bg: #f5f5f5;

.ant-input[disabled] {
    cursor: default;
}

.ant-input[readonly] {
    cursor: default;
    background-color: #f5f5f5;
    color: fade(#000, 25%);
}

// Select
@select-dropdown-vertical-padding: 1px; // 下拉选项内边距
@select-dropdown-line-height: 22px;
@select-dropdown-height: 22px; // 下拉选项高度
@btn-disable-bg: #f5f5f5;

// Modal
@modal-header-padding-vertical: 4px;
@modal-header-padding-horizontal: 8px;
@modal-body-padding: 8px;

// Form
@form-item-margin-bottom: 4px; // 底部外边距
@form-item-trailing-colon: false; // 是否显示label后面的冒号

.ant-form-item {
    &-control-input {
        min-height: inherit;
        height: 100%;
        line-height: 1;
        white-space: pre-wrap;
    }

    &-label {
        height: inherit; // 继承父元素的高度
        width: 100px;
        justify-content: flex-end; // 右对齐
    }
}

// Table
@table-padding-vertical-sm: 0px;
@table-padding-horizontal-sm: 2px;
@table-padding-vertical: 0px;
@table-padding-horizontal: 2px;
@table-header-bg: #f9fafb;
@table-border-color: #e2e4e8;

.ant-table-thead>tr>th {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1;
}

// .ant-table-tbody>tr>td {
//     position: -webkit-sticky;
//     position: sticky;
//     top: 0px;
// }

td.ant-table-column-sort {
    background: white;
}

.table-row {
    cursor: pointer;

    &.selected {
        background-color: @primary-color;
        color: white;
    }

    &.selected:hover>td {
        background-color: @primary-color  !important;
        color: white;
    }
}

// Tabs
.ant-tabs-card.ant-tabs-top>.ant-tabs-nav {
    margin-bottom: 5px;

    .ant-tabs-tab {
        border-radius: 8px 8px 0 0;
        padding: 4px 16px;
    }

    .ant-tabs-tab-active {
        background-color: @primary-color;

        .ant-tabs-tab-btn {
            color: white;
        }
    }
}

// Carousel
.ant-carousel {
    height: 100%;
}

.ant-carousel .slick-slider {
    height: 100%;
}

// Radio
.ant-radio-group {
    display: flex;
}

.ant-radio-button-wrapper {
    flex: 1;
    text-align: center;
}

.ant-radio-button-wrapper-checked {
    background-color: @primary-color;
    color: white;
}

.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled)::before {
    background-color: @primary-color;
}

.ant-radio-button-wrapper-checked:not([class*=' ant-radio-button-wrapper-disabled']).ant-radio-button-wrapper:first-child {
    border-right-color: @primary-color;
}

// Notification
.ant-notification-notice-description {
    margin-left: 0 !important;
    white-space: pre-wrap !important;
}

// Popover
.ant-popover-inner-content {
    padding: 4px;
}

// Layout
@layout-body-background: #fff;
@layout-header-background: #fff;
@layout-header-height: 32px;
@layout-header-padding: 0;
@layout-footer-padding: 0;
@layout-footer-background: #fff;
@layout-sider-background: #fff;

.ant-layout {
    width: 100%;
    height: 100%;
}

.ant-layout-header {
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.ant-layout-footer {
    height: 28px;
    line-height: 28px;
}

.ant-layout-sider {
    flex: 0 0 272px !important;
    max-width: 272px !important;
    min-width: 272px !important;
    width: 272px !important;
    border-right: 1px solid #eaeaea;
}

//撑开的空格样式
.fill-remaining-space {
    flex: 1 1 auto;
}