/* ==========================================================================
   站点自定义样式（与主题 css/themes.css 分离维护）
   ========================================================================== */

/* ---- 全局字体 ----
   不依赖 Google Fonts（国内无法访问），改用系统字体栈：
   英文/数字使用系统无衬线字体，中文自动回退到苹方 / 雅黑等系统中文字体。
   覆盖主题 css/themes.css 中写死的 Urbanist（body、tooltip、popover、.primary-font）。 */
:root {
    --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
body,
.tooltip,
.popover {
    font-family: var(--font-family-sans-serif);
}
.primary-font {
    font-family: var(--font-family-sans-serif) !important;
}

/* ---- 客户案例视频卡片 ---- */
.video-card {
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: transform .3s ease;
    outline: none;
}
.video-card:hover {
    transform: translateY(-4px);
}
.video-thumb {
    aspect-ratio: 9 / 16;
    max-width: 320px;
    margin: 0 auto;
    background-color: #0c1a16;
    border-radius: 24px;
}
.video-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}
.video-thumb::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .26) 0%, rgba(0, 0, 0, 0) 34%, rgba(0, 0, 0, .42) 100%);
    pointer-events: none;
}
.video-play-badge {
    left: 50%;
    top: 50%;
    z-index: 2;
    width: 60px;
    height: 60px;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, .94);
    transition: all .3s ease;
}
.video-play-badge i {
    font-size: 22px;
    margin-left: 3px;
}
.video-card:hover .video-play-badge {
    transform: translate(-50%, -50%) scale(1.08);
}
.video-card .card-text {
    font-weight: 400;
    line-height: 1.8;
}

/* ---- 视频放大播放弹窗 ---- */
.video-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.video-lightbox.open {
    display: flex;
}
.video-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(20, 30, 28, .78);
    backdrop-filter: blur(6px);
}
.video-lightbox-dialog {
    position: relative;
    z-index: 1;
    max-width: 94vw;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
    display: grid;
    grid-template-columns: auto minmax(240px, 320px);
    animation: videoLightboxIn .3s ease;
}
@keyframes videoLightboxIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
.video-lightbox-close {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    border: none;
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .3s ease;
}
.video-lightbox-close:hover {
    color: #fff;
    transform: rotate(90deg);
}

/* 竖屏 9:16 舞台：宽度由高度推导，画面不变形、不裁切 */
.video-lightbox-stage {
    height: min(78vh, 604px);
    width: calc(min(78vh, 604px) * 0.5625);
    background-color: #0c1a16;
    display: flex;
    align-items: center;
    justify-content: center;
}
.video-lightbox-stage video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.video-lightbox-info {
    padding: 34px 30px;
    max-height: 78vh;
    overflow-y: auto;
    text-align: left;
}
.video-lightbox-info h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 14px;
}
.video-lightbox-info p {
    color: #6c757d;
    font-size: 16px;
    line-height: 1.85;
}

@media (max-width: 768px) {
    .video-lightbox-dialog {
        grid-template-columns: 1fr;
        width: 92vw;
    }
    .video-lightbox-stage {
        height: 58vh;
        width: calc(58vh * 0.5625);
        margin: 0 auto;
    }
    .video-lightbox-info {
        padding: 20px 22px 24px;
        max-height: none;
        text-align: center;
    }
}

/* ---- 图片弹窗（Magnific Popup）：滚轮缩放 + 拖拽平移 ---- */
.mfp-figure {
    position: relative;
}
.mfp-figure .mfp-img {
    cursor: zoom-in;
    transition: transform .2s ease;
    will-change: transform;
}
.mfp-figure .mfp-img.is-zoomed {
    cursor: grab;
    touch-action: none;
}
.mfp-figure .mfp-img.is-dragging {
    cursor: grabbing;
    transition: none;
}
.mfp-zoom-hint {
    position: absolute;
    left: 50%;
    bottom: -30px;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .6);
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

/* ---- 页脚 ---- */
.site-footer {
    color: #5c6b63;
}
.site-footer .site-footer-heading {
    color: #22392f;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: .05em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    position: relative;
}
.site-footer .site-footer-heading::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    border-radius: 2px;
    background: #4e7661;
}
.site-footer .site-footer-text {
    color: #5c6b63;
}
.site-footer .site-footer-slogan {
    color: #4e7661;
    font-weight: 500;
    letter-spacing: .02em;
}
.site-footer .site-footer-link {
    color: #4a5550;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: color .25s ease;
}
.site-footer .site-footer-link:hover {
    color: #4e7661;
}
.site-footer .site-footer-contact-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(78, 118, 97, .1);
    color: #4e7661;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .25s ease;
}
.site-footer .media:hover .site-footer-contact-icon {
    background: rgba(78, 118, 97, .18);
}
.site-footer .site-footer-bottom {
    border-top: 1px solid rgba(0, 0, 0, .08);
    color: #8a938e;
}
.site-footer .site-footer-bottom .site-footer-link {
    color: #5c6b63;
}
.site-footer .site-footer-bottom .site-footer-divider {
    color: rgba(0, 0, 0, .2);
}

/* ---- 移动端菜单按钮气泡提示 ---- */
.canvas-toggle {
    position: relative;
}
.nav-hint-bubble {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1030;
    padding: 9px 14px;
    background-color: var(--primary, #4E7661);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .15);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: none;
}
.nav-hint-bubble::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 14px;
    width: 8px;
    height: 8px;
    background-color: inherit;
    transform: rotate(45deg);
}
.nav-hint-bubble.show {
    opacity: 1;
    transform: translateY(0);
}

/* ---- 移动端顶部导航：纯 CSS 吸顶，不依赖 JS 计算高度 ---- */
/* 背景：theme.js 会在导航区外包裹 .sticky-area-wrap 并写入像素高度、滚动时改为 fixed。
   一旦首次测量到 0（图片/字体未就绪等时序问题），导航条会被压缩/隐藏，菜单按钮随之不可用。
   因此移动端改为 sticky 定位，由 CSS 负责吸顶，JS 的定位与高度全部让位。 */
@media (max-width: 1199.98px) {
    .main-header.header-sticky {
        position: -webkit-sticky;
        position: sticky;
        top: -40px; /* 抵消顶部 topbar 高度，仅让导航条吸顶 */
        z-index: 1030;
    }
    .main-header .sticky-area {
        position: static !important;
        top: auto !important;
        -webkit-transform: none !important;
        transform: none !important;
    }
    .main-header .sticky-area-wrap {
        height: auto !important;
        transition: none;
    }
    /* 保证菜单按钮始终有可点击区域与可见图标 */
    .main-header .navbar-toggler.canvas-toggle {
        display: -webkit-inline-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 32px;
        min-height: 32px;
        flex: 0 0 auto;
        color: #000;
    }
}

/* ---- 双语站点：语言切换入口 ---- */
.topbar-inner {
    position: relative;
}
.topbar-lang {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    text-decoration: none;
}
.topbar-lang:hover,
.topbar-lang:focus {
    color: #fff;
    text-decoration: underline;
}
.language-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 16px 20px 24px;
    background: #f4f6f4;
    color: #5c6b63;
    font-size: 14px;
    text-align: center;
}
.language-switcher-label {
    color: #8a938e;
}
.language-switcher a {
    color: #4E7661;
    text-decoration: none;
}
.language-switcher a:hover,
.language-switcher a:focus {
    text-decoration: underline;
}
.language-switcher-current {
    font-weight: 600;
    color: #2f3b34;
}
.site-footer-lang a {
    color: #4E7661;
}
@media (max-width: 575.98px) {
    .topbar-lang {
        display: none;
    }
}
