html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    overflow: hidden;
}

#app-loading {
    position: fixed;
    inset: 0;
    background: #0a0e1a;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, transform 0.8s ease;
    overflow: hidden;
}

/* 背景网格 */
#app-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 179, 237, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 179, 237, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridMove 20s linear infinite;
}

/* 光晕背景 */
#app-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 20% 50%, rgba(56, 189, 248, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 80% 50%, rgba(139, 92, 246, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 50% 80%, rgba(34, 211, 238, 0.04) 0%, transparent 60%);
    animation: glowPulse 8s ease-in-out infinite alternate;
}

@keyframes gridMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(40px); }
}

@keyframes glowPulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* 流星粒子 */
.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(99, 179, 237, 0.6);
    border-radius: 50%;
    animation: particleFloat linear infinite;
}

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

/* 主容器 */
.app-loading-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 480px;
    padding: 0 32px;
    box-sizing: border-box;
}

/* Logo区域 */
.app-loading-logo {
    margin-bottom: 48px;
    text-align: center;
}

.logo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    position: relative;
}

.logo-icon-inner {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.3), 0 0 60px rgba(56, 189, 248, 0.1);
    animation: logoGlow 3s ease-in-out infinite alternate;
    position: relative;
    overflow: hidden;
}

.logo-icon-inner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: logoShine 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0% { box-shadow: 0 0 20px rgba(56, 189, 248, 0.3), 0 0 40px rgba(56, 189, 248, 0.1); }
    100% { box-shadow: 0 0 40px rgba(56, 189, 248, 0.5), 0 0 80px rgba(56, 189, 248, 0.2); }
}

@keyframes logoShine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    50%, 100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.app-loading-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #38bdf8, #818cf8, #34d399, #38bdf8);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleFlow 4s linear infinite;
    margin: 0 0 8px;
}

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

.app-loading-subtitle {
    font-size: 13px;
    color: rgba(148, 163, 184, 0.6);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0;
}

/* 核心动画区域 */
.app-loading-visual {
    margin-bottom: 48px;
    position: relative;
    width: 120px;
    height: 120px;
}

/* 外圈扫描线 */
.scan-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(56, 189, 248, 0.15);
    animation: scanRotate 3s linear infinite;
}

.scan-ring::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    width: 4px;
    height: 4px;
    background: #38bdf8;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 8px #38bdf8, 0 0 16px rgba(56, 189, 248, 0.5);
}

.scan-ring-2 {
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    border: 1px solid rgba(129, 140, 248, 0.15);
    animation: scanRotate 2s linear infinite reverse;
}

.scan-ring-2::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 4px;
    height: 4px;
    background: #818cf8;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 8px #818cf8, 0 0 16px rgba(129, 140, 248, 0.5);
}

.scan-ring-3 {
    position: absolute;
    inset: 24px;
    border-radius: 50%;
    border: 1px solid rgba(52, 211, 153, 0.15);
    animation: scanRotate 1.5s linear infinite;
}

.scan-ring-3::before {
    content: '';
    position: absolute;
    top: -2px;
    right: 10px;
    width: 3px;
    height: 3px;
    background: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 6px #34d399;
}

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

/* 中心核心 */
.core-center {
    position: absolute;
    inset: 36px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, rgba(56, 189, 248, 0.05) 50%, transparent 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: corePulse 2s ease-in-out infinite;
}

.core-dot {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.8), 0 0 24px rgba(56, 189, 248, 0.4);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes corePulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 12px rgba(56, 189, 248, 0.8), 0 0 24px rgba(56, 189, 248, 0.4); }
    50% { transform: scale(1.3); box-shadow: 0 0 20px rgba(56, 189, 248, 1), 0 0 40px rgba(56, 189, 248, 0.6); }
}

/* 进度区域 */
.app-loading-info {
    width: 100%;
}

/* 进度条 */
.progress-track {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.progress-track::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.1), transparent);
    animation: trackShimmer 2s ease-in-out infinite;
}

@keyframes trackShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.app-loading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #38bdf8, #818cf8, #34d399);
    background-size: 200% auto;
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: barFlow 2s linear infinite;
    position: relative;
}

.app-loading-progress-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(56, 189, 248, 1), 0 0 16px rgba(56, 189, 248, 0.6);
}

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

/* 底部信息 */
.progress-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-loading-status {
    font-size: 12px;
    color: rgba(148, 163, 184, 0.6);
    letter-spacing: 0.5px;
    transition: opacity 0.3s ease;
    flex: 1;
}

.app-loading-percentage {
    font-size: 13px;
    font-weight: 600;
    color: #38bdf8;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    min-width: 40px;
    text-align: right;
}

/* 底部装饰点 */
.loading-dots {
    display: flex;
    gap: 6px;
    margin-top: 32px;
    justify-content: center;
}

.loading-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.4);
    animation: dotBlink 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(2) { animation-delay: 0.2s; background: rgba(129, 140, 248, 0.4); }
.loading-dot:nth-child(3) { animation-delay: 0.4s; background: rgba(52, 211, 153, 0.4); }

@keyframes dotBlink {
    0%, 80%, 100% { transform: scale(1); opacity: 0.4; }
    40% { transform: scale(1.4); opacity: 1; }
}

/* 淡出动画 */
.fade-out {
    opacity: 0 !important;
    transform: scale(1.02) !important;
}

/* 响应式 */
@media (max-width: 480px) {
    .app-loading-container { padding: 0 24px; }
    .logo-icon { width: 52px; height: 52px; }
    .logo-icon-inner { font-size: 22px; border-radius: 14px; }
    .app-loading-title { font-size: 22px; letter-spacing: 1px; }
    .app-loading-visual { width: 100px; height: 100px; }
    .scan-ring-2 { inset: 10px; }
    .scan-ring-3 { inset: 20px; }
    .core-center { inset: 30px; }
    .app-loading-logo { margin-bottom: 36px; }
    .app-loading-visual { margin-bottom: 36px; }
}

@media (min-width: 1024px) {
    .app-loading-container { max-width: 520px; }
    .logo-icon { width: 72px; height: 72px; }
    .logo-icon-inner { font-size: 32px; border-radius: 20px; }
    .app-loading-title { font-size: 32px; }
    .app-loading-visual { width: 140px; height: 140px; }
    .scan-ring-2 { inset: 14px; }
    .scan-ring-3 { inset: 28px; }
    .core-center { inset: 42px; }
}
