/* 苹果风格提示框系统 */

/* Toast 通知 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    transform: translateX(450px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(450px);
    opacity: 0;
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.toast-content {
    flex: 1;
    color: #1d1d1f;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.toast-close {
    width: 20px;
    height: 20px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #86868b;
    font-size: 14px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1d1d1f;
}

/* Toast 类型 */
.toast.success {
    border-left: 3px solid #34c759;
}

.toast.success .toast-icon {
    color: #34c759;
}

.toast.error {
    border-left: 3px solid #ff3b30;
}

.toast.error .toast-icon {
    color: #ff3b30;
}

.toast.warning {
    border-left: 3px solid #ff9500;
}

.toast.warning .toast-icon {
    color: #ff9500;
}

.toast.info {
    border-left: 3px solid #007aff;
}

.toast.info .toast-icon {
    color: #007aff;
}

/* Modal 对话框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-dialog {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show .modal-dialog {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    padding: 24px 24px 16px;
    text-align: center;
}

.modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.modal-icon.success {
    background: linear-gradient(135deg, #34c759, #30d158);
    color: white;
}

.modal-icon.error {
    background: linear-gradient(135deg, #ff3b30, #ff453a);
    color: white;
}

.modal-icon.warning {
    background: linear-gradient(135deg, #ff9500, #ff9f0a);
    color: white;
}

.modal-icon.info {
    background: linear-gradient(135deg, #007aff, #0051d5);
    color: white;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.modal-body {
    padding: 0 24px 24px;
    text-align: center;
}

.modal-message {
    font-size: 14px;
    color: #86868b;
    line-height: 1.6;
}

.modal-footer {
    padding: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
}

.modal-btn {
    flex: 1;
    padding: 16px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #007aff;
}

.modal-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

.modal-btn:active {
    background: rgba(0, 0, 0, 0.08);
}

.modal-btn.primary {
    color: #007aff;
}

.modal-btn.danger {
    color: #ff3b30;
}

.modal-btn.secondary {
    color: #86868b;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.loading-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.loading-spinner {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 122, 255, 0.2);
    border-top-color: #007aff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    color: #1d1d1f;
    font-weight: 500;
}

/* 响应式 */
@media (max-width: 480px) {
    .toast-container {
        left: 12px;
        right: 12px;
        top: 12px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
    
    .modal-dialog {
        max-width: none;
        margin: 0 16px;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .toast {
        background: rgba(44, 44, 46, 0.95);
    }
    
    .toast-content {
        color: #f5f5f7;
    }
    
    .toast-close {
        background: rgba(255, 255, 255, 0.1);
        color: #98989d;
    }
    
    .toast-close:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #f5f5f7;
    }
    
    .modal-dialog {
        background: rgba(44, 44, 46, 0.98);
    }
    
    .modal-title {
        color: #f5f5f7;
    }
    
    .modal-message {
        color: #98989d;
    }
    
    .modal-footer {
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    
    .modal-btn.secondary {
        border-right-color: rgba(255, 255, 255, 0.1);
    }
    
    .loading-spinner {
        background: rgba(44, 44, 46, 0.95);
    }
    
    .loading-text {
        color: #f5f5f7;
    }
}
