/* ============================================
   Index Home Page - 新首页样式（基于设计图）
   ============================================ */

:root {
    --home-hero-align-width: min(1400px, calc(100vw - 40px));
    --home-hero-inline-padding: clamp(10px, 2vw, 20px);
}

/* 深蓝色背景 - 初始颜色 */
.main-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #040d22;
    z-index: -1;
    transition: background-color 1s ease;
}

/* 居中内容容器 - 允许视频超出宽度，左右截取 */
.content-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* 截取左右超出的部分 */
}

/* 主标题和副标题容器 - 浮动在视频上方 */
.main-header {
    position: absolute;
    top: clamp(68px, 11vh, 148px);
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: var(--home-hero-align-width);
    max-width: none;
    padding: 0 var(--home-hero-inline-padding);
    box-sizing: border-box;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    pointer-events: none;
}

.hero-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(7, 16, 38, 0.56);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    pointer-events: auto;
}

.hero-brand__icon {
    width: clamp(32px, 2.6vw, 44px);
    height: clamp(32px, 2.6vw, 44px);
    border-radius: 10px;
    display: block;
    flex: 0 0 auto;
}

.hero-brand__text {
    color: #ffffff;
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* 主标题 */
.main-title {
    color: #ffffff;
    font-size: clamp(2.6rem, 6vw, 5rem);
    font-weight: 700;
    margin: 0;
    font-family: 'Kalam', 'Comic Neue', 'Microsoft YaHei', sans-serif;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    pointer-events: auto;
    display: grid;
    place-items: center;
    text-align: center;
    line-height: 1.12;
    text-shadow: 0 14px 38px rgba(0, 0, 0, 0.36);
}

.hero-rotating-title {
    font-size: clamp(3rem, 6vw, 5.3rem);
    line-height: 1.08;
    display: block;
    width: 100%;
    margin: 0 auto;
    transition: opacity 220ms ease, transform 220ms ease;
    will-change: opacity, transform;
    max-width: 100%;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.hero-rotating-title.is-fading {
    opacity: 0;
    transform: translateY(8px);
}

.title-highlight {
    color: #F9D849;
    font-weight: 800;
    text-shadow: 0 0 12px rgba(249, 216, 73, 0.25);
}

.title-highlight-big {
    font-size: clamp(3.2rem, 6.2vw, 6rem);
}

/* 副标题 */
.main-subtitle {
    color: #ffffff;
    font-size: clamp(1rem, 1.6vw, 1.3rem);
    margin: 0 auto;
    opacity: 0.9;
    font-family: 'Kalam', 'Comic Neue', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    max-width: 42ch;
    overflow-wrap: break-word;
    pointer-events: auto;
    text-align: center;
    text-wrap: balance;
    text-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

/* 视频容器 - 包含标题、视频、菜单三个层级 */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(0);
    /* 减少垂直偏移 */
    padding: clamp(10px, 2vh, 20px) 0;
    /* 减少上下内边距 */
    overflow: visible;
    /* 允许视频超出容器 */
}

.main-video {
    width: auto;
    /* 改为auto，允许超出 */
    min-width: 100%;
    /* 最小宽度为100% */
    max-width: 140%;
    /* 允许超出40%，保持较大尺寸 */
    height: auto;
    max-height: calc(100vh - 280px);
    /* 为标题和面板留出空间，但保持较大 */
    min-height: 60vh;
    /* 最小高度，确保视频不会太小 */
    object-fit: contain;
    border-radius: 12px;
    opacity: 1;
    transition: opacity 0.3s ease;
    display: block;
    visibility: visible;
    position: relative;
    top: -173px;
    /* 向上偏移173像素 */
    margin: 0 auto;
    /* 水平居中 */
}

/* 播放/暂停按钮 */
.video-play-pause-btn {
    position: absolute;
    /* 定位在小熊图案下方 */
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    /* 垂直和水平居中，初始缩放0.8 */
    width: 48px;
    /* 稍微增大按钮 */
    height: 48px;
    background: rgba(255, 255, 255, 0.3);
    /* 降低透明度 */
    border: 2px solid rgba(255, 255, 255, 0.2);
    /* 降低边框透明度 */
    border-radius: 50%;
    /* 改为圆形 */
    cursor: pointer;
    display: none;
    /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    z-index: 100;
    /* 提高z-index，确保在最上层，高于面板的30 */
    color: #ffffff;
    padding: 0;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    /* 添加过渡动画 */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    /* 降低阴影强度 */
}

.video-play-pause-btn.show {
    display: flex !important;
    /* 使用!important确保显示 */
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    /* 确保显示小手状态 */
    transform: translate(-50%, -50%) scale(1) !important;
    /* 显示时缩放为1，有放大动画效果 */
}

.video-play-pause-btn:hover {
    background: rgba(255, 255, 255, 0.5) !important;
    /* 悬停时稍微提高透明度 */
    border-color: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%) scale(1.1);
    /* 保持居中并稍微放大 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.video-play-pause-btn svg {
    width: 20px;
    height: 20px;
    display: block;
    pointer-events: none;
    /* SVG图标不阻挡鼠标事件，让整个按钮区域可点击 */
}

.video-play-pause-btn .pause-icon {
    display: none;
}

.video-play-pause-btn.playing .play-icon {
    display: none;
}

.video-play-pause-btn.playing .pause-icon {
    display: block;
}

/* 六个面板容器 - 覆盖在视频人物身体位置 */
.panels-container {
    position: absolute;
    bottom: calc(clamp(20px, 5vh, 60px) + 130px);
    left: 50%;
    transform: translateX(-50%);
    width: var(--home-hero-align-width);
    max-width: none;
    /* 限制最大宽度，与视频保持一致 */
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    column-gap: clamp(0.6rem, 1.5vw, 1rem);
    /* 响应式列间距 */
    row-gap: 24px;
    /* 固定行间距，不会随窗口大小变化 */
    padding: 0 var(--home-hero-inline-padding);
    /* 左右内边距 */
    pointer-events: auto;
    box-sizing: border-box;
    perspective: 1000px;
    /* 添加3D透视效果 */
}

.panel-link {
    text-decoration: none;
    display: block;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* 单个面板样式 - 默认状态（显示文字和预览图） */
.panel {
    background: rgba(50, 50, 60, 0.85);
    /* 深灰色背景 */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: clamp(0.6rem, 1.2vw, 1rem);
    /* 响应式padding */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    /* 确保内容分布均匀 */
    gap: clamp(0.6rem, 1.2vw, 1rem);
    /* 响应式gap */
    transition: transform 0.1s ease-out, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    height: clamp(110px, 9vw, 130px);
    /* 响应式高度，保持比例 */
    min-height: clamp(110px, 9vw, 130px);
    max-height: clamp(110px, 9vw, 130px);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    /* 确保padding包含在高度内 */
    width: 100%;
    /* 确保宽度占满 */
    transform-style: preserve-3d;
    /* 保持3D变换 */
    will-change: transform;
    /* 优化性能 */
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.panel-featured {
    border: 2px solid #FFD700;
    box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.18);
}

/* 顶部黄色渐变条 - 默认隐藏 */
.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    z-index: 1;
}

/* 悬停状态 - 应用Preview.html的黄色发光边框效果 */
.panel:hover {
    background: rgba(39, 39, 42, 0.95);
    /* var(--bg-card-hover) 对应的颜色 */
    border-color: #FFD700;
    /* 黄色边框 */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    transform: translateY(-12px) scale(1.02) rotateX(1deg) rotateY(-1deg);
}

/* 悬停时显示顶部蓝色渐变条 */
.panel:hover::before {
    transform: scaleX(1);
}

/* 防止面板内容溢出 */
.panel * {
    max-width: 100%;
}

/* 内容布局 */
.panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(0.3rem, 0.6vw, 0.5rem);
    /* 响应式gap */
    min-width: 0;
    /* 允许flex子元素收缩 */
    transition: all 0.4s ease;
}

