@charset "utf-8";
@import "./var";

.#{$prefix}menu{
    position: relative;
    width: 200px;
    background-color: $menu-bg;
    
    display: flex;

    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    -moz-flex-direction: column;
    -ms-flex-direction: column;
    -o-flex-direction: column;
    flex-direction: column;

    height: 100%;
    vertical-align: top;
    -webkit-transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
    transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
    overflow-x: hidden;
}
.#{$prefix}menu .#{$prefix}icon-arrowdown{
    position: absolute;
    right: 15px;
    top: 10px;
    background-image: url(../../assets/image/slice/svg/arrows-down-line.svg);
}
// 标题/产品名
.#{$prefix}menu__title{
    color: #fff;
    padding: 0 20px 0 20px;
    position: relative;
    display: flex;

    -webkit-box-orient: horizontal;
    -webkit-flex-direction: row;
    -moz-flex-direction: row;
    -ms-flex-direction: row;
    -o-flex-direction: row;
    flex-direction: row;

    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    -webkit-align-items: center;
    align-items: center;
    height: 56px;
    width: 200px;

    .#{$prefix}h2{
        font-size: $font-size-xl;
        color: #fff;
    }

    .#{$prefix}icon-arrowdown{
        top:20px;
        display:none;
    }
}
.#{$prefix}menu__title-back{
    padding: 14px 20px 0 24px;
    
    display: flex;

    -webkit-box-orient: horizontal;
    -webkit-flex-direction: row;
    -moz-flex-direction: row;
    -ms-flex-direction: row;
    -o-flex-direction: row;
    flex-direction: row;

    min-height: 50px;
    max-height: 60px;
    overflow-y: hidden;
    margin-bottom: 11px;
}
.#{$prefix}menu__title-back .#{$prefix}h2{
    font-size: 14px;
    line-height: 21px;
    margin-top: 3px;
    word-wrap:break-word;
    word-break:break-word;
}
.#{$prefix}menu__title-main{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.#{$prefix}menu__title-text{
    line-height: 21px;
    font-size: 12px;
    color: #888888;
    font-weight: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.#{$prefix}menu__title-list{
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.#{$prefix}menu__title .#{$prefix}h2{
    display:table-cell;
    vertical-align:middle;
}
.#{$prefix}menu__title-icon{
    display: none;
}
// 返回
.#{$prefix}menu__back {
    width: 26px;
    height: 26px;
    text-align: center;
    line-height: 26px;
    font-size: 0;
    margin-left: -6px;
    margin-right: 1px;
}

// 徽章
.#{$prefix}menu .#{$prefix}badge{
    //margin: 0 0 0 8px;
    background-color: #344258;
    color: #7C878E;
    font-weight: 700;
    border: 0;
    padding:0 8px;
    height: 24px;
    line-height: 24px;
    border-radius:12px ;
    vertical-align: middle;
    -webkit-transform: scale(0.8);
    flex:none;

    &.is-success{
        background-color: #07623f;
        color: #5dbe8a;
    }
    // 以下暂时未对外暴露
    &.is-warning{
        background-color: #8c581e;
        color: #e6c979;
    }
    &.is-error{
        background-color: #742536;
        color: #d27c7e;
    }
    &.is-primary{
        background-color: #0935ad;
        color: #6eadff;
    }

}
.#{$prefix}menu__item .#{$prefix}badge{
    margin-top: 1px;
}

// 菜单
.#{$prefix}menu__body{
    width: 200px;
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    overflow: auto;
    overflow-x: hidden;
}

.#{$prefix}menu__body::-webkit-scrollbar {
    width: 15px;
    height: 15px;
    background-color: transparent;
    border-radius: 9px;
}
.#{$prefix}menu.#{$prefix}menu-is-collapsed {
    .#{$prefix}menu__body::-webkit-scrollbar{
        display: none;
    }
    &:hover{
        .#{$prefix}menu__body::-webkit-scrollbar{
            display: block;
        }
    }
}

