/**
 * 全局公告通知栏样式
 */

.announcement-notification {
    width: 100%;
    padding: 12px 0;
    position: relative;
    z-index: 999;
    animation: slideDown 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}


/* 滑入动画 - 增强版 */
@keyframes slideDown {
    0% {
        transform: translateY(-100%) scale(0.95);
        opacity: 0;
        filter: blur(2px);
    }
    50% {
        transform: translateY(-20%) scale(1.02);
        opacity: 0.8;
        filter: blur(1px);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

/* 滑出动画 */
@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.announcement-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    z-index: 2;
    animation: containerFadeIn 0.8s ease-out 0.2s both;
}

/* 容器淡入动画 */
@keyframes containerFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.announcement-container:hover {
    opacity: 0.95;
}

.announcement-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    animation: iconBounce 2s ease-in-out infinite;
    transition: all 0.3s ease;
}

/* 图标弹跳动画 */
@keyframes iconBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

.announcement-container:hover .announcement-icon {
    animation-play-state: paused;
    transform: scale(1.1) rotate(5deg);
}

.announcement-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.announcement-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    animation: titleSlideIn 0.6s ease-out 0.4s both;
    transition: all 0.3s ease;
    position: relative;
}

/* 标题滑入动画 */
@keyframes titleSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.announcement-container:hover .announcement-title {
    transform: translateX(2px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.announcement-time {
    font-size: 12px;
    opacity: 0.8;
    flex-shrink: 0;
    animation: timeFadeIn 0.5s ease-out 0.6s both;
    transition: all 0.3s ease;
}

/* 时间淡入动画 */
@keyframes timeFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 0.8;
        transform: scale(1);
    }
}

.announcement-container:hover .announcement-time {
    opacity: 1;
    transform: scale(1.05);
}

.announcement-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.announcement-link {
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    white-space: nowrap;
    user-select: none;
    pointer-events: none; /* 让点击事件穿透到容器 */
    animation: linkSlideIn 0.5s ease-out 0.8s both;
    position: relative;
    overflow: hidden;
}

/* 按钮滑入动画 */
@keyframes linkSlideIn {
    0% {
        opacity: 0;
        transform: translateX(20px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* 按钮光效 */
.announcement-link::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;
}

.announcement-container:hover .announcement-link::before {
    left: 100%;
}

.announcement-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 16px;
    opacity: 0.7;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    pointer-events: auto; /* 确保关闭按钮可以点击 */
    z-index: 1;
    border-radius: 4px;
    animation: closeFadeIn 0.4s ease-out 1s both;
    position: relative;
}

/* 关闭按钮淡入动画 */
@keyframes closeFadeIn {
    0% {
        opacity: 0;
        transform: rotate(-90deg) scale(0.5);
    }
    100% {
        opacity: 0.7;
        transform: rotate(0deg) scale(1);
    }
}

.announcement-close:hover {
    opacity: 1;
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.3);
}

.announcement-close:active {
    transform: scale(0.9) rotate(90deg);
    transition: all 0.1s ease;
}

/* 通知类型样式 */
.announcement-info {
    background: linear-gradient(135deg, #f0fdfd 0%, #e8f9fb 100%);
    color: #0c5460;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}


.announcement-info:hover {
    background: linear-gradient(135deg, #e8f9fb 0%, #d4f4f7 100%);
}

.announcement-info .announcement-link {
    background: rgba(24, 162, 183, 0.08);
    color: #0c5460;
    transition: all 0.3s ease;
}

.announcement-info .announcement-link:hover {
    background: rgba(24, 162, 183, 0.15);
}

.announcement-warning {
    background: linear-gradient(135deg, #fffbf5 0%, #fff3e0 100%);
    color: #e65100;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}


.announcement-warning:hover {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.announcement-warning .announcement-link {
    background: rgba(230, 81, 0, 0.08);
    color: #e65100;
    transition: all 0.3s ease;
}

.announcement-warning .announcement-link:hover {
    background: rgba(230, 81, 0, 0.15);
}

.announcement-success {
    background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e9 100%);
    color: #1b5e20;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}


.announcement-success:hover {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.announcement-success .announcement-link {
    background: rgba(27, 94, 32, 0.08);
    color: #1b5e20;
    transition: all 0.3s ease;
}

.announcement-success .announcement-link:hover {
    background: rgba(27, 94, 32, 0.15);
}

.announcement-error {
    background: linear-gradient(135deg, #fef7f7 0%, #ffebee 100%);
    color: #b71c1c;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}


.announcement-error:hover {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
}

.announcement-error .announcement-link {
    background: rgba(183, 28, 28, 0.08);
    color: #b71c1c;
    transition: all 0.3s ease;
}

.announcement-error .announcement-link:hover {
    background: rgba(183, 28, 28, 0.15);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .announcement-container {
        padding: 0 15px;
        gap: 10px;
    }
    
    .announcement-icon {
        font-size: 18px;
    }
    
    .announcement-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .announcement-title {
        font-size: 13px;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .announcement-time {
        font-size: 11px;
    }
    
    .announcement-link {
        font-size: 12px;
        padding: 3px 10px;
    }
}

@media (max-width: 480px) {
    .announcement-notification {
        padding: 10px 0;
    }
    
    .announcement-container {
        gap: 8px;
    }
    
    .announcement-icon {
        font-size: 16px;
    }
    
    .announcement-content {
        gap: 3px;
    }
    
    .announcement-title {
        font-size: 12px;
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }
    
    .announcement-time {
        font-size: 10px;
    }
    
    .announcement-actions {
        gap: 8px;
    }
    
    .announcement-link {
        font-size: 11px;
        padding: 2px 8px;
    }
    
    .announcement-close {
        padding: 2px 4px;
        font-size: 14px;
    }
}

