/*
Theme Name: hx-learn 沐涵学堂
Description: 私域学习服务平台(移动优先): 学习经验 / 视频微课 / 音频听读 / 免费资料
Version: 1.3.0
*/
*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent}
body{font-family:-apple-system,"PingFang SC","Microsoft YaHei",sans-serif;background:#f4f6fa;color:#1e293b;line-height:1.6}
img{max-width:100%;display:block}
a{text-decoration:none;color:inherit}
.container{max-width:480px;margin:0 auto;padding:0 0 70px}
/* 顶栏 */
.topbar{position:sticky;top:0;z-index:50;background:#fff;display:flex;align-items:center;gap:8px;padding:8px 13px;box-shadow:0 1px 4px rgba(15,23,42,.06)}
.logo{width:30px;height:30px;border-radius:8px;background:linear-gradient(135deg,#4f46e5,#7c3aed);color:#fff;display:flex;align-items:center;justify-content:center;font-size:14px;flex:none}
.site{font-size:15px;font-weight:700;flex:none;color:#1e293b}
.site-slogan{flex:1;font-size:10.5px;color:#94a3b8;text-align:right;padding-right:2px}
.search{flex:1;background:#f1f5f9;border-radius:17px;padding:6px 12px;font-size:12px;color:#94a3b8;border:0;outline:0}
/* 横幅 */
.banner{margin:12px 13px 0;border-radius:16px;background:linear-gradient(120deg,#4f46e5,#8b5cf6);color:#fff;padding:20px 17px;position:relative;overflow:hidden}
.banner .tag{position:absolute;right:12px;top:12px;background:rgba(255,255,255,.22);padding:2px 9px;border-radius:11px;font-size:10px}
.banner h2{font-size:17px;margin-bottom:5px}
.banner p{font-size:11.5px;opacity:.9;line-height:1.6}
.banner-cta{display:inline-block;margin-top:11px;background:#fff;color:#4f46e5;font-size:11.5px;font-weight:600;padding:6px 13px;border-radius:16px}
/* 宫格 */
.grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:12px 13px 0;background:#fff;border-radius:15px;padding:12px 6px;box-shadow:0 1px 4px rgba(15,23,42,.05)}
.g4{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center}
.g4 .ico{width:42px;height:42px;border-radius:13px;display:flex;align-items:center;justify-content:center;font-size:20px}
.g4 span{font-size:10.5px;color:#475569;font-weight:500;white-space:nowrap}
.c1{background:#eef2ff}.c2{background:#fdf2f8}.c3{background:#fefce8}.c4{background:#ecfdf5}
/* 分区 */
.sect{display:flex;align-items:center;justify-content:space-between;margin:15px 13px 8px}
.sect h3{font-size:14.5px}
.sect a{font-size:11.5px;color:#4f46e5}
/* 内容流卡片 */
.feed{margin:0 13px;display:flex;flex-direction:column;gap:9px}
.card{background:#fff;border-radius:13px;padding:10px;display:flex;gap:10px;box-shadow:0 1px 4px rgba(15,23,42,.05)}
.card .thumb{width:66px;height:66px;border-radius:9px;flex:none;display:flex;align-items:center;justify-content:center;font-size:24px;position:relative;overflow:hidden;background:#f1f5f9}
.card .thumb img{width:100%;height:100%;object-fit:cover}
.card .dur{position:absolute;right:3px;bottom:3px;background:rgba(0,0,0,.65);color:#fff;font-size:9px;padding:0 4px;border-radius:5px}
.card .info{flex:1;display:flex;flex-direction:column;justify-content:space-between;min-width:0}
.card .t{font-size:13px;font-weight:600;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.card .meta{display:flex;align-items:center;gap:5px;font-size:10px;color:#94a3b8}
.pill{font-size:9px;padding:1px 6px;border-radius:7px;background:#eef2ff;color:#4f46e5;flex:none}
.pill.v{background:#fefce8;color:#a16207}
.pill.d{background:#ecfdf5;color:#047857}
.pill.k{background:#fdf2f8;color:#be185d}
/* 底部tab */
.tabbar{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:480px;background:#fff;border-top:1px solid #eef2f7;display:flex;padding:5px 0 calc(5px + env(safe-area-inset-bottom));z-index:60}
.tb{flex:1;display:flex;flex-direction:column;align-items:center;gap:1px;font-size:9.5px;color:#94a3b8;cursor:pointer}
.tb.on{color:#4f46e5;font-weight:600}
.tb .i{font-size:17px}
.tb-search:active{color:#4f46e5}
/* 通用页面 */
.page-head{padding:20px 13px 12px;background:#fff}
.page-head h1{font-size:19px}
.page-head .sub{font-size:12px;color:#64748b;margin-top:3px}
.simple-list{margin:12px 13px;background:#fff;border-radius:13px;overflow:hidden}
.simple-list .row{display:flex;align-items:center;gap:12px;padding:11px 13px;border-bottom:1px solid #f4f6fa}
.simple-list .row:last-child{border:0}
/* 文章排版 */
.article{background:#fff;padding:20px 16px 30px}
.article h1{font-size:20px;line-height:1.4;margin-bottom:10px}
.article .ameta{color:#94a3b8;font-size:12px;margin-bottom:14px}
.article .content{font-size:15px;line-height:1.9}
.article .content p{margin-bottom:14px}
.article .content h2{font-size:17px;margin:18px 0 8px;padding-left:9px;border-left:4px solid #4f46e5}
/* 课程听读页 */
.course-top{background:linear-gradient(135deg,#4f46e5,#7c3aed);padding:16px 15px 46px;color:#fff}
.back{display:inline-flex;align-items:center;gap:4px;font-size:12.5px;opacity:.9;margin-bottom:11px}
.book-row{display:flex;gap:13px;align-items:center}
.book{width:80px;height:106px;background:#fff;border-radius:5px;display:flex;align-items:center;justify-content:center;font-size:30px;box-shadow:0 6px 14px rgba(0,0,0,.25);flex:none;overflow:hidden}
.book img{width:100%;height:100%;object-fit:cover}
.book-info h1{font-size:16px;line-height:1.35;margin-bottom:5px}
.book-info p{font-size:11px;opacity:.85;line-height:1.5}
.switch{background:#fff;border-radius:14px;margin:-30px 13px 0;padding:7px;display:flex;box-shadow:0 3px 12px rgba(15,23,42,.08);position:relative;z-index:2}
.sw{flex:1;text-align:center;padding:8px 0;font-size:12.5px;color:#64748b;border-radius:10px}
.sw.on{background:#eef2ff;color:#4f46e5;font-weight:600}
.unit{margin:15px 13px 7px;display:flex;align-items:center;gap:8px}
.unit h3{font-size:13.5px}
.unit .line{flex:1;height:1px;background:#e2e8f0}
.audio-list{margin:0 13px;background:#fff;border-radius:13px;overflow:hidden;box-shadow:0 1px 4px rgba(15,23,42,.05)}
.audio{display:flex;align-items:center;gap:11px;padding:11px 13px;border-bottom:1px solid #f1f5f9}
.audio:last-child{border-bottom:0}
.play-btn{width:34px;height:34px;border-radius:50%;background:#4f46e5;color:#fff;display:flex;align-items:center;justify-content:center;flex:none;font-size:13px}
.audio .tt{flex:1;font-size:12.5px;line-height:1.4}
.audio .tt .sub{font-size:10px;color:#94a3b8;margin-top:1px}
.audio .dur{font-size:10.5px;color:#94a3b8;flex:none}
audio{width:100%;height:34px;margin-top:4px}
/* 空状态 */
.empty{text-align:center;color:#94a3b8;font-size:13px;padding:50px 0}
/* ===== 首页: 年级 3x3 卡片 ===== */
.grade-wrap{margin:12px 13px 0;background:#fff;border-radius:15px;padding:13px;box-shadow:0 1px 4px rgba(15,23,42,.05)}
.grade-head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:10px}
.grade-head .gt{font-size:14.5px;font-weight:700}
.grade-head .gs{font-size:10.5px;color:#94a3b8}
.grade-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}
.gc{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;border-radius:11px;padding:8px 4px;min-height:52px}
.gc .gn{font-size:13.5px;font-weight:700}
.gc .gs2{font-size:9.5px;opacity:.85}
.g0{background:#eef2ff;color:#4f46e5}
.g0.on{background:linear-gradient(135deg,#4f46e5,#7c3aed);color:#fff}
.g1{background:#fff3e6;color:#ea8010}
.g2{background:#ffe8cc;color:#dd8b00}
.g3{background:#fff9db;color:#b08a00}
.g4{background:#e9fac8;color:#5c940d}
.g5{background:#d3f9d8;color:#2b8a3e}
.g6{background:#c5f6fa;color:#0b7285}
.g7{background:linear-gradient(135deg,#edf2ff,#dbe4ff);color:#4263eb;border:1.5px solid #4263eb}
.g8{background:#f3f0ff;color:#7048e8}
.g9{background:#ffe3e3;color:#c92a2a}
.gc:active{transform:scale(.96)}
/* ===== 首页: 课本同步音频专区(黄调) ===== */
.audio-zone{margin:13px 13px 0;border-radius:16px;padding:14px;background:linear-gradient(145deg,#fff8e1,#ffecb3 55%,#ffe0b2);border:1px solid #ffe082}
.az-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.az-head h2{font-size:15.5px;color:#7a5a00}
.az-head p{font-size:10.5px;color:#b08a00;margin-top:1px}
.az-link{background:#7c3aed;color:#fff;font-size:11px;font-weight:600;padding:5px 11px;border-radius:13px;flex:none}
.az-book{display:flex;gap:11px;align-items:center;background:#fff;border-radius:12px;padding:10px;margin-top:10px;box-shadow:0 2px 6px rgba(180,140,0,.08)}
.az-cover{width:46px;height:46px;border-radius:10px;background:linear-gradient(135deg,#4f46e5,#7c3aed);display:flex;align-items:center;justify-content:center;font-size:22px;flex:none}
.az-info{flex:1;min-width:0}
.az-title{font-size:13.5px;font-weight:700;color:#1e293b}
.az-meta{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}
.az-pill{font-size:9px;background:#f1f5f9;color:#64748b;border-radius:7px;padding:1px 6px}
.az-pill.on{background:#d1fae5;color:#047857}
.az-tip{font-size:9.5px;color:#94a3b8;margin-top:5px}
.az-units{margin-top:10px}
.az-unit{background:#fff;border-radius:11px;margin-bottom:7px;overflow:hidden;border:1px solid #f1f5f9}
.az-unit-head{display:flex;align-items:center;gap:8px;padding:10px 11px;cursor:pointer}
.az-unit-num{width:21px;height:21px;border-radius:50%;background:#fff3cd;color:#b08a00;font-size:10.5px;font-weight:700;display:flex;align-items:center;justify-content:center;flex:none}
.az-unit-name{flex:1;min-width:0;font-size:12.5px;font-weight:600;color:#1e293b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.az-unit-cnt{font-size:9.5px;color:#94a3b8;flex:none}
.az-unit-arrow{font-size:11px;color:#b08a00;flex:none}
.az-unit-body{max-height:0;overflow:hidden;transition:max-height .25s ease}
.az-unit.open .az-unit-body{max-height:600px}
.az-track{display:flex;align-items:center;gap:9px;padding:8px 11px 8px 40px;border-top:1px solid #f8fafc;cursor:pointer}
.az-play{width:26px;height:26px;border-radius:50%;background:#eef2ff;color:#4f46e5;font-size:10px;display:flex;align-items:center;justify-content:center;flex:none}
.az-label{flex:1;min-width:0;font-size:11.5px;color:#334155;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.az-size{font-size:9.5px;color:#c0a56a;flex:none;font-variant-numeric:tabular-nums}
.az-track.playing{background:#fffbeb}
.az-track.playing .az-play{background:#4f46e5;color:#fff}
.az-future{margin-top:9px}
.az-future-title{font-size:10.5px;font-weight:700;color:#a16207;margin-bottom:5px}
.az-future-list{display:flex;flex-wrap:wrap;gap:5px}
.az-fut{font-size:9.5px;color:#a16207;background:rgba(255,255,255,.65);border:1px dashed #e6c36a;border-radius:9px;padding:2px 8px}
/* ===== 归档页: 年级切换条 ===== */
.grade-bar{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:10px 13px 2px}
.gb-label{font-size:12px;font-weight:700;color:#475569;margin-right:2px}
.gb-chip{display:inline-flex;align-items:center;gap:4px;background:#fff;border:1px solid #e2e8f0;color:#334155;border-radius:16px;padding:5px 10px;font-size:12px;text-decoration:none;line-height:1.2}
.gb-chip .gb-dot{width:7px;height:7px;border-radius:50%;display:inline-block;flex:none}
.gb-chip .gb-sub{font-size:9.5px;color:#94a3b8}
.gb-chip.on{background:#4f46e5;border-color:#4f46e5;color:#fff}
.gb-chip.on .gb-sub{color:#c7d2fe}
.gb-chip:active{transform:scale(.96)}
/* ===== 归档页: 按单元分组 ===== */
.unit-block{margin:14px 13px 0}
.unit-h3{display:flex;align-items:center;gap:8px;font-size:14.5px;color:#1e293b;margin:0 0 8px;padding-bottom:6px;border-bottom:2px solid #eef2ff}
.unit-h3 .uc{font-size:10.5px;font-weight:600;color:#4f46e5;background:#eef2ff;border-radius:10px;padding:1px 8px}
.unit-list{background:#fff;border:1px solid #eef2f6;border-radius:12px;overflow:hidden;box-shadow:0 1px 3px rgba(15,23,42,.04)}
.unit-list .row{display:flex;align-items:center;gap:9px;padding:10px 12px;text-decoration:none;border-bottom:1px solid #f1f5f9}
.unit-list .row:last-child{border-bottom:none}
.unit-list .row:active{background:#f8fafc}
.unit-list .ic{width:28px;height:28px;border-radius:8px;background:#eef2ff;display:flex;align-items:center;justify-content:center;font-size:14px;flex:none}
.unit-list .ti{flex:1;min-width:0;font-size:13px;color:#1e293b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.unit-list .du{font-size:10.5px;color:#64748b;background:#f1f5f9;border-radius:8px;padding:2px 6px;flex:none;font-variant-numeric:tabular-nums}
/* ===== 海报轮播 ===== */
.poster-swiper{margin:12px 13px 0;overflow:hidden;position:relative;border-radius:14px}
.poster-track{display:flex;width:400%;transition:transform .42s ease}
.poster-card{flex:0 0 25%;padding:14px 13px 12px;min-height:108px;color:#fff;position:relative;overflow:hidden;box-shadow:0 4px 14px rgba(15,23,42,.08)}
.poster-card .poster-emoji{font-size:26px;margin-bottom:4px}
.poster-card .poster-title{font-size:15px;font-weight:700;line-height:1.3}
.poster-card .poster-sub{font-size:10.5px;opacity:.92;margin-top:3px;line-height:1.4}
.poster-card .poster-go{font-size:10.5px;margin-top:7px;background:rgba(255,255,255,.22);display:inline-block;padding:3px 10px;border-radius:11px}
.p1{background:linear-gradient(135deg,#4f46e5,#7c3aed)}
.p2{background:linear-gradient(135deg,#0ea5e9,#06b6d4)}
.p3{background:linear-gradient(135deg,#f59e0b,#f97316)}
.p4{background:linear-gradient(135deg,#10b981,#0d9488)}
.poster-dots{position:absolute;bottom:7px;left:0;right:0;display:flex;justify-content:center;gap:5px;z-index:2}
.poster-dots span{width:5px;height:5px;border-radius:50%;background:rgba(255,255,255,.5);transition:all .2s}
.poster-dots span.on{background:#fff;width:14px;border-radius:3px}
/* 搜索弹层 */
.tb-search-mask{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:200;display:none;align-items:flex-start;justify-content:center;padding-top:14vh}
.tb-search-mask.on{display:flex}
.tb-search-box{background:#fff;width:88%;max-width:380px;border-radius:14px;padding:14px;display:flex;gap:8px;align-items:center;position:relative;box-shadow:0 10px 30px rgba(0,0,0,.25)}
.tb-search-box input{flex:1;border:1px solid #e2e8f0;border-radius:10px;padding:9px 12px;font-size:14px;outline:0}
.tb-search-box input:focus{border-color:#4f46e5}
.tb-search-box button{background:#4f46e5;color:#fff;border:0;border-radius:10px;padding:9px 16px;font-size:13px;font-weight:600}
.tb-search-close{position:absolute;right:-7px;top:-7px;width:24px;height:24px;border-radius:50%;background:#fff;color:#475569;font-size:18px;line-height:22px;text-align:center;box-shadow:0 2px 6px rgba(0,0,0,.2);cursor:pointer}
/* 桌面适配 */
@media (min-width:640px){
  body{max-width:900px;margin:0 auto;background:#eef1f7}
  .container{max-width:900px}
  .topbar,.tabbar{max-width:900px}
  .tabbar{display:none}
  .grid4{grid-template-columns:repeat(4,1fr)}
  .feed{display:grid;grid-template-columns:repeat(2,1fr)}
  .poster-track{width:200%}
  .poster-card{flex:0 0 50%}
}
