/* toast.css - Toast 通知组件样式 */

/* ====== Toast 容器 ====== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

/* ====== Toast 基础样式 ====== */
.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    animation: toast-slide-in 0.3s ease;
    min-width: 300px;
    max-width: 100%;
    position: relative;
    overflow: hidden;
}

@keyframes toast-slide-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.toast-hiding {
    animation: toast-slide-out 0.3s ease forwards;
}

@keyframes toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ====== Toast 类型 ====== */

/* Success - 成功 */
.toast-success {
    border-left: 4px solid #07C160;
}

.toast-success .toast-icon {
    color: #07C160;
}

/* Error - 错误 */
.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-error .toast-icon {
    color: #dc3545;
}

/* Warning - 警告 */
.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast-warning .toast-icon {
    color: #ffc107;
}

/* Info - 信息 */
.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-info .toast-icon {
    color: #17a2b8;
}

/* ====== Toast 元素 ====== */

/* 图标 */
.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

/* 内容 */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.4;
}

.toast-message {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    word-wrap: break-word;
}

/* 关闭按钮 */
.toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #999;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* 进度条（自动消失倒计时） */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 0 12px;
    animation: toast-progress linear forwards;
}

.toast-success .toast-progress {
    background: rgba(7, 193, 96, 0.3);
}

.toast-error .toast-progress {
    background: rgba(220, 53, 69, 0.3);
}

.toast-warning .toast-progress {
    background: rgba(255, 193, 7, 0.3);
}

.toast-info .toast-progress {
    background: rgba(23, 162, 184, 0.3);
}

@keyframes toast-progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* ====== Toast 操作按钮 ====== */
.toast-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.toast-actions .btn {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.toast-actions .btn-primary {
    background: linear-gradient(135deg, #07C160 0%, #06a852 100%);
    color: white;
}

.toast-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
}

.toast-actions .btn-outline {
    background: white;
    color: #07C160;
    border: 2px solid #07C160;
}

.toast-actions .btn-outline:hover {
    background: #f0fff4;
}

/* ====== 响应式 ====== */
@media (max-width: 768px) {
    .toast-container {
        left: 20px;
        right: 20px;
        top: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
        padding: 14px 16px;
    }
    
    .toast-title {
        font-size: 14px;
    }
    
    .toast-message {
        font-size: 13px;
    }
    
    .toast-actions {
        flex-direction: column;
    }
    
    .toast-actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* ====== 暗色模式 ====== */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #2a2a2a;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    }
    
    .toast-title {
        color: #fff;
    }
    
    .toast-message {
        color: #ccc;
    }
    
    .toast-close:hover {
        background: #3a3a3a;
        color: #fff;
    }
    
    .toast-actions {
        border-top-color: #3a3a3a;
    }
}

/* ====== 打印样式 ====== */
@media print {
    .toast-container {
        display: none !important;
    }
}
