@charset "utf-8";
.xyfg2-main {
    --xyfg2-red: #8C1015;
    /* 页签选中底 / 主红 */
    --xyfg2-red-2: #A62B2A;
    /* 云纹条兜底色（xrldlibg.png 加载前的过渡色） */
    --xyfg2-arm: 60px;
    /* 左侧红竖臂宽 = 版心 - 大图 */
    --xyfg2-hero-w: calc(var(--w) - var(--xyfg2-arm));
    /* 大图 2:1 → 1440×720；高度不存变量，见 .xyfg2-hero-view 的 padding-top:50% */
    --xyfg2-cap-w: 1170px;
    /* 标题条 / 红横臂宽（= 大图 1440 − 右侧留给按钮的 210 − 竖臂 60）；
       版心 1500 时正好 1170；≤1560 改流式，见第 5 节 */
    --xyfg2-cap-h: 118px;
    --xyfg2-thumb-w: 350px;
    /* 4×350 + 3×33 = 1499 ≈ 版心 1500；≤1560 改流式 */
    --xyfg2-thumb-h: 300px;
    --xyfg2-gap: 33px;

    position: relative;
    width: var(--w);
    margin: 0 auto;
    padding-bottom: 50px;
}

/* --------------------------------------------------------------------------
   1. 校区页签
   -------------------------------------------------------------------------- */
.xyfg2-tabs {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.xyfg2-tabs a {
    display: block;
    height: 46px;
    padding: 0 34px;
    line-height: 44px;
    /* -2 是上下两条 1px 边框，让盒子总高仍是 46 */
    font-size: 17px;
    text-align: center;
    white-space: nowrap;
    text-decoration: none;
    color: var(--xyfg2-red);
    background: #fff;
    border: 1px solid #E7C6C4;
    border-radius: 23px;
    transition: background-color .3s, border-color .3s, color .3s;
}

.xyfg2-tabs a:hover {
    border-color: var(--xyfg2-red);
}

.xyfg2-tabs a.on {
    color: #fff;
    background: var(--xyfg2-red);
    border-color: var(--xyfg2-red);
}

/* --------------------------------------------------------------------------
   2. 轮播舞台
   -------------------------------------------------------------------------- */
.xyfg2-hero {
    position: relative;
    /* 大图 1440 靠右 → 左侧 60 的空间留给红竖臂 */
    width: var(--xyfg2-hero-w);
    /* ⚠ 高度不能写百分比：≤1560 时 --w 已经是 100%，而这个 100% 挂在 auto 高度的
       .xyfg2-main 上，百分比高度会直接算成 0（1400/1100/820 宽实测大图高 0px）。
       2:1 交给下面 .xyfg2-hero-view 的 padding-top:50% 撑，任何宽度都成立。 */
    margin: 50px 0 0 auto;
}

/* 2.1 L 形红块：普通矩形，被大图盖住右上部分后只剩「竖臂 + 横臂」 */
.xyfg2-frame {
    position: absolute;
    left: calc(var(--xyfg2-arm) * -1);
    top: 70%;
    bottom: calc(var(--xyfg2-cap-h) * -1);
    width: calc(var(--xyfg2-cap-w) + var(--xyfg2-arm));
    z-index: 0;
    background: var(--xyfg2-red-2) url("../images/xrldlibg.png") repeat;
}

/* 2.2 大图舞台：底部两角 40 圆角（用户指定），左下圆角透出红块
   ⚠ 高度用 padding-top:50% 撑（百分比 padding 按「包含块宽度」算，宽度是确定的），
     不要写 height —— 绝对定位的子项会以 padding box 为包含块，height:100% 仍然拿得到 720。 */
.xyfg2-hero-view {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 0;
    padding-top: 50%;
    overflow: hidden;
    border-radius: 40px;
    background: #EDEAE6;
    /* 图未到位时的占位色 */
}

/* 空态 / 加载态：铺满大图区（大图是 padding-top 撑高的，内容区高度为 0，
   所以必须绝对定位到 padding box，否则文字会被 overflow:hidden 裁掉） */
.xyfg2-empty {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #8C8C8C;
    background: #EDEAE6;
}

.xyfg2-slide {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity .55s ease, visibility .55s;
}

.xyfg2-slide.on {
    opacity: 1;
    visibility: visible;
}

.xyfg2-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 任意原图都铺满、不变形 */
}

