/* 滚动效果容器 */
.geniatech-scroll-effect-container {
    display: flex;
    width: 100%;
    height: 80vh;
    position: relative;
    overflow: hidden;
}

/* 左侧图片容器 */
.geniatech-scroll-image-container {
    width: 50%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 左侧图片 */
.geniatech-scroll-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    opacity: 0;
    /*transition: opacity 0.6s ease-in-out;*/
    transition: none;
    border-radius: 10px;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.geniatech-scroll-image.active {
    opacity: 1;
}

/* 右侧内容容器 */
.geniatech-scroll-content-container {
    width: 50%;
    height: 100%;
    position: relative;
    overflow: hidden;
    padding: 40px;
    box-sizing: border-box;
}

/* 右侧内容滚动区域 */
.geniatech-scroll-content {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 20px;
    box-sizing: border-box;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    
    /* 隐藏滚动条但保持滚动功能 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.geniatech-scroll-content::-webkit-scrollbar {
    display: none; /* WebKit */
}

/* 滚动项目 - 默认启用缩放模式 */
.geniatech-scroll-effect-container.scale-enabled .geniatech-scroll-item {
    margin-bottom: 60px;
    padding: 20px 0;
    transition: all 0.3s ease;
    opacity: 0.6;
    transform: scale(0.95);
}

.geniatech-scroll-effect-container.scale-enabled .geniatech-scroll-item.active {
    opacity: 1;
    /* 缩放值由Elementor控制器设置 */
}

/* 关闭缩放模式 - 所有项目统一大小 */
.geniatech-scroll-effect-container.scale-disabled .geniatech-scroll-item {
    margin-bottom: 60px;
    padding: 20px 0;
    transition: all 0.3s ease;
    opacity: 0.6;
    transform: scale(1) !important; /* 强制统一大小 */
}

.geniatech-scroll-effect-container.scale-disabled .geniatech-scroll-item.active {
    opacity: 1;
    transform: scale(1) !important; /* 激活时也保持统一大小 */
}

.geniatech-scroll-item:last-child {
    margin-bottom: 0;
}

/* 项目图标 */
.geniatech-scroll-item-icon {
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.geniatech-scroll-item-icon i,
.geniatech-scroll-item-icon svg {
    font-size: 40px;
    color: #007cba;
    transition: all 0.3s ease;
}

.geniatech-scroll-item.active .geniatech-scroll-item-icon i,
.geniatech-scroll-item.active .geniatech-scroll-item-icon svg {
    color: #ff4757;
    transform: scale(1.1);
}

/* 项目标题 */
.geniatech-scroll-item-title {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
    color: #333333;
    margin: 0 0 15px 0;
    transition: all 0.3s ease;
}

.geniatech-scroll-item-title a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

.geniatech-scroll-item-title a:hover {
    color: #007cba;
}

.geniatech-scroll-item.active .geniatech-scroll-item-title {
    color: #ff4757;
}

/* 项目描述 */
.geniatech-scroll-item-description {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: #666666;
    margin: 0;
    transition: all 0.3s ease;
}

.geniatech-scroll-item.active .geniatech-scroll-item-description {
    color: #333333;
}

/* 滚动区域遮罩层 - 实现上下渐变淡入淡出效果 */
.geniatech-scroll-fade {
    position: absolute;
    left: 0;
    right: 20px; /* 避免覆盖滚动条区域 */
    pointer-events: none;
    z-index: 10; /* 确保在滚动内容之上 */
    --mask-height: 50px; /* 遮罩高度，可通过Elementor控制 */
    --mask-opacity: 0.9; /* 遮罩透明度，可通过Elementor控制 */
    --mask-color: #ffffff; /* 遮罩颜色，可通过Elementor控制 */
    transition: all 0.3s ease;
}

/* 顶部遮罩层 - 从完全遮罩到透明的渐变 */
.geniatech-scroll-fade-top {
    top: 0;
    --mask-opacity: 0.9; /* 默认透明度 */
    --mask-color: #ffffff; /* 默认颜色 */
    background: linear-gradient(to bottom, 
        var(--mask-color) 0%,
        color-mix(in srgb, var(--mask-color), transparent calc((1 - var(--mask-opacity) * 0.9) * 100%)) 20%,
        color-mix(in srgb, var(--mask-color), transparent calc((1 - var(--mask-opacity) * 0.7) * 100%)) 40%,
        color-mix(in srgb, var(--mask-color), transparent calc((1 - var(--mask-opacity) * 0.4) * 100%)) 70%,
        color-mix(in srgb, var(--mask-color), transparent calc((1 - var(--mask-opacity) * 0.1) * 100%)) 90%,
        transparent 100%
    );
}

/* 底部遮罩层 - 从透明到完全遮罩的渐变 */
.geniatech-scroll-fade-bottom {
    bottom: 0;
    --mask-opacity: 0.9; /* 默认透明度 */
    --mask-color: #ffffff; /* 默认颜色 */
    background: linear-gradient(to top, 
        var(--mask-color) 0%,
        color-mix(in srgb, var(--mask-color), transparent calc((1 - var(--mask-opacity) * 0.9) * 100%)) 20%,
        color-mix(in srgb, var(--mask-color), transparent calc((1 - var(--mask-opacity) * 0.7) * 100%)) 40%,
        color-mix(in srgb, var(--mask-color), transparent calc((1 - var(--mask-opacity) * 0.4) * 100%)) 70%,
        color-mix(in srgb, var(--mask-color), transparent calc((1 - var(--mask-opacity) * 0.1) * 100%)) 90%,
        transparent 100%
    );
}

/* 增强可见度模式 - 更强的遮罩效果 */
.geniatech-scroll-fade.enhanced-visibility.geniatech-scroll-fade-top {
    background: linear-gradient(to bottom, 
        var(--mask-color) 0%,
        var(--mask-color) 10%,
        color-mix(in srgb, var(--mask-color), transparent calc((1 - var(--mask-opacity) * 0.95) * 100%)) 25%,
        color-mix(in srgb, var(--mask-color), transparent calc((1 - var(--mask-opacity) * 0.8) * 100%)) 45%,
        color-mix(in srgb, var(--mask-color), transparent calc((1 - var(--mask-opacity) * 0.5) * 100%)) 70%,
        color-mix(in srgb, var(--mask-color), transparent calc((1 - var(--mask-opacity) * 0.2) * 100%)) 90%,
        transparent 100%
    );
}

.geniatech-scroll-fade.enhanced-visibility.geniatech-scroll-fade-bottom {
    background: linear-gradient(to top, 
        var(--mask-color) 0%,
        var(--mask-color) 10%,
        color-mix(in srgb, var(--mask-color), transparent calc((1 - var(--mask-opacity) * 0.95) * 100%)) 25%,
        color-mix(in srgb, var(--mask-color), transparent calc((1 - var(--mask-opacity) * 0.8) * 100%)) 45%,
        color-mix(in srgb, var(--mask-color), transparent calc((1 - var(--mask-opacity) * 0.5) * 100%)) 70%,
        color-mix(in srgb, var(--mask-color), transparent calc((1 - var(--mask-opacity) * 0.2) * 100%)) 90%,
        transparent 100%
    );
}

/* 兼容旧浏览器的回退方案 */
@supports not (color: color-mix(in srgb, white 50%, transparent)) {
    .geniatech-scroll-fade-top {
        background: linear-gradient(to bottom, 
            var(--mask-color) 0%,
            transparent 100%);
        opacity: var(--mask-opacity);
    }
    
    .geniatech-scroll-fade-bottom {
        background: linear-gradient(to top, 
            var(--mask-color) 0%,
            transparent 100%);
        opacity: var(--mask-opacity);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .geniatech-scroll-effect-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .geniatech-scroll-image-container {
        width: 100%;
        height: 100vh;
        position: relative;
        z-index: 5;
    }

    .geniatech-scroll-content-container {
        width: 100%;
        height: 50vh;
        padding: 20px;
        background: #ffffff;
        z-index: 6;
        position: relative;
        margin-top: -20px;
        border-radius: 20px 20px 0 0;
    }

    .geniatech-scroll-content {
        height: 100%;
        overflow-y: hidden;
        padding-right: 0;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        /* 允许滚动链到页面 */
        overscroll-behavior: auto;
    }

    .geniatech-scroll-item {
        margin-bottom: 40px;
        padding: 15px 0;
    }

    .geniatech-scroll-item-icon i,
    .geniatech-scroll-item-icon svg {
        font-size: 32px;
    }

    .geniatech-scroll-item-title {
        font-size: 20px;
    }

    .geniatech-scroll-item-description {
        font-size: 14px;
    }

    /* 移动端隐藏渐隐遮罩 */
    .geniatech-scroll-fade {
        display: none;
    }
}

@media (max-width: 480px) {
    .geniatech-scroll-content-container {
        padding: 15px;
    }

    .geniatech-scroll-item {
        margin-bottom: 30px;
        padding: 10px 0;
    }

    .geniatech-scroll-item-icon i,
    .geniatech-scroll-item-icon svg {
        font-size: 28px;
    }

    .geniatech-scroll-item-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .geniatech-scroll-item-description {
        font-size: 13px;
    }
}

/* 平板端调整 */
@media (max-width: 1024px) and (min-width: 769px) {
    .geniatech-scroll-content-container {
        padding: 30px;
    }

    .geniatech-scroll-item {
        margin-bottom: 50px;
    }

    .geniatech-scroll-item-icon i,
    .geniatech-scroll-item-icon svg {
        font-size: 36px;
    }

    .geniatech-scroll-item-title {
        font-size: 22px;
    }

    .geniatech-scroll-item-description {
        font-size: 15px;
    }
}

/* 滚动指示器（可选） */
.geniatech-scroll-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 100px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    z-index: 20;
}

.geniatech-scroll-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: #007cba;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 加载动画 */
.geniatech-scroll-effect-container.loading {
    opacity: 0.8;
}

.geniatech-scroll-effect-container.loading .geniatech-scroll-item {
    animation: scroll-item-fade-in 0.6s ease forwards;
}

@keyframes scroll-item-fade-in {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 0.6;
        transform: translateY(0) scale(0.95);
    }
}

/* 项目延迟动画 */
.geniatech-scroll-item:nth-child(1) { animation-delay: 0.1s; }
.geniatech-scroll-item:nth-child(2) { animation-delay: 0.2s; }
.geniatech-scroll-item:nth-child(3) { animation-delay: 0.3s; }
.geniatech-scroll-item:nth-child(4) { animation-delay: 0.4s; }
.geniatech-scroll-item:nth-child(5) { animation-delay: 0.5s; }
.geniatech-scroll-item:nth-child(6) { animation-delay: 0.6s; }

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .geniatech-scroll-item {
        border: 2px solid transparent;
    }

    .geniatech-scroll-item.active {
        border-color: #000;
        background: rgba(255, 255, 255, 0.9);
    }

    .geniatech-scroll-fade-top,
    .geniatech-scroll-fade-bottom {
        display: none;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .geniatech-scroll-image,
    .geniatech-scroll-item,
    .geniatech-scroll-item-icon i,
    .geniatech-scroll-item-icon svg,
    .geniatech-scroll-item-title,
    .geniatech-scroll-item-description {
        transition: none;
    }

    .geniatech-scroll-item {
        animation: none;
    }

    .geniatech-scroll-item.active .geniatech-scroll-item-icon i,
    .geniatech-scroll-item.active .geniatech-scroll-item-icon svg {
        transform: none;
    }
}

/* Elementor编辑器支持 */
.elementor-editor-active .geniatech-scroll-effect-container {
    pointer-events: auto;
}

.elementor-editor-active .geniatech-scroll-content {
    overflow: visible;
}

.elementor-editor-active .geniatech-scroll-fade {
    display: none;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .geniatech-scroll-fade-top {
        background: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
    }

    .geniatech-scroll-fade-bottom {
        background: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
    }
}
