/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

/* 顶部搜索栏 */
.header {
    background-color: #2c5aa0;
    padding: 10px 15px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    width: 30px;
    height: 30px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-weight: bold;
    color: #2c5aa0;
    font-size: 16px;
}

.site-name {
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.search-bar {
    background-color: white;
    border-radius: 20px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
}

.search-icon {
    color: #999;
    margin-right: 8px;
    font-size: 16px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
}

/* 页面内容 */
.content {
    margin-top: 60px;
    padding-bottom: 60px;
}

/* 轮播图 */
.banner {
    position: relative;
    overflow: hidden;
}

.banner-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.banner-indicators {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.banner-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
}

.banner-indicator.active {
    background-color: white;
    width: 20px;
    border-radius: 3px;
}

/* 分类导航 */
.category-nav {
    background-color: white;
    padding: 15px 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px;
}

.category-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e8f0fe;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    font-size: 20px;
    color: #2c5aa0;
}

.category-name {
    font-size: 12px;
    color: #333;
}

/* 课程卡片样式 */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f5f5f5;
}

.section-title h3 {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.more-link {
    font-size: 14px;
    color: #999;
}

.course-list {
    background-color: white;
    padding: 15px;
}

.course-card {
    margin-bottom: 15px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

.course-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.course-info {
    padding: 10px;
}

.course-title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.course-stats {
    font-size: 12px;
    color: #999;
}

.course-price {
    font-size: 16px;
    font-weight: bold;
    color: #ff4d4f;
}

/* 水平课程列表 */
.horizontal-course-list {
    background-color: white;
    padding: 15px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.horizontal-course-list::-webkit-scrollbar {
    display: none;
}

.horizontal-courses {
    display: flex;
    padding: 0 15px;
    gap: 12px;
}

.horizontal-course-card {
    flex-shrink: 0;
    width: 140px;
}

.horizontal-course-image {
    width: 100%;
    height: 90px;
    border-radius: 6px;
    object-fit: cover;
    margin-bottom: 8px;
}

.horizontal-course-title {
    font-size: 13px;
    color: #333;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.horizontal-course-price {
    font-size: 15px;
    font-weight: bold;
    color: #ff4d4f;
}

/* 客服信息 */
.customer-service {
    background-color: white;
    margin: 10px 0;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

.cs-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f0f8ff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 18px;
    color: #2c5aa0;
}

.cs-info h4 {
    font-size: 15px;
    color: #333;
    margin-bottom: 3px;
}

.cs-phone {
    font-size: 14px;
    color: #666;
}

.cs-button {
    padding: 6px 12px;
    background-color: #2c5aa0;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background-color: white;
    display: flex;
    border-top: 1px solid #f0f0f0;
    z-index: 999;
}

/* 页脚样式 */
.footer {
    background-color: #f8f8f8;
    padding: 20px 15px;
    text-align: center;
    margin-top: 30px;
    padding-bottom: 70px;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    margin: 0 10px;
    font-size: 14px;
    margin-bottom: 10px;
}

.footer-copyright {
    color: #999;
    font-size: 12px;
    line-height: 1.6;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
}

.nav-item.active {
    color: #2c5aa0;
}

.nav-icon {
    font-size: 18px;
    margin-bottom: 2px;
}

.nav-text {
    font-size: 12px;
}

/* 点击反馈效果 */
.search-bar,
.banner,
.category-item,
.course-card,
.horizontal-course-card,
.cs-button,
.nav-item {
    -webkit-tap-highlight-color: transparent;
}

.search-bar:active,
.banner:active,
.category-item:active,
.course-card:active,
.horizontal-course-card:active,
.cs-button:active,
.nav-item:active {
    opacity: 0.7;
}

/* 页面淡入动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.content {
    animation: fadeIn 0.3s ease-out;
}


/* 底部导航栏 */
.nav-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background-color: white;
    display: flex;
    border-top: 1px solid #f0f0f0;
    z-index: 999;
}

    .nav-bottom a {
        text-decoration: none;
        color: inherit;
    }

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

    .nav-item.active {
        color: #2c5aa0;
    }

.nav-icon {
    font-size: 18px;
    margin-bottom: 2px;
}

.nav-text {
    font-size: 12px;
}