/**
 * dynamic-bg.css - 整页动态背景动画
 */

/* ===== 整页动态背景容器 ===== */
.page-dynamic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background: transparent;
}

/* ===== 内容层（在动画之上） ===== */
.dh-container {
    position: relative;
    z-index: 1;
}
.main-content {
    position: relative;
    z-index: 1;
}

/* ============================================================
   纸飞机动画
   ============================================================ */
.page-dynamic-bg .paper-plane {
    position: absolute;
    font-size: 32px;
    color: rgba(74, 108, 247, 0.12);
    animation: flyPlane linear infinite;
    will-change: transform;
}

.page-dynamic-bg .paper-plane:nth-child(1) {
    top: 10%;
    left: -80px;
    font-size: 30px;
    animation-duration: 14s;
    animation-delay: 0s;
    color: rgba(74, 108, 247, 0.10);
}

.page-dynamic-bg .paper-plane:nth-child(2) {
    top: 35%;
    left: -120px;
    font-size: 44px;
    animation-duration: 18s;
    animation-delay: 3s;
    color: rgba(106, 140, 255, 0.08);
}

.page-dynamic-bg .paper-plane:nth-child(3) {
    top: 60%;
    left: -60px;
    font-size: 24px;
    animation-duration: 16s;
    animation-delay: 6s;
    color: rgba(74, 108, 247, 0.07);
}

.page-dynamic-bg .paper-plane:nth-child(4) {
    top: 85%;
    left: -100px;
    font-size: 36px;
    animation-duration: 20s;
    animation-delay: 10s;
    color: rgba(106, 140, 255, 0.06);
}

.page-dynamic-bg .paper-plane:nth-child(5) {
    top: 50%;
    left: -150px;
    font-size: 28px;
    animation-duration: 22s;
    animation-delay: 15s;
    color: rgba(74, 108, 247, 0.05);
}

@keyframes flyPlane {
    0% {
        transform: translateX(0) translateY(0) rotate(-15deg) scale(0.6);
        opacity: 0;
    }
    8% {
        opacity: 0.8;
    }
    30% {
        transform: translateX(30vw) translateY(-12px) rotate(-5deg) scale(1);
    }
    60% {
        transform: translateX(60vw) translateY(8px) rotate(5deg) scale(0.9);
    }
    85% {
        transform: translateX(90vw) translateY(-5px) rotate(-3deg) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translateX(110vw) translateY(0) rotate(10deg) scale(0.6);
        opacity: 0;
    }
}

/* ============================================================
   方块滑过动画
   ============================================================ */
.page-dynamic-bg .slide-block {
    position: absolute;
    border-radius: 6px;
    opacity: 0;
    will-change: transform;
}

.page-dynamic-bg .slide-block:nth-child(6) {
    top: 18%;
    width: 70px;
    height: 70px;
    background: rgba(74, 108, 247, 0.05);
    border: 2px solid rgba(74, 108, 247, 0.06);
    animation: slideBlock 22s ease-in-out infinite;
    animation-delay: 0s;
    transform: rotate(20deg);
}

.page-dynamic-bg .slide-block:nth-child(7) {
    top: 48%;
    width: 45px;
    height: 45px;
    background: rgba(106, 140, 255, 0.04);
    border: 2px solid rgba(106, 140, 255, 0.05);
    animation: slideBlock 25s ease-in-out infinite;
    animation-delay: 5s;
    transform: rotate(-15deg);
}

.page-dynamic-bg .slide-block:nth-child(8) {
    top: 72%;
    width: 90px;
    height: 90px;
    background: rgba(74, 108, 247, 0.03);
    border: 2px solid rgba(74, 108, 247, 0.04);
    animation: slideBlock 20s ease-in-out infinite;
    animation-delay: 10s;
    transform: rotate(40deg);
}

