
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    font-size: 0.9375rem;
}

/* 响应式字体大小 */
html {
    font-size: 0.9375rem;
}
@media (max-width: 375px) {
    html { font-size: 0.9375rem; }
}
@media (max-width: 320px) {
    html { font-size: 0.9375rem; }
}

/* 顶部导航栏 - 核心优化 */
.top-nav-wrapper {
    position: relative;
    overflow: hidden; /* 隐藏滚动条 */
    background-color: #fff;
    border-bottom: 1px solid #eee;
}
.top-nav {
    display: flex;
    padding: 0 0.9375rem; /* 15px */
    -webkit-overflow-scrolling: touch; /* iOS 滚动流畅 */
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none; /* 隐藏Firefox滚动条 */
    white-space: nowrap;
}
/* 隐藏Chrome/Safari滚动条 */
.top-nav::-webkit-scrollbar {
    display: none;
}
.top-nav-item {
    padding: 0.9375rem 0.75rem; /* 15px 12px */
    font-size: 1rem; /* 15px */
    color: #333;
    text-decoration: none;
    position: relative;
    flex-shrink: 0; /* 防止被压缩 */
    -webkit-tap-highlight-color: transparent; /* 移除点击背景色 */
    tap-highlight-color: transparent;
    outline: none; /* 移除点击轮廓 */
    font-weight: bold;
}
.top-nav-item:active {
    background: none; /* 确保点击无背景色 */
}
.top-nav-item.active {
    color: #128cff;
}
.top-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1.25rem; /* 20px */
    height: 0.1875rem; /* 3px */
    background-color: #128cff;
    border-radius: 0.1875rem; /* 3px */
}

/* 课程列表容器 */
.course-container {
    padding: 0.9375rem; /* 15px */
}

/* 课程卡片 */
.course-card {
    background-color: #fff;
    border-radius: 0.5rem; /* 8px */
    padding: 0.9375rem; /* 15px */
    margin-bottom: 0.625rem; /* 10px */
}

.course-title {
    font-size: 1.1rem; /* 16px */
    font-weight: 600;
    margin-bottom: 0.5rem; /* 8px */
    line-height: 1.4;
}

.course-desc {
    font-size: 0.8125rem; /* 13px */
    color: #666;
    margin-bottom: 0.75rem; /* 12px */
    line-height: 1.4;
}

.tag-free {
    display: inline-block;
    background-color: #e8f4ff;
    color: #128cff;
    font-size: 0.75rem; /* 12px */
    padding: 0.125rem 0.5rem; /* 2px 8px */
    border-radius: 0.625rem; /* 10px */
    margin-bottom: 0.75rem; /* 12px */
}

/* 底部行：讲师头像 + 右侧信息 */
.card-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* 关键：底部对齐 */
    flex-wrap: wrap; /* 小屏幕换行 */
    gap: 0.5rem;
}

.teacher-avatars {
    display: flex;
    align-items: center;
}

.avatar {
    width: 1.875rem; /* 30px */
    height: 1.875rem; /* 30px */
    border-radius: 50%;
    background-color: #eee;
    overflow: hidden;
    border: 0.125rem solid #fff; /* 2px */
}

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

.course-info-right {
    text-align: right;
}

.limited-free {
    font-size: 1rem; /* 16px */
    color: #f53f3f;
    font-weight: 600;
    margin-bottom: 0.25rem; /* 4px */
}

.student-count {
    font-size: 0.75rem; /* 12px */
    color: #999;
}

/* 无更多课程提示 */
.no-more {
    text-align: center;
    color: #999;
    font-size: 0.8125rem; /* 13px */
    padding: 1.25rem 0; /* 20px */
    display: none; /* 默认隐藏 */
}

/* 加载中提示 */
.loading {
    text-align: center;
    color: #999;
    font-size: 0.8125rem; /* 13px */
    padding: 1.25rem 0; /* 20px */
    display: none;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 1rem; /* 16px */
    height: 1rem; /* 16px */
    border: 0.125rem solid #ccc; /* 2px */
    border-top-color: #128cff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem; /* 8px */
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background-color: #fff;
    border-top: 1px solid #eee;
    padding: 0.5rem 0; /* 8px */
}

.bottom-nav-item {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: #666;
    font-size: 0.75rem; /* 12px */
    -webkit-tap-highlight-color: transparent; /* 移除点击背景色 */
}

.bottom-nav-item.active {
    color: #128cff;
}

.nav-icon {
    width: 1.5rem; /* 24px */
    height: 1.5rem; /* 24px */
    margin: 0 auto 0.25rem; /* 4px */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 适配内容高度，避免被底部导航遮挡 */
.content-wrap {
    padding-bottom: 3.75rem; /* 60px */
}

/* 横屏适配 */
@media (orientation: landscape) {
    .course-card {
        max-width: 37.5rem; /* 600px */
        margin-left: auto;
        margin-right: auto;
    }
}