/* KT智能拓客系统 - 高级加载动画 2.0 */

.kt-loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    overflow: hidden;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.kt-loader-container.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* 动态背景网格 */
.kt-grid-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(103, 126, 234, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(103, 126, 234, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* 渐变光晕背景 */
.kt-glow-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(103, 126, 234, 0.2) 0%, transparent 70%);
    animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* 中心内容容器 */
.kt-loader-center-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

/* 主加载器容器 */
.kt-loader-main {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* DNA双螺旋动画 */
.kt-dna-loader {
    position: absolute;
    width: 100px;
    height: 200px;
    display: flex;
    justify-content: space-between;
}

.kt-dna-strand {
    width: 2px;
    height: 100%;
    position: relative;
}

.kt-dna-strand::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
        transparent 0%,
        #667eea 10%,
        #764ba2 50%,
        #f093fb 90%,
        transparent 100%
    );
    animation: dnaFlow 2s linear infinite;
}

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

.kt-dna-connector {
    position: absolute;
    width: 100px;
    height: 2px;
    left: 0;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    animation: dnaRotate 2s ease-in-out infinite;
}

.kt-dna-connector:nth-child(1) { top: 10%; animation-delay: 0s; }
.kt-dna-connector:nth-child(2) { top: 20%; animation-delay: 0.2s; }
.kt-dna-connector:nth-child(3) { top: 30%; animation-delay: 0.4s; }
.kt-dna-connector:nth-child(4) { top: 40%; animation-delay: 0.6s; }
.kt-dna-connector:nth-child(5) { top: 50%; animation-delay: 0.8s; }
.kt-dna-connector:nth-child(6) { top: 60%; animation-delay: 1s; }
.kt-dna-connector:nth-child(7) { top: 70%; animation-delay: 1.2s; }
.kt-dna-connector:nth-child(8) { top: 80%; animation-delay: 1.4s; }
.kt-dna-connector:nth-child(9) { top: 90%; animation-delay: 1.6s; }

@keyframes dnaRotate {
    0%, 100% {
        transform: rotateY(0deg) scaleX(0.3);
        opacity: 0.3;
    }
    50% {
        transform: rotateY(180deg) scaleX(1);
        opacity: 1;
    }
}

/* 3D立方体加载器 */
.kt-cube-loader {
    position: absolute;
    width: 80px;
    height: 80px;
    transform-style: preserve-3d;
    animation: cubeRotate 4s linear infinite;
}

@keyframes cubeRotate {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

.kt-cube-face {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid;
    background: rgba(103, 126, 234, 0.1);
    backdrop-filter: blur(10px);
}

.kt-cube-face:nth-child(1) {
    transform: translateZ(40px);
    border-color: #667eea;
    box-shadow: 0 0 50px rgba(102, 126, 234, 0.5);
}
.kt-cube-face:nth-child(2) {
    transform: rotateY(90deg) translateZ(40px);
    border-color: #764ba2;
    box-shadow: 0 0 50px rgba(118, 75, 162, 0.5);
}
.kt-cube-face:nth-child(3) {
    transform: rotateY(180deg) translateZ(40px);
    border-color: #f093fb;
    box-shadow: 0 0 50px rgba(240, 147, 251, 0.5);
}
.kt-cube-face:nth-child(4) {
    transform: rotateY(-90deg) translateZ(40px);
    border-color: #fbbf24;
    box-shadow: 0 0 50px rgba(251, 191, 36, 0.5);
}
.kt-cube-face:nth-child(5) {
    transform: rotateX(90deg) translateZ(40px);
    border-color: #10b981;
    box-shadow: 0 0 50px rgba(16, 185, 129, 0.5);
}
.kt-cube-face:nth-child(6) {
    transform: rotateX(-90deg) translateZ(40px);
    border-color: #ef4444;
    box-shadow: 0 0 50px rgba(239, 68, 68, 0.5);
}

/* 圆形轨道 */
.kt-orbit-container {
    position: absolute;
    width: 300px;
    height: 300px;
    animation: orbitRotate 20s linear infinite;
}

@keyframes orbitRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.kt-orbit {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(103, 126, 234, 0.2);
    border-radius: 50%;
}

.kt-orbit:nth-child(1) {
    width: 100%;
    height: 100%;
    animation: pulse 2s ease-in-out infinite;
}

.kt-orbit:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    animation: pulse 2s ease-in-out infinite 0.2s;
}

.kt-orbit:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    animation: pulse 2s ease-in-out infinite 0.4s;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.6;
    }
}

/* 轨道粒子 */
.kt-orbit-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #fff, transparent);
    border-radius: 50%;
    box-shadow: 0 0 10px #667eea, 0 0 20px #667eea;
}

.kt-orbit-particle:nth-child(4) {
    top: -4px;
    left: calc(50% - 4px);
    animation: orbitParticle1 3s linear infinite;
}

.kt-orbit-particle:nth-child(5) {
    bottom: -4px;
    left: calc(50% - 4px);
    animation: orbitParticle2 3s linear infinite;
}

.kt-orbit-particle:nth-child(6) {
    top: calc(50% - 4px);
    right: -4px;
    animation: orbitParticle3 3s linear infinite;
}