.panel-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    /* 允许文本收缩 */
    overflow: hidden;
    /* 防止文本溢出 */
}

.panel-title {
    color: #ffffff;
    font-size: clamp(1rem, 1.8vw, 1.4rem);
    /* 响应式字体大小 */
    font-weight: 700;
    margin: 0 0 clamp(0.2rem, 0.4vw, 0.3rem) 0;
    font-family: 'Kalam', 'Comic Neue', 'Microsoft YaHei', sans-serif;
    transition: all 0.4s ease;
    white-space: nowrap;
    /* 防止标题换行 */
    overflow: hidden;
    text-overflow: ellipsis;
    /* 超出部分显示省略号 */
}

.panel-subtitle {
    color: #ffffff;
    font-size: clamp(0.75rem, 1.1vw, 0.9rem);
    /* 响应式字体大小 */
    margin: 0;
    opacity: 0.8;
    font-family: 'Kalam', 'Comic Neue', 'Microsoft YaHei', sans-serif;
    line-height: 1.4;
    transition: all 0.4s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* 最多显示2行 */
    -webkit-box-orient: vertical;
}

.panel-icon {
    display: none;
    /* 隐藏图标，因为现在一直显示预览图 */
}

.panel-thumbnail {
    width: clamp(120px, 16vw, 200px);
    /* 响应式宽度，保持比例 */
    height: clamp(70px, 8.5vw, 110px);
    /* 响应式高度，保持16:9比例 */
    min-width: 120px;
    /* 最小宽度 */
    max-width: 200px;
    /* 最大宽度 */
    opacity: 1;
    flex-shrink: 0;
    /* 防止图片被压缩 */
    border-radius: 6px;
    border: 2px solid rgba(128, 128, 128, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    margin: clamp(5px, 0.8vw, 10px) 0;
    /* 响应式上下边距 */
    align-self: center;
    /* 垂直居中显示 */
    aspect-ratio: 200/110;
    /* 保持图片比例 */
}

.panel-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    /* 从图片顶部开始显示 */
    display: block;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-video {
        max-width: 130%;
        /* 中等屏幕允许超出30% */
        max-height: calc(100vh - 280px);
        min-height: 55vh;
        top: -173px;
        /* 保持默认值 */
    }

    .panels-container {
        grid-template-columns: repeat(2, 1fr);
        column-gap: clamp(0.6rem, 1.2vw, 0.8rem);
        /* 响应式列间距 */
        row-gap: 24px;
        /* 保持固定行间距 */
        bottom: clamp(15px, 4vh, 50px);
        /* 减少底部间距 */
        max-width: 1200px;
    }

    .panel {
        height: clamp(110px, 8.5vw, 120px);
        /* 响应式高度 */
        min-height: clamp(110px, 8.5vw, 120px);
        max-height: clamp(110px, 8.5vw, 120px);
        padding: clamp(0.7rem, 1vw, 0.9rem);
        gap: clamp(0.6rem, 1vw, 0.9rem);
        flex-direction: row;
        box-sizing: border-box;
    }

    .panel-thumbnail {
        width: clamp(120px, 14vw, 180px);
        /* 响应式宽度 */
        height: clamp(70px, 7.5vw, 100px);
        /* 响应式高度，保持比例 */
        min-width: 120px;
        max-width: 180px;
        margin: clamp(5px, 0.8vw, 10px) 0;
        align-self: center;
        aspect-ratio: 180/100;
        /* 保持比例 */
    }
}

