/* --- 公告轮播 (最终解决方案) --- */

.announcements {
    margin-bottom: 40px;
    position: relative;
    /* 保持 overflow: hidden，这是解决页面被撑开的关键 */
    overflow: hidden;

    /* --- 核心修复 #1: 使用 Flexbox 进行垂直布局 --- */
    display: flex;
    flex-direction: column; /* 让子元素垂直排列 */

    /* 移除 padding-bottom，不再需要它来预留空间 */
}

.carousel-container {
    /* 容器作为Flex项目，占据所有可用空间 */
    flex: 1 1 auto;
    
    /* 保持 position: relative，作为卡片和 sizer 的定位基准 */
    position: relative;
    cursor: grab;
}

.carousel-container:active {
    cursor: grabbing;
}

/* 占位符的作用不变：撑开容器的高度 */
.carousel-sizer {
    position: relative;
    visibility: hidden; /* 它本身不可见 */
    transition: height 0.3s ease-in-out;
    pointer-events: none; /*重点:禁止拦截触摸事件*/
}

.announcement-card {
    /* 保持原始的、正确的绝对定位模型 */
    position: absolute;
    top: 50%;
    left: 0;

    width: 75%;
    max-width: 450px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    transform-origin: center center;
    pointer-events: auto;
    box-sizing: border-box;
    overflow: hidden;
    
    /* 保持我们需要的固定宽高比 */
    aspect-ratio: 16 / 9;

    z-index: 1;

     background-color: var(--secondary-bg);
    background-size: cover;
    background-position: center;
}

/* 底部渐变阴影 */
.announcement-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    pointer-events: none;
    border-radius: 0 0 10px 10px;
    z-index: 1;
}

.announcement-card.dragging {
    pointer-events: none;
}

/* 标题样式 */
.announcement-card h3 {
    position: absolute;
    bottom: 10px;
    left: 15px;
    right: 15px;
    z-index: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
    margin: 0;
    font-size: 18px;
    text-align: left;
    line-height: 1.4;
}

.announcement-card p {
    display: none;
}

/* --- 核心修复 #2: 指示器作为正常的Flex项 --- */
.carousel-indicators {
    /* 它现在是一个正常的块级元素，在轮播区域的下方 */
    display: flex;
    justify-content: flex-end;
    
    /* 移除所有绝对定位相关的属性 */

    /* 为其自身创造空间 */
    padding-top: 15px;
    padding-bottom: 5px; /* 底部留一些空间 */
    padding-right: var(--card-padding-x);

    /* 让其高度固定，不被压缩 */
    flex-shrink: 0;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 50%;
    margin: 0 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, width 0.3s ease, height 0.3s ease, border-radius 0.3s ease;
}

.indicator-dot.active {
    background-color: var(--accent-color);
    width: 20px;
    height: 6px;
    border-radius: 3px;
}