/* ===== 统一弹窗组件 Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.modal-box {
    width: 100%;
    max-width: 520px;
    /* 设置最小高度让宽高比接近黄金分割比例 1.618:1
       520 / 1.618 ≈ 321，内容不足时也能维持比例协调的形状
       内容超出时自然撑高，不会受限 */
    min-height: 322px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    /* flex 布局让 body 撑满剩余空间，footer 固定底部，
       避免短内容时底部留白 */
    display: flex;
    flex-direction: column;
    transform: translateY(16px) scale(0.96);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.28s ease;
}

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

/* 主体 */
.modal-body {
    padding: 28px 28px 8px;
    text-align: center; /* 图标和标题居中 */
    flex: 1 1 auto; /* 占据剩余空间，让 footer 贴底 */
    display: flex;
    flex-direction: column;
    justify-content: center; /* 内容垂直居中，短内容时上下留白均衡 */
}

/* 提示内容左对齐，便于阅读较长文案 */
.modal-message {
    text-align: left;
}

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    line-height: 1;
}

.modal-icon.icon-info {
    background: rgba(43, 95, 215, 0.10);
    color: #2B5FD7;
}

.modal-icon.icon-success {
    background: rgba(34, 197, 94, 0.12);
    color: #22C55E;
}

.modal-icon.icon-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #F59E0B;
}

.modal-icon.icon-error {
    background: rgba(239, 68, 68, 0.10);
    color: #EF4444;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}

.modal-message {
    font-size: 14px;
    color: #475569;
    line-height: 1.7;
    word-break: break-word;
}

/* 高亮金额：红色加粗 */
.modal-message .modal-highlight-price {
    color: #ef4444;
    font-weight: 700;
    font-size: 18px;
    padding: 0 2px;
}

/* 高亮次数：主色调加粗 */
.modal-message .modal-highlight-times {
    color: #2563eb;
    font-weight: 700;
    font-size: 18px;
    padding: 0 2px;
}

/* 副提示文字：浅灰小字 */
.modal-message .modal-hint {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.6;
}

/* 按钮区 */
.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 28px 28px;
}

.modal-footer .modal-btn {
    flex: 1;
    padding: 11px 16px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.2s ease;
    outline: none;
}

.modal-footer .modal-btn.btn-cancel {
    background: #F8FAFC;
    color: #475569;
    border-color: #E2E8F0;
}

.modal-footer .modal-btn.btn-cancel:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

.modal-footer .modal-btn.btn-confirm {
    background: linear-gradient(135deg, #2B5FD7, #7C3AED);
    color: #fff;
    box-shadow: 0 4px 16px rgba(43, 95, 215, 0.30);
}

.modal-footer .modal-btn.btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(43, 95, 215, 0.40);
}

.modal-footer .modal-btn.btn-confirm:active,
.modal-footer .modal-btn.btn-cancel:active {
    transform: translateY(0);
}

/* 单按钮时固定宽度并居右对齐 */
.modal-footer.single {
    justify-content: flex-end;
}

.modal-footer.single .modal-btn {
    flex: 0 0 120px;
    width: 120px;
}

/* 响应式 */
@media (max-width: 480px) {
    .modal-body {
        padding: 24px 20px 6px;
    }

    .modal-footer {
        padding: 16px 20px 24px;
    }
}