.#{$prefix}menu__body::-webkit-scrollbar-thumb {
    background-color: #344158;
    border-radius: 0;
    background-clip: content-box;
    border: 4px solid transparent;
}
.#{$prefix}menu__list{
    font-size: 12px;
    //margin-top: 1px;
}
.#{$prefix}menu__list li{
    color:  $menu-text;
    font-size: 0;
    cursor: pointer;
    &.is-selected > .#{$prefix}menu__item:hover,
    &.is-selected > .#{$prefix}menu__item{
        background: rgba(52, 66, 88,0.6);
        
    }
    &.is-selected{
        .#{$prefix}badge{
            background-color: $color-bg;
            color:$color-text-primary;

            &.is-success{
                color:$color-text-success;
            }
            // 以下暂时未对外暴露
            &.is-warning{
                color:$color-text-warning;
            }
            &.is-error{
                color:$color-text-error;
            }
            &.is-primary{
                color:$color-text-primary;
            }
        }
    }
}
.#{$prefix}menu__item{
    padding-left: 20px;
    padding-top: 6px;
    padding-bottom: 6px;
    display: flex;
    align-items: flex-start;
}
.#{$prefix}menu__list li .#{$prefix}menu__item:hover{
    background-color: #262F3E;
    cursor: pointer;
    text-decoration: none;
}
.#{$prefix}menu__list li.#{$prefix}menu__label .#{$prefix}menu__item:hover,
.#{$prefix}menu--light .#{$prefix}menu__list li.#{$prefix}menu__label .#{$prefix}menu__item:hover{
    background-color: transparent;
    cursor: text;
}
.#{$prefix}menu__submenu.is-expanded,
.#{$prefix}menu__list li.#{$prefix}menu__submenu.is-expanded > .#{$prefix}menu__item,
.#{$prefix}menu__list li.#{$prefix}menu__submenu.is-expanded:hover{
    background-color: #151822;
}
.#{$prefix}menu__list li.#{$prefix}menu__submenu.is-expanded.is-selected,
.#{$prefix}menu__list li.#{$prefix}menu__submenu.is-expanded.is-selected > .#{$prefix}menu__item{
    background: rgba(52, 66, 88,0.6);
}

// 左侧导航icon
.#{$prefix}menu__list-icon {
    vertical-align: text-top;
    margin-top: 5px;
    margin-right: 8px;
    width:16px;
    height: 16px;
    
}
.#{$prefix}menu__list-icon.is-selected
,.is-selected .#{$prefix}menu__list-icon
// ,.#{$prefix}menu__submenu.is-expanded .#{$prefix}menu__list-icon.is-selected
{
    display: none;
}
.is-selected .#{$prefix}menu__list-icon.is-selected
// .#{$prefix}menu__submenu.is-selected .#{$prefix}menu__list-icon
{
    display: inline-block;
}


// 左侧导航文本
.#{$prefix}menu__text{
    max-width: 115px;
    font-size: var(--fz-l);
    display: inline-block;
    vertical-align: text-top;
    line-height: 18px;
    padding: 4px 0;
    color:  $menu-text;
}
.is-selected .#{$prefix}menu__text{
    color: #fff;
}
.#{$prefix}menu__submenu.is-expanded .#{$prefix}menu__text {
    color:  $menu-text;
}
.#{$prefix}menu__text.#{$prefix}menu__text-short{
    max-width: 75px;
}

// 左侧导航分组标题
.#{$prefix}menu__label {
    position: relative;
    .#{$prefix}menu__item{
        padding:18px 0 4px 20px;
    }
    .#{$prefix}menu__text{
        min-height: 18px;
        display: block;
        //margin-top: 8px;
        padding:0;
        color: #7C878E;
        font-size: 12px;
        word-wrap:break-word;
        word-break:break-word;
        margin-left: 0;
        font-weight: normal;
        max-width: inherit;
    }
    &::after{
        content: "";
        display: none;
        position: absolute;
        left: 16px;
        right:16px;
        top:19px;
        height:1px;
        background-color: rgba(124, 135, 142,0.5);

    }
}
.#{$prefix}menu__list li.#{$prefix}list__label .#{$prefix}menu__item:hover {
    background-color: #333;
    cursor: default;
}

.#{$prefix}menu__submenu.is-expanded .#{$prefix}icon-arrowdown{
    // transform: rotate(180deg);
    // -ms-transform: rotate(180deg);
    // -moz-transform: rotate(180deg);
    // -webkit-transform: rotate(180deg);
    // -o-transform: rotate(180deg);
    transform: scaleY(-1);
    -ms-transform: scaleY(-1);
    -moz-transform: scaleY(-1);
    -webkit-transform: scaleY(-1);
    -o-transform: scaleY(-1);
}

