/* 相册大图查看器：三图轨道 + 底图占位 + 故事条 */
.gv {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: #000;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.gv-stage {
	position: absolute;
	inset: 0;
	overflow: hidden;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}

.gv-track {
	display: flex;
	height: 100%;
	will-change: transform;
}

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

.gv-slide.is-empty {
	visibility: hidden;
}

.gv-inner {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	transform-origin: center center;
	will-change: transform;
}

/* 小图铺满 + 模糊，作为大图加载期间的底 */
.gv-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: blur(24px) saturate(1.05);
	opacity: 0.5;
	transform: scale(1.15);
	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;
}

.gv-bg.is-hidden {
	opacity: 0;
}

.gv-img {
	position: relative;
	max-width: 94%;
	max-height: 94%;
	object-fit: contain;
	opacity: 0;
	transition: opacity 0.22s ease;
	user-select: none;
	-webkit-user-drag: none;
}

.gv-img.is-loaded {
	opacity: 1;
}

.gv-bar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px calc(16px + env(safe-area-inset-top, 0px));
	pointer-events: none;
}

.gv-count {
	padding: 8px 14px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	color: rgba(255, 255, 255, 0.92);
	font-size: 13px;
	line-height: 1.2;
	letter-spacing: 0.02em;
	backdrop-filter: blur(8px);
	pointer-events: auto;
}

/* 桌面端左右翻页按钮：只在精确指针设备出现 */
.gv-nav {
	position: absolute;
	top: 50%;
	z-index: 5;
	display: none;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin-top: -23px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.22);
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	backdrop-filter: blur(8px);
	transition: background 0.2s ease, opacity 0.2s ease;
}

.gv.is-desktop .gv-nav {
	display: inline-flex;
}

.gv.is-single .gv-nav {
	display: none;
}

.gv-nav::before {
	content: "";
	width: 9px;
	height: 9px;
	border-left: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
}

.gv-prev {
	left: 22px;
}

.gv-next {
	right: 22px;
}

.gv-prev::before {
	margin-left: 3px;
	transform: rotate(45deg);
}

.gv-next::before {
	margin-right: 3px;
	transform: rotate(-135deg);
}

.gv-nav:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.24);
}

.gv-nav:disabled {
	opacity: 0.25;
	cursor: default;
}

.gv.is-desktop .gv-stage {
	cursor: grab;
}

.gv.is-desktop.is-dragging .gv-stage {
	cursor: grabbing;
}

.gv.is-desktop.is-dragging .gv-img {
	transition: none;
}

.gv-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.24);
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	backdrop-filter: blur(8px);
	cursor: pointer;
	pointer-events: auto;
}

.gv-story {
	position: absolute;
	left: 50%;
	bottom: 0;
	z-index: 4;
	width: min(720px, 100%);
	max-height: 34vh;
	overflow-y: auto;
	padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
	border-radius: 14px 14px 0 0;
	background: rgba(0, 0, 0, 0.58);
	color: rgba(255, 255, 255, 0.94);
	font-size: 14px;
	line-height: 1.7;
	white-space: pre-wrap;
	word-break: break-word;
	backdrop-filter: blur(12px);
	opacity: 0;
	transform: translate(-50%, 12px);
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: none;
}

.gv-story.is-on {
	opacity: 1;
	transform: translate(-50%, 0);
	pointer-events: auto;
}

@media (max-width: 768px) {
	.gv-bar {
		padding: 12px 14px calc(12px + env(safe-area-inset-top, 0px));
	}

	.gv-img {
		max-width: 100%;
		max-height: 100%;
	}

	.gv-story {
		max-height: 38vh;
		font-size: 13px;
		line-height: 1.65;
		border-radius: 0;
	}
}

/* 网格里“有故事”的小角标 */
.story-dot {
	position: absolute;
	right: 10px;
	bottom: 10px;
	z-index: 2;
	display: none;
	align-items: center;
	gap: 4px;
	padding: 4px 8px;
	border-radius: 999px;
	background: rgba(21, 17, 14, 0.55);
	color: rgba(255, 255, 255, 0.92);
	font-size: 11px;
	line-height: 1;
	letter-spacing: 0.04em;
	backdrop-filter: blur(6px);
}

.story-dot::before {
	content: "";
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: currentColor;
}

.has-story .story-dot {
	display: inline-flex;
}
