@charset "utf-8";

/* ================================================================
   专题：以德润城 向善同行——新津持续筑牢新时代公民道德根基
   样式表（与结构 index.html、交互 js/index.js 分离）
   布局：flex 弹性布局，电脑端优先，兼容移动端
   字体：微软雅黑（政务网页标准排版）
   ================================================================ */

/* ---------- 0. 全局重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* 锚点平滑滚动 */
}

body {
    font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    background-color: #fdf7ef; /* 页面底色：暖米色，呼应专题暖调 */
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
    border: 0;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color .25s ease;
}

ul, ol {
    list-style: none;
}

/* ---------- 1. 版心容器：居中限宽，规范左右留白 ---------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ================================================================
   2. 顶部 Banner
   ================================================================ */
.banner {
    width: 100%;
    line-height: 0;
    background: #0f6fb4;
}

.banner img {
    width: 100%;
    height: auto;
    margin: 0 auto;
}

/* ================================================================
   3. 栏目通用样式
   ================================================================ */
.section {
    padding: 20px 0;
}

/* 带暖色山峦背景的栏目（背景图资源分离，居中覆盖） */
.section--bg1 {
    background: url("../images/bg1.jpg") center top / cover no-repeat;
}

.section--bg2 {
    background: url("../images/bg3.jpg") center top / cover no-repeat;
}

.section--bg3 {
    background: url("../images/bg2.jpg") center top / cover no-repeat;
}

/* 无图背景栏目：极浅暖色，保证阅读 */
.section--plain {
    background: url("../images/bg2.jpg") center top / cover no-repeat;
}


/* 栏目标题：图片居中 */
.section-head {
    text-align: center;
    margin-bottom: 34px;
}

.section-head img {
    max-width: 520px;
    width: 80%;
    margin: 0 auto;
    /* 标题入场轻微浮动效果 */
    animation: titleFloat 4s ease-in-out infinite;
}

@keyframes titleFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* 栏目导语：两端对齐、字距舒展，政务正文排版 */
.intro {
    max-width: 1200px;
    margin: 0 auto 40px;
    font-size: 16px;
    line-height: 2.1;
    color: #5a4632;
    text-indent: 2em;
    text-align: justify;
}

.body-text {
    max-width: 1200px;
    margin: 30px auto;
    font-size: 16px;
    line-height: 2.1;
    color: #5a4632;
    text-indent: 2em;
    text-align: justify;
}

/* ================================================================
   4. ★ 横向图片滚动（设计图红色框选区域）
   结构：左右箭头 + 可视窗口(viewport) + 轨道(track) + 指示点
   ================================================================ */
.scroll-gallery {
    position: relative;
    max-width: 1200px;
    margin: 44px auto;
    /* 红色主题边框：呼应设计稿框选区域，同时具备卡片质感 */
    border: 2px solid rgba(206, 52, 32, .55);
    background: rgba(255, 255, 255, .75);
    border-radius: 6px;
    padding: 18px 56px 26px;
    box-shadow: 0 6px 22px rgba(180, 70, 30, .10);
}

/* 可视窗口：溢出隐藏，露出的内容由轨道横向位移呈现 */
.gallery-viewport {
    overflow: hidden;
    width: 100%;
}

/* 轨道：flex 横向排列，JS 通过 transform 控制滚动位置 */
.gallery-track {
    display: flex;
    align-items: stretch;
    gap: 18px;
    transition: transform .55s cubic-bezier(.25, .8, .3, 1);
    will-change: transform;
}

/* 单个图片项：电脑端每屏 3 张（(100% - 两个间距) / 3） */
.gallery-slide {
    flex: 0 0 calc((100% - 36px) / 3);
    display: flex;
    flex-direction: column;
}

.gallery-slide img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform .4s ease, box-shadow .4s ease;
}

/* hover：图片放大 + 浮起阴影（移动端无 hover，不影响浏览） */
.gallery-slide:hover img {
    transform: scale(1.05);
    box-shadow: 0 10px 24px rgba(120, 40, 20, .25);
}

