/*
 * kh-about-video.css
 * 企业宣传片视频播放组件样式
 * 依赖: Boxicons (bx bx-play)
 */

/* ===== 视频容器 ===== */
.about-company-video {
    position: relative;
    width: 100%;
}

/* ===== 内嵌自动播放（首页关于我们等）===== */
.about-company-video--inline .about-company-video__media {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 5px;
    background: #000;
}

/* ===== 触发按钮（封面图 + 播放图标）===== */
.about-company-video__trigger {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 5px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.about-company-video__trigger:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(29, 81, 152, 0.18);
}

.about-company-video__trigger:focus-visible {
    outline: 3px solid #1d5198;
    outline-offset: 2px;
}

/* 封面图 */
.about-company-video__trigger > img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 5px;
}

/* ===== 播放按钮图标 ===== */
.about-company-video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: rgba(29, 81, 152, 0.9);
    border-radius: 50%;
    transition: background 0.2s ease, transform 0.2s ease;
}

.about-company-video__play i {
    font-size: 32px;
    color: #fff;
    margin-left: 4px; /* 视觉居中补偿 */
}

.about-company-video__trigger:hover .about-company-video__play {
    background: rgba(29, 81, 152, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

/* ===== 说明文字 ===== */
.about-company-video__caption {
    margin: 10px 0 0;
    font-size: 14px;
    color: #6c757d;
    text-align: center;
}

/* ===== 视频播放弹窗遮罩 ===== */
.kh-video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.kh-video-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* 弹窗内容区 */
.kh-video-overlay__inner {
    position: relative;
    width: 90%;
    max-width: 960px;
    background: #000;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.35s ease;
}

.kh-video-overlay.is-active .kh-video-overlay__inner {
    transform: translateY(0) scale(1);
}

/* 视频 */
.kh-video-overlay video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 80vh;
    background: #000;
}

/* 关闭按钮 */
.kh-video-overlay__close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    color: #fff;
    font-size: 18px;
    line-height: 1;
}

.kh-video-overlay__close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 标题 */
.kh-video-overlay__title {
    padding: 12px 16px;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #e8e8e8;
    text-align: center;
    background: #111;
}

/* 响应式 */
@media (max-width: 768px) {
    .kh-video-overlay__inner {
        width: 95%;
        max-width: none;
    }

    .kh-video-overlay video {
        max-height: 60vh;
    }

    .about-company-video__play {
        width: 56px;
        height: 56px;
    }

    .about-company-video__play i {
        font-size: 24px;
    }
}

/* ===== 视频弹窗（about-video-popup.js / #khVideoModal）===== */
.kh-video-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.kh-video-modal[hidden] {
    display: none !important;
}

.kh-video-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    cursor: pointer;
}

.kh-video-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(960px, 100%);
    max-height: calc(100vh - 48px);
    background: #000;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.kh-video-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.kh-video-modal__close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.kh-video-modal__close i {
    font-size: 22px;
    line-height: 1;
}

.kh-video-modal__body {
    padding: 0;
}

.kh-video-modal__body video {
    display: block;
    width: 100%;
    max-height: min(80vh, 720px);
    background: #000;
}

.kh-video-modal__gif {
    display: block;
    max-width: 100%;
    max-height: min(72vh, 640px);
    width: auto;
    height: auto;
    margin: 0 auto;
}

.kh-video-modal__message {
    padding: 40px 28px;
    color: #e8e8e8;
    text-align: center;
}

.kh-video-modal__message-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.kh-video-modal__message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
}

.kh-video-modal__message code {
    font-size: 13px;
    color: var(--site-brand-orange);
}
