/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding-top: 70px;
    transition: padding-top 0.3s ease-in-out;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-more {
    margin-top: 30px;
}

/* ==================== 头部样式 ==================== */
/* 顶部搜索区域 - 始终显示 */
.header-top {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    right: 0;
    z-index: 1001;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-top .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.brand-url {
    font-size: 12px;
    color: #999;
}

/* 搜索框 */
.header-center {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
}

.search-form {
    display: flex;
    position: relative;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px 0 0 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #667eea;
}

.search-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.3s;
}

.search-btn:hover {
    opacity: 0.9;
}

/* 登录注册 */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-btn,
.register-btn {
    color: #667eea;
    font-size: 14px;
    transition: color 0.3s;
}

.login-btn:hover,
.register-btn:hover {
    color: #764ba2;
}

.separator {
    color: #ddd;
}

/* ==================== 导航栏样式 ==================== */
/* 下部导航栏 - 可以隐藏 */
.header-bottom {
    position: fixed !important;
    top: 70px !important;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease-in-out;
}

.header-bottom.hidden {
    transform: translateY(-100%);
}

.header-bottom.visible {
    transform: translateY(0);
}

/* 顶部触发区域 */
.top-trigger {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    z-index: 999;
    pointer-events: none;
}

/* 主导航 */
.main-nav {
    padding: 15px 0;
    background: #f5f5f5;
}

.main-nav ul {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-item {
    position: relative;
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
    min-width: 200px;
}

.nav-item:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.nav-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 6px;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
}

.nav-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.nav-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nav-links a {
    font-size: 12px;
    color: #666;
    text-decoration: none;
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    transition: all 0.3s;
}

.nav-links a:hover {
    background: #667eea;
    color: #fff;
}

/* ==================== 轮播图样式 ==================== */
.hero-section {
    background: #fff;
    padding: 20px 0;
}

.hero-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* 轮播图容器 */
.carousel-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.carousel-wrapper {
    position: relative;
    height: 350px;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 轮播指示器 */
.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.indicator.active {
    background: #fff;
    width: 24px;
    border-radius: 5px;
}

/* 轮播控制按钮 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.8);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

/* 登录信息区域 */
.login-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.login-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: #fff;
    margin-bottom: 20px;
    cursor: pointer;
}

.hot-courses h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #333;
}

.hot-courses ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hot-courses li a {
    font-size: 14px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s;
}

.hot-courses li a:hover {
    color: #667eea;
}

/* ==================== 关于我们样式 ==================== */
.about {
    padding: 60px 0;
    background: #fff;
}

.about h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 30px;
    color: #333;
}

.about > .container > p {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
    color: #666;
    line-height: 1.8;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.feature {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.feature h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
}

.feature p {
    color: #666;
    font-size: 14px;
}

/* ==================== 课程样式 ==================== */
/* 推荐课程区域 */
.recommended-courses,
.featured-courses {
    padding: 60px 0;
}

.recommended-courses {
    background: #f8f9fa;
}

.featured-courses {
    background: #fff;
}

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

.section-header h2 {
    font-size: 28px;
    color: #333;
}

.view-all {
    color: #667eea;
    font-size: 14px;
    transition: color 0.3s;
}

.view-all:hover {
    color: #764ba2;
}

/* 课程分类 */
.course-categories {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.category {
    padding: 8px 20px;
    background: #fff;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
    border: 1px solid #e0e0e0;
}

.category:hover,
.category.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
}

/* 课程标签页 */
.course-tabs {
    display: flex;
    gap: 10px;
}

.course-tabs button {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.course-tabs button:hover,
.course-tabs button.tab-active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
}

/* 课程网格 */
.course-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* 课程卡片链接 */
.course-card-link {
    display: block;
    text-decoration: none;
}

/* 课程卡片 */
.course-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.course-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    background: #f0f0f0;
}

.course-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.course-info {
    padding: 15px;
}

.course-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.course-source {
    color: #667eea;
    font-weight: 500;
}

.course-students {
    color: #999;
}

.course-students::before {
    content: "👥 ";
}