// 二级 
.#{$prefix}menu__submenu {
    position: relative;
}
.#{$prefix}menu__submenu .#{$prefix}menu__list{
    display: none;
    padding-top:0;
    padding-bottom: 10px;
}
.#{$prefix}menu__submenu.is-expanded .#{$prefix}menu__list{
    display: block;
}

// .#{$prefix}menu__submenu .#{$prefix}menu__list .#{$prefix}menu__text{
//     font-weight: normal;
//     // padding: 1px 0 0 0;
// }
.#{$prefix}menu__submenu .#{$prefix}menu__list .#{$prefix}menu__item:before{
    content: '';
    background-color: #7C878E;
    width: 3px;
    height: 3px;
    border-radius: 10px;
    margin-right: 14px;
    display: inline-block;
    vertical-align: text-top;
    margin-top: 11px;
    margin-left: 6px;
}
.t#{$prefix}menu__submenu .#{$prefix}menu__list .is-selected .#{$prefix}menu__item:before{
    background-color: #fff;
}
.#{$prefix}menu__submenu .#{$prefix}menu__list .is-selected .#{$prefix}menu__text{
    color: #fff;
}

// 如果二级菜单有徽章,必须绑定在 tea-menu__submenu 上
.#{$prefix}menu__submenu.#{$prefix}menu__subbadge{
    .#{$prefix}icon-arrowdown{
        
        &::after{
            content:"";
            display: block;
            position: absolute;
            top:5px;
            right:-5px;
            width:6px;
            height:6px;
            border-radius: 100%;
            background-color: #e54545;
        }
    }
}

// 调整icon
.#{$prefix}menu__text .#{$prefix}icon-externallink {
    background-image: url(../../assets/image/slice/svg/external-link-icon.svg);
    margin-top:-2px;
    margin-left: 5px;
}

// 底部
.#{$prefix}menu__footer{
    display: block;
    width: 100%;
    height: 56px;
    background-color: #262F3E;
    //border-top: 1px solid #262F3E;
}
// pc端底部折叠操作区
.#{$prefix}menu__fold{
    width: 56px;
    height: 100%;
    bottom: 0;
    left: 0;
    top: auto;
    border: 0;
    z-index: 1000;
    position: relative;
    cursor: pointer;
}
.#{$prefix}menu__fold-icon{
    border-radius: 36px;
    background-image: none;
    background-position: inherit;
    background-size: auto;
    width: 36px;
    height: 36px;
    left: 10px;
    top: 10px;
    position: absolute;
}
.#{$prefix}menu__fold-icon .#{$prefix}icon-fold{
    left: 10px;
    top: 10px;
    position: absolute;
}
.#{$prefix}menu__fold:hover{
    background-color: #344258;
    .#{$prefix}icon-fold{
        background-image: url(../../assets/image/slice/svg/menu-fold-white.svg);
    }
}

//菜单折叠效果 start
.#{$prefix}menu-is-collapsed.#{$prefix}menu,
.#{$prefix}menu-is-collapsed.#{$prefix}menu .#{$prefix}menu__body{
    width:56px;
    overflow-x: hidden;
    -webkit-transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
    transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}
.#{$prefix}menu-is-collapsed .#{$prefix}menu__title{
    width: 56px;
}
.#{$prefix}menu-is-collapsed .#{$prefix}menu__title-icon{
    display: block;
    width:32px;
    height: 32px;
    position: absolute;
    left: 12px;
    top: 10px;
}
.#{$prefix}menu-is-collapsed.#{$prefix}menu .#{$prefix}badge,
.#{$prefix}menu-is-collapsed.#{$prefix}menu .#{$prefix}menu__title .#{$prefix}h2,
.#{$prefix}menu-is-collapsed.#{$prefix}menu .#{$prefix}menu__text,
.#{$prefix}menu-is-collapsed.#{$prefix}menu .#{$prefix}icon-arrowdown{
    display: none;
}
.#{$prefix}menu-is-collapsed.#{$prefix}menu .#{$prefix}menu__item{
    height: 38px;
}
.#{$prefix}menu-is-collapsed.#{$prefix}menu .#{$prefix}menu__label .#{$prefix}menu__item{
    height: 40px;
}
.#{$prefix}menu-is-collapsed.#{$prefix}menu  .#{$prefix}menu__label::after{
    display: block;
    // border-top: 1px solid #262626;
    // margin-top: 19px;
    // padding-top: 19px;
    // margin-left: 15px;
    // margin-right: 15px;
    // width: 33px;
    // height: 0;
}
.#{$prefix}menu-is-collapsed .#{$prefix}menu__fold-icon .#{$prefix}icon-fold,
.#{$prefix}menu-is-locked.#{$prefix}menu-is-collapsed .#{$prefix}menu__fold-icon .#{$prefix}icon-fold{
    transform: rotate(180deg);
}
.#{$prefix}menu-is-collapsed .#{$prefix}menu__submenu .#{$prefix}menu__list{
    display: none;
}
//菜单折叠效果 end



