/* ========== H5 公共样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Helvetica Neue', sans-serif;
  background: #f5f5f5;
  color: #333;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* 顶部导航 */
.nav-bar {
  position: sticky; top: 0; z-index: 100;
  background: #fff; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #eee; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.nav-bar .back { font-size: 20px; color: #333; cursor: pointer; }
.nav-bar .title { font-size: 16px; font-weight: 600; }
.nav-bar .right { font-size: 13px; color: #999; }

/* Tab栏 */
.tab-bar {
  position: sticky; top: 52px; z-index: 99;
  background: #fff; display: flex; border-bottom: 1px solid #f0f0f0;
}
.tab-bar .tab {
  flex: 1; text-align: center; padding: 10px 0;
  font-size: 14px; color: #666; cursor: pointer; position: relative;
}
.tab-bar .tab.active { color: #4F46E5; font-weight: 600; }
.tab-bar .tab.active::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 3px; background: #4F46E5; border-radius: 2px;
}

/* 课程卡片 */
.course-card {
  background: #fff; border-radius: 10px; margin: 10px 12px;
  overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  cursor: pointer; transition: transform 0.15s;
}
.course-card:active { transform: scale(0.98); }
.course-card .cover {
  width: 100%; height: 160px; background: #e0e0e0; object-fit: cover;
}
.course-card .info { padding: 12px; }
.course-card .info .t { font-size: 15px; font-weight: 600; line-height: 1.4; margin-bottom: 6px; }
.course-card .info .s { font-size: 12px; color: #999; margin-bottom: 8px; }
.course-card .info .price { display: flex; align-items: baseline; gap: 8px; }
.course-card .info .price .now { font-size: 18px; color: #FF4444; font-weight: 700; }
.course-card .info .price .orig { font-size: 12px; color: #ccc; text-decoration: line-through; }
.course-card .info .price .free { font-size: 18px; color: #07C160; font-weight: 700; }
.course-card .info .meta { display: flex; gap: 12px; margin-top: 6px; font-size: 11px; color: #999; }

/* 按钮 */
.btn {
  display: block; width: 100%; padding: 12px; border: none; border-radius: 8px;
  font-size: 16px; font-weight: 600; cursor: pointer; transition: opacity 0.2s;
}
.btn:active { opacity: 0.85; }
.btn-primary { background: #4F46E5; color: #fff; }
.btn-wx { background: #07C160; color: #fff; }
.btn-danger { background: #FF4444; color: #fff; }
.btn-outline { background: #fff; color: #4F46E5; border: 1px solid #4F46E5; }
.btn-disabled { background: #ccc; color: #fff; cursor: not-allowed; }
.btn-sm { display: inline-block; width: auto; padding: 6px 14px; font-size: 13px; border-radius: 6px; }

/* 标签 */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 500;
}
.tag-live { background: #FFF0F0; color: #FF4444; }
.tag-recorded { background: #F0F5FF; color: #4F46E5; }
.tag-free { background: #F0FFF4; color: #07C160; }
.tag-video { background: #EFF6FF; color: #2563EB; }
.tag-text { background: #F0FDF4; color: #16A34A; }
.tag-audio { background: #FFF7ED; color: #EA580C; }
.tag-mixed { background: #FAF5FF; color: #9333EA; }

/* 内容形式筛选栏 */
.form-filter-bar {
  display: flex; gap: 0; padding: 0 12px; overflow-x: auto;
  background: #fff; border-bottom: 1px solid #f0f0f0;
}
.form-tab {
  padding: 8px 14px; font-size: 13px; color: #666; white-space: nowrap; cursor: pointer;
  border-bottom: 2px solid transparent; transition: all .2s;
}
.form-tab.active { color: #4F46E5; font-weight: 600; border-bottom-color: #4F46E5; }

/* 直播卡片 */
.live-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px; margin: 10px 12px; padding: 16px;
  color: #fff; cursor: pointer; position: relative; overflow: hidden;
}
.live-card .live-badge {
  display: inline-block; background: rgba(255,68,68,0.9); padding: 2px 8px;
  border-radius: 4px; font-size: 11px; margin-bottom: 8px;
}
.live-card .live-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.live-card .live-time { font-size: 12px; opacity: 0.85; }
.live-card .live-count { font-size: 12px; opacity: 0.85; margin-top: 4px; }

/* 直播间 */
.live-room {
  position: relative; width: 100%; height: 100vh; background: #000; overflow: hidden;
}
.live-room video { width: 100%; height: 42vh; object-fit: cover; background: #000; }
.live-room .live-overlay {
  position: absolute; top: 0; left: 0; right: 0; padding: 12px 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
  display: flex; justify-content: space-between; align-items: flex-start;
}
.live-room .live-badge-top {
  background: #FF4444; color: #fff; padding: 4px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px;
}
.live-room .viewer-count {
  background: rgba(0,0,0,0.5); color: #fff; padding: 4px 10px; border-radius: 12px;
  font-size: 12px;
}
.live-room .chat-area {
  height: 40vh; overflow-y: auto; padding: 10px 12px; background: #1a1a1a;
}
.live-room .chat-msg {
  margin-bottom: 8px; display: flex; align-items: flex-start; gap: 8px;
}
.live-room .chat-msg .avatar {
  width: 28px; height: 28px; border-radius: 50%; background: #333; flex-shrink: 0;
}
.live-room .chat-msg .bubble {
  background: rgba(255,255,255,0.1); border-radius: 10px; padding: 6px 10px;
  max-width: 75%;
}
.live-room .chat-msg .bubble .name { font-size: 11px; color: #FFD700; margin-bottom: 2px; }
.live-room .chat-msg .bubble .text { font-size: 13px; color: #fff; }
.live-room .product-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  border-top: 1px solid #eee;
}
.live-room .product-bar .p-img { width: 40px; height: 40px; border-radius: 6px; background: #f0f0f0; }
.live-room .product-bar .p-info { flex: 1; }
.live-room .product-bar .p-name { font-size: 13px; font-weight: 500; }
.live-room .product-bar .p-price { font-size: 15px; color: #FF4444; font-weight: 700; }

/* 播放器页 */
.player-page video { width: 100%; height: 210px; background: #000; object-fit: cover; }
.player-page .chapter-list { background: #fff; }
.player-page .chapter-item {
  display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
}
.player-page .chapter-item .idx {
  width: 28px; height: 28px; border-radius: 50%; background: #f0f0f5;
  display: flex; align-items: center; justify-content: center; font-size: 13px; color: #666; flex-shrink: 0;
}
.player-page .chapter-item.active .idx { background: #4F46E5; color: #fff; }
.player-page .chapter-item .c-info { flex: 1; margin-left: 10px; }
.player-page .chapter-item .c-title { font-size: 14px; }
.player-page .chapter-item .c-meta { font-size: 11px; color: #999; margin-top: 2px; }
.player-page .chapter-item .c-lock { color: #ccc; font-size: 14px; }
.player-page .chapter-item .free-tag {
  font-size: 10px; background: #F0FFF4; color: #07C160; padding: 1px 6px; border-radius: 3px; margin-left: 6px;
}

/* 图文内容渲染样式 */
#textContent img { max-width: 100%; height: auto; border-radius: 8px; margin: 10px 0; }
#textContent h1, #textContent h2, #textContent h3 { font-size: 17px; font-weight: 600; margin: 16px 0 8px; color: #333; }
#textContent p { margin: 8px 0; }
#textContent ul, #textContent ol { padding-left: 20px; margin: 8px 0; }
#textContent li { margin: 4px 0; }
#textContent blockquote { border-left: 3px solid #4F46E5; padding-left: 12px; margin: 10px 0; color: #666; }
#textContent a { color: #4F46E5; text-decoration: none; }
#textContent strong { font-weight: 600; }

/* 空状态 */
.empty-state {
  text-align: center; padding: 60px 20px; color: #999;
  min-height: calc(100vh - 240px);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .text { font-size: 14px; }

/* 底部固定栏 */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; padding: 10px 16px; border-top: 1px solid #eee;
  display: flex; align-items: center; gap: 12px; z-index: 100;
}
.bottom-bar .price-area { flex: 1; }
.bottom-bar .price-area .now { font-size: 22px; color: #FF4444; font-weight: 700; }
.bottom-bar .price-area .orig { font-size: 13px; color: #ccc; text-decoration: line-through; }
.bottom-bar .btn { width: auto; padding: 10px 28px; }

/* Loading */
.loading { text-align: center; padding: 40px; color: #999; font-size: 14px; }
.loading .spinner {
  width: 32px; height: 32px; border: 3px solid #f0f0f0; border-top-color: #4F46E5;
  border-radius: 50%; margin: 0 auto 10px; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 列表 */
.list-item {
  background: #fff; padding: 14px 16px; margin: 8px 12px; border-radius: 8px;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.list-item .li-cover { width: 80px; height: 60px; border-radius: 6px; background: #f0f0f0; object-fit: cover; flex-shrink: 0; }
.list-item .li-info { flex: 1; min-width: 0; }
.list-item .li-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-meta { font-size: 11px; color: #999; }
.list-item .li-status { font-size: 12px; padding: 2px 8px; border-radius: 4px; }
.li-status-paid { background: #F0FFF4; color: #07C160; }
.li-status-unpaid { background: #FFF0F0; color: #FF4444; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: #fff; border-radius: 12px; width: 88%; max-width: 360px; overflow: hidden;
}
.modal-box .m-header { padding: 16px; font-size: 16px; font-weight: 600; text-align: center; border-bottom: 1px solid #f0f0f0; }
.modal-box .m-body { padding: 20px 16px; }
.modal-box .m-footer { display: flex; border-top: 1px solid #f0f0f0; }
.modal-box .m-footer .m-btn { flex: 1; padding: 14px; text-align: center; font-size: 15px; cursor: pointer; }
.modal-box .m-footer .m-btn.cancel { color: #999; }
.modal-box .m-footer .m-btn.confirm { color: #4F46E5; font-weight: 600; border-left: 1px solid #f0f0f0; }

/* 搜索栏 */
.search-bar {
  background: #fff; padding: 8px 12px; display: flex; align-items: center; gap: 8px;
}
.search-bar input {
  flex: 1; height: 36px; border: none; background: #f5f5f5; border-radius: 18px;
  padding: 0 16px; font-size: 14px; outline: none;
}

/* 公众号关注悬浮窗 */
.follow-float {
  position: fixed; right: 16px; bottom: 24px; z-index: 150;
  display: flex; align-items: center; gap: 0;
  background: #4F46E5; border-radius: 22px; padding: 0; overflow: hidden;
  box-shadow: 0 4px 16px rgba(79,70,229,0.3);
  transition: all 0.3s; max-width: 48px; transition: max-width 0.3s;
}
.follow-float.expanded { max-width: 240px; }
.follow-float .ff-icon {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff; flex-shrink: 0; cursor: pointer;
}
.follow-float .ff-body {
  display: flex; align-items: center; gap: 8px; padding-right: 12px;
  white-space: nowrap; overflow: hidden;
}
.follow-float .ff-text { color: #fff; font-size: 13px; }
.follow-float .ff-btn {
  background: #fff; color: #4F46E5; font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 12px; flex-shrink: 0;
}

/* 关注弹窗 */
.follow-modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 300;
  display: none; align-items: center; justify-content: center;
}
.follow-modal-mask.show { display: flex; }
.follow-modal {
  background: #fff; border-radius: 16px; width: 82%; max-width: 340px; overflow: hidden; text-align: center;
}
.follow-modal .fm-close { position: absolute; top: 12px; right: 12px; font-size: 22px; color: #fff; cursor: pointer; }
.follow-modal .fm-banner { height: 120px; background: #4F46E5; display: flex; align-items: center; justify-content: center; }
.follow-modal .fm-banner-text { color: #fff; font-size: 20px; font-weight: 600; }
.follow-modal .fm-body { padding: 24px 20px 20px; }
.follow-modal .fm-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.follow-modal .fm-desc { font-size: 13px; color: #666; margin-bottom: 16px; line-height: 1.6; }
.follow-modal .fm-qr { width: 160px; height: 160px; margin: 0 auto 16px; background: #f5f5f5; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.follow-modal .fm-qr img { width: 100%; height: 100%; border-radius: 8px; }
.follow-modal .fm-tip { font-size: 12px; color: #999; margin-bottom: 16px; }
.follow-modal .fm-btn { background: #4F46E5; color: #fff; border: none; border-radius: 24px; padding: 12px 40px; font-size: 15px; font-weight: 600; }

/* 企微活码悬浮窗 */
.wecom-live-float {
  position: fixed; right: 16px; bottom: 84px; z-index: 998;
}
.wecom-live-float .wl-icon {
  background: #07C160; width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 12px rgba(7,193,96,0.4);
  transition: transform 0.3s;
}
.wecom-live-float .wl-icon:active { transform: scale(0.95); }
.wecom-live-float .wl-icon span { font-size: 24px; }
.wecom-live-panel {
  display: none; position: absolute; right: 0; bottom: 60px;
  background: #fff; border-radius: 12px; padding: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15); width: 200px; text-align: center;
}
.wecom-live-panel.show { display: block; }
.wecom-live-panel .wl-name { font-size: 14px; font-weight: 600; color: #333; margin-bottom: 8px; }
.wecom-live-panel .wl-desc { font-size: 12px; color: #999; margin-bottom: 10px; }
.wecom-live-panel .wl-qr { width: 160px; height: 160px; border-radius: 8px; border: 1px solid #f0f0f0; }
.wecom-live-panel .wl-tip { font-size: 11px; color: #999; margin-top: 8px; }

/* H5 点赞评论 */
.h5-like-bar { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: #fff; border-bottom: 1px solid #f0f0f0; }
.h5-like-btn { display: flex; align-items: center; gap: 6px; padding: 6px 16px; background: #f5f5f5; border-radius: 20px; cursor: pointer; }
.h5-like-btn.active .h5-like-icon { color: #FF4D4F; }
.h5-like-icon { font-size: 18px; color: #999; }
.h5-like-count { font-size: 13px; color: #666; }
.h5-share-btn { display: flex; align-items: center; gap: 6px; padding: 6px 16px; background: #f5f5f5; border-radius: 20px; cursor: pointer; }
.h5-share-btn .h5-share-icon { font-size: 16px; color: #666; }
.h5-share-btn .h5-share-text { font-size: 13px; color: #666; }

.h5-comments { background: #fff; padding: 16px; margin-top: 8px; }
.h5-comments .hc-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.h5-comment-input-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.h5-comment-input { flex: 1; height: 38px; border: 1px solid #e0e0e0; border-radius: 19px; padding: 0 16px; font-size: 14px; outline: none; }
.h5-comment-input:focus { border-color: #4F46E5; }
.h5-comment-submit { padding: 8px 20px; background: #4F46E5; color: #fff; font-size: 13px; border: none; border-radius: 19px; cursor: pointer; flex-shrink: 0; }
.h5-comment-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f5f5f5; }
.h5-comment-item:last-child { border-bottom: none; }
.h5-comment-avatar { width: 32px; height: 32px; border-radius: 50%; background: #e8e8e8; flex-shrink: 0; object-fit: cover; }
.h5-comment-body { flex: 1; }
.h5-comment-nick { font-size: 13px; font-weight: 500; color: #333; }
.h5-comment-time { font-size: 11px; color: #ccc; float: right; }
.h5-comment-text { font-size: 14px; color: #333; line-height: 1.6; margin-top: 4px; word-break: break-all; }
.h5-load-more { text-align: center; padding: 12px; color: #4F46E5; font-size: 13px; cursor: pointer; }
.h5-no-comments { text-align: center; padding: 20px; color: #ccc; font-size: 13px; }
