/* ==========================================================================
   通知样式 - 中间长条样式（覆盖原有样式）
   ========================================================================== */

/* 通知容器 - 顶部居中 */
.notifications-container {
    position: fixed;
    top: 80px; /* 留出导航栏空间 */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    width: 100%;
    max-width: 1200px; /* 最大宽度 */
    padding: 0 20px;
    pointer-events: none; /* 允许点击穿透到下层元素 */
    /* display属性由JavaScript控制：无内容时none，有内容时block */
}

/* 通知框 - 长条样式 */
.notification {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    width: auto !important;
    min-width: 400px !important;
    max-width: 100% !important;
    margin: 0 auto 15px auto !important;
    padding: 16px 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    
    /* 长条形样式 */
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 
                0 2px 8px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    border-left: 4px solid transparent !important;
    
    /* 动画 */
    animation: slideInTop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    pointer-events: auto; /* 恢复点击事件 */
    
    /* 根据内容自动调整宽度 */
    width: fit-content !important;
}

/* 成功通知 */
.notification.success {
    border-left-color: #28a745 !important;
    background: linear-gradient(135deg, 
        rgba(212, 237, 218, 0.98), 
        rgba(195, 230, 203, 0.98)) !important;
}

/* 错误通知 */
.notification.error {
    border-left-color: #dc3545 !important;
    background: linear-gradient(135deg, 
        rgba(248, 215, 218, 0.98), 
        rgba(245, 198, 203, 0.98)) !important;
}

/* 警告通知 */
.notification.warning {
    border-left-color: #ffc107 !important;
    background: linear-gradient(135deg, 
        rgba(255, 243, 205, 0.98), 
        rgba(255, 234, 167, 0.98)) !important;
}

/* 信息通知 */
.notification.info {
    border-left-color: #17a2b8 !important;
    background: linear-gradient(135deg, 
        rgba(209, 236, 241, 0.98), 
        rgba(190, 229, 235, 0.98)) !important;
}

/* 通知内容 */
.notification-content {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex: 1 !important;
    min-width: 0 !important; /* 允许文本截断 */
}

.notification-content i {
    font-size: 20px !important;
    width: 24px !important;
    height: 24px !important;
    text-align: center !important;
    flex-shrink: 0 !important;
}

/* 图标颜色 */
.notification.success .notification-content i {
    color: #155724 !important;
}

.notification.error .notification-content i {
    color: #721c24 !important;
}

.notification.warning .notification-content i {
    color: #856404 !important;
}

.notification.info .notification-content i {
    color: #0c5460 !important;
}

/* 通知文本 */
.notification-content span {
    color: #333 !important;
    font-weight: 500 !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    word-break: break-word !important;
}

/* 关闭按钮 */
.notification-close {
    background: none !important;
    border: none !important;
    color: rgba(0, 0, 0, 0.5) !important;
    cursor: pointer !important;
    padding: 6px !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0 !important;
    pointer-events: auto !important; /* 确保按钮可以点击 */
    position: relative !important;
    z-index: 10 !important;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    color: rgba(0, 0, 0, 0.8) !important;
}

.notification-close i {
    font-size: 16px !important;
}

/* 从顶部滑入动画 */
@keyframes slideInTop {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 向上滑出动画 */
@keyframes slideOutTop {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-50px);
        opacity: 0;
    }
}

.notification.removing {
    animation: slideOutTop 0.3s ease-in forwards !important;
}

/* 通知堆叠 - 垂直排列 */
.notification + .notification {
    margin-top: 12px !important;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .notifications-container {
        max-width: 900px;
        padding: 0 20px;
    }
    
    .notification {
        min-width: 350px !important;
    }
}

@media (max-width: 768px) {
    .notifications-container {
        max-width: 100%;
        padding: 0 15px;
        top: 70px;
    }
    
    .notification {
        min-width: 300px !important;
        max-width: calc(100vw - 30px) !important;
        padding: 14px 20px !important;
        gap: 12px !important;
    }
    
    .notification-content span {
        font-size: 14px !important;
    }
    
    .notification-content i {
        font-size: 18px !important;
        width: 20px !important;
        height: 20px !important;
    }
}

@media (max-width: 480px) {
    .notifications-container {
        padding: 0 10px;
        top: 60px;
    }
    
    .notification {
        min-width: auto !important;
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        padding: 12px 16px !important;
        gap: 10px !important;
    }
    
    .notification-content {
        gap: 10px !important;
    }
    
    .notification-content i {
        font-size: 16px !important;
        width: 18px !important;
        height: 18px !important;
    }
    
    .notification-content span {
        font-size: 13px !important;
    }
    
    .notification-close {
        width: 24px !important;
        height: 24px !important;
        padding: 4px !important;
    }
    
    .notification-close i {
        font-size: 14px !important;
    }
}

/* 深色主题适配 */
.theme-dark .notification {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 
                0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.theme-dark .notification.success {
    background: linear-gradient(135deg, 
        rgba(30, 126, 52, 0.95), 
        rgba(21, 87, 36, 0.95)) !important;
}

.theme-dark .notification.error {
    background: linear-gradient(135deg, 
        rgba(200, 35, 51, 0.95), 
        rgba(114, 28, 36, 0.95)) !important;
}

.theme-dark .notification.warning {
    background: linear-gradient(135deg, 
        rgba(230, 137, 0, 0.95), 
        rgba(133, 100, 4, 0.95)) !important;
}

.theme-dark .notification.info {
    background: linear-gradient(135deg, 
        rgba(25, 118, 210, 0.95), 
        rgba(12, 84, 96, 0.95)) !important;
}

.theme-dark .notification-content span {
    color: #fff !important;
}

.theme-dark .notification-close {
    color: rgba(255, 255, 255, 0.6) !important;
}

.theme-dark .notification-close:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

/* 长文本优化 */
.notification-content span {
    /* 允许内容自动换行 */
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* 多行文本时的样式调整 */
.notification:has(.notification-content span:not(:only-child)) {
    min-height: 60px;
}

/* 确保通知框在页面滚动时保持固定 */
.notifications-container {
    position: fixed !important;
}

/* 增强可见性 */
.notification {
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.theme-dark .notification {
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* 鼠标悬停效果 */
.notification:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2), 
                0 3px 10px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.theme-dark .notification:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 
                0 3px 10px rgba(0, 0, 0, 0.4) !important;
}

