/* ========== 自定义弹窗组件 ========== */

/* 遮罩层 */
.custom-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.custom-modal-overlay.show {
    display: flex;
    animation: cmOverlayIn 0.25s ease;
}

/* 弹窗主体 */
.custom-modal {
    background: #fff;
    border-radius: 14px;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: cmSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

/* 顶部彩色条 */
.custom-modal-bar {
    height: 4px;
    background: linear-gradient(90deg, #34c759, #30d158);
    transition: background 0.3s;
}
.custom-modal-bar.error {
    background: linear-gradient(90deg, #ff3b30, #ff453a);
}
.custom-modal-bar.warning {
    background: linear-gradient(90deg, #ff9500, #ff9f0a);
}

/* 内容区域 */
.custom-modal-body {
    padding: 32px 30px 20px;
    text-align: center;
}

/* 图标容器 */
.custom-modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #e8faf0;
    transition: background 0.3s;
}
.custom-modal-icon.error {
    background: #ffeaea;
}
.custom-modal-icon.warning {
    background: #fff4e5;
}

/* SVG 图标 */
.custom-modal-icon svg {
    width: 32px;
    height: 32px;
}

/* 消息文字 */
.custom-modal-msg {
    font-size: 16px;
    color: #1d1d1f;
    line-height: 1.6;
    margin: 0;
    word-break: break-word;
}

/* 按钮区域 */
.custom-modal-footer {
    padding: 0 30px 28px;
    text-align: center;
}
.custom-modal-btn {
    display: inline-block;
    min-width: 120px;
    padding: 10px 32px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #007aff, #0071e3);
    border: none;
    border-radius: 24px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    letter-spacing: 1px;
}
.custom-modal-btn:hover {
    background: linear-gradient(135deg, #0071e3, #005bb5);
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
    transform: translateY(-1px);
}
.custom-modal-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 122, 255, 0.25);
}

/* 关闭动画 */
.custom-modal-overlay.hiding .custom-modal {
    animation: cmSlideOut 0.2s ease forwards;
}
.custom-modal-overlay.hiding {
    animation: cmOverlayOut 0.2s ease forwards;
}

/* 动画 */
@keyframes cmOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes cmOverlayOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes cmSlideIn {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes cmSlideOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to   { opacity: 0; transform: scale(0.85) translateY(20px); }
}
