/*
 * Paid ad slots (inc/paid-ads.php): HOME_TOP row of three cards on the homepage,
 * DETAIL_PAGE carousel on broker detail, NEWS_SIDEBAR rail on news pages.
 * Each slot takes the section language of the page it sits on, so it reads as
 * part of that page: a quiet homepage band, a broker-detail module card
 * (.fxm-mod-card / .fxm-news-card), an open news-sidebar block headed like
 * 市场快讯 (.fxm-news-flash-sidebar). It stays plainly sponsored: the label and
 * note, the "Ad" tag on every creative and the landing host before the click.
 */
.fxm-paid-ads {
	--pa-ink: var(--home-ink, #243044);
	--pa-muted: #667085;
	--pa-line: #ececf5;
	--pa-primary: var(--color-primary, #4f34d9);
	--pa-interval: 6s;
	font-family: var(--font-family-body);
}
.fxm-paid-ads__inner { min-width: 0; }

/* Head: icon (variant-dependent), title, sponsored note, optional controls. */
.fxm-paid-ads__head { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: 1rem; }
.fxm-paid-ads__icon { display: flex; flex: none; align-items: center; justify-content: center; color: var(--pa-primary); }
.fxm-paid-ads__heading { min-width: 0; }
.fxm-paid-ads .fxm-paid-ads__title { margin: 0; color: var(--pa-ink); font-family: var(--font-family-heading); font-size: 1.375rem; font-weight: 600; line-height: 1.4; letter-spacing: 0; }
.fxm-paid-ads .fxm-paid-ads__note { margin: .35rem 0 0; color: var(--pa-muted); font-size: 13px; font-weight: 400; line-height: 1.6; letter-spacing: 0; }
.fxm-paid-ads__list { display: grid; gap: 1.25rem; }

/* Card: the creative with its "Ad" tag, then title, landing host and CTA. */
.fxm-paid-ad { position: relative; display: flex; flex-direction: column; min-width: 0; color: inherit; text-decoration: none; cursor: pointer; }
.fxm-paid-ad:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 4px; border-radius: 12px; }
.fxm-paid-ad__backdrop { display: none; }
.fxm-paid-ad__media { position: relative; display: block; flex: none; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: #f3f2fb; }
/* Hairline over the creative edge, so a white or a loud creative still sits inside the page. */
.fxm-paid-ad__media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(36, 48, 68, .07); pointer-events: none; }
.fxm-paid-ad__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.fxm-paid-ad:hover .fxm-paid-ad__media img { transform: scale(1.025); }
/* Same badge as the "Ad" mark on the recommended brokers list (.fxm-home-ad). */
.fxm-paid-ad__tag { position: absolute; top: 8px; left: 8px; z-index: 1; padding: 0 6px; border: 1px solid #d5d9e6; border-radius: 4px; background: rgba(243, 244, 248, .94); color: #586078; font-size: 11px; line-height: 18px; letter-spacing: .02em; white-space: nowrap; }
.fxm-paid-ad__body { display: flex; flex: 1; flex-direction: column; gap: .45rem; min-width: 0; padding-top: .8rem; }
.fxm-paid-ad__title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--pa-ink); font-family: var(--font-family-heading); font-size: 15px; font-weight: 600; line-height: 1.5; transition: color .2s ease; }
.fxm-paid-ad:hover .fxm-paid-ad__title { color: var(--pa-primary); }
.fxm-paid-ad__meta { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: auto; font-size: 12px; line-height: 1.5; }
.fxm-paid-ad__host { min-width: 0; overflow: hidden; color: var(--pa-muted); text-overflow: ellipsis; white-space: nowrap; }
.fxm-paid-ad__cta { display: inline-flex; flex: none; align-items: center; gap: .3rem; color: var(--pa-primary); font-size: 13px; font-weight: 500; }
.fxm-paid-ad__cta svg { transition: transform .25s ease; }
.fxm-paid-ad:hover .fxm-paid-ad__cta { text-decoration: underline; text-underline-offset: 4px; }
.fxm-paid-ad:hover .fxm-paid-ad__cta svg { transform: translate(2px, -2px); }

/* ---------- HOME_TOP: a slim banner carousel under the hero, on the board grid width ----------
 * One band (--pa-band tall). The creative is a 16:9 thumbnail; the same image, blurred and washed
 * out, fills the rest of the band, so a wide band never crops or stretches the creative. The label,
 * the controls and the progress tabs are laid over the band (same grid cell as the track). */
