/* 筝语课堂 H5 —— 中式配色：朱砂 #A2302B / 描金 #C8A06A / 宣纸 #FAF7F2 */
:root {
    --red: #A2302B;
    --red-d: #8a2723;
    --gold: #C8A06A;
    --paper: #FAF7F2;
    --ink: #2b2b2b;
    --gray: #8a8a8a;
    --line: #ece7df;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0; padding: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
    font-size: 15px; line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, li { list-style: none; margin: 0; padding: 0; }

/* 布局容器：移动端全宽，PC 居中 640px */
.app {
    max-width: 640px; margin: 0 auto; min-height: 100vh;
    background: var(--paper);
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
    position: relative;
}

/* ---------- 顶栏 ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: linear-gradient(135deg, var(--red) 0%, var(--red-d) 100%);
    color: #fff; padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
}
.topbar .tb-title { font-size: 17px; font-weight: 600; letter-spacing: 1px; }
.topbar .tb-back { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.topbar .tb-right { margin-left: auto; font-size: 13px; opacity: .9; }

/* ---------- 底部 Tab ---------- */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    max-width: 640px; margin: 0 auto;
    background: #fff; border-top: 1px solid var(--line);
    display: flex; padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
    flex: 1; padding: 8px 0 6px; text-align: center; font-size: 11px; color: var(--gray);
    display: block; min-height: 52px;
}
.tabbar a.on { color: var(--red); }
.tabbar svg { display: block; margin: 0 auto 3px; }

/* ---------- 通用卡片 ---------- */
.card {
    background: #fff; border-radius: 12px; padding: 14px; margin: 12px;
    box-shadow: 0 1px 6px rgba(120, 90, 60, .06);
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; }
.card-title::before {
    content: ''; width: 3px; height: 15px; background: var(--red);
    border-radius: 2px; margin-right: 8px;
}

