/* HDU凌极课程平台 - Coursera风格主页样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa; /* 与 course-home 一致 */
    color: #333;        /* 与 course-home 一致 */
    line-height: 1.6;
}

/* 顶部导航样式 */
.main-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: none; /* 去掉顶栏阴影 */
}

.header-content {
    max-width: 1400px; /* 优化：适应现代宽屏，提升空间利用率 */
    margin: 0 auto; /* 居中显示 */
    width: 100%;
    padding: 0 40px; /* 与页面内容左右内边距对齐 */
    display: -webkit-flex; /* Safari 兼容 */
    display: flex;
    -webkit-align-items: center; /* Safari 兼容 */
    align-items: center;
    -webkit-justify-content: space-between; /* Safari 兼容 */
    justify-content: space-between;
    height: 72px;
}

/* 二级导航（Tabs） */
.header-tabs {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.tabs-content {
    max-width: 1400px; /* 与header-content保持一致 */
    margin: 0 auto;
    padding: 0 40px;
}

.tabs-nav {
    display: -webkit-flex; /* Safari 兼容 */
    display: flex;
    /* Safari 兼容：使用 margin 替代 gap */
    margin: 0 -20px;
}
.tabs-nav > * {
    margin: 0 20px; /* 替代 gap: 40px */
}

/* 学生平台隐藏指定 Tabs：我的教学、课程联盟（教师平台不隐藏） */
body:not(.page-teacher) .header-tabs .tabs-nav a[href="/my-teaching.html"],
body:not(.page-teacher) .header-tabs .tabs-nav a[href="/course-alliance.html"] {
    display: none;
}

.tab-item {
    display: inline-block;
    padding: 14px 0;
    text-decoration: none;
    color: #666;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.tab-item.active,
.tab-item:hover {
    color: #0056d3;
    border-bottom-color: #0056d3;
}

.logo-section {
    display: -webkit-flex; /* Safari 兼容 */
    display: flex;
    -webkit-align-items: center; /* Safari 兼容 */
    align-items: center;
    /* Safari 兼容：使用 margin 替代 gap */
}
.logo-section > * + * {
    margin-left: 12px; /* 替代 gap: 12px */
}

.logo-link {
    display: -webkit-flex; /* Safari 兼容 */
    display: flex;
    -webkit-align-items: center; /* Safari 兼容 */
    align-items: center;
    text-decoration: none;
    color: inherit;
    -webkit-transition: opacity 0.2s ease; /* Safari 兼容 */
    transition: opacity 0.2s ease;
    /* Safari 兼容：使用 margin 替代 gap */
}
.logo-link > * + * {
    margin-left: 12px; /* 替代 gap: 12px */
}

.logo-link:hover {
    opacity: 0.8;
}

.university-logo {
    height: 40px;
    width: 40px;      /* 正方形显示 */
    object-fit: cover;    /* 与提供方logo一致的填充方式 */
    display: block;
    border-radius: 8px;   /* 与提供方logo一致的圆角 */
    border: 1px solid #e0e0e0;
    background: #fff;
}

.platform-name {
    font-size: 20px;
    font-weight: 700;
    color: #000; /* 顶栏标题改为规范黑色 */
}

.search-section {
    margin-left: 24px; /* 紧随标题右侧 */
    width: 520px;       /* 加长搜索框宽度 */
    flex: 0 0 520px;    /* 在顶栏中占固定宽度 */
}

.search-container {
    position: relative;
    width: 100%;
}

.global-search {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease;
}

.global-search:focus {
    border-color: #1B4F8C;
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #1B4F8C;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

.main-nav { display: flex; gap: 0; }

.nav-item {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.icon-bell {
    vertical-align: middle;
}

.nav-item.active,
.nav-item:hover {
    color: #1B4F8C;
    border-bottom-color: #1B4F8C;
}

.notification-badge {
    background: #ef4444;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 12px;
    position: absolute;
    top: -2px;
    right: -4px;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

/* 教师端三个 Tab（主页 / 我的教学 / 探索课程）与学生端统一头像与通知间距 */
.page-teacher .user-section {
    gap: 16px;
}

.notify-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #64748b;
    text-decoration: none;
}

.notify-btn:hover { background: #f1f5f9; }

.language-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.language-toggle:hover {
    background: #f1f5f9;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: #22c55e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 教师首页头像不表现为可点击状态 */
.page-teacher .user-avatar {
    cursor: default;
}

.page-teacher .user-avatar:hover {
    transform: none;
    box-shadow: none;
}

/* 用户菜单 - 现代设计风格 */
.user-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 20px 25px -5px rgba(0, 0, 0, 0.1);
    width: 320px;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px) scale(0.98);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.user-section:hover .user-menu,
.user-menu:hover,
.user-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* 菜单顶部 - 用户名和关闭按钮 */
.user-menu-top {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-menu-email {
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

.user-menu-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: background 0.2s ease;
}

.user-menu-close:hover {
    background: #f1f5f9;
}

/* 用户信息区域 - 符合 learning-overview-card 规范 */
.user-menu-profile {
    padding: 24px;
    text-align: center;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.user-menu-avatar-large {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 32px;
    margin: 0 auto 20px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.user-menu-avatar-large:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}

.user-menu-avatar-camera {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 28px;
    height: 28px;
    background: #1e293b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.user-menu-avatar-camera:hover {
    background: #0f172a;
    transform: scale(1.1);
}

.user-menu-greeting {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 16px 0;
    letter-spacing: -0.01em;
}

.user-menu-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    background: #0056d3;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 86, 211, 0.2);
}

.user-menu-primary-btn:hover {
    background: #0045a8;
    box-shadow: 0 4px 8px rgba(0, 86, 211, 0.3);
    transform: translateY(-1px);
}

.user-menu-primary-btn:active {
    transform: translateY(0);
}

/* 学校切换区域 - 符合 learning-overview-card 规范 */
.user-menu-schools {
    padding: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: #ffffff;
}

.user-menu-schools-title {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-menu-schools-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-menu-school-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid transparent;
    background: #f8fafc;
}

.user-menu-school-item:hover {
    background: #f1f5f9;
    border-color: rgba(0, 86, 211, 0.2);
    transform: translateX(2px);
}

.user-menu-school-item.active {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #0056d3;
    box-shadow: 0 2px 8px rgba(0, 86, 211, 0.15);
}

.user-menu-school-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.user-menu-school-item:hover .user-menu-school-avatar {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transform: scale(1.05);
}

.user-menu-school-item.active .user-menu-school-avatar {
    border-color: #0056d3;
    box-shadow: 0 2px 8px rgba(0, 86, 211, 0.2);
}

.user-menu-school-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.user-menu-school-avatar-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.user-menu-school-info {
    flex: 1;
    min-width: 0;
}

.user-menu-school-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 3px 0;
    letter-spacing: -0.01em;
}

.user-menu-school-role {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    font-weight: 400;
}

.user-menu-school-check {
    width: 20px;
    height: 20px;
    color: #0056d3;
    flex-shrink: 0;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(0.8);
}

.user-menu-school-item.active .user-menu-school-check {
    opacity: 1;
    transform: scale(1);
}

/* 菜单项列表 - 符合 learning-overview-card 规范 */
.user-menu-items {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #ffffff;
}

/* 账号设置和帮助按钮容器 - 一行显示 */
.user-menu-items-row {
    display: flex;
    gap: 12px;
}

.user-menu-items-row .user-menu-item {
    flex: 1;
}

.user-menu-item {
    width: 100%;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #1B4F8C;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    text-decoration: none;
    gap: 8px;
}

.user-menu-item:hover {
    background: #1B4F8C;
    color: white;
}

.user-menu-item:hover .user-menu-item-icon {
    color: white;
}

.user-menu-item-icon {
    width: 18px;
    height: 18px;
    color: #1B4F8C;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.user-menu-item-text {
    flex: 1;
    font-weight: 500;
}

.user-menu-item-action {
    font-size: 12px;
    color: #94a3b8;
}

/* 退出登录 - 特殊样式 */
.user-menu-item.logout {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.user-menu-item.logout:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.user-menu-item.logout .user-menu-item-icon {
    color: #dc2626;
}

.user-menu-item.logout:hover .user-menu-item-icon {
    color: white;
}

/* 主页容器布局 */
.homepage-container {
    max-width: 1400px; /* 优化：适应现代宽屏，提升空间利用率 */
    margin: 0 auto;
    padding: 40px; /* 与 course-home 内边距一致 */
    padding-top: 150px; /* 为固定顶栏留出空间（72px顶栏 + 约50px tabs + 28px合理间距） */
    display: -webkit-grid; /* Safari 兼容 */
    display: grid;
    -webkit-grid-template-columns: 1fr 320px; /* Safari 兼容 */
    grid-template-columns: 1fr 320px;
    -webkit-column-gap: 32px; /* Safari 兼容 */
    column-gap: 32px;
    -webkit-row-gap: 32px; /* Safari 兼容 */
    row-gap: 32px;
    gap: 32px;
    align-items: start;
}

/* 左侧主内容区 */
.main-content {
    min-width: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 28px; /* 统一为 28px，与待批改作业标题一致 */
    font-weight: 700;
    color: #1e293b; /* 统一颜色，与待批改作业标题一致 */
}

/* 进行中实践、建设中的课程 - 标题上方合理间距 */
.recommended-courses-section {
    margin-top: 40px;
}

/* 当待批改作业和进行中实践隐藏时，建设中的课程与右侧卡片顶对齐 */
#building-courses.align-with-sidebar {
    margin-top: 6px !important;
}

.view-more {
    background: none;
    border: none;
    color: #1B4F8C;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.view-more:hover {
    background: #f1f5f9;
}

/* 顶栏自适应优化：先隐藏搜索框，再隐藏标题文字（不改字号） */
@media (max-width: 900px) {
    .header-content .search-section { display: none; }
    .header-content { justify-content: space-between; }
}

@media (max-width: 520px) {
    .header-content .platform-name { display: none; }
}

/* 继续学习卡片 */
/* 继续学习区域头部 */
.continue-learning-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    width: calc(100% + 320px + 32px); /* 延伸到包含右侧边栏的宽度 (320px边栏 + 32px间距) */
    position: relative;
}

.continue-learning-section h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.btn-view-all-header {
    background: none;
    color: #0056d3;
    border: 1px solid #0056d3;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-view-all-header:hover {
    background: #0056d3;
    color: white;
}

/* 简化的学习卡片样式 - 参考Coursera */
.learning-card.large {
    background: #fff;
    border-radius: 8px; /* 与 course-home 卡片圆角一致 */
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    border: 1px solid #e0e0e0; /* 与 course-home 边框一致 */
    padding: 24px;
    margin-bottom: 20px; /* 统一为 20px，与 my-learning 页面保持一致 */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.learning-card.large:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
}

/* 课程头部（图标 + 标题） */
.course-header-new {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.course-logo {
    flex-shrink: 0;
}

.course-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.course-title-section {
    flex: 1;
}

.course-title-section h3 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    line-height: 1.3;
}

.course-card-subtitle {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

/* 简化的进度条部分 */
.course-progress-section {
    margin-bottom: 24px;
}

.progress-text-simple {
    font-size: 14px;
    color: #666; /* 与 course-home 次级文字一致 */
    margin-bottom: 8px;
    font-weight: 500;
}

.progress-bar-simple {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill-simple {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    transition: width 0.6s ease;
    border-radius: 4px;
}

/* 当前任务部分 */
.current-task-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.task-info {
    flex: 1;
}

.task-title {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.task-detail {
    margin: 0;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-continue-simple {
    background: #0056d3; /* 与 course-home 主按钮接近 */
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 16px;
}

.btn-continue-simple:hover {
    background: #0047b3;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 86, 211, 0.3);
}




.btn-view-all {
    background: none;
    color: #1B4F8C;
    border: 2px solid #1B4F8C;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-view-all:hover {
    background: #1B4F8C;
    color: white;
}

/* 课程网格 - 优化大屏显示 */
.course-grid {
    display: -webkit-grid; /* Safari 兼容 */
    display: grid;
    -webkit-grid-template-columns: repeat(2, 1fr); /* Safari 兼容 */
    grid-template-columns: repeat(2, 1fr); /* 桌面端固定两列 */
    -webkit-column-gap: 20px; /* Safari 兼容 */
    column-gap: 20px;
    -webkit-row-gap: 20px; /* Safari 兼容 */
    row-gap: 20px;
    gap: 20px;
    margin-bottom: 40px;
}

/* 超大屏幕优化 - 三列布局 */
@media (min-width: 1600px) {
    .course-grid {
        grid-template-columns: repeat(3, 1fr); /* 超大屏幕三列 */
        gap: 24px;
    }
}

.course-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e6e6e6; /* 与 course-home 一致 */
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
}

.course-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.course-card:hover .course-card-image {
    transform: scale(1.05);
}

.course-card-content {
    padding: 20px;
}

/* 语音语料项目：带图标的标题区域 */
.course-card-header-with-icon {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.corpus-type-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.course-card-text {
    flex: 1;
    min-width: 0;
}

.course-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
}

.course-card-subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 0;
    line-height: 1.4;
}

.course-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.meta-item {
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
}

.course-card-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}

.students-count {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* 右侧边栏样式 - 优化版 */
.sidebar {
    width: 320px;
    margin-top: 68px;
    display: -webkit-flex; /* Safari 兼容 */
    display: flex;
    -webkit-flex-direction: column; /* Safari 兼容 */
    flex-direction: column;
    position: -webkit-sticky; /* Safari 兼容 */
    position: sticky; /* 滚动到顶部后固定 */
    top: calc(72px + 56px + 16px); /* 顶栏72px + Tabs约56px + 额外16px缓冲，避免干涉 */
    -webkit-align-self: start; /* Safari 兼容 */
    align-self: start; /* 与网格顶部对齐，确保sticky生效 */
    max-height: calc(100vh - 120px); /* 视口内可滚动 */
    overflow: auto;
    /* Safari 兼容：使用 margin 替代 gap */
}
.sidebar > * + * {
    margin-top: 20px; /* 替代 gap: 20px */
}

/* 侧边栏中的 lesson-plan-actions-card 使用 margin 控制间距（Safari 兼容） */
.sidebar .lesson-plan-actions-card {
    margin-top: 0; /* 移除 margin-top，由父容器的 margin-top 统一控制间距 */
}

/* 学习概览卡片 */
.learning-overview-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    border: 1px solid #e0e0e0;
}

.learning-overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
}

.overview-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.user-avatar-large {
    width: 56px;
    height: 56px;
    background: #22c55e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    margin-right: 16px;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.overview-text h3 {
    margin: 0 0 4px 0;
    font-size: 20px;
    color: #1e293b;
    font-weight: 600;
}

.overview-text .subtitle {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

.learning-stats {
    display: -webkit-grid; /* Safari 兼容 */
    display: grid;
    -webkit-grid-template-columns: 1fr 1fr; /* Safari 兼容 */
    grid-template-columns: 1fr 1fr;
    -webkit-column-gap: 16px; /* Safari 兼容 */
    column-gap: 16px;
    -webkit-row-gap: 16px; /* Safari 兼容 */
    row-gap: 16px;
    gap: 16px;
}

.stat-item {
    display: -webkit-flex; /* Safari 兼容 */
    display: flex;
    -webkit-flex-direction: column; /* Safari 兼容 */
    flex-direction: column;
    -webkit-align-items: center; /* Safari 兼容 */
    align-items: center;
    -webkit-justify-content: center; /* Safari 兼容 */
    justify-content: center;
    text-align: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #1B4F8C;
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    line-height: 1.4;
}

/* 教师主页 - 1:1 复用作业页 activity-item 样式 */
.activity-group {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 8px;
}

.activity-title {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
}

.activity-title.pre-class {
    background: #dbeafe;
    color: #1e40af;
}

.activity-title.in-class {
    background: #dcfce7;
    color: #166534;
}

.activity-title.post-class {
    background: #fef3c7;
    color: #92400e;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    position: relative;
    cursor: pointer;
    margin-bottom: 8px;
    height: 44px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.activity-item.urgent {
    border-left: 3px solid #f59e0b;
    background: linear-gradient(90deg, #fffbeb 0%, #ffffff 8%);
}

.activity-item.overdue {
    border-left: 3px solid #ef4444;
    background: linear-gradient(90deg, #fef2f2 0%, #ffffff 8%);
}

.activity-item.material {
    cursor: default;
    height: 44px;
    overflow: hidden;
}

.activity-type {
    background: #1B4F8C;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.activity-content {
    flex: 1;
    color: #374151;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.class-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.class-progress {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    margin-right: 8px;
    flex-direction: row-reverse;
}

.progress-mini {
    width: 56px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.progress-mini .fill {
    display: block;
    height: 100%;
    background: #1B4F8C;
    width: 0%;
    transition: width .2s ease;
}

.pending-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #fde68a;
    transition: all 0.2s ease;
}

.pending-badge.highlight {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    border-color: #fca5a5;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.2);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 批阅按钮（与作业详情页保持一致的视觉） */
.activity-btn {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid #d0d7e1;
    background: #ffffff;
    color: #0f172a;
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}

.activity-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(16, 24, 40, .1);
}

.activity-btn:active {
    transform: translateY(0);
}

.activity-btn.primary {
    background: linear-gradient(180deg, #1e60a8, #1B4F8C);
    color: #fff;
    border-color: #1B4F8C;
    box-shadow: 0 2px 4px rgba(27, 79, 140, 0.2);
}

.activity-btn.primary:hover {
    background: linear-gradient(180deg, #2170c2, #1e60a8);
    box-shadow: 0 3px 6px rgba(27, 79, 140, 0.3);
}

/* 教师首页作业矩阵布局：行=教学班，左列=未截止，右列=截止一周内 */
.assignments-matrix {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.assignments-row {
    padding-top: 8px;
    margin-top: 8px;
}

/* 教师首页：待批改作业区域视觉简化 */
.page-teacher .continue-learning-section #pendingAssignmentsList {
    margin-top: 16px;
}

.page-teacher .continue-learning-section .class-card.learning-card.large {
    border: none;                 /* 去掉外层卡片边框 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    padding: 20px 24px;
    margin-bottom: 20px;          /* 统一为 20px，与其他卡片间距一致 */
}

.page-teacher .continue-learning-section .class-card:last-child {
    margin-bottom: 0;
}

.page-teacher .continue-learning-section .class-card .current-task-section {
    background: transparent;      /* 取消内层灰底 */
    border: none;                 /* 去掉内层边框，避免层级过多 */
    padding: 0;
}

.page-teacher .continue-learning-section .class-card .course-header-with-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.page-teacher .continue-learning-section .class-card .task-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.course-pending-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #fecaca;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.1);
}

.page-teacher .continue-learning-section .class-card .activity-group {
    background: transparent;      /* 列里的 group 只做间距，不再加一层块状背景 */
    padding: 0;
    margin-bottom: 0;
}

/* 顶部统一的未截止 / 截止一周内列标题 */
.assignments-status-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
    margin-bottom: 12px;
    padding: 0 2px;
}

.assignments-status-header .status-col-label {
    text-align: left;
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    color: #0369a1;
    border: 1px solid #bae6fd;
    box-shadow: 0 1px 3px rgba(14, 165, 233, 0.1);
}

.assignments-status-header .status-col-label:last-child {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    color: #a16207;
    border-color: #fde047;
    box-shadow: 0 1px 3px rgba(250, 204, 21, 0.1);
}

@media (max-width: 768px) {
    .assignments-status-header {
        grid-template-columns: 1fr;
        row-gap: 4px;
    }
}

.assignments-row:first-child {
    border-top: none;
}

.assignments-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
    padding: 8px 0;
}

.assignments-row-header .class-name {
    color: #1e293b;
    font-weight: 600;
}

.class-pending-count {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #f8fafc;
    color: #64748b;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

.assignments-row-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.assignments-col {
    min-width: 0;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px dashed #e2e8f0;
    min-height: 60px;
    gap: 8px;
}

.empty-state .empty-icon {
    font-size: 20px;
    color: #cbd5e1;
    line-height: 1;
}

.empty-state span:not(.empty-icon) {
    color: #94a3b8;
}

@media (max-width: 768px) {
    .assignments-row-body {
        grid-template-columns: 1fr;
    }
}



/* 最新通知卡片 */
.notifications-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    border: 1px solid #e0e0e0;
}

.notifications-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
}

.notifications-card h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.notification-list {
    margin-bottom: 16px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.notification-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.notification-dot {
    width: 8px;
    height: 8px;
    background: #3b82f6; /* 默认信息蓝 */
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

/* 通知类型颜色语义化 */
.notification-dot.info { background: #3b82f6; }    /* 信息/已发布：蓝 */
.notification-dot.success { background: #22c55e; } /* 成功/已完成：绿 */
.notification-dot.warning { background: #f59e0b; } /* 截止提醒/警示：橙 */
.notification-dot.error { background: #ef4444; }   /* 失败/异常：红 */

.notification-content {
    flex: 1;
}

.notification-title {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.4;
}

.notification-time {
    font-size: 12px;
    color: #64748b;
}

.view-all-notifications {
    width: 100%;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #1B4F8C;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-all-notifications:hover {
    background: #1B4F8C;
    color: white;
}



/* 响应式设计 */
@media (max-width: 1024px) {
    .homepage-container {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 24px 16px;
    }
    
    .sidebar {
        width: 100%;
        order: -1;
        margin-top: 0;
        gap: 16px; /* 移动端减少间距 */
        position: static; /* 移动端关闭吸顶行为 */
        top: auto;
        max-height: none;
        overflow: visible;
    }
    
    /* 移动端右侧边栏调整 */
    .learning-stats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .header-content {
        max-width: 1400px; /* 保持与内容区域等宽 */
        margin: 0 auto; /* 居中显示 */
        padding: 0 16px;
        flex-wrap: nowrap; /* 关键：不换行，保持单行 */
        height: 72px;      /* 固定高度，垂直居中 */
        min-height: 72px;
        align-items: center; /* 垂直居中 */
    }
    
    .main-nav {
        order: 3;
        width: 100%;
        justify-content: space-around;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid #e2e8f0;
    }
    
    .search-section {
        margin: 0 0 0 24px;  /* 与标题右侧保持一致 */
        max-width: none;
        order: 2;
        width: 420px;       /* 中宽屏固定宽，避免断行 */
        flex: 0 0 420px;
    }
}

@media (max-width: 768px) {
    .learning-card.large {
        padding: 20px;
    }
    
    .course-header-new {
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .course-icon {
        width: 40px;
        height: 40px;
    }
    
    .course-title-section h3 {
        font-size: 18px;
    }
    
    .current-task-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px;
    }
    
    .btn-continue-simple {
        width: 100%;
        margin-left: 0;
        padding: 14px;
    }
    
    .continue-learning-section .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        width: 100%; /* 移动端恢复正常宽度 */
    }
    
    .btn-view-all-header {
        align-self: stretch;
        text-align: center;
    }
    
    .course-grid {
        grid-template-columns: 1fr; /* 移动端单列 */
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1B4F8C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* 成功状态提示 */
.success-indicator {
    background: #22c55e;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ============================================
   教师首页：简化版作业列表（极简设计）
   ============================================ */

/* 简化版课程卡片 */
.simple-course-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    border: 1px solid #e0e0e0;
    padding: 20px;
    margin-bottom: 20px; /* 统一为 20px，与 course grid 对齐 */
}

.simple-course-card:last-child {
    margin-bottom: 0;
}

.simple-course-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

/* 教学班横向布局容器 */
.simple-course-card .classes-container-horizontal {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* 教学班卡片（横向排列）- 一行2个，右边不留margin */
.simple-course-card .class-card-horizontal {
    flex: 0 0 calc(50% - 8px);
    width: calc(50% - 8px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
}

.simple-course-card .class-card-horizontal:nth-child(2n) {
    margin-right: 0;
}

.simple-class-name {
    font-size: 15px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 4px;
}

/* 作业纵向列表（使用参考页面的 activity-item） */
.activity-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-list-vertical .activity-item {
    margin-bottom: 8px;
}

/* 学生端：作业横向列表（一行2个并排） */
.activity-list-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.activity-list-horizontal .activity-item {
    flex: 0 0 calc(50% - 4px);
    margin-bottom: 8px;
}

.empty-message {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}
