/* Hero Carousel - Front page banner carousel
   动画/交互由 js/front-hero-carousel.js 控制：
   ✅ 自动播放（每4s切一张）
   ✅ 左右按钮点击切换
   ✅ 鼠标拖拽 / 触屏滑动（拖动超过20%宽度即切换，否则回弹）
   ✅ 无缝循环（3张 + 末尾克隆1张，边界瞬移）
*/

.hero-carousel {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #f5f5f5;
	aspect-ratio: 1920 / 600;
	/* 拖拽交互：鼠标悬浮显示 grab，拖动时 grabbing */
	cursor: grab;
	/* 触屏滑动时允许 Y 轴滚页面，X 轴留给轮播拖拽 */
	touch-action: pan-y;
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
}
.hero-carousel.is-dragging {
	cursor: grabbing;
}

.hero-carousel__track {
	display: flex;
	width: 400%;           /* 4 张 slide（3真实 + 1克隆），每张占 25% */
	height: 100%;
	will-change: transform;
	transform: translateX(0);
	/* 动画由 JS 控制：加/去除 transition，不要 CSS @keyframes 以免和拖拽冲突 */
}
.hero-carousel__track.hero-carousel__track--animate {
	transition: transform 0.6s ease-in-out;
}

.hero-carousel__slide {
	width: 25%;
	height: 100%;
	flex: 0 0 25%;
	overflow: hidden;
}

.hero-carousel__slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	/* 图片不接收鼠标事件，拖拽事件全部由容器接管 */
	pointer-events: none;
	-webkit-user-drag: none;
	user-drag: none;
}

/* ========== 资质认证相关幻灯片样式 ========== */
.hero-carousel__slide--cert,
.hero-carousel__slide--certs {
	position: relative;
}

/* 灰黑色遮罩层 */
.hero-carousel__overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, rgba(30, 30, 35, 0.82) 0%, rgba(20, 20, 25, 0.72) 100%);
	z-index: 1;
	pointer-events: none;
}

/* 内容容器（两种布局共用：左侧认证元素 + 右侧文字） */
.hero-carousel__content {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 2;
	display: flex;
	align-items: center;
	padding: 0 8% 0 6%;
	gap: 60px;
}

/* 前两张：水平居中 */
.hero-carousel__slide--cert .hero-carousel__content {
	justify-content: center;
	padding: 0 6%;
}

/* 第三张：靠左对齐 */
.hero-carousel__slide--certs .hero-carousel__content {
	justify-content: flex-start;
}

/* 左侧认证元素组（第三张用） */
.hero-carousel__certs-group {
	display: flex;
	align-items: flex-end;
	gap: 24px;
	flex-shrink: 0;
}

/* 单张证书图片 */
.hero-carousel__cert-item {
	width: 140px;
	height: 200px;
	border-radius: 4px;
	overflow: hidden;
	background: #ffffff;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
	display: flex;
	flex-shrink: 0;
}

.hero-carousel__cert-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
}

/* CMA/CNAS 圆形标识 */
.hero-carousel__cert-logo {
	width: 160px;
	height: 160px;
	border-radius: 50%;
	overflow: hidden;
	background: #ffffff;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.hero-carousel__cert-logo img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	pointer-events: none;
}

/* 右侧文字内容区（默认靠右填充，第三张用） */
.hero-carousel__text {
	flex: 1;
	min-width: 0;
	color: #ffffff;
	pointer-events: auto;
}

/* 前两张：文字只占自然宽度，与标识一起居中 */
.hero-carousel__slide--cert .hero-carousel__text {
	flex: none;
}

.hero-carousel__title {
	font-size: 42px;
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 18px;
	color: #ffffff;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-carousel__desc {
	font-size: 17px;
	line-height: 1.7;
	margin: 0 0 20px;
	color: rgba(255, 255, 255, 0.88);
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
	max-width: 640px;
}