/* ---------- Hero（参考 web 版首页） ---------- */
.h5-hero {
    position: relative; overflow: hidden; color: #fff;
    background: linear-gradient(120deg, #A2302B 0%, #7a2120 55%, #4d1617 100%);
    padding: 30px 20px 26px;
}
.h5-hero::before {
    content: ''; position: absolute; right: -40px; top: -50px; width: 180px; height: 180px;
    border: 1px solid rgba(200, 160, 106, .3); border-radius: 50%;
}
.h5-hero::after {
    content: ''; position: absolute; right: 30px; bottom: -70px; width: 130px; height: 130px;
    border: 1px solid rgba(200, 160, 106, .2); border-radius: 50%;
}
.h5-hero > * { position: relative; z-index: 2; }
.h5-hero .hh-sub { font-size: 12px; color: var(--gold); letter-spacing: 5px; }
.h5-hero .hh-title { font-size: 27px; font-weight: 700; letter-spacing: 2px; margin: 10px 0 8px; line-height: 1.3; }
.h5-hero .hh-desc { font-size: 13px; opacity: .88; max-width: 100%; line-height: 1.7; }
.hero-search {
    display: flex; margin-top: 18px; background: #fff; border-radius: 22px; padding: 4px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}
.hero-search input {
    flex: 1; border: none; outline: none; background: transparent; padding: 0 14px;
    font-size: 14px; color: #333; min-width: 0;
}
.hero-search button {
    border: none; background: linear-gradient(135deg, var(--red), var(--red-d)); color: #fff;
    padding: 0 20px; height: 38px; border-radius: 19px; font-size: 14px; flex: none;
}
.hero-stats { display: flex; gap: 18px; margin-top: 22px; }
.hero-stats .hstat { flex: 1; }
.hero-stats .n { font-size: 21px; font-weight: 700; color: var(--gold); line-height: 1.1; }
.hero-stats .t { font-size: 11px; opacity: .82; margin-top: 3px; }

/* ---------- 全站公告（后台「站点设置 → 手机端」填了才显示） ---------- */
.notice-bar {
    background: #fff8e6; color: #8a5a00; font-size: 12px;
    padding: 8px 14px; line-height: 1.6; border-bottom: 1px solid #f2e4c8;
}

/* ---------- 分类卡片网格（参考 web 版） ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px 14px 14px; }
.cat-card {
    background: #faf7f2; border: 1px solid var(--line); border-radius: 10px; padding: 14px 8px;
    text-align: center; transition: .2s;
}
.cat-card:active { background: #fdf3ee; border-color: var(--gold); }
.cat-card .ci { font-size: 22px; color: var(--red); font-weight: 700; }
.cat-card .cn { font-size: 14px; margin-top: 5px; font-weight: 600; color: #333; }
.cat-card .cd { font-size: 11px; color: var(--gray); margin-top: 2px; }

/* ---------- 优势网格（为什么选择我们） ---------- */
.feat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 14px 14px; }
.feat { background: #faf7f2; border: 1px solid var(--line); border-radius: 10px; padding: 16px 12px; text-align: center; }
.feat .fi { font-size: 22px; color: var(--gold); }
.feat .ft { font-size: 14px; font-weight: 600; margin: 6px 0 3px; color: #333; }
.feat .fd { font-size: 11px; color: var(--gray); line-height: 1.6; }
a.feat { text-decoration: none; color: inherit; display: block; }

/* ---------- 手机首页轮播图（后台「内容区块 → 手机站首页 · 轮播图」） ---------- */
/* 轮播图：满宽 + 同一时刻只显示一张（绝对叠放 + 淡入淡出，无 peek/无横向位移） */
.h5-banner { position: relative; padding: 12px 12px 4px; background: var(--paper); }
.hb-stage {
    position: relative; width: 100%; background: #eee; overflow: hidden;
    border-radius: 12px;
    /* 兜底：随屏宽缩放的高度（不支持 aspect-ratio 的旧浏览器走这条） */
    height: 42vw; max-height: 210px; min-height: 130px;
}
@supports (aspect-ratio: 75 / 32) {
    .hb-stage { height: auto; aspect-ratio: 75 / 32; }
}
.hb-item {
    position: absolute; inset: 0; opacity: 0;
    transition: opacity .5s ease; display: block;
}
.hb-item.on { opacity: 1; }
.hb-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 圆点指示器（覆盖在轮播图上，可点击切换） */
.hb-dots {
    position: absolute; left: 0; right: 0; bottom: 12px; z-index: 2;
    display: flex; justify-content: center; gap: 6px;
}
.hb-dots i {
    width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.5);
    transition: width .25s, background .25s; cursor: pointer;
}
.hb-dots i.on { width: 16px; border-radius: 3px; background: #fff; }

/* ---------- 手机首页快捷入口（后台「内容区块 → 手机站首页 · 快捷入口」） ---------- */
/* 5 列固定：5 个快捷入口（全部课程/打卡作业/免费试听/我的课程/客服中心）排一行不换行；
   条目更多时由 grid 自动换行成 5+1、5+2 … */
.quick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px 4px; padding: 12px 14px 16px; }
.quick-item { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: #444; min-width: 0; }
.quick-item .qi-ico {
    width: 42px; height: 42px; border-radius: 50%; background: #faf7f2; border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center; font-size: 19px; color: var(--red); margin-bottom: 6px;
}
.quick-item .qi-t { font-size: 12px; color: #555; text-align: center; line-height: 1.3; }

/* ---------- 课程卡片 ---------- */
.course-item {
    display: flex; gap: 12px; padding: 12px; margin: 0 12px 10px;
    background: #fff; border-radius: 12px; box-shadow: 0 1px 6px rgba(120, 90, 60, .06);
}
.course-cover {
    width: 108px; height: 76px; flex: none; border-radius: 8px; overflow: hidden;
    background: linear-gradient(135deg, #d9c3a5, #b8956a);
    display: flex; align-items: center; justify-content: center; color: #fff;
    font-size: 13px; font-weight: 600; text-align: center; padding: 6px; line-height: 1.35;
}
.course-cover img { width: 100%; height: 100%; object-fit: cover; }
.course-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.course-name { font-size: 15px; font-weight: 600; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.course-desc { font-size: 12px; color: var(--gray); margin: 4px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-meta { font-size: 11px; color: #aaa; margin-top: auto; }
.course-price { color: var(--red); font-size: 17px; font-weight: 700; }
.course-price small { font-size: 12px; font-weight: 400; }
.course-oPrice { font-size: 12px; color: #bbb; text-decoration: line-through; margin-left: 6px; }

/* ---------- 首页双列课程网格 ---------- */
.course-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 14px 14px; }
.course-grid .loading { grid-column: 1 / -1; padding: 40px 0; }
.course-grid-item {
    background: #fff; border-radius: 10px; overflow: hidden;
    box-shadow: 0 1px 6px rgba(120, 90, 60, .06); display: flex; flex-direction: column;
}
.course-grid-item:active { opacity: .92; }
.cgi-link { display: flex; flex-direction: column; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.cgi-cover {
    width: 100%; height: 96px; background: linear-gradient(135deg, #d9c3a5, #b8956a);
    display: flex; align-items: center; justify-content: center; color: #fff;
    font-size: 13px; font-weight: 600; text-align: center; padding: 8px; line-height: 1.35;
}
.cgi-cover img { width: 100%; height: 100%; object-fit: cover; }
.cgi-body { padding: 8px 10px 10px; flex: 1; display: flex; flex-direction: column; }
.cgi-name {
    font-size: 14px; font-weight: 600; line-height: 1.4; color: #2b2b2b;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 39px;
}
.cgi-meta { font-size: 11px; color: #aaa; margin: 5px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cgi-price { margin-top: auto; }
.cgi-price .course-price { font-size: 16px; }

/* ---------- 收藏心形按钮 ---------- */
.fav-heart {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0; border: none; cursor: pointer;
    background: rgba(255, 255, 255, .82); color: #bbb; border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12); transition: transform .12s ease, color .15s;
    -webkit-tap-highlight-color: transparent;
}
.fav-heart svg { width: 19px; height: 19px; display: block; }
.fav-heart.on { color: var(--red); }
.fav-heart.on svg { fill: var(--red); stroke: var(--red); }
.fav-heart:active { transform: scale(.85); }
.fav-heart[disabled] { opacity: .6; }

/* 课程列表卡：把链接与心形拆开成「链接 + 心形」两栏 */
.course-link { display: flex; gap: 12px; flex: 1; min-width: 0; text-decoration: none; color: inherit; }

/* 列表卡：心形叠加在封面右上角 */
.course-item { position: relative; }
.course-main .course-item .fav-heart {
    position: absolute; top: 18px; right: 18px; z-index: 2;
}

/* 双列网格卡：心形叠加在封面右上角 */
.course-grid-item { position: relative; }
.course-grid-item .fav-heart { position: absolute; top: 8px; right: 8px; z-index: 2; }

/* 详情页：心形贴在封面右上角 */
.fav-cover-wrap { position: relative; }
.fav-cover-wrap .fav-heart { position: absolute; top: 10px; right: 10px; z-index: 2; }

/* 详情页购买栏里的心形（与价格/按钮并列） */
.buybar .fav-heart { box-shadow: none; background: #f3ede4; flex: none; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid var(--line);
    background: #fff; color: var(--ink); font-size: 15px; cursor: pointer;
}
.btn:active { opacity: .8; }
.btn-primary { background: linear-gradient(135deg, var(--red), var(--red-d)); border-color: transparent; color: #fff; }
.btn-gold { background: linear-gradient(135deg, #d8b47c, #c1974f); border-color: transparent; color: #4a3208; }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 50px; font-size: 16px; border-radius: 25px; }
.btn:disabled { opacity: .5; }

/* ---------- 底部购买栏 ----------
 * 有 tabbar 的页面（全部 H5 页）：buybar 抬到 tabbar 上方，避免压住 tab */
.buybar {
    position: fixed; left: 0; right: 0; bottom: calc(52px + env(safe-area-inset-bottom)); z-index: 60; max-width: 640px; margin: 0 auto;
    background: #fff; border-top: 1px solid var(--line); padding: 10px 14px 10px;
    display: flex; align-items: center; gap: 12px;
}
/* 带购买/提交栏的页面：内容底部留白 = tabbar(52) + buybar(约64) + 余量 */
.app.has-buybar { padding-bottom: calc(128px + env(safe-area-inset-bottom)); }
.buybar .price { color: var(--red); font-size: 22px; font-weight: 700; }
.buybar .price small { font-size: 12px; font-weight: 400; }
.buybar .btn { flex: 1; margin-left: auto; }

/* ---------- 课时目录 ---------- */
.lesson {
    display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f4f1ec;
    font-size: 14px;
}
.lesson:last-child { border-bottom: none; }
.lesson .idx {
    width: 26px; height: 26px; flex: none; border-radius: 50%; background: #f3ede4; color: #8c7a5e;
    font-size: 12px; display: flex; align-items: center; justify-content: center;
}
.lesson .lt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson .free { font-size: 11px; color: #0a0; border: 1px solid #b7e3b7; border-radius: 3px; padding: 0 5px; }
.lesson .lock { width: 16px; height: 16px; flex: none; color: #bbb; }
.lesson .dur { font-size: 12px; color: #bbb; flex: none; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.field input {
    width: 100%; height: 46px; font-size: 16px; padding: 0 14px;   /* 16px 防止 iOS 自动缩放 */
    border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none;
}
.field input:focus { border-color: var(--gold); }

/* ---------- 播放器 ---------- */
.player-box { width: 100%; background: #000; }
.player-box .prism-player { width: 100% !important; }
.player-tip { background: #fff8e6; color: #8a6d1f; font-size: 12px; padding: 10px 14px; margin: 12px; border-radius: 8px; }

/* ---------- 支付方式选择 ---------- */
.pay-item {
    display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f4f1ec;
}
.pay-item:last-child { border-bottom: none; }
.pay-ico { width: 34px; height: 34px; flex: none; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.pay-ico.wx { background: #07c160; }
.pay-ico.ali { background: #1677ff; }
.pay-item .pn { flex: 1; font-size: 15px; }
.pay-item .pd { font-size: 12px; color: var(--gray); }
.radio { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 1px solid #ccc; position: relative; }
.radio.on { border-color: var(--red); background: var(--red); }
.radio.on::after { content: ''; position: absolute; left: 6px; top: 3px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(40deg); }

/* ---------- Toast ---------- */
.kc-toast {
    position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9);
    background: rgba(0, 0, 0, .8); color: #fff; padding: 12px 20px; border-radius: 8px;
    font-size: 14px; z-index: 9999; opacity: 0; transition: all .25s; max-width: 80%; text-align: center;
}
.kc-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- 空状态 / 加载 ---------- */
.empty { text-align: center; color: #bbb; padding: 50px 20px; font-size: 14px; }
.loading { text-align: center; color: #bbb; padding: 40px; font-size: 13px; }

/* ---------- 我的 ---------- */
.user-head {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-d) 100%);
    color: #fff; padding: 24px 16px 30px; display: flex; align-items: center; gap: 14px;
}
.user-head .avatar {
    width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, .22);
    display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.user-head .un { font-size: 17px; font-weight: 600; }
.user-head .us { font-size: 12px; opacity: .85; margin-top: 2px; }
.stat-row { display: flex; background: #fff; margin: 12px; border-radius: 12px; padding: 14px 0; box-shadow: 0 1px 6px rgba(120, 90, 60, .08); position: relative; }
.stat-row div { flex: 1; text-align: center; }
.stat-row .n { font-size: 19px; font-weight: 700; color: var(--red); }
.stat-row .t { font-size: 12px; color: var(--gray); }

.order-item { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f4f1ec; font-size: 14px; }
.order-item .oi-main { flex: 1; min-width: 0; }
.order-item .oi-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-item .oi-sub { font-size: 11px; color: #aaa; }
.order-item .oi-amt { color: var(--red); font-weight: 600; }
.order-item .oi-right { flex: 0 0 auto; text-align: right; }
.order-item .oi-act { margin-top: 7px; display: flex; gap: 8px; }
/* 订单操作按钮（去支付 / 查看课程） */
.oi-btn { display: inline-block; padding: 7px 16px; border-radius: 18px; background: var(--red);
    color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; line-height: 1; }
.oi-btn.ghost { background: #fff; color: var(--red); border: 1px solid var(--red); }
.oi-btn.gray { background: #fff; color: #999; border: 1px solid #ddd; }
.oi-btn:active { opacity: .85; }

/* ---------- 我的（增强版） ---------- */
.u-info { flex: 1; min-width: 0; }
.u-badge { margin-left: auto; background: rgba(255,255,255,.25); font-size: 11px; padding: 3px 9px; border-radius: 11px; }
.u-login-wrap { background: #fff; margin: 12px; padding: 18px 16px; border-radius: 12px; text-align: center; box-shadow: 0 1px 6px rgba(120,90,60,.08); }
.u-login-btn { width: 100%; background: linear-gradient(135deg, var(--red) 0%, var(--red-d) 100%); color: #fff; border: 0; border-radius: 24px; padding: 13px 0; font-size: 16px; font-weight: 600; }
.u-login-btn:active { opacity: .9; }
.u-login-tip { font-size: 12px; color: #999; margin-top: 10px; }

.mine-grid { display: flex; flex-wrap: wrap; background: #fff; margin: 12px; border-radius: 12px; padding: 16px 0; box-shadow: 0 1px 6px rgba(120,90,60,.06); }
.mg-item { flex: 0 0 33.333%; width: 33.333%; text-align: center; text-decoration: none; color: #333; padding: 8px 0; }
.mg-item:active { opacity: .6; }
.mg-ico { width: 42px; height: 42px; margin: 0 auto 7px; border-radius: 50%; background: #f7f1e8; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.mg-t { font-size: 12px; }

.mt-row { display: flex; background: #fff; margin: 12px 12px 0; border-radius: 10px 10px 0 0; overflow: hidden; border-bottom: 1px solid #f0ece4; }
.mt { flex: 1; text-align: center; padding: 13px 0; font-size: 15px; color: #888; position: relative; }
.mt.on { color: var(--red); font-weight: 600; }
.mt.on::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); bottom: 0; width: 28px; height: 2px; background: var(--red); }

.ci-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.ci-own { font-size: 12px; color: #0a0; }
.cgi-learn { color: var(--red); font-size: 13px; font-weight: 600; }

/* 登录弹层：微信快捷登录按钮 */
.lg-wx { width: 100%; margin-top: 10px; background: #07c160; color: #fff; border: 0; border-radius: 8px; padding: 12px 0; font-size: 15px; }
.lg-wx:active { opacity: .9; }


/* ---------- PC 大屏微调 ---------- */
@media (min-width: 700px) {
    .course-cover { width: 132px; height: 92px; }
    .banner { height: 150px; }
}

/* ==================== 资讯（帝国CMS 栏目内容） ==================== */
.tabs-scroll {
    display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px;
    background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 44px; z-index: 50;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tabs-scroll::-webkit-scrollbar { display: none; }
.tabs-scroll a {
    flex: none; padding: 6px 16px; border-radius: 16px; font-size: 14px;
    background: #f5f1ea; color: #666; white-space: nowrap;
}
.tabs-scroll a.on { background: var(--red); color: #fff; }

.news-cell { display: flex; gap: 12px; padding: 14px; background: #fff; border-bottom: 1px solid #f6f3ee; }
.news-cell .nc-thumb {
    width: 96px; height: 68px; flex: none; border-radius: 6px; overflow: hidden;
    background: linear-gradient(135deg, #f3eee6, #e8dfd1);
    display: flex; align-items: center; justify-content: center; font-size: 11px; color: #b9a48a;
}
.news-cell .nc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-cell .nc-body { flex: 1; min-width: 0; }
.news-cell .nc-t {
    font-size: 15px; font-weight: 600; line-height: 1.5; color: #222;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-cell .nc-d {
    font-size: 12px; color: #999; margin-top: 6px;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.news-cell .nc-m { font-size: 11px; color: #bbb; margin-top: 8px; display: flex; gap: 10px; }
.tag-top { background: var(--red); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 3px; margin-right: 5px; }

/* 文章正文 */
.article-wrap { background: #fff; padding: 16px 16px 30px; }
.article-t { font-size: 21px; font-weight: 700; line-height: 1.5; color: #1f1f1f; }
.article-m { font-size: 12px; color: #aaa; padding: 12px 0; border-bottom: 1px solid var(--line); }
.article-m span { margin-right: 12px; }
.article-c { font-size: 16px; line-height: 1.95; color: #333; padding-top: 6px; word-wrap: break-word; }
.article-c p { margin: 0 0 14px; }
.article-c img { border-radius: 8px; margin: 10px 0; }
.article-c h3 { font-size: 17px; margin: 18px 0 10px; }
.article-c blockquote { margin: 12px 0; padding: 10px 14px; background: #faf6f0; border-left: 3px solid var(--gold); color: #666; }
.pn-nav { display: flex; justify-content: space-between; gap: 14px; padding: 16px; font-size: 13px; color: #666; }
.pn-nav a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 48%; }

/* 首页「课堂动态」卡片 */
.block-card { background: #fff; margin: 12px 12px 0; border-radius: 10px; overflow: hidden; }
.block-head { display: flex; align-items: center; padding: 13px 14px 10px; }
.block-head .bh-t { font-size: 16px; font-weight: 600; }
.block-head .bh-m { margin-left: auto; font-size: 12px; color: var(--gray); }
.cell-link {
    display: flex; gap: 10px; padding: 11px 14px; border-top: 1px solid #f6f3ee; font-size: 14px; color: #333;
}
.cell-link .cl-t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-link .cl-d { flex: none; font-size: 12px; color: #bbb; }
.cell-link .cl-num { flex: none; width: 22px; color: var(--gold); font-size: 12px; font-weight: 600; }

/* ==================== 课程中心（左侧分类 + 右侧列表） ==================== */
.app-courses { height: 100vh; display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.app-courses .topbar { flex: none; -webkit-flex: none; }
.courses-body { flex: 1; -webkit-flex: 1; display: -webkit-flex; display: flex; -webkit-flex-direction: row; flex-direction: row; min-height: 0; padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
.cat-side {
    width: 140px; flex: 0 0 140px; -webkit-flex: 0 0 140px;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: #f7f3ec; border-right: 1px solid #ece4d8; padding: 8px 0 14px;
}
.cat-side-item {
    display: flex; align-items: center; gap: 6px;
    padding: 13px 10px 13px 12px; margin: 0 8px;
    font-size: 13.5px; color: #4a4a4a; cursor: pointer; position: relative;
    line-height: 1.35; border-radius: 10px; transition: all .15s;
}
.cat-side-item.has-child { font-weight: 600; color: #333; }
/* 与父栏目同一级（顶级）的栏目名加粗 */
.cat-side-item.lv0 { font-weight: 700; color: #333; }
.cat-side-item:active { background: rgba(162,48,43,.06); }
.cat-side-item.on {
    background: var(--red); color: #fff; font-weight: 700;
    box-shadow: 0 3px 10px rgba(162,48,43,.25);
}
.cat-side-children { display: none; background: transparent; }
.cat-side-children.open { display: block; }
/* 二级栏目与父栏目同缩进，栏目名左缘对齐父栏目 */
.cat-side-children .cat-side-item {
    font-size: 12.5px; color: #666; margin: 0 8px;
    padding: 11px 10px 11px 12px;
}
/* 三级及以下再向右缩进，保持更深层级关系 */
.cat-side-children .cat-side-children .cat-side-item { padding-left: 26px; }
.cat-side-children .cat-side-item.on { color: #fff; }
.cat-side-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cat-side-item.on > .cat-side-name { -webkit-line-clamp: 2; }
.cat-caret {
    width: 16px; height: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center;
    transition: transform .2s; color: #999; font-size: 10px;
}
.cat-caret::before { content: '▶'; }
.cat-caret-empty { visibility: hidden; }
.cat-caret-empty::before { content: ''; }
.cat-side-item.open > .cat-caret { transform: rotate(90deg); }
.cat-side-item.on > .cat-caret { color: rgba(255,255,255,.8); }
.course-main { flex: 1; -webkit-flex: 1; min-width: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.course-main .course-item { margin: 0 10px 10px; }

/* ---------- 顶栏投屏按钮 ---------- */
.tb-cast {
    margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
    color: #fff; font-size: 13px; opacity: .95; padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, .4); border-radius: 16px;
}
.tb-cast svg { width: 18px; height: 18px; }
.tb-cast:active { opacity: .7; }