/* 无课程提示 */
.no-courses {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* ==================== 课程列表页面新样式 ==================== */
.courses-page {
    padding: 40px 0;
    background-color: #f5f5f5;
    min-height: calc(100vh - 200px);
}

.courses-page h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 32px;
    color: #333;
}

/* 筛选栏样式 */
.filter-section {
    background: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.filter-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.filter-row:last-child {
    border-bottom: none;
}

.filter-label {
    width: 80px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    flex-shrink: 0;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}

.filter-option {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    background: transparent;
}

.filter-option:hover {
    color: #1890ff;
    background: #e6f7ff;
}

.filter-option.active {
    color: #1890ff;
    background: #e6f7ff;
    font-weight: 500;
}

/* 课程网格布局 - 课程列表页面 */
.courses-page .course-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* 课程卡片样式 - 课程列表页面 */
.courses-page .course-card {
    text-decoration: none;
    display: block;
}

.course-tag {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.course-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4d4f;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.course-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
}

.course-university {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.course-instructor {
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
}

.courses-page .course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #52c41a;
}

.course-progress {
    display: flex;
    align-items: center;
    gap: 4px;
}

.course-progress::before {
    content: "⏱";
    font-size: 12px;
}

.icon-clock {
    font-style: normal;
}

.icon-clock::before {
    content: "⏱";
}

/* ==================== 教师样式 ==================== */
.teachers {
    padding: 60px 0;
    background: #f8f9fa;
    text-align: center;
}

.teachers h2 {
    font-size: 32px;
    margin-bottom: 40px;
    color: #333;
}

.teacher-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.teacher-item {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.teacher-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.teacher-item img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 20px;
}

.teacher-item h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #333;
}

.teacher-item .position {
    color: #667eea;
    font-size: 14px;
    margin-bottom: 15px;
}

.teacher-item p:last-child {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* ==================== 新闻样式 ==================== */
.news {
    padding: 60px 0;
    background: #fff;
    text-align: center;
}

.news h2 {
    font-size: 32px;
    margin-bottom: 40px;
    color: #333;
}

.news-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.news-item {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
    text-align: left;
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.news-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.news-item h3 {
    font-size: 18px;
    padding: 20px 20px 10px;
    color: #333;
    line-height: 1.4;
}

.news-item p {
    padding: 0 20px;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.news-item .btn {
    margin: 0 20px 20px;
}

/* ==================== 底部样式 ==================== */
footer {
    background: #2c3e50;
    color: #fff;
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-info h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.footer-info p {
    color: #bdc3c7;
    line-height: 1.8;
}

.footer-links h4,
.footer-contact h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #fff;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: #bdc3c7;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #667eea;
}

.footer-contact p {
    color: #bdc3c7;
    margin-bottom: 10px;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 30px;
    text-align: center;
}

.footer-bottom p {
    color: #95a5a6;
    font-size: 14px;
    margin-bottom: 5px;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1400px) {
    .courses-page .course-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .hero-content {
        grid-template-columns: 1fr;
    }
    
    .login-section {
        display: none;
    }
}

@media (max-width: 1100px) {
    .courses-page .course-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .about-features {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .teacher-list,
    .news-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
    
    .header-top .container {
        flex-wrap: wrap;
        padding: 10px;
    }
    
    .header-center {
        order: 3;
        width: 100%;
        margin: 10px 0 0;
        max-width: none;
    }
    
    .header-bottom {
        top: 110px !important;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
    }
    
    .nav-item {
        padding: 10px 15px;
    }
    
    .carousel-wrapper {
        height: 250px;
    }
    
    .about-features,
    .teacher-list,
    .news-list {
        grid-template-columns: 1fr;
    }
    
    .course-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .courses-page .course-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .course-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* 课程列表页面筛选栏响应式 */
    .filter-section {
        padding: 15px 20px;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .filter-label {
        width: auto;
    }
    
    .filter-options {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .course-grid {
        grid-template-columns: 1fr;
    }
    
    .courses-page .course-grid {
        grid-template-columns: 1fr;
    }
    
    .carousel-wrapper {
        height: 200px;
    }
    
    .carousel-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .about h2,
    .teachers h2,
    .news h2,
    .courses-page h2 {
        font-size: 24px;
    }
}
