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

/* 深蓝色背景 - 初始颜色 */
.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: calc(clamp(10px, 2vh, 30px) + 100px);
    /* 减少顶部间距，响应式 */
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 90%;
    max-width: 1200px;
    z-index: 20;
    pointer-events: none;
}

/* 主标题 */
.main-title {
    color: #ffffff;
    font-size: clamp(2rem, 5vw, 4rem);
    /* 响应式字体大小 */
    font-weight: 700;
    margin: 0;
    font-family: 'Kalam', 'Comic Neue', 'Microsoft YaHei', sans-serif;
    white-space: nowrap;
    /* 防止换行 */
    overflow: visible;
    text-overflow: clip;
    pointer-events: auto;
}

.hero-rotating-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.15;
    display: inline-block;
    transition: opacity 220ms ease, transform 220ms ease;
    will-change: opacity, transform;
}

.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(2.8rem, 5vw, 5rem);
}

/* 副标题 */
.main-subtitle {
    color: #ffffff;
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    /* 响应式字体大小 */
    margin: 0;
    opacity: 0.9;
    font-family: 'Kalam', 'Comic Neue', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    max-width: 100%;
    overflow-wrap: break-word;
    /* 允许长单词换行 */
    pointer-events: auto;
}

/* 视频容器 - 包含标题、视频、菜单三个层级 */
.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: calc(100% - 40px);
    max-width: 1400px;
    /* 限制最大宽度，与视频保持一致 */
    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 clamp(10px, 2vw, 20px);
    /* 左右内边距 */
    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::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;
}

@media (max-width: 768px) {
    .main-video {
        max-width: 120%;
        /* 小屏幕允许超出20% */
        max-height: calc(100vh - 250px);
        min-height: 50vh;
        top: -350px;
        /* 中等宽度时向上移动更多 */
    }

    .panels-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        column-gap: clamp(0.5rem, 1vw, 0.8rem);
        /* 响应式列间距 */
        row-gap: 24px;
        /* 保持固定行间距 */
        bottom: clamp(10px, 3vh, 40px);
        /* 减少底部间距 */
        max-width: 100%;
    }

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

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

    .main-title {
        font-size: clamp(2rem, 5vw, 3.5rem);
        /* 响应式标题 */
    }

    .main-subtitle {
        font-size: clamp(0.75rem, 1.1vw, 0.9rem);
        /* 响应式副标题 */
    }
}

@media (max-width: 480px) {
    .main-video {
        max-width: 110%;
        /* 超小屏幕允许超出10% */
        max-height: calc(100vh - 220px);
        min-height: 45vh;
        top: -354px;
        /* 最小宽度时向上移动更多 */
    }

    .panels-container {
        column-gap: clamp(0.4rem, 1vw, 0.7rem);
        /* 响应式列间距 */
        row-gap: 24px;
        /* 保持固定行间距 */
        bottom: clamp(8px, 2vh, 30px);
        /* 减少底部间距 */
        max-width: 100%;
    }

    .panel {
        height: clamp(90px, 15vw, 100px);
        /* 响应式高度 */
        min-height: clamp(90px, 15vw, 100px);
        max-height: clamp(90px, 15vw, 100px);
        padding: clamp(0.5rem, 1vw, 0.7rem);
        gap: clamp(0.4rem, 1vw, 0.7rem);
        flex-direction: row;
        box-sizing: border-box;
    }

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

    .main-title {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
        /* 响应式标题 */
    }

    .main-subtitle {
        font-size: clamp(0.7rem, 1vw, 0.85rem);
        /* 响应式副标题 */
    }
}

/* 确保 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');
}