.hero-carousel__tags {
	font-size: 14px;
	line-height: 1.6;
	margin: 0 0 28px;
	color: rgba(255, 255, 255, 0.75);
	letter-spacing: 0.5px;
}

/* 按钮组 */
.hero-carousel__btns {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

.hero-carousel__btn-primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 50px;
	padding: 0 36px;
	font-size: 16px;
	font-weight: 600;
	border: none;
	border-radius: 4px;
	background: #1a6dff;
	color: #ffffff;
	cursor: pointer;
	transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
	box-shadow: 0 4px 16px rgba(26, 109, 255, 0.4);
	pointer-events: auto;
	text-decoration: none;
}

.hero-carousel__btn-primary:hover {
	background: #0f5ce6;
	box-shadow: 0 6px 22px rgba(26, 109, 255, 0.55);
}

.hero-carousel__btn-primary:active {
	transform: scale(0.97);
}

.hero-carousel__btn-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 50px;
	padding: 0 36px;
	font-size: 16px;
	font-weight: 600;
	border: 2px solid #ff8a1f;
	border-radius: 4px;
	background: transparent;
	color: #ffffff;
	cursor: pointer;
	transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
	text-decoration: none;
	pointer-events: auto;
}

.hero-carousel__btn-secondary:hover {
	background: #ff8a1f;
	box-shadow: 0 4px 18px rgba(255, 138, 31, 0.45);
}

.hero-carousel__btn-secondary:active {
	transform: scale(0.97);
}

/* 响应式 */
/* 电脑屏幕宽度不足以支持图片+文字同排：隐藏图片，仅保留文字+按钮 */
@media (max-width: 1200px) {
	.hero-carousel__content {
		padding: 0 6%;
		gap: 0;
		justify-content: center;
	}
	/* 布局A：隐藏左侧圆形认证标识 */
	.hero-carousel__slide--cert .hero-carousel__cert-logo,
	/* 布局B：隐藏左侧证书组（含证书图片+认证标识） */
	.hero-carousel__certs-group {
		display: none;
	}
	/* 文字区域占满可用宽度，自适应换行 */
	.hero-carousel__text {
		flex: 1;
		max-width: 100%;
		text-align: center;
	}
	.hero-carousel__slide--cert .hero-carousel__text {
		flex: 1;
	}
	.hero-carousel__title,
	.hero-carousel__desc,
	.hero-carousel__tags {
		max-width: 100%;
		margin-left: auto;
		margin-right: auto;
	}
	/* 按钮组居中，两个按钮始终同一水平 */
	.hero-carousel__btns {
		justify-content: center;
		flex-wrap: nowrap;
	}
}

@media (max-width: 1024px) {
	.hero-carousel__content {
		padding: 0 6%;
		gap: 0;
		justify-content: center;
	}
	.hero-carousel__title {
		font-size: 34px;
	}
	.hero-carousel__desc {
		font-size: 15px;
	}
	.hero-carousel__slide--cert .hero-carousel__cert-logo,
	.hero-carousel__certs-group {
		display: none;
	}
	.hero-carousel__text {
		flex: 1;
		max-width: 100%;
		text-align: center;
	}
	.hero-carousel__slide--cert .hero-carousel__text {
		flex: 1;
	}
	.hero-carousel__btns {
		justify-content: center;
		flex-wrap: nowrap;
	}
}

@media (max-width: 768px) {
	.hero-carousel__content {
		padding: 0 5%;
		gap: 0;
		justify-content: center;
	}
	.hero-carousel__slide--cert .hero-carousel__cert-logo,
	.hero-carousel__certs-group {
		display: none;
	}
	.hero-carousel__text {
		flex: 1;
		max-width: 100%;
		text-align: center;
	}
	.hero-carousel__title {
		font-size: 26px;
		margin-bottom: 12px;
	}
	.hero-carousel__desc {
		font-size: 14px;
		line-height: 1.6;
		margin-bottom: 12px;
	}
	.hero-carousel__tags {
		font-size: 12px;
		margin-bottom: 18px;
	}
	.hero-carousel__btns {
		justify-content: center;
		flex-wrap: nowrap;
		gap: 12px;
	}
	.hero-carousel__btn-primary,
	.hero-carousel__btn-secondary {
		height: 42px;
		padding: 0 20px;
		font-size: 14px;
		flex-shrink: 0;
	}
}

