/* ==============================================
   1. 基础配置：变量/全局重置（核心复用层）
   ============================================== */
:root {
    /* 核心配色变量（统一复用，避免硬编码） */
    --color-red: #EA3939;
    --color-yellow: #FFB703;
    --color-beige: #FFF1E6;
    --color-dark-blue: #1D3557;
    --color-light-blue: #0064d1;
    --color-white: #FFFFFF;
    --color-black: #000000;
    --color-gray-1: #f8f9fa;
    --color-gray-2: #dee2e6;
    --color-gray-3: #6c757d;
    --color-gray-4: #999999;
    --color-gray-5: #aaaaaa;
    --color-gray-6: #727a85;
    --color-gray-7: #adb5bd;

    /* 通用尺寸/间距变量 */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.2rem;
    --spacing-xl: 2rem;

    /* 过渡动画变量（统一曲线/时长） */
    --transition-base: all 0.2s ease;
    --transition-hover: all 0.3s ease;
}
html, body {
    overflow-x: hidden; /* 关键：禁止整个页面横向滚动 */
    width: 100%;
    max-width: 100vw;
}


/* 全局重置（标准化盒模型/字体） */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Arial", "Microsoft YaHei", "黑体", "宋体", sans-serif;
}
@media (max-width: 768px) {
    * {
        font-size: 16px;
    }
}
/* ==============================================
   2. 通用复用样式（跨模块共用）
   ============================================== */
/* 通用间距 */
.py-section {
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
}

/* 红色背景通用类（替代硬编码+!important） */
.bg-header-red,
.header-nav,
.footer-nav {
    --bs-bg-opacity: 1;
    background-color: var(--color-red) !important; /* 仅保留必要的!important（适配Bootstrap优先级） */
}

/* 按钮样式（统一基类+变体，合并重复样式） */
.btn-custom {
    display: inline-block;
    border-radius: 4px;
    padding: 0.4rem 1rem;
    border: none;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: var(--transition-base);
}
/* 黄色按钮变体 */
.btn-custom--yellow {
    background-color: var(--color-yellow);
    color: var(--color-black);
}
.btn-custom--yellow:hover {
    opacity: 0.9;
}
/* 黑色按钮变体（合并原.btn-dark-custom/.bottom-more-btn） */
.btn-custom--black {
    background-color: var(--color-black);
    color: var(--color-white);
}
.btn-custom--black--lg {
    padding: 10px 30px;
    margin-top: 20px;
}

/* 搜索框样式 */
.search-input {
    border-radius: 20px;
    padding: var(--spacing-sm) var(--spacing-lg);
    border: 1px solid #eee;
    outline: none;
}
.search-input:focus {
    border-color: var(--color-light-blue);
    box-shadow: 0 0 0 2px rgba(0, 100, 209, 0.1);
}

/* 左侧文字 右侧图片 卡片样式 */
.news-link {
    color: #131313;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-base);
    /* 新增：确保a标签占满列宽，点击区域完整 */
    display: block;
    height: 100%;
}

.news-link:hover {
    color: var(--color-gray-6);
}

