/* 蓝色磨砂渐变公告系统样式 */

/* 公告滑入动画 */
@keyframes announcementSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-5px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 公告滑出动画 */
@keyframes announcementSlideOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

/* 公告容器 */
.announcement-container {
    position: relative;
    margin: 30px auto 20px;
    max-width: 800px;
    z-index: 100;
}

/* 公告消息主体 */
.announcement-message {
    position: relative;
    padding: 16px 50px 16px 20px;
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.9) 0%, 
        rgba(99, 102, 241, 0.8) 25%,
        rgba(139, 92, 246, 0.7) 50%,
        rgba(59, 130, 246, 0.6) 75%,
        rgba(99, 102, 241, 0.5) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    color: white;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: 0.5px;
    box-shadow: 
        0 8px 32px rgba(59, 130, 246, 0.3),
        0 4px 16px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 公告消息悬停效果 */
.announcement-message:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(59, 130, 246, 0.4),
        0 6px 20px rgba(99, 102, 241, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* 背景装饰光效 */
.announcement-message::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    animation: backgroundShimmer 3s ease-in-out infinite;
}

@keyframes backgroundShimmer {
    0%, 100% {
        opacity: 0.3;
        transform: rotate(0deg);
    }
    50% {
        opacity: 0.6;
        transform: rotate(5deg);
    }
}

/* 公告文本样式 */
.announcement-text {
    position: relative;
    z-index: 2;
}

/* 公告文本中的链接样式 */
.announcement-text a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
}

.announcement-text a:hover {
    color: white;
    text-decoration-color: white;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* 公告图标样式 */
.announcement-message .fa-bullhorn {
    margin-right: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* 关闭按钮样式 */
.announcement-close-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 16px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
}

.announcement-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.announcement-close-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .announcement-container {
        margin: 20px 15px 15px;
        max-width: none;
    }
    
    .announcement-message {
        padding: 14px 45px 14px 16px;
        font-size: 13px;
        border-radius: 12px;
    }
    
    .announcement-close-btn {
        width: 24px;
        height: 24px;
        font-size: 14px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .announcement-message {
        padding: 12px 40px 12px 14px;
        font-size: 12px;
        letter-spacing: 0.3px;
    }
    
    .announcement-message .fa-bullhorn {
        font-size: 12px;
        margin-right: 8px;
    }
}

/* 公告隐藏动画类 */
.announcement-hiding {
    animation: announcementSlideOut 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .announcement-message {
        background: linear-gradient(135deg, 
            rgba(59, 130, 246, 0.95) 0%, 
            rgba(99, 102, 241, 0.85) 25%,
            rgba(139, 92, 246, 0.75) 50%,
            rgba(59, 130, 246, 0.65) 75%,
            rgba(99, 102, 241, 0.55) 100%
        );
        border-color: rgba(255, 255, 255, 0.3);
    }
}

/* 高对比度模式适配 */
@media (prefers-contrast: high) {
    .announcement-message {
        border-width: 2px;
        border-color: rgba(255, 255, 255, 0.5);
    }
    
    .announcement-close-btn {
        border-width: 2px;
        border-color: rgba(255, 255, 255, 0.5);
    }
}

/* 减少动画模式适配 */
@media (prefers-reduced-motion: reduce) {
    .announcement-message,
    .announcement-close-btn,
    .announcement-message::before,
    .announcement-message .fa-bullhorn {
        animation: none;
        transition: none;
    }
    
    @keyframes announcementSlideIn {
        0%, 100% {
            opacity: 1;
            transform: none;
        }
    }
}