/* --- 基础布局重置 --- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: background-color 0.3s ease;
}

/* --- 1. About Hero (海报区) --- */
.about-hero {
    height: 60vh;
    min-height: 400px;
    max-height: 600px;
    background: 
                url("../images/about/about-hero.jpg") center/cover no-repeat;
    display: flex;
    align-items: center;
    color: #fff;
}

.about-hero-text {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    width: 100%;
}

.about-hero-text h1 {
    font-size: clamp(28px, 5vw, 42px); 
    margin-bottom: 12px;
    font-weight: 700;
    text-shadow: 0 2px 15px rgba(0,0,0,0.5);
}

/* --- 2. About Text (文字介绍区) --- */
.about-text {
    padding: 80px 0;
    background: #f7f8fa;
}

.about-text h2 {
    margin-bottom: 32px;
    color: #12165d;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
}

.about-text p {
    max-width: 900px; 
    margin: 0 auto;
    line-height: 1.8;
    color: #444;
    font-size: 16px;
    padding: 0 24px;
    text-align: justify;
}

/* --- 3. About Video (视频展示区) --- */
.about-video {
    padding: 80px 0;
    background: #fff;
}

.video-box {
    display: flex;
    max-width: 1000px;
    margin: 0 auto;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

#factoryVideo {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    object-fit: cover;
}

.video-switch {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.video-btn {
    padding: 12px 28px;
    border-radius: 50px;
    border: 1px solid #000000;
    background: #000000;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #000000;
}

.video-btn.active {
    background-color: #12165d !important;
    color: #ffffff !important;
    border-color: #12165d !important;
    box-shadow: 0 4px 12px rgba(18, 22, 93, 0.3);
}

/* --- 4. About Gallery (轮播区) --- */
.about-gallery {
    padding: 80px 0;
    background: #f7f8fa;
    overflow: hidden;
    position: relative;
}

.gallery-wrapper {
    position: relative;
    max-width: 1000px; /* 改为 1000px 与视频框同步 */
    margin: 0 auto;
    padding: 0; /* 去掉内边距，让模糊效果从边缘开始 */
    
    /* --- 核心：边缘模糊效果 --- */
    /* 使用线性渐变遮罩，中间不透明，两端透明 */
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%
    );
}

/* 确保轨道不会被 mask 切掉阴影 */
.about-gallery {
    padding: 80px 0;
    /* 增加一点上下 padding 确保阴影显示完整 */
}

/* 调整按钮位置，让它跨在模糊带边缘或稍微靠外 */
.gallery-arrow.prev { left: -60px; }
.gallery-arrow.next { right: -60px; }

/* 如果屏幕太窄放不下外置按钮，则移动端隐藏 */
@media (max-width: 1150px) {
    .gallery-arrow {
        display: none; 
    }
}

.gallery-track:active { cursor: grabbing; }

.gallery-item {
    flex: 0 0 auto;
    width: 300px; 
    text-align: center;
}

.gallery-item img {
    width: 100% !important;
    display: block;
    aspect-ratio: 3 / 2;
    background-color: #e8eaed; 
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    pointer-events: none; 
    -webkit-user-drag: none;
}

.gallery-item p {
    margin-top: 16px;
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

/* --- 5. Gallery Controls --- */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.gallery-arrow:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.gallery-arrow.prev { left: 30px; }
.gallery-arrow.next { right: 30px; }

/* --- 6. 暗黑模式深度适配 (关键优化) --- */
@media (prefers-color-scheme: dark) {
    body { background-color: #121212; color: #eeeeee; }

    .about-text, .about-gallery {
        background-color: #1a1a1a !important;
    }

    /* 文字颜色分级：标题纯白，描述浅灰 */
    .about-text h2 { color: #ffffff !important; }
    .about-text p { color: #bbbbbb !important; }
    .gallery-item p { color: #dddddd !important; }

    .about-video { background-color: #121212 !important; }

    /* 视频按钮适配 */
    .video-btn {
        background: #2a2a2a;
        border-color: #444;
        color: #aaaaaa;
    }

    .gallery-arrow {
        background: rgba(255, 255, 255, 0.15) !important;
        color: #ffffff !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    }
    
    .gallery-item img {
        background-color: #2a2a2a;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    }

    /* 暗黑模式滑动手感优化 */
    .about-gallery {
        touch-action: pan-y;
        overscroll-behavior-x: none;
    }
}

/* --- 7. 响应式布局 --- */
@media (max-width: 900px) {
    .gallery-arrow { display: none; }
    .about-text p { font-size: 15px; }
}

@media (max-width: 600px) {
    .about-hero { height: 40vh; min-height: 300px; }
    .about-text, .about-video, .about-gallery { padding: 50px 0; }
    .gallery-track { gap: 16px; }
    .gallery-item { width: 85vw; }
    .video-btn { padding: 10px 20px; font-size: 13px; }
}


.gallery-item img {
    -webkit-user-drag: none; /* 关键：防止浏览器默认的图片拖拽 */
    user-select: none;
}

@media (max-width: 600px) {
    .gallery-wrapper {
        max-width: 100%;
        -webkit-mask-image: none;
        mask-image: none;
    }
    .gallery-item {
        width: 80vw; /* 移动端让宽度随屏幕走 */
    }
}

/* ===== iPhone Safari 触控修复 ===== */

/* 让轨道允许水平滑动 */
.gallery-track {
    display: flex;
    gap: 24px;
    touch-action: pan-y pan-x;
    -webkit-overflow-scrolling: touch;
}

/* 防止图片吃掉触控事件 */
.gallery-item img {
    pointer-events: none;
    touch-action: none;
    -webkit-user-drag: none;
    user-select: none;
}

/* 防止 iOS 长按图片弹菜单 */
.gallery-item {
    -webkit-touch-callout: none;
}

