/* =========================================================
 * 首页样式 index.css
 * 包含：全局重置 / 首屏 Hero / 最新资讯轮播 / 三个解决方案区
 * 备注：导航、页脚由 site-nav.css / site-footer.css 维护
 * ========================================================= */

/* ---------- 全局重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Arial', sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

/* =========================================================
 * 1. 首屏 Hero
 * 视频全屏背景 + 标题居中叠加，使用半透明遮罩增强可读性
 * ========================================================= */
.hero {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 480px;
    background: #0d1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 视频背景：铺满 hero 区域 */
.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* 移动端静态图占位：默认隐藏，移动端显示以替代视频背景 */
.hero-poster-mobile {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.45) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    padding: 0 24px;
}

.hero-title {
    font-size: 72px;
    font-weight: 700;
    letter-spacing: 4px;
    line-height: 1.2;
    margin: 0 0 24px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.hero-title sup {
    font-size: 0.5em;
    vertical-align: super;
    margin-left: 4px;
}

.banner-subtitle {
    font-size: 36px;
    color: #fff;
    margin: 0 0 16px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-amp {
    margin: 0 16px;
    font-weight: 400;
    opacity: 0.9;
}

/* =========================================================
 * 1.1 整页滚轮吸附 + 右侧分屏导航
 * main 容器垂直滚轮吸附，section 一一对应右侧 5 个小点
 * ========================================================= */
.snap-container {
    scroll-snap-type: y proximity;
    /* 不再自建滚动容器，吸附交给 body / html */
    overflow: visible;
    height: auto;
    scroll-behavior: smooth;
}

/* 吸附完全由 JS 控制，移除原生 scroll-snap 避免与动画冲突 */
html {
    scroll-behavior: auto;
}

/* 每屏统一 100vh，hero 在 margin-top 上让出 80px 站点导航，避免底部空缺 */
.snap-section {
    height: 100vh;
    position: relative;
    flex-shrink: 0;
}

/* hero 让出 80px 站点导航：margin-top 推 80px，height 仍 100vh 撑满视口 */
.snap-section.hero {
    height: 100vh;
    margin-top: 80px;
}

/* 页脚：参与吸附但不强制占满一屏，高度由内容决定 */
.snap-section--footer {
    height: auto;
    min-height: auto;
}

/* 右侧 5 点分屏导航：固定在视口右侧，5 个 24px 短线条小点 */
.snap-nav {
    position: fixed;
    top: 50%;
    right: 32px;
    transform: translateY(-50%);
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 20px;
    pointer-events: auto;
}

/* =========================================================
 * 1.2 渐进式进场：进入视口的元素逐个淡入 + 滑入
 * 只用 transform + opacity，GPU 加速，保证流畅
 * direction 变体：--up 从下向上 / --down 从上向下
 * ========================================================= */
.snap-reveal {
    opacity: 0;
    transition: opacity 300ms cubic-bezier(0.22, 1, 0.36, 1),
                transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

/* 默认 / 从下向上：translateY(40px) → 0 */
.snap-reveal--up {
    transform: translateY(40px);
}

/* 从上向下：translateY(-40px) → 0 */
.snap-reveal--down {
    transform: translateY(-40px);
}

.snap-reveal.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.snap-nav-dot {
    width: 4px;
    height: 24px;
    border-radius: 2px;
    background: #b9c0c8;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.25s, transform 0.25s;
    pointer-events: auto;
}

.snap-nav-dot:hover {
    background: #6b7785;
    transform: scaleX(1.6);
}

.snap-nav-dot.is-active {
    background: #3FCAC0;
    transform: scaleX(1.6);
}

/* =========================================================
 * 2. 最新资讯
 * 复用 news.css 的 .news-card 卡片样式与 news-data.js 数据
 * 白色背景，标题居中；3 张卡片 + 左右箭头翻页
 * 高度占满一屏，与首屏视频平滑衔接
 * ========================================================= */
.news-preview {
    padding: 60px 0;
    background-color: #fff;
    height: 100vh;
    display: flex;
    align-items: flex-start;
}

.news-preview-inner {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
}

.news-preview-title {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 56px;
    margin-top: 11vh;
}

.news-preview-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 80px;
}

/* 覆盖 news.css 中 .news-grid：仅作用于首页最新资讯，不影响新闻中心页 */
.news-preview-carousel .news-grid {
    flex: 1;
    margin-bottom: 0;
    gap: 36px;
}

/* 首页资讯卡片放大：标题、封面、内边距独立放大，不污染新闻中心页 */
.news-preview-carousel .news-card {
    border-radius: 16px;
}

.news-preview-carousel .news-card-cover {
    aspect-ratio: 16 / 9;
}

.news-preview-carousel .news-card-body {
    padding: 32px 32px 80px;
}

.news-preview-carousel .news-card-title {
    font-size: 22px;
    line-height: 1.55;
    min-height: 3.1em;
}

.news-preview-carousel .news-card-date {
    margin-top: 28px;
    font-size: 16px;
}

.news-preview-carousel .news-card-cta {
    padding: 20px 32px;
    font-size: 18px;
}

/* 轮播箭头：无边框，仅图标 */
.news-preview-arrow {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border: none;
    background: none;
    color: #6b7785;
    font-size: 32px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.news-preview-arrow:hover {
    color: #3FCAC0;
}

.news-preview-arrow:focus-visible {
    outline: 2px solid #3FCAC0;
    outline-offset: 2px;
}

/* =========================================================
 * 3. 解决方案区（共用样式）
 * 图片全屏背景 + 遮罩 + 文案左对齐，section 占满一屏
 * ========================================================= */
.solution {
    position: relative;
    overflow: hidden;
    height: 100vh;
    display: flex;
    align-items: center;
    color: #fff;
}

/* 全屏背景图 */
.solution-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* 遮罩层：保证文字可读性 */
.solution-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.solution-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 96px 24px;
}

.solution-content {
    max-width: 520px;
}

.solution-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 24px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.solution-desc {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 32px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.solution-btn {
    display: inline-block;
    padding: 12px 32px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    font-size: 15px;
    color: #fff;
    transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}

.solution-btn:hover {
    background: #3FCAC0;
    border-color: #3FCAC0;
    color: #fff;
}

/* 3.1 深色遮罩：车规级 / 多场景 */
.solution--adas .solution-overlay,
.solution--aiot .solution-overlay {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.2) 100%);
}

/* 3.2 浅色遮罩：AI + 中台 */
.solution--ai .solution-overlay {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.1) 100%);
}

