/* ============================================================
   专题页「城市卡片」（学区房源 / 投资房源 / 宜居房源）
   统一图片与卡片规格：桌面 4 列，移动 1 列
   必须在 /bjjg/country_homepage.css 之后加载
   ============================================================ */

.yl-hs_xuequlist,
.yl-hs_touzilist,
.yl-hs_yijulist {
    display: flex !important;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 22px 24px;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.yl-hs_xuequlist > li,
.yl-hs_touzilist > li,
.yl-hs_yijulist > li,
.yl-hs_xuequlist > .nw_left,
.yl-hs_touzilist > .nw_left,
.yl-hs_yijulist > .nw_left {
    float: none !important;
    display: block !important;
    width: calc(25% - 18px) !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .09);
}

.yl-hs_xuequlist > li > a,
.yl-hs_touzilist > li > a,
.yl-hs_yijulist > li > a,
.yl-hs_xuequlist > .nw_left > a,
.yl-hs_touzilist > .nw_left > a,
.yl-hs_yijulist > .nw_left > a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    position: relative;
}

/* ------------------------------------------------------------
   区域 tab 切换（美国东部/中部/西部 等）
   tab 脚本写的是内联 display:none，会被上面的 flex !important 压掉，
   这里用属性选择器 + 更高优先级把隐藏态重新生效；
   激活态脚本写 display:block，不匹配该选择器，仍保持 flex 四列。
   ------------------------------------------------------------ */
.yl-hs_touzilist[style*="none"],
.yl-hs_xuequlist[style*="none"],
.yl-hs_yijulist[style*="none"] {
    display: none !important;
}

/* 卡片规格统一 */
.yl-hs_xuequlist img,
.yl-hs_touzilist img,
.yl-hs_yijulist img {
    display: block !important;
    width: 100% !important;
    height: 190px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    object-fit: cover;
    object-position: center;
}

/* 浮层标题条保持贴底 */
.yl-hs_xuequlist .nw_share,
.yl-hs_touzilist .nw_share,
.yl-hs_yijulist .nw_share {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    background: rgba(28, 28, 30, .55) !important;
    filter: none !important;
}

/* 标题文字完整显示，不再被浮层高度裁掉 */
.yl-hs_xuequlist .nw_share span,
.yl-hs_touzilist .nw_share span,
.yl-hs_yijulist .nw_share span {
    height: auto !important;
    line-height: 36px !important;
    margin: 0 8px !important;
    border-bottom: 0 !important;
    font-size: 15px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .yl-hs_xuequlist,
    .yl-hs_touzilist,
    .yl-hs_yijulist {
        display: block !important;
        gap: 0;
    }

    .yl-hs_xuequlist > li,
    .yl-hs_touzilist > li,
    .yl-hs_yijulist > li,
    .yl-hs_xuequlist > .nw_left,
    .yl-hs_touzilist > .nw_left,
    .yl-hs_yijulist > .nw_left {
        width: 100% !important;
        margin: 0 0 14px 0 !important;
    }

    .yl-hs_xuequlist img,
    .yl-hs_touzilist img,
    .yl-hs_yijulist img {
        height: 200px !important;
    }
}