/* 2.3 标题条：与 L 形横臂完全重合，只负责排字与箭头 */
.xyfg2-hero-cap {
    position: absolute;
    left: calc(var(--xyfg2-arm) * -1);
    bottom: calc(var(--xyfg2-cap-h) * -1);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: var(--xyfg2-cap-w);
    height: var(--xyfg2-cap-h);
    /* 左内距 48：设计稿量到「文字距红条左沿 40~64」两个读数（整页图 64、局部图 40），取中 */
    padding: 0 48px;
    text-decoration: none;
}

.xyfg2-cap-txt {
    font-size: 18px;
    line-height: 1.5;
    color: #fff;
    /* 标题过长时单行省略 —— 标题条高度是按单行排版的 */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding-right: 30px;
}

.xyfg2-cap-arrow {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    opacity: 1;
    transition: opacity .3s;
}

.xyfg2-cap-arrow img {
    display: block;
    width: 100%;
    height: 100%;
}

/* 标题条整体可点（文字与箭头同属一个 <a>），hover 时箭头略暗提示可点
   ⚠ 用户要求「鼠标移入按钮给 0.7 透明度」，那条只针对左右切换按钮（见 3.1）；
     这里给 0.8 只是可点性提示，别混为一谈。 */
.xyfg2-hero-cap:hover .xyfg2-cap-arrow {
    opacity: .8;
}

/* --------------------------------------------------------------------------
   3. 左右切换按钮
   -------------------------------------------------------------------------- */
.xyfg2-ctrl {
    position: absolute;
    /* 大图右下：距大图底 29（设计稿实测），右沿与版心齐平 */
    top: calc(100% + 29px);
    right: 0;
    display: flex;
    gap: 48px;
    z-index: 3;
}

.xyfg2-btn {
    display: block;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.xyfg2-btn img {
    display: block;
    width: 100%;
    height: 100%;
    /* 3.1 鼠标移入 → 透明度 0.7（用户指定） */
    transition: opacity .3s;
}

.xyfg2-btn:hover img,
.xyfg2-btn:focus-visible img {
    opacity: .7;
}

/* --------------------------------------------------------------------------
   4. 缩略图
   -------------------------------------------------------------------------- */
.xyfg2-thumbs {
    position: relative;
    /* 让开 L 形横臂（118）后再空 76，落到缩略图顶（设计稿实测 194） */
    margin-top: calc(var(--xyfg2-cap-h) + 76px);
    overflow: hidden;
}

.xyfg2-thumb-track {
    display: flex;
    gap: var(--xyfg2-gap);
    margin: 0;
    padding: 0;
    list-style: none;
    transition: transform .5s ease;
    will-change: transform;
}

.xyfg2-thumb-track li {
    flex: 0 0 var(--xyfg2-thumb-w);
    width: var(--xyfg2-thumb-w);
    height: var(--xyfg2-thumb-h);
}

.xyfg2-thumb {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #EDEAE6;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.xyfg2-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

/* 底部压暗：保证白色标题在任何照片上都读得清（同 xyfg 旧版的做法） */
.xyfg2-thumb::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 62%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .72) 100%);
    pointer-events: none;
}

.xyfg2-thumb-txt {
    position: absolute;
    left: 16px;
    right: 60px;
    bottom: 14px;
    z-index: 1;
    display: -webkit-box;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.5;
    color: #fff;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.xyfg2-thumb-arrow {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 1;
    width: 32px;
    height: 32px;
    opacity: .95;
    transition: opacity .3s;
}

.xyfg2-thumb-arrow img {
    display: block;
    width: 100%;
    height: 100%;
}

/* 当前项：整图轻微放大 + 描一圈红边提示「这就是大图那张」
   ⚠ 描边用 inset box-shadow，不能用 border —— 350×300 是定值，border 会撑破格子。 */
.xyfg2-thumb.is-on {
    box-shadow: inset 0 0 0 3px var(--xyfg2-red);
}

.xyfg2-thumb:hover img {
    transform: scale(1.05);
}

.xyfg2-thumb.is-on img {
    transform: scale(1.02);
}

/* --------------------------------------------------------------------------
   5. 响应式
   断点与全站一致：1560 / 1220 / 768。
   本页主体是按 1500 设计稿做的固定尺寸，1560/1220 两档只收一收间距，
   真正重排放在 ≤768。
   -------------------------------------------------------------------------- */
