/* 全局样式重置 - 确保没有溢出和分割问题 */
html,
body,
#root,
#app,
.app-container {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 100% !important;
    height: 100% !important;
    overflow-x: hidden !important;
    position: relative !important;
    box-sizing: border-box !important;
}

/* 基本加载容器样式 */
#app-loading {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%) !important;
    z-index: 9999 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: opacity 0.4s ease !important;
    opacity: 1 !important;
    transform: none !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* 装饰背景伪元素使用classes代替 - 兼容decoration-effects.css */
#app-loading::before,
#app-loading::after {
    display: none;
}

/* 加载屏幕隐藏时的效果 */
#app-loading.hidden {
    opacity: 0 !important;
    transform: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
    z-index: -1 !important;
    transition: opacity 0.4s ease, visibility 0.4s ease, z-index 0s 0.5s !important;
}

/* 确保加载页面在登录页面显示时不可见 */
body.login-page #app-loading,
body.app-ready #app-loading {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    z-index: -9999 !important;
    pointer-events: none !important;
    transform: none !important;
}

/* 深色模式 */
#app-loading.dark-theme {
    background: linear-gradient(135deg, #1a1f25 0%, #272c35 100%) !important;
    color: #e0e0e0 !important;
}

/* 移动端特定样式 */
#app-loading.mobile {
    padding: 0 !important;
}

/* 内容容器 */
.brand-container {
    padding: 2rem;
    z-index: 2;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
    text-align: center;
    animation: fadeInDown 1s ease-out forwards;
    opacity: 0;
    transform: translateY(-20px);
    position: relative;
}

.dark-theme .brand-container {
    background: transparent;
}

/* Logo容器样式 */
.logo-container {
    width: 320px;
    height: auto;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    width: 260px;
    height: auto;
    object-fit: contain;
}

/* 暗色模式下的LOGO处理 */
.dark-theme .logo {
    filter: invert(1) brightness(1.25);
    /* 将黑色LOGO转换为白色 */
}

/* 品牌标语样式 */
.brand-slogan {
    font-size: 16px;
    color: #4b5563;
    margin-bottom: 6px;
    font-weight: 400;
    letter-spacing: 0.5px;
    line-height: 1.5rem;
    text-align: center;
}

/* 品牌描述样式 */
.brand-description {
    font-size: 14px;
    color: #374151;
    font-weight: 400;
    letter-spacing: 0.5px;
    line-height: 1.75rem;
    text-align: center;
}

/* 深色模式下文本颜色 */
.dark-theme .brand-slogan {
    color: #d1d5db;
}

.dark-theme .brand-description {
    color: #f3f4f6;
}

/* 移动端特定样式 - 调整Logo和文字尺寸 */
.mobile .logo-container {
    width: 150px;
    height: 60px;
    margin-bottom: 10px;
}

.mobile .brand-slogan {
    font-size: 13px;
    margin-bottom: 4px;
    line-height: 1.4rem;
}

.mobile .brand-description {
    font-size: 15px;
    line-height: 1.6rem;
}

/* 进度条容器 */
.progress-container {
    width: 280px;
    height: 6px;
    background: rgba(240, 240, 240, 0.8);
    border-radius: 3px;
    overflow: hidden;
    margin: 15px 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    opacity: 0;
    animation: fadeIn 0.6s ease-out 0.6s forwards;
    z-index: 2;
}

.dark-theme .progress-container {
    background: rgba(45, 55, 72, 0.6);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4d7cfe, #38f);
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* 第二阶段进度条 */
.progress-container.stage2 {
    margin: 8px 0;
    display: none;
}

.progress-text {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
    font-weight: 500;
    text-align: center;
    display: block;
    opacity: 0;
    animation: fadeIn 0.6s ease-out 0.8s forwards;
    z-index: 2;
}

.dark-theme .progress-text {
    color: #b0b0b0;
}

/* 信息面板 */
.info-panel {
    width: 220px;
    background-color: rgba(255, 255, 255, 0.65);
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    margin-top: 20px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    animation: fadeIn 0.6s ease-out 1s forwards;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 2;
}

.dark-theme .info-panel {
    background-color: rgba(42, 42, 42, 0.65);
    border-color: rgba(255, 255, 255, 0.06);
}

/* 信息面板行 */
.info-panel-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 标签样式 */
.info-label {
    font-size: 12px;
    color: #666;
    font-weight: normal;
    text-align: left;
}

.dark-theme .info-label {
    color: #aaa;
}

/* 值样式 */
.info-value {
    font-size: 12px;
    color: #333;
    font-weight: 500;
    text-align: right;
}

.dark-theme .info-value {
    color: #ddd;
}

/* 进度百分比特殊样式 */
#progress-percentage {
    color: #2b85e4;
    font-weight: 600;
}

.dark-theme #progress-percentage {
    color: #4dabf5;
}

/* 网络状态 */
.network-status {
    color: #666;
    font-size: 12px;
    margin-top: 8px;
    width: 220px;
    padding: 8px 12px;
    opacity: 0;
    animation: fadeIn 0.6s ease-out 1.2s forwards;
    text-align: left;
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 2;
}

.dark-theme .network-status {
    color: #aaa;
    background-color: rgba(42, 42, 42, 0.65);
    border-color: rgba(255, 255, 255, 0.06);
}

.network-status::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #52c41a;
    border-radius: 50%;
    margin-right: 6px;
}

.network-status.slow::before {
    background-color: #faad14;
}

.network-status.very-slow::before {
    background-color: #ff4d4f;
}

/* 动画效果 */
@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .logo-container {
        width: 100px;
        height: 100px;
        margin-bottom: 30px;
    }

    .progress-container,
    .info-panel,
    .network-status {
        width: 85%;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .logo-container {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
    }

    .progress-text {
        font-size: 13px;
    }

    .info-panel {
        padding: 10px;
        gap: 6px;
        width: 200px;
    }

    .info-label,
    .info-value {
        font-size: 11px;
    }

    .network-status {
        width: 200px;
        padding: 6px 10px;
        font-size: 11px;
    }
}