/* ==========================================================================
   Yixiang UI / 翊象 UI
   Loading and Progress
   加载与进度条

   Copyright (c) 2026 威海颜翊网络科技有限公司
   Licensed under the MIT License. Commercial use is permitted.
   https://www.weihaiyanyi.com  |  pinenetcn@gmail.com
   ========================================================================== */
.yx-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 1080;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.yx-progress.is-active {
    opacity: 1;
}

.yx-progress-bar {
    width: 0;
    height: 100%;
    background-image: linear-gradient(90deg, var(--yx-brand-primary, #3964fe), #8ab4ff);
    box-shadow: 0 0 8px rgba(var(--yx-brand-primary-rgb, 57, 100, 254), 0.55);
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: width;
}

/* 可选的全屏加载遮罩 */
.yx-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 1070;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(15, 17, 21, 0.28);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.yx-loading-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.yx-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: yx-ajax-spin 0.9s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .yx-progress,
    .yx-progress-bar,
    .yx-loading-overlay {
        transition: none;
    }
    .yx-loading-spinner {
        animation-duration: 2s;
    }
}