@keyframes slideBlock {
    0% {
        left: -120px;
        opacity: 0;
        transform: rotate(0deg) scale(0.5);
    }
    15% {
        opacity: 0.5;
    }
    40% {
        transform: rotate(25deg) scale(1);
        opacity: 0.7;
    }
    70% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        left: calc(100% + 120px);
        opacity: 0;
        transform: rotate(50deg) scale(0.5);
    }
}

/* ============================================================
   漂浮光点
   ============================================================ */
.page-dynamic-bg .float-dot {
    position: absolute;
    border-radius: 50%;
    background: rgba(74, 108, 247, 0.06);
    animation: floatDot ease-in-out infinite alternate;
    will-change: transform;
}

.page-dynamic-bg .float-dot:nth-child(9) {
    width: 10px;
    height: 10px;
    top: 12%;
    left: 15%;
    animation-duration: 7s;
    animation-delay: 0s;
    background: rgba(74, 108, 247, 0.08);
}

.page-dynamic-bg .float-dot:nth-child(10) {
    width: 16px;
    height: 16px;
    top: 45%;
    left: 55%;
    animation-duration: 9s;
    animation-delay: 2s;
    background: rgba(106, 140, 255, 0.06);
}

.page-dynamic-bg .float-dot:nth-child(11) {
    width: 8px;
    height: 8px;
    top: 68%;
    left: 25%;
    animation-duration: 6s;
    animation-delay: 4s;
    background: rgba(74, 108, 247, 0.10);
}

.page-dynamic-bg .float-dot:nth-child(12) {
    width: 12px;
    height: 12px;
    top: 25%;
    left: 75%;
    animation-duration: 8s;
    animation-delay: 1s;
    background: rgba(106, 140, 255, 0.05);
}

.page-dynamic-bg .float-dot:nth-child(13) {
    width: 20px;
    height: 20px;
    top: 80%;
    left: 45%;
    animation-duration: 10s;
    animation-delay: 3s;
    background: rgba(74, 108, 247, 0.04);
}

.page-dynamic-bg .float-dot:nth-child(14) {
    width: 6px;
    height: 6px;
    top: 55%;
    left: 88%;
    animation-duration: 5s;
    animation-delay: 6s;
    background: rgba(74, 108, 247, 0.12);
}

@keyframes floatDot {
    0% {
        transform: translateY(0px) scale(1);
        opacity: 0.2;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-40px) scale(1.4);
        opacity: 0.2;
    }
}

/* ============================================================
   响应式：移动端减少动画元素
   ============================================================ */
@media (max-width: 768px) {
    .page-dynamic-bg .paper-plane:nth-child(3),
    .page-dynamic-bg .paper-plane:nth-child(4),
    .page-dynamic-bg .paper-plane:nth-child(5),
    .page-dynamic-bg .slide-block:nth-child(7),
    .page-dynamic-bg .slide-block:nth-child(8),
    .page-dynamic-bg .float-dot:nth-child(10),
    .page-dynamic-bg .float-dot:nth-child(12),
    .page-dynamic-bg .float-dot:nth-child(13),
    .page-dynamic-bg .float-dot:nth-child(14) {
        display: none;
    }
    .page-dynamic-bg .paper-plane {
        font-size: 22px !important;
    }
    .page-dynamic-bg .paper-plane:nth-child(1) {
        font-size: 22px !important;
        left: -60px;
    }
    .page-dynamic-bg .paper-plane:nth-child(2) {
        font-size: 30px !important;
        left: -80px;
    }
    .page-dynamic-bg .slide-block {
        width: 35px !important;
        height: 35px !important;
    }
    .page-dynamic-bg .slide-block:nth-child(6) {
        width: 35px !important;
        height: 35px !important;
    }
}

@media (max-width: 480px) {
    .page-dynamic-bg .paper-plane:nth-child(2) {
        display: none;
    }
    .page-dynamic-bg .float-dot:nth-child(9),
    .page-dynamic-bg .float-dot:nth-child(11) {
        display: none;
    }
}