/* ============================================================
 * 瑞帆雷MODS - 入站穿越动画 (Tunnel Through Logo)
 * 镜头从镂空"瑞帆雷"字体中心高速穿过
 * ============================================================ */

/* 穿越隧道容器 */
.tunnel-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    pointer-events: all;
}

/* 隧道深度层 - 多层渐变模拟速度线 */
.tunnel-depth {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

/* 速度线层 */
.tunnel-speed-lines {
    position: absolute;
    inset: -50%;
    background:
        repeating-conic-gradient(
            from 0deg at 50% 50%,
            transparent 0deg,
            rgba(255, 107, 0, 0.03) 0.5deg,
            transparent 1deg
        );
    animation: speedRotate 3s linear infinite;
    opacity: 0;
}

/* 径向速度线 */
.tunnel-radial-lines {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 50%, transparent 30%, rgba(255, 107, 0, 0.02) 50%, transparent 70%);
    animation: radialPulse 1.5s ease-in-out infinite;
}

@keyframes speedRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes radialPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* 核心字体图像 - 穿越主体 */
.tunnel-logo-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.tunnel-logo {
    position: relative;
    width: 280vmax; /* 超大尺寸 - 初始充满视野 */
    height: auto;
    max-width: none;
    object-fit: contain;
    /* 初始状态：巨大、居中 */
    transform: scale(12) translateZ(0);
    opacity: 0;
    filter:
        brightness(0.9) contrast(1.15) saturate(1.1)
        drop-shadow(0 0 60px rgba(0, 180, 220, 0.4))
        drop-shadow(0 0 120px rgba(0, 229, 184, 0.2));
    will-change: transform, opacity, filter;
}

/* 穿越动画 - 三阶段 */
.tunnel-active .tunnel-logo {
    animation: tunnelThrough 2.4s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes tunnelThrough {
    /* Phase 1: 0-15% - 从黑暗中浮现，字体巨大 */
    0% {
        transform: scale(14) translateZ(-200px);
        opacity: 0;
        filter:
            brightness(0.3) contrast(1.05) saturate(0.8)
            blur(20px)
            drop-shadow(0 0 80px rgba(0, 180, 220, 0.6))
            drop-shadow(0 0 160px rgba(0, 229, 184, 0.3));
    }
    /* Phase 2: 15%-45% - 快速推进，字体逐渐清晰 */
    15% {
        transform: scale(10) translateZ(0);
        opacity: 1;
        filter:
            brightness(0.85) contrast(1.1) saturate(1.05)
            blur(6px)
            drop-shadow(0 0 60px rgba(0, 180, 220, 0.5))
            drop-shadow(0 0 120px rgba(0, 229, 184, 0.25));
    }
    /* Phase 3: 45%-75% - 高速穿越字体中心 */
    45% {
        transform: scale(4) translateZ(100px);
        opacity: 1;
        filter:
            brightness(1.1) contrast(1.2) saturate(1.2)
            blur(0px)
            drop-shadow(0 0 40px rgba(255, 107, 0, 0.6))
            drop-shadow(0 0 80px rgba(255, 140, 0, 0.3));
    }
    /* Phase 4: 75%-90% - 穿过字体，极速后退 */
    75% {
        transform: scale(0.8) translateZ(200px);
        opacity: 0.9;
        filter:
            brightness(1.4) contrast(1.3) saturate(1.3)
            blur(0px)
            drop-shadow(0 0 60px rgba(255, 107, 0, 0.8))
            drop-shadow(0 0 120px rgba(255, 140, 0, 0.4));
    }
    /* Phase 5: 90%-100% - 消失在远方光点 */
    90% {
        transform: scale(0.08) translateZ(400px);
        opacity: 0.4;
        filter:
            brightness(2) contrast(1.5) saturate(0.5)
            blur(2px)
            drop-shadow(0 0 40px rgba(255, 255, 255, 0.9));
    }
    100% {
        transform: scale(0.01) translateZ(800px);
        opacity: 0;
        filter:
            brightness(3) contrast(2) saturate(0)
            blur(8px)
            drop-shadow(0 0 80px rgba(255, 255, 255, 1));
    }
}

/* 光晕爆发效果 - 穿越瞬间 */
.tunnel-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at 50% 50%,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 140, 0, 0) 60%,
        rgba(255, 107, 0, 0) 100%
    );
    z-index: 3;
    pointer-events: none;
    opacity: 0;
}

.tunnel-active .tunnel-flash {
    animation: flashBurst 2.4s ease-out forwards;
}

