/**
 * 宅游库新版首页样式（作用域 .zyh-home）。
 *
 * 版式参考 Steam / 游戏站的深色首页：
 *   首屏大图轮播 + 搜索/最近更新侧栏 → 快捷入口 → 最新更新网格 → 分类 Tab → 热门封面墙 → 免费专区
 * 颜色全部走主题变量，亮色/暗色自动适配。
 */

.zyh-home {
	--zyh-radius: 1rem;
	--zyh-radius-sm: 0.65rem;
	--zyh-surface: #ffffff;
	--zyh-surface-2: #f4f6fa;
	--zyh-border: rgba(16, 24, 40, 0.08);
	--zyh-text: var(--ri-body-color, #4a4d59);
	--zyh-heading: var(--ri-heading-color, #151922);
	--zyh-muted: #69768b;
	--zyh-accent: #2870df;
	--zyh-accent-soft: #edf4ff;
	--zyh-accent-2: #66c0f4;
	--zyh-free: #10b981;
	--zyh-vip: #f59e0b;

	display: block;
	padding-bottom: 3rem;
	color: var(--zyh-text);
}

[data-bs-theme="dark"] .zyh-home {
	--zyh-surface: #1b1e26;
	--zyh-surface-2: #21242b;
	--zyh-border: rgba(255, 255, 255, 0.07);
	--zyh-text: #b0b5bd;
	--zyh-heading: #f0f1f5;
	--zyh-muted: #9aa7bb;
	--zyh-accent: #75b7ff;
	--zyh-accent-soft: rgba(85, 157, 255, 0.13);
}

.zyh-home .zyh-home,
.zyh-home a {
	text-decoration: none;
}

/* ==================== 首屏 ==================== */
.zyh-hero {
	padding: 1.25rem 0 0.5rem;
}

.zyh-hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 330px;
	gap: 1rem;
	align-items: stretch;
}

/* --- 轮播 --- */
.zyh-slider {
	position: relative;
	width: 100%;
	min-width: 0;
	height: 280px;
	border-radius: var(--zyh-radius);
	overflow: hidden;
	background: #101418;
	box-shadow: 0 12px 34px rgba(10, 18, 35, 0.18);
}

.zyh-slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	opacity: 0;
	visibility: hidden;
	transform: scale(1.015);
	transition: opacity 0.45s ease, transform 0.6s ease, visibility 0.45s;
}

.zyh-slide.is-active {
	position: absolute;
	opacity: 1;
	visibility: visible;
	transform: scale(1);
}

.zyh-slide-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.zyh-slide-shade {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(90deg, rgba(9, 12, 18, 0.92) 0%, rgba(9, 12, 18, 0.55) 45%, rgba(9, 12, 18, 0.1) 100%),
		linear-gradient(0deg, rgba(9, 12, 18, 0.75) 0%, rgba(9, 12, 18, 0) 55%);
}

.zyh-slide-body {
	position: relative;
	z-index: 2;
	width: min(100%, 560px);
	padding: clamp(1rem, 2.4vw, 2rem);
	color: #e9eef6;
}

.zyh-slide-cat {
	display: inline-flex;
	align-items: center;
	padding: 0.15rem 0.6rem;
	border: 1px solid rgba(102, 192, 244, 0.45);
	border-radius: 999px;
	background: rgba(26, 159, 255, 0.16);
	color: #9fd8ff;
	font-size: 0.75rem;
	font-weight: 600;
}

