/* ==========================================================
   课程详情 course-detail.css
   参考 "课程详情 Course Detail.jpg"
   - 继承 home.css :root 变量
   ========================================================== */

/* ============ 面包屑 ============ */
.iti-cd-crumbs {
    background: var(--iti-bg);
    /* border-bottom: 1px solid var(--iti-bg-soft-2); */
}
.iti-cd-crumbs .iti-container {
    padding-top: 14px;
    padding-bottom: 14px;
    font-size: 12px;
    color: var(--iti-text-light);
}
.iti-cd-crumbs a { color: var(--iti-text-light); text-decoration: none; }
.iti-cd-crumbs a:hover { color: var(--iti-primary); }
.iti-cd-crumbs .sep { margin: 0 8px; color: var(--iti-bg-soft-2); }
.iti-cd-crumbs .cur { color: var(--iti-navy); font-weight: 600; }

/* ============ 主体：左右两栏 ============
   左 iti-cd-content ：大封面 → 课程简介 → 关键主题
   右 iti-cd-sidebar ：课程信息卡（sticky，高度贯穿整个内容区）
   ========================================== */
.iti-cd-main {
    position: relative;
    background: var(--iti-bg);
    overflow: hidden;
    padding: 32px 0 52px;
}
.iti-cd-jiesuo {
    width: 1160px;
    margin: 0 auto;
    padding: 4px 20px;
    display: flex;
    align-items: center;
    background-color: var(--iti-primary);
    margin-bottom: 14px;
    
}
.iti-cd-jiesuo img {
    width: 16px;
}
    .iti-cd-jiesuo span {
    font-size: 14px;
    color: #fff;
    margin-left: 6px;
}
.iti-cd-jiesuo button {
    padding: 2px 10px;
    font-size: 13px;
    background-color: #ecf4f5;
    color: var(--iti-primary);
    border-radius: 99px;
    margin-left: auto;

}
.iti-cd-main-deco {
    position: absolute;
    top: 10px;
    right: 20px;
    width: 150px;
    height: 150px;
    background:
        radial-gradient(circle at 30% 30%, var(--iti-primary) 0 38%, transparent 39%),
        radial-gradient(circle at 70% 60%, var(--iti-yellow)  0 30%, transparent 31%),
        radial-gradient(circle at 45% 80%, var(--iti-navy)    0 24%, transparent 25%);
    opacity: 0.75;
    pointer-events: none;
}

.iti-cd-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
}

/* ---- 左：主内容 ---- */
.iti-cd-content { min-width: 0; }

.iti-cd-content-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--iti-navy);
    line-height: 1.35;
    margin-bottom: 10px;
}

.iti-cd-block {
    background: #fff;
    border-radius: var(--iti-radius-lg);
    padding: 24px 28px;
    box-shadow: 0 1px 2px rgba(15, 31, 61, 0.04);
}

.iti-cd-preview { margin-bottom: 0; }

/* ---- 左：课件播放窗口（iframe，参考 /course/view） ---- */
.iti-cd-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 260px;
    border-radius: var(--iti-radius-lg);
    overflow: hidden;
    background: var(--iti-navy);
    box-shadow: 0 8px 24px rgba(15, 31, 61, 0.12);
}

.iti-cd-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #fff;
}

/* ---- 全屏切换按钮 ---- */
.iti-cd-fs {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 7;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(15, 31, 61, 0.55);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--iti-transition), transform var(--iti-transition);
}
.iti-cd-fs:hover {
    background: var(--iti-primary);
    transform: scale(1.06);
}
/* 进入 / 退出两个图标按状态切换。
   注意：这里不要用 `.iti-cd-fs svg { display:block }` 这类选择器——
   它的特异性(0,1,1)高于单类选择器，会把「退出」图标也一起显示出来。 */
.iti-cd-fs-icon { width: 18px; height: 18px; display: none; }
.iti-cd-fs-icon--enter { display: block; }
.iti-cd-player.is-fullscreen .iti-cd-fs-icon--enter { display: none; }
.iti-cd-player.is-fullscreen .iti-cd-fs-icon--exit  { display: block; }

