/* ============================================================
   教学中心 · 视频库
   ============================================================ */

.video-library {
    background: #f2f6fb;
    padding: 46px 0 72px;
    font-size: 14px;
    line-height: 1.7;
    color: #333;
}

.video-library-inner {
    width: 90%;
    max-width: 1280px;
    margin: 0 auto;
}

.video-library *,
.video-library *::before,
.video-library *::after {
    box-sizing: border-box;
}

.video-library-head {
    margin-bottom: 28px;
    text-align: center;
}

.video-library-head h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    color: #17233d;
    letter-spacing: 2px;
}

.video-library-head p {
    margin: 10px 0 0;
    font-size: 14px;
    color: #7a8699;
}

.video-cat {
    margin-bottom: 22px;
    padding: 22px 26px 18px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(2, 65, 150, .06);
}

.video-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.video-cat-head h2 {
    position: relative;
    margin: 0;
    padding-left: 14px;
    font-size: 21px;
    font-weight: 600;
    color: #17233d;
}

.video-cat-head h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 4px;
    border-radius: 2px;
    background: #024196;
}

.video-cat-head .video-cat-count {
    font-size: 13px;
    color: #9aa5b5;
}

.video-rail {
    display: flex;
    gap: 20px;
    padding: 4px 2px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

.video-rail::-webkit-scrollbar {
    display: none;
}

.video-card {
    flex: 0 0 300px;
    width: 300px;
    margin: 0;
    background: #fff;
    border: 1px solid #e6ecf4;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .25s, box-shadow .25s, border-color .25s;
}

.video-card:hover {
    transform: translateY(-3px);
    border-color: #a9c1e2;
    box-shadow: 0 12px 28px rgba(2, 65, 150, .14);
}

.video-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0e1b2c;
    overflow: hidden;
}

.video-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
}

.video-card:hover .video-cover img {
    transform: scale(1.04);
}

.video-cover-empty {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 70% 30%, rgba(11, 92, 187, .55), transparent 55%),
        linear-gradient(135deg, #0d1b2d 0%, #122a47 100%);
}

.video-cover-empty::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 120px;
    height: 120px;
    margin: -60px 0 0 -60px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .08);
}

.video-play {
    position: absolute;
    left: 50%;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: -26px 0 0 -26px;
    border-radius: 50%;
    background: rgba(2, 65, 150, .82);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    transition: background .2s, transform .2s;
    z-index: 2;
}

.video-play::before {
    content: "";
    display: block;
    width: 0;
    height: 0;
    margin-left: 4px;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid #fff;
}

.video-card:hover .video-play {
    background: #024196;
    transform: scale(1.08);
}

.video-time {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 0 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, .68);
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    z-index: 2;
}

.video-card h3 {
    margin: 0;
    padding: 12px 14px 14px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.55;
    color: #2b3648;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 66px;
}

.video-card:hover h3 {
    color: #024196;
}

.video-library-empty {
    padding: 50px 20px;
    background: #fff;
    border: 1px dashed #cfd9e8;
    border-radius: 10px;
    text-align: center;
    color: #7a8699;
}

/* 播放弹层 */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    background: rgba(6, 14, 26, .82);
}

.video-modal[hidden] {
    display: none;
}

.video-modal-inner {
    position: relative;
    width: 100%;
    max-width: 980px;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}

.video-modal video {
    display: block;
    width: 100%;
    max-height: 78vh;
    background: #000;
}

.video-modal-close {
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 3;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 22px;
    line-height: 34px;
    text-align: center;
    cursor: pointer;
}

.video-modal-close:hover {
    background: #024196;
}

.video-modal-title {
    position: absolute;
    left: 0;
    bottom: 0;
    right: 0;
    padding: 40px 16px 12px;
    color: #fff;
    font-size: 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .65));
    pointer-events: none;
}

@media screen and (max-width: 768px) {
    .video-library {
        padding: 26px 0 46px;
    }

    .video-library-head h1 {
        font-size: 23px;
    }

    .video-cat {
        padding: 16px 14px 12px;
    }

    .video-cat-head h2 {
        font-size: 18px;
    }

    .video-card {
        flex-basis: 240px;
        width: 240px;
    }

    .video-card h3 {
        font-size: 14px;
        min-height: 62px;
    }

    .video-modal {
        padding: 20px 8px;
    }
}

/* 视频详情页 */
.video-detail-box {
    max-width: 1000px;
    margin: 0 auto;
}

.video-detail-player {
    display: block;
    width: 100%;
    max-height: 75vh;
    background: #000;
    border-radius: 10px;
}

.video-detail-content {
    margin-top: 20px;
    padding: 22px 26px;
    background: #fff;
    border-radius: 10px;
    line-height: 1.9;
}

/* 视频展位：一个栏目一个视频位置 + 书签式视频列表 */
.video-showcase {
    display: flex;
    gap: 24px;
    align-items: stretch;
}

.video-stage {
    position: relative;
    flex: 1 1 820px;
    min-width: 0;
    max-width: 820px;
    aspect-ratio: 16 / 9;
    background: #0e1b2c;
    border-radius: 10px;
    overflow: hidden;
}