.news-link:hover .card-custom {
    /* 新增：hover时卡片轻微上浮+阴影，提升交互感 */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-custom {
    background-color: var(--color-white);
    border-radius: 8px;
    padding: 5px;
    position: relative;
    align-items: center;
    gap: 5px; /* 文字和图片间距 */
    min-height: 120px; /* 保持最小高度 */
    transition: all 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 3;          /* 限制显示 3 行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 左侧文字区域：占满剩余宽度 */
.card-text-wrapper {
    flex-grow: 1;
    /* 文字超出省略，避免排版错乱 */
    overflow: hidden;
}
/* 图标+文字组合容器：实现横向排列 */
.info-item {
    display: flex;
    align-items: center; /* 垂直居中对齐 */
    gap: 4px; /* 图标和文字之间的间距，可按需调整 */
}

/* 图标样式：控制大小，避免过大/过小 */
.info-icon {
    width: 14px;  /* 图标宽度，可按需调整 */
    height: 14px; /* 图标高度，和宽度保持一致 */
    flex-shrink: 0; /* 防止图标被压缩 */
    display: inline-block;
}

.detail-info-icon {
    width: 30px;  /* 图标宽度，可按需调整 */
    height: 30px; /* 图标高度，和宽度保持一致 */
    flex-shrink: 0; /* 防止图标被压缩 */
    display: inline-block;
}

.visit-info-icon {
    width: 16px;  /* 图标宽度，可按需调整 */
    height: 16px; /* 图标高度，和宽度保持一致 */
    flex-shrink: 0; /* 防止图标被压缩 */
    display: inline-block;
}

.share-btn {
    border: none;
    background: transparent;
    padding: 0;
    padding-left: 10px;
}

.copy-info-icon {
    width: 100px;
    border: 0;
    outline: none;
    display: block;
}


/* 移除p标签的默认margin，改用info-item的mb-1控制间距 */
.info-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* 右侧图片容器：固定尺寸，保证一致性 */
.card-img-wrapper {
    flex-shrink: 0; /* 防止图片被压缩 */
    width: 150px;     /* 图片宽度 */
    height: 150px;    /* 图片高度 */
    border-radius: 10px; /* 图片圆角，和卡片呼应 */
    overflow: hidden;   /* 裁剪图片超出部分 */
    @media (max-width: 768px) {
        width: 120px;     /* 图片宽度 */
        height: 120px;
    }
}



/* 活动图片样式：覆盖容器，保持比例 */
.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 图片自适应，不拉伸变形 */
}

/* 无图片时的占位样式 */
.card-img-placeholder {
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 文字样式优化：避免换行错乱，超出省略 */
.card-text-wrapper .fw-bold {
    margin-bottom: 4px;
    font-size: 15px;
    /* 标题超出1行省略 */
    display: -webkit-box;
    -webkit-line-clamp: 3;          /* 限制显示 3 行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-text-wrapper img{
    width: 18px;
    height: 18px;
    /* 确保SVG颜色继承按钮的color属性（若SVG是单色且设置了fill="currentColor"） */
    color: inherit;
    /* 防止SVG超出按钮 */
    object-fit: contain;
    /* 移除图片默认间距 */
    display: block;
}

.card-text-wrapper .small {
    color: #666;
    margin-bottom: 2px;
    /* 信息行超出1行省略 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* 广告横幅（响应式高度） */
.ad-banner-img {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    background-color: #f5f5f5; /* 占位背景 */
}


.events-list-ad-banner-img {
    width: 100%;
    height: clamp(180px, 20vw, 200px); /* 移动端自适应，最大200px */
    object-fit: cover;
    background-color: #f5f5f5; /* 占位背景 */
}


/* 列表项优化 */
/* 新闻列表容器基础样式 */
.news-list-container {
    background-color: var(--color-beige);
}

/* 新闻项容器：作为绝对定位参考 */
.news-item-wrapper {
    position: relative;
}

/* 新闻项核心样式：调整布局为顶部对齐，预留底部空间 */
.news-item {
    position: relative;
    min-height: 80px; /* 确保足够高度容纳内容 */
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start !important; /* 改为顶部对齐，避免垂直居中影响定位 */
    padding-bottom: 5px !important; /* 预留时间显示空间 */
}

.news-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


/* 新闻内容区域样式 */
.news-content-area {
    position: relative;
    height: 100px; /* 与图片高度一致 */
    padding-bottom: 5px; /* 为底部信息预留空间 */
}

/* 底部信息栏（来源+时间+浏览量） */
.news-meta-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 来源+时间容器 */
.news-source-time {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 新闻来源样式 */
.news-author {
    color: #007bff;
    font-size: 12px;
    white-space: nowrap;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 发布时间样式 */
.news-publish-time {
    color: #6c757d;
    font-size: 12px;
}

/* 浏览量样式 */
.view-count {
    color: #6c757d;
    font-size: 12px;
}

/* 分隔符样式 */
.meta-separator {
    color: #ced4da;
    font-size: 10px;
}




.news-er-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    z-index: 1;
    position: relative;
}

/* 版权/社交链接 */
.copyright {
    margin-top: 20px;
    color: var(--color-gray-5);
    font-size: 0.9rem;
}
.social-links {
    list-style: none;
    padding: 0;
}
.social-links li {
    margin-bottom: 5px;
}

/* ==============================================
   3. 组件专属样式（独立模块）
   ============================================== */
/* 回到顶部按钮（优化可访问性/交互） */
.back-to-top {
    position: fixed;
    bottom: 200px;
    right: 20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-size: 100%;
    background-image: url('../images/top.png');
    background-position: center;
    background-repeat: no-repeat;
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    border: none;
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: var(--transition-hover);
    opacity: 0;
    visibility: hidden;
    /* 可访问性：屏幕阅读器文字 */
    text-indent: -9999px;
    overflow: hidden;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background-color: #d92d2d;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.back-to-top:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 轮播组件（响应式高度） */
.my-carousel {
    width: 100%;
    height: clamp(200px, 50vw, 400px); /* 移动端200px，最大400px */
    position: relative;
    overflow: hidden;
}
.my-carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
/* 轮播翻页按钮 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    color: var(--color-white);
    text-decoration: none;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.5);
    font-weight: bold;
    border-radius: 4px; /* 增加圆角提升体验 */
    transition: var(--transition-base);
}
.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}
.btn-prev {
    left: 10px;
}
.btn-next {
    right: 10px;
}

/* ==============================================
   4. 响应式适配（统一断点）
   ============================================== */
@media (max-width: 768px) {


    .news-er-title {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    /* 轮播适配 */
    .my-carousel {
        height: clamp(160px, 40vw, 300px);
    }
    .carousel-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    /* 列表图片适配 */
    .news-img {
        width: 80px;
        height: 60px;
    }
    /* 回到顶部按钮适配 */
    .back-to-top {
        width: 60px;
        height: 60px;
    }
    /* 通用间距适配 */
    .py-section {
        padding-top: var(--spacing-md);
        padding-bottom: var(--spacing-md);
    }
}