.zyh-slide-title {
	margin: 0.55rem 0 0.4rem;
	color: #fff;
	font-size: clamp(1.25rem, 2.2vw, 1.85rem);
	font-weight: 700;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.zyh-slide-title a {
	color: inherit;
}

.zyh-slide-title a:hover {
	color: var(--zyh-accent-2);
}

.zyh-slide-desc {
	margin: 0 0 0.65rem;
	color: rgba(233, 238, 246, 0.78);
	font-size: 0.875rem;
	line-height: 1.6;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.zyh-slide-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 0.9rem;
	margin-bottom: 0.9rem;
	color: rgba(233, 238, 246, 0.72);
	font-size: 0.8125rem;
}

.zyh-slide-meta .is-free {
	color: #6ee7b7;
	font-weight: 600;
}

.zyh-slide-meta i {
	margin-right: 0.25rem;
}

.zyh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.45rem 1.15rem;
	border-radius: 0.5rem;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.4;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.zyh-btn-primary {
	background: linear-gradient(135deg, #1a9fff 0%, #0b6fb8 100%);
	color: #fff !important;
	box-shadow: 0 6px 18px rgba(26, 159, 255, 0.35);
}

.zyh-btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 9px 22px rgba(26, 159, 255, 0.45);
}

.zyh-slide-nav {
	position: absolute;
	top: 50%;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 60px;
	border: 0;
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.32);
	color: #fff;
	font-size: 1.25rem;
	cursor: pointer;
	transform: translateY(-50%);
	transition: background 0.2s ease;
}

.zyh-slide-prev {
	left: 10px;
}

.zyh-slide-next {
	right: 10px;
}

.zyh-slide-nav:hover,
.zyh-slide-nav:focus-visible {
	background: rgba(0, 0, 0, 0.6);
	outline: none;
}

.zyh-slide-dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 12px;
	z-index: 4;
	display: flex;
	justify-content: center;
	gap: 6px;
}

.zyh-dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.4);
	cursor: pointer;
	transition: width 0.2s ease, background 0.2s ease;
}

.zyh-dot.is-active {
	width: 20px;
	background: #fff;
}

/* --- 侧栏 --- */
.zyh-hero-side {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	min-width: 0;
}

.zyh-search,
.zyh-updates {
	padding: 0.9rem;
	border: 1px solid var(--zyh-border);
	border-radius: var(--zyh-radius);
	background: var(--zyh-surface);
	box-shadow: 0 6px 20px rgba(10, 18, 35, 0.06);
}

.zyh-search-row {
	display: flex;
	align-items: stretch;
	overflow: hidden;
	border: 1px solid var(--zyh-border);
	border-radius: 0.55rem;
	background: var(--zyh-surface-2);
}

.zyh-search-row input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0.55rem 0.75rem;
	border: 0;
	background: transparent;
	color: var(--zyh-text);
	font-size: 0.875rem;
	outline: none;
}

.zyh-search-row input::placeholder {
	color: var(--zyh-muted);
}

.zyh-search-row button {
	flex: 0 0 auto;
	width: 44px;
	border: 0;
	background: linear-gradient(135deg, #1a9fff, #0b6fb8);
	color: #fff;
	cursor: pointer;
}

.zyh-hot-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-top: 0.7rem;
}

.zyh-hot-tags a {
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	background: var(--zyh-surface-2);
	color: var(--zyh-muted);
	font-size: 0.75rem;
	transition: color 0.2s ease, background 0.2s ease;
}

.zyh-hot-tags a:hover {
	background: rgba(26, 159, 255, 0.14);
	color: var(--zyh-accent);
}

.zyh-updates {
	flex: 1 1 auto;
	min-height: 0;
}

.zyh-updates-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.35rem;
	color: var(--zyh-heading);
	font-size: 0.875rem;
	font-weight: 600;
}

.zyh-updates-head i {
	margin-right: 0.35rem;
	color: var(--zyh-accent);
}

.zyh-updates-head a {
	color: var(--zyh-muted);
	font-size: 0.75rem;
	font-weight: 400;
}

.zyh-updates-head a:hover {
	color: var(--zyh-accent);
}

.zyh-updates-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.zyh-updates-list li + li {
	border-top: 1px dashed var(--zyh-border);
}

.zyh-updates-list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.4rem 0;
	color: var(--zyh-text);
	font-size: 0.8125rem;
}

.zyh-updates-list a:hover .zyh-update-title {
	color: var(--zyh-accent);
}

.zyh-update-title {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	transition: color 0.2s ease;
}

