/* ================================================
   news.html 新闻列表页 移动端响应式样式
   - 覆盖板块：Banner、频道 Tab、新闻头条+侧列表、
     底部新闻网格（多列改单列）、分页
   断点：仅 @media only screen and (max-width: 767px)
   顶部导航/页脚公共部分见 css/responsive/common-responsive.css
   ================================================ */
@media only screen and (max-width: 767px) {

    /* ---------- 顶部导航汉堡按钮对齐修复 ----------
       公共 header.html 的 DOM 顺序为 logo → nav → 汉堡 → 搜索表单，
       flex space-between 下汉堡不会自动靠右，而是悬在中间偏左；
       首页（index.css）给汉堡设置了 margin-left:auto 使其靠右。
       此处复刻首页写法：margin-left:auto 把汉堡推到最右，
       右侧间距与首页完全一致。 */
    header .nav-toggle,
    .header .nav-toggle {
        margin-left: auto !important;
    }

    /* 强制导航容器 flex 两端对齐（覆盖各内页自身 header 布局差异） */
    header,
    .header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 16px !important;
        box-sizing: border-box;
    }

    /* 清除 Logo 区多余左内边距，保证左右视觉对齐 */
    header .logo-area,
    .header .logo-area {
        padding-left: 0 !important;
    }

    /* ---------- Banner ---------- */
    .news-banner {
        height: 180px;
        background-size: cover !important; /* 覆盖页面内联 background-size:100% */
    }
    .banner-title-box {
        left: 20px;
        border-left: 3px solid #fff;
        padding-left: 12px;
    }
    .banner-title-en {
        font-size: 22px;
        letter-spacing: 1px;
        line-height: 1.2;
    }
    .banner-title-cn {
        font-size: 24px;
        line-height: 1.2;
    }

    /* ---------- 主容器 ---------- */
    .main-container {
        padding-top: 20px;
        padding-bottom: 32px;
    }

    /* ---------- 频道 Tab（可换行，触控目标 ≥44px） ---------- */
    .tabs-header {
        flex-wrap: wrap;
        align-items: center;
        gap: 18px;
        margin-bottom: 20px;
        padding-bottom: 6px;
        padding-left: 16px;
        padding-right: 16px;
    }
    .tab-item {
        font-size: 16px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 12px 8px 8px;
    }
    .tab-item.active::after {
        bottom: -4px;
        height: 3px;
    }

    /* ---------- 双面板滑块容器（横滚轮播，保持可滑动） ---------- */
    .news-slider-panel {
        padding: 0 16px !important;
    }

    /* ---------- 新闻头条 + 侧列表（改单列） ---------- */
    .styled-section {
        padding-bottom: 20px;
    }
    .home-style-news-section .content-container {
        flex-direction: column !important;
        gap: 24px;
    }
    .home-style-news-section .featured-news {
        flex: none;
        width: 100%;
        display: block;
    }
    .home-style-news-section .featured-image {
        width: 100% !important;
        height: auto !important;
        display: block;
    }
    .home-style-news-section .news-date-large {
        width: 100% !important;
        margin-top: 12px;
    }
    .home-style-news-section .date-day {
        font-size: 22px;
        height: auto;
        margin-bottom: 0;
        line-height: 1.2;
    }
    .home-style-news-section .date-year {
        font-size: 14px;
        transform: none;
    }
    .home-style-news-section .featured-title {
        font-size: 16px;
        letter-spacing: 0;
        margin-top: 4px;
        margin-bottom: 8px;
    }
    .home-style-news-section .featured-desc {
        width: 100% !important;
        font-size: 14px;
        letter-spacing: 0;
        line-height: 1.6;
    }
    .home-style-news-section .news-list-section {
        gap: 20px;
        width: 100%;
    }
    .home-style-news-section .news-item {
        gap: 12px;
        align-items: flex-start;
    }
    .home-style-news-section .news-item-img {
        width: 110px !important;
        height: 80px !important;
        flex-shrink: 0;
    }
    .home-style-news-section .news-item-content {
        flex: 1;
        min-width: 0;
        width: auto !important;
        transform: none !important;
    }
    .home-style-news-section .news-item-day {
        font-size: 18px;
        margin-right: 0;
        line-height: 1.2;
    }
    .home-style-news-section .news-item-year {
        font-size: 13px;
        transform: none !important;
        margin-top: 2px;
    }
    .home-style-news-section .news-item-title {
        font-size: 15px;
        letter-spacing: 0;
        max-width: 100% !important;
        transform: none !important;
        white-space: normal !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.4;
        margin-bottom: 4px;
    }
    .home-style-news-section .news-item-desc {
        font-size: 13px;
        margin-top: 4px;
        max-width: 100% !important;
        line-height: 1.5;
    }
    .home-style-news-section .date-arrow {
        width: 20px;
        height: auto;
    }
    .home-style-news-section .more-link {
        font-size: 14px;
        margin-top: 4px;
    }

    /* ---------- 底部新闻网格（多列改单列） ---------- */
    .news-grid-row {
        flex-direction: column !important;
        gap: 28px;
        margin-bottom: 16px;
    }
    .grid-card {
        width: 100% !important;
    }
    .grid-img {
        width: 100% !important;
        height: auto !important;
        margin-bottom: 12px;
    }
    .grid-img img {
        width: 100% !important;
        height: auto !important;
        object-fit: cover;
    }
    .news-title {
        font-size: 16px;
        line-height: 1.4;
        margin-bottom: 6px;
        white-space: normal !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    .news-desc {
        font-size: 14px;
        line-height: 1.5;
    }
    /* 卡片内日期带内联样式(font-size:calc(16/1920*100vw))，需 !important 覆盖 */
    .grid-card > div[style] {
        font-size: 14px !important;
        margin-top: 8px !important;
        line-height: 1.5;
    }

    /* ---------- 分页（横向滚动保持可滑动，触控目标 ≥44px） ---------- */
    .pagination-container {
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px !important;
        font-size: 14px;
        margin-top: 20px;
        padding: 8px 16px 12px;
    }
    .pagination-container::-webkit-scrollbar {
        display: none;
    }
    .pagination-info {
        margin-right: 0;
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 13px;
        letter-spacing: 0;
    }
    .page-box,
    .page-select-box,
    .page-input-box,
    .page-confirm-box {
        height: 44px !important;
        flex-shrink: 0;
    }
    .page-box {
        width: 44px !important;
        font-size: 16px;
    }
    .page-select-box {
        padding: 0 12px;
        font-size: 14px;
    }
    .page-input-box {
        width: 56px !important;
        font-size: 16px;
    }
    .page-confirm-box {
        padding: 0 14px;
        font-size: 14px;
        min-width: 44px;
    }
    .page-label {
        font-size: 14px;
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* ================================================
   追加层：新闻列表页 移动端分页组件专项微调
   - 仅 (max-width:767px) 生效，PC 端分页 100% 原样不动
   - 覆盖上方横滚方案：分页自适应宽度、水平居中、按钮自动换行压缩
     1. 记录信息「共xx条 第x/x页」置顶独立一行、居中、字号缩小
     2. 分页按钮缩小宽高/字号、减小间距、圆角放大（触控友好）
     3. 当前激活页码保留原有主题绿色背景
     4. 分页区上下留白，与新闻列表/页脚拉开距离
     5. 全部元素约束在屏幕内，禁止横向滚动
   ================================================ */
@media only screen and (max-width: 767px) {

    /* ---------- 1. 分页容器：自适应宽度 + 水平居中 + 换行不溢出 ---------- */
    .pagination-container {
        flex-wrap: wrap !important;              /* 按钮超宽自动换行，不产生横向滚动 */
        justify-content: center !important;      /* 水平居中 */
        overflow-x: visible !important;          /* 彻底关闭横向滚动 */
        -webkit-overflow-scrolling: auto;
        gap: 6px !important;                     /* 按钮间距适度压缩 */
        width: 100% !important;
        max-width: 100% !important;
        margin: 28px auto 36px !important;       /* 上下留白，与列表/页脚拉开距离 */
        padding: 0 16px !important;              /* 屏幕安全边距 */
        box-sizing: border-box;
        font-size: 13px !important;
    }
    .pagination-container::-webkit-scrollbar {
        display: none !important;
    }

    /* ---------- 2. 记录信息：独立一行、居中、字号缩小 ---------- */
    .pagination-info {
        flex: 0 0 100% !important;               /* 独占一行，置于按钮上方 */
        width: 100% !important;
        text-align: center !important;
        margin: 0 0 12px !important;
        white-space: nowrap;
        font-size: 13px !important;
        letter-spacing: 0 !important;
    }
    .pagination-info b {
        font-size: 13px !important;
    }

    /* ---------- 3. 分页按钮：缩小宽高/字号、圆角放大 ---------- */
    .page-box,
    .page-select-box,
    .page-input-box,
    .page-confirm-box {
        height: 38px !important;
        min-height: 38px;
        border-radius: 9px !important;           /* 圆角适度放大，适配触控 */
        box-sizing: border-box;
    }
    .page-box {
        width: 38px !important;
        min-width: 0;
        font-size: 14px !important;
    }
    .page-confirm-box {
        padding: 0 12px !important;
        font-size: 13px !important;
        white-space: nowrap;
    }
    .page-select-box {
        padding: 0 10px !important;
        font-size: 13px !important;
    }
    .page-input-box {
        width: 46px !important;
        font-size: 14px !important;
    }
    .page-label {
        font-size: 13px !important;
        white-space: nowrap;
    }
    /* 当前激活页码：保留原有主题绿色背景 */
    .page-box.active {
        background-color: var(--primary) !important;
        color: #fff !important;
        border-color: var(--primary) !important;
    }

    /* ---------- 4. 全局防横向溢出兜底 ---------- */
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }
}
