/* 全局消息弹窗样式 */
.global-message-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.global-message-overlay.show {
    opacity: 1;
    visibility: visible;
}

.global-message-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
    border-radius: 20px;
    padding: 25px 35px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    max-width: 450px;
    min-width: 350px;
    text-align: center;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.global-message-overlay.show .global-message-container {
    transform: scale(1) translateY(0);
}

.global-message-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.global-message-container.shimmer::before {
    left: 100%;
}

.global-message-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    position: relative;
    animation: iconPulse 2s infinite;
}

.global-message-icon.success {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
}

.global-message-icon.error {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    box-shadow: 0 10px 30px rgba(220, 53, 69, 0.3);
}

.global-message-icon.warning {
    background: linear-gradient(135deg, #ffc107, #f39c12);
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.3);
}

.global-message-icon.info {
    background: linear-gradient(135deg, #17a2b8, #3498db);
    box-shadow: 0 10px 30px rgba(23, 162, 184, 0.3);
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.global-message-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.3;
}

.global-message-text {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 25px;
    line-height: 1.5;
}

.global-message-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.global-message-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    position: relative;
    overflow: hidden;
}

.global-message-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.global-message-btn:hover::before {
    width: 100px;
    height: 100px;
}

.global-message-btn.primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.global-message-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

.global-message-btn.secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.global-message-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

.global-message-btn.danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.global-message-btn.danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

.global-message-btn.success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.global-message-btn.success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

/* 自动消失的消息提示 */
.global-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    max-width: 400px;
    min-width: 320px;
    z-index: 99999;
    transform: translateX(450px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    backdrop-filter: blur(10px);
}

.global-toast.show {
    transform: translateX(0);
}

.global-toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
    margin-top: 2px;
}

.global-toast-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.global-toast-icon.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.global-toast-icon.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.global-toast-icon.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.global-toast-content {
    flex: 1;
}

.global-toast-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.3;
}

.global-toast-text {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

.global-toast-close {
    background: none;
    border: none;
    font-size: 16px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.global-toast-close:hover {
    background: rgba(156, 163, 175, 0.1);
    color: #6b7280;
}

/* 进度条 */
.global-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 0 0 12px 12px;
    transition: width linear;
}

.global-toast-progress.success {
    background: linear-gradient(90deg, #10b981, #059669);
}

.global-toast-progress.error {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.global-toast-progress.warning {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.global-toast-progress.info {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .global-message-container {
        margin: 20px;
        padding: 20px 24px;
        max-width: calc(100vw - 40px);
        min-width: auto;
        width: 320px;
        border-radius: 16px;
    }

    .global-message-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
        margin-bottom: 14px;
    }

    .global-message-title {
        font-size: 17px;
    }

    .global-message-text {
        font-size: 14px;
        margin-bottom: 18px;
    }

    .global-message-btn {
        padding: 9px 20px;
        font-size: 13px;
    }
    
    .global-toast {
        top: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
        min-width: auto;
        transform: translateY(-120px);
        padding: 14px 16px;
    }

    .global-toast.show {
        transform: translateY(0);
    }

    .global-toast-title {
        font-size: 14px;
    }

    .global-toast-text {
        font-size: 13px;
    }
}

/* 客户模块风格的确认对话框样式 */
.custom-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}

.custom-confirm-dialog {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    overflow: hidden;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.custom-confirm-overlay.show .custom-confirm-dialog {
    transform: scale(1);
}

.custom-confirm-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.custom-confirm-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.custom-confirm-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.custom-confirm-body {
    padding: 25px;
    color: #495057;
    line-height: 1.5;
    font-size: 0.95rem;
}

.custom-confirm-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.custom-confirm-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    min-width: 80px;
}

.custom-confirm-btn-secondary {
    background: #6c757d;
    color: white;
}

.custom-confirm-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.custom-confirm-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.custom-confirm-btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
}

.custom-confirm-btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.custom-confirm-btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-1px);
}

/* 深色模式支持 - 仅适配Toast，模态弹窗保持白色背景 */
@media (prefers-color-scheme: dark) {
    .global-message-container {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
        border-color: rgba(255, 255, 255, 0.3);
    }

    .global-message-title {
        color: #2c3e50;
    }

    .global-message-text {
        color: #6c757d;
    }

    .global-toast {
        background: linear-gradient(135deg, rgba(33, 37, 41, 0.95), rgba(52, 58, 64, 0.9));
        border-color: rgba(255, 255, 255, 0.1);
    }

    .global-toast-title {
        color: #f8f9fa;
    }

    .global-toast-text {
        color: #adb5bd;
    }

    .custom-confirm-dialog {
        background: #2c3e50;
    }

    .custom-confirm-body {
        color: #ecf0f1;
    }

    .custom-confirm-footer {
        background: #34495e;
    }
}
