Files
hsa/Html/apps/static/css/dashboard.css
2025-10-27 11:42:21 +08:00

628 lines
11 KiB
CSS

/* Reset some default styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* Body & Page Background */
body {
font-family: 'Arial', sans-serif;
background-color: #f5f5f5;
}
:root {
--primary-blue: #6A9FB5;
--secondary-blue: #8BB4C5;
--light-blue: #E1F0F7;
--accent-blue: #4A7B9D;
--text-dark: #2C3E50;
--text-light: #7F8C8D;
--card-shadow: 0 4px 12px rgba(106, 159, 181, 0.15);
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #F9FBFD;
color: var(--text-dark);
line-height: 1.6;
}
/* 导航栏样式 */
.navbar {
background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
padding: 0.8rem 1rem;
}
.navbar-brand {
font-weight: 700;
font-size: 1.5rem;
color: white !important;
}
.nav-link {
color: rgba(255, 255, 255, 0.9) !important;
font-weight: 500;
padding: 0.5rem 1rem !important;
transition: all 0.3s ease;
border-radius: 4px;
}
.nav-link:hover,
.nav-link.active {
color: white !important;
background-color: rgba(255, 255, 255, 0.15);
}
.user-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
border: 2px solid rgba(255, 255, 255, 0.7);
object-fit: cover;
}
/* 学习路径区域 */
.learning-path-section {
background: linear-gradient(135deg, var(--light-blue), #D4E9F2);
padding: 2rem 0;
border-radius: 0 0 20px 20px;
margin-bottom: 2rem;
}
.section-title {
color: var(--accent-blue);
font-weight: 600;
margin-bottom: 1.5rem;
position: relative;
padding-bottom: 0.5rem;
font-size: 28px;
}
.section-title:after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 60px;
height: 3px;
background-color: var(--primary-blue);
border-radius: 2px;
}
/* 专业选择器样式优化 */
.major-selector {
position: relative;
margin-bottom: 2rem;
}
.major-selector label {
font-weight: 600;
color: var(--accent-blue);
margin-bottom: 0.5rem;
display: block;
}
.major-selector select {
appearance: none;
background-color: white;
border: 2px solid var(--primary-blue);
border-radius: 8px;
padding: 0.75rem 1.5rem;
font-size: 1rem;
color: var(--text-dark);
width: 100%;
max-width: 300px;
cursor: pointer;
transition: all 0.3s ease;
}
.major-selector select:focus {
outline: none;
box-shadow: 0 0 0 3px rgba(106, 159, 181, 0.3);
border-color: var(--accent-blue);
}
.major-selector::after {
content: '\f078';
font-family: 'Font Awesome 5 Free';
font-weight: 900;
position: absolute;
top: 50%;
right: 1rem;
transform: translateY(-50%);
pointer-events: none;
color: var(--primary-blue);
}
/* 学习路径图样式 - 横向流程图 */
.path-flow {
background-color: white;
border-radius: 12px;
padding: 2rem;
box-shadow: var(--card-shadow);
overflow-x: auto;
position: relative;
}
.path-container {
display: flex;
min-width: 900px;
position: relative;
}
.path-step {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
padding: 0 1rem;
}
.step-connector {
position: absolute;
top: 40px;
left: -50%;
width: 100%;
height: 2px;
background-color: var(--primary-blue);
z-index: 1;
}
.step-node {
width: 80px;
height: 80px;
border-radius: 50%;
background-color: var(--light-blue);
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 1rem;
position: relative;
z-index: 2;
transition: all 0.3s ease;
cursor: pointer;
}
.step-node:hover {
transform: scale(1.05);
background-color: var(--primary-blue);
}
.step-node:hover .step-icon {
color: white;
}
.step-icon {
font-size: 1.8rem;
color: var(--accent-blue);
}
.step-content {
text-align: center;
width: 100%;
}
.step-title {
font-weight: 600;
margin-bottom: 0.5rem;
color: var(--accent-blue);
}
.step-courses {
font-size: 0.9rem;
color: var(--text-light);
margin-bottom: 0.5rem;
}
.step-progress {
height: 6px;
background-color: #e9ecef;
border-radius: 3px;
overflow: hidden;
margin-bottom: 0.5rem;
}
.step-progress-bar {
height: 100%;
background-color: var(--primary-blue);
border-radius: 3px;
transition: width 0.5s ease;
}
.step-status {
font-size: 0.8rem;
color: var(--text-light);
}
.step-completed .step-node {
background-color: var(--primary-blue);
}
.step-completed .step-icon {
color: white;
}
.step-active .step-node {
background-color: var(--accent-blue);
box-shadow: 0 0 0 4px rgba(74, 123, 157, 0.3);
}
.step-active .step-icon {
color: white;
}
/* 课程详情面板 */
.course-panel {
display: none;
background-color: white;
border-radius: 12px;
padding: 1.5rem;
box-shadow: var(--card-shadow);
margin-top: 1.5rem;
}
.course-panel.active {
display: block;
}
.panel-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
padding-bottom: 0.5rem;
border-bottom: 1px solid #e9ecef;
}
.panel-title {
font-weight: 600;
color: var(--accent-blue);
margin: 0;
}
.close-panel {
background: none;
border: none;
font-size: 1.2rem;
color: var(--text-light);
cursor: pointer;
}
.course-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 1rem;
}
.course-item {
display: flex;
align-items: center;
padding: 0.75rem;
border-radius: 8px;
border: 1px solid #e9ecef;
transition: all 0.3s ease;
}
.course-item:hover {
border-color: var(--primary-blue);
box-shadow: 0 2px 8px rgba(106, 159, 181, 0.15);
}
.course-check {
margin-right: 0.75rem;
color: #28a745;
}
.course-info {
flex: 1;
}
.course-name {
font-weight: 500;
margin-bottom: 0.25rem;
}
.course-duration {
font-size: 0.8rem;
color: var(--text-light);
}
.course-action {
margin-left: 0.75rem;
}
/* 搜索区域 */
.search-section {
padding: 0;
}
.search-container {
background-color: white;
border-radius: 12px;
padding: 1.5rem;
box-shadow: var(--card-shadow);
}
/* 课程卡片样式 */
.course-card {
border: none;
border-radius: 12px;
box-shadow: var(--card-shadow);
transition: all 0.3s ease;
margin-bottom: 1.5rem;
overflow: hidden;
background-color: white;
}
.course-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(106, 159, 181, 0.2);
}
.course-img {
height: 160px;
object-fit: cover;
width: 100%;
}
.course-category {
display: inline-block;
background-color: var(--light-blue);
color: var(--accent-blue);
font-size: 0.8rem;
padding: 0.3rem 0.8rem;
border-radius: 20px;
margin-bottom: 0.8rem;
}
.course-title {
font-weight: 600;
color: var(--text-dark);
margin-bottom: 0.5rem;
font-size: 1.1rem;
line-height: 1.4;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
}
.course-title-in-progress{
color: var(--text-dark);
font-size: 1.4rem;
line-height: 1.4;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
text-align: center;
}
.course-instructor {
color: var(--text-light);
font-size: 0.9rem;
margin-bottom: 0.5rem;
}
.course-meta {
display: flex;
justify-content: space-between;
color: var(--text-light);
font-size: 0.85rem;
margin-bottom: 1rem;
}
.course-rating {
color: #FFC107;
}
.btn-view {
background-color: white;
color: var(--primary-blue);
border: 1px solid var(--primary-blue);
font-weight: 500;
transition: all 0.3s ease;
}
.btn-view:hover {
background-color: var(--light-blue);
color: var(--accent-blue);
}
.btn-enroll {
background-color: var(--primary-blue);
color: white;
font-weight: 500;
transition: all 0.3s ease;
}
.btn-enroll:hover {
background-color: var(--accent-blue);
color: white;
}
/* Dashboard 主体部分 */
.dashboard {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
.dashboard-title {
font-size: 28px;
font-weight: bold;
margin-bottom: 20px;
text-align: center;
}
/* 课程卡片容器 */
.course-cards {
display: flex;
flex-wrap: nowrap;
gap: 20px;
justify-content: flex-start;
padding: 10px 0;
overflow: hidden;
position: relative;
}
/* 课程卡片 */
.course-card {
width: 300px;
height: 500px;
display: flex;
flex-direction: column;
background-color: white;
border-radius: 15px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
overflow: hidden;
transition: transform 0.3s;
}
.select-button {
display: block;
width: 100%;
padding: 10px;
background-color: #2575fc;
color: white;
border: none;
cursor: pointer;
font-size: 16px;
margin-top: auto; /* 将按钮推到父元素的底部 */
}
.course-card:hover {
transform: translateY(-10px); /* 提升效果 */
}
.course-image {
width: 100%;
height: 200px;
object-fit: cover;
}
.course-info {
padding: 20px;
}
.course-name {
font-size: 22px;
font-weight: bold;
color: #333;
}
.course-description {
font-size: 14px;
color: #777;
margin-top: 10px;
}
/* 右侧滑出进度卡片样式 */
.course-progress {
position: fixed;
top: 0;
right: -400px; /* 初始时在屏幕外 */
width: 400px;
height: 100%;
background-color: #fff;
box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
padding: 30px;
transition: right 0.3s ease;
z-index: 9999;
border-radius: 15px; /* 添加圆角 */
}
.course-progress.open {
right: 0; /* 打开时显示 */
}
.progress-header {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 20px;
margin-bottom: 20px;
text-align: center;
}
.close-btn {
background: none;
border: none;
font-size: 24px;
cursor: pointer;
}
/* 章节和子章节样式 */
.chapter-list {
list-style-type: none;
padding-left: 0;
}
.chapter-item {
margin: 5px 0;
padding: 5px;
cursor: pointer;
}
.chapter-item .chapter-title {
font-size: 16px;
font-weight: bold;
}
.chapter-item .sub-chapter-list {
display: none; /* 初始状态下子章节隐藏 */
padding-left: 20px;
}
.chapter-item.open .sub-chapter-list {
display: block; /* 展开时显示子章节 */
}
.chapter-item:hover {
background-color: #f1f1f1;
border-radius: 5px;
}
/* 子章节的样式 */
.sub-chapter-item {
margin: 3px 0;
padding: 3px;
font-size: 14px;
}
.sub-chapter-item:hover {
background-color: #e8e8e8;
}
/* 响应式调整 */
@media (max-width: 768px) {
.path-container {
min-width: 700px;
}
.step-node {
width: 60px;
height: 60px;
}
.step-icon {
font-size: 1.4rem;
}
.step-title {
font-size: 0.9rem;
}
.course-list {
grid-template-columns: 1fr;
}
}
.fas.fa-times-circle.fa-lg {
color: var(--accent-blue);
}