diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss index ba76114..cdb5f94 100644 --- a/src/assets/styles/sidebar.scss +++ b/src/assets/styles/sidebar.scss @@ -548,7 +548,7 @@ margin-bottom: 10px; } - .teacher-sidebar-toggle { + .course-sidebar-toggle { position: absolute; top: 14px; right: 14px; @@ -603,7 +603,122 @@ display: none; } - .teacher-sidebar-toggle { + .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; } diff --git a/src/assets/styles/student-training.scss b/src/assets/styles/student-training.scss index 57ef44f..dad7757 100644 --- a/src/assets/styles/student-training.scss +++ b/src/assets/styles/student-training.scss @@ -39,6 +39,16 @@ background: #06111d !important; } +/* 学生实训工作台:右侧 AI 栏默认折叠,展开后使用更舒展的阅读宽度。 */ +#app .studentLayout .app-main:has(.student-training-shell) .student-training-shell { + grid-template-columns: minmax(660px, 1fr) minmax(360px, 390px) !important; + transition: grid-template-columns .24s ease; +} + +#app .studentLayout .app-main:has(.student-training-shell) .student-training-shell:has(.training-ai-sidebar.is-collapsed) { + grid-template-columns: minmax(0, 1fr) 56px !important; +} + /* * Student pages use different local names for their main and workbench cards. * Keep the layout density here so a page-specific card cannot reclaim the @@ -605,6 +615,15 @@ background: #06111d !important; } +#app .studentLayout .legacy-training-page { + grid-template-columns: minmax(0, 1fr) minmax(360px, 390px) !important; + transition: grid-template-columns .24s ease; +} + +#app .studentLayout .legacy-training-page:has(.training-ai-sidebar.is-collapsed) { + grid-template-columns: minmax(0, 1fr) 56px !important; +} + .legacy-training-page > :not(.training-ai-sidebar) { grid-column: 1 !important; min-width: 0 !important; diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index 0d5486b..cbb79ca 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -11,12 +11,12 @@