:root {
	--slide-width-desktop: 40%; /* 桌機版中間卡片寬度 */
	--slide-width-mobile: 85%; /* 手機版中間卡片寬度 */
	--gap: 15px; /* 卡片間距 */
	--bg-color: #1a1a1a;
	--text-color: #ffffff;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* body {
	font-family: "PingFang TC", "Heiti TC", sans-serif;
	background-color: var(--bg-color);
	color: var(--text-color);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	overflow-x: hidden;
} */

h2 {
	margin-bottom: 20px;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.carousel-stage {
	font-family: "PingFang TC", "Heiti TC", sans-serif;
	width: 100%;
	max-width: 2000px;
	overflow: hidden;
	position: relative;
	padding: 30px 0;
	perspective: 1500px;
	touch-action: pan-y;
}

.carousel-track {
	display: flex;
	align-items: center;
	transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
	will-change: transform;
	transform: translateX(calc(-1 * var(--slide-width-desktop)));
}

.carousel-track.no-anim .slide {
	transition: none !important;
}

.carousel-track.no-anim {
	transition: none !important;
}

.slide {
	position: relative;
	flex: 0 0 var(--slide-width-desktop);
	width: var(--slide-width-desktop);
	aspect-ratio: 8 / 5;
	margin: 0 var(--gap);
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);

	transition:
		transform 0.6s ease,
		opacity 0.6s ease;

	opacity: 0.3;
	transform: scale(0.8) translateZ(-150px);
	z-index: 1;
	cursor: pointer;
}

.slide:hover {
	cursor: pointer;
}

@media (max-width: 768px) {
	.slide {
		flex: 0 0 var(--slide-width-mobile);
		width: var(--slide-width-mobile);
		/* height: 250px; */
		transform: scale(0.8) translateZ(-100px);
	}
}

/* 圖片樣式 */
.slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.slide span {
	position: absolute;
	color: #fff;
	bottom: 0;
	left: 0;
	width: 100%;
	padding: 20px;
	font-weight: 500;
	font-size: 16px;
	letter-spacing: 1px;
	text-shadow: 0px 0px 10px rgba(10, 10, 10, 1);
}

.slide.active {
	opacity: 1;
	transform: scale(1.1) translateZ(0);
	z-index: 10;
}

.controls {
	display: flex;
	gap: 20px;
	margin-top: 30px;
}

button {
	padding: 10px 20px;
	background-color: rgba(255, 255, 255, 0.1);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 5px;
	cursor: pointer;
	transition: background 0.3s;
}

button:hover {
	background-color: rgba(255, 255, 255, 0.2);
}

.flash-container {
	width: 100%; /* 你的設定 */
	margin: 0 auto; /* 置中 */
	overflow: hidden;
	position: relative;
}

.imgs-container {
	display: flex;
	/* width: fit-content; */
	/* 初始位移：向左推「一個父容器寬度」 */
	transform: translateX(-100%);
	transition: transform 0.5s ease-in-out;
	will-change: transform;
}

.imgitem {
	/* width: 100%; */
	/* 或者為了保險，使用繼承父層寬度 */
	flex: 0 0 calc(100% - 20px);
	margin: 10px;
	aspect-ratio: 8 / 5;
	box-sizing: border-box;
	position: relative;
	border-radius: 10px;
	overflow-x: hidden;
}

.imgitem.active:hover {
	cursor: pointer;
}

.imgitem img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.imgitem span {
	position: absolute;
	color: #fff;
	bottom: 0;
	left: 0;
	width: 100%;
	padding: 20px;
	font-weight: 500;
	font-size: 16px;
	letter-spacing: 1px;
	text-shadow: 0px 0px 10px rgba(10, 10, 10, 1);
}

.pagination {
	display: flex;
	gap: 10px;
	justify-content: center;
	/* position: absolute; */
	/* bottom: 15px; */
	/* left: 0; */
	padding: 15px;
	width: 100%;
	z-index: 10;
}

.pagination .dot {
	width: 10px;
	height: 10px;
	background-color: rgba(255, 255, 255, 0.5);
	border-radius: 50%;
	cursor: pointer;
	transition: all 0.3s ease;
}

.pagination .dot.focus {
	background-color: #185e99;
	transform: scale(1.1);
}

.hidden {
    opacity: 0;
    visibility: hidden; /* 讓元素不可見且不可點擊 */
    height: 0;          /* 如果需要完全不佔空間 */
    overflow: hidden;   /* 配合 height: 0 使用 */
    pointer-events: none; /* 徹底禁止滑鼠事件 */
}