@charset "utf-8";
/* CSS Document */
/* ===== 根容器 ===== */
.sphere-root {
	background: url("../images/khml-gallery/earth-bg.jpg") #000000 ;
	background-position: center;
	background-repeat: no-repeat;
	background-size: 100%;
	position: relative;
	width: 100%;
	height: 85vh;
	margin: 0 auto;
	--radius: 800px;
	--segments-x: 38;
	--segments-y: 38;
	--circ: calc(var(--radius) * 3.14159);
	--rot-y: calc((360deg / var(--segments-x)) / 2);
	--rot-x: calc((360deg / var(--segments-y)) / 2);
	--item-width: calc(var(--circ) / var(--segments-x));
	--item-height: calc(var(--circ) / var(--segments-y));
	--overlay-blur-color: #000000;
	--tile-radius: 30px;
	--image-filter: grayscale(0);
	/*颜色*/
	--transition-ms: 300ms;
	--drag-dampening: 2;
}

.sphere-root * {
	box-sizing: border-box;
}

/* ===== 主容器 允许子元素点击 ===== */
.sphere-main {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	overflow: hidden;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	background: transparent;
	pointer-events: auto !important;
}

/* ===== 3D 舞台 ===== */
.stage {
	width: 100%;
	height: 100%;
	display: grid;
	place-items: center;
	perspective: calc(var(--radius) * 2);
	perspective-origin: 50% 50%;
	contain: layout paint size;
	pointer-events: auto !important;
}

/* ===== 球体 ===== */
.sphere {
	transform: translateZ(calc(var(--radius) * -1));
	will-change: transform;
	transform-style: preserve-3d;
	pointer-events: auto !important;
	transition: transform 0.05s linear;
	/* 平滑自动旋转 */
}

/* ===== 卡片 ===== */
.item {
	width: calc(var(--item-width) * var(--item-size-x, 2));
	height: calc(var(--item-height) * var(--item-size-y, 2));
	position: absolute;
	top: -999px;
	bottom: -999px;
	left: -999px;
	right: -999px;
	margin: auto;
	transform-origin: 50% 50%;
	backface-visibility: hidden;
	transition: transform 300ms;
	transform-style: preserve-3d;
	pointer-events: auto !important;
	transform: rotateY(calc(var(--rot-y) * (var(--offset-x) + ((var(--item-size-x, 2) - 1) / 2)) + var(--rot-y-delta, 0deg)))
			   rotateX(calc(var(--rot-x) * (var(--offset-y) - ((var(--item-size-y, 2) - 1) / 2)) + var(--rot-x-delta, 0deg)))
			   translateZ(var(--radius));
}

.item__image {
	position: absolute;
	display: block;
	inset: 10px;
	border-radius: var(--tile-radius, 12px);
	background: transparent;
	overflow: hidden;
	backface-visibility: hidden;
	transition: transform 300ms;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	pointer-events: auto !important;
	transform: translateZ(1px);
}

.item__image:focus {
	/*outline: 2px solid #fff;*/
}

.item__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
	backface-visibility: hidden;
	filter: var(--image-filter, none);
	display: block;
}

/* ===== 遮罩不拦截点击 ===== */
.overlay,
.overlay--blur {
	position: absolute;
	inset: 0;
	margin: auto;
	z-index: 3;
	pointer-events: none !important;
}
.overlay {
	background-image: radial-gradient(rgba(235, 235, 235, 0) 65%, var(--overlay-blur-color, #000000) 100%);
}
.overlay--blur {
	-webkit-mask-image: radial-gradient(rgba(235, 235, 235, 0) 70%, var(--overlay-blur-color, #000000) 90%);
	mask-image: radial-gradient(rgba(235, 235, 235, 0) 70%, var(--overlay-blur-color, #000000) 90%);
	backdrop-filter: blur(3px);
}

/* 边缘渐隐 */
.edge-fade {
	position: absolute;
	left: 0;
	right: 0;
	height: 120px;
	z-index: 5;
	pointer-events: none !important;
	background: linear-gradient(to bottom, transparent, var(--overlay-blur-color, #000000));
}
.edge-fade--top {
	top: 0;
	transform: rotate(180deg);
}
.edge-fade--bottom {
	bottom: 0;
}

/* ===== 移动端 ===== */
@media (max-width: 600px) {
	.sphere-root {
		--tile-radius: 16px;
	}
	.item__image {
		inset: 4px;
	}
	.edge-fade {
		height: 60px;
	}
}

/* ================================================================
   Lightbox（点击放大）
   ================================================================ */
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 999;
	background: rgba(0, 0, 0, 0.86);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.4s ease;
	padding: 24px;
}
.lightbox.active {
	opacity: 1;
	pointer-events: auto;
}
.lightbox .lb-inner {
	position: relative;
	max-width: 92vw;
	max-height: 88vh;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8);
	transform: scale(0.85);
	transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
	background: #1a1a2e;
}
.lightbox.active .lb-inner {
	transform: scale(1);
}
.lightbox img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 92vw;
	max-height: 88vh;
	object-fit: contain;
}
.lightbox .lb-close {
	position: absolute;
	top: 16px;
	right: 20px;
	font-size: 32px;
	color: rgba(255, 255, 255, 0.6);
	cursor: pointer;
	transition: color 0.25s, transform 0.25s;
	background: rgba(0, 0, 0, 0.4);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	font-weight: 300;
	line-height: 1;
	padding: 0;
}
.lightbox .lb-close:hover {
	color: #fff;
	transform: rotate(90deg);
	background: rgba(0, 0, 0, 0.6);
}
@media (max-width: 600px) {
	.lightbox .lb-close {
		top: 10px;
		right: 14px;
		font-size: 26px;
		width: 36px;
		height: 36px;
	}
	.lightbox {
		padding: 12px;
	}
}

/* ===== 自动旋转状态指示（可选装饰） ===== */
.auto-rotate-indicator {
	position: absolute;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	color: rgba(255, 255, 255, 0.25);
	font-size: 13px;
	letter-spacing: 2px;
	pointer-events: none;
	font-weight: 300;
	text-transform: uppercase;
	transition: opacity 0.6s ease;
	opacity: 0.5;
}
.auto-rotate-indicator.paused {
	opacity: 0.15;
}
@media (max-width: 600px) {
	.auto-rotate-indicator {
		bottom: 16px;
		font-size: 10px;
	}
}