/* 模态全屏：播放器本身铺满整个视口。
   只切换自身定位，不移动 iframe —— 移动 DOM 会导致课件重新加载、丢进度。 */
.iti-cd-player.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    width: 100vw;
    height: 100vh;
    aspect-ratio: auto;
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
    background: #000;
}

/* 加载占位 */
.iti-cd-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
    font-size: 13px;
    background: linear-gradient(135deg, var(--iti-navy) 0%, #1F3A5F 100%);
}
.iti-cd-loading p { margin: 0; }
.iti-cd-loading.is-hidden { display: none; }

.iti-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.28);
    border-top-color: #fff;
    animation: iti-cd-spin 0.8s linear infinite;
}
@keyframes iti-cd-spin { to { transform: rotate(360deg); } }

/* 无课件时的占位 */
.iti-cd-player-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
}
.iti-cd-player-empty p { margin: 0; }
.iti-cd-player-empty .iti-cd-cover-logo { font-size: 52px; }

/* 播放窗口下方状态条 */
.iti-cd-preview-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.iti-cd-playing {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    color: var(--iti-text-light);
}
.iti-cd-playing strong { color: var(--iti-navy); font-weight: 600; }
.iti-cd-playing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--iti-primary);
    box-shadow: 0 0 0 4px rgba(26, 181, 181, 0.16);
}

.iti-cd-duration {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--iti-navy);
    background: var(--iti-bg-soft-2);
    padding: 4px 12px;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}

/* 几何封面配色（primary / yellow / navy） */


.iti-cd-player-empty::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    top: -60px;
    right: -50px;
}
.iti-cd-player-empty::after {
    content: '';
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 14px solid rgba(255, 255, 255, 0.12);
    bottom: -50px;
    left: -34px;
}

.iti-cd-cover-logo {
    position: relative;
    z-index: 1;
    font-size: 72px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 6px;
    text-shadow: 0 4px 16px rgba(15, 31, 61, 0.3);
}

/* 播放按钮 */
.iti-cd-play {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--iti-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(15, 31, 61, 0.28);
    transition: transform var(--iti-transition), background var(--iti-transition);
}
.iti-cd-play svg { width: 30px; height: 30px; display: block; margin-left: 3px; }
.iti-cd-play:hover {
    transform: translate(-50%, -50%) scale(1.08);
    background: #fff;
}

.iti-cd-preview-duration {
    position: absolute;
    bottom: 16px;
    right: 18px;
    z-index: 3;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    background: rgba(15, 31, 61, 0.6);
    padding: 4px 12px;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}

.iti-cd-preview-tip {
    margin: 12px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--iti-text-light);
}

/* ---- 右：信息卡（拉长：sticky 跟随滚动，内部区块自然展开） ---- */
.iti-cd-sidebar {
    position: sticky;
    top: 20px;                     /* 滚动时吸附，视觉上"拉长"贯穿整个内容区 */
    background: var(--iti-bg-soft);
    border-radius: var(--iti-radius-lg);
    padding: 16px 26px 28px;
    box-shadow: 0 2px 10px rgba(15, 31, 61, 0.05);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.iti-cd-sidebar-head { margin-bottom: 18px; }

.iti-cd-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.iti-cd-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 12px;
    border-radius: 99px;
}
.iti-cd-tag--form  {  color: var(--iti-primary); border: 2px solid var(--iti-primary); }
.iti-cd-tag--topic { background: var(--iti-primary);  color: #fff; line-height: 20px;}

.iti-cd-hours {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--iti-navy);
    margin: 0;
}
.iti-cd-hours span {
    color: #b9b9b9;
}
.iti-cd-hours svg { width: 15px; height: 15px; color: var(--iti-primary); }

