html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
}

#app-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #f8f9fa 0%, #f0f2f5 100%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

#app-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 30% 70%, rgba(17, 155, 125, 0.05) 0%, transparent 70%),
        radial-gradient(circle at 70% 30%, rgba(26, 115, 232, 0.05) 0%, transparent 70%),
        radial-gradient(circle at 50% 50%, rgba(22, 163, 74, 0.03) 0%, transparent 60%);
    background-size: 100% 100%;
    animation: backgroundFlow 15s ease-in-out infinite alternate;
}

@keyframes backgroundFlow {
    0% { background-position: 0% 0%; }
    33% { background-position: 10% 5%; }
    66% { background-position: -5% 10%; }
    100% { background-position: 0% 0%; }
}

.app-loading-container {
    position: relative;
    text-align: center;
    z-index: 2;
    color: #2d3748;
    width: 100%;
    max-width: 420px;
    padding: 0 24px;
}

.app-loading-header {
    margin-bottom: 40px;
    position: relative;
}

.app-loading-title {
    font-size: 34px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.2px;
    background: linear-gradient(90deg, #119b7d, #1a73e8, #16a34a, #119b7d);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 1px 3px rgba(17, 155, 125, 0.1);
    animation: titleGradient 6s ease-in-out infinite, titlePulse 3s ease-in-out infinite;
}

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

@keyframes titlePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.95; transform: scale(1.01); }
}

.app-loading-subtitle {
    font-size: 15px;
    color: rgba(17, 155, 125, 0.6);
    font-weight: 400;
    letter-spacing: 0.1px;
    animation: subtitleFade 4s ease-in-out infinite, subtitleColor 6s ease-in-out infinite;
}

@keyframes subtitleColor {
    0% { color: rgba(17, 155, 125, 0.6); }
    33% { color: rgba(26, 115, 232, 0.6); }
    66% { color: rgba(22, 163, 74, 0.6); }
    100% { color: rgba(17, 155, 125, 0.6); }
}

@keyframes subtitleFade {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.app-loading-main {
    margin-bottom: 36px;
    position: relative;
}

.app-loading-ring {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 28px;
    animation: ringContainerScale 4s ease-in-out infinite alternate;
}

@keyframes ringContainerScale {
    0% { transform: scale(1); }
    100% { transform: scale(1.03); }
}

.ring-outer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(17, 155, 125, 0.1);
    border-top: 2px solid #119b7d;
    border-radius: 50%;
    animation: ringRotate 2.2s linear infinite, ringGlow 3s ease-in-out infinite, ringColorOuter 6s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(17, 155, 125, 0.05);
}

.ring-middle {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 74px;
    height: 74px;
    border: 1px solid rgba(26, 115, 232, 0.1);
    border-right: 1px solid #1a73e8;
    border-radius: 50%;
    animation: ringRotate 1.8s linear infinite reverse, ringGlow 3s ease-in-out infinite 0.5s, ringColorMiddle 6s ease-in-out infinite;
}

.ring-inner {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 62px;
    height: 62px;
    border: 1px solid rgba(22, 163, 74, 0.1);
    border-bottom: 1px solid #16a34a;
    border-radius: 50%;
    animation: ringRotate 1.5s linear infinite, ringGlow 3s ease-in-out infinite 1s, ringColorInner 6s ease-in-out infinite;
}

@keyframes ringRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes ringGlow {
    0%, 100% { box-shadow: 0 0 15px rgba(0, 0, 0, 0.05); }
    50% { box-shadow: 0 0 25px var(--glow-color, rgba(17, 155, 125, 0.15)); }
}