.zyh-update-time {
	flex: 0 0 auto;
	color: var(--zyh-muted);
	font-size: 0.6875rem;
}

/* ==================== 快捷入口 ==================== */
.zyh-quick {
	padding: 1rem 0 0.25rem;
}

.zyh-quick-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.75rem;
}

.zyh-quick-item {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.7rem 0.8rem;
	border: 1px solid var(--zyh-border);
	border-radius: var(--zyh-radius-sm);
	background: var(--zyh-surface);
	color: var(--zyh-text);
	transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.zyh-quick-item:hover {
	transform: translateY(-2px);
	border-color: rgba(26, 159, 255, 0.45);
	box-shadow: 0 8px 20px rgba(10, 18, 35, 0.12);
}

.zyh-quick-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	color: #fff;
	font-size: 0.95rem;
}

.zyh-quick-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.35;
}

.zyh-quick-text strong {
	color: var(--zyh-heading);
	font-size: 0.875rem;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.zyh-quick-text em {
	color: var(--zyh-muted);
	font-size: 0.6875rem;
	font-style: normal;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.zyh-quick-arrow {
	margin-left: auto;
	color: var(--zyh-muted);
	font-size: 0.75rem;
}

/* ==================== 通用区块 ==================== */
.zyh-section {
	padding: 1.6rem 0 0.4rem;
}

.zyh-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 0.85rem;
}

.zyh-section-head h2 {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	margin: 0;
	color: var(--zyh-heading);
	font-size: 1.125rem;
	font-weight: 700;
}

.zyh-section-head h2 i {
	color: var(--zyh-accent);
	font-size: 1rem;
}

.zyh-more {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	color: var(--zyh-muted);
	font-size: 0.8125rem;
}

.zyh-more:hover {
	color: var(--zyh-accent);
}

.zyh-hint {
	color: var(--zyh-muted);
	font-size: 0.75rem;
}

/* ==================== 卡片网格 ==================== */
.zyh-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.9rem;
}

.zyh-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--zyh-border);
	padding: 0.35rem;
	border-radius: 0.85rem;
	background: var(--zyh-surface);
	transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.zyh-card:hover {
	transform: translateY(-3px);
	border-color: rgba(56, 120, 246, 0.32);
	box-shadow: 0 10px 24px rgba(23, 47, 88, 0.09);
}

.zyh-card-media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	border-radius: 0.55rem;
	overflow: hidden;
	background: linear-gradient(135deg, #1b2838, #0f141b);
}

.zyh-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.zyh-card:hover .zyh-card-media img {
	transform: scale(1.05);
}

.zyh-card-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: rgba(255, 255, 255, 0.25);
	font-size: 1.6rem;
}

.zyh-card-badges {
	position: absolute;
	left: 0.5rem;
	top: 0.5rem;
	display: flex;
	gap: 0.3rem;
	z-index: 2;
}

.zyh-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.1rem 0.45rem;
	border-radius: 0.35rem;
	background: rgba(0, 0, 0, 0.62);
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1.6;
	backdrop-filter: blur(4px);
}

.zyh-badge-free {
	background: rgba(16, 185, 129, 0.9);
}

.zyh-badge-price {
	background: rgba(26, 159, 255, 0.9);
}

.zyh-badge-vip {
	background: rgba(245, 158, 11, 0.92);
}

.zyh-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	padding: 0.7rem 0.4rem 0.35rem;
}

.zyh-card-cat {
	display: inline-block;
	margin-bottom: 0.5rem;
	padding: 0.15rem 0.45rem;
	border-radius: 0.3rem;
	background: var(--zyh-accent-soft);
	color: var(--zyh-accent);
	font-size: 0.6875rem;
}

