/* ============================================
   数界探索 - 背景动效系统
   融合三角洲战术风格 × 苹果精致动效
   ============================================ */

/* === 1. 浮动几何体 - 科技三角/六边形 === */
.bg-geo-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.geo-shape {
    position: absolute;
    opacity: 0;
    will-change: transform;
}

.geo-shape svg {
    width: 100%;
    height: 100%;
}

/* 浮动动画 */
@keyframes geoFloat1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 0; }
    10% { opacity: 0.08; }
    90% { opacity: 0.08; }
    100% { transform: translate(100px, -100px) rotate(180deg) scale(1.2); opacity: 0; }
}

@keyframes geoFloat2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.06; }
    90% { opacity: 0.06; }
    100% { transform: translate(-80px, 120px) rotate(-120deg); opacity: 0; }
}

@keyframes geoFloat3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 0; }
    10% { opacity: 0.04; }
    90% { opacity: 0.04; }
    100% { transform: translate(120px, 80px) rotate(90deg) scale(0.8); opacity: 0; }
}

/* === 2. 流光数据线 - Data Flow Lines === */
.data-flow-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.data-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-1), transparent);
    opacity: 0;
    width: 200px;
}

@keyframes dataFlow {
    0% { transform: translateX(-200px); opacity: 0; }
    10% { opacity: 0.15; }
    90% { opacity: 0.15; }
    100% { transform: translateX(calc(100vw + 200px)); opacity: 0; }
}

.data-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-1);
    box-shadow: 0 0 8px var(--accent-1), 0 0 16px var(--accent-1);
}

@keyframes dataDotMove {
    0% { transform: translateX(-4px); opacity: 0; }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% { transform: translateX(calc(100vw + 4px)); opacity: 0; }
}

/* === 3. 脉冲光晕 - Glowing Orbs === */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

@keyframes orbPulse1 {
    0%, 100% { transform: scale(1); opacity: 0.04; }
    50% { transform: scale(1.3); opacity: 0.08; }
}

@keyframes orbPulse2 {
    0%, 100% { transform: scale(1) translate(0, 0); opacity: 0.03; }
    33% { transform: scale(1.2) translate(30px, -20px); opacity: 0.06; }
    66% { transform: scale(0.9) translate(-20px, 30px); opacity: 0.05; }
}

@keyframes orbDrift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(40px, -30px); }
    50% { transform: translate(-20px, 40px); }
    75% { transform: translate(30px, 20px); }
    100% { transform: translate(0, 0); }
}

/* === 4. 扫描线效果 - Scanlines (三角洲战术感) === */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 212, 255, 0.008) 2px,
        rgba(0, 212, 255, 0.008) 4px
    );
}

.scanline-beam {
    position: fixed;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.06), transparent);
    pointer-events: none;
    z-index: 1;
    animation: scanBeam 4s ease-in-out infinite;
}

@keyframes scanBeam {
    0% { top: -2px; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* === 5. 数字雨效果 - Matrix Digital Rain (技术区域) === */
.digital-rain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    opacity: 0.03;
}

.rain-column {
    position: absolute;
    top: -100%;
    color: var(--accent-1);
    font-family: 'Inter', monospace;
    font-size: 12px;
    line-height: 1;
    writing-mode: vertical-lr;
    animation: rainFall linear infinite;
}

@keyframes rainFall {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

/* === 6. 涟漪效果 - Ripple on hover === */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--accent-1);
    pointer-events: none;
    animation: rippleExpand 0.8s ease-out forwards;
}

@keyframes rippleExpand {
    0% { width: 0; height: 0; opacity: 0.5; transform: translate(-50%, -50%); }
    100% { width: 300px; height: 300px; opacity: 0; transform: translate(-50%, -50%); }
}

/* === 7. 卡片微动效 - Active Card Border Flow === */
@keyframes borderGlow {
    0%, 100% { border-color: var(--border-color); }
    50% { border-color: var(--border-accent); }
}

/* === 8. 视差星星 - Parallax Stars === */
.stars-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: starTwinkle var(--duration) ease-in-out infinite;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.6; }
}

/* === 9. 截面渐变光晕 - Section Ambient Glows === */
.section-ambient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.06;
}

@keyframes ambientDrift1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, -30px); }
}

@keyframes ambientDrift2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, 40px); }
}

/* === 10. 页面加载动效 === */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--accent-1);
    animation: loaderSpin 1s linear infinite;
    position: relative;
}

.loader-ring::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-bottom-color: var(--accent-2);
    animation: loaderSpin 0.6s linear infinite reverse;
}

@keyframes loaderSpin {
    to { transform: rotate(360deg); }
}

/* === 11. Hero 增强动效 === */
.hero-grid {
    animation: gridPulse 8s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* 标题光效 */
.title-line {
    position: relative;
}

.title-line.accent::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
    opacity: 0.3;
    filter: blur(4px);
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { opacity: 0.2; filter: blur(4px); }
    50% { opacity: 0.5; filter: blur(8px); }
}

/* === 12. Service Cards 悬浮光效 === */
.service-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(0, 212, 255, 0.06), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.service-card:hover::after {
    opacity: 1;
}

/* === 13. 连续脉冲环形 === */
.pulse-ring {
    position: absolute;
    border: 1px solid rgba(0, 212, 255, 0.1);
    border-radius: 50%;
    animation: pulseRing 4s ease-out infinite;
}

@keyframes pulseRing {
    0% { width: 0; height: 0; opacity: 0.5; }
    100% { width: 400px; height: 400px; opacity: 0; }
}

/* === 14. 联系区粒子场 === */
.contact-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* === 15. 鼠标跟随光晕 (桌面端) === */
.mouse-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.03), transparent 70%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    opacity: 0;
    will-change: left, top;
}

.mouse-glow.visible {
    opacity: 1;
}

/* === 响应式控制 === */
@media (max-width: 768px) {
    .scanlines,
    .scanline-beam,
    .mouse-glow {
        display: none;
    }
}

/* 减少动效模式 */
@media (prefers-reduced-motion: reduce) {
    .bg-geo-container,
    .data-flow-container,
    .digital-rain,
    .stars-container,
    .scanline-beam {
        display: none;
    }
}