@media (max-width: 480px) {
	.hero-carousel__content {
		padding: 0 4%;
		gap: 0;
		justify-content: center;
	}
	.hero-carousel__slide--cert .hero-carousel__cert-logo,
	.hero-carousel__certs-group {
		display: none;
	}
	.hero-carousel__text {
		flex: 1;
		max-width: 100%;
		text-align: center;
	}
	.hero-carousel__title {
		font-size: 20px;
		margin-bottom: 10px;
	}
	.hero-carousel__desc {
		font-size: 13px;
		line-height: 1.5;
		margin-bottom: 10px;
	}
	.hero-carousel__tags {
		font-size: 11px;
		margin-bottom: 14px;
	}
	.hero-carousel__btns {
		justify-content: center;
		flex-wrap: wrap;
		gap: 10px;
	}
	.hero-carousel__btn-primary,
	.hero-carousel__btn-secondary {
		height: 36px;
		padding: 0 16px;
		font-size: 13px;
		flex: 1 1 auto;
		min-width: 120px;
	}
}

/* Indicators - 由 JS 加 is-active 类切换高亮，不再用 CSS @keyframes 动画 */
.hero-carousel__indicators {
	position: absolute;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 10px;
	z-index: 2;
}

.hero-carousel__indicator {
	width: 32px;
	height: 4px;
	background: rgba(255, 255, 255, 0.4);
	border-radius: 2px;
	cursor: pointer;
	transition: background 0.3s ease, transform 0.3s ease;
}
.hero-carousel__indicator:hover {
	transform: scaleY(1.4);
}
/* JS 控制：当前真实索引加 is-active，对应指示器变亮 */
.hero-carousel__indicator.is-active {
	background: rgba(255, 255, 255, 0.95);
}

/* ========== 左右切换按钮 ========== */
.hero-carousel__btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: rgba(255, 255, 255, 0.22);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	color: #ffffff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	padding: 0;
	transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	/* 拖拽时按钮不抢事件，仍然可点击 */
	user-select: none;
}
.hero-carousel__btn:hover {
	background: #ff8a1f;
	border-color: #ff8a1f;
	color: #ffffff;
	box-shadow: 0 5px 20px rgba(255, 138, 31, 0.45);
}
.hero-carousel__btn:active {
	transform: translateY(-50%) scale(0.94);
}
.hero-carousel__btn svg {
	width: 22px;
	height: 22px;
	display: block;
}
.hero-carousel__btn--prev { left: 24px; }
.hero-carousel__btn--next { right: 24px; }

/* Responsive */
@media (max-width: 768px) {
	.hero-carousel {
		aspect-ratio: 16 / 9;
	}

	.hero-carousel__indicators {
		bottom: 16px;
		gap: 8px;
	}

	.hero-carousel__indicator {
		width: 24px;
		height: 3px;
	}

	.hero-carousel__btn {
		width: 40px;
		height: 40px;
	}
	.hero-carousel__btn--prev { left: 12px; }
	.hero-carousel__btn--next { right: 12px; }
	.hero-carousel__btn svg { width: 18px; height: 18px; }
}

@media (max-width: 480px) {
	.hero-carousel {
		aspect-ratio: 4 / 3;
	}
	.hero-carousel__indicators {
		bottom: 12px;
		gap: 6px;
	}
	.hero-carousel__indicator {
		width: 20px;
	}
	.hero-carousel__btn {
		width: 34px;
		height: 34px;
	}
	.hero-carousel__btn--prev { left: 8px; }
	.hero-carousel__btn--next { right: 8px; }
	.hero-carousel__btn svg { width: 16px; height: 16px; }
}
