@charset "UTF-8";

/*!
 * 灯箱（图片查看器）
 * 用法：给图片加 class="zoomable-image"，脚本会自动接管。
 *      可用 data-full 指定放大时加载的原图地址。
 */

/* 可放大图片的容器与自身 */
.zoomable-image-container {
	position: relative;
	cursor: pointer;
}

.zoomable-image {
	max-width: 100%;
	height: auto;
	transition: transform .4s ease;
}

/* 可放大提示：原由 medium-zoom 注入，该库已作为死代码移除，此处补回 */
.zoomable-image,
.medium-zoom-image {
	cursor: zoom-in;
}

.lightbox {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 10000;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .96);
	opacity: 0;
	transition: opacity .26s ease;
	overscroll-behavior: contain;
}

.lightbox.is-open {
	display: flex;
}

.lightbox.is-visible {
	opacity: 1;
}

.lightbox__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.lightbox__img {
	max-width: 92vw;
	max-height: 82vh;
	object-fit: contain;
	opacity: 0;
	/* transform 走短过渡：滚轮连续缩放时跟手，又不至于生硬 */
	transition: opacity .22s ease, transform .12s ease-out;
	cursor: zoom-in;
	-webkit-user-select: none;
	user-select: none;
	will-change: transform;
}

.lightbox__img.is-loaded {
	opacity: 1;
}

/* 放大后可拖动查看细节 */
.lightbox__img.is-zoomed {
	cursor: grab;
}

.lightbox__img.is-zoomed.is-dragging {
	cursor: grabbing;
	transition: none;
}

.lightbox__close {
	position: absolute;
	top: max(14px, env(safe-area-inset-top, 0px));
	right: max(14px, env(safe-area-inset-right, 0px));
	z-index: 2;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: 0;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	opacity: .7;
	transition: opacity .2s ease;
}

.lightbox__close:hover,
.lightbox__close:focus,
.lightbox__close:focus-visible {
	opacity: 1;
	outline: none;
}

.lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: 0;
	color: #fff;
	cursor: pointer;
	opacity: .5;
	transition: opacity .2s ease;
}

.lightbox__nav:hover,
.lightbox__nav:focus-visible {
	opacity: 1;
}

.lightbox__nav--prev {
	left: 8px;
}

.lightbox__nav--next {
	right: 8px;
}

.lightbox__nav svg {
	width: 26px;
	height: 26px;
	display: block;
}

.lightbox__count {
	position: absolute;
	bottom: max(22px, env(safe-area-inset-bottom, 0px));
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
	font-family: var(--font-sans);
	font-size: 12px;
	letter-spacing: .14em;
	color: rgba(255, 255, 255, .55);
}

.lightbox__hint {
	position: absolute;
	top: max(24px, env(safe-area-inset-top, 0px));
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
	font-family: var(--font-sans);
	font-size: 11px;
	letter-spacing: .1em;
	color: rgba(255, 255, 255, .35);
	pointer-events: none;
	white-space: nowrap;
}

.lightbox__loading {
	position: absolute;
	width: 28px;
	height: 28px;
	border: 1px solid rgba(255, 255, 255, .22);
	border-top-color: rgba(255, 255, 255, .85);
	border-radius: 50%;
	animation: lb-spin .8s linear infinite;
}

@keyframes lb-spin {
	to {
		transform: rotate(360deg);
	}
}

/* 小屏：手势为主，控件收窄 */
@media (max-width: 767.98px) {
	.lightbox__nav {
		width: 44px;
		height: 44px;
	}

	.lightbox__nav svg {
		width: 22px;
		height: 22px;
	}

	.lightbox__img {
		max-width: 96vw;
		max-height: 72vh;
	}

	.lightbox__hint {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lightbox,
	.lightbox__img {
		transition: none;
	}

	.lightbox__loading {
		animation: none;
	}
}
