.announcement-notification {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 9999; /* 提高层级确保置顶 */
    padding: 0 20px;
    color: #fff;
    font-size: 16px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    transform: translateY(0);
    /* 确保公告在所有情况下都显示在顶部 */
    top: 0;
}

.announcement-hidden {
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
}

/* 子比主题兼容性调整 */
body.zib-lite .announcement-notification,
body.zib-pro .announcement-notification {
    top: 0 !important; /* 确保在子比主题中置顶 */
    border-radius: 0 0 4px 4px; /* 圆角效果 */
}

.announcement-content {
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.close-announcement {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    outline: none;
    line-height: 1;
    transition: transform 0.2s;
}

.close-announcement:hover {
    transform: translateY(-50%) rotate(90deg);
}

/* 调整body的margin-top，避免内容被公告遮挡 */
body.has-announcement {
    margin-top: 60px; /* 默认公告高度 */
    transition: margin-top 0.3s ease;
}    