* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
    --primary: #667eea; --primary-dark: #5a6fd6; --secondary: #764ba2;
    --success: #07C160; --warning: #ff6b35; --danger: #f5576c;
    --text: #333; --text-light: #666; --text-muted: #999;
    --bg: #f5f6fa; --white: #fff; --border: #eee;
    --shadow: 0 2px 12px rgba(0,0,0,0.08); --radius: 12px;
}
html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.5; overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
.app-container { max-width: 750px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: 60px; }
.header { position: sticky; top: 0; z-index: 100; background: var(--white); border-bottom: 1px solid var(--border); }
.header-content { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.logo { font-size: 20px; font-weight: 700; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.search-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--bg); }
.header-back { display: flex; align-items: center; padding: 12px 16px; }
.back-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; margin-right: 12px; }
.header-title { font-size: 17px; font-weight: 600; }
.header-dark { background: var(--text); border: none; }
.header-dark .back-btn, .header-dark .header-title { color: var(--white); }
.banner-slider { position: relative; overflow: hidden; border-radius: 0 0 var(--radius) var(--radius); }
.banner-track { display: flex; transition: transform 0.5s ease; }
.banner-item { min-width: 100%; height: 130px; display: flex; align-items: center; padding: 0 20px; }
.banner-text h2 { color: var(--white); font-size: 20px; margin-bottom: 6px; }
.banner-text p { color: rgba(255,255,255,0.9); font-size: 12px; margin-bottom: 12px; }
.banner-btn { display: inline-block; padding: 8px 20px; background: var(--white); color: var(--primary); border-radius: 20px; font-size: 13px; font-weight: 600; }
.banner-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.5); transition: all 0.3s; }
.dot.active { width: 18px; border-radius: 3px; background: var(--white); }
.category-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 14px 12px; background: var(--white); margin: 10px; border-radius: var(--radius); }
.category-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.category-icon { font-size: 24px; }
.category-name { font-size: 11px; color: var(--text-light); }
.section { padding: 0 12px; margin-bottom: 8px; }
.section-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 6px; }
.section-title { font-size: 15px; font-weight: 700; }
.section-more { font-size: 12px; color: var(--text-muted); }
.course-scroll { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.course-scroll::-webkit-scrollbar { display: none; }
.course-card { min-width: 160px; max-width: 160px; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); scroll-snap-align: start; }
.course-cover { height: 90px; display: flex; align-items: center; justify-content: center; position: relative; }
.course-cover-text { color: var(--white); font-size: 20px; font-weight: 700; opacity: 0.3; }
.course-badge { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 10px; font-size: 10px; color: var(--white); font-weight: 600; }
.course-badge.hot { background: var(--danger); }
.course-badge.new { background: var(--success); }
.course-badge.free { background: var(--warning); }
.course-badge.recommend { background: var(--primary); }
.course-info { padding: 8px; }
.course-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-subtitle { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.course-price { display: flex; align-items: center; gap: 4px; }
.price-current { color: var(--danger); font-weight: 700; font-size: 14px; }
.price-original { color: var(--text-muted); font-size: 11px; text-decoration: line-through; }
.price-free { color: var(--success); font-weight: 600; font-size: 13px; }
.course-list { background: var(--white); border-radius: var(--radius); overflow: hidden; }
.course-list-item { display: flex; padding: 12px; border-bottom: 1px solid var(--border); }
.course-list-item:last-child { border-bottom: none; }
.list-cover { width: 100px; height: 70px; border-radius: 8px; flex-shrink: 0; position: relative; }
.list-info { flex: 1; margin-left: 12px; display: flex; flex-direction: column; justify-content: space-between; }
.list-title { font-size: 14px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-desc { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); }
.list-price { display: flex; align-items: center; gap: 6px; }
.course-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.grid-cover { height: 100px; position: relative; }
.grid-info { padding: 10px; }
.grid-info h3 { font-size: 13px; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-hero { padding: 40px 20px; color: var(--white); }
.hero-content h1 { font-size: 22px; margin-bottom: 8px; }
.hero-subtitle { font-size: 14px; opacity: 0.9; margin-bottom: 16px; }
.hero-meta { display: flex; gap: 16px; font-size: 13px; }
.course-tabs { display: flex; background: var(--white); border-bottom: 1px solid var(--border); }
.tab-btn { flex: 1; padding: 14px; border: none; background: none; font-size: 14px; color: var(--text-light); position: relative; }
.tab-btn.active { color: var(--primary); font-weight: 600; }
.tab-btn.active::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 3px; background: var(--primary); border-radius: 2px; }
.tab-pane { display: none; background: var(--white); margin: 12px; border-radius: var(--radius); padding: 16px; }
.tab-pane.active { display: block; }
.course-desc h3, .course-highlights h3 { font-size: 16px; margin-bottom: 12px; }
.course-desc p { color: var(--text-light); line-height: 1.8; margin-bottom: 20px; }
.highlights-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.highlight-item { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--text-light); }
.highlight-icon { font-size: 24px; }
.chapter { margin-bottom: 16px; }
.chapter-title { font-size: 15px; padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.lesson-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.lesson-info { display: flex; align-items: center; gap: 10px; }
.lesson-number { width: 22px; height: 22px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-muted); }
.lesson-title { font-size: 14px; }
.lesson-badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.lesson-badge.free { background: #e8f5e9; color: var(--success); }
.lesson-duration { font-size: 12px; color: var(--text-muted); }
.teacher-card { display: flex; align-items: center; gap: 16px; }
.teacher-avatar { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--white); font-size: 24px; font-weight: 600; }
.teacher-info h3 { font-size: 16px; margin-bottom: 4px; }
.teacher-info p { font-size: 13px; color: var(--text-muted); }
.course-action { position: fixed; bottom: 60px; left: 0; right: 0; background: var(--white); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 -2px 12px rgba(0,0,0,0.08); max-width: 750px; margin: 0 auto; }
.action-price { display: flex; align-items: center; gap: 8px; }
.action-btn { padding: 12px 32px; border-radius: 24px; border: none; font-size: 15px; font-weight: 600; cursor: pointer; }
.action-btn.primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: var(--white); }
.video-container { width: 100%; background: #000; }
.video-player { width: 100%; max-height: 50vh; display: block; }
.lesson-info-bar { padding: 16px; background: var(--white); margin-bottom: 12px; }
.lesson-main-title { font-size: 18px; margin-bottom: 6px; }
.lesson-course-name { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.lesson-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); }
.lesson-list-section { background: var(--white); margin: 0 12px 12px; border-radius: var(--radius); padding: 16px; }
.section-title-small { font-size: 16px; margin-bottom: 12px; }
.chapter-mini { margin-bottom: 16px; }
.chapter-mini h4 { font-size: 14px; color: var(--text-light); margin-bottom: 8px; }
.lesson-mini-item { display: flex; align-items: center; padding: 10px 12px; border-radius: 8px; margin-bottom: 4px; background: var(--bg); }
.lesson-mini-item.active { background: #e8eaf6; color: var(--primary); }
.mini-number { width: 20px; height: 20px; border-radius: 50%; background: var(--white); display: flex; align-items: center; justify-content: center; font-size: 10px; margin-right: 10px; }
.mini-title { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-duration { font-size: 11px; color: var(--text-muted); margin-left: 8px; }
.search-header { padding: 12px 16px; }
.search-form { display: flex; gap: 8px; }
.search-input { flex: 1; padding: 10px 16px; border: 1px solid var(--border); border-radius: 20px; font-size: 14px; outline: none; background: var(--bg); }
.search-input:focus { border-color: var(--primary); background: var(--white); }
.search-submit { padding: 10px 20px; background: var(--primary); color: var(--white); border: none; border-radius: 20px; font-size: 14px; }
.search-page { padding: 16px; }
.search-result-text { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.search-hot h3 { font-size: 16px; margin-bottom: 12px; }
.hot-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.hot-tag { padding: 8px 16px; background: var(--white); border-radius: 20px; font-size: 13px; box-shadow: var(--shadow); }
.auth-page { padding: 40px 24px; }
.auth-logo { text-align: center; margin-bottom: 32px; }
.logo-circle { width: 70px; height: 70px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: var(--white); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; margin: 0 auto 16px; }
.auth-logo h2 { font-size: 22px; margin-bottom: 6px; }
.auth-logo p { color: var(--text-muted); font-size: 14px; }
.auth-error { padding: 12px; background: #ffebee; color: var(--danger); border-radius: 8px; margin-bottom: 16px; font-size: 13px; text-align: center; }
.auth-form .form-group { margin-bottom: 16px; }
.form-input { width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; outline: none; transition: border-color 0.3s; }
.form-input:focus { border-color: var(--primary); }
.auth-btn { width: 100%; padding: 14px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: var(--white); border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 8px; }
.auth-footer { text-align: center; margin-top: 24px; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 600; }
/* My Page */
.profile-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.profile-info { display: flex; align-items: center; gap: 14px; }
.profile-avatar {
    width: 60px; height: 60px; border-radius: 50%;
    background: rgba(255,255,255,0.2); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 600; border: 2px solid rgba(255,255,255,0.3);
}
.profile-details h2 { color: #fff; font-size: 18px; margin-bottom: 4px; }
.profile-username { color: rgba(255,255,255,0.8); font-size: 13px; margin-bottom: 6px; }
.profile-coins-inline { display: inline-flex; align-items: center; gap: 4px; background: rgba(0,0,0,0.15); padding: 4px 10px; border-radius: 12px; }
.profile-coins-inline .coins-icon { font-size: 14px; }
.profile-coins-inline .coins-num { color: #ffd700; font-size: 15px; font-weight: 700; }
.profile-coins-inline .coins-label { color: rgba(255,255,255,0.9); font-size: 12px; }
.profile-banner .logout-btn {
    padding: 6px 12px; border: 1px solid rgba(255,255,255,0.3); border-radius: 16px;
    font-size: 12px; color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.1);
}
.user-stats {
    display: flex; background: var(--white); border-radius: var(--radius);
    padding: 16px; margin: 12px 16px; box-shadow: var(--shadow);
}
.stat-item { flex: 1; text-align: center; }
.stat-num { display: block; font-size: 20px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-muted); }
.my-courses { padding: 0 16px; }
.section-title-small { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.my-course-item {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    background: var(--white); border-radius: var(--radius);
    margin-bottom: 10px; box-shadow: var(--shadow);
}
.my-course-cover {
    width: 50px; height: 50px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--white); font-size: 16px; font-weight: 600; flex-shrink: 0;
}
.my-course-info { flex: 1; }
.my-course-info h4 { font-size: 14px; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress-bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 3px; transition: width 0.3s; }
.progress-text { font-size: 11px; color: var(--text-muted); }
.empty-state { text-align: center; padding: 40px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { color: var(--text-muted); margin-bottom: 16px; }
.empty-hint { font-size: 12px; }
.empty-btn { display: inline-block; padding: 10px 24px; background: var(--primary); color: var(--white); border-radius: 20px; font-size: 14px; }
.coins-display { font-size: 14px; color: #fa8c16; margin-top: 4px; }
.coins-display strong { font-size: 18px; }
.footer { text-align: center; padding: 24px 16px; color: var(--text-muted); font-size: 12px; }
.footer p { margin-bottom: 4px; }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--white); border-top: 1px solid var(--border); max-width: 750px; margin: 0 auto; z-index: 100; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 0; color: var(--text-muted); font-size: 10px; gap: 4px; }
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--primary); }
@media (max-width: 375px) { .category-grid { grid-template-columns: repeat(3, 1fr); } .course-card { min-width: 170px; } .highlights-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .app-container { box-shadow: 0 0 20px rgba(0,0,0,0.1); } }
html[wxwebview] body, body.wx-bridge { -webkit-text-size-adjust: 100%; }
video::-webkit-media-controls { display: flex !important; }
video::-webkit-media-controls-enclosure { overflow: hidden; }
video::-webkit-media-controls-panel { width: calc(100% + 30px); }
