/* MessageBox 通用提示弹窗组件样式 */

/* 遮罩层 */
.tl-mt-message-box-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

/* 消息框主体 */
.tl-mt-message-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    min-width: 420px;
    max-width: 520px;
    overflow: hidden;
    animation: message-box-bounce 0.3s ease-out;
}

/* 头部 */
.tl-mt-message-box-header {
    padding: 24px 24px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.tl-mt-message-box-header.success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.tl-mt-message-box-header.error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.tl-mt-message-box-header.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.tl-mt-message-box-header.info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

/* 图标 */
.tl-mt-message-box-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tl-mt-message-box-header.success .tl-mt-message-box-icon {
    background: #22c55e;
    color: white;
}

.tl-mt-message-box-header.error .tl-mt-message-box-icon {
    background: #ef4444;
    color: white;
}

.tl-mt-message-box-header.warning .tl-mt-message-box-icon {
    background: #f59e0b;
    color: white;
}

.tl-mt-message-box-header.info .tl-mt-message-box-icon {
    background: #3b82f6;
    color: white;
}

.tl-mt-message-box-icon .material-symbols-outlined {
    font-size: 28px;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 48;
}

/* 标题 */
.tl-mt-message-box-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    flex: 1;
}

/* 内容区域 */
.tl-mt-message-box-body {
    padding: 24px;
}

.tl-mt-message-box-message {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #4b5563;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 底部按钮区域 */
.tl-mt-message-box-footer {
    padding: 16px 24px;
    background: #f9fafb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #f0f0f0;
}

/* 按钮通用样式 */
.tl-mt-message-box-button {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    min-width: 80px;
}

.tl-mt-message-box-button:active {
    transform: scale(0.98);
}

/* 取消按钮 */
.tl-mt-message-box-button-cancel {
    background: white;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.tl-mt-message-box-button-cancel:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

/* 确认按钮 */
.tl-mt-message-box-button-confirm {
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tl-mt-message-box-button-confirm.success {
    background: #22c55e;
}

.tl-mt-message-box-button-confirm.success:hover {
    background: #16a34a;
}

.tl-mt-message-box-button-confirm.error {
    background: #ef4444;
}

.tl-mt-message-box-button-confirm.error:hover {
    background: #dc2626;
}

.tl-mt-message-box-button-confirm.warning {
    background: #f59e0b;
}

.tl-mt-message-box-button-confirm.warning:hover {
    background: #d97706;
}

.tl-mt-message-box-button-confirm.info {
    background: #3b82f6;
}

.tl-mt-message-box-button-confirm.info:hover {
    background: #2563eb;
}

/* 动画效果 */
@keyframes message-box-bounce {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 淡入淡出动画 */
.tl-mt-message-box-fade-enter-active,
.tl-mt-message-box-fade-leave-active {
    transition: opacity 0.3s ease;
}

.tl-mt-message-box-fade-enter,
.tl-mt-message-box-fade-leave-to {
    opacity: 0;
}

/* 缩放动画 */
.tl-mt-message-box-zoom-enter-active {
    animation: message-box-bounce 0.3s ease-out;
}

.tl-mt-message-box-zoom-leave-active {
    animation: message-box-zoom-out 0.2s ease-in;
}

@keyframes message-box-zoom-out {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tl-mt-message-box {
        min-width: 90%;
        max-width: 90%;
        margin: 0 20px;
    }
    
    .tl-mt-message-box-header {
        padding: 20px 16px 16px;
    }
    
    .tl-mt-message-box-body {
        padding: 20px 16px;
    }
    
    .tl-mt-message-box-footer {
        padding: 12px 16px;
        flex-direction: column-reverse;
    }
    
    .tl-mt-message-box-button {
        width: 100%;
    }
}

/* 暗色模式支持 */
body.dark .tl-mt-message-box {
    background: #1e293b;
}

body.dark .tl-mt-message-box-header {
    border-bottom-color: #334155;
}

body.dark .tl-mt-message-box-header.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
}

body.dark .tl-mt-message-box-header.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
}

body.dark .tl-mt-message-box-header.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
}

body.dark .tl-mt-message-box-header.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
}

body.dark .tl-mt-message-box-title {
    color: #f1f5f9;
}

body.dark .tl-mt-message-box-message {
    color: #cbd5e1;
}

body.dark .tl-mt-message-box-footer {
    background: #0f172a;
    border-top-color: #334155;
}

body.dark .tl-mt-message-box-button-cancel {
    background: #334155;
    color: #cbd5e1;
    border-color: #475569;
}

body.dark .tl-mt-message-box-button-cancel:hover {
    background: #475569;
    border-color: #64748b;
    color: #f1f5f9;
}