/* 图片下方说明文字 */
.slide-caption {
    margin-top: 12px;
    font-size: 14px;
    color: #7a5a3c;
    text-align: center;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 图文卡片式轮播（说明为多行卡片样式） */
.card-slide {
    background: #fff;
    border: 1px solid #f0ddc8;
    border-radius: 4px;
    padding-bottom: 14px;
    overflow: hidden;
    transition: transform .35s ease, box-shadow .35s ease;
}

.card-slide:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 26px rgba(160, 70, 30, .18);
}

.card-slide img {
    height: 168px;
    border-radius: 0;
}

.card-slide:hover img {
    transform: none;
    box-shadow: none;
}

.card-caption {
    padding: 12px 14px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    white-space: normal;
}

.card-caption strong {
    font-size: 15px;
    color: #c0392b;
    letter-spacing: .5px;
}

.card-caption span {
    font-size: 13px;
    line-height: 1.7;
    color: #8a7a66;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 左右切换箭头 */
.gallery-arrow {
    position: absolute;
    top: 27%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(206, 52, 32, .85);
    color: #fff;
    font-size: 18px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    z-index: 5;
    opacity: .65;
    transition: opacity .25s ease, background .25s ease, transform .25s ease;
}

.gallery-arrow.prev { left: 10px; }
.gallery-arrow.next { right: 10px; }

.gallery-arrow:hover {
    opacity: 1;
    background: #ce3420;
    transform: translateY(-50%) scale(1.12);
}

/* 禁用态箭头 */
.gallery-arrow.disabled {
    opacity: .25;
    cursor: not-allowed;
}

/* 指示点容器 */
.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
    margin-bottom: 20px;
}

.gallery-dots .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e3c8ae;
    cursor: pointer;
    transition: all .3s ease;
}

.gallery-dots .dot.active {
    width: 26px;
    border-radius: 5px;
    background: #ce3420;
}

/* ================================================================
   5. 图文条目（左图右文）
   ================================================================ */
.news-row {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 26px;
    background: rgba(255, 255, 255, .82);
    border: 1px solid #f2e2cf;
    border-radius: 6px;
    transition: box-shadow .3s ease, transform .3s ease;
}

.news-row:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(170, 90, 40, .14);
}

.news-thumb {
    position: relative; /* 作为标题条的定位容器 */
    flex: 0 0 300px;
    overflow: hidden;
    border-radius: 4px;
    line-height: 0;
}

.news-thumb img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    transition: transform .45s ease;
}

.news-thumb:hover img {
    transform: scale(1.06);
}

/* 图片标题条：叠加在图片底部，政务网页常见样式 */
.thumb-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.5; /* 覆盖父级 line-height:0，保证文字正常显示 */
    color: #fff;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: linear-gradient(180deg, rgba(60, 30, 10, 0) 0%, rgba(60, 30, 10, .82) 100%);
    transition: background .3s ease;
    text-align: center;
}

.news-body {
    flex: 1;
    min-width: 0; /* 防止 flex 子项内容撑破容器 */
    display: flex;
    flex-direction: column;
}

.news-title {
    font-size: 19px;
    font-weight: bold;
    line-height: 1.5;
    margin-bottom: 12px;
}

.news-title a {
    color: #b5331f;
}

.news-title a:hover {
    color: #e06b2a;
    text-decoration: underline;
}

.news-text {
    flex: 1;
    font-size: 14.5px;
    line-height: 2;
    color: #665440;
    text-indent: 2em;
    text-align: justify;
    display: -webkit-box;

    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #e6d3bc;
    font-size: 13px;
    color: #a08d76;
    display: flex;
    gap: 26px;
}

/* ================================================================
   6. 特色图文（双图 + 文字，可左右翻转）
   ================================================================ */
.feature-row {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 26px;
    background: rgba(255, 255, 255, .82);
    border: 1px solid #f2e2cf;
    border-radius: 6px;
    transition: box-shadow .3s ease, transform .3s ease;
}

.feature-row:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(170, 90, 40, .14);
}

/* 反向排列：文字居左、图片居右 */
.feature-row.reverse {
    flex-direction: row-reverse;
}

.feature-imgs {
    flex: 0 0 700px;
    display: flex;
    flex-direction: row; /* 双图左右并排展示 */
    gap: 14px;
}

