/**
 * 单篇文章页样式（single.php / single-game.php 等）
 *
 * 原 single.php 两块内联 <style> 已合并：
 *   - 正文居中/展开收起（原 L1086）
 *   - hide-scrollbar / 缩略图滚动条 / 下载 CTA 动画 / 移动端 sticky 条 / 侧边栏（原 L1508）
 *
 * Enqueue：functions.php → youcang_enqueue_scripts()  (is_singular)
 * 依赖：youcang-style / youcang-animations
 */

/* =================================================================
 * 1. 正文内容居中（WP Block 兼容）
 * ================================================================= */

.entry-content img,
.entry-content video,
.entry-content picture,
.entry-content iframe,
.entry-content embed,
.entry-content object,
.entry-content figure,
.entry-content .wp-block-image,
.entry-content .wp-block-video,
.entry-content .wp-block-embed,
.entry-content .wp-block-embed__wrapper,
.entry-content .wp-block-gallery,
.entry-content .wp-video,
.entry-content .video-container {
	display: block;
	margin-left: auto;
	margin-right: auto;
	max-width: 100%;
}

.entry-content figure img,
.entry-content figure video,
.entry-content figure iframe,
.entry-content figure picture {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.entry-content figcaption {
	text-align: center;
}

.entry-content video,
.entry-content iframe,
.entry-content .wp-block-embed iframe {
	max-width: 100%;
	height: auto;
}

/* =================================================================
 * 2. 正文展开 / 收起
 * ================================================================= */

.entry-content-wrapper {
	overflow: hidden;
	transition: max-height 0.45s ease;
}

.entry-content-wrapper.is-expanded .entry-content-fade {
	opacity: 0;
}

.entry-content-wrapper.is-collapsed .entry-content-fade {
	opacity: 1;
}

.entry-content-wrapper:not(.is-collapsed):not(.is-expanded) .entry-content-fade {
	opacity: 0;
}

/* =================================================================
 * 3. 隐藏滚动条（通用 .hide-scrollbar）
 * ================================================================= */

.hide-scrollbar::-webkit-scrollbar {
	display: none;
}

.hide-scrollbar {
	-ms-overflow-style: none;
	scrollbar-width: none;
}

/* =================================================================
 * 4. 画廊缩略图轨道（#thumbnail-track）
 * ================================================================= */

#thumbnail-track::-webkit-scrollbar {
	height: 8px;
}

#thumbnail-track::-webkit-scrollbar-track {
	background: #1e293b;
	border-radius: 0;
}

#thumbnail-track::-webkit-scrollbar-thumb {
	background: #facc15;
	border-radius: 0;
	border: 2px solid #0f172a;
}

#thumbnail-track::-webkit-scrollbar-thumb:hover {
	background: #fbbf24;
}

/* Firefox 滚动条样式 */
#thumbnail-track {
	scrollbar-width: thin;
	scrollbar-color: #facc15 #1e293b;
}

/* =================================================================
 * 5. 下载 CTA 呼吸 / 扫光 / 图标弹动
 * ================================================================= */

@keyframes ycDownloadCtaBreath {
	0%, 100% {
		box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
	}
	50% {
		box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4), 0 0 0 4px rgba(250, 204, 21, 0.35);
	}
}

.yc-download-cta {
	animation: ycDownloadCtaBreath 2.6s ease-in-out infinite;
}

.yc-download-cta:hover,
.yc-download-cta:active {
	animation: none;
}

/* 扫光 */
@keyframes ycDownloadShine {
	0%   { transform: translateX(0); }
	60%  { transform: translateX(420%); }
	100% { transform: translateX(420%); }
}

.yc-dl-shine {
	animation: ycDownloadShine 3s ease-in-out infinite;
}

/* 下载图标弹动 */
@keyframes ycDownloadIconBounce {
	0%, 60%, 100% { transform: translateY(0); }
	30%           { transform: translateY(-2px); }
}

.yc-download-icon {
	animation: ycDownloadIconBounce 2.6s ease-in-out infinite;
}

/* =================================================================
 * 6. 移动端 sticky 下载条
 * ================================================================= */

@media (max-width: 1023.98px) {
	/* 给页面底部留出空间，避免内容被 sticky 条遮挡 */
	main {
		padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
	}

	/* sticky 条入场过渡 */
	.yc-mobile-download-bar {
		animation: ycMobileBarSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
	}

	@keyframes ycMobileBarSlide {
		from { transform: translateY(100%); opacity: 0; }
		to   { transform: translateY(0);    opacity: 1; }
	}
}

/* iOS 安全区兼容（刘海屏 home indicator） */
.yc-mobile-download-bar {
	padding-bottom: max(10px, env(safe-area-inset-bottom));
}

/* 尊重用户系统的"减少动效"偏好 */
@media (prefers-reduced-motion: reduce) {
	.yc-download-cta,
	.yc-download-icon,
	.yc-mobile-download-bar {
		animation: none !important;
	}
}

/* =================================================================
 * 7. 侧边栏样式
 * ================================================================= */

/* 侧边栏移动端全宽 */
@media (max-width: 1023.98px) {
	aside {
		width: 100%;
	}
}

/* 侧边栏卡片悬停效果 */
aside > div {
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

aside > div:hover {
	transform: translateY(-2px);
	box-shadow: 8px 8px 0 #0f172a;
}

/* 侧边栏游戏列表项优化 */
aside .line-clamp-2 {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