/* =========================================================
 * 特色功能场景（由 productApply 迁入，整屏吸附）
 * ========================================================= */
.featured-features {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
}
.featured-features-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================================================
 * 响应式适配
 * ========================================================= */
@media (max-width: 1200px) {
    .news-preview-inner,
    .solution-inner {
        max-width: 100%;
    }
}

@media (max-width: 992px) {
    .news-preview-carousel .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .news-preview-carousel .news-grid .news-card:nth-child(3) {
        display: none;
    }

    .solution {
        min-height: auto;
    }

    .solution-inner {
        padding: 64px 24px;
    }

    .solution-title {
        font-size: 28px;
    }

    .solution-desc {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    /* 移动端 snap 容器外层页面直接滚动，关闭整页 snap 与侧边导航 */
    .snap-container {
        scroll-snap-type: none;
        height: auto;
        overflow: visible;
    }

    .snap-section {
        scroll-snap-align: none;
        scroll-snap-stop: normal;
        height: auto;
    }

    .snap-section.hero {
        height: calc(100vh - 64px);
        margin-top: 64px;
    }

    .snap-nav {
        display: none;
    }

    .hero {
        height: 100%;
        min-height: 360px;
    }

    /* cursor: 特色功能场景在移动端按图片原始宽高比展示 */
    .featured-features {
        height: auto;
    }
    .featured-features-img {
        height: auto;
        object-fit: contain;
    }

    .hero-video {
        display: none;
    }

    .hero-poster-mobile {
        display: block;
    }

    .hero-title {
        font-size: 36px;
        letter-spacing: 2px;
    }

    .news-preview {
        padding: 40px 0;
        min-height: 100vh;
    }

    .news-preview-title {
        font-size: 26px;
        margin-bottom: 32px;
        margin-top: 12vh;
    }

    .news-preview-carousel {
        gap: 40px;
    }

    .news-preview-carousel .news-grid {
        grid-template-columns: 1fr;
    }

    .news-preview-carousel .news-grid .news-card:nth-child(2),
    .news-preview-carousel .news-grid .news-card:nth-child(3) {
        display: none;
    }

    .news-preview-arrow {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .solution-title {
        font-size: 24px;
    }

    .solution-btn {
        padding: 10px 24px;
        font-size: 14px;
    }
}
