/**
 * ============================================================
 * 【新增文件】single-photo-album.css — 写真集详情页专属样式
 * ------------------------------------------------------------
 * 1. 仅在「素材资源下载风格」文章详情页由模板晚加载，不影响其他页面；
 * 2. 配色复用主题 CSS 变量（--pcgh-*）并带兜底值，跟随后台强调色；
 * 3. 类名前缀统一为 .pcgh-ph-（photo album），避免与主题现有样式冲突。
 * ============================================================
 */

/* ---------- 页面基础 ---------- */
.pcgh-ph-single {
	padding: 24px 0 60px;
	color: var(--pcgh-text, #e6e8eb);
}

/* ---------- 面包屑 ---------- */
.pcgh-ph-breadcrumb {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 18px;
	font-size: 13px;
	color: var(--pcgh-text-3, #6b7785);
}

.pcgh-ph-breadcrumb a {
	color: var(--pcgh-text-2, #a4adb8);
	text-decoration: none;
	transition: color .2s ease;
}

.pcgh-ph-breadcrumb a:hover { color: var(--pcgh-primary, #3b82f6); }

.pcgh-ph-breadcrumb em {
	font-style: normal;
	color: var(--pcgh-text-2, #a4adb8);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 46%;
}

/* ---------- 标题区 ---------- */
.pcgh-ph-hero { margin-bottom: 24px; }

.pcgh-ph-hero__title {
	margin: 0 0 14px;
	font-size: 26px;
	line-height: 1.35;
	color: var(--pcgh-text, #e6e8eb);
}

/* 信息条：分类 / 日期 / 浏览 / 张数 / 大小 / 下载量（纯文本，无胶囊美化） */
.pcgh-ph-hero__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 14px;
	font-size: 13px;
	color: var(--pcgh-text-2, #a4adb8);
}

.pcgh-ph-meta-item a { color: inherit; text-decoration: none; }

.pcgh-ph-meta-item a:hover { color: var(--pcgh-primary, #3b82f6); text-decoration: underline; }

/* ---------- 通用区块 ---------- */
.pcgh-ph-section {
	margin-bottom: 28px;
	padding: 20px;
	background: var(--pcgh-surface, #1a1f2e);
	border: 1px solid var(--pcgh-border, #232b35);
	border-radius: var(--pcgh-radius-lg, 14px);
}

.pcgh-ph-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--pcgh-border, #232b35);
}

.pcgh-ph-section__head h2 {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 17px;
	color: var(--pcgh-text, #e6e8eb);
}

.pcgh-ph-section__head h2 svg { width: 17px; height: 17px; color: var(--pcgh-primary, #3b82f6); }

.pcgh-ph-section__head h2 small { color: var(--pcgh-text-3, #6b7785); font-size: 13px; font-weight: 400; }

.pcgh-ph-section__tip { font-size: 12px; color: var(--pcgh-text-3, #6b7785); }

/* ---------- 简介正文 ---------- */
.pcgh-ph-intro__body {
	font-size: 14px;
	line-height: 1.9;
	color: var(--pcgh-text-2, #a4adb8);
	word-break: break-word;
}

.pcgh-ph-intro__body img {
	max-width: 100%;
	height: auto;
	border-radius: var(--pcgh-radius, 10px);
}

/* ---------- 写真画廊（大图主视图 + 缩略图条） ---------- */
.pcgh-ph-gallery__viewer {
	display: flex;
	flex-direction: column;
	align-items: center; /* 主视图随图片尺寸收缩居中 */
	gap: 12px;
}

/* 主视图舞台：尺寸跟随图片，点击打开灯箱 */
.pcgh-ph-gallery__stage {
	position: relative;
	display: block;
	width: auto;          /* 收缩包裹图片，不再撑满整行 */
	max-width: 100%;
	margin: 0 auto;
	padding: 0;
	border: 0;
	border-radius: var(--pcgh-radius, 10px);
	overflow: hidden;
	background: var(--pcgh-surface-2, #1d242c);
	cursor: zoom-in;
}

/* 主图：保持原始比例，容器随图撑开，长图不留白 */
.pcgh-ph-gallery__main {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 82vh; /* 仅防超高，不裁切不留白 */
}

/* 计数角标（右下角，1 / 6 样式） */
.pcgh-ph-gallery__count {
	position: absolute;
	right: 12px;
	bottom: 12px;
	padding: 3px 12px;
	border-radius: 999px;
	background: rgba(10, 14, 19, .72);
	color: #fff;
	font-size: 12px;
	line-height: 1.6;
	pointer-events: none;
}

/* 悬浮放大图标遮罩 */
.pcgh-ph-gallery__zoom {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(10, 14, 19, .35);
	color: #fff;
	opacity: 0;
	transition: opacity .25s ease;
	pointer-events: none;
}

.pcgh-ph-gallery__zoom svg { width: 28px; height: 28px; }

.pcgh-ph-gallery__stage:hover .pcgh-ph-gallery__zoom,
.pcgh-ph-gallery__stage:focus-visible .pcgh-ph-gallery__zoom { opacity: 1; }

/* 缩略图条：横向滚动，选中项主题色描边 */
.pcgh-ph-gallery__thumbs {
	align-self: stretch; /* 父容器居中收缩时，缩略图条仍占整行 */
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding-bottom: 4px;
	scrollbar-width: thin;
}

.pcgh-ph-gallery__thumb {
	flex: 0 0 auto;
	width: 96px;
	height: 64px;
	padding: 0;
	border-radius: 8px;
	overflow: hidden;
	border: 2px solid transparent;
	background: var(--pcgh-surface-2, #1d242c);
	cursor: pointer;
	opacity: .7;
	transition: opacity .2s ease, border-color .2s ease;
}

.pcgh-ph-gallery__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pcgh-ph-gallery__thumb:hover { opacity: 1; }

.pcgh-ph-gallery__thumb.is-active {
	border-color: var(--pcgh-primary, #3b82f6);
	opacity: 1;
}

/* 画廊空状态提示 */
.pcgh-ph-empty {
	margin: 0;
	padding: 30px;
	text-align: center;
	font-size: 13px;
	color: var(--pcgh-text-3, #6b7785);
	border: 1px dashed var(--pcgh-border, #232b35);
	border-radius: var(--pcgh-radius, 10px);
}

/* ---------- 下载区 ---------- */
.pcgh-ph-download__panel {
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	gap: 20px;
	padding: 18px;
	border-radius: var(--pcgh-radius, 10px);
	background:
		linear-gradient(135deg, rgba(var(--pcgh-primary-rgb, 59, 130, 246), .08), transparent 55%),
		var(--pcgh-surface-2, #1d242c);
	border: 1px solid var(--pcgh-border, #232b35);
}

.pcgh-ph-download__info strong {
	display: block;
	margin-bottom: 10px;
	font-size: 15px;
	color: var(--pcgh-text, #e6e8eb);
}

.pcgh-ph-download__tips {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 6px;
	font-size: 12px;
	color: var(--pcgh-text-3, #6b7785);
}

.pcgh-ph-download__tips li::before { content: '· '; color: var(--pcgh-primary, #3b82f6); font-weight: 700; }

.pcgh-ph-download__tips a { color: var(--pcgh-primary, #3b82f6); text-decoration: none; }

.pcgh-ph-download__tips a:hover { text-decoration: underline; }

.pcgh-ph-download__action {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	flex-shrink: 0;
}

/* 大号下载按钮（状态由模板输出：免费/登录/评论/积分/VIP） */
.pcgh-ph-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 180px;
	padding: 13px 26px;
	border: none;
	border-radius: 12px;
	background: linear-gradient(135deg, var(--pcgh-primary, #3b82f6), var(--pcgh-primary-2, #2563eb));
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(var(--pcgh-primary-rgb, 59, 130, 246), .35);
	transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.pcgh-ph-btn:hover {
	transform: translateY(-2px);
	filter: brightness(1.08);
	box-shadow: 0 10px 24px rgba(var(--pcgh-primary-rgb, 59, 130, 246), .45);
}

.pcgh-ph-btn svg { width: 17px; height: 17px; }

.pcgh-ph-btn.is-disabled {
	background: var(--pcgh-surface, #1a1f2e);
	color: var(--pcgh-text-3, #6b7785);
	box-shadow: none;
	cursor: not-allowed;
	transform: none;
	filter: none;
	border: 1px solid var(--pcgh-border, #232b35);
}

.pcgh-ph-download__safe {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	color: var(--pcgh-text-3, #6b7785);
}

.pcgh-ph-download__safe svg { width: 12px; height: 12px; color: #22c55e; }

/* ---------- 标签 ---------- */
.pcgh-ph-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 28px;
}

.pcgh-ph-tag {
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--pcgh-surface, #1a1f2e);
	border: 1px solid var(--pcgh-border, #232b35);
	font-size: 12px;
	color: var(--pcgh-text-2, #a4adb8);
	text-decoration: none;
	transition: all .2s ease;
}

.pcgh-ph-tag:hover {
	color: var(--pcgh-primary, #3b82f6);
	border-color: rgba(var(--pcgh-primary-rgb, 59, 130, 246), .5);
}

/* ---------- 相关写真 ---------- */
.pcgh-ph-related__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 14px;
}

.pcgh-ph-rel-card {
	display: block;
	text-decoration: none;
	color: inherit;
	border-radius: var(--pcgh-radius, 10px);
	overflow: hidden;
	background: var(--pcgh-surface-2, #1d242c);
	border: 1px solid var(--pcgh-border, #232b35);
	transition: transform .25s ease, border-color .25s ease;
}

.pcgh-ph-rel-card:hover {
	transform: translateY(-3px);
	border-color: rgba(var(--pcgh-primary-rgb, 59, 130, 246), .5);
}

.pcgh-ph-rel-card__cover {
	position: relative;
	display: block;
	aspect-ratio: 3 / 4;      /* 竖版封面比例 */
	overflow: hidden;
	background: var(--pcgh-surface, #1a1f2e);
}

.pcgh-ph-rel-card__cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .35s ease;
}

.pcgh-ph-rel-card:hover .pcgh-ph-rel-card__cover img { transform: scale(1.05); }

/* 图片数量角标 */
.pcgh-ph-rel-card__count {
	position: absolute;
	right: 6px;
	bottom: 6px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 8px;
	border-radius: 6px;
	background: rgba(10, 14, 19, .75);
	color: #fff;
	font-size: 11px;
	font-style: normal;
}

.pcgh-ph-rel-card__count svg { width: 11px; height: 11px; }

.pcgh-ph-rel-card__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	padding: 10px 10px 4px;
	font-size: 13px;
	line-height: 1.45;
	color: var(--pcgh-text, #e6e8eb);
}

.pcgh-ph-rel-card:hover .pcgh-ph-rel-card__title { color: var(--pcgh-primary, #3b82f6); }

.pcgh-ph-rel-card__meta {
	display: block;
	padding: 0 10px 10px;
	font-size: 11px;
	color: var(--pcgh-text-3, #6b7785);
}

/* ---------- 两栏布局：主内容 + 右侧小工具侧栏 ---------- */
.pcgh-ph-layout {
	display: grid;
	grid-template-columns: 1fr; /* 未配置侧栏小工具时单栏占满 */
	gap: 24px;
	align-items: start;
}

.pcgh-ph-layout.has-side {
	grid-template-columns: minmax(0, 1fr) 320px; /* 右栏 320px 放小工具 */
	align-items: flex-start; /* 与游戏页一致：侧栏自身高度、顶部对齐 */
}

.pcgh-ph-main {
	min-width: 0; /* 防止画廊撑破网格列 */
}

.pcgh-ph-side {
	min-width: 0;
	display: grid;
	gap: 16px; /* 多个小工具之间的间距 */
	/* 与主题 .pcgh-single__side 完全一致：宽屏滚动时侧栏钉住（sticky） */
	position: sticky;
	top: calc(var(--pcgh-header-h, 72px) + 18px);
	align-self: flex-start;
}

/* 窄屏：侧栏折到主内容下方并取消 sticky（与游戏页主题断点行为一致；需覆盖 has-side 的两栏规则） */
@media (max-width: 1100px) {
	.pcgh-ph-layout,
	.pcgh-ph-layout.has-side {
		grid-template-columns: 1fr;
	}

	.pcgh-ph-side {
		position: static; /* 同主题窄屏规则 */
		width: 100%;
		max-width: none;
	}
}

/* ---------- 大图灯箱 ---------- */
/* hidden 属性必须真正隐藏灯箱，否则透明遮罩会拦截整页点击 */
.pcgh-ph-lightbox[hidden] {
	display: none;
}

.pcgh-ph-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none; /* 关闭态不拦截任何点击；打开态恢复 */
	transition: opacity .22s ease;
}

.pcgh-ph-lightbox.is-open {
	opacity: 1;
	pointer-events: auto; /* 打开后可编辑交互 */
}

.pcgh-ph-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(8, 11, 15, .92);
	backdrop-filter: blur(6px);
}

.pcgh-ph-lightbox__body {
	position: relative;
	margin: 0;
	max-width: 94vw;
	text-align: center;
}

.pcgh-ph-lightbox__img {
	max-width: 94vw;
	max-height: 84vh;
	border-radius: var(--pcgh-radius-lg, 14px);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
	object-fit: contain;
}

.pcgh-ph-lightbox__caption {
	margin-top: 12px;
	font-size: 13px;
	color: var(--pcgh-text-2, #a4adb8);
}

.pcgh-ph-lightbox__btn {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 1px solid rgba(255, 255, 255, .14);
	border-radius: 50%;
	background: rgba(255, 255, 255, .08);
	color: #fff;
	cursor: pointer;
	transition: background .2s ease;
}

.pcgh-ph-lightbox__btn svg { width: 20px; height: 20px; }

.pcgh-ph-lightbox__btn:hover { background: var(--pcgh-primary, #3b82f6); }

.pcgh-ph-lightbox__btn.is-close { top: 22px; right: 26px; }

.pcgh-ph-lightbox__btn.is-prev { left: 26px; top: 50%; transform: translateY(-50%); }

.pcgh-ph-lightbox__btn.is-next { right: 26px; top: 50%; transform: translateY(-50%); }

/* 张数计数器（右下角 3 / 48） */
.pcgh-ph-lightbox__counter {
	position: absolute;
	right: 30px;
	bottom: 26px;
	padding: 4px 12px;
	border-radius: 999px;
	background: rgba(10, 14, 19, .7);
	color: #fff;
	font-size: 12px;
}

/* ---------- 响应式（沿用主题 1100 / 720 双断点） ---------- */
@media (max-width: 1100px) {
	.pcgh-ph-hero__title { font-size: 23px; }

	.pcgh-ph-download__panel { flex-direction: column; }

	.pcgh-ph-download__action { align-items: stretch; }

	.pcgh-ph-download__action .pcgh-ph-btn { width: 100%; }
}

@media (max-width: 720px) {
	.pcgh-ph-single { padding-top: 12px; }

	.pcgh-ph-hero__title { font-size: 20px; }

	.pcgh-ph-section { padding: 14px; }

	.pcgh-ph-gallery__thumb { width: 72px; height: 48px; }

	.pcgh-ph-related__grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

	.pcgh-ph-lightbox__btn.is-prev,
	.pcgh-ph-lightbox__btn.is-next { display: none; } /* 小屏靠点击左右半屏切换（JS 已支持触摸滑动） */

	.pcgh-ph-lightbox__btn.is-close { top: 12px; right: 12px; }

	.pcgh-ph-lightbox__counter { right: 14px; bottom: 14px; }
}
