/* 模板广告位通用样式（全站统一引用）
 * 1) 未投放/内容为空的广告位不占位，避免预留广告位留下空白间距；
 * 2) 右侧栏图片广告固定在栏宽容器内，图片按容器宽度缩放，不把侧栏撑变形；
 * 3) 文字链接广告统一行内排布，长链接自动换行。 */
.tpl-ad-top,
.tpl-ad-side,
.tpl-ad-foot,
.tpl-ad-link {
    box-sizing: border-box;
}

.tpl-ad-top {
    max-width: 100%;
    margin: 12px auto;
    text-align: center;
    overflow: hidden;
}

.tpl-ad-top img {
    max-width: 100%;
    height: auto;
}

.tpl-ad-side {
    width: 100%;
    max-width: 100%;
    margin: 0 0 12px;
    overflow: hidden;
    text-align: center;
}

.tpl-ad-side img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.tpl-ad-foot {
    margin: 8px 0;
}

.tpl-ad-link {
    font-size: 13px;
    line-height: 1.8;
    word-break: break-all;
}

.tpl-ad-link a,
.tpl-ad-foot a {
    margin-right: 8px;
}

.tpl-ad-top:empty,
.tpl-ad-side:empty,
.tpl-ad-foot:empty,
.tpl-ad-link:empty {
    display: none;
}

/* 各模板既有横幅容器：广告未启用时不留空白 */
.geo-ad:empty,
.qy-ad:empty,
.qh-ad:empty,
.rz-ad:empty,
.ra-ad:empty,
.sk-ad:empty,
.gs1-ad:empty,
.et-ad:empty,
.cp-ad:empty,
.lg-ad:empty,
.th-ad:empty,
.gn-ad:empty,
.ggsy_1:empty,
.gglb_1:empty,
.ggwz_1:empty,
.ggwz_2:empty {
    display: none;
}

/* 既有横幅内的图片不溢出内容区 */
.geo-ad img,
.qy-ad img,
.qh-ad img,
.rz-ad img,
.ra-ad img,
.sk-ad img,
.gs1-ad img,
.et-ad img,
.cp-ad img,
.lg-ad img,
.th-ad img,
.gn-ad img,
.ggsy_1 img,
.gglb_1 img,
.ggwz_1 img,
.ggwz_2 img {
    max-width: 100%;
    height: auto;
}