.fxm-paid-ads--carousel {
	--pa-band: 148px;
	--pa-pad: 14px;
	--pa-thumb: calc((var(--pa-band) - 2 * var(--pa-pad)) * 16 / 9);
	--pa-text-x: calc(var(--pa-pad) + var(--pa-thumb) + 22px);
	padding: 0 2rem 1.5rem;
	background: #f7f6ff;
}
.fxm-paid-ads--carousel .fxm-paid-ads__inner { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); max-width: 1180px; margin-inline: auto; overflow: hidden; border: 1px solid #e6e9f5; border-radius: 12px; background: #fff; box-shadow: 0 4px 18px #25286003; }
.fxm-paid-ads--carousel .fxm-paid-ads__inner > * { grid-area: 1 / 1; min-width: 0; }
.fxm-paid-ads--carousel .fxm-paid-carousel__track { z-index: 1; }

/* Label row: "合作推广 · note" on one line, over the text column; clicks fall through to the slide. */
.fxm-paid-ads--carousel .fxm-paid-ads__head { z-index: 2; align-self: start; align-items: center; gap: .75rem; margin: 0; padding: 12px 12px 0 var(--pa-text-x); pointer-events: none; }
.fxm-paid-ads--carousel .fxm-paid-ads__icon { display: none; }
.fxm-paid-ads--carousel .fxm-paid-ads__heading { display: flex; flex: 1; align-items: baseline; gap: .5rem; min-width: 0; overflow: hidden; white-space: nowrap; }
.fxm-paid-ads--carousel .fxm-paid-ads__title { flex: none; color: #4b586c; font-size: 12.5px; font-weight: 600; line-height: 1.5; letter-spacing: .04em; }
.fxm-paid-ads--carousel .fxm-paid-ads__note { min-width: 0; margin: 0; overflow: hidden; color: #6b7487; font-size: 12px; line-height: 1.5; text-overflow: ellipsis; }
.fxm-paid-ads--carousel .fxm-paid-ads__note::before { content: "·"; margin-right: .5rem; color: #a3a9b8; }

/* Controls: counter, pause / play, previous, next. The script unhides them. */
.fxm-paid-carousel__nav { display: flex; flex: none; align-items: center; gap: .375rem; pointer-events: auto; }
.fxm-paid-carousel__nav[hidden],
.fxm-paid-carousel__btn[hidden],
.fxm-paid-carousel__tabs[hidden] { display: none; }
.fxm-paid-carousel__count { display: inline-flex; align-items: baseline; gap: .2rem; margin-right: .3rem; color: #6b7487; font-family: var(--home-numeric, "Segoe UI"), var(--font-family-body); font-size: 12px; font-variant-numeric: tabular-nums; }
.fxm-paid-carousel__count b { color: var(--pa-ink); font-size: 13px; font-weight: 600; }
.fxm-paid-carousel__btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 1.875rem; height: 1.875rem; padding: 0; border: 1px solid rgba(226, 229, 240, .95); border-radius: 999px; background: rgba(255, 255, 255, .9); color: #4b586c; cursor: pointer; transition: color .15s ease, border-color .15s ease, background-color .15s ease; }
.fxm-paid-carousel__btn svg { width: 15px; height: 15px; }
.fxm-paid-carousel__btn:hover { border-color: rgba(79, 52, 217, .32); background: #fff; color: var(--pa-primary); }
.fxm-paid-carousel__btn:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }
.fxm-paid-carousel__pause,
.fxm-paid-carousel__play { display: inline-flex; }
.fxm-paid-carousel__toggle .fxm-paid-carousel__play,
.fxm-paid-carousel__toggle[aria-pressed="true"] .fxm-paid-carousel__pause { display: none; }
.fxm-paid-carousel__toggle[aria-pressed="true"] .fxm-paid-carousel__play { display: inline-flex; }

/* Track: one slide per view; scroll-snap lands a swipe on a slide. */
.fxm-paid-ads .fxm-paid-carousel__track { display: flex; gap: 0; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; }
.fxm-paid-ads.is-ready .fxm-paid-carousel__track { scrollbar-width: none; }
.fxm-paid-ads.is-ready .fxm-paid-carousel__track::-webkit-scrollbar { display: none; }
.fxm-paid-carousel__slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; }
/* A jump (far tab, last → first) cuts to the slide and fades it in instead of sweeping past the others. */
.fxm-paid-carousel__slide.is-cut { animation: fxm-pa-cut .4s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes fxm-pa-cut { from { opacity: .3; } to { opacity: 1; } }

/* Slide: blurred creative behind a light wash, thumbnail left, copy and CTA right. */
.fxm-paid-ads--carousel .fxm-paid-ad { isolation: isolate; flex-direction: row; align-items: center; gap: 22px; height: var(--pa-band); padding: var(--pa-pad); overflow: hidden; background: #f7f6fd; }
.fxm-paid-ads--carousel .fxm-paid-ad:focus-visible { outline-offset: -3px; border-radius: 12px; }
/* The creative's background side (left) is the calmest part to stretch across the band. */
.fxm-paid-ads--carousel .fxm-paid-ad__backdrop { position: absolute; inset: -40px; z-index: -2; display: block; width: calc(100% + 80px); height: calc(100% + 80px); max-width: none; object-fit: cover; object-position: 12% 50%; filter: blur(34px) saturate(1.2); opacity: .75; }
.fxm-paid-ads--carousel .fxm-paid-ad::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .8) calc(var(--pa-text-x) + 40px), rgba(255, 255, 255, .9) 100%); pointer-events: none; }
.fxm-paid-ads--carousel .fxm-paid-ad__media { width: var(--pa-thumb); height: calc(var(--pa-band) - 2 * var(--pa-pad)); border-radius: 9px; box-shadow: 0 10px 22px -14px rgba(20, 24, 40, .55); }
/* On a thumbnail the top-left corner is usually the advertiser's logo: the tag moves to the right. */
.fxm-paid-ads--carousel .fxm-paid-ad__tag { top: 6px; right: 6px; left: auto; padding: 0 5px; font-size: 10px; line-height: 16px; }
.fxm-paid-ads--carousel .fxm-paid-ad__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center; gap: .3rem 1.5rem; height: 100%; padding: 22px 4px 14px 0; }
.fxm-paid-ads--carousel .fxm-paid-ad__title { grid-column: 1; grid-row: 1; -webkit-line-clamp: 1; font-size: 17px; line-height: 1.45; }
.fxm-paid-ads--carousel .fxm-paid-ad__meta { display: contents; }
.fxm-paid-ads--carousel .fxm-paid-ad__host { grid-column: 1; grid-row: 2; font-size: 12.5px; }
.fxm-paid-ads--carousel .fxm-paid-ad__cta { grid-column: 2; grid-row: 1 / span 2; align-self: center; gap: .35rem; min-height: 2.25rem; padding: 0 1rem; border-radius: 999px; background: var(--pa-primary); color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 10px 20px -14px rgba(79, 52, 217, .8); transition: background-color .2s ease; }
.fxm-paid-ads--carousel .fxm-paid-ad:hover .fxm-paid-ad__cta { background: #4129c4; text-decoration: none; }

/* Progress tabs: short bars at the foot of the copy; the current one fills over --pa-interval.
   The advertiser name is the button's accessible label (visually hidden) and its tooltip. */
.fxm-paid-carousel__tabs { z-index: 2; display: grid; grid-template-columns: repeat(var(--pa-count, 3), minmax(0, 1fr)); align-self: end; justify-self: start; gap: 6px; width: min(200px, 40%); margin: 0 0 6px var(--pa-text-x); }
.fxm-paid-carousel__tab { display: block; min-width: 0; padding: 8px 0; border: 0; background: transparent; cursor: pointer; }
.fxm-paid-carousel__tab:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 1px; border-radius: 3px; }
.fxm-paid-carousel__bar { position: relative; display: block; height: 3px; overflow: hidden; border-radius: 3px; background: rgba(36, 48, 68, .14); transition: background-color .15s ease; }
.fxm-paid-carousel__tab:hover .fxm-paid-carousel__bar { background: rgba(36, 48, 68, .24); }
.fxm-paid-carousel__bar i { position: absolute; inset: 0; border-radius: inherit; background: var(--pa-primary); transform: scaleX(0); transform-origin: left center; }
.fxm-paid-carousel__tab[data-state="done"] .fxm-paid-carousel__bar i { opacity: .3; transform: scaleX(1); }
.fxm-paid-carousel__tab[aria-current="true"] .fxm-paid-carousel__bar i { transform: scaleX(1); }
.fxm-paid-ads.is-playing .fxm-paid-carousel__tab[aria-current="true"] .fxm-paid-carousel__bar i { animation: fxm-pa-progress var(--pa-interval) linear both; }
.fxm-paid-ads.is-paused .fxm-paid-carousel__tab[aria-current="true"] .fxm-paid-carousel__bar i { animation-play-state: paused; }
.fxm-paid-carousel__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
@keyframes fxm-pa-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- HOME_TOP: one static row of three cards under the hero, no heading ----------
 * Same band, width and panel language as the board grid below (.fxm-home-panel): white cards,
 * a hairline border, 14px corners. Each card's "Ad" tag and the section's aria-label carry the
 * disclosure. Every card is visible at once, so nothing rotates and every impression is a card
 * the reader could see. Fewer than three ads keep the column width and centre. */
.fxm-paid-ads--grid {
	--pa-gap: 1.25rem;
	--pa-col: calc((100% - 2 * var(--pa-gap)) / 3);
	padding: 0 2rem 1.75rem;
	background: #f7f6ff;
}
.fxm-paid-ads--grid .fxm-paid-ads__inner { max-width: 1180px; margin-inline: auto; }
.fxm-paid-ads--grid .fxm-paid-ads__list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--pa-gap); }
.fxm-paid-ads--grid.is-count-1 .fxm-paid-ads__list,
.fxm-paid-ads--grid.is-count-2 .fxm-paid-ads__list { grid-template-columns: repeat(auto-fit, var(--pa-col)); justify-content: center; }
/* Card: the creative runs edge to edge across the top, "Ad" tag at its top-left; one title line; host and CTA. */
.fxm-paid-ads--grid .fxm-paid-ad { overflow: hidden; border: 1px solid #e7ebf0; border-radius: 14px; background: #fff; transition: border-color .2s ease, box-shadow .25s ease, transform .25s ease; }
.fxm-paid-ads--grid .fxm-paid-ad:hover { border-color: rgba(79, 52, 217, .28); box-shadow: 0 16px 30px -24px rgba(79, 52, 217, .55); transform: translateY(-2px); }
.fxm-paid-ads--grid .fxm-paid-ad:focus-visible { outline-offset: 3px; border-radius: 14px; }
.fxm-paid-ads--grid .fxm-paid-ad__media { border-radius: 0; }
.fxm-paid-ads--grid .fxm-paid-ad__media::after { box-shadow: inset 0 -1px 0 rgba(36, 48, 68, .06); }
.fxm-paid-ads--grid .fxm-paid-ad__body { gap: .5rem; padding: .75rem .875rem .875rem; }
.fxm-paid-ads--grid .fxm-paid-ad__title { -webkit-line-clamp: 1; font-size: 15px; }
.fxm-paid-ads--grid .fxm-paid-ad__meta { gap: .5rem; }
.fxm-paid-ads--grid .fxm-paid-ad__tag { top: 8px; left: 8px; right: auto; }
.fxm-paid-ads--grid .fxm-paid-ad__host { flex: 1; }

/* ---------- DETAIL_PAGE: a broker-detail module card; the ad row is a tinted inset like the card rows ---------- */
.fxm-paid-ads--inline .fxm-paid-ads__inner { padding: 18px; border-radius: 24px; background: #fff; box-shadow: 0 10px 28px -14px rgba(79, 52, 217, .16), 0 4px 12px -8px rgba(47, 38, 88, .08); }
.fxm-paid-ads--inline .fxm-paid-ads__head { align-items: center; gap: 12px; margin: 0; padding: 4px 2px 14px; }
.fxm-paid-ads--inline .fxm-paid-ads__icon { width: 36px; height: 36px; border-radius: 999px; background: #f3f0ff; }
.fxm-paid-ads--inline .fxm-paid-ads__icon svg { width: 18px; height: 18px; }
.fxm-paid-ads--inline .fxm-paid-ads__title { color: var(--color-on-surface, #272e42); font-size: 16px; font-weight: 700; line-height: 1.4; }
.fxm-paid-ads--inline .fxm-paid-ads__note { margin-top: 2px; color: rgba(47, 38, 88, .5); font-size: 12.5px; line-height: 1.5; }
.fxm-paid-ads--inline .fxm-paid-ad { flex-direction: row; align-items: center; gap: 22px; padding: 10px; border-radius: 18px; background: #f8f7fc; transition: background-color .2s ease; }
.fxm-paid-ads--inline .fxm-paid-ad:hover { background: #f3f0ff; }
.fxm-paid-ads--inline .fxm-paid-ad__media { width: min(42%, 400px); border-radius: 14px; }
.fxm-paid-ads--inline .fxm-paid-ad__body { justify-content: center; gap: 1rem; padding: 6px 14px 6px 0; }
.fxm-paid-ads--inline .fxm-paid-ad__title { -webkit-line-clamp: 3; color: var(--color-on-surface, #272e42); font-size: 18px; line-height: 1.45; }
.fxm-paid-ads--inline .fxm-paid-ad__meta { margin-top: 0; font-size: 13px; }
.fxm-paid-ads--inline .fxm-paid-ad__cta { padding: .4rem .9rem; border: 1px solid rgba(79, 52, 217, .22); border-radius: 999px; background: #fff; }
.fxm-paid-ads--inline .fxm-paid-ad:hover .fxm-paid-ad__cta { border-color: var(--pa-primary); text-decoration: none; }

/* PC detail: the same softly lit band, with controls for multiple booked ads.
 * The disclosure shares the copy column, instead of occupying a separate card header. */
@media (min-width: 768px) {
	.fxm-paid-ads--inline {
		--pa-band: 148px;
		--pa-pad: 14px;
		--pa-thumb: calc((var(--pa-band) - 2 * var(--pa-pad)) * 16 / 9);
		--pa-text-x: calc(var(--pa-pad) + var(--pa-thumb) + 22px);
	}
	.fxm-paid-ads--inline .fxm-paid-ads__inner { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); overflow: hidden; padding: 0; border: 1px solid #e6e9f5; border-radius: 12px; background: #fff; box-shadow: 0 4px 18px #25286003; }
	.fxm-paid-ads--inline .fxm-paid-ads__inner > * { grid-area: 1 / 1; min-width: 0; }
	.fxm-paid-ads--inline .fxm-paid-ads__list { z-index: 1; }
	.fxm-paid-ads--inline .fxm-paid-ads__head { z-index: 2; align-self: start; align-items: center; margin: 0; padding: 12px 14px 0 var(--pa-text-x); pointer-events: none; }
	.fxm-paid-ads--inline .fxm-paid-ads__icon { display: none; }
	.fxm-paid-ads--inline .fxm-paid-ads__heading { display: flex; align-items: baseline; gap: .5rem; min-width: 0; overflow: hidden; white-space: nowrap; }
	.fxm-paid-ads--inline .fxm-paid-ads__title { flex: none; color: #4b586c; font-size: 12.5px; font-weight: 600; line-height: 1.5; letter-spacing: .04em; }
	.fxm-paid-ads--inline .fxm-paid-ads__note { min-width: 0; margin: 0; overflow: hidden; color: #6b7487; font-size: 12px; line-height: 1.5; text-overflow: ellipsis; }
	.fxm-paid-ads--inline .fxm-paid-ads__note::before { content: "·"; margin-right: .5rem; color: #a3a9b8; }
	.fxm-paid-ads--inline .fxm-paid-ad { isolation: isolate; gap: 22px; height: var(--pa-band); padding: var(--pa-pad); overflow: hidden; border-radius: 0; background: #f7f6fd; }
	.fxm-paid-ads--inline .fxm-paid-ad:focus-visible { outline-offset: -3px; border-radius: 12px; }
	.fxm-paid-ads--inline .fxm-paid-ad__backdrop { position: absolute; inset: -40px; z-index: -2; display: block; width: calc(100% + 80px); height: calc(100% + 80px); max-width: none; object-fit: cover; object-position: 12% 50%; filter: blur(34px) saturate(1.2); opacity: .75; }
	.fxm-paid-ads--inline .fxm-paid-ad::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .8) calc(var(--pa-text-x) + 40px), rgba(255, 255, 255, .9) 100%); pointer-events: none; }
	.fxm-paid-ads--inline .fxm-paid-ad__media { width: var(--pa-thumb); height: calc(var(--pa-band) - 2 * var(--pa-pad)); border-radius: 9px; box-shadow: 0 10px 22px -14px rgba(20, 24, 40, .55); }
	.fxm-paid-ads--inline .fxm-paid-ad__tag { top: 6px; right: 6px; left: auto; padding: 0 5px; font-size: 10px; line-height: 16px; }
	.fxm-paid-ads--inline .fxm-paid-ad__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center; gap: .3rem 1.5rem; height: 100%; padding: 22px 4px 14px 0; }
	.fxm-paid-ads--inline .fxm-paid-ad__title { grid-column: 1; grid-row: 1; -webkit-line-clamp: 2; color: var(--pa-ink); font-size: 17px; line-height: 1.45; }
	.fxm-paid-ads--inline .fxm-paid-ad__meta { display: contents; }
	.fxm-paid-ads--inline .fxm-paid-ad__host { grid-column: 1; grid-row: 2; font-size: 12.5px; }
	.fxm-paid-ads--inline .fxm-paid-ad__cta { grid-column: 2; grid-row: 1 / span 2; align-self: center; gap: .35rem; min-height: 2.25rem; padding: 0 1rem; border: 0; border-radius: 999px; background: var(--pa-primary); color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 10px 20px -14px rgba(79, 52, 217, .8); }
	.fxm-paid-ads--inline .fxm-paid-ad:hover .fxm-paid-ad__cta { background: #4129c4; text-decoration: none; }
}

/* Detail ads reuse the inline layout while sharing the carousel controller.
   Keep all slides in the same track: no cloned links or duplicated impressions. */
.fxm-paid-ads--inline .fxm-paid-ads__heading { flex: 1; }
.fxm-paid-ads--inline .fxm-paid-carousel__slide > .fxm-paid-ad { height: 100%; }
@media (min-width: 768px) {
	.fxm-paid-ads--inline .fxm-paid-carousel__slide > .fxm-paid-ad { height: var(--pa-band); }
	.fxm-paid-ads--inline[data-fxm-paid-carousel] .fxm-paid-ad__body { padding-bottom: 22px; }
}

/* ---------- NEWS_SIDEBAR: an open sidebar block headed like 市场快讯, portrait 3:4 creative ---------- */
.fxm-paid-ads--rail .fxm-paid-ads__head { gap: 9px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid #e9ebf2; }
.fxm-paid-ads--rail .fxm-paid-ads__icon { height: 28px; color: #6239f5; }
.fxm-paid-ads--rail .fxm-paid-ads__icon svg { width: 21px; height: 21px; }
.fxm-paid-ads--rail .fxm-paid-ads__title { color: #252d46; font-size: 20px; font-weight: 700; line-height: 1.4; }
.fxm-paid-ads--rail .fxm-paid-ads__note { margin-top: 2px; color: #8a93a8; font-size: 12px; line-height: 1.55; }
.fxm-paid-ads--rail .fxm-paid-ad { max-width: 360px; }
.fxm-paid-ads--rail .fxm-paid-ad__media { aspect-ratio: 3 / 4; border-radius: 14px; }
.fxm-paid-ads--rail .fxm-paid-ad__title { color: #252d46; }
.fxm-news-side { display: flex; flex-direction: column; gap: 28px; min-width: 0; }

@media (max-width: 960px) {
	/* Same column as the board grid below. */
	.fxm-paid-ads--carousel { --pa-band: 132px; --pa-pad: 12px; padding: 0 1rem 1.25rem; }
	.fxm-paid-ads--carousel .fxm-paid-ads__inner { max-width: 640px; }
	.fxm-paid-ads--carousel .fxm-paid-ad { gap: 18px; }
	.fxm-paid-ads--carousel .fxm-paid-ad__body { grid-template-columns: minmax(0, 1fr); padding-top: 24px; }
	.fxm-paid-ads--carousel .fxm-paid-ad__title { -webkit-line-clamp: 2; font-size: 15px; line-height: 1.4; }
	.fxm-paid-ads--carousel .fxm-paid-ad__cta { display: none; }
	.fxm-paid-ads--carousel .fxm-paid-ads__note { display: none; }
}
@media (max-width: 767.98px) {
	/* Phone: a compact row; swipe replaces previous / next, the whole band is the link. */
	.fxm-paid-ads--carousel { --pa-band: 104px; --pa-pad: 10px; --pa-text-x: calc(var(--pa-pad) + var(--pa-thumb) + 12px); }
	.fxm-paid-ads--carousel .fxm-paid-ad { gap: 12px; }
	.fxm-paid-ads--carousel .fxm-paid-ad__media { border-radius: 7px; }
	.fxm-paid-ads--carousel .fxm-paid-ad__tag { top: 4px; right: 4px; left: auto; padding: 0 4px; font-size: 9px; line-height: 14px; }
	/* Right padding keeps the title clear of the pause button over the band's corner. */
	.fxm-paid-ads--carousel .fxm-paid-ad__body { gap: .15rem; padding: 18px 30px 10px 0; }
	.fxm-paid-ads--carousel .fxm-paid-ad__title { font-size: 13.5px; line-height: 1.4; }
	.fxm-paid-ads--carousel .fxm-paid-ad__host { font-size: 11px; }
	.fxm-paid-ads--carousel .fxm-paid-ads__head { padding: 8px 8px 0 var(--pa-text-x); }
	.fxm-paid-ads--carousel .fxm-paid-ads__title { font-size: 11px; }
	.fxm-paid-carousel__btn[data-fxm-paid-prev],
	.fxm-paid-carousel__btn[data-fxm-paid-next],
	.fxm-paid-carousel__count { display: none; }
	/* Pause stays reachable: a 26px button with a 44px hit area. */
	.fxm-paid-carousel__btn { width: 1.625rem; height: 1.625rem; }
	.fxm-paid-carousel__btn::before { content: ""; position: absolute; inset: -9px; }
	.fxm-paid-carousel__btn svg { width: 13px; height: 13px; }
	.fxm-paid-carousel__tabs { width: min(140px, 45%); margin-bottom: 0; }
	.fxm-paid-carousel__tab { padding: 6px 0; }
	/* Other slots: smaller tag on narrow cards, so it stays clear of the advertiser's logo corner. */
	.fxm-paid-ad__tag { top: 6px; left: 6px; padding: 0 5px; font-size: 10px; line-height: 16px; }
	.fxm-paid-ads--inline .fxm-paid-ad { flex-direction: column; align-items: stretch; gap: 0; }
	.fxm-paid-ads--inline .fxm-paid-ad__media { width: 100%; }
	.fxm-paid-ads--inline .fxm-paid-ads__inner { padding: 14px 14px 16px; border-radius: 20px; }
	.fxm-paid-ads--inline .fxm-paid-ads__head { padding: 2px 2px 12px; }
	.fxm-paid-ads--inline .fxm-paid-ad { padding: 8px; border-radius: 16px; }
	.fxm-paid-ads--inline .fxm-paid-ad__media { border-radius: 12px; }
	.fxm-paid-ads--inline .fxm-paid-ad__body { gap: .6rem; padding: .8rem .35rem .35rem; }
	.fxm-paid-ads--inline .fxm-paid-ad__title { -webkit-line-clamp: 2; font-size: 16px; }
	/* A full-width disclosure and 44px controls stay readable on narrow phones. */
	.fxm-paid-ads--inline[data-fxm-paid-carousel] .fxm-paid-ads__icon { display: none; }
	.fxm-paid-ads--inline[data-fxm-paid-carousel] .fxm-paid-ads__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding-bottom: 14px; }
	.fxm-paid-ads--inline[data-fxm-paid-carousel] .fxm-paid-ads__heading { display: contents; }
	.fxm-paid-ads--inline[data-fxm-paid-carousel] .fxm-paid-ads__title { grid-column: 1; grid-row: 1; overflow-wrap: anywhere; }
	.fxm-paid-ads--inline[data-fxm-paid-carousel] .fxm-paid-ads__note { grid-column: 1 / -1; grid-row: 2; margin: 0; overflow-wrap: anywhere; }
	.fxm-paid-ads--inline .fxm-paid-carousel__nav { grid-column: 2; grid-row: 1; }
	.fxm-paid-ads--inline .fxm-paid-carousel__btn { flex: none; width: 44px; height: 44px; background: #fbfaff; color: #625a7c; }
	.fxm-paid-ads--inline .fxm-paid-carousel__btn::before { inset: 0; }
	.fxm-paid-ads--inline .fxm-paid-carousel__btn[data-fxm-paid-prev]:not([hidden]),
	.fxm-paid-ads--inline .fxm-paid-carousel__btn[data-fxm-paid-next]:not([hidden]) { display: inline-flex; }
	.fxm-paid-ads--inline .fxm-paid-carousel__btn svg { width: 18px; height: 18px; }
	.fxm-paid-ads--inline .fxm-paid-ad__title { overflow-wrap: anywhere; }
	.fxm-paid-ads--inline .fxm-paid-ad__meta { flex-wrap: wrap; gap: 8px 12px; }
	.fxm-paid-ads--inline .fxm-paid-ad__host { flex: 1 1 80px; }
	.fxm-paid-ads--inline .fxm-paid-ad__cta { justify-content: center; min-height: 40px; }
	.fxm-paid-ads--inline .fxm-paid-carousel__tabs { width: 100%; margin: 4px 0 -8px; gap: 8px; }
	.fxm-paid-ads--inline .fxm-paid-carousel__tab { display: flex; align-items: center; min-height: 44px; padding: 12px 0; }
	.fxm-paid-ads--inline .fxm-paid-carousel__bar { width: 100%; }
	/* Under the feed the rail turns into a soft card, like the flash timeline beside it. */
	.fxm-paid-ads--rail .fxm-paid-ads__inner { padding: 16px 14px 18px; border: 1px solid #eceaf6; border-radius: 18px; background: #fff; box-shadow: 0 14px 30px -26px rgba(39, 46, 66, .4); }
	.fxm-paid-ads--rail .fxm-paid-ads__head { margin-bottom: 14px; padding-bottom: 12px; }
	.fxm-paid-ads--rail .fxm-paid-ads__title { font-size: 17px; }
	.fxm-paid-ads--rail .fxm-paid-ad { max-width: 420px; margin-inline: auto; width: 100%; }
}
/* HOME_TOP below 961px: three columns would squeeze each card to ~200px, so the cards become
   rows (thumbnail left, copy right) on the board grid's 640px column. Nothing scrolls sideways. */
@media (max-width: 960px) {
	.fxm-paid-ads--grid { --pa-gap: .75rem; padding: 0 1rem 1.25rem; }
	.fxm-paid-ads--grid .fxm-paid-ads__inner { max-width: 640px; }
	.fxm-paid-ads--grid .fxm-paid-ads__list,
	.fxm-paid-ads--grid.is-count-1 .fxm-paid-ads__list,
	.fxm-paid-ads--grid.is-count-2 .fxm-paid-ads__list { grid-template-columns: minmax(0, 1fr); }
	.fxm-paid-ads--grid .fxm-paid-ad { flex-direction: row; align-items: stretch; gap: 14px; padding: 10px; }
	.fxm-paid-ads--grid .fxm-paid-ad:hover { transform: none; }
	/* In a row the creative is a thumbnail again: rounded, with the full hairline. */
	.fxm-paid-ads--grid .fxm-paid-ad__media { width: 40%; max-width: 220px; align-self: center; border-radius: 9px; }
	.fxm-paid-ads--grid .fxm-paid-ad__media::after { box-shadow: inset 0 0 0 1px rgba(36, 48, 68, .07); }
	.fxm-paid-ads--grid .fxm-paid-ad__body { justify-content: center; padding: 2px 4px 2px 0; }
	.fxm-paid-ads--grid .fxm-paid-ad__title { -webkit-line-clamp: 2; }
	.fxm-paid-ads--grid .fxm-paid-ad__meta { margin-top: 0; }
}
@media (max-width: 767.98px) {
	.fxm-paid-ads--grid .fxm-paid-ad { gap: 12px; padding: 8px; border-radius: 12px; }
	.fxm-paid-ads--grid .fxm-paid-ad__media { width: 42%; border-radius: 7px; }
	.fxm-paid-ads--grid .fxm-paid-ad__tag { top: 4px; left: 4px; padding: 0 4px; font-size: 9px; line-height: 14px; }
	.fxm-paid-ads--grid .fxm-paid-ad__body { gap: .3rem; }
	.fxm-paid-ads--grid .fxm-paid-ad__title { font-size: 13.5px; line-height: 1.4; }
	.fxm-paid-ads--grid .fxm-paid-ad__host { font-size: 11px; }
	/* The whole card is the link; the CTA would only crowd the copy on a phone. */
	.fxm-paid-ads--grid .fxm-paid-ad__cta { display: none; }
}
@media (max-width: 430px) {
	.fxm-paid-ads--carousel,
	.fxm-paid-ads--grid { padding-inline: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
	.fxm-paid-ad__media img,
	.fxm-paid-ad__title,
	.fxm-paid-ad__cta,
	.fxm-paid-ad__cta svg,
	.fxm-paid-carousel__btn,
	.fxm-paid-carousel__bar,
	.fxm-paid-ads--inline .fxm-paid-ad,
	.fxm-paid-ads--grid .fxm-paid-ad { transition: none; }
	.fxm-paid-ad:hover .fxm-paid-ad__media img,
	.fxm-paid-ad:hover .fxm-paid-ad__cta svg,
	.fxm-paid-ads--grid .fxm-paid-ad:hover { transform: none; }
	.fxm-paid-carousel__bar i,
	.fxm-paid-carousel__slide.is-cut { animation: none !important; }
}
