/* ========== 滚动公告条 基础样式 ========== */
.notice-bar {
    max-width: 100%;
    margin: 10px auto 5px;
    height: 46px;
    background: linear-gradient(90deg, #303033, #3d3d42);
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    align-items: center;
    position: relative;
    justify-content: flex-start;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 3px 10px rgba(0,0,0,0.25);
    border-left: 4px solid #5b8def;
    /* 左右留白，防止文字贴边 */
    padding-left: 110px;
}

/* 左侧固定播报标签 - 桌面端 */
.notice-bar::before {
    content: "📢 公告";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    padding: 0 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    z-index: 1;
    box-shadow: 3px 0 12px rgba(99, 102, 241, 0.2);
}

/* 滚动核心容器，性能优化 */
.notice-content {
    white-space: nowrap;
    animation: noticeScroll 20s linear infinite;
    will-change: transform;
}

/* 单条公告样式 - 桌面端大间距 */
.notice-content span {
    display: inline-block;
    color: #fff;
    font-size: 15px;
    letter-spacing: 0.6px;
    line-height: 46px;
    padding-right: 600px;
}

/* 右侧渐变遮罩 */
.notice-bar::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(to left, #36363b, transparent);
    z-index: 2;
    pointer-events: none;
}

/* 无缝滚动关键帧 */
@keyframes noticeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* 鼠标悬停暂停滚动 */
.notice-bar:hover .notice-content {
    animation-play-state: paused;
}

/* ========== 移动端适配 屏幕宽度768px以下 ========== */
@media screen and (max-width: 768px) {
    .notice-bar {
        max-width: 100%;
        margin: 5px auto;
        height: 38px;
        padding-left: 72px;
        border-left-width: 3px;
        border-radius: 5px;
    }

    /* 缩小左侧标签文字与内边距 */
    .notice-bar::before {
        padding: 0 6px;
        font-size: 12px;
    }

    /* 公告文字缩小，行高匹配容器高度 */
    .notice-content span {
        font-size: 13px;
        line-height: 38px;
        /* 手机大幅减少空白间隔，避免大量空白滚动 */
        padding-right: 180px;
        letter-spacing: 0.3px;
    }

    /* 缩短右侧渐变遮罩宽度 */
    .notice-bar::after {
        width: 12px;
    }

    /* 移动端滚动调慢一点，小字更容易看清 */
    .notice-content {
        animation-duration: 25s;
    }
}

/* ========== 超小屏手机（480px以下）进一步压缩 ========== */
@media screen and (max-width: 480px) {
    .notice-bar {
        margin: 5px auto;
        padding-left: 64px;
        height: 38px;
        border-radius: 5px;
    }

    .notice-bar::before {
        font-size: 13px;
        padding: 0 4px;
    }

    .notice-content span {
        font-size: 13px;
        line-height: 34px;
        padding-right: 120px;
    }

    .notice-content {
        animation-duration: 25s;
    }
}