You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dianshang-qianduan/src/assets/styles/sidebar.scss

1198 lines
31 KiB
SCSS

#app {
.main-container {
height: calc(100% - 50px);
transition: margin-left .28s;
margin-left: $base-sidebar-width;
position: relative;
}
.sidebarHide {
margin-left: 0 !important;
}
.sidebar-container {
-webkit-transition: width .28s;
transition: width 0.28s;
width: 239px !important;
background: url('../images/sidebar-background.webp') no-repeat center;
// background-color: $base-menu-background;
background-size: 100% 100%;
height: 100%;
position: fixed;
font-size: 0px;
top: -8px;
bottom: 0;
left: 0;
z-index: 1001;
overflow: hidden;
-webkit-box-shadow: 2px 0 6px rgba(0, 21, 41, .35);
box-shadow: 2px 0 6px rgba(0, 21, 41, .35);
// reset element-ui css
.horizontal-collapse-transition {
transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
}
.scrollbar-wrapper {
overflow-x: hidden !important;
}
.el-scrollbar__bar.is-vertical {
right: 0px;
}
.el-scrollbar {
height: 100%;
}
&.has-logo {
.el-scrollbar {
height: calc(100% - 50px);
}
}
.is-horizontal {
display: none;
}
a {
display: inline-block;
width: 100%;
overflow: hidden;
}
.svg-icon {
margin-right: 16px;
}
.el-menu {
border: none;
height: 100%;
width: 100% !important;
background-color: transparent !important;
padding: 25px 18px;
.el-sub-menu {
margin-bottom: 15px !important;
.el-sub-menu__title {
height: 37px;
line-height: 37px;
background: url('../images/sidebar-normal.png') no-repeat;
background-size: 100% 100% !important;
}
.el-menu {
padding: 1px 18px !important;
.el-menu-item {
min-width: 100% !important;
height: 30px;
color: #fff;
padding-left: 4px;
background: transparent !important;
margin-bottom: 0px;
&:hover {
background: transparent !important;
}
}
}
}
.is-opened{
margin-bottom: 0px !important;
}
.el-menu-item {
display: flex;
align-items: center;
margin-bottom: 20px;
height: 37px;
line-height: 37px;
color: #fff;
background: url('../images/sidebar-normal.png') no-repeat;
background-size: 100% 100% !important;
}
.is-active {
background: url('../images/sidebar-active.png') no-repeat !important;
.el-menu{
.nest-menu{
.is-active{
color: #008efe !important;
}
}
}
.el-sub-menu__title {
background: url('../images/sidebar-active.png') no-repeat !important;
background-size: 100% 100% !important;
}
}
}
.el-menu-item,
.menu-title {
// overflow: hidden !important;
// text-overflow: ellipsis !important;
// white-space: nowrap !important;
}
.el-menu-item .el-menu-tooltip__trigger {
display: inline-block !important;
}
// menu hover
.sub-menu-title-noDropdown,
.el-sub-menu__title {
&:hover {
background-color: rgba(0, 0, 0, 0.06) !important;
}
}
& .theme-dark .is-active>.el-sub-menu__title {
color: $base-menu-color-active !important;
}
& .nest-menu .el-sub-menu>.el-sub-menu__title,
& .el-sub-menu .el-menu-item {
min-width: $base-sidebar-width !important;
&:hover {
background-color: rgba(0, 0, 0, 0.06) !important;
}
}
& .theme-dark .nest-menu .el-sub-menu>.el-sub-menu__title,
& .theme-dark .el-sub-menu .el-menu-item {
background-color: $base-sub-menu-background !important;
&:hover {
background-color: $base-sub-menu-hover !important;
}
}
}
.hideSidebar {
.sidebar-container {
width: 54px !important;
}
.main-container {
margin-left: 54px;
}
.sub-menu-title-noDropdown {
padding: 0 !important;
position: relative;
.el-tooltip {
padding: 0 !important;
.svg-icon {
margin-left: 20px;
}
}
}
.el-sub-menu {
overflow: hidden;
&>.el-sub-menu__title {
padding: 0 !important;
.svg-icon {
margin-left: 20px;
}
}
}
.el-menu--collapse {
.el-sub-menu {
&>.el-sub-menu__title {
&>span {
height: 0;
width: 0;
overflow: hidden;
visibility: hidden;
display: inline-block;
}
&>i {
height: 0;
width: 0;
overflow: hidden;
visibility: hidden;
display: inline-block;
}
}
}
}
}
.el-menu--collapse .el-menu .el-sub-menu {
min-width: $base-sidebar-width !important;
}
// mobile responsive
.mobile {
.main-container {
margin-left: 0px;
}
.sidebar-container {
transition: transform .28s;
width: $base-sidebar-width !important;
}
&.hideSidebar {
.sidebar-container {
pointer-events: none;
transition-duration: 0.3s;
transform: translate3d(-$base-sidebar-width, 0, 0);
}
}
}
.withoutAnimation {
.main-container,
.sidebar-container {
transition: none;
}
}
.platform-admin-main {
height: calc(100vh - 50px);
overflow: auto !important;
background:
radial-gradient(circle at 12% 18%, rgba(14, 74, 112, 0.45), transparent 34%),
radial-gradient(circle at 78% 6%, rgba(25, 92, 170, 0.3), transparent 28%),
linear-gradient(135deg, #03070e 0%, #061827 48%, #02060d 100%) !important;
&::-webkit-scrollbar {
width: 5px;
height: 5px;
}
&::-webkit-scrollbar-track {
background: #111a24;
border-radius: 10px;
}
&::-webkit-scrollbar-thumb {
background: #2d8fcf;
border-radius: 10px;
}
}
.studentLayout,
.teacherLayout {
background:
radial-gradient(circle at 10% 20%, rgba(11, 42, 74, 0.74), transparent 34%),
radial-gradient(circle at 88% 8%, rgba(0, 136, 210, 0.24), transparent 28%),
linear-gradient(135deg, #02050c 0%, #07101d 52%, #02060d 100%);
.main-container {
margin-left: 304px;
background:
radial-gradient(circle at 10% 20%, rgba(11, 42, 74, 0.72), transparent 34%),
radial-gradient(circle at 88% 8%, rgba(0, 136, 210, 0.22), transparent 28%),
linear-gradient(135deg, #02050c 0%, #07101d 52%, #02060d 100%);
}
.app-main,
.teacher-main {
height: calc(100vh - 50px);
padding: 28px 32px 40px 24px;
overflow: auto;
background:
radial-gradient(circle at 12% 18%, rgba(14, 74, 112, 0.45), transparent 34%),
radial-gradient(circle at 78% 6%, rgba(25, 92, 170, 0.3), transparent 28%),
linear-gradient(135deg, #03070e 0%, #061827 48%, #02060d 100%) !important;
&::-webkit-scrollbar {
width: 5px;
height: 5px;
}
&::-webkit-scrollbar-track {
background: #111a24;
border-radius: 10px;
}
&::-webkit-scrollbar-thumb {
background: #2d8fcf;
border-radius: 10px;
}
}
.sidebar-container {
top: 50px;
width: 304px !important;
height: calc(100% - 50px);
padding: 0;
background: transparent !important;
border-right: 0;
box-shadow: none;
overflow: hidden;
&::before {
display: none;
}
&.student-sidebar-shell {
position: fixed;
z-index: 1;
height: calc(100% - 50px);
background: transparent !important;
}
.student-sidebar-scroll {
height: 100%;
}
.scrollbar-wrapper {
overflow-x: hidden !important;
}
.student-course-nav {
width: calc(100% - 40px);
min-height: calc(100% - 56px);
margin: 28px 20px;
padding: 24px 16px 28px;
border: 1px solid rgba(0, 180, 255, 0.25);
border-radius: 32px;
background: rgba(8, 18, 28, 0.7);
box-shadow: 0 22px 48px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(169, 229, 255, 0.08);
backdrop-filter: blur(12px);
}
.student-course-heading {
display: flex;
align-items: center;
gap: 10px;
width: 100%;
min-height: 22px;
margin: 0 0 14px;
border: 0;
padding: 0 6px;
line-height: 1.35;
text-align: left;
color: #7e9fc5;
background: transparent;
font-family: inherit;
font-size: 12px;
font-weight: 800;
letter-spacing: 1.6px;
text-transform: uppercase;
white-space: normal;
cursor: pointer;
transition: color 0.2s ease;
}
.student-course-heading:hover,
.student-course-heading.active {
color: #c9edff;
}
.student-course-list {
margin: 0 0 28px;
}
.student-course-link {
position: relative;
display: flex;
align-items: center;
gap: 10px;
width: 100%;
min-height: 42px;
margin: 0 0 8px;
border: 1px solid transparent;
border-radius: 18px;
padding: 10px 14px 10px 16px;
line-height: 1.4;
text-align: left;
color: #d7e9ff;
background: rgba(255, 255, 255, 0.025);
font-family: inherit;
font-size: 15px;
font-weight: 700;
letter-spacing: 0;
white-space: normal;
overflow: hidden;
cursor: pointer;
transition: color 0.2s ease, transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.student-course-icon {
position: relative;
z-index: 1;
display: inline-flex;
flex: 0 0 auto;
align-items: center;
justify-content: center;
width: 26px;
height: 26px;
border: 1px solid rgba(0, 170, 255, 0.26);
border-radius: 10px;
color: #7ee9ff;
background:
linear-gradient(135deg, rgba(0, 170, 255, 0.24), rgba(43, 110, 255, 0.08)),
rgba(1, 24, 36, 0.82);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 10px rgba(0, 170, 255, 0.08);
svg {
width: 15px;
height: 15px;
}
}
.student-course-icon--heading {
width: 22px;
height: 22px;
border-radius: 9px;
color: #9defff;
background: rgba(0, 132, 198, 0.18);
svg {
width: 13px;
height: 13px;
}
}
.student-course-text {
min-width: 0;
flex: 1;
}
.student-course-link:hover,
.student-course-link.active {
color: #ffffff;
border-color: rgba(0, 170, 255, 0.72);
background: linear-gradient(95deg, rgba(0, 160, 255, 0.2), rgba(0, 100, 200, 0.1));
box-shadow: 0 2px 14px rgba(0, 170, 255, 0.18);
transform: translateX(3px);
}
.student-course-link.active {
border-left: 3px solid #00aaff;
}
.student-course-link.disabled {
cursor: default;
}
.student-report-button {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
width: calc(100% - 28px);
min-height: 44px;
margin: 18px 14px 0;
border: 1px solid rgba(0, 170, 255, 0.65);
border-radius: 40px;
line-height: 42px;
text-align: center;
color: #caf0ff;
background: rgba(0, 160, 255, 0.15);
font-family: inherit;
font-size: 14px;
font-weight: 800;
cursor: pointer;
transition: background 0.2s ease, box-shadow 0.2s ease;
&:hover,
&.active {
color: #ffffff;
background: rgba(0, 170, 255, 0.26);
box-shadow: 0 0 14px rgba(34, 183, 237, 0.32);
}
}
}
}
.mobile.studentLayout,
.mobile.teacherLayout {
.main-container {
margin-left: 0;
}
.sidebar-container {
width: 304px !important;
}
&.hideSidebar {
.sidebar-container {
transform: translate3d(-304px, 0, 0);
}
}
}
.teacherLayout {
.sidebar-container {
border-right: 1px solid rgba(0, 180, 255, 0.24);
&::after {
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
z-index: 3;
width: 1px;
background: linear-gradient(180deg, rgba(81, 211, 255, 0.38), rgba(81, 211, 255, 0.18) 45%, rgba(81, 211, 255, 0.28));
pointer-events: none;
}
.student-sidebar-scroll,
.el-scrollbar__wrap,
.el-scrollbar__view {
height: 100%;
}
.el-scrollbar__bar.is-vertical {
right: 4px;
opacity: 0;
transition: opacity 0.2s ease;
}
&:hover .el-scrollbar__bar.is-vertical {
opacity: 1;
}
.student-course-nav {
width: 100%;
height: 100%;
min-height: 100%;
margin: 0;
padding: 28px 20px;
box-sizing: border-box;
border: 0;
border-radius: 0;
background:
radial-gradient(circle at 18% 10%, rgba(0, 170, 255, 0.12), transparent 34%),
rgba(8, 18, 28, 0.82);
box-shadow: inset -1px 0 0 rgba(169, 229, 255, 0.06), 12px 0 32px rgba(0, 5, 16, 0.2);
}
.student-course-list {
margin-bottom: 0;
}
.student-course-link {
min-height: 46px;
margin-bottom: 10px;
}
.course-sidebar-toggle {
position: absolute;
top: 14px;
right: 14px;
z-index: 8;
display: grid;
width: 32px;
height: 32px;
place-items: center;
border: 1px solid rgba(89, 218, 255, 0.5);
border-radius: 9px;
color: #dff8ff;
background: rgba(5, 54, 83, 0.84);
box-shadow: 0 0 14px rgba(0, 170, 255, 0.15);
font-size: 24px;
line-height: 1;
cursor: pointer;
transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
&:hover {
border-color: #70e4ff;
background: rgba(11, 116, 160, 0.8);
transform: translateX(1px);
}
}
}
&.hideSidebar {
.sidebar-container {
width: 64px !important;
.student-course-nav {
padding: 58px 10px 24px;
}
.student-course-heading,
.student-course-link {
justify-content: center;
padding-right: 0;
padding-left: 0;
}
.student-course-heading {
margin-bottom: 14px;
}
.student-course-link {
min-height: 42px;
margin-bottom: 10px;
}
.student-course-text {
display: none;
}
.course-sidebar-toggle {
right: 16px;
transform: none;
}
}
.main-container {
margin-left: 64px;
}
}
}
/* 仅学生实训任务页提供课程导航的图标轨道,离开任务页不改变原有学生布局。 */
.studentLayout:has(.student-training-shell) {
.sidebar-container {
border-right: 1px solid rgba(0, 180, 255, 0.24);
.student-course-nav {
margin: 20px;
}
.course-sidebar-toggle {
position: absolute;
top: 28px;
right: 28px;
z-index: 8;
display: grid;
width: 32px;
height: 32px;
place-items: center;
border: 1px solid rgba(89, 218, 255, 0.5);
border-radius: 9px;
color: #dff8ff;
background: rgba(5, 54, 83, 0.84);
box-shadow: 0 0 14px rgba(0, 170, 255, 0.15);
font-size: 24px;
line-height: 1;
cursor: pointer;
transition: background .2s ease, border-color .2s ease, transform .2s ease;
&:hover,
&:focus-visible {
border-color: #70e4ff;
outline: none;
background: rgba(11, 116, 160, 0.8);
transform: translateX(1px);
}
}
}
&.hideSidebar {
.sidebar-container {
width: 64px !important;
.student-course-nav {
box-sizing: border-box;
width: 100%;
min-height: 100%;
margin: 0;
padding: 58px 11px 24px;
border: 0;
border-radius: 0;
background:
linear-gradient(180deg, rgba(8, 31, 47, .92), rgba(3, 16, 28, .98));
box-shadow: inset -1px 0 0 rgba(132, 228, 255, .1);
}
.student-course-heading,
.student-course-link {
box-sizing: border-box;
width: 42px;
justify-content: center;
padding-right: 0;
padding-left: 0;
}
/* 分类名收起后没有辨识价值,保留具有页面入口的标题按钮。 */
div.student-course-heading {
display: none;
}
.student-course-heading {
min-height: 42px;
margin: 0 0 10px;
}
.student-course-link {
min-height: 42px;
margin: 0 0 8px;
border-radius: 13px;
background: rgba(255, 255, 255, .025);
}
.student-course-list {
margin: 0 0 10px;
}
.student-course-text {
display: none;
}
.student-course-icon {
width: 27px;
height: 27px;
}
.student-course-link.active {
border: 1px solid rgba(0, 190, 255, .85);
background: linear-gradient(135deg, rgba(0, 174, 255, .28), rgba(18, 95, 190, .14));
box-shadow: 0 0 14px rgba(0, 178, 255, .25);
transform: none;
}
.course-sidebar-toggle {
top: 12px;
right: 16px;
transform: none;
}
}
.main-container {
margin-left: 64px;
}
}
}
}
// when menu collapsed
.el-menu--vertical {
&>.el-menu {
.svg-icon {
margin-right: 16px;
}
}
.nest-menu .el-sub-menu>.el-sub-menu__title,
.el-menu-item {
&:hover {
// you can use $sub-menuHover
background-color: rgba(0, 0, 0, 0.06) !important;
}
}
// the scroll bar appears when the sub-menu is too long
>.el-menu--popup {
max-height: 100vh;
overflow-y: auto;
&::-webkit-scrollbar-track-piece {
background: #d3dce6;
}
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-thumb {
background: #99a9bf;
border-radius: 20px;
}
}
}
/*
* 学生端 + 教师端共用亮色主题覆盖
* 取代 #app .studentLayout, #app .teacherLayout 共享的暗色背景(L274-411)
* 超管端 (role 1) 走独立深色路径:#app .platform-admin-main (L250-272)
*/
#app .studentLayout,
#app .teacherLayout {
// 整体浅色背景 + 蓝色点缀,营造明亮的科技感
background:
radial-gradient(circle at 10% 20%, rgba(30, 136, 229, 0.07), transparent 34%),
radial-gradient(circle at 88% 8%, rgba(66, 165, 245, 0.05), transparent 28%),
linear-gradient(135deg, #f5f8fc 0%, #eaf2fb 52%, #f3f8ff 100%) !important;
.main-container {
background:
radial-gradient(circle at 10% 20%, rgba(30, 136, 229, 0.06), transparent 34%),
radial-gradient(circle at 88% 8%, rgba(66, 165, 245, 0.04), transparent 28%),
linear-gradient(135deg, #f5f8fc 0%, #eaf2fb 52%, #f3f8ff 100%) !important;
}
.app-main,
.teacher-main {
background:
radial-gradient(circle at 12% 18%, rgba(30, 136, 229, 0.05), transparent 34%),
radial-gradient(circle at 78% 6%, rgba(66, 165, 245, 0.04), transparent 28%),
linear-gradient(135deg, #f7fafd 0%, #eef4fb 48%, #f5f8fc 100%) !important;
&::-webkit-scrollbar {
width: 6px;
height: 6px;
}
&::-webkit-scrollbar-track {
background: rgba(30, 60, 100, 0.06);
border-radius: 10px;
}
&::-webkit-scrollbar-thumb {
background: rgba(30, 136, 229, 0.35);
border-radius: 10px;
&:hover {
background: rgba(30, 136, 229, 0.55);
}
}
}
// 侧边栏整体:浅色玻璃质感 + 蓝色描边
.sidebar-container {
border-right: 1px solid rgba(30, 136, 229, 0.18) !important;
background: linear-gradient(180deg, #ffffff 0%, #f3f8ff 100%) !important;
box-shadow: 4px 0 18px rgba(30, 60, 100, 0.06) !important;
&::after {
background: linear-gradient(180deg, rgba(30, 136, 229, 0.35), rgba(30, 136, 229, 0.15) 45%, rgba(30, 136, 229, 0.25)) !important;
}
// 教师端导航容器:浅色玻璃 + 蓝色描边
.student-course-nav {
background:
radial-gradient(circle at 18% 10%, rgba(30, 136, 229, 0.08), transparent 34%),
rgba(255, 255, 255, 0.7) !important;
box-shadow: inset -1px 0 0 rgba(30, 136, 229, 0.08), 8px 0 24px rgba(30, 60, 100, 0.06) !important;
backdrop-filter: blur(10px);
}
// 区块标题:深蓝色字
.student-course-heading {
color: #5a7896 !important;
&:hover,
&.active {
color: #1e88e5 !important;
}
}
// 菜单项:浅色背景 + 深色文字 + 蓝色 hover
.student-course-link {
color: #2c4a6a !important;
background: rgba(30, 136, 229, 0.04) !important;
border: 1px solid rgba(30, 136, 229, 0.1) !important;
&:hover,
&.active {
color: #1e88e5 !important;
border-color: rgba(30, 136, 229, 0.4) !important;
background: linear-gradient(95deg, rgba(30, 136, 229, 0.14), rgba(66, 165, 245, 0.06)) !important;
box-shadow: 0 4px 14px rgba(30, 136, 229, 0.16) !important;
}
&.active {
border-left: 3px solid #1e88e5 !important;
}
}
// 图标容器:浅色玻璃 + 蓝色边框
.student-course-icon {
color: #1e88e5 !important;
border-color: rgba(30, 136, 229, 0.22) !important;
background:
linear-gradient(135deg, rgba(30, 136, 229, 0.16), rgba(66, 165, 245, 0.06)),
rgba(255, 255, 255, 0.6) !important;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 8px rgba(30, 136, 229, 0.1) !important;
&--heading {
color: #1e88e5 !important;
background: rgba(30, 136, 229, 0.12) !important;
}
}
// 报告按钮(如有):浅色玻璃 + 蓝色高亮
.student-report-button {
color: #1e88e5 !important;
background: rgba(30, 136, 229, 0.1) !important;
border-color: rgba(30, 136, 229, 0.5) !important;
&:hover,
&.active {
color: #ffffff !important;
background: linear-gradient(135deg, #1e88e5, #42a5f5) !important;
box-shadow: 0 4px 14px rgba(30, 136, 229, 0.3) !important;
}
}
// 折叠把手:贴侧边栏右缘、垂直居中的极小竖条(全 !important 压过旧深色块)
.course-sidebar-toggle {
position: absolute !important;
top: 50% !important;
right: 0 !important;
transform: translateY(-50%) !important;
z-index: 8;
display: flex !important;
align-items: center !important;
justify-content: center !important;
box-sizing: border-box !important;
width: 14px !important;
height: 44px !important;
padding: 0 !important;
border: 1px solid #e5e7eb !important;
border-right: 0 !important;
border-radius: 8px 0 0 8px !important;
background: #ffffff !important;
color: #9ca3af !important;
box-shadow: -2px 0 6px rgba(17, 24, 39, 0.08) !important;
cursor: pointer;
transition: background-color 0.15s ease, color 0.15s ease;
.toggle-arrow { font-size: 10px; }
.toggle-arrow--right { display: none; }
&:hover,
&:focus-visible {
background: #1f2937 !important;
color: #ffffff !important;
outline: none;
}
}
}
// 折叠态:左箭头隐藏、右箭头显示(与 .sidebar-container 同级,避免嵌套出双容器)
.sidebar-container.is-collapse .course-sidebar-toggle {
.toggle-arrow--left { display: none; }
.toggle-arrow--right { display: inline-flex; }
}
}
/*
* 学生端 + 教师端实训页背景覆盖
* student-training.scss 中 .student-training-shell 的暗色背景统一覆盖为亮色
*/
#app .studentLayout .app-main:has(.student-training-shell),
#app .teacherLayout .app-main:has(.student-training-shell) {
background: linear-gradient(135deg, #f5f8fc 0%, #eaf2fb 52%, #f3f8ff 100%) !important;
}
#app .studentLayout .app-main:has(.student-training-shell) .student-training-shell,
#app .teacherLayout .app-main:has(.student-training-shell) .student-training-shell {
background: transparent !important;
}
/* ========================================================================
* 学生端课程菜单(role 4)墨黑极简主题
* 1) 仅命中 .is-student-nav,教师端 teacherLayout 不受影响
* 2) 置于文件末尾,选择器多出一个 .is-student-nav 类,覆盖前文共享亮色块
* 3) 风格:白底 + 墨黑选中块,去玻璃卡片/渐变/胶囊/位移动画
* ====================================================================== */
#app .studentLayout {
.sidebar-container.is-student-nav {
background: #ffffff !important;
border-right: 1px solid #e5e7eb !important;
box-shadow: none !important;
&::after { display: none !important; }
.student-sidebar-scroll,
.el-scrollbar__wrap,
.el-scrollbar__view {
height: 100%;
}
/* 侧边栏滚动条中性化 */
.el-scrollbar__wrap {
&::-webkit-scrollbar { width: 5px; }
&::-webkit-scrollbar-track { background: transparent; }
&::-webkit-scrollbar-thumb {
background: #d1d5db;
border-radius: 10px;
}
&::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
}
.el-scrollbar__bar.is-vertical {
right: 4px;
opacity: 0;
transition: opacity 0.2s ease;
}
&:hover .el-scrollbar__bar.is-vertical { opacity: 1; }
}
/* el-menu 菜单容器:白底、紧凑行高 */
.sidebar-container.is-student-nav .student-course-menu {
box-sizing: border-box;
width: 100%;
border-right: 0;
background: #ffffff;
padding: 12px 10px;
--el-menu-item-height: 46px;
--el-menu-sub-item-height: 46px;
}
/* 一级行(直跳项 / 分组标题):墨黑实底白字,仅命中根菜单直接子项。
EP 会给 title 绑内联 color/background,必须 !important 才能覆盖 */
.student-course-menu > li.el-menu-item,
.student-course-menu > li.el-sub-menu > .el-sub-menu__title {
height: 46px;
line-height: 46px;
margin: 0 0 8px;
border-radius: 8px;
color: #ffffff !important;
font-size: 14px;
font-weight: 600;
background: #1f2937 !important;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
.student-menu-icon { color: #ffffff !important; }
&:hover,
&:focus {
color: #ffffff !important;
background: #111827 !important;
outline: none;
.student-menu-icon { color: #ffffff !important; }
}
}
/* 一级激活(直跳项 / 当前路由所在分组):深黑底 + 左侧白色引导条 */
.student-course-menu > li.el-menu-item.is-active,
.student-course-menu > li.el-sub-menu.is-active > .el-sub-menu__title {
color: #ffffff !important;
background: #111827 !important;
box-shadow: inset 3px 0 0 #ffffff;
.student-menu-icon { color: #ffffff !important; }
&:hover,
&:focus {
color: #ffffff !important;
background: #111827 !important;
.student-menu-icon { color: #ffffff !important; }
}
}
/* 二级列表展开区:白底 */
.sidebar-container.is-student-nav .el-sub-menu .el-menu {
background: #ffffff;
}
/* 二级菜单项:透明底、hover 浅灰、激活墨黑实底。
老规则对嵌套项写了 transparent !important(L80-90),背景必须 !important 才能覆盖 */
.sidebar-container.is-student-nav .el-sub-menu .el-menu-item {
height: 34px;
line-height: 34px;
min-width: auto;
border-radius: 8px;
color: #4b5563;
background: transparent;
&:hover,
&:focus {
background: #f3f4f6 !important;
color: #111827;
outline: none;
}
&.is-active {
background: #1f2937 !important;
color: #ffffff;
&:hover {
background: #111827 !important;
color: #ffffff;
}
}
&.is-disabled,
&.is-disabled:hover {
color: #c0c5cd;
opacity: 1;
background: transparent !important;
cursor: default;
}
}
/* 分组折叠箭头:墨黑块上用 70% 白,hover/激活全白;旋转由组件内置 */
.sidebar-container.is-student-nav .el-sub-menu__icon-arrow {
color: rgba(255, 255, 255, 0.7) !important;
}
.sidebar-container.is-student-nav .el-sub-menu__title:hover .el-sub-menu__icon-arrow,
.sidebar-container.is-student-nav li.el-sub-menu.is-active .el-sub-menu__icon-arrow {
color: #ffffff !important;
}
/* 菜单图标:16px,与文字间距 8px */
.sidebar-container.is-student-nav .student-menu-icon {
margin-right: 8px;
font-size: 16px;
}
/* 折叠把手沿用共享块的边缘定位(!important);此处仅覆写 hover,
压过旧 .studentLayout:has(.student-training-shell) 蓝色玻璃 hover */
.sidebar-container.is-student-nav .course-sidebar-toggle {
&:hover,
&:focus-visible {
border-color: #1f2937;
background: #1f2937;
color: #ffffff;
outline: none;
}
}
/* 64px 图标轨道模式(el-menu collapse 原生支持,二级以弹出层展示) */
&.hideSidebar .sidebar-container.is-student-nav {
.student-course-menu {
box-sizing: border-box;
width: 64px;
padding: 12px 8px;
}
/* 一级深蓝块在轨道模式下只居中显图标 */
.student-course-menu > li.el-menu-item,
.student-course-menu > li.el-sub-menu > .el-sub-menu__title {
justify-content: center;
padding: 0;
}
.student-menu-icon { margin-right: 0; }
}
}
/* ========================================================================
* 学生端 64px 轨道模式:分组二级弹出层(teleport 到 body,脱离 sidebar 作用域)
* 通过 el-sub-menu 的 popper-class="student-menu-popper" 锚定换肤
* ====================================================================== */
.el-popper.student-menu-popper,
.el-menu--popup-container.student-menu-popper {
padding: 6px;
border: 1px solid #e5e7eb;
border-radius: 10px;
box-shadow: 0 6px 20px rgba(17, 24, 39, 0.12);
.el-menu--popup {
padding: 0;
background: #ffffff;
}
.el-menu-item {
height: 34px;
line-height: 34px;
border-radius: 8px;
color: #374151;
background: transparent;
&:hover,
&:focus {
background: #f3f4f6;
color: #111827;
outline: none;
}
&.is-active {
background: #1f2937;
color: #ffffff;
&:hover {
background: #111827;
color: #ffffff;
}
}
}
}