/* ==========================================================
   作品图片查看器（Lightbox）
   点击作品图片放大查看，Esc / 点击空白处 / 关闭按钮返回原页面
   ========================================================== */

.lb-enabled {
	cursor: zoom-in;
}

.lb {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: rgba(10, 10, 10, 0.94);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.28s ease, visibility 0.28s ease;
	-webkit-tap-highlight-color: transparent;
	/* 手势全部交给 JS 处理（双指缩放图片），不让浏览器缩放整个页面，
	   这样关闭按钮等界面元素始终保持原大、位置固定 */
	touch-action: none;
	overscroll-behavior: contain;
}

.lb.is-open {
	opacity: 1;
	visibility: visible;
}

/* 图片舞台 */
.lb-stage {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 70px 90px;
	cursor: zoom-out;
}

.lb-img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	display: block;
	object-fit: contain;
	background-color: #fff;
	box-shadow: 0 20px 70px rgba(0, 0, 0, 0.65);
	opacity: 0;
	transform: scale(0.94);
	transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.075, 0.82, 0.165, 1);
	cursor: default;
	will-change: transform;
}

/* 手势缩放过程中禁用过渡，跟手 */
.lb-img.no-anim {
	transition: none !important;
}

.lb.is-open .lb-img.is-loaded {
	opacity: 1;
	transform: scale(1);
}

/* 按钮通用样式 */
.lb-btn {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	outline: none;
	background-color: rgba(255, 255, 255, 0.08);
	color: #fafafa;
	font-family: inherit;
	font-size: 22px;
	line-height: 1;
	border-radius: 50%;
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
	transition: background-color 0.25s ease, transform 0.25s ease, opacity 0.25s ease;
}

.lb-btn:hover {
	background-color: rgba(255, 255, 255, 0.22);
}

.lb-btn:active {
	transform: scale(0.94);
}

.lb-btn:focus-visible {
	outline: 2px solid #fafafa;
	outline-offset: 2px;
}

/* 关闭 */
.lb-close {
	top: 22px;
	right: 22px;
	width: 46px;
	height: 46px;
	font-size: 26px;
	z-index: 3;
}

/* 上一张 / 下一张 */
.lb-prev,
.lb-next {
	top: 50%;
	margin-top: -26px;
	width: 52px;
	height: 52px;
	font-size: 30px;
	padding-bottom: 4px;
	z-index: 3;
}

.lb-prev {
	left: 22px;
}

.lb-next {
	right: 22px;
}

.lb.is-single .lb-prev,
.lb.is-single .lb-next,
.lb.is-single .lb-counter {
	display: none;
}

/* 计数 */
.lb-counter {
	position: absolute;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	color: #ddd;
	font-size: 14px;
	letter-spacing: 1px;
	z-index: 3;
}

/* 返回提示 */
.lb-hint {
	position: absolute;
	bottom: 22px;
	right: 26px;
	color: #777;
	font-size: 12px;
	letter-spacing: 0.5px;
	z-index: 3;
}

/* 加载中 */
.lb-img.is-loading {
	opacity: 0.15;
}

@media (max-width: 720px) {
	.lb-stage {
		padding: 60px 12px 80px;
	}

	.lb-close {
		top: 12px;
		right: 12px;
		width: 42px;
		height: 42px;
		font-size: 24px;
	}

	.lb-prev,
	.lb-next {
		top: auto;
		bottom: 18px;
		margin-top: 0;
		width: 44px;
		height: 44px;
		font-size: 26px;
	}

	.lb-prev {
		left: 16px;
	}

	.lb-next {
		right: 16px;
	}

	.lb-counter {
		bottom: 32px;
		font-size: 13px;
	}

	.lb-hint {
		display: block;
		top: 20px;
		left: 14px;
		right: auto;
		bottom: auto;
		font-size: 11px;
		color: #8a8a8a;
	}
}

/* 打开查看器时锁定页面滚动，关闭后回到原来的滚动位置 */
body.lb-lock {
	position: fixed;
	left: 0;
	right: 0;
	width: 100%;
	overflow: hidden;
}
