/* 课件平台（courseware）样式 — 天一急救官网 */
.cw-hero { background: linear-gradient(135deg, #001ae6 0%, #0a3cff 55%, #a633d9 130%); color: #fff; padding: 60px 0 52px; }
.cw-hero h1 { font-size: 34px; margin: 0 0 12px; letter-spacing: .5px; }
.cw-hero p { max-width: 780px; opacity: .92; line-height: 1.75; margin: 0; }
.cw-notice { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.cw-notice .cw-chip { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28); padding: 8px 14px; border-radius: 999px; font-size: 13px; }

.cw-section { padding: 40px 0 64px; background: #f7f9fc; min-height: 50vh; }
.cw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; margin-top: 8px; }
.cw-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease; }
.cw-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0, 26, 230, .12); }
.cw-card-cover { aspect-ratio: 16 / 9; background: #eef1f8; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cw-card-cover img { width: 100%; height: 100%; object-fit: contain; }
.cw-card-cover--video { background: linear-gradient(135deg, #001ae6, #a633d9); }
.cw-play { color: #fff; font-size: 42px; text-shadow: 0 2px 12px rgba(0, 0, 0, .3); }
.cw-card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cw-badge { align-self: flex-start; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #e8ebff; color: #001ae6; font-weight: 600; }
.cw-badge--video { background: #f3e6fb; color: #a633d9; }
.cw-card-title { font-size: 18px; margin: 0; line-height: 1.4; }
.cw-card-summary { font-size: 13px; color: #5b6478; margin: 0; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cw-card-meta { font-size: 12px; color: #8a93a6; }
.cw-card-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 8px; }
.cw-empty { text-align: center; color: #8a93a6; padding: 60px 20px; }

/* 查看器 */
.cw-view-head { padding: 18px 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cw-view-head h1 { font-size: 22px; margin: 0; }
.cw-stage { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 10px 0; }
.cw-slide-box { position: relative; flex: 1; max-width: 1000px; background: #11142b; border-radius: 12px; min-height: 320px; display: flex; align-items: center; justify-content: center; padding: 8px; }
.cw-slide { max-width: 100%; max-height: 72vh; display: block; border-radius: 6px; cursor: zoom-in; }
.cw-loading { position: absolute; color: #cdd3e6; font-size: 14px; pointer-events: none; }
.cw-nav { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%; border: 1px solid #e2e8f0; background: #fff; font-size: 26px; line-height: 1; cursor: pointer; color: #001ae6; transition: background .15s; }
.cw-nav:hover { background: #e8ebff; }
.cw-nav:disabled { opacity: .35; cursor: not-allowed; }
.cw-view-bar { display: flex; align-items: center; gap: 14px; justify-content: center; padding: 16px 0; flex-wrap: wrap; }
.cw-counter { font-size: 15px; color: #333; display: flex; align-items: center; gap: 6px; }
.cw-page-input { width: 58px; padding: 4px 6px; border: 1px solid #e2e8f0; border-radius: 8px; text-align: center; }
.cw-thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 10px 2px 24px; }
.cw-thumb { flex: 0 0 auto; width: 124px; height: 70px; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #eef1f8; cursor: pointer; padding: 0; }
.cw-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cw-thumb.active { border-color: #001ae6; }
.cw-video-wrap { max-width: 1000px; margin: 0 auto; background: #000; border-radius: 12px; overflow: hidden; }
.cw-video { width: 100%; max-height: 76vh; display: block; }

/* 下载弹窗 */
.cw-modal-mask { position: fixed; inset: 0; background: rgba(10, 14, 30, .55); display: none; align-items: center; justify-content: center; z-index: 9999; padding: 20px; }
.cw-modal-mask.open { display: flex; }
.cw-modal { background: #fff; border-radius: 16px; padding: 26px 24px; width: 100%; max-width: 380px; position: relative; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.cw-modal-close { position: absolute; top: 10px; right: 14px; border: none; background: none; font-size: 24px; cursor: pointer; color: #8a93a6; line-height: 1; }
.cw-modal-title { margin: 0 0 6px; font-size: 20px; }
.cw-modal-sub { margin: 0 0 16px; font-size: 13px; color: #5b6478; line-height: 1.6; }
.cw-field-label { display: block; font-size: 13px; color: #333; margin-bottom: 6px; }
.cw-input { width: 100%; padding: 11px 12px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 15px; box-sizing: border-box; }
.cw-input:focus { outline: none; border-color: #001ae6; box-shadow: 0 0 0 3px rgba(0, 26, 230, .12); }
.cw-modal-err { color: #d23b3b; font-size: 13px; min-height: 18px; margin: 8px 0; }
.cw-modal-submit { width: 100%; margin-top: 4px; }

/* 幻灯片放大 / 全屏 */
.cw-zoom-mask { position: fixed; inset: 0; background: rgba(8, 11, 24, .92); display: none; z-index: 10000; overflow: hidden; }
.cw-zoom-mask.open { display: block; }
.cw-zoom-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 12px; justify-content: center; padding: 14px; background: linear-gradient(to bottom, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0)); }
.cw-zoom-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .12); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; transition: background .15s; }
.cw-zoom-btn:hover { background: rgba(255, 255, 255, .26); }
.cw-zoom-close { font-size: 20px; }
.cw-zoom-val { color: #fff; font-size: 14px; min-width: 52px; text-align: center; }
.cw-zoom-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 70px 24px 24px; }
.cw-zoom-img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center; cursor: grab; user-select: none; }
.cw-zoom-img:active { cursor: grabbing; }

@media (max-width: 640px) {
  .cw-hero h1 { font-size: 26px; }
  .cw-nav { width: 38px; height: 38px; font-size: 22px; }
  .cw-slide { max-height: 58vh; }
}

/* ===== 列表页：工具栏 / 分类筛选 / 已看标记 ===== */
.cw-list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 18px 0 6px; }
.cw-toolbar-left { display: flex; gap: 10px; flex-wrap: wrap; }
.cw-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cw-chip-btn { border: 1px solid #d8deea; background: #fff; color: #333; padding: 7px 14px; border-radius: 999px; font-size: 13px; cursor: pointer; transition: all .15s; }
.cw-chip-btn:hover { border-color: #001ae6; color: #001ae6; }
.cw-chip-btn.is-active { background: #001ae6; border-color: #001ae6; color: #fff; }
.cw-badge-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cw-done-badge { font-size: 11px; color: #1bbf7a; background: #e6f8f0; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.cw-card.is-watched { border-color: #bfe9d4; }
.cw-card.is-watched .cw-card-cover--video { filter: saturate(.85); }

/* ===== 查看器：视频 + 播放列表布局 ===== */
.cw-view-layout { display: flex; gap: 22px; align-items: flex-start; }
.cw-player-col { flex: 1 1 auto; min-width: 0; }
.cw-playlist-col { flex: 0 0 330px; align-self: flex-start; position: sticky; top: 14px; max-height: calc(100vh - 40px); overflow: hidden; display: flex; flex-direction: column; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 26, 230, .06); }
.cw-playlist-head { padding: 13px 16px; font-weight: 700; font-size: 15px; border-bottom: 1px solid #eef1f8; display: flex; justify-content: space-between; align-items: center; }
.cw-playlist-count { font-size: 12px; color: #8a93a6; font-weight: 500; }
.cw-playlist { overflow-y: auto; padding: 8px; flex: 1 1 auto; }
.cw-pl-cat { font-size: 12px; color: #8a93a6; padding: 12px 10px 4px; font-weight: 600; }
.cw-pl-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none; background: none; padding: 9px 10px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.cw-pl-item:hover { background: #f2f5ff; }
.cw-pl-item.is-active { background: #e8ebff; }
.cw-pl-ic { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; background: #eef1f8; color: #001ae6; font-size: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.cw-pl-item.is-active .cw-pl-ic { background: #001ae6; color: #fff; }
.cw-pl-item.is-watched .cw-pl-ic { background: #1bbf7a; color: #fff; }
.cw-pl-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cw-pl-title { font-size: 14px; color: #1f2533; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cw-pl-item.is-active .cw-pl-title { color: #001ae6; font-weight: 700; }
.cw-pl-prog { height: 4px; background: #eef1f8; border-radius: 999px; overflow: hidden; }
.cw-pl-prog i { display: block; height: 100%; background: #001ae6; }
.cw-pl-done { font-size: 11px; color: #1bbf7a; flex: 0 0 auto; }

/* 控制条：上一集/下一集/位置/自动连播/倍速/列表 */
.cw-pos { font-size: 13px; color: #5b6478; }
.cw-auto-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #333; cursor: pointer; user-select: none; }
.cw-auto-toggle input { accent-color: #001ae6; }
.cw-speed { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #333; }
.cw-speed select { padding: 4px 6px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; background: #fff; }
.cw-pl-toggle { display: none; }

/* 视频容器定位（供连播倒计时覆盖） */
.cw-video-wrap { position: relative; }

/* 连播倒计时遮罩 */
.cw-countdown { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .55); z-index: 5; }
.cw-countdown[hidden] { display: none; }
.cw-countdown-box { text-align: center; color: #fff; padding: 20px; max-width: 320px; }
.cw-countdown-label { font-size: 14px; opacity: .85; }
.cw-countdown-next { font-size: 18px; font-weight: 700; margin: 8px 0; line-height: 1.4; }
.cw-countdown-num { font-size: 50px; font-weight: 800; margin: 6px 0 16px; }

@media (max-width: 900px) {
  .cw-view-layout { flex-direction: column; }
  .cw-playlist-col { flex: 1 1 auto; width: 100%; position: static; max-height: 56vh; display: none; }
  .cw-playlist-col.is-open { display: flex; }
  .cw-pl-toggle { display: inline-block; }
}

/* ===== 流畅性：骨架屏 / 缓冲 / 错误 / 预载 ===== */
.cw-card--skeleton .cw-skeleton-block,
.cw-skeleton-line { background: linear-gradient(90deg, #eef1f8 25%, #e2e8f0 37%, #eef1f8 63%); background-size: 400% 100%; animation: cw-shimmer 1.3s ease-in-out infinite; border-radius: 8px; }
.cw-skeleton-block { width: 100%; height: 100%; aspect-ratio: 16 / 9; }
.cw-skeleton-line { height: 12px; margin: 6px 0; }
.cw-skeleton-line.w60 { width: 60%; }
.cw-skeleton-line.w90 { width: 90%; }
.cw-skeleton-line.w40 { width: 40%; }
@keyframes cw-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.cw-video-wrap { background: radial-gradient(circle at 50% 38%, #1a1f3a 0%, #05060f 100%); }
.cw-preload { position: absolute; width: 1px; height: 1px; left: -9999px; top: -9999px; opacity: 0; pointer-events: none; }

.cw-buffering { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; flex-direction: column; color: #fff; font-size: 14px; background: rgba(0, 0, 0, .28); z-index: 4; }
.cw-buffering[hidden] { display: none; }
.cw-spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .28); border-top-color: #fff; animation: cw-spin .8s linear infinite; }
@keyframes cw-spin { to { transform: rotate(360deg); } }

.cw-video-error { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .62); z-index: 6; }
.cw-video-error[hidden] { display: none; }
.cw-video-error-box { text-align: center; color: #fff; }
.cw-video-error-msg { font-size: 16px; margin-bottom: 14px; }

/* 视频卡片封面：渐变 + 播放按钮浮动阴影，更醒目 */
.cw-card-cover--video { position: relative; }
.cw-card-cover--video::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .28), transparent 55%); }
.cw-card-cover--video .cw-play { position: relative; transition: transform .18s ease; }
.cw-card:hover .cw-card-cover--video .cw-play { transform: scale(1.12); }

/* 列表页重试按钮间距 */
.cw-empty .btn { cursor: pointer; }

/* ===== 完善：封面铺满 + 搜索框 + 续播标记 ===== */
.cw-card-cover { background-size: cover; background-position: center; background-repeat: no-repeat; }
.cw-card-cover--video { background-size: cover; background-position: center; background-repeat: no-repeat; }

.cw-search-wrap { position: relative; display: inline-flex; align-items: center; }
.cw-search { width: 240px; max-width: 56vw; padding: 9px 12px 9px 36px; border: 1px solid #d8deea; border-radius: 999px; font-size: 14px; background: #fff; box-sizing: border-box; transition: border-color .15s, box-shadow .15s; }
.cw-search:focus { outline: none; border-color: #001ae6; box-shadow: 0 0 0 3px rgba(0, 26, 230, .12); }
.cw-search-ic { position: absolute; left: 12px; font-size: 14px; opacity: .55; pointer-events: none; }

.cw-resume-badge { font-size: 11px; color: #b06a00; background: #fff3e0; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.cw-pl-resume { font-size: 11px; color: #b06a00; margin-left: 6px; font-weight: 600; }

@media (max-width: 640px) {
  .cw-search { width: 100%; max-width: none; }
  .cw-toolbar-left { flex-direction: column; align-items: stretch; width: 100%; }
}

