/* ═══ 页面加载动画 ═══ */

/* ── 全屏遮罩 ── */
#zm-page-loading {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: opacity .45s cubic-bezier(.4,0,.2,1), visibility .45s cubic-bezier(.4,0,.2,1);
}
#zm-page-loading.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ── 加载内容容器 ── */
.zm-loading-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

/* ── 双环旋转器 ── */
.zm-loading-spinner {
    width: 56px;
    height: 56px;
    position: relative;
}
.zm-loading-spinner::before,
.zm-loading-spinner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: zm-spin 1s linear infinite;
}
.zm-loading-spinner::before {
    border-top-color: #7367f0;
    border-bottom-color: #0fc6c2;
}
.zm-loading-spinner::after {
    inset: 6px;
    border-left-color: #ff9f43;
    border-right-color: #ea5455;
    animation-duration: 1.4s;
    animation-direction: reverse;
}

@keyframes zm-spin {
    to { transform: rotate(360deg); }
}

/* ── 弹跳圆点 ── */
.zm-loading-dots {
    display: flex;
    gap: 8px;
}
.zm-loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7367f0, #0fc6c2);
    animation: zm-bounce .6s ease-in-out infinite alternate;
}
.zm-loading-dots span:nth-child(2) {
    background: linear-gradient(135deg, #0fc6c2, #ff9f43);
    animation-delay: .2s;
}
.zm-loading-dots span:nth-child(3) {
    background: linear-gradient(135deg, #ff9f43, #ea5455);
    animation-delay: .4s;
}

@keyframes zm-bounce {
    from { transform: translateY(0); opacity: .4; }
    to   { transform: translateY(-10px); opacity: 1; }
}

/* ── 自定义加载图片 ── */
.zm-loading-image {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
    animation: zm-img-pulse 1.5s ease-in-out infinite;
}
@keyframes zm-img-pulse {
    0%, 100% { transform: scale(1); opacity: .85; }
    50%      { transform: scale(1.06); opacity: 1; }
}

/* ── 加载文字 ── */
.zm-loading-text {
    font-size: 13px;
    color: #999;
    letter-spacing: 3px;
    font-weight: 500;
    text-transform: uppercase;
}

/* ── 顶部进度条 ── */
.zm-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(90deg, #7367f0, #0fc6c2, #ff9f43, #ea5455);
    background-size: 300% 100%;
    animation: zm-progress 2.5s ease-out forwards, zm-bar-glow 1.5s ease-in-out infinite;
    z-index: 1000000;
}
#zm-page-loading.loaded .zm-loading-bar {
    width: 100% !important;
    transition: width .3s ease;
}

@keyframes zm-progress {
    0%   { width: 0; }
    20%  { width: 30%; }
    50%  { width: 60%; }
    70%  { width: 78%; }
    90%  { width: 90%; }
    100% { width: 95%; }
}
@keyframes zm-bar-glow {
    0%, 100% { background-position: 0% 0; }
    50%      { background-position: 100% 0; }
}

/* ── loaded 时内容缩小 ── */
#zm-page-loading.loaded .zm-loading-wrap {
    transform: scale(.85);
    opacity: 0;
    transition: transform .35s ease, opacity .35s ease;
}

/* ═══ 暗色主题 ═══ */
.dark-theme #zm-page-loading {
    background: var(--main-bg-color, #16213e);
}
.dark-theme .zm-loading-text {
    color: #8892a4;
}
