/**
 * 启动遮罩（CDN 测线 / 正在加载资源）— 须在 Angular 与全局 styles 之前加载
 */
html {
    min-height: 100%;
    min-height: -webkit-fill-available;
}

body {
    min-height: 100%;
    min-height: -webkit-fill-available;
}

/* 不在遮罩期间隐藏 app-root，让 Angular 在遮罩下层先渲染，收起时无白屏空窗 */

html.boot-splash-active:not(.dark),
body.boot-splash-active:not(.dark) {
    background: #ffffff !important;
}

html.boot-splash-active.dark,
body.boot-splash-active.dark {
    background: #1f1f1f !important;
}

body.boot-splash-active .loading_index {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 2147483646 !important;
    background: #ffffff !important;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

body.dark.boot-splash-active .loading_index {
    background: #1f1f1f !important;
}

body.boot-splash-active .cdn-line-status-slot {
    display: block !important;
}

body.boot-splash-active .cdn-line-status:not(.cdn-line-status--error) {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    color: #888888 !important;
}

body.boot-splash-active .cdn-line-spinner {
    display: block !important;
}

.loading_index {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2147483646;
    background: #ffffff;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-box-pack: center;
    -webkit-box-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    text-align: center;
    pointer-events: auto;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.loading_index-panel {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-box-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 88%;
    max-width: 320px;
    text-align: center;
    padding: 0 0 32px;
    box-sizing: border-box;
}

.loading_index.loading_index--hiding {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.loading_index-inner {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-box-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    color: #888888;
    margin-top: 28px;
}

.loading_index--busy #cdn-line-status,
.loading_index--busy .cdn-line-status:not(.cdn-line-status--error) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #888888 !important;
}

.loading_index-brand {
    text-align: center;
}

.loading_index-logo {
    width: 72px;
    height: 72px;
    margin: 0 0 12px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid #6a6a6a;
}

.loading_index-title {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--theme-color, #0fa248);
    letter-spacing: 0.02em;
}

.loading_index-domain {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--theme-color, #0fa248);
    letter-spacing: 0.12em;
}

.cdn-line-spinner {
    display: block;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin: 4px auto 10px;
    border: 2px solid #cccccc;
    border-top-color: #0fa248;
    border-radius: 50%;
    animation: cdn-line-spin 0.75s linear infinite;
}

/* 用 visibility 占位，避免错误态去掉 spinner 时整列上下跳动 */
.loading_index.loading_index--error .cdn-line-spinner {
    visibility: hidden;
    animation: none;
}

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

.loading_index--busy .cdn-line-status-slot {
    display: block;
    max-width: calc(100vw - 48px);
    text-align: center;
}

.cdn-line-status-slot {
    display: none;
    flex-shrink: 0;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 21px;
    min-height: 21px;
    text-align: center;
}

.cdn-line-status:not(.cdn-line-status--error) {
    display: block;
    margin: 0;
    padding: 0;
    line-height: 21px;
    text-align: center;
    font-size: inherit;
    color: #888888 !important;
    white-space: nowrap;
}

.cdn-line-status.cdn-line-status--error {
    display: block;
    margin: 0;
    padding: 0 8px;
    text-align: center;
    font-size: inherit;
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
    color: #ff4444 !important;
}

.cdn-boot-retry {
    display: none;
    margin-top: 16px;
    padding: 10px 28px;
    font-size: 15px;
    line-height: 1.2;
    color: #ffffff;
    background: var(--theme-color, #0fa248);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.loading_index--error .cdn-boot-retry {
    display: inline-block;
}