@keyframes ringColorOuter {
    0% { border-top-color: #119b7d; --glow-color: rgba(17, 155, 125, 0.15); }
    50% { border-top-color: #1a73e8; --glow-color: rgba(26, 115, 232, 0.15); }
    100% { border-top-color: #119b7d; --glow-color: rgba(17, 155, 125, 0.15); }
}

@keyframes ringColorMiddle {
    0% { border-right-color: #1a73e8; --glow-color: rgba(26, 115, 232, 0.15); }
    50% { border-right-color: #16a34a; --glow-color: rgba(22, 163, 74, 0.15); }
    100% { border-right-color: #1a73e8; --glow-color: rgba(26, 115, 232, 0.15); }
}

@keyframes ringColorInner {
    0% { border-bottom-color: #16a34a; --glow-color: rgba(22, 163, 74, 0.15); }
    50% { border-bottom-color: #119b7d; --glow-color: rgba(17, 155, 125, 0.15); }
    100% { border-bottom-color: #16a34a; --glow-color: rgba(22, 163, 74, 0.15); }
}

.ring-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #119b7d, #1a73e8);
    background-size: 200% auto;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: centerPulse 2s ease-in-out infinite, centerColor 6s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(17, 155, 125, 0.2);
}

.ring-center::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(17, 155, 125, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: centerRipple 2s ease-out infinite, centerRippleColor 6s ease-in-out infinite;
}

@keyframes centerColor {
    0% { background-position: 0% 50%; box-shadow: 0 0 12px rgba(17, 155, 125, 0.2); }
    33% { background-position: 50% 50%; box-shadow: 0 0 12px rgba(26, 115, 232, 0.2); }
    66% { background-position: 100% 50%; box-shadow: 0 0 12px rgba(22, 163, 74, 0.2); }
    100% { background-position: 0% 50%; box-shadow: 0 0 12px rgba(17, 155, 125, 0.2); }
}

@keyframes centerPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

@keyframes centerRipple {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

@keyframes centerRippleColor {
    0% { background: rgba(17, 155, 125, 0.3); }
    33% { background: rgba(26, 115, 232, 0.3); }
    66% { background: rgba(22, 163, 74, 0.3); }
    100% { background: rgba(17, 155, 125, 0.3); }
}

.app-loading-info { width: 100%; position: relative; }

.app-loading-progress-container {
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg,
        rgba(17, 155, 125, 0.06),
        rgba(26, 115, 232, 0.06),
        rgba(22, 163, 74, 0.06)
    );
    background-size: 200% auto;
    border-radius: 1.5px;
    margin: 0 auto 16px;
    overflow: hidden;
    backdrop-filter: blur(2px);
    position: relative;
    animation: progressBgColor 6s ease-in-out infinite;
}

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

.app-loading-progress-container::after {
    content: '';
    position: absolute;
    top: 0;
    height: 100%;
    width: 12px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: progressLight 1.5s ease-in-out infinite, progressLightColor 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes progressLight {
    0% { left: -20px; }
    100% { left: calc(100% + 20px); }
}

@keyframes progressLightColor {
    0% { box-shadow: 0 0 8px rgba(17, 155, 125, 0.5); }
    33% { box-shadow: 0 0 8px rgba(26, 115, 232, 0.5); }
    66% { box-shadow: 0 0 8px rgba(22, 163, 74, 0.5); }
    100% { box-shadow: 0 0 8px rgba(17, 155, 125, 0.5); }
}

.app-loading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #119b7d, #1a73e8, #16a34a);
    background-size: 200% auto;
    border-radius: 1.5px;
    transition: width 0.3s ease;
    animation: progressBarGlow 3s ease-in-out infinite, progressBarColor 6s ease-in-out infinite;
}

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

@keyframes progressBarGlow {
    0%, 100% { box-shadow: 0 0 0 rgba(17, 155, 125, 0.2); }
    50% { box-shadow: 0 0 8px var(--bar-glow-color, rgba(17, 155, 125, 0.3)); }
}

.app-loading-percentage {
    font-size: 16px;
    font-weight: 500;
    color: #119b7d;
    margin-bottom: 6px;
    letter-spacing: 0.1px;
    animation: percentagePulse 3s ease-in-out infinite, percentageColor 6s ease-in-out infinite;
}

@keyframes percentageColor {
    0% { color: #119b7d; }
    33% { color: #1a73e8; }
    66% { color: #16a34a; }
    100% { color: #119b7d; }
}

@keyframes percentagePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

.app-loading-status {
    font-size: 14px;
    color: rgba(17, 155, 125, 0.7);
    font-weight: 400;
    letter-spacing: 0.1px;
    transition: opacity 0.3s ease, color 0.5s ease;
    animation: statusColor 6s ease-in-out infinite;
}

@keyframes statusColor {
    0% { color: rgba(17, 155, 125, 0.7); }
    33% { color: rgba(26, 115, 232, 0.7); }
    66% { color: rgba(22, 163, 74, 0.7); }
    100% { color: rgba(17, 155, 125, 0.7); }
}

.fade-out { opacity: 0 !important; transform: scale(0.99) !important; }

@media (max-width: 768px) {
    .app-loading-title { font-size: 30px; }
    .app-loading-ring { width: 80px; height: 80px; }
    .ring-middle { top: 6px; left: 6px; width: 68px; height: 68px; }
    .ring-inner { top: 12px; left: 12px; width: 56px; height: 56px; }
}

@media (max-width: 480px) {
    .app-loading-title { font-size: 26px; }
    .app-loading-ring { width: 70px; height: 70px; }
    .ring-middle { top: 5px; left: 5px; width: 60px; height: 60px; }
    .ring-inner { top: 10px; left: 10px; width: 50px; height: 50px; }
}