@media (max-width: 1560px) {
    .xyfg2-main {
        padding: 50px 0 100px;

        /* ≤1560 时 .list-page 的 --w 已经是 100%（流式），版心不再是 1500，
           1170 / 350 这两个定值会让横臂和缩略图顶出版心，这里跟着改比例：
           标题条 = 大图 − 270（左竖臂 60 + 右侧按钮区 210 保持不变）；
           缩略图 = (100% − 3 个列距) / 4，永远一屏 4 张、不裁第 5 张 */
        --xyfg2-cap-w: calc(100% - 270px);
        --xyfg2-thumb-w: calc((100% - 3 * var(--xyfg2-gap)) / 4);
    }

    .xyfg2-hero {
        margin-top: 42px;
    }

    .xyfg2-thumbs {
        margin-top: calc(var(--xyfg2-cap-h) + 60px);
    }
}

@media (max-width: 1220px) {
    .xyfg2-tabs a {
        height: 42px;
        padding: 0 26px;
        line-height: 40px;
        font-size: 16px;
    }

    .xyfg2-main {
        --xyfg2-cap-h: 102px;
        --xyfg2-gap: 24px;
    }

    .xyfg2-cap-txt {
        font-size: 17px;
    }

    .xyfg2-cap-arrow {
        width: 48px;
        height: 48px;
    }

    .xyfg2-btn {
        width: 42px;
        height: 42px;
    }

    .xyfg2-ctrl {
        gap: 36px;
    }
}

/* ≤768：单列 —— 竖臂收掉（大图整宽），标题条整宽，缩略图每屏 2 张（JS 同步 perPage=2） */
@media (max-width: 768px) {
    .xyfg2-main {
        --xyfg2-arm: 0px;
        --xyfg2-cap-w: 100%;
        --xyfg2-cap-h: 88px;
        --xyfg2-thumb-w: calc((100% - 24px) / 2);
        --xyfg2-thumb-h: 150px;
        --xyfg2-gap: 24px;

        padding: 34px 16px 60px;
    }

    .xyfg2-tabs {
        gap: 12px;
        justify-content: space-between;
    }

    .xyfg2-tabs a {
        flex: 1 1 0;
        height: 40px;
        padding: 0 8px;
        line-height: 38px;
        font-size: 15px;
    }

    /* 竖屏单列：hero 改成纵向流 —— 大图 → 红标题条 → 左右按钮。
       ⚠ 别再让 ctrl 绝对定位：它一旦回到文档流会把 hero 撑高，
         而 cap 还是按 bottom:-cap-h 定位，就会和 thumbs 叠在一起（390 宽实测重叠 68px）。 */
    .xyfg2-hero {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: auto;
        margin-top: 26px;
    }

    /* 窄屏没有「左侧竖臂」可言，L 形红块直接不画，红底交给标题条自己 */
    .xyfg2-frame {
        display: none;
    }

    /* 大图 2:1 由 padding-top 撑高（高度不能再用 --xyfg2-hero-h，那是 1440 的） */
    .xyfg2-hero-view {
        height: 0;
        padding-top: 50%;
        border-radius: 0 0 24px 24px;
    }

    .xyfg2-hero-cap {
        position: static;
        width: 100%;
        height: var(--xyfg2-cap-h);
        padding: 0 16px;
        background: var(--xyfg2-red-2) url("../images/xrldlibg.png") repeat;
    }

    .xyfg2-cap-txt {
        font-size: 15px;
        padding-right: 12px;
    }

    .xyfg2-cap-arrow {
        width: 38px;
        height: 38px;
    }

    .xyfg2-ctrl {
        position: static;
        margin-top: 16px;
        gap: 20px;
        justify-content: flex-end;
    }

    .xyfg2-btn {
        width: 38px;
        height: 38px;
    }

    .xyfg2-thumbs {
        margin-top: 20px;
    }

    .xyfg2-thumb-txt {
        left: 10px;
        right: 44px;
        bottom: 10px;
        font-size: 12px;
    }

    .xyfg2-thumb-arrow {
        right: 8px;
        bottom: 8px;
        width: 24px;
        height: 24px;
    }

    .xyfg2-thumb.is-on {
        box-shadow: inset 0 0 0 2px var(--xyfg2-red);
    }
}
