/* ===== 全局通用 Modal — 轻遮罩 + 简约卡片 ===== */

/* 弹窗遮罩：更透；无背景模糊（backdrop 关闭） */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.08);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 弹窗容器：轻边框、大圆角、柔和阴影 */
.modal-box {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 18px;
    padding: 36px 32px 32px;
    max-width: 360px;
    width: min(90%, 380px);
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.06),
        0 20px 40px -12px rgba(15, 23, 42, 0.12);
    text-align: center;
    transform: translateY(12px) scale(0.98);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
    position: relative;
}

.modal-overlay.show .modal-box {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* 关闭：伪元素画「×」，与 demand 页一致、不依赖字体对齐 */
.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    color: #94a3b8;
    cursor: pointer;
    background: transparent;
    border: none;
    border-radius: 10px;
    transition: color 0.2s ease, background 0.2s ease;
    z-index: 10;
}

.modal-close-btn::before,
.modal-close-btn::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 1.5px;
    background: currentColor;
    border-radius: 1px;
}

.modal-close-btn::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.modal-close-btn::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.modal-close-btn:hover {
    color: #475569;
    background: rgba(15, 23, 42, 0.06);
}

/* 图标：去掉粗黑边，成功态为柔和绿色块 */
.modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 600;
    border: none;
}

.modal-icon.success {
    background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%);
    color: #115e59;
    animation: successPulse 0.55s ease;
}

.modal-icon.error {
    background: linear-gradient(145deg, #fef2f2 0%, #fecaca 100%);
    color: #dc2626;
    animation: errorShake 0.55s ease;
}

.modal-icon.warning {
    background: linear-gradient(145deg, #fffbeb 0%, #fde68a 100%);
    color: #b45309;
}

.modal-icon.loading {
    background: #f8fafc;
    color: #64748b;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #64748b;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

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

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.modal-title {
    font-size: 19px;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    line-height: 1.35;
}

.modal-message {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 26px;
    line-height: 1.55;
}

/* 主操作：扁平品牌蓝 */
.modal-btn {
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    display: inline-block;
    margin: 0 auto;
    outline: none;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

.modal-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -6px rgba(37, 99, 235, 0.45);
}

.modal-btn:active {
    transform: translateY(0);
}

@media (max-width: 576px) {
    .modal-box {
        padding: 30px 22px 26px;
    }

    .modal-icon {
        width: 56px;
        height: 56px;
        font-size: 26px;
    }

    .modal-title {
        font-size: 17px;
    }

    .modal-message {
        font-size: 13px;
    }

    .modal-btn {
        padding: 11px 24px;
        font-size: 14px;
        width: 100%;
        max-width: 280px;
    }
}