.zyh-card-title {
	align-self: stretch;
	min-height: 2.9em;
	margin: 0 0 0.7rem;
	color: var(--zyh-heading);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.zyh-card-title a {
	color: inherit;
}

.zyh-card:hover .zyh-card-title {
	color: var(--zyh-accent);
}

.zyh-card-meta {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	align-self: stretch;
	flex-wrap: wrap;
	margin-top: auto;
	padding-top: 0.55rem;
	border-top: 1px solid var(--zyh-border);
	color: var(--zyh-muted);
	font-size: 0.6875rem;
}

.zyh-card-meta i {
	margin-right: 0.25rem;
}

/* ==================== 分类 Tab ==================== */
.zyh-tabs {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.zyh-tab {
	padding: 0.25rem 0.75rem;
	border: 1px solid var(--zyh-border);
	border-radius: 999px;
	background: var(--zyh-surface);
	color: var(--zyh-muted);
	font-size: 0.8125rem;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.zyh-tab:hover {
	color: var(--zyh-accent);
	border-color: rgba(26, 159, 255, 0.45);
}

.zyh-tab.is-active {
	border-color: transparent;
	background: linear-gradient(135deg, #1a9fff, #0b6fb8);
	color: #fff;
}

.zyh-tab-panel {
	display: none;
}

.zyh-tab-panel.is-active {
	display: block;
	animation: zyh-fade 0.25s ease;
}

@keyframes zyh-fade {
	from {
		opacity: 0;
		transform: translateY(4px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

.zyh-tab-more {
	margin-top: 0.75rem;
	text-align: center;
}

/* ==================== 热门封面墙 ==================== */
.zyh-covers {
	display: flex;
	gap: 0.75rem;
	overflow-x: auto;
	padding-bottom: 0.4rem;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
}

.zyh-cover {
	position: relative;
	flex: 0 0 auto;
	width: 168px;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	border-radius: var(--zyh-radius-sm);
	background: linear-gradient(135deg, #1b2838, #0f141b);
	scroll-snap-align: start;
	transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.zyh-cover:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 26px rgba(10, 18, 35, 0.3);
}

.zyh-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.zyh-cover::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(0deg, rgba(8, 12, 18, 0.92) 0%, rgba(8, 12, 18, 0.15) 45%, rgba(8, 12, 18, 0) 70%);
}

.zyh-cover-rank {
	position: absolute;
	left: 0.5rem;
	top: 0.5rem;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.5rem;
	height: 1.5rem;
	padding: 0 0.35rem;
	border-radius: 0.4rem;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
}

.zyh-cover-rank.is-top {
	background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.zyh-cover-body {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 0.55rem 0.6rem;
	color: #fff;
}

.zyh-cover-title {
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.zyh-cover-meta {
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.6875rem;
}

.zyh-cover-meta i {
	margin-right: 0.25rem;
}

/* ==================== 响应式 ==================== */
@media (min-width: 768px) {
	.zyh-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.zyh-slider {
		height: 360px;
	}
}

@media (min-width: 1200px) {
	.zyh-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.zyh-slider {
		height: 420px;
	}
}

@media (max-width: 991.98px) {
	.zyh-hero-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.zyh-hero-side {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767.98px) {
	.zyh-hero {
		padding-top: 0.75rem;
	}

	.zyh-slider {
		height: 300px;
	}

	.zyh-slide-nav {
		width: 32px;
		height: 48px;
	}

	.zyh-prev,
	.zyh-slide-prev {
		left: 6px;
	}

	.zyh-slide-next {
		right: 6px;
	}

	.zyh-slide-body {
		padding: 0.9rem;
	}

	.zyh-slide-desc {
		display: none;
	}

	.zyh-quick-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.zyh-hero-side {
		grid-template-columns: minmax(0, 1fr);
	}

	.zyh-cover {
		width: 140px;
	}

	.zyh-section-head {
		align-items: flex-start;
	}
}

/* 减少动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
	.zyh-home *,
	.zyh-home *::before,
	.zyh-home *::after {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}
}

/* ==================== 游戏体验：轻量游戏卡片 + 人气榜单 ==================== */
.zyh-head2 {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.zyh-head2 h2 {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	margin: 0;
	color: var(--zyh-heading);
	font-size: 1.5rem;
	font-weight: 750;
	letter-spacing: -0.025em;
}

.zyh-head2 h2::before {
	content: "";
	width: 5px;
	height: 1.25rem;
	border-radius: 3px;
	background: linear-gradient(180deg, #64c9ff, #3878f6);
}

.zyh-head2-more {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.45rem 0.8rem;
	border: 1px solid var(--zyh-border);
	border-radius: 999px;
	color: var(--zyh-text);
	font-size: 0.75rem;
	transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.zyh-head2-more:hover {
	border-color: var(--zyh-accent);
	background: var(--zyh-accent-soft);
	color: var(--zyh-accent);
}

.zyh-tabs2-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 336px;
	gap: 1.25rem;
	align-items: stretch;
}

.zyh-tabs2-main {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 1rem;
	border: 1px solid var(--zyh-border);
	border-radius: 1rem;
	background: var(--zyh-surface);
}

.zyh-tabs2-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	margin-bottom: 1rem;
	padding-bottom: 0.9rem;
	border-bottom: 1px solid var(--zyh-border);
}

.zyh-tabs2-tab {
	flex: 0 0 auto;
	padding: 0.4rem 0.55rem;
	border: 0;
	border-radius: 0.5rem;
	background: transparent;
	color: var(--zyh-text);
	font: inherit;
	font-size: 0.8125rem;
	line-height: 1.6;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.2s ease, color 0.2s ease;
}

.zyh-tabs2-tab:hover {
	background: var(--zyh-surface-2);
	color: var(--zyh-heading);
}

.zyh-tabs2-tab.is-active {
	background: var(--zyh-accent-soft);
	color: var(--zyh-accent);
	font-weight: 650;
}

.zyh-tabs2-panel { display: none; }

.zyh-tabs2-panel.is-active {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	animation: zyh-fade 0.25s ease;
}

.zyh-tabs2-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1rem;
	flex: 1 1 auto;
	align-content: space-between;
}

.zyh-tab-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 0.35rem;
	border: 1px solid var(--zyh-border);
	border-radius: 0.85rem;
	background: var(--zyh-surface);
	transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.zyh-tab-card:hover,
.zyh-tab-card:focus-within {
	transform: translateY(-4px);
	border-color: rgba(56, 120, 246, 0.32);
	box-shadow: 0 10px 24px rgba(23, 47, 88, 0.09);
}

.zyh-tab-card-media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	border-radius: 0.55rem;
	background: linear-gradient(135deg, #24354d, #101b2b);
}

.zyh-tab-card-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.45s ease;
}

.zyh-tab-card:hover .zyh-tab-card-media img { transform: scale(1.055); }

.zyh-tab-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	padding: 0.7rem 0.4rem 0.35rem;
}

.zyh-tab-card-cat {
	display: inline-flex;
	max-width: 100%;
	padding: 0.15rem 0.45rem;
	overflow: hidden;
	border-radius: 0.3rem;
	background: var(--zyh-accent-soft);
	color: var(--zyh-accent);
	font-size: 0.6875rem;
	line-height: 1.5;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.zyh-tab-card-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	align-self: stretch;
	min-height: 2.9em;
	margin: 0.55rem 0 0.7rem;
	overflow: hidden;
	color: var(--zyh-heading);
	font-size: 0.9375rem;
	font-weight: 650;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.zyh-tab-card-title a { color: inherit; }
.zyh-tab-card:hover .zyh-tab-card-title a { color: var(--zyh-accent); }

.zyh-tab-card-meta {
	display: flex;
	flex-wrap: wrap;
	align-self: stretch;
	align-items: center;
	gap: 0.3rem 0.65rem;
	margin-top: auto;
	padding-top: 0.55rem;
	border-top: 1px solid var(--zyh-border);
	color: var(--zyh-muted);
	font-size: 0.6875rem;
	line-height: 1.6;
}

.zyh-tab-card-meta span { white-space: nowrap; }
.zyh-tab-card-meta span:first-child { margin-right: auto; }
.zyh-tab-card-meta i { margin-right: 0.2rem; }

/* 右侧热门榜（配色/尺寸对齐参考站） */
.zyh-rank {
	--zyh-accent: #1a9fff;
	--zyh-muted: var(--ri-secondary-color, #8a90a0);
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 0.75rem 0.9rem 0.4rem;
	border: 1px solid var(--zyh-border);
	border-radius: 0.65rem;
	background: var(--zyh-surface);
}

.zyh-rank-head {
	display: flex;
	justify-content: space-between;
	gap: 0;
	padding: 0.6rem 0;
	border-bottom: 1px solid var(--zyh-border);
}

.zyh-rank-tab {
	flex: 1 1 0;
	padding: 0;
	text-align: center;
	border: 0;
	background: none;
	color: var(--zyh-muted);
	font-size: 0.8125rem;
	line-height: 1.6;
	cursor: pointer;
	white-space: nowrap;
	transition: color 0.2s ease;
	padding: 0.4rem 0.55rem;
}

.zyh-rank-tab:hover {
	color: var(--zyh-heading);
}

.zyh-rank-tab.is-active {
	color: var(--zyh-accent);
	font-weight: 600;
}

.zyh-rank-list {
	display: none;
	flex: 1 1 auto;
	margin: 0;
	padding: 0.5rem 0 0;
	list-style: none;
}

.zyh-rank-list.is-active,
.zyh-rank-list.is-transitioning {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.zyh-rank-item {
	position: relative;
	margin: 0 0 12px;
	padding: 0;
}

.zyh-rank-item:last-child {
	margin-bottom: 0;
}

.zyh-rank-link {
	display: block;
}

/* 名次方块：1-5 渐变，6+ 浅灰底（与参考站一致） */
.zyh-rank-no {
	position: absolute;
	left: 0;
	top: 0;
	width: 25px;
	height: 30px;
	border-radius: 5px;
	background: #f6f6f6;
	color: #666;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 30px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.zyh-rank-list li:nth-child(1) .zyh-rank-no {
	background: linear-gradient(180deg, #ff8a5c 0%, #fd6d3f 100%);
	color: #fff;
}

.zyh-rank-list li:nth-child(2) .zyh-rank-no {
	background: linear-gradient(180deg, #ffca45 0%, #f9b801 100%);
	color: #fff;
}

.zyh-rank-list li:nth-child(3) .zyh-rank-no {
	background: linear-gradient(180deg, #a6e799 0%, #88d87a 100%);
	color: #fff;
}

.zyh-rank-list li:nth-child(4) .zyh-rank-no {
	background: linear-gradient(180deg, #8ec7ff 0%, #5fafff 100%);
	color: #fff;
}

.zyh-rank-list li:nth-child(5) .zyh-rank-no {
	background: linear-gradient(180deg, #dedddd 0%, #cac9c9 100%);
	color: #fff;
}

.zyh-rank-title {
	display: block;
	margin-left: 35px;
	height: 30px;
	line-height: 30px;
	color: var(--zyh-heading);
	font-size: 0.8125rem;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color 0.2s ease;
}

.zyh-rank-link:hover .zyh-rank-title {
	color: var(--zyh-accent);
}

/* 始终且只展开一条：详情 + 名次方块拉满整行高度（同参考站 .now） */
.zyh-rank-detail {
	display: none;
	align-items: flex-start;
	gap: 0.5rem;
	margin-left: 35px;
	padding: 0.35rem 0 0.15rem;
}

.zyh-rank-item.is-active .zyh-rank-detail {
	display: flex;
}

.zyh-rank-item.is-active .zyh-rank-no {
	height: 100%;
	line-height: 90px;
}

.zyh-rank-thumb {
	flex: 0 0 80px;
	width: 80px;
	height: 60px;
	object-fit: cover;
	border: 1px solid var(--zyh-border);
	border-radius: 10px;
	background: #0f141b;
}

.zyh-rank-info {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	min-width: 0;
}

.zyh-rank-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	color: var(--zyh-muted);
	font-size: 0.75rem;
	line-height: 1.4;
}

.zyh-rank-cat,
.zyh-rank-series {
	display: inline-flex;
	align-items: center;
}

.zyh-rank-cat::before,
.zyh-rank-series::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	margin-right: 5px;
}

.zyh-rank-cat::before {
	background: rgba(33, 99, 232, 0.75);
}

.zyh-rank-series::before {
	background: rgba(247, 195, 46, 0.75);
}

.zyh-rank-sub {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	color: var(--zyh-muted);
	font-size: 0.75rem;
}

.zyh-rank-sub i {
	margin-right: 0.2rem;
}

/* 热门榜滑动窗口：保留原有榜单外观，只为面板切换提供裁切和布局。 */
.zyh-rank-viewport {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 1 0 auto;
	min-width: 0;
	overflow: hidden;
}

.zyh-rank-list[hidden] { display: none !important; }
.zyh-rank-tab.is-pending { color: var(--zyh-accent); }
.zyh-rank.is-loading .zyh-rank-viewport { opacity: 0.65; }

/* 提示只供辅助技术读取，避免主题未加载隐藏样式时撑高榜单。 */
.zyh-rank-status {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.zyh-rank-tab:focus-visible,
.zyh-rank-link:focus-visible {
	outline: 2px solid var(--zyh-accent);
	outline-offset: -2px;
}

[data-bs-theme="dark"] .zyh-rank {
	--zyh-muted: #8891a1;
}

.zyh-tabs2-tab:focus-visible,
.zyh-tab-card a:focus-visible,
.zyh-head2-more:focus-visible {
	outline: 2px solid var(--zyh-accent);
	outline-offset: 3px;
}

@media (max-width: 1199.98px) {
	.zyh-tabs2-layout { grid-template-columns: minmax(0, 1fr); }
	.zyh-tabs2-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.zyh-rank { display: none; }
}

@media (max-width: 767.98px) {
	.zyh-tabs2-main { padding: 0.75rem; border-radius: 0.85rem; }
	.zyh-tabs2-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
	.zyh-tabs2-bar::-webkit-scrollbar { display: none; }
	.zyh-tabs2-tab { padding-inline: 0.65rem; }
	.zyh-tabs2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
	.zyh-head2 h2 { font-size: 1.25rem; }
	.zyh-tab-card-body { padding-inline: 0.2rem; }
	.zyh-tab-card-title { font-size: 0.8125rem; }
	.zyh-tab-card-meta { gap: 0.25rem 0.4rem; font-size: 0.625rem; }
}

/* ==================== 首页小工具输出（模块化首页） ==================== */
.zyh-home-widget {
	padding-bottom: 0;
}

.zyh-home-widget .zyh-section {
	padding-top: 0.5rem;
	padding-bottom: 0.5rem;
}

.zyh-home-widget .zyh-tabs2 {
	margin-bottom: 0;
}

.zyh-tabs2-no-rank {
	grid-template-columns: minmax(0, 1fr);
}

/* 标题居中（像「每日更新」那样） */
.zyh-head2-center {
	justify-content: center;
}

.zyh-head2-center h2 {
	text-align: center;
}
/* 「每日更新」模块：标题左对齐 + 右侧「今日更新：N」角标 */
.zyh-daily-head .section-title,
.zyh-daily-head .title {
	position: relative;
	padding-right: 150px;
	margin-bottom: 1rem;
	text-align: left !important;
}

.zyh-daily-head .section-title h3,
.zyh-daily-head .title h3 {
	margin: 0;
	text-align: left;
}

.zyh-daily-count {
	position: absolute;
	right: 0;
	top: 50%;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 0.25rem 0.7rem;
	border: 1px solid var(--zyh-border);
	border-radius: 999px;
	background: var(--zyh-surface);
	color: var(--zyh-muted);
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.6;
	white-space: nowrap;
	transform: translateY(-50%);
}

.zyh-daily-count i {
	color: var(--zyh-accent);
}

.zyh-daily-count b {
	margin-left: 2px;
	color: #f97316;
	font-weight: 600;
}

/* 默认模块化首页的图文卡片，与游戏体验使用同一套间距和层次。 */
.home-widget .post-item.item-grid:not(.grid-overlay) {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 0.35rem;
	border: 1px solid rgba(16, 24, 40, 0.08);
	border-radius: 0.85rem;
	box-shadow: none;
	transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.home-widget .post-item.item-grid:not(.grid-overlay):hover {
	border-color: rgba(56, 120, 246, 0.32);
	box-shadow: 0 10px 24px rgba(23, 47, 88, 0.09);
}

.home-widget .post-item.item-grid:not(.grid-overlay) .entry-media {
	--ri-aspect-ratio: 62.5%;
	overflow: hidden;
	border-radius: 0.55rem;
}

.home-widget .post-item.item-grid:not(.grid-overlay) .entry-wrapper {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 0.85rem 0.5rem 0.5rem;
}

.home-widget .post-item.item-grid:not(.grid-overlay) .entry-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	min-height: 2.9em;
	overflow: hidden;
	font-size: 0.9375rem;
	font-weight: 650;
	line-height: 1.45;
	white-space: normal;
	overflow-wrap: anywhere;
}

.home-widget .post-item.item-grid:not(.grid-overlay) .entry-cat-dot {
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-bottom: 0.55rem;
}

.home-widget .post-item.item-grid:not(.grid-overlay) .entry-cat-dot > a {
	margin: 0;
	padding: 0.15rem 0.45rem;
	border-radius: 0.3rem;
	background: #edf4ff;
	color: #2870df;
	font-size: 0.6875rem;
}

.home-widget .post-item.item-grid:not(.grid-overlay) .entry-cat-dot > a::before { display: none; }

.home-widget .post-item.item-grid:not(.grid-overlay) .entry-meta {
	flex-wrap: wrap;
	gap: 0.3rem 0.6rem;
	margin-top: auto;
	padding-top: 0.65rem;
	border-top: 1px solid rgba(16, 24, 40, 0.08);
	font-size: 0.6875rem;
}

.home-widget .post-item.item-grid:not(.grid-overlay) .entry-meta > span { margin-right: 0; }

[data-bs-theme="dark"] .home-widget .post-item.item-grid:not(.grid-overlay),
[data-bs-theme="dark"] .home-widget .post-item.item-grid:not(.grid-overlay) .entry-meta {
	border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .home-widget .post-item.item-grid:not(.grid-overlay) .entry-cat-dot > a {
	background: rgba(85, 157, 255, 0.13);
	color: #75b7ff;
}

@media (prefers-reduced-motion: reduce) {
	.home-widget .post-item.item-grid:not(.grid-overlay) { transition: none; }
	.home-widget .post-item.item-grid:not(.grid-overlay):hover,
	.zyh-tab-card:hover,
	.zyh-tab-card:focus-within { transform: none; }
}

@media (max-width: 575.98px) {
	.zyh-daily-head .section-title,
	.zyh-daily-head .title {
		padding-right: 0;
	}

	.zyh-daily-count {
		position: static;
		margin-top: 0.5rem;
		transform: none;
	}
}
/* AJAX 懒加载中的过渡（不影响布局） */
.zyh-tabs2-panel.is-loading .zyh-tabs2-grid,
.zyh-rank-list.is-loading {
	opacity: 0.35;
	transition: opacity 0.15s ease;
}
/* 切换热榜/分类时页面高度会变化，固定滚动条槽位，避免出现/消失滚动条造成整页左右横移 */
html {
	scrollbar-gutter: stable;
}
/* 首页搜索模块（.home-search-box）的样式已集中到 assets/css/search-box.css
   + assets/js/search-box.js，并在首页无条件加载（enqueue_search_box_assets）。
   原来这里的 object-fit: contain + top:-425px、search-warp 固定高度等规则只在
   「首页游戏体验小工具被启用」或「使用插件页面模板」时才加载（见 enqueue_assets），
   模块化首页里根本不生效，所以移出去并改成「宽 100% + 高度按图片比例」。 */
