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

#app-loading {
    position: fixed;
    inset: 0;
    background: #ffffff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
}

#app-loading.fade-out {
    opacity: 0;
}

/* 全屏动态背景容器 */
.app-loading-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

/* 弥散渐变网格背景 */
.bg-gradient-mesh {
    position: absolute;
    inset: 0;
    background-color: #ffffff;
    background-image: 
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(129, 140, 248, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(79, 70, 229, 0.05) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(129, 140, 248, 0.05) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(240, 249, 255, 1) 0px, transparent 80%);
    filter: blur(40px);
    animation: meshPulse 15s ease-in-out infinite alternate;
}

@keyframes meshPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* 科技感细微网格叠加层 */
.bg-grid-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(79, 70, 229, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 70, 229, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle at center, black, transparent 80%);
}

#bg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.6;
}

/* 内容容器 */
.app-loading-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
    padding: 20px;
    box-sizing: border-box;
}

.app-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo 样式 */
.app-loading-logo {
    text-align: center;
    margin-bottom: 60px;
}

.logo-box {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}

.logo-svg {
    width: 100%;
    height: 100%;
}

.path-outer {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawPath 2.5s ease-out forwards;
}

.path-inner {
    opacity: 0;
    transform: scale(0.8);
    transform-origin: center;
    animation: fadeInScale 1s ease-out 1.2s forwards;
}

@keyframes drawPath {
    to { stroke-dashoffset: 0; }
}

@keyframes fadeInScale {
    to { opacity: 1; transform: scale(1); }
}

.app-loading-title {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(90deg, #4f46e5, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 4px;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.app-loading-brand {
    font-size: 12px;
    color: #64748b;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
}

/* 视觉动画区 */
.app-loading-visual {
    margin-bottom: 60px;
}

.loading-ring {
    width: 48px;
    height: 48px;
    border: 3px solid #f1f5f9;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ring-core {
    width: 8px;
    height: 8px;
    background: #4f46e5;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.5); opacity: 1; }
}

/* 进度反馈区 */
.app-loading-footer {
    width: 100%;
}

.progress-container {
    width: 100%;
    height: 18px;
    background: #f1f5f9;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #818cf8);
    border-radius: 20px;
    transition: width 0.4s cubic-bezier(0.1, 0.5, 0.5, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    box-sizing: border-box;
}

.percentage-text {
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: 0.9;
}

/* 响应式适配 */
@media (max-width: 640px) {
    .app-loading-wrapper {
        max-width: 320px;
    }
    .app-loading-title {
        font-size: 20px;
    }
}
