/* --------------------------------------------------------------------------
   3.4 Modal - 模态框
   -------------------------------------------------------------------------- */

/* 退出登录等确认模态框 */
.uap-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(28, 25, 23, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

/* 弹窗是浮层：保留一层阴影表示层级，不加内高光，入场不回弹 */
.uap-modal {
    background: var(--uap-surface);
    border-radius: var(--uap-radius-md);
    padding: 32px 28px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: var(--uap-shadow-xl);
    animation: uapModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    font-family: var(--uap-font-family);
}

@keyframes uapModalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.uap-modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--uap-error-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--uap-error);
}

.uap-modal-icon svg {
    width: 28px;
    height: 28px;
}

.uap-modal-title {
    font-size: var(--uap-text-lg);
    font-weight: 600;
    color: var(--uap-text);
    margin: 0 0 8px;
}

.uap-modal-text {
    font-size: var(--uap-text-base);
    color: var(--uap-text-muted);
    margin: 0 0 24px;
    line-height: 1.5;
}

.uap-modal-actions {
    display: flex;
    gap: 12px;
}

.uap-modal-btn {
    flex: 1;
    padding: 11px 20px;
    border-radius: var(--uap-radius-sm);
    font-size: var(--uap-text-base);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    border: 1px solid transparent;
}

.uap-modal-btn-cancel {
    background: var(--uap-surface);
    border-color: var(--uap-border);
    color: var(--uap-text);
}

.uap-modal-btn-cancel:hover {
    background: var(--uap-surface-hover);
    border-color: var(--uap-border-hover);
}

/* 危险操作确认：错误色实色；悬停加深，白字对比度保持 4.5:1 以上 */
.uap-modal-btn-confirm {
    background: var(--uap-error);
    color: #fff;
}

.uap-modal-btn-confirm:hover {
    background: #be123c;
}

body.uap-modal-open {
    overflow: hidden;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .uap-modal {
        padding: 24px;
    }

    .uap-modal-icon {
        width: 52px;
        height: 52px;
    }

    .uap-modal-icon svg {
        width: 36px;
        height: 36px;
    }

    .uap-modal-title {
        font-size: 18px;
    }

    .uap-modal-actions {
        flex-direction: column-reverse;
    }
}

/* 未登录提示 */
.uap-login-required {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    max-width: 400px;
    margin: 40px auto;
}

.uap-login-required-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--uap-primary-bg) 0%, var(--uap-primary-light) 100%);
    border-radius: 50%;
    color: var(--uap-action-bg, #4f46e5);
    margin-bottom: 20px;
}

.uap-login-required-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px;
}

.uap-login-required-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px;
}

.uap-login-required .uap-button {
    min-width: 120px;
}