@keyframes orbitParticle1 {
    0% { transform: rotate(0deg) translateX(150px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(150px) rotate(-360deg); }
}

@keyframes orbitParticle2 {
    0% { transform: rotate(180deg) translateX(120px) rotate(-180deg); }
    100% { transform: rotate(540deg) translateX(120px) rotate(-540deg); }
}

@keyframes orbitParticle3 {
    0% { transform: rotate(90deg) translateX(90px) rotate(-90deg); }
    100% { transform: rotate(450deg) translateX(90px) rotate(-450deg); }
}

/* 文字和进度 */
.kt-loader-info {
    text-align: center;
    width: 100%;
}

.kt-loader-title {
    margin-bottom: 15px;
    animation: textShine 3s ease-in-out infinite;
}

/* 中文标题 */
.kt-title-zh {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 6px;
    margin-bottom: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

@keyframes textShine {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.kt-loader-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

/* 进度条容器 */
.kt-progress-container {
    width: 400px;
    margin: 0 auto;
    position: relative;
}

.kt-progress-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.kt-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #fbbf24);
    background-size: 300% 100%;
    animation: progressGradient 3s ease-in-out infinite;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(103, 126, 234, 0.5);
}

@keyframes progressGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.kt-progress-text {
    position: absolute;
    right: 0;
    top: -25px;
    color: #667eea;
    font-size: 12px;
    font-weight: 600;
}

/* 状态文本 */
.kt-status-text {
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.kt-status-icon {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: statusBlink 1s ease-in-out infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* 浮动粒子背景 */
.kt-particles-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.kt-particle-float {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: floatUp 15s linear infinite;
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(100vh) translateX(0) scale(0);
    }
    10% {
        opacity: 1;
        transform: translateY(90vh) translateX(10px) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(10vh) translateX(-10px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(0);
    }
}

/* 生成多个粒子 */
.kt-particle-float:nth-child(1) { left: 5%; animation-delay: 0s; animation-duration: 12s; }
.kt-particle-float:nth-child(2) { left: 15%; animation-delay: 2s; animation-duration: 15s; }
.kt-particle-float:nth-child(3) { left: 25%; animation-delay: 4s; animation-duration: 18s; }
.kt-particle-float:nth-child(4) { left: 35%; animation-delay: 1s; animation-duration: 14s; }
.kt-particle-float:nth-child(5) { left: 45%; animation-delay: 3s; animation-duration: 16s; }
.kt-particle-float:nth-child(6) { left: 55%; animation-delay: 5s; animation-duration: 13s; }
.kt-particle-float:nth-child(7) { left: 65%; animation-delay: 2s; animation-duration: 17s; }
.kt-particle-float:nth-child(8) { left: 75%; animation-delay: 4s; animation-duration: 15s; }
.kt-particle-float:nth-child(9) { left: 85%; animation-delay: 0s; animation-duration: 14s; }
.kt-particle-float:nth-child(10) { left: 95%; animation-delay: 3s; animation-duration: 16s; }
.kt-particle-float:nth-child(11) { left: 10%; animation-delay: 6s; animation-duration: 13s; }
.kt-particle-float:nth-child(12) { left: 20%; animation-delay: 7s; animation-duration: 15s; }
.kt-particle-float:nth-child(13) { left: 30%; animation-delay: 8s; animation-duration: 14s; }
.kt-particle-float:nth-child(14) { left: 40%; animation-delay: 9s; animation-duration: 16s; }
.kt-particle-float:nth-child(15) { left: 50%; animation-delay: 10s; animation-duration: 15s; }
.kt-particle-float:nth-child(16) { left: 60%; animation-delay: 11s; animation-duration: 13s; }
.kt-particle-float:nth-child(17) { left: 70%; animation-delay: 12s; animation-duration: 14s; }
.kt-particle-float:nth-child(18) { left: 80%; animation-delay: 13s; animation-duration: 15s; }
.kt-particle-float:nth-child(19) { left: 90%; animation-delay: 14s; animation-duration: 16s; }
.kt-particle-float:nth-child(20) { left: 100%; animation-delay: 15s; animation-duration: 14s; }

/* 响应式设计 */
@media (max-width: 768px) {
    .kt-loader-center-wrapper {
        gap: 30px;
    }

    .kt-loader-main {
        width: 150px;
        height: 150px;
    }

    .kt-orbit-container {
        width: 250px;
        height: 250px;
    }

    .kt-cube-loader {
        width: 60px;
        height: 60px;
    }

    .kt-cube-face {
        width: 60px;
        height: 60px;
    }

    .kt-cube-face:nth-child(1) { transform: translateZ(30px); }
    .kt-cube-face:nth-child(2) { transform: rotateY(90deg) translateZ(30px); }
    .kt-cube-face:nth-child(3) { transform: rotateY(180deg) translateZ(30px); }
    .kt-cube-face:nth-child(4) { transform: rotateY(-90deg) translateZ(30px); }
    .kt-cube-face:nth-child(5) { transform: rotateX(90deg) translateZ(30px); }
    .kt-cube-face:nth-child(6) { transform: rotateX(-90deg) translateZ(30px); }

    .kt-title-zh {
        font-size: 32px;
        letter-spacing: 4px;
    }

    .kt-progress-container {
        width: 300px;
    }

    .kt-dna-loader {
        width: 80px;
        height: 160px;
    }

    .kt-dna-connector {
        width: 80px;
    }
}