/* 全局模态框样式 */
.global-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.global-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.global-modal {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.7) translateY(20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.global-modal-overlay.show .global-modal {
    transform: scale(1) translateY(0);
}

.global-modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.global-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #212121;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.global-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.global-modal-close:hover {
    background: #f5f5f5;
    color: #666;
}

.global-modal-body {
    padding: 20px 24px;
    color: #333;
    line-height: 1.6;
    max-height: 60vh;
    overflow-y: auto;
}

.global-modal-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.global-modal-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.global-modal-btn-primary {
    background: #00a1d6;
    color: white;
}

.global-modal-btn-primary:hover {
    background: #0085b3;
    transform: translateY(-1px);
}

.global-modal-btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.global-modal-btn-secondary:hover {
    background: #e8e8e8;
}

.global-modal-btn-danger {
    background: #ff4757;
    color: white;
}

.global-modal-btn-danger:hover {
    background: #ff3838;
    transform: translateY(-1px);
}

/* 图标样式 */
.global-modal-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.global-modal-icon.success {
    color: #52c41a;
}

.global-modal-icon.error {
    color: #ff4757;
}

.global-modal-icon.warning {
    color: #faad14;
}

.global-modal-icon.info {
    color: #1890ff;
}

/* 确认对话框样式 */
.global-modal.confirm .global-modal-body {
    padding: 24px;
    text-align: center;
}

.global-modal.confirm .global-modal-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    font-size: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-modal.confirm .global-modal-icon.success {
    background: #f6ffed;
    color: #52c41a;
}

.global-modal.confirm .global-modal-icon.error {
    background: #fff2f0;
    color: #ff4757;
}

.global-modal.confirm .global-modal-icon.warning {
    background: #fffbe6;
    color: #faad14;
}

.global-modal.confirm .global-modal-icon.info {
    background: #e6f7ff;
    color: #1890ff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .global-modal {
        width: 95%;
        margin: 20px;
    }
    
    .global-modal-header,
    .global-modal-body,
    .global-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .global-modal-footer {
        flex-direction: column-reverse;
    }
    
    .global-modal-btn {
        width: 100%;
        margin: 0;
    }
}

/* 加载动画 */
.global-modal-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #00a1d6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast 样式 */
.global-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.global-toast.show {
    transform: translateX(0);
}

.global-toast.success {
    border-left: 4px solid #52c41a;
}

.global-toast.error {
    border-left: 4px solid #ff4757;
}

.global-toast.warning {
    border-left: 4px solid #faad14;
}

.global-toast.info {
    border-left: 4px solid #1890ff;
}

.global-toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.global-toast-content {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.global-toast-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.global-toast-close:hover {
    background: #f5f5f5;
    color: #666;
}

/* 多个 Toast 堆叠 */
.global-toast:nth-child(2) { top: 80px; }
.global-toast:nth-child(3) { top: 140px; }
.global-toast:nth-child(4) { top: 200px; }