.#{$prefix}menu--light.#{$prefix}menu{
    width: 199px;
    border-left: $menu-light-border-left;
    border-right: $menu-light-border-right;
    background-color: $menu-light-bg;
}
.#{$prefix}menu--light .#{$prefix}menu__header .#{$prefix}tag{
    margin: 0 0 0 10px;
    background-color: #f2f2f2;
    color: #000;
}
.#{$prefix}menu--light .#{$prefix}menu__list li.is-selected .#{$prefix}badge,
.#{$prefix}menu--light .#{$prefix}badge{
    background-color:$color-bg-hover;
    color: $color-text;

    &.is-success{
        background-color: $color-success-0;
        color:$color-success-8;
    }
    // 以下暂时未对外暴露
    &.is-warning{
        background-color: $color-warning-0;
        color:$color-warning-8;
    }
    &.is-error{
        background-color: $color-error-0;
        color:$color-error-8;
    }
    &.is-primary{
        background-color:$color-primary-0;
        color:$color-primary-8 ;
    }
}
.#{$prefix}menu--light .#{$prefix}menu__list li.#{$prefix}list__label .#{$prefix}menu__item:hover {
    background-color: #fff;
}

.#{$prefix}menu--light .#{$prefix}menu__title,
.#{$prefix}menu--light .#{$prefix}menu__text{
    color: $menu-light-text;
}
.#{$prefix}menu--light .#{$prefix}menu__title .#{$prefix}h2{
    color: $menu-light-text;
    font-size: 14px;
    line-height: 21px;
    margin-top: 3px;
    word-wrap: break-word;
    word-break: break-word;
    @include clamp(2)

}
.#{$prefix}menu--light .#{$prefix}menu__list li.is-selected > .#{$prefix}menu__item{
    background-color: transparent;
    &:hover{
        background-color: transparent;
    }
}
.#{$prefix}menu--light li.#{$prefix}menu__submenu.is-expanded.is-selected,
.#{$prefix}menu--light li.#{$prefix}menu__submenu.is-expanded.is-selected > .#{$prefix}menu__item{
    background: $menu-light-item-bg-expanded;
}
.#{$prefix}menu--light .#{$prefix}menu__submenu .#{$prefix}menu__list .#{$prefix}menu__text,
.#{$prefix}menu--light .#{$prefix}menu__submenu.is-expanded > .#{$prefix}menu__item > .#{$prefix}menu__text{
    color: $menu-light-text-expanded;
}
.#{$prefix}menu--light .#{$prefix}menu__submenu .#{$prefix}menu__list .is-selected .#{$prefix}menu__item:before{
    background-color:$menu-light-text-selected;
}
.#{$prefix}menu--light .is-selected > .#{$prefix}menu__item > .#{$prefix}menu__text,
.#{$prefix}menu--light .#{$prefix}menu__submenu .#{$prefix}menu__list .is-selected .#{$prefix}menu__text{
    color:$menu-light-text-selected;
}
.#{$prefix}menu--light .#{$prefix}menu__list li .#{$prefix}menu__item:hover{
    background-color: $menu-light-item-bg-hover;
}
.#{$prefix}menu--light .#{$prefix}menu__submenu.is-expanded,
.#{$prefix}menu--light .#{$prefix}menu__list li.#{$prefix}menu__submenu.is-expanded > .#{$prefix}menu__item,
.#{$prefix}menu--light .#{$prefix}menu__list li.#{$prefix}menu__submenu.is-expanded:hover,
.#{$prefix}menu--light .#{$prefix}menu__fold:hover .#{$prefix}menu__fold-icon{
    background-color: $menu-light-item-bg-selected;
}
.#{$prefix}menu--light .#{$prefix}menu__body::-webkit-scrollbar-thumb{
    background-color: #F2F2F2;
}
.#{$prefix}menu--light .#{$prefix}menu__footer{
    border-top: 1px solid $menu-light-fold-border;
    background-color:$menu-light-fold-bg;
    .#{$prefix}menu__fold:hover{
        background-color: $menu-light-fold-bg-hover;
        .#{$prefix}icon-fold{
            background-image: url(../../assets/image/slice/svg/menu-fold.svg);
        }
    }
}

