/* 基本重置和全局设置 */
:root {
    --primary-color: #72C3FC; /* 柔和蓝 */
    --secondary-color: #A1EAA7; /* 清新绿 */
    --accent-color: #F5B041; /* 活泼橙 */
    --text-color: #333333;
    --text-light: #555555;
    --bg-light: #f9f9f9;
    --bg-light-alt: #eef7ff; /* 浅蓝背景 */
    --bg-white: #ffffff;
    --border-color: #dddddd;
    --font-family: 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    background-color: var(--bg-white);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

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

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.8em;
    color: var(--text-color);
    font-weight: 600;
}
h1 { font-size: 2.5em; }
h2 { font-size: 2em; }
h3 { font-size: 1.5em; }

.page-padding {
    padding-top: 30px;
    padding-bottom: 30px;
}

/* 头部导航 */
header {
    background-color: var(--bg-white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}
header nav.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}
.logo img {
    height: 40px;
    margin-right: 10px;
}
header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}
header nav ul li a {
    padding: 10px 15px;
    color: var(--text-light);
    font-weight: 500;
}
header nav ul li a.active,
header nav ul li a:hover {
    color: var(--primary-color);
    font-weight: bold;
}
.auth-buttons .btn {
    margin-left: 10px;
}
#mobile-menu-toggle {
    display: none; /* 默认隐藏，在小屏幕上显示 */
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--primary-color);
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.btn-primary {
    background-color: var(--primary-color);
    color: var(--bg-white);
}
.btn-primary:hover {
    background-color: #5aa9e0; /* 略深的主色 */
    color: var(--bg-white);
    text-decoration: none;
}
.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
}
.btn-secondary:hover {
    background-color: #88d88c; /* 略深的辅助色 */
    color: var(--text-color);
    text-decoration: none;
}
.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}
.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--bg-white);
    text-decoration: none;
}
.btn-large {
    padding: 15px 30px;
    font-size: 1.1em;
}

/* 首页 Hero Section */
.hero {
    background: url('../images/hero-banner.jpg') no-repeat center center/cover; /* 替换为实际图片 */
    background-color: var(--primary-color); /* 图片加载失败时的备用背景 */
    color: var(--bg-white);
    padding: 80px 0;
    text-align: center;
    min-height: 200px; /* 确保有一定高度 */
}
.hero h1 {
    color: var(--bg-white);
    margin-bottom: 20px;
    font-size: 3em;
}
.hero p {
    font-size: 1.2em;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* 课程卡片 */
.section-icon {
    height: 30px;
    width: 30px;
    margin-right: 10px;
    vertical-align: middle;
}
.featured-courses, .knowledge-intro, .community-promo {
    padding: 50px 0;
}
.community-promo {
    background-color: var(--bg-light-alt);
    text-align: center;
}
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 30px;
}
.course-card {
    background-color: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.course-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.course-card h3 {
    font-size: 1.3em;
    margin: 15px;
    color: var(--primary-color);
}
.course-card p {
    margin: 0 15px 15px;
    flex-grow: 1; /* 使内容区域填充剩余空间 */
    color: var(--text-light);
    font-size: 0.95em;
}
.course-card .btn {
    margin: 0 15px 15px;
    align-self: flex-start; /* 按钮靠左 */
}
.course-meta {
    font-size: 0.85em;
    color: #777;
    margin: 10px 15px;
}
.text-center { text-align: center; margin-top: 20px; }


/* 社区推广 */
.community-highlights {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    gap: 20px;
}
.highlight-item {
    background-color: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    flex-basis: 45%; /* 调整宽度 */
}
.highlight-item h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* 页头 (通用) */
.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.page-header h1 { color: var(--primary-color); }

/* 过滤器 */
.filters { margin-bottom: 30px; }
.filters span { font-weight: bold; margin-right: 10px; }
.filter-btn {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    margin-right: 5px;
    border-radius: 20px;
    cursor: pointer;
}
.filter-btn.active, .filter-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 课程详情页 */
.course-detail .course-header { margin-bottom: 30px; }
.course-detail .course-main-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 20px;
}
.course-meta-bar {
    font-size: 0.9em;
    color: var(--text-light);
    margin-top: -10px;
    margin-bottom: 20px;
}
.lesson-list { list-style: none; padding-left: 0; }
.lesson-list li details {
    background: var(--bg-light);
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 5px;
}
.lesson-list li details summary {
    font-weight: bold;
    cursor: pointer;
}
.lesson-list li details ul {
    list-style-type: disc;
    padding-left: 30px;
    margin-top: 10px;
}

/* 社区页面 */
.forum-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.forum-section {
    background-color: var(--bg-light-alt);
    padding: 20px;
    border-radius: 8px;
}
.forum-section h3 a { color: var(--primary-color); }
.forum-section p { font-size: 0.9em; color: var(--text-light); }

.post-list { list-style: none; padding: 0; }
.post-item {
    display: flex;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}
.post-item:last-child { border-bottom: none; }
.post-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}
.post-summary h4 { margin-bottom: 5px; }
.post-summary h4 a { color: var(--text-color); font-size: 1.1em; }
.post-summary h4 a:hover { color: var(--primary-color); }
.post-summary p { font-size: 0.85em; color: #777; margin: 0; }
.post-summary p span { margin-right: 5px; }

/* 知识库文章 */
.knowledge-article .article-meta {
    font-size: 0.9em;
    color: var(--text-light);
    margin-bottom: 20px;
}
.knowledge-article .article-image {
    margin: 20px auto;
    border-radius: 8px;
    max-height: 350px;
}
.article-navigation {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}


/* 页脚 */
footer {
    background-color: #333;
    color: #ccc;
    padding: 30px 0;
    text-align: center;
    font-size: 0.9em;
}
footer p { margin: 5px 0; }
footer a { color: var(--primary-color); }
footer a:hover { color: var(--bg-white); }

/* 响应式设计 - 移动端导航 */
@media (max-width: 768px) {
    header nav.container {
        flex-wrap: wrap; /* 允许换行 */
    }
    header nav ul {
        display: none; /* 默认隐藏菜单项 */
        flex-direction: column;
        width: 100%;
        background-color: var(--bg-white);
        position: absolute;
        top: 70px; /* 根据header高度调整 */
        left: 0;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    header nav ul.active { /* JS会添加这个class来显示 */
        display: flex;
    }
    header nav ul li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }
    header nav ul li:last-child {
        border-bottom: none;
    }
    header nav ul li a {
        display: block;
        padding: 15px;
    }
    .auth-buttons {
        display: none; /* 在小屏幕上可以先隐藏登录注册，或者整合进菜单 */
        /* 如果要显示，可以考虑让他们换行:
        width: 100%;
        margin-top: 10px;
        justify-content: center;
        */
    }
    #mobile-menu-toggle {
        display: block; /* 显示汉堡菜单按钮 */
        order: 3; /* 将按钮放在右侧，如果logo在左，菜单项在中间 */
    }
    .logo {
        /* 调整logo占位，确保汉堡菜单有空间 */
    }
    .hero h1 { font-size: 2em; }
    .hero p { font-size: 1em; }

    .course-grid {
        grid-template-columns: 1fr; /* 移动端单列显示 */
    }
    .community-highlights {
        flex-direction: column;
    }
}