/* Footer Styles */
footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    padding: 10px 0;
}

footer p {
    margin: 0;
    padding: 0 12px;
}

.mobile-panels-toggle {
    display: none;
}

@media (min-width: 1024px) and (orientation: landscape) {
    .main-header {
        width: var(--home-hero-align-width);
        max-width: none;
    }

    .main-title {
        white-space: normal;
    }

    .hero-rotating-title {
        width: 100%;
        max-width: 100%;
        white-space: normal;
    }

    .main-subtitle {
        max-width: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 900px), (orientation: portrait) {
    .mobile-panels-toggle {
        display: none;
    }

    .panels-container {
        max-height: none;
        overflow: visible;
        opacity: 1;
        pointer-events: auto;
    }

    .main-header {
        width: 95%;
        max-width: 95%;
    }

    .main-title {
        width: 100%;
        white-space: normal;
        text-wrap: balance;
    }

    .hero-rotating-title {
        display: block;
        width: 100%;
        white-space: normal;
        text-wrap: balance;
    }

    .main-subtitle {
        width: 100%;
        max-width: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 900px) {
    .content-wrapper {
        position: relative;
        inset: auto;
        min-height: 100svh;
        height: auto;
        display: block;
        overflow: visible;
    }

    .video-container {
        min-height: 100svh;
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: calc(env(safe-area-inset-top, 0px) + 18px) 16px 24px;
        box-sizing: border-box;
    }

    .main-video {
        width: min(100%, 720px);
        min-width: 0;
        max-width: 100%;
        max-height: min(52vh, 420px);
        min-height: 0;
        top: auto;
        margin: clamp(-54px, -7vw, -28px) auto clamp(8px, 2vw, 14px);
        order: 2;
    }

    .main-header {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        order: 1;
        width: 95%;
        max-width: 95%;
        min-height: clamp(200px, 28vh, 290px);
        margin: 0 auto clamp(12px, 3vw, 22px);
        padding: 0;
        justify-content: center;
        gap: 16px;
    }

    .panels-container {
        grid-template-columns: 1fr;
        position: relative;
        left: auto;
        bottom: auto;
        transform: none;
        width: min(100%, 680px);
        max-width: 680px;
        column-gap: 0;
        row-gap: 14px;
        padding: 0;
        margin-top: clamp(-78px, -10vw, -42px);
        order: 4;
        z-index: 6;
    }
}

@media (max-width: 768px) {
    .main-video {
        width: min(100%, 720px);
        min-width: 0;
        max-width: 100%;
        max-height: min(52vh, 420px);
        min-height: 0;
        top: auto;
        margin: clamp(-60px, -9vw, -34px) auto clamp(6px, 2vw, 12px);
    }

    .content-wrapper {
        position: relative;
        inset: auto;
        min-height: 100svh;
        height: auto;
        display: block;
        overflow: visible;
    }

    .video-container {
        min-height: 100svh;
        height: auto;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: calc(env(safe-area-inset-top, 0px) + 18px) 16px 24px;
        box-sizing: border-box;
    }

    .main-header {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        order: 1;
        width: 95%;
        max-width: 95%;
        min-height: clamp(200px, 28vh, 290px);
        margin: 0 auto clamp(12px, 3vw, 22px);
        padding: 0;
        justify-content: center;
        gap: 16px;
    }

    .hero-brand {
        gap: 10px;
        padding: 8px 16px;
    }

    .hero-brand__icon {
        width: clamp(34px, 9vw, 42px);
        height: clamp(34px, 9vw, 42px);
    }

    .hero-brand__text {
        font-size: clamp(1rem, 3.4vw, 1.2rem);
    }

    .main-title {
        font-size: clamp(2.45rem, 9vw, 4rem);
        line-height: 1.12;
        white-space: normal;
        overflow: visible;
        text-wrap: balance;
    }

    .hero-rotating-title {
        display: block;
        font-size: inherit;
        white-space: normal;
        text-wrap: balance;
    }

    .title-highlight-big {
        font-size: 1.1em;
    }

    .panels-container {
        grid-template-columns: 1fr;
        position: relative;
        left: auto;
        bottom: auto;
        transform: none;
        order: 3;
        width: min(100%, 680px);
        max-width: 680px;
        column-gap: 0;
        row-gap: 14px;
        padding: 0;
        margin-top: clamp(-15px, -12vw, -48px);
        order: 4;
        z-index: 6;
    }

    .panel {
        height: auto;
        min-height: 0;
        max-height: none;
        padding: 14px;
        flex-direction: row;
        align-items: stretch;
        gap: 12px;
    }

    .panel-content {
        justify-content: flex-start;
        gap: 8px;
    }

    .panel-text {
        overflow: visible;
    }

    .panel-title {
        font-size: clamp(1.05rem, 4vw, 1.22rem);
        line-height: 1.24;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .panel-subtitle {
        font-size: clamp(0.86rem, 3vw, 0.96rem);
        line-height: 1.55;
        display: block;
        overflow: visible;
        text-overflow: clip;
        -webkit-line-clamp: unset;
    }

    .panel-thumbnail {
        width: clamp(108px, 24vw, 138px);
        height: auto;
        min-width: clamp(108px, 24vw, 138px);
        max-width: clamp(108px, 24vw, 138px);
        margin: 0;
        align-self: center;
        aspect-ratio: 16 / 9;
    }

    .main-subtitle {
        font-size: clamp(1.02rem, 3.6vw, 1.18rem);
        max-width: none;
        margin: 0 auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .main-video {
        order: 2;
    }


    footer {
        position: relative;
        bottom: auto;
        padding: 12px 16px;
        flex-wrap: wrap;
        row-gap: 8px;
    }

    footer p {
        padding: 0 6px;
    }

    body > footer:last-of-type {
        margin-top: 0 !important;
        border-top: 0 !important;
        gap: 10px 16px;
        justify-content: center;
        text-align: center;
    }

    body > footer:last-of-type .beian-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
        margin-left: 0 !important;
    }
}

@media (max-width: 480px) {
    .main-video {
        max-height: min(46vh, 300px);
        margin-bottom: 40px;
    }

    .panels-container {
        width: 100%;
        row-gap: 12px;
    }

    .panel {
        padding: 12px;
        gap: 10px;
    }

    .panel-thumbnail {
        width: clamp(88px, 30vw, 112px);
        min-width: clamp(88px, 30vw, 112px);
        max-width: clamp(88px, 30vw, 112px);
    }

    .main-title {
        font-size: clamp(2.1rem, 9.2vw, 3rem);
    }

    .main-header {
        width: 95%;
        max-width: 95%;
    }

    .main-subtitle {
        font-size: 0.98rem;
        line-height: 1.65;
    }

    .hero-brand {
        padding: 7px 14px;
    }

    .hero-brand__text {
        font-size: 0.94rem;
    }

    .title-highlight-big {
        font-size: 1.02em;
    }

    .video-container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .panel-title {
        font-size: 1rem;
    }

    .panel-subtitle {
        font-size: 0.84rem;
    }

    body > footer:last-of-type {
        padding-top: 8px !important;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* 确保 body 和 html 占满全屏 */
html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #040d22;
}



.icon-placeholder {
    width: 40px;
    height: 40px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.panel-link:nth-child(1) .icon-placeholder {
    background-image: url('../images/Guide/images/ico_Guide1.png');
}

.panel-link:nth-child(2) .icon-placeholder {
    background-image: url('../images/Guide/images/ico_Guide2.png');
}

.panel-link:nth-child(3) .icon-placeholder {
    background-image: url('../images/Guide/images/ico_Guide3.png');
}

.panel-link:nth-child(4) .icon-placeholder {
    background-image: url('../images/Guide/images/ico_Guide4.png');
}

.panel-link:nth-child(5) .icon-placeholder {
    background-image: url('../images/Guide/images/ico_Guide5.png');
}

.panel-link:nth-child(6) .icon-placeholder {
    background-image: url('../images/Guide/images/ico_Guide6.png');
}
