/* ============================================================
   ToastMessage 公共提示组件样式
   配套脚本：/assets/js/toastMessage.js
   包含：Toast 消息提示 + 全局 Loading 遮罩
   （容器由脚本自动创建，页面无需手写 HTML）
   ============================================================ */

/* ========== 全局 Loading 遮罩 ========== */
.global-loading-overlay {
    display: none;
    position: fixed;
    top: var(--toast-loading-top, 4.375vw);
    left: 0;
    width: 100vw;
    height: calc(100vh - var(--toast-loading-top, 4.375vw));
    background: rgba(255, 255, 255, 0.85);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.global-loading-overlay--visible {
    display: flex;
}

.global-loading-spinner {
    width: 2.0833vw;
    height: 2.0833vw;
    border: 0.1563vw solid rgba(58, 102, 251, 0.15);
    border-top-color: #3A66FB;
    border-radius: 50%;
    animation: toast-global-spinner-rotate 0.7s linear infinite;
}

@keyframes toast-global-spinner-rotate {
    to { transform: rotate(360deg); }
}

/* ========== Toast 消息提示 ========== */
.toast-container {
    position: fixed;
    top: var(--toast-container-top, 6.25vw);
    left: 0;
    right: 0;
    z-index: 10560;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5208vw;
    pointer-events: none;
}

.msg-toast {
    display: flex;
    align-items: center;
    margin: 0 auto;
    min-width: 18.75vw;
    max-width: 26.0417vw;
    padding: 0.8333vw 1.0417vw;
    border-radius: 0.4167vw;
    border: none;
    box-shadow: 0 0.2083vw 0.625vw rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5208vw);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    pointer-events: auto;
    box-sizing: border-box;
}

.msg-toast.msg-toast--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.msg-toast--success {
    background: #E8F5E9;
    border-left: 0.2083vw solid #2E7D32;
}

.msg-toast--error {
    background: #FFEBEE;
    border-left: 0.2083vw solid #C62828;
}

.msg-toast__icon {
    font-size: 1.0417vw;
    margin-right: 0.5208vw;
    flex-shrink: 0;
}

.msg-toast__icon .iconfont {
    font-size: 1.0417vw;
}

.msg-toast--success .msg-toast__icon {
    color: #2E7D32;
}

.msg-toast--error .msg-toast__icon {
    color: #C62828;
}

.msg-toast__body {
    flex: 1;
    color: #231815;
    font-family: 'Montserrat';
    font-size: 0.7292vw;
    font-weight: 400;
    line-height: 150%;
}

/* ========== 移动端 ========== */
@media (max-width: 768px) {
    .global-loading-overlay {
        top: var(--toast-loading-top-mobile, 12.8vw);
        height: calc(100vh - var(--toast-loading-top-mobile, 12.8vw));
    }

    .global-loading-spinner {
        width: 8vw;
        height: 8vw;
        border-width: 0.8vw;
    }

    .toast-container {
        top: var(--toast-container-top-mobile, 32vw);
        gap: 2.6667vw;
    }

    .msg-toast {
        min-width: 80vw;
        max-width: 85.3333vw;
        padding: 2.1333vw 4.2667vw;
        border-radius: 2.1333vw;
        box-shadow: 0 1.0667vw 3.2vw rgba(0, 0, 0, 0.12);
        transform: translateY(-2.6667vw);
    }

    .msg-toast.msg-toast--visible {
        transform: translateY(0);
    }

    .msg-toast--success {
        border-left-width: 1.0667vw;
    }

    .msg-toast--error {
        border-left-width: 1.0667vw;
    }

    .msg-toast__icon {
        font-size: 5.3333vw;
        margin-right: 2.6667vw;
    }

    .msg-toast__icon .iconfont {
        font-size: 5.3333vw;
    }

    .msg-toast__body {
        font-size: 3.7333vw;
    }
}