@keyframes flashBurst {
    0%, 40% { opacity: 0; }
    /* 穿越中点时闪光 */
    55% {
        opacity: 1;
        background: radial-gradient(
            circle at 50% 50%,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(255, 220, 150, 0.7) 20%,
            rgba(255, 140, 0, 0.4) 45%,
            rgba(255, 107, 0, 0.1) 70%,
            transparent 100%
        );
    }
    65% {
        opacity: 0.8;
        background: radial-gradient(
            circle at 50% 50%,
            rgba(255, 255, 255, 0.6) 0%,
            rgba(255, 200, 100, 0.3) 30%,
            transparent 60%
        );
    }
    80%, 100% { opacity: 0; }
}

/* 边缘暗角 - 增强隧道感 */
.tunnel-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at 50% 50%,
        transparent 30%,
        rgba(0, 0, 0, 0.4) 70%,
        rgba(0, 0, 0, 0.95) 100%
    );
    z-index: 4;
    pointer-events: none;
    animation: vignettePulse 2.4s ease-out forwards;
}

@keyframes vignettePulse {
    0% {
        background: radial-gradient(
            ellipse at 50% 50%,
            transparent 0%,
            rgba(0, 0, 0, 0.95) 50%,
            rgba(0, 0, 0, 1) 100%
        );
    }
    30% {
        background: radial-gradient(
            ellipse at 50% 50%,
            transparent 20%,
            rgba(0, 0, 0, 0.6) 60%,
            rgba(0, 0, 0, 0.9) 100%
        );
    }
    60% {
        background: radial-gradient(
            ellipse at 50% 50%,
            transparent 40%,
            rgba(0, 0, 0, 0.3) 70%,
            rgba(0, 0, 0, 0.7) 100%
        );
    }
    100% {
        background: radial-gradient(
            ellipse at 50% 50%,
            transparent 50%,
            rgba(0, 0, 0, 0) 80%,
            rgba(0, 0, 0, 0) 100%
        );
        opacity: 0;
    }
}

/* 粒子效果 - 穿越时的碎片/光点 */
.tunnel-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

.tunnel-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #ff8c00;
    border-radius: 0;
    opacity: 0;
    box-shadow: 0 0 6px #ff8c00, 0 0 12px rgba(255, 140, 0, 0.5);
}

.tunnel-active .tunnel-particle {
    animation: particleFly 1.2s ease-out forwards;
}

@keyframes particleFly {
    0% {
        opacity: 0;
        transform: translateZ(-100px) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateZ(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateZ(300px) scale(0.2) translateY(-100px);
    }
}

/* 底部进度条 - 加载指示 */
.tunnel-progress {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    z-index: 10;
}

.tunnel-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff6b00, #ff8c00, #00e5b8);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.5);
}

.tunnel-active .tunnel-progress-bar {
    animation: progressFill 2.4s linear forwards;
}

@keyframes progressFill {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* 文字提示 */
.tunnel-hint {
    position: absolute;
    bottom: 56px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.tunnel-active .tunnel-hint {
    animation: hintFade 2.4s ease forwards;
}

@keyframes hintFade {
    0%, 10% { opacity: 1; }
    30%, 100% { opacity: 0; }
}

/* 跳过按钮 */
.tunnel-skip {
    position: absolute;
    top: 24px;
    right: 24px;
    padding: 8px 18px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    cursor: pointer;
    z-index: 20;
    transition: all 0.25s ease;
}
.tunnel-skip:hover {
    color: #ff8c00;
    background: rgba(255, 107, 0, 0.1);
    border-color: rgba(255, 107, 0, 0.3);
}

/* 遮罩退出动画 */
.tunnel-exit {
    animation: tunnelExit 0.5s cubic-bezier(0.65, 0, 1, 1) forwards !important;
}

@keyframes tunnelExit {
    to {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
    .tunnel-logo,
    .tunnel-flash,
    .tunnel-vignette,
    .tunnel-particle,
    .tunnel-speed-lines,
    .tunnel-radial-lines,
    .tunnel-progress-bar,
    .tunnel-hint {
        animation: none !important;
    }
    .tunnel-overlay {
        transition: opacity 0.3s ease;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .tunnel-logo {
        width: 350vmax;
    }
    .tunnel-progress {
        width: 150px;
        bottom: 28px;
    }
    .tunnel-hint {
        bottom: 42px;
        font-size: 9px;
    }
    .tunnel-skip {
        top: 16px;
        right: 16px;
        padding: 6px 14px;
        font-size: 10px;
    }
}