.feature-imgs a {
    flex: 1; /* 两图均分宽度 */
    display: block;
    overflow: hidden;
    border-radius: 4px;
    line-height: 0;
}

.feature-imgs img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform .45s ease;
}

.feature-imgs a:hover img {
    transform: scale(1.06);
}

.feature-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ================================================================
   7. 页脚
   ================================================================ */
.footer {
    background: linear-gradient(180deg, #0f7fc4 0%, #0a5f99 100%);
    color: rgba(255, 255, 255, .92);
    text-align: center;
    padding: 30px 20px;
    font-size: 14px;
    line-height: 2;
}

.footer-host {
    letter-spacing: 1px;
}

.footer-copy {
    font-size: 13px;
    opacity: .75;
}

/* ================================================================
   8. 返回顶部
   ================================================================ */
.back-top {
    position: fixed;
    right: 26px;
    bottom: 60px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(43, 191, 197, .88);
    color: #fff;
    font-size: 20px;
    text-align: center;
    line-height: 42px;
    transform: rotate(90deg); /* 右向箭头旋为上向 */
    opacity: 0;
    visibility: hidden;
    z-index: 99;
    box-shadow: 0 6px 18px rgba(18, 53, 69, 0.35);
    transition: opacity .3s ease, visibility .3s ease, background .3s ease, transform .3s ease;
}

.back-top.show {
    opacity: 1;
    visibility: visible;m
}

.back-top:hover {
    background: #ff8025;
    transform: rotate(90deg) scale(1.12);
}

/* ================================================================
   9. 响应式适配（电脑端优先，向下兼容平板 / 手机）
   ================================================================ */

/* ---- 平板：每屏 2 张图 ---- */
@media screen and (max-width: 1024px) {
    .gallery-slide {
        flex-basis: calc((100% - 18px) / 2);
    }

    .gallery-slide img {
        height: 180px;
    }

    .card-slide img {
        height: 150px;
    }
}

/* ---- 手机端：每屏 1 张图，图文上下排列 ---- */
@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 0 14px;
    }

    .section {
        padding: 44px 0;
    }

    .section-head {
        margin-bottom: 22px;
    }

    .section-head img {
        width: 92%;
    }

    .intro,
    .body-text {
        font-size: 14.5px;
        line-height: 2;
        margin-bottom: 26px;
    }

    /* 轮播：单图铺满，缩小内边距，箭头内嵌 */
    .scroll-gallery {
        padding: 14px 14px 20px;
        margin: 30px auto;
    }

    .gallery-track {
        gap: 0; /* 单图模式无需间距 */
    }

    .gallery-slide {
        flex-basis: 100%;
    }

    .gallery-slide img {
        height: 210px;
    }

    .card-slide img {
        height: 180px;
    }

    .gallery-arrow {
        width: 34px;
        height: 34px;
        line-height: 34px;
        font-size: 15px;
        background: rgba(206, 52, 32, .7);
    }

    .gallery-arrow.prev { left: 6px; }
    .gallery-arrow.next { right: 6px; }

    /* 图文条目改为上下结构 */
    .news-row,
    .feature-row,
    .feature-row.reverse {
        flex-direction: column;
        gap: 18px;
        padding: 18px;
        margin-top: 26px;
    }

    .news-thumb,
    .feature-imgs {
        flex: none;
        width: 100%;
    }

    .news-thumb img {
        height: 200px;
    }

    /* 移动端标题条字号微调 */
    .thumb-caption {
        font-size: 13px;
        padding: 6px 10px;
    }

    .feature-imgs a {
        flex: 1;
    }

    .feature-imgs img {
        height: 100px;
    }

    .news-title {
        font-size: 17px;
    }

    .news-meta {
        flex-wrap: wrap;
        gap: 6px 20px;
    }

    .footer {
        font-size: 13px;
        padding: 24px 16px;
    }

    .back-top {
        right: 16px;
        bottom: 36px;
        width: 40px;
        height: 40px;
        line-height: 36px;
    }
}

/* ---- 超小屏手机微调 ---- */
@media screen and (max-width: 380px) {
    .gallery-slide img {
        height: 180px;
    }

    .news-thumb img {
        height: 170px;
    }
}