.video-stage-player {
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
    object-fit: contain;
}

.video-stage-play {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(2, 65, 150, .88);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .3);
    cursor: pointer;
    transition: background .2s, transform .2s, opacity .2s;
}

.video-stage-play::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    margin: -11px 0 0 -7px;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 17px solid #fff;
}

.video-stage-play:hover {
    background: #024196;
    transform: scale(1.06);
}

.video-stage.is-playing .video-stage-play {
    opacity: 0;
    pointer-events: none;
}

.video-stage-meta {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 2;
    padding: 10px 16px;
    color: #fff;
    font-size: 15px;
    background: rgba(0, 0, 0, .55);
    pointer-events: none;
}

.video-stage-title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-bookmarks {
    flex: 0 0 320px;
    padding: 10px;
    background: #f8fbff;
    border: 1px solid #e8eef7;
    border-radius: 10px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c5d2e4 transparent;
}

.video-bookmarks::-webkit-scrollbar {
    width: 5px;
}

.video-bookmarks::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: #c5d2e4;
}

.video-bookmark {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    margin: 0 0 8px;
    padding: 12px 14px;
    border: 0;
    border-left: 3px solid transparent;
    border-radius: 6px;
    background: #f6f9fe;
    color: #2b3648;
    text-align: left;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}

.video-bookmark:hover {
    background: #eef4fd;
}

.video-bookmark.active {
    border-left-color: #024196;
    background: #e8f1ff;
    color: #024196;
}

.video-bookmark-index {
    flex: 0 0 22px;
    padding-top: 1px;
    color: #9aa5b5;
    font-size: 12px;
    line-height: 22px;
}

.video-bookmark.active .video-bookmark-index {
    color: #024196;
}

.video-bookmark-title {
    flex: 1;
    font-size: 14px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media screen and (max-width: 768px) {
    .video-showcase {
        flex-direction: column;
        gap: 12px;
    }

    .video-stage {
        flex: none;
        width: 100%;
        max-width: none;
        aspect-ratio: 16 / 9;
        max-height: none;
    }

    .video-stage-play {
        width: 52px;
        height: 52px;
        margin: -26px 0 0 -26px;
    }

    .video-bookmarks {
        display: flex;
        flex: none;
        gap: 8px;
        max-height: none;
        padding: 0 0 6px;
        background: transparent;
        border: 0;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .video-bookmark {
        flex: 0 0 220px;
        width: 220px;
        margin: 0;
        border-left: 0;
        border-bottom: 3px solid transparent;
    }

    .video-bookmark.active {
        border-left-color: transparent;
        border-bottom-color: #024196;
    }
}

/* 视频书签（带缩略图）与留言 */
.video-stage {
    box-shadow: 0 18px 45px rgba(2, 65, 150, .16);
}

.video-stage-play {
    animation: videoPulse 2.2s infinite;
}

@keyframes videoPulse {
    0% { box-shadow: 0 0 0 0 rgba(2, 65, 150, .35); }
    70% { box-shadow: 0 0 0 18px rgba(2, 65, 150, 0); }
    100% { box-shadow: 0 0 0 0 rgba(2, 65, 150, 0); }
}

.video-stage.is-playing .video-stage-play {
    animation: none;
}

.video-bookmarks {
    flex: 0 0 340px;
}

.video-bookmark {
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: #fff;
    border: 1px solid #edf2f8;
    border-left: 1px solid #edf2f8;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(15, 40, 80, .03);
}

.video-bookmark:hover {
    border-color: #c9d9ee;
    background: #fff;
    box-shadow: 0 6px 18px rgba(2, 65, 150, .08);
}

.video-bookmark.active {
    border-color: #024196;
    background: #f4f8ff;
    box-shadow: 0 6px 18px rgba(2, 65, 150, .12);
}

.video-bookmark-cover {
    position: relative;
    flex: 0 0 94px;
    width: 94px;
    height: 56px;
    overflow: hidden;
    border-radius: 6px;
    background: #122a47;
}

.video-bookmark-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.video-bookmark:hover .video-bookmark-cover img {
    transform: scale(1.06);
}

.video-bookmark-cover-empty {
    display: block;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 70% 30%, rgba(11, 92, 187, .75), transparent 60%),
        linear-gradient(135deg, #0d1b2d, #17385e);
}

.video-bookmark-cover-empty::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    margin: -7px 0 0 -4px;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 10px solid rgba(255, 255, 255, .9);
}

.video-bookmark.active .video-bookmark-cover {
    box-shadow: 0 0 0 2px #024196;
}

.video-bookmark-body {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.video-bookmark-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #2b3648;
    font-size: 13px;
    line-height: 1.5;
}

.video-bookmark.active .video-bookmark-title {
    color: #024196;
}

.video-bookmark-meta {
    color: #9aa5b5;
    font-size: 12px;
    line-height: 1.4;
}

/* 留言 */
.video-comments {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid #edf2f9;
}

.video-comments-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 14px;
}

.video-comments-head h3 {
    margin: 0;
    color: #17233d;
    font-size: 18px;
    font-weight: 600;
}