//二级折叠效果
.#{$prefix}menu-is-collapsed.#{$prefix}menu--light.#{$prefix}menu{
    width: 56px;
}
.#{$prefix}menu-is-collapsed.#{$prefix}menu.#{$prefix}menu--light .#{$prefix}menu__label{
    // border-top:1px solid #e2e2e2;
}

//hover 菜单
.#{$prefix}menu-is-locked.#{$prefix}menu {
    position: absolute;
    z-index: 101; // hover 的时候提高aside的层级，确保能够覆盖右侧内容区

}
.#{$prefix}menu-is-locked .#{$prefix}menu__fold-icon .#{$prefix}icon-fold {
    transform: rotate(180deg);
}



// 移动端样式 ，通过class来控制
.#{$prefix}menu.#{$prefix}menu--mobile{
    width: 100%;
    height: auto;
    overflow: initial;
        
    &.#{$prefix}menu-mobile-collapsed{
        .#{$prefix}menu__header .#{$prefix}icon-arrowdown{
            transform: scaleY(-1);
        }
    }
     
    .#{$prefix}menu__body{
        width: 100%;
        background-color: inherit;
        position: absolute;
        z-index: 1;
        left:0;
        right:0;
        top:56px;
        padding-bottom: 12px;
        display: none;
    }
    &.#{$prefix}menu.#{$prefix}menu-mobile-collapsed{
        .#{$prefix}menu__body{
            display: block;
        }
    }
    .#{$prefix}menu__title{
        width:100%;
        &:hover{
            cursor: pointer;
        }
        .#{$prefix}icon-arrowdown{
            display: inline-block;
        }
    }
    .#{$prefix}menu__item{
        padding-top:11px;
        padding-bottom: 11px;
        position: relative;
        box-shadow: inset 0 -1px 0 0 rgba(124,135,142,0.30);
        // &::after{
        //     content:"";
        //     position: absolute;
        //     bottom:0;
        //     left:0px;
        //     right:0px;
        //     height: 1px;
        //     background-color: #5d5d5d;
        // }
        
    }
    .#{$prefix}menu__submenu .#{$prefix}menu__list{
        padding-bottom: 0;
    }


    //////////@extend////@extend
    .#{$prefix}menu__list .#{$prefix}menu__item:hover{
        background-color: #344258;
    }
    .#{$prefix}menu__list li.is-selected > .#{$prefix}menu__item:hover,
    .#{$prefix}menu__list li.is-selected > .#{$prefix}menu__item{
            background: #344258;
            
    }
    .#{$prefix}menu__list li.#{$prefix}menu__label .#{$prefix}menu__item:hover,
    .#{$prefix}menu--light .#{$prefix}menu__list li.#{$prefix}menu__label .#{$prefix}menu__item:hover{
        background-color: transparent;
        cursor: text;
    }
    .#{$prefix}menu__submenu.is-expanded,
    .#{$prefix}menu__list li.#{$prefix}menu__submenu.is-expanded > .#{$prefix}menu__item,
    .#{$prefix}menu__list li.#{$prefix}menu__submenu.is-expanded:hover{
        background-color: transparent;
    }
    ///////////////@extend

    
    // .#{$prefix}menu__list li .#{$prefix}menu__item:hover,
    // .#{$prefix}menu__list li .#{$prefix}menu__item:active{
    //     background-color: #344258;
    //     .#{$prefix}menu__text{
    //         color:#fff;
    //     }
    // }
    
    
    // .#{$prefix}menu__label .#{$prefix}menu__item{
    //     padding-left: 0;
    // }
    .#{$prefix}menu__label{
        display: none;
    }
    
    .#{$prefix}menu__text{
        max-width: 100%;
        font-size: 14px;
    }
    // .#{$prefix}menu__submenu .#{$prefix}menu__list{
    //     margin-left: 20px;
    // }
    .#{$prefix}menu__submenu .#{$prefix}icon-arrowdown{
        top:16px
    }
    
    .#{$prefix}menu__text.#{$prefix}menu__text-short {
        max-width: calc(100% - 73px);
    }
    .#{$prefix}menu__footer{
        display: none;
    }
}