/* Heaboos 视频剧集课程 - 前端样式 */

.hvc-course {
    margin-bottom: 30px;
}

.hvc-course .hvc-title {
    margin: 0 0 14px;
    font-size: 20px;
    line-height: 1.4;
}

.hvc-course .new-dplayer {
    margin-bottom: 16px;
}

.hvc-player-empty {
    padding: 40px 16px;
    text-align: center;
    background: var(--main-shadow, rgba(136, 136, 136, 0.08));
    border-radius: 6px;
    color: var(--muted-2-color, #888);
    margin-bottom: 16px;
}

/* 描述块 + 右侧「查看附件」 */
.hvc-course .hvc-meta {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
}

.hvc-course .hvc-desc {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.8;
}

.hvc-course .hvc-desc > *:first-child {
    margin-top: 0;
}

.hvc-course .hvc-desc > *:last-child {
    margin-bottom: 0;
}

.hvc-course .hvc-desc-empty {
    color: var(--muted-2-color, #999);
}

.hvc-course .hvc-attach {
    flex: 0 0 auto;
    position: relative;
    max-width: 240px;
}

.hvc-course .hvc-attach-toggle {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    background: rgba(136, 136, 136, 0.12);
    font-size: 14px;
    white-space: nowrap;
    text-decoration: none;
}

.hvc-course .hvc-attach-list {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 30;
    min-width: 240px;
    max-width: 320px;
    background: var(--main-bg-color, #fff);
    border: 1px solid var(--main-border-color, rgba(50, 50, 50, 0.06));
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    padding: 6px;
}

.hvc-course .hvc-attach-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    color: inherit;
}

.hvc-course .hvc-attach-item:hover {
    background: rgba(136, 136, 136, 0.1);
}

.hvc-course .hvc-attach-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hvc-course .hvc-attach-size {
    color: var(--muted-2-color, #999);
    font-size: 12px;
    flex: 0 0 auto;
}

/* 剧集选择模块 */
.hvc-course .hvc-episodes {
    display: block;
    clear: both;
    margin-top: 8px;
}

.hvc-course .hvc-episodes-title {
    font-weight: 600;
    margin-bottom: 10px;
    padding-left: 9px;
    border-left: 3px solid var(--focus-color, #f04494);
    line-height: 1.3;
}

/* ------- 剧集目录树：层级沿用主题评论的嵌套方式 ------- */
.hvc-course .hvc-tree ul,
.hvc-course .hvc-tree-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.hvc-course .hvc-tree-node {
    display: block;
    margin: 0;
}

/* 二级及以下目录整体缩进成块：浅底色 + 左侧线 + 圆角，层级一眼可辨 */
.hvc-course .hvc-tree .hvc-tree-list .hvc-tree-list {
    margin: 6px 0 6px 18px !important;
    padding: 8px 8px 8px 12px !important;
    background: var(--main-shadow, rgba(136, 136, 136, 0.06));
    border-left: 2px solid rgba(136, 136, 136, 0.22);
    border-radius: 6px;
}

/* 更深层级缩进更小，避免层层叠加后过窄（与主题评论一致） */
.hvc-course .hvc-tree .hvc-tree-list .hvc-tree-list .hvc-tree-list {
    margin-left: 14px !important;
    padding: 6px 6px 6px 10px !important;
}

/* 目录标题：文件夹图标 + 标题 + 右侧细线 */
.hvc-course .hvc-tree-group {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--main-color, #3c434a);
}

.hvc-course .hvc-tree-group-icon {
    flex: 0 0 auto;
    font-size: 13px;
    color: var(--focus-color, #f04494);
}

.hvc-course .hvc-tree-group-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hvc-course .hvc-tree-group::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: rgba(136, 136, 136, 0.18);
}

/* 剧集条目：布局完全由插件控制，避免被主题的 .switch-video 样式影响导致错位 */
.hvc-course .hvc-tree .switch-video {
    display: flex !important;
    align-items: center;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
    margin: 4px 0 0 !important;
    padding: 8px 12px !important;
    border-radius: 4px;
    background: rgba(136, 136, 136, 0.1);
    line-height: 1.6;
    text-align: left !important;
    text-decoration: none;
    overflow: hidden;
}

.hvc-course .hvc-tree .switch-video .hvc-ep-index {
    flex: 0 0 auto;
    min-width: 19px;
}

.hvc-course .hvc-tree .switch-video .episode-active-icon,
.hvc-course .hvc-tree .switch-video .hvc-lock-icon {
    flex: 0 0 auto;
}

.hvc-course .hvc-tree .switch-video .hvc-ep-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hvc-course .hvc-tree .switch-video .hvc-lock-icon {
    margin-right: 6px;
    color: inherit;
}

/* 学完标记（学完后该集可自由拖动进度） */
.hvc-course .hvc-tree .switch-video .hvc-done-icon {
    flex: 0 0 auto;
    margin-left: 8px;
    font-size: 13px;
    color: #2ea44f;
}

/* 未解锁 */
.hvc-course .hvc-tree .switch-video.hvc-locked {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.6);
}

/* 禁止拖动进度：屏蔽 DPlayer 进度条交互 */
.hvc-course .hvc-no-seek .dplayer-bar-wrap,
.hvc-no-seek .dplayer-bar-wrap {
    pointer-events: none;
}

/* 提示气泡 */
.hvc-toast {
    position: fixed;
    left: 50%;
    bottom: 60px;
    transform: translateX(-50%);
    z-index: 99999;
    max-width: 80vw;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
}

.hvc-toast.hvc-toast-show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .hvc-course .hvc-meta {
        flex-wrap: wrap;
    }

    .hvc-course .hvc-attach {
        max-width: 100%;
        width: 100%;
    }

    .hvc-course .hvc-attach-list {
        position: static;
        margin-top: 6px;
        max-width: 100%;
    }

    /* 移动端缩小层级缩进，保证每层都有足够宽度 */
    .hvc-course .hvc-tree .hvc-tree-list .hvc-tree-list {
        margin-left: 12px !important;
        padding: 6px 6px 6px 10px !important;
    }

    .hvc-course .hvc-tree .hvc-tree-list .hvc-tree-list .hvc-tree-list {
        margin-left: 8px !important;
    }

    .hvc-course .hvc-tree-group {
        font-size: 13px;
        margin: 8px 0 2px;
    }
}
