* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Helvetica, sans-serif; background: #f5f7fa; color: #333; font-size: 14px; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { border: none; outline: none; cursor: pointer; font-family: inherit; }
input, textarea { font-family: inherit; outline: none; }

.app { max-width: 750px; margin: 0 auto; background: #f5f7fa; min-height: 100vh; padding-bottom: 70px; }

/* 顶部Header */
.header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; padding: 18px 20px; text-align: center; font-size: 18px; font-weight: 600; position: sticky; top: 0; z-index: 50; }

/* 轮播图 */
.carousel { position: relative; width: 100%; height: 180px; overflow: hidden; background: #fff; }
.carousel-wrapper { display: flex; height: 100%; transition: transform 0.4s ease; }
.carousel-item { flex-shrink: 0; width: 100%; height: 100%; position: relative; }
.carousel-item img { width: 100%; height: 100%; object-fit: cover; }
.carousel-item .title { position: absolute; bottom: 0; left: 0; right: 0; padding: 15px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,0.5)); font-size: 14px; }
.carousel-indicators { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.carousel-indicators span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.5); transition: all 0.3s; }
.carousel-indicators span.active { width: 18px; border-radius: 3px; background: #fff; }

/* 分类按钮 */
.category-bar { background: #fff; padding: 15px; display: flex; gap: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.category-bar::-webkit-scrollbar { display: none; }
.cat-btn { flex-shrink: 0; padding: 8px 18px; background: #f5f7fa; border-radius: 20px; font-size: 13px; color: #666; transition: all 0.2s; }
.cat-btn.active { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; }

/* 课程列表 */
.course-list { padding: 12px; }
.course-item { display: flex; background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); transition: transform 0.2s; }
.course-item:active { transform: scale(0.98); }
.course-item .cover { width: 110px; height: 75px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: #f5f5f5; }
.course-item .cover img { width: 100%; height: 100%; object-fit: cover; }
.course-item .info { flex: 1; padding-left: 12px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.course-item .title { font-size: 15px; font-weight: 600; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-item .desc { font-size: 12px; color: #999; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.course-item .meta { display: flex; justify-content: space-between; align-items: center; }
.course-item .tag { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: rgba(102,126,234,0.1); color: #667eea; }
.course-item .tag.free { background: rgba(82,196,26,0.1); color: #52c41a; }
.course-item .tag.member { background: rgba(250,173,20,0.1); color: #faad14; }
.course-item .price { font-size: 16px; font-weight: 600; color: #ff4d4f; }
.course-item .price .original { font-size: 11px; color: #999; text-decoration: line-through; margin-left: 4px; font-weight: normal; }

/* 底部Tab栏 */
.tab-bar { position: fixed; bottom: 0; left: 0; right: 0; max-width: 750px; margin: 0 auto; display: flex; background: #fff; border-top: 1px solid #eee; padding: 8px 0; z-index: 100; }
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #999; font-size: 11px; transition: color 0.2s; }
.tab-item.active { color: #667eea; }
.tab-item .icon { font-size: 22px; }

/* 模态框 */
.modal-mask { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); z-index: 999; justify-content: center; align-items: center; }
.modal-mask.show { display: flex; }
.modal-box { background: #fff; border-radius: 12px; width: 80%; max-width: 320px; padding: 25px 20px; text-align: center; }
.modal-box h3 { font-size: 18px; margin-bottom: 10px; }
.modal-box p { color: #999; margin-bottom: 20px; font-size: 13px; }
.modal-box .btn { padding: 10px 24px; border-radius: 22px; font-size: 14px; margin: 0 6px; }
.btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; }
.btn-default { background: #f5f5f5; color: #666; }

/* 课程详情 */
.detail-header { background: #fff; padding: 16px; }
.detail-header .cover { width: 100%; height: 200px; border-radius: 10px; overflow: hidden; background: #f5f5f5; }
.detail-header .cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-header .title { font-size: 18px; font-weight: 600; margin-top: 14px; margin-bottom: 8px; line-height: 1.4; }
.detail-header .meta { color: #999; font-size: 12px; display: flex; gap: 12px; }
.detail-header .price-row { display: flex; align-items: baseline; margin-top: 12px; }
.detail-header .price { font-size: 24px; font-weight: 600; color: #ff4d4f; }
.detail-header .original { font-size: 13px; color: #999; text-decoration: line-through; margin-left: 8px; }

.detail-section { background: #fff; margin-top: 10px; padding: 16px; }
.detail-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; padding-left: 10px; border-left: 3px solid #667eea; }
.detail-section .content { font-size: 14px; color: #555; line-height: 1.8; white-space: pre-wrap; word-break: break-all; }
.detail-section .video-box { width: 100%; }
.detail-section .video-box video { width: 100%; border-radius: 8px; }
.detail-section .audio-box { width: 100%; }
.detail-section .audio-box audio { width: 100%; }
.detail-section .images-box img { width: 100%; border-radius: 8px; margin-bottom: 8px; }

/* 锁定提示 */
.lock-tip { background: #fffbe6; border: 1px solid #ffe58f; color: #d48806; padding: 12px; border-radius: 8px; text-align: center; margin: 10px 0; font-size: 13px; }

/* 详情底部操作 */
.detail-footer { position: fixed; bottom: 0; left: 0; right: 0; max-width: 750px; margin: 0 auto; display: flex; gap: 10px; padding: 10px 12px; background: #fff; border-top: 1px solid #eee; z-index: 100; }
.detail-footer .btn { flex: 1; padding: 12px; border-radius: 25px; font-size: 14px; font-weight: 600; }
.btn-collect { background: #f5f5f5; color: #666; flex: 0 0 60px !important; }
.btn-share { background: #f5f5f5; color: #666; flex: 0 0 60px !important; }
.btn-buy { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%); color: #fff; }
.btn-member { background: linear-gradient(135deg, #faad14 0%, #d48806 100%); color: #fff; }
.btn-read { background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%); color: #fff; }

/* 我的页面 */
.mine-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 30px 20px 50px; color: #fff; }
.mine-header .user-row { display: flex; align-items: center; }
.mine-header .avatar { width: 64px; height: 64px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.3); overflow: hidden; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 30px; }
.mine-header .avatar img { width: 100%; height: 100%; object-fit: cover; }
.mine-header .user-info { margin-left: 14px; flex: 1; }
.mine-header .user-info .name { font-size: 17px; font-weight: 600; }
.mine-header .user-info .sub { font-size: 12px; opacity: 0.85; margin-top: 4px; }
.mine-header .member-badge { background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%); color: #fff; padding: 4px 10px; border-radius: 12px; font-size: 11px; display: inline-block; margin-top: 6px; }
.mine-header .member-badge.expired { background: #999; }

.stats-card { background: #fff; margin: -30px 12px 12px; border-radius: 12px; padding: 16px; display: flex; box-shadow: 0 2px 12px rgba(0,0,0,0.06); position: relative; z-index: 2; }
.stats-card .stat { flex: 1; text-align: center; }
.stats-card .stat .num { font-size: 20px; font-weight: 600; color: #333; }
.stats-card .stat .label { font-size: 11px; color: #999; margin-top: 4px; }

.menu-list { margin: 0 12px 12px; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.menu-item { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid #f5f5f5; transition: background 0.2s; }
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: #f9f9f9; }
.menu-item .icon { font-size: 20px; margin-right: 12px; width: 24px; text-align: center; }
.menu-item .text { flex: 1; font-size: 14px; }
.menu-item .arrow { color: #ccc; }

/* 会员卡 */
.member-card { margin: 12px; background: linear-gradient(135deg, #2c3e50 0%, #4a6741 100%); border-radius: 12px; padding: 20px; color: #fff; position: relative; overflow: hidden; }
.member-card::before { content: 'VIP'; position: absolute; top: -10px; right: -10px; font-size: 80px; color: rgba(255,215,0,0.15); font-weight: bold; }
.member-card .title { font-size: 16px; font-weight: 600; }
.member-card .desc { font-size: 12px; opacity: 0.85; margin-top: 6px; }

/* 会员开通页 */
.member-plans { padding: 12px; }
.plan-item { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 12px; position: relative; transition: all 0.2s; border: 2px solid transparent; }
.plan-item.active { border-color: #faad14; background: #fffbe6; }
.plan-item .name { font-size: 18px; font-weight: 600; }
.plan-item .price { font-size: 28px; font-weight: 600; color: #ff4d4f; margin: 10px 0; }
.plan-item .price .yuan { font-size: 14px; }
.plan-item .price .original { font-size: 14px; color: #999; text-decoration: line-through; margin-left: 8px; font-weight: normal; }
.plan-item .desc { color: #999; font-size: 13px; }
.plan-item .badge { position: absolute; top: 0; right: 0; background: #ff4d4f; color: #fff; padding: 3px 10px; border-radius: 0 12px 0 12px; font-size: 11px; }

/* 登录页 */
.login-page { padding: 60px 30px; text-align: center; }
.login-page .logo { font-size: 60px; margin-bottom: 20px; }
.login-page h2 { font-size: 22px; margin-bottom: 10px; color: #333; }
.login-page p { color: #999; margin-bottom: 40px; }
.login-btn { display: inline-block; padding: 12px 40px; background: #07c160; color: #fff; border-radius: 30px; font-size: 15px; font-weight: 500; }
.login-btn:active { background: #06ad56; }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: #999; }
.empty .icon { font-size: 50px; margin-bottom: 12px; opacity: 0.5; }
.empty .text { font-size: 13px; }

/* 加载 */
.loading { text-align: center; padding: 20px; color: #999; font-size: 13px; }
.loading::after { content: ''; display: inline-block; width: 14px; height: 14px; border: 2px solid #ddd; border-top-color: #667eea; border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 课程页左侧分类 */
.course-page { display: flex; padding-bottom: 70px; }
.course-page .left-menu { width: 90px; background: #f5f5f5; height: calc(100vh - 110px); position: fixed; left: 0; overflow-y: auto; }
.course-page .left-menu .menu { padding: 15px 0; text-align: center; font-size: 13px; color: #666; border-left: 3px solid transparent; }
.course-page .left-menu .menu.active { background: #fff; color: #667eea; border-left-color: #667eea; font-weight: 600; }
.course-page .right-content { flex: 1; margin-left: 90px; padding: 10px; }
.course-page .right-content .page-title { padding: 10px 5px; font-size: 14px; font-weight: 600; color: #333; border-bottom: 1px solid #eee; margin-bottom: 10px; }

@media (min-width: 750px) {
    .course-page .left-menu { left: 50%; transform: translateX(-375px); }
}
