/** 全局样式 */
@use 'element-plus/theme-chalk/src/mixins/function.scss' as *;
@use './transition.scss' as *;

.ele-page,
.ele-admin-tabs {
    --ele-page-padding: 12px;
    --ele-menu-compact-item-padding: 12px 0 0 0;
}

* {
    outline: none;
}

html {
    overflow-x: hidden;
    height: 100%;
}

body {
    margin: 0;
    line-height: 1.58;
    color: getCssVar('text-color', 'regular');
    font-size: getCssVar('font-size', 'base');
    font-family: getCssVar('font-family');
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    overflow-x: hidden;
    overflow-y: auto;
    height: 100%;
    width: 100% !important;
}

/* 按钮加图标减少间距 */
.ele-btn-icon.el-button,
.ele-btn-icon.el-button.is-round {
    padding-left: 12px;
    padding-right: 12px;

    &>.el-icon {
        margin-left: -2px;
        margin-right: -2px;
    }

    &.el-button--small {
        padding-left: 6px;
        padding-right: 6px;
    }

    &.el-button--large {
        padding-left: 16px;
        padding-right: 16px;
    }
}

.demo-timeline {
    .el-timeline {
        padding: 0;
        padding-left: 20px;
    }
}

//订单详情
.order-detail {
    .el-step.is-center .el-step__description {
        padding: 0;
    }
}

/* 级联选择器增加高度 */
.ele-popper-higher .el-cascader-menu__wrap.el-scrollbar__wrap {
    height: 280px;
}

/* 间距组件样式优化 */
.el-space--horizontal>.el-space__item:last-child {
    margin-right: 0 !important;
}

.el-space--vertical>.el-space__item:last-child {
    padding-bottom: 0 !important;
}

/* echarts */
.echarts>div>div {
    max-width: 100%;
    overflow: hidden;
}

/* 小屏幕时分页去掉一些组件 */
@media screen and (max-width: 768px) {
    .ele-pro-table .el-pagination {

        .el-pagination__sizes,
        .el-pagination__jump {
            display: none;
        }
    }
}

/* 表单验证气泡形式 */
.pro-form-error-popper.el-form-item>.el-form-item__content {
    &>.el-form-item__error {
        position: absolute;
        left: 0;
        top: auto;
        bottom: calc(100% + 3px);
        width: max-content;
        color: #fff;
        font-size: 12px;
        background: getCssVar('color-danger');
        transition: all 0.2s;
        padding: 4px 6px;
        border-radius: 3px;
        z-index: 999;
        transform: none;

        &:after {
            content: '';
            border: 4px solid transparent;
            border-top-color: getCssVar('color-danger');
            position: absolute;
            left: 8px;
            bottom: -7px;
        }
    }
}

//上传组件样式
.upload-image {
    margin-right: 10px;

    .el-upload {
        width: 100px;
        height: 100px;
    }
}

//表单下编辑器样式
.simple-form {
    .tox-tinymce {
        width: 100% !important;
    }
}

//table操作按钮
.ele-pro-table {
    .el-table .cell.el-tooltip {
        white-space: wrap;
    }

    // .action-btns {
    //     .el-button {
    //         margin-right: 8px;
    //         margin-left: 0;
    //         &:nth-child(even) {
    //             margin-right: 0;
    //         }
    //     }
    //     .el-button+.el-button {
    //         margin-left: 0;
    //     }
    // }
    .el-button {
        margin-right: 5px;
    }

    .el-button+.el-button {
        margin-left: 0;
    }

    .el-text {
        align-self: flex-start;
        text-align: left;
    }

    //toolbar的状态选择
    .ele-toolbar-body {
        .el-radio-group {
            position: relative;
            top: -3px;
        }

        .el-radio-button {
            min-width: 120px;
        }

        .el-radio-button__inner {
            width: 100%;
            padding: 9px 15px;
        }
    }

    .el-tag__content {
        display: flex;
        width: 100%;
    }
}

//搜索况下时间选择框的样式
.search-form {
    .el-form-item {
        margin-bottom: 12px;
        position: relative;

        .el-form-item__label {
            position: absolute;
            top: -10px;
            right: 12px;
            font-size: 14px;
            display: inline-block;
            z-index: 2;
            height: 18px;
            line-height: 18px;
            padding: 0;
            width: fit-content !important;
        }
    }

    //不显示label
    &.no-label-search .el-form-item .el-form-item__label {
        display: none;
    }

    .el-date-editor.el-input,
    .el-date-editor.el-input__wrapper {
        width: 100%
    }
}

/* 主题切换过渡 */
::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

::view-transition-new(root),
html.dark::view-transition-old(root) {
    z-index: 1;
}

::view-transition-old(root),
html.dark::view-transition-new(root) {
    z-index: 2147483646;
}

html.disabled-transition,
html.disabled-transition :not(.view-transition-trigger) * {
    transition: none !important;
}


.article-dialog {
    .el-dialog__body {
        max-height: 80vh;
        overflow-y: auto;
    }
}


//基础信息展示样式
.common-row {
    padding-left: 12px;

    .el-col {
        line-height: 32px;
        margin-bottom: 6px;
    }
}

//表单中基础样式
.el-form {
    .is-without-controls {
        .el-input .el-input__wrapper {
            padding-left: 10px;
        }

        .el-input-number .el-input__inner {
            text-align: left !important;
        }
    }
}

.common-title {
    font-size: 18px;
    font-weight: 550;
}

.el-statistic {
    .el-statistic__head {
        font-size: 14px;
    }
}


.common-section {
    padding: 12px 30px;
    background-color: #fcfbfa;
    border-radius: 6px;

    .el-form-item {
        margin-bottom: 10px;
    }
}


.custom-select {
    .el-select__wrapper {
        .el-select__placeholder {
            position: relative;
            white-space: pre-wrap;
            top: 0;
            transform: translateY(0);
        }
    }

    .el-select-dropdown .el-select-dropdown__item {
        white-space: normal;
    }
}



//左侧菜单
.ele-menu {
    --ele-menu-compact-item-padding: 6px 0;
    --ele-menu-compact-icon-font-size: 14px;
}