/* ============================================================
 * HH Banner Studio · 前台样式  v1.1.0
 * 结构：__bg 或 __slides（背景/滤镜） / __overlay（遮罩） / __content（文字）
 *       __arrow + __dots（轮播控件） / __crumbs（面包屑）
 * 所有可调参数均由 HHB_Config::css_vars() 以 CSS 变量注入到 .banner
 *
 * 命名空间说明：
 * 主题 myTheme 自身也使用 .banner 类（首页 .banner.home / 内页 .banner.ny），
 * 因此这里统一用 .banner[data-hhb-profile] 限定作用域 —— 既提高优先级，
 * 又保证插件样式绝不污染主题原有 banner，反之亦然。
 * 组件根节点类名依然严格是 class="banner"。
 * ============================================================ */

.banner[data-hhb-profile] {
	--hhb-h: var(--hhb-h-desktop, 600px);
	--hhb-title-size: var(--hhb-title-size-desktop, 56px);

	position: relative;
	display: block;
	box-sizing: border-box;
	width: var(--hhb-width, 100%);
	height: var(--hhb-h);
	margin-top: var(--hhb-mt, 0px);
	margin-bottom: var(--hhb-mb, 0px);
	padding: 0;
	overflow: hidden;
	isolation: isolate;
	border-radius: var(--hhb-radius, 0px);
	background-color: var(--hhb-bg-color, #1f2937);
	color: var(--hhb-text-color, #ffffff);
	-webkit-font-smoothing: antialiased;
}

.banner[data-hhb-profile] *,
.banner[data-hhb-profile] *::before,
.banner[data-hhb-profile] *::after { box-sizing: border-box; }

/* --- 静态背景图层：滤镜只作用于这里，文字不受影响 --- */
.banner[data-hhb-profile] .banner__bg {
	position: absolute;
	inset: -8px; /* 略微外扩，避免 blur 滤镜边缘露出底色 */
	z-index: 0;
	pointer-events: none;
	background-color: var(--hhb-bg-color, #1f2937);
	background-image: var(--hhb-bg-image, none);
	background-size: var(--hhb-bg-size, cover);
	background-position: var(--hhb-bg-pos, center center);
	background-repeat: var(--hhb-bg-repeat, no-repeat);
	background-attachment: var(--hhb-bg-attach, scroll);
	filter: var(--hhb-filter, none);
}

/* --- 轮播背景层：每张图一个独立帧，滤镜统一加在容器上 --- */
.banner[data-hhb-profile] .banner__slides {
	position: absolute;
	inset: -8px;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
	background-color: var(--hhb-bg-color, #1f2937);
	filter: var(--hhb-filter, none);
}

.banner[data-hhb-profile] .banner__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity var(--hhb-slide-speed, 800ms) ease;
	will-change: opacity;
}
.banner[data-hhb-profile] .banner__slide.is-active { opacity: 1; }

/* 横向滑动模式：所有帧都可见，靠 transform 排成一列 */
.banner[data-hhb-profile][data-hhb-effect="slide"] .banner__slide {
	opacity: 1;
	transform: translateX(100%);
	transition: transform var(--hhb-slide-speed, 800ms) cubic-bezier(.4, 0, .2, 1);
	will-change: transform;
}

.banner[data-hhb-profile] .banner__slide-bg {
	position: absolute;
	inset: 0;
	background-color: var(--hhb-bg-color, #1f2937);
	background-image: var(--hhb-slide-image, none);
	background-size: var(--hhb-bg-size, cover);
	background-position: var(--hhb-bg-pos, center center);
	background-repeat: var(--hhb-bg-repeat, no-repeat);
	background-attachment: scroll;
}

/* --- 颜色遮罩层 --- */
.banner[data-hhb-profile] .banner__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: var(--hhb-overlay, transparent);
}

/* --- 文字层 --- */
.banner[data-hhb-profile] .banner__inner {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: var(--hhb-valign, center);
	justify-content: var(--hhb-justify, center);
	width: 100%;
	height: 100%;
	padding: 36px var(--hhb-pad-x, 24px);
}

.banner[data-hhb-profile] .banner__content {
	width: 100%;
	max-width: var(--hhb-max-w, 1200px);
	text-align: var(--hhb-align, center);
	color: var(--hhb-text-color, #ffffff);
}

/* 轮播模式：同一时刻只显示当前帧对应的文字层 */
.banner[data-hhb-profile][data-hhb-slider="1"] .banner__content { display: none; }
.banner[data-hhb-profile][data-hhb-slider="1"] .banner__content.is-active {
	display: block;
	animation: hhbFade var(--hhb-slide-speed, 800ms) ease both;
}

.banner[data-hhb-profile] .banner__subtitle {
	margin: 0 0 14px;
	font-size: var(--hhb-subtitle-size, 16px);
	line-height: 1.5;
	font-weight: 500;
	letter-spacing: .18em;
	text-transform: uppercase;
	opacity: .92;
}

.banner[data-hhb-profile] .banner__title {
	margin: 0 0 18px;
	font-size: var(--hhb-title-size);
	line-height: 1.18;
	font-weight: 700;
	letter-spacing: .01em;
	color: var(--hhb-title-color, #ffffff);
	text-wrap: balance;
	overflow-wrap: anywhere;
}

.banner[data-hhb-profile] .banner__desc {
	max-width: 760px;
	margin: 0 auto 28px;
	font-size: var(--hhb-desc-size, 16px);
	line-height: 1.8;
	font-weight: 400;
	opacity: .9;
}

.banner[data-hhb-profile] .banner__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 32px;
	border: 2px solid currentColor;
	border-radius: 2px;
	color: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: .04em;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .25s ease, color .25s ease, transform .25s ease;
}

.banner[data-hhb-profile] .banner__btn:hover,
.banner[data-hhb-profile] .banner__btn:focus-visible {
	background-color: var(--hhb-text-color, #ffffff);
	color: #16181d;
	transform: translateY(-2px);
	outline: none;
}

.banner[data-hhb-profile] .banner__btn:focus-visible { box-shadow: 0 0 0 3px rgba(255, 255, 255, .45); }
.banner[data-hhb-profile] .banner__btn--static { cursor: default; }

/* ============================================================
 * v2.0.0 · 动态图层（标题 / 文字 / 按钮 / 图片）
 * 常规排版：按 DOM 顺序纵向排列；自由布局：见文件末尾的层定位规则。
 * 字号 / 颜色 / 粗细 / 行高 / 字距 / 对齐都优先取图层自身变量。
 * ============================================================ */
.banner[data-hhb-profile] .banner__layer {
	display: block;
	box-sizing: border-box;
	max-width: 100%;
	width: var(--w, auto);
	margin-left: auto;
	margin-right: auto;
	color: var(--color, inherit);
	opacity: var(--opacity, 1);
	text-align: var(--align, center);
	font-family: var(--ff, inherit);
	font-style: var(--italic, normal);
	text-decoration: var(--deco, none);
	text-transform: var(--tt, none);
}

.banner[data-hhb-profile] .banner__layer--title {
	margin: 0 auto 18px;
	font-size: var(--fs, var(--hhb-title-size));
	font-weight: var(--weight, 700);
	line-height: var(--lh, 1.18);
	letter-spacing: var(--ls, .01em);
	color: var(--color, var(--hhb-title-color, #ffffff));
	text-wrap: balance;
	overflow-wrap: anywhere;
}

.banner[data-hhb-profile] .banner__layer--text {
	margin: 0 auto 14px;
	font-size: var(--fs, var(--hhb-desc-size, 16px));
	font-weight: var(--weight, 400);
	line-height: var(--lh, 1.8);
	letter-spacing: var(--ls, normal);
}

.banner[data-hhb-profile] .banner__layer--button {
	display: inline-flex;
	width: var(--w, auto);
	margin: 18px auto 0;
	padding: var(--pad, 12px 32px);
}

.banner[data-hhb-profile] .banner__layer--image {
	margin: 0 auto 18px;
	border-radius: var(--radius, 0px);
	background: var(--bg, transparent);
	padding: var(--pad, 0px);
	overflow: hidden;
}
.banner[data-hhb-profile] .banner__layer--image img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	border-radius: inherit;
	object-fit: var(--fit, cover);
}

/* 工作台里未选图的图片图层用占位框表示，便于选中与上传（前台不输出） */
.banner[data-hhb-profile] .banner__layer--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 90px;
	padding: 12px;
	border: 1px dashed rgba(255, 255, 255, .45);
	background: rgba(255, 255, 255, .08);
	color: rgba(255, 255, 255, .78);
	font-size: 12px;
	letter-spacing: .04em;
}

/* 常规排版下最后一个图层不再留底部间距 */
.banner[data-hhb-profile] .banner__content > .banner__layer:last-child { margin-bottom: 0; }

/* --- 状态开关 --- */
.banner[data-hhb-profile][data-hhb-hide-text="1"] .banner__content { display: none !important; }

/* --- 入场动画（轮播模式下的逐帧淡入由上面的规则接管） --- */
.banner[data-hhb-profile][data-hhb-slider="0"][data-hhb-animation="fade"] .banner__content { animation: hhbFade .85s ease both; }
.banner[data-hhb-profile][data-hhb-slider="0"][data-hhb-animation="up"] .banner__content { animation: hhbUp .85s cubic-bezier(.2, .7, .3, 1) both; }

@keyframes hhbFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hhbUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
 * 轮播控件 · 左右箭头
 * ============================================================ */
.banner[data-hhb-profile] .banner__arrow {
	position: absolute;
	top: 50%;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--hhb-arrow-size, 44px);
	height: var(--hhb-arrow-size, 44px);
	padding: 0;
	border: 0;
	border-radius: var(--hhb-arrow-radius, 50px);
	background: var(--hhb-arrow-bg, rgba(0, 0, 0, .35));
	color: var(--hhb-arrow-color, #ffffff);
	cursor: pointer;
	transform: translateY(-50%);
	transition: background-color .25s ease, transform .25s ease, opacity .25s ease;
}
.banner[data-hhb-profile] .banner__arrow--prev { left: var(--hhb-dot-offset-x, 24px); }
.banner[data-hhb-profile] .banner__arrow--next { right: var(--hhb-dot-offset-x, 24px); }
.banner[data-hhb-profile] .banner__arrow:hover,
.banner[data-hhb-profile] .banner__arrow:focus-visible { transform: translateY(-50%) scale(1.09); outline: none; }
.banner[data-hhb-profile] .banner__arrow:focus-visible { box-shadow: 0 0 0 3px rgba(255, 255, 255, .5); }
.banner[data-hhb-profile] .banner__arrow svg { display: block; width: 46%; height: 46%; }

/* ============================================================
 * 轮播控件 · 索引小圆点
 * 大小 / 间距 / 圆角 / 边框 / 颜色 / 位置 / 激活填充样式
 * ============================================================ */
.banner[data-hhb-profile] .banner__dots {
	position: absolute;
	z-index: 4;
	display: flex;
	align-items: center;
	gap: var(--hhb-dot-gap, 9px);
}
.banner[data-hhb-profile] .banner__dots--bottom-center { bottom: var(--hhb-dot-offset-y, 26px); left: 50%; transform: translateX(-50%); }
.banner[data-hhb-profile] .banner__dots--bottom-left { bottom: var(--hhb-dot-offset-y, 26px); left: var(--hhb-dot-offset-x, 24px); }
.banner[data-hhb-profile] .banner__dots--bottom-right { bottom: var(--hhb-dot-offset-y, 26px); right: var(--hhb-dot-offset-x, 24px); }
.banner[data-hhb-profile] .banner__dots--top-center { top: var(--hhb-dot-offset-y, 26px); left: 50%; transform: translateX(-50%); }
.banner[data-hhb-profile] .banner__dots--top-left { top: var(--hhb-dot-offset-y, 26px); left: var(--hhb-dot-offset-x, 24px); }
.banner[data-hhb-profile] .banner__dots--top-right { top: var(--hhb-dot-offset-y, 26px); right: var(--hhb-dot-offset-x, 24px); }

.banner[data-hhb-profile] .banner__dot {
	position: relative;
	display: block;
	flex: 0 0 auto;
	width: var(--hhb-dot-size, 10px);
	height: var(--hhb-dot-size, 10px);
	padding: 0;
	margin: 0;
	border: var(--hhb-dot-border-width, 0px) solid var(--hhb-dot-border-color, rgba(255, 255, 255, .75));
	border-radius: var(--hhb-dot-radius, 50px);
	background: var(--hhb-dot-color, rgba(255, 255, 255, .45));
	overflow: hidden;
	cursor: pointer;
	transition: background-color .3s ease, width .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.banner[data-hhb-profile] .banner__dot:hover { box-shadow: 0 0 0 3px rgba(255, 255, 255, .22); }
.banner[data-hhb-profile] .banner__dot:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.banner[data-hhb-profile] .banner__dot.is-active { background: var(--hhb-dot-active-color, #ffffff); }

/* 进度填充层：只在 progress 模式下展开 */
.banner[data-hhb-profile] .banner__dot-fill {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: 0;
	background: var(--hhb-dot-active-color, #ffffff);
}

/* 当前索引圆点的四种填充样式 */
.banner[data-hhb-profile] .banner__dots[data-hhb-dot-style="outline"] .banner__dot.is-active {
	background: transparent;
	box-shadow: inset 0 0 0 2px var(--hhb-dot-active-color, #ffffff);
}
.banner[data-hhb-profile] .banner__dots[data-hhb-dot-style="bar"] .banner__dot.is-active {
	width: var(--hhb-dot-active-width, 28px);
	border-radius: var(--hhb-dot-radius, 50px);
}
.banner[data-hhb-profile] .banner__dots[data-hhb-dot-style="progress"] .banner__dot.is-active {
	background: var(--hhb-dot-color, rgba(255, 255, 255, .45));
}
.banner[data-hhb-profile] .banner__dots[data-hhb-dot-style="progress"] .banner__dot.is-active .banner__dot-fill {
	animation: hhbDotProgress var(--hhb-dot-duration, 7000ms) linear both;
}
@keyframes hhbDotProgress { from { width: 0; } to { width: 100%; } }

/* ============================================================
 * 面包屑导航
 * ============================================================ */
.banner[data-hhb-profile] .banner__crumbs {
	position: absolute;
	z-index: 4;
	display: flex;
	align-items: center;
	gap: 9px;
	padding: var(--hhb-crumb-pad-y, 9px) var(--hhb-crumb-pad-x, 18px);
	border-radius: var(--hhb-crumb-radius, 40px);
	background: var(--hhb-crumb-bg, transparent);
	font-size: var(--hhb-crumb-font-size, 14px);
	line-height: 1.45;
	color: var(--hhb-crumb-color, rgba(255, 255, 255, .72));
}
.banner[data-hhb-profile] .banner__crumbs--bottom-center { bottom: var(--hhb-crumb-offset-y, 26px); left: 50%; transform: translateX(-50%); }
.banner[data-hhb-profile] .banner__crumbs--bottom-left { bottom: var(--hhb-crumb-offset-y, 26px); left: var(--hhb-crumb-offset-x, 24px); }
.banner[data-hhb-profile] .banner__crumbs--bottom-right { bottom: var(--hhb-crumb-offset-y, 26px); right: var(--hhb-crumb-offset-x, 24px); }
.banner[data-hhb-profile] .banner__crumbs--top-center { top: var(--hhb-crumb-offset-y, 26px); left: 50%; transform: translateX(-50%); }
.banner[data-hhb-profile] .banner__crumbs--top-left { top: var(--hhb-crumb-offset-y, 26px); left: var(--hhb-crumb-offset-x, 24px); }
.banner[data-hhb-profile] .banner__crumbs--top-right { top: var(--hhb-crumb-offset-y, 26px); right: var(--hhb-crumb-offset-x, 24px); }

.banner[data-hhb-profile] .banner__crumbs-list { display: flex; align-items: center; flex-wrap: wrap; gap: 0; margin: 0; padding: 0; list-style: none; }
.banner[data-hhb-profile] .banner__crumb { display: inline-flex; align-items: center; white-space: nowrap; margin: 0; }
.banner[data-hhb-profile] .banner__crumb-sep { margin: 0 .65em; opacity: .8; color: var(--hhb-crumb-color, rgba(255, 255, 255, .72)); }
.banner[data-hhb-profile] .banner__crumb a {
	color: var(--hhb-crumb-link, #ffffff);
	text-decoration: none;
	transition: opacity .2s ease;
}
.banner[data-hhb-profile] .banner__crumb a:hover,
.banner[data-hhb-profile] .banner__crumb a:focus-visible { opacity: .75; text-decoration: underline; outline: none; }
.banner[data-hhb-profile] .banner__crumb.is-current > span { color: var(--hhb-crumb-active, rgba(255, 255, 255, .72)); }

/* 最前面的图标：设置了才由模板输出，没设置就完全不存在 */
.banner[data-hhb-profile] .banner__crumb-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	font-size: var(--hhb-crumb-icon-size, 16px);
	line-height: 1;
	color: var(--hhb-crumb-link, #ffffff);
}
.banner[data-hhb-profile] .banner__crumb-icon--image {
	display: block;
	width: var(--hhb-crumb-icon-size, 16px);
	height: var(--hhb-crumb-icon-size, 16px);
	object-fit: contain;
}

/* ============================================================
 * 响应式：仅切换 CSS 变量，组件结构完全不变
 * ============================================================ */

@media (max-width: 1024px) {
	.banner[data-hhb-profile] {
		--hhb-h: var(--hhb-h-tablet, var(--hhb-h-desktop, 600px));
	}
	.banner[data-hhb-profile] .banner__inner { padding-top: 26px; padding-bottom: 26px; }
	.banner[data-hhb-profile] .banner__title { margin-bottom: 14px; }
	.banner[data-hhb-profile] .banner__desc { margin-bottom: 22px; }
}

@media (max-width: 767px) {
	.banner[data-hhb-profile] {
		--hhb-h: var(--hhb-h-mobile, var(--hhb-h-desktop, 600px));
		--hhb-title-size: var(--hhb-title-size-mobile, 30px);
	}
	.banner[data-hhb-profile] .banner__bg {
		/* 手机端切换到独立竖图；未设置时自动回退桌面图 */
		background-image: var(--hhb-bg-image-mobile, var(--hhb-bg-image, none));
		/* iOS Safari 不支持 fixed 背景，强制降级 */
		background-attachment: scroll;
	}
	.banner[data-hhb-profile] .banner__slide-bg {
		background-image: var(--hhb-slide-image-mobile, var(--hhb-slide-image, none));
		background-attachment: scroll;
	}
	.banner[data-hhb-profile] .banner__inner {
		padding: 20px 16px;
		justify-content: var(--hhb-justify-mobile, var(--hhb-justify, center));
	}
	.banner[data-hhb-profile] .banner__content { text-align: var(--hhb-align-mobile, var(--hhb-align, center)); }
	.banner[data-hhb-profile] .banner__title { margin-bottom: 12px; line-height: 1.26; }
	.banner[data-hhb-profile] .banner__subtitle { margin-bottom: 10px; font-size: 12px; letter-spacing: .12em; }
	.banner[data-hhb-profile] .banner__desc { margin-bottom: 20px; font-size: 14px; line-height: 1.7; }
	.banner[data-hhb-profile] .banner__btn { min-height: 42px; padding: 10px 22px; font-size: 14px; }
	.banner[data-hhb-profile][data-hhb-mobile-hide-title="1"] .banner__layer--text { display: none; }

	/* 轮播控件在手机上缩小，避免遮挡文字 */
	.banner[data-hhb-profile] .banner__arrow { width: 36px; height: 36px; }
	.banner[data-hhb-profile] .banner__arrow--prev { left: 10px; }
	.banner[data-hhb-profile] .banner__arrow--next { right: 10px; }
	.banner[data-hhb-profile] .banner__dots { gap: 6px; }
	.banner[data-hhb-profile][data-hhb-dots-mobile="0"] .banner__dots { display: none; }

	/* 面包屑在小屏上收窄 */
	.banner[data-hhb-profile] .banner__crumbs {
		font-size: 12px;
		padding: 6px 12px;
		max-width: calc(100% - 24px);
	}
	.banner[data-hhb-profile] .banner__crumbs--bottom-left,
	.banner[data-hhb-profile] .banner__crumbs--top-left { left: 12px; }
	.banner[data-hhb-profile] .banner__crumbs--bottom-right,
	.banner[data-hhb-profile] .banner__crumbs--top-right { right: 12px; }
	.banner[data-hhb-profile] .banner__crumbs--bottom-center,
	.banner[data-hhb-profile] .banner__crumbs--top-center { max-width: calc(100% - 24px); }
}

@media (max-width: 380px) {
	.banner[data-hhb-profile] .banner__desc { font-size: 13px; }
	.banner[data-hhb-profile] .banner__btn { padding: 9px 18px; }
}

@media (hover: none) and (pointer: coarse) {
	.banner[data-hhb-profile] .banner__bg { background-attachment: scroll; }
}

@media (prefers-reduced-motion: reduce) {
	.banner[data-hhb-profile] .banner__content { animation: none !important; }
	.banner[data-hhb-profile] .banner__btn { transition: none !important; }
	.banner[data-hhb-profile] .banner__slide,
	.banner[data-hhb-profile] .banner__arrow,
	.banner[data-hhb-profile] .banner__dot { transition: none !important; }
	.banner[data-hhb-profile] .banner__dots[data-hhb-dot-style="progress"] .banner__dot.is-active .banner__dot-fill { animation: none !important; width: 100%; }
}

/* ============================================================
 * v1.2.0 · 可视化拖拽自由布局
 * 只有根节点 data-hhb-layout="1" 时整段规则才命中；默认关闭时
 * 前台 DOM / CSS 与 v1.1.0 逐字一致，老方案完全不受影响。
 *
 * 坐标来自 --hhb-l-<层名>-* （由 HHB_Config::layout_vars() 注入），
 * 每个元素上的 --x / --y / --w ... 是引用这些变量的局部别名，
 * 因此所有层可以共用下面这一条通用规则。
 * ============================================================ */
.banner[data-hhb-profile][data-hhb-layout="1"] .banner__inner {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	pointer-events: none;
}

/* 每帧的文字容器铺满 Banner，作为内部图层的定位上下文 */
.banner[data-hhb-profile][data-hhb-layout="1"] .banner__content {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	text-align: left;
	pointer-events: none;
}

.banner[data-hhb-profile][data-hhb-layout="1"] [data-hhb-layer] {
	position: absolute;
	left: var(--x, 50%);
	top: var(--y, 50%);
	right: auto;
	bottom: auto;
	width: var(--w, auto);
	height: var(--h, auto);
	max-width: none;
	margin: 0;
	padding: var(--pad, 0px);
	border-radius: var(--radius, 0px);
	background: var(--bg, transparent);
	opacity: var(--opacity, 1);
	text-align: var(--align, center);
	z-index: var(--z, 3);
	transform: translate(-50%, -50%) scale(var(--scale, 1)) rotate(var(--rotate, 0deg));
	pointer-events: auto;
	box-sizing: border-box;
}

/* 轮播多帧：只显示当前帧的文字组 */
.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-slider="1"] .banner__content { display: none; }
.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-slider="1"] .banner__content.is-active { display: block; }

/* 图层字号 / 字重 / 行高 / 字距：变量有值时才覆盖类型默认值 */
.banner[data-hhb-profile][data-hhb-layout="1"] [data-hhb-layer] {
	font-size: var(--fs, inherit);
	font-weight: var(--weight, inherit);
	line-height: var(--lh, inherit);
	letter-spacing: var(--ls, normal);
	color: var(--color, inherit);
}
.banner[data-hhb-profile][data-hhb-layout="1"] [data-hhb-layer-type="image"] img {
	width: 100%;
	height: 100%;
	display: block;
	border-radius: inherit;
	object-fit: var(--fit, cover);
}

/* ============================================================
 * v3.3.0 · 容器图层（group）
 * 容器是一个可设宽高的 div，子图层在它内部按百分比定位；
 * 默认 overflow:hidden 把超出容器的部分裁掉（可在属性面板关闭）。
 * 容器本身不拦截鼠标，避免挡住其它图层的点击。
 * ============================================================ */
.banner[data-hhb-profile][data-hhb-layout="1"] [data-hhb-layer-type="group"] {
	overflow: var(--clip, hidden);
	pointer-events: none;
}

/* 子图层恢复可点击（按钮 / 链接 / 图片） */
.banner[data-hhb-profile][data-hhb-layout="1"] [data-hhb-layer-type="group"] > [data-hhb-layer] {
	pointer-events: auto;
}

/* 嵌套容器继续按同一规则定位，无需额外处理；这里只兜底空容器的层级 */
.banner[data-hhb-profile][data-hhb-layout="1"] [data-hhb-layer-type="group"] [data-hhb-layer-type="group"] {
	overflow: var(--clip, hidden);
}

/* 后台图层面板的「隐藏」开关。
 * 不依赖 data-hhb-layout：手机端回退常规排版时隐藏状态也要保持。
 * 未启用自由布局时模板根本不会输出 data-hhb-layer，因此这条规则不会误伤 v1.1.0 的 DOM。 */
.banner[data-hhb-profile] [data-hhb-layer][data-hhb-layer-hidden="1"] { display: none !important; }

/* 入场动画会改写 transform / opacity，与自由定位冲突，直接禁用。 */
.banner[data-hhb-profile][data-hhb-layout="1"] .banner__content { animation: none !important; }

/* 左右箭头：X 解释为距左右边缘的百分比，Y 为垂直位置 */
.banner[data-hhb-profile][data-hhb-layout="1"] [data-hhb-layer="arrows"] {
	left: auto;
	right: auto;
	width: var(--hhb-arrow-size, 44px);
	height: var(--hhb-arrow-size, 44px);
	transform: translateY(-50%) scale(var(--scale, 1)) rotate(var(--rotate, 0deg));
}
.banner[data-hhb-profile][data-hhb-layout="1"] .banner__arrow--prev { left: var(--x, 3%); right: auto; }
.banner[data-hhb-profile][data-hhb-layout="1"] .banner__arrow--next { right: var(--x, 3%); left: auto; }

/* 圆点与面包屑保持自适应宽度，避免被 w 变量撑开 */
.banner[data-hhb-profile][data-hhb-layout="1"] [data-hhb-layer="dots"],
.banner[data-hhb-profile][data-hhb-layout="1"] [data-hhb-layer="breadcrumb"] { width: auto; }

/* 背景图焦点：拖动 background 层改变裁切中心 */
.banner[data-hhb-profile][data-hhb-layout="1"] .banner__bg,
.banner[data-hhb-profile][data-hhb-layout="1"] .banner__slide-bg {
	background-position: var(--hhb-l-background-x, 50%) var(--hhb-l-background-y, 50%);
}

/* 手机端默认回退为常规流式布局，避免自由定位在小屏上互相重叠。
 * 在可视化布局里打开「手机端也用自由布局」才会在 <768px 保留绝对定位。 */
@media (max-width: 767px) {
	.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-layout-mobile="0"] .banner__inner {
		position: relative !important;
		display: flex !important;
		align-items: var(--hhb-valign, center) !important;
		justify-content: var(--hhb-justify-mobile, var(--hhb-justify, center)) !important;
		height: 100% !important;
		padding: 20px 16px !important;
		pointer-events: auto !important;
	}
	.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-layout-mobile="0"] .banner__content {
		position: static !important;
		width: 100% !important;
		height: auto !important;
		max-width: var(--hhb-max-w, 1200px) !important;
		margin: 0 auto !important;
		transform: none !important;
		opacity: 1 !important;
		background: transparent !important;
		padding: 0 !important;
		text-align: var(--hhb-align-mobile, center) !important;
		pointer-events: auto !important;
	}
	.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-layout-mobile="0"] .banner__content > .banner__layer {
		position: static !important;
		left: auto !important; right: auto !important; top: auto !important; bottom: auto !important;
		width: auto !important; height: auto !important; max-width: 100% !important;
		transform: none !important;
		opacity: 1 !important;
		text-align: inherit !important;
		background: transparent !important;
		padding: 0 !important;
		font-size: var(--fs, inherit) !important;
	}
	.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-layout-mobile="0"] .banner__layer--text { margin: 0 0 10px !important; font-size: var(--fs, 14px) !important; }
	.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-layout-mobile="0"] .banner__layer--title { margin: 0 0 12px !important; }
	.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-layout-mobile="0"] .banner__layer--image { margin: 0 0 16px !important; }
	.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-layout-mobile="0"] .banner__layer--button { margin: 12px 0 0 !important; padding: 10px 22px !important; }
	/* v3.3.0：回退常规排版时容器与它的子图层一并回到普通流，避免相对整个 Banner 定位而重叠。 */
	.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-layout-mobile="0"] .banner__layer--group,
	.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-layout-mobile="0"] .banner__layer--group > .banner__layer {
		position: static !important;
		left: auto !important; right: auto !important; top: auto !important; bottom: auto !important;
		width: auto !important; height: auto !important; max-width: 100% !important;
		transform: none !important;
		opacity: 1 !important;
		overflow: visible !important;
		background: transparent !important;
		padding: 0 !important;
		margin: 0 !important;
	}
	.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-layout-mobile="0"] [data-hhb-layer="breadcrumb"] {
		position: absolute !important;
		left: 12px !important; right: auto !important; top: auto !important;
		bottom: var(--hhb-crumb-offset-y, 26px) !important;
		width: auto !important; height: auto !important;
		transform: none !important; opacity: 1 !important;
	}
	.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-layout-mobile="0"] [data-hhb-layer="dots"] {
		position: absolute !important;
		left: 50% !important; right: auto !important; top: auto !important;
		bottom: var(--hhb-dot-offset-y, 26px) !important;
		width: auto !important; height: auto !important;
		transform: translateX(-50%) !important; opacity: 1 !important;
	}
	.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-layout-mobile="0"] [data-hhb-layer="arrows"] {
		position: absolute !important;
		top: 50% !important; bottom: auto !important;
		width: 36px !important; height: 36px !important;
		transform: translateY(-50%) !important; opacity: 1 !important;
	}
	.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-layout-mobile="0"] .banner__arrow--prev { left: 10px !important; right: auto !important; }
	.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-layout-mobile="0"] .banner__arrow--next { right: 10px !important; left: auto !important; }
	.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-layout-mobile="0"] .banner__bg,
	.banner[data-hhb-profile][data-hhb-layout="1"][data-hhb-layout-mobile="0"] .banner__slide-bg {
		background-position: var(--hhb-bg-pos, center center) !important;
	}
}
