/* 公告系统样式 */

.announcement {
    background: rgba(40, 40, 40, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(80, 80, 80, 0.5);
    color: rgb(255, 255, 255);
    width: 37.5%; /* 搜索栏宽度(50%)的9/12 = 37.5% */
    max-width: 450px; /* 按比例调整最大宽度 */
    min-width: 300px; /* 按比例调整最小宽度 */
    padding: 12px 16px; /* 调整内边距 */
    margin: 10px auto;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 12px; /* 调整图标和内容间距 */
    opacity: 1;
    transform: translateY(0);
    animation: slideIn 0.5s ease-out;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.announcement:hover {
    background: rgba(55, 55, 55, 0.6);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(15px);
    border-color: rgba(120, 120, 120, 0.7);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* 公告中的链接样式 */
.announcement a {
    color: #66d9ef;
    text-decoration: underline;
    transition: all 0.3s ease;
    font-weight: 500;
}

.announcement a:hover {
    color: #00b09b;
    text-decoration: none;
    text-shadow: 0 0 8px rgba(102, 217, 239, 0.5);
}

/* 关闭按钮 */
.close-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-50%) scale(1.15);
}

/* 防止关闭按钮的悬浮影响公告栏的悬浮效果 */
.close-btn:hover + * {
    pointer-events: none;
}

/* 公告隐藏动画 */
.announcement.hide {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

/* 公告滑入动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 公告图标样式 */
.ann-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.announcement:hover .ann-icon {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

/* 公告内容样式 */
.ann-content {
    flex: 1;
    text-align: left;
    line-height: 1.4;
    padding-right: 30px; /* 为关闭按钮留出空间 */
}

/* 响应式设计 */
@media (max-width: 768px) {
    .announcement {
        width: 65%; /* 平板端适当增加宽度 */
        max-width: 400px; /* 调整最大宽度 */
        min-width: 250px; /* 调整最小宽度 */
        padding: 10px 14px; /* 调整内边距 */
        font-size: 13px;
    }
    
    .ann-icon {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .ann-content {
        padding-right: 25px;
    }
    
    .close-btn {
        right: 10px;
        width: 24px;
        height: 24px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .announcement {
        width: 75%; /* 手机端适当增加宽度 */
        min-width: 200px; /* 调整最小宽度 */
        padding: 8px 12px; /* 调整内边距 */
        font-size: 12px;
    }
    
    .ann-icon {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .ann-content {
        padding-right: 20px;
    }
    
    .close-btn {
        right: 8px;
        width: 22px;
        height: 22px;
        font-size: 14px;
    }
}