/* 讲师 */
.iti-cd-speaker {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid rgba(15, 31, 61, 0.08);
    border-bottom: 1px solid rgba(15, 31, 61, 0.08);
}
.iti-cd-speaker-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--iti-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    flex-shrink: 0;
}
.iti-cd-speaker-body { display: flex; flex-direction: column; min-width: 0; }
.iti-cd-speaker-body strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--iti-navy);
}
.iti-cd-speaker-body small {
    font-size: 11px;
    color: var(--iti-text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 进度 */
.iti-cd-progress {
     padding: 6px 8px;
     display: flex;
     align-items: center;
     background: #fff;
     border-radius: 99px;
     margin-bottom: 20px;

    
}
.iti-cd-progress-head {
    width: 20%;
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--iti-text-light);
    /* margin-bottom: 8px; */
}
/* .iti-cd-progress-head strong {
    font-size: 15px;
    font-weight: 800;
    color: var(--iti-primary);
} */

.iti-cd-progress-bar {
    width: 65%;
    border: 1px solid var(--iti-primary);
    height: 7px;
    background: #fff;
    border-radius: 999px;
    overflow: hidden;
}
.iti-cd-progress-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--iti-primary) 0%, #0E8A8A 100%);
    border-radius: 999px;
    transition: width .3s ease;
}
.iti-cd-progress-meta {
    margin: 0px 2 0;
    font-size: 11px;
    color: var(--iti-text-light);
}

/* 章节目录 */
.iti-cd-chapters {
    padding-top: 8px;
    border-top: 2px solid rgba(15, 31, 61, 0.08);
}

.iti-cd-chapters-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 14px;
    font-weight: 800;
    color: var(--iti-navy);
    margin: 16px 0 12px;
}
.iti-cd-chapters-title  span {
    color: var(--iti-text-light);
    font-weight: 400;
    font-size: 12px;
}

.iti-cd-chapters-count {
    background: var(--iti-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
}

.iti-cd-chapters-empty {
    font-size: 12px;
    color: var(--iti-text-light);
    margin: 0;
    padding: 8px 0;
}

/* 章节目录：不限制 max-height，随内容自然拉长（滚动交给 sidebar） */
.iti-cd-chapter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.iti-cd-chapter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    justify-content: space-between;
    transition: background var(--iti-transition);
}
.iti-cd-chapter:hover { background: rgba(255, 255, 255, 0.7); }
.iti-cd-chapter--learning { background: #fff; }
/* 当前正在播放的章节 */
.iti-cd-chapter.is-active {
    background: #fff;
    border: 2px solid var(--iti-primary);
    box-shadow: inset 3px 0 0 var(--iti-primary);
}

.iti-cd-chapter-no {
    flex-shrink: 0;
    border-radius: 4px;
    color: var(--iti-text-light);
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.iti-cd-chapter--learning .iti-cd-chapter-no { color: var(--iti-primary); }

.iti-cd-chapter-body {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    
}
.iti-cd-chapter-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--iti-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.iti-cd-chapter-time {
    font-size: 10.5px;
    color: var(--iti-text-light);
    font-variant-numeric: tabular-nums;
}

.iti-cd-chapter-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 12px;
    border-radius: 999px;
}
.iti-cd-chapter-badge--learning { background: var(--iti-primary); color: #fff; }
.iti-cd-chapter-badge--done     { background: #E8F6EE; color: #1A5A38; }
.iti-cd-chapter-badge--todo     { background: var(--iti-bg-soft-2); color: var(--iti-text-light); }
.iti-cd-chapter-badge--locked   { background: #EEF1F4; color: #9AA7B2; }
.iti-cd-chapter-badge--free     { background: #E7F7F2; color: #0E8C6F; border: 1px solid #B7E4D4; }

/* 章节左侧圆形播放按钮（原来是装饰 div，点了没反应） */
.iti-cd-chapter-icon {
    margin-right: 4px;
      flex-shrink: 0;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--iti-primary);
    border: 2px solid var(--iti-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--iti-transition);
}
.iti-cd-chapter-icon:hover { transform: scale(1.15); }

/* 无权限章节的锁图标 */
.iti-cd-chapter-locked {
    margin-right: 4px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    color: #9AA7B2;
    border: 2px solid #C8D2DA;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.iti-cd-chapter-locked svg { width: 10px; height: 10px; display: block; }
.iti-cd-chapter-body svg { width: 12px; height: 12px; display: block; margin-left: 0px; }
.iti-cd-chapter-play {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--iti-primary);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--iti-transition);
}
.iti-cd-chapter-play svg { width: 12px; height: 12px; display: block; margin-left: 1px; }
.iti-cd-chapter-play:hover { transform: scale(1.12); }

.iti-cd-chapter--locked { opacity: 0.65; }

/* ============ 左栏区块：课程简介 + 关键主题（上下排列） ============ */
.iti-cd-section-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--iti-navy);
    margin: 0 0 16px;
}

.iti-cd-about-text {
    font-size: 14px;
    line-height: 1.9;
    color: var(--iti-text);
    margin: 0;
}

.iti-cd-topic-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.iti-cd-topic-list li { display: flex; align-items: flex-start; gap: 10px; }
.iti-cd-topic-no {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: var(--iti-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}
.iti-cd-topic-text {
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--iti-navy);
}

/* ============ 相关推荐 ============ */
.iti-cd-related {
    background: var(--iti-bg-soft);
    padding: 20px 0 56px;
}

.iti-cd-related-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.iti-cd-related-controls { display: flex; gap: 10px; }

.iti-cd-related-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--iti-border, #E3E8EE);
    background: #fff;
    color: var(--iti-navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--iti-transition);
}
.iti-cd-related-btn svg { width: 16px; height: 16px; }
.iti-cd-related-btn:hover {
    background: var(--iti-primary);
    color: #fff;
    border-color: var(--iti-primary);
}

.iti-cd-related-carousel { overflow: hidden; }

.iti-cd-related-track {
    display: flex;
    gap: 18px;
    transition: transform .4s ease;
    will-change: transform;
}

.iti-cd-related-card {
    flex: 0 0 calc((100% - 54px) / 4);
    background-color: #fff;
    padding: 14px;
    border-radius: 8px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform var(--iti-transition);
}
.iti-cd-related-card:hover { transform: translateY(-4px); }

.iti-cd-related-cover {
    position: relative;
    height: 120px;
    border-radius: var(--iti-radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* 相关推荐：后台上传的封面图铺满 */
.iti-cd-related-cover > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.iti-cd-related-cover .iti-cd-cover-logo { font-size: 26px; letter-spacing: 2px; }

.iti-cd-related-body { display: flex; flex-direction: column; gap: 3px; }
.iti-cd-related-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--iti-navy);
    line-height: 1.4;
    margin-top: 20px;
}
.iti-cd-related-meta {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--iti-text-light);
}

/* ============ CTA ============ */
.iti-cd-cta {
    position: relative;
    background: url(/assets/images/course/cta-bg.png);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    padding: 30px 0;
    overflow: hidden;
}

.iti-cd-cta-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}
.iti-cd-cta-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--iti-navy);
    margin: 0 0 8px;
}
.iti-cd-cta-desc {
    font-size: 13px;
    color: var(--iti-primary);
    margin: 0 0 22px;
}

.iti-btn-pill { border-radius: 999px; }

/* ============ 响应式 ============ */
@media (max-width: 1199px) {
    .iti-cd-layout { grid-template-columns: 1fr 320px; gap: 24px; }
    .iti-cd-player { min-height: 240px; }
    .iti-cd-related-card { flex: 0 0 calc((100% - 36px) / 3); }
}

@media (max-width: 1023px) {
    .iti-cd-main { padding: 20px 0 36px; }
    .iti-cd-main-deco { width: 100px; height: 100px; opacity: 0.45; }

    /* 窄屏：改为上下堆叠，侧栏取消 sticky */
    .iti-cd-layout { grid-template-columns: 1fr; gap: 24px; }
    .iti-cd-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .iti-cd-player { min-height: 200px; }
    .iti-cd-cover-logo { font-size: 44px; }
    .iti-cd-play { width: 56px; height: 56px; }
    .iti-cd-play svg { width: 22px; height: 22px; }
    .iti-cd-content-title { font-size: 21px; margin-top: 14px; }
    .iti-cd-block { padding: 20px 22px; margin-top: 18px; }

    .iti-cd-related-card { flex: 0 0 calc((100% - 18px) / 2); }

    .iti-cd-cta-deco-left,
    .iti-cd-cta-deco-right { display: none; }
}

@media (max-width: 600px) {
    .iti-cd-sidebar { padding: 18px 20px 22px; }
    .iti-cd-related-card { flex: 0 0 100%; }
}