.video-comments-head p {
    margin: 4px 0 0;
    color: #8a95a7;
    font-size: 13px;
}

.video-comments-count {
    color: #8a95a7;
    font-size: 13px;
    white-space: nowrap;
}

.video-comment-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-height: 330px;
    overflow-y: auto;
}

.video-comment-item {
    display: flex;
    gap: 10px;
    padding: 14px;
    background: #f8fbff;
    border: 1px solid #eef3fa;
    border-radius: 10px;
}

.video-comment-avatar {
    display: flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #024196, #3f83d6);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.video-comment-body {
    flex: 1;
    min-width: 0;
}

.video-comment-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.video-comment-name {
    color: #2b3648;
    font-size: 13px;
    font-weight: 600;
}

.video-comment-time {
    color: #a4afc0;
    font-size: 12px;
    white-space: nowrap;
}

.video-comment-text {
    margin: 0;
    color: #4a5568;
    font-size: 13px;
    line-height: 1.7;
    word-break: break-word;
    white-space: pre-line;
}

.video-comment-empty {
    padding: 26px 16px;
    background: #f8fbff;
    border: 1px dashed #d7e2f0;
    border-radius: 10px;
    color: #8a95a7;
    font-size: 13px;
    text-align: center;
}

.video-comment-form {
    margin-top: 16px;
    padding: 16px;
    background: #f8fbff;
    border: 1px solid #eef3fa;
    border-radius: 10px;
}

.video-comment-fields {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.video-comment-fields input,
.video-comment-form textarea {
    width: 100%;
    border: 1px solid #dfe8f4;
    border-radius: 6px;
    background: #fff;
    color: #2b3648;
    font-size: 14px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.video-comment-fields input {
    height: 42px;
    padding: 0 12px;
}

.video-comment-form textarea {
    display: block;
    min-height: 92px;
    padding: 10px 12px;
    resize: vertical;
}

.video-comment-fields input:focus,
.video-comment-form textarea:focus {
    border-color: #024196;
    box-shadow: 0 0 0 3px rgba(2, 65, 150, .08);
}

.video-comment-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

.video-comment-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 10px;
}

.video-comment-msg {
    color: #8a95a7;
    font-size: 13px;
}

.video-comment-msg.is-error {
    color: #d93025;
}

.video-comment-msg.is-ok {
    color: #178a4c;
}

.video-comment-form button {
    height: 40px;
    padding: 0 26px;
    border: 0;
    border-radius: 6px;
    background: #024196;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s, box-shadow .2s;
}

.video-comment-form button:hover {
    background: #01306f;
    box-shadow: 0 6px 16px rgba(2, 65, 150, .22);
}

.video-comment-form button:disabled {
    opacity: .6;
    cursor: not-allowed;
    box-shadow: none;
}

@media screen and (max-width: 768px) {
    .video-comment-list {
        grid-template-columns: 1fr;
    }

    .video-comment-fields {
        flex-direction: column;
        gap: 8px;
    }

    .video-bookmark-cover {
        flex-basis: 78px;
        width: 78px;
        height: 48px;
    }

    .video-bookmarks {
        flex: none;
    }
}

/* 分类过多时：顶部标签切换，一次只显示一个分类 */
.video-cat {
    display: none;
}

.video-cat.is-active {
    display: block;
}

.video-cat-tabs {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 10px 0;
    background: rgba(242, 247, 255, .96);
    backdrop-filter: blur(8px);
}

.video-cat-tabs[hidden] {
    display: none;
}

.video-cat-tabs-track {
    display: flex;
    flex: 1;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.video-cat-tabs-track::-webkit-scrollbar {
    display: none;
}

.video-cat-tab {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border: 1px solid #dbe6f3;
    border-radius: 999px;
    background: #fff;
    color: #4a5568;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}

.video-cat-tab:hover {
    border-color: #b9cde6;
    background: #f6faff;
}

.video-cat-tab.active {
    border-color: #024196;
    background: #024196;
    color: #fff;
    box-shadow: 0 6px 16px rgba(2, 65, 150, .2);
}

.video-cat-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #eef4fc;
    color: #6b7c93;
    font-size: 11px;
}

.video-cat-tab.active .video-cat-tab-count {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}

.video-cat-tabs-arrow {
    display: inline-flex;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #dbe6f3;
    border-radius: 50%;
    background: #fff;
    color: #4a5568;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.video-cat-tabs-arrow:hover {
    border-color: #024196;
    color: #024196;
}

.video-cat-tabs-arrow[disabled] {
    opacity: .35;
    cursor: default;
}

@media screen and (max-width: 768px) {
    .video-cat-tabs {
        margin-bottom: 12px;
        padding: 8px 0;
    }

    .video-cat-tab {
        padding: 8px 13px;
        font-size: 13px;
    }

    .video-cat-tabs-arrow {
        display: none;
    }
}

/* 分类标题改为当前视频标题 */
.video-cat-head .video-current-title {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 110px);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.video-cat-head .video-cat-count {
    flex: 0 0 auto;
}
