/* 
 * 移动端 Toast 提示样式
 * 轻量级、无依赖、移动端优化
 */

/* Toast 容器 */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999;
    pointer-events: none;
}

/* Toast 主体 */
.toast {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
    min-width: 120px;
    max-width: 280px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    animation: toastFadeIn 0.3s ease;
    pointer-events: auto;
    word-wrap: break-word;
}

/* Loading Toast - 包含 spinner */
.toast.loading {
    padding: 24px;
}

.toast .spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Success Toast - 绿色对勾 */
.toast.success .icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.3s ease;
}

.toast.success .icon::after {
    content: '✓';
    font-size: 32px;
    color: #fff;
    font-weight: bold;
}

/* Error Toast - 红色叉号 */
.toast.error .icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #FF3B30;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.3s ease;
}

.toast.error .icon::after {
    content: '✕';
    font-size: 32px;
    color: #fff;
    font-weight: bold;
}

/* 淡出动画 */
.toast.fade-out {
    animation: toastFadeOut 0.3s ease forwards;
}

/* 动画定义 */
@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes toastFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

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

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* 确认弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    pointer-events: auto;
}

.modal {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease;
    pointer-events: auto;
    position: relative;
    z-index: 99999;
}

/* Loading 图标容器 */
.modal-loading-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

/* Loading 转圈动画 */
.modal-loading-icon .loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007AFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    text-align: center;
}

.modal-content {
    font-size: 15px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 20px;
    text-align: center;
    white-space: pre-line;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.modal-button:active {
    opacity: 0.7;
    transform: scale(0.98);
}

.modal-button.primary {
    background: #007AFF;
    color: #fff;
}

.modal-button.secondary {
    background: #f0f0f0;
    color: #333;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

