/* 银河录像局 - 文章页样式 */

.yhj-single {
	font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.7;
	color: #333;
	background: #f4f4f4;
	-webkit-font-smoothing: antialiased;
}

.yhj-single .yhj-breadcrumb a,
.yhj-single .yhj-related a,
.yhj-single .yhj-hot-list a,
.yhj-single .yhj-post-nav a {
	text-decoration: none;
	color: inherit;
}

/* Breadcrumb */
.yhj-breadcrumb {
	background: #fff;
	border-bottom: 1px solid #f0f0f0;
}

.yhj-breadcrumb__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 12px 24px;
	font-size: 13px;
	color: #999;
}

.yhj-breadcrumb a {
	color: #999;
	transition: color 0.2s;
}

.yhj-breadcrumb a:hover {
	color: #007bff;
}

.yhj-breadcrumb span {
	margin: 0 6px;
	color: #ccc;
}

/* Layout */
.yhj-single-wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 24px;
	align-items: start;
}

/* Article card */
.yhj-article {
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
	padding: 32px 36px;
	min-width: 0;
	overflow: hidden;
}

.yhj-article__title {
	font-size: clamp(22px, 3vw, 28px);
	font-weight: 700;
	color: #222;
	line-height: 1.4;
	margin-bottom: 16px;
}

.yhj-article__meta {
	font-size: 13px;
	color: #999;
	margin-bottom: 28px;
	padding-bottom: 20px;
	border-bottom: 1px solid #f0f0f0;
}

.yhj-article__meta span {
	margin-right: 16px;
}

.yhj-article__meta a {
	color: #007bff;
}

/* Article content typography */
.yhj-article__content {
	font-size: 16px;
	line-height: 1.7;
	color: #333;
	word-wrap: break-word;
	overflow-wrap: break-word;
	min-width: 0;
	max-width: 100%;
	overflow-x: hidden;
}

.yhj-article__content > * {
	max-width: 100%;
	box-sizing: border-box;
}

.yhj-article__content p {
	margin-bottom: 1.2em;
}

.yhj-article__content h2,
.yhj-article__content h3,
.yhj-article__content h4 {
	font-weight: 700;
	color: #222;
	margin: 1.6em 0 0.8em;
	padding-left: 14px;
	border-left: 4px solid #007bff;
	line-height: 1.4;
}

.yhj-article__content h2 {
	font-size: 20px;
}

.yhj-article__content h3 {
	font-size: 18px;
}

.yhj-article__content h4 {
	font-size: 16px;
}

.yhj-article__content a {
	color: #007bff;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.yhj-article__content a:hover {
	color: #0056b3;
}

/* 正文图片：等比缩放，不拉伸变形 */
.yhj-article__content figure,
.yhj-article__content .wp-block-image,
.yhj-article__content .wp-caption {
	display: block;
	max-width: 100%;
	margin: 0.75em 0;
	padding: 0;
	line-height: 0;
	box-sizing: border-box;
}

.yhj-article__content .wp-block-image figure {
	margin: 0;
	padding: 0;
	max-width: 100%;
}

.yhj-article__content .yhj-content-img,
.yhj-article__content img {
	display: block;
	max-width: 100%;
	width: auto;
	height: auto;
	border-radius: 8px;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	vertical-align: bottom;
}

/* 仅「全宽/宽屏」类图片铺满栏宽，仍保持比例 */
.yhj-article__content img.size-full,
.yhj-article__content img.alignwide,
.yhj-article__content img.alignfull,
.yhj-article__content figure.size-full > img,
.yhj-article__content figure.alignwide > img,
.yhj-article__content figure.alignfull > img,
.yhj-article__content .wp-block-image.size-full img,
.yhj-article__content .wp-block-image.alignwide img,
.yhj-article__content .wp-block-image.alignfull img {
	width: 100%;
	max-width: 100%;
	height: auto;
}

.yhj-article__content a img {
	max-width: 100%;
	width: auto;
	height: auto;
}

.yhj-article__content img.aligncenter {
	margin-left: auto;
	margin-right: auto;
}

/* 仅含图片的段落：去掉行高带来的上下空隙 */
.yhj-article__content p:has(> img:only-child),
.yhj-article__content p:has(> a:only-child > img:only-child) {
	margin: 0.75em 0;
	padding: 0;
	line-height: 0;
}

.yhj-article__content p:has(> img) img {
	margin: 0;
}

/* 空段落（编辑器常插在图片上下） */
.yhj-article__content p:empty {
	display: none;
	margin: 0;
	padding: 0;
	min-height: 0;
}

.yhj-article__content figcaption,
.yhj-article__content .wp-element-caption,
.yhj-article__content .wp-caption-text {
	display: block;
	font-size: 13px;
	color: #999;
	text-align: center;
	margin: 6px 0 0;
	padding: 0;
	line-height: 1.5;
	max-width: 100%;
}

/* 左/右浮动图：限制在栏宽一半内，内部图片仍自适应 */
.yhj-article__content .alignleft,
.yhj-article__content figure.alignleft,
.yhj-article__content .wp-block-image.alignleft,
.yhj-article__content .wp-caption.alignleft {
	float: left;
	width: auto !important;
	max-width: min(50%, 100%) !important;
	margin: 0 1.5em 1em 0;
}

.yhj-article__content .alignright,
.yhj-article__content figure.alignright,
.yhj-article__content .wp-block-image.alignright,
.yhj-article__content .wp-caption.alignright {
	float: right;
	width: auto !important;
	max-width: min(50%, 100%) !important;
	margin: 0 0 1em 1.5em;
}

.yhj-article__content .aligncenter,
.yhj-article__content figure.aligncenter,
.yhj-article__content .wp-block-image.aligncenter,
.yhj-article__content .wp-caption.aligncenter {
	float: none;
	width: fit-content;
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

.yhj-article__content::after {
	content: "";
	display: table;
	clear: both;
}

.yhj-article__content ul,
.yhj-article__content ol {
	margin: 0 0 1.2em 1.5em;
}

.yhj-article__content li {
	margin-bottom: 0.5em;
}

.yhj-article__content blockquote {
	margin: 1.2em 0;
	padding: 16px 20px;
	background: #f8f9fa;
	border-left: 4px solid #007bff;
	color: #555;
	border-radius: 0 8px 8px 0;
}

.yhj-article__content table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.2em 0;
	font-size: 14px;
}

.yhj-article__content th,
.yhj-article__content td {
	border: 1px solid #e0e0e0;
	padding: 10px 14px;
	text-align: left;
}

.yhj-article__content th {
	background: #f8f9fa;
	font-weight: 600;
}

/* Post navigation */
.yhj-post-nav {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid #f0f0f0;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.yhj-post-nav__item {
	font-size: 14px;
}

.yhj-post-nav__label {
	color: #999;
	font-size: 13px;
	margin-bottom: 6px;
}

.yhj-post-nav__title {
	color: #333;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 0.2s;
}

.yhj-post-nav__item a:hover .yhj-post-nav__title {
	color: #007bff;
}

.yhj-post-nav__item--next {
	text-align: right;
}

/* Related posts */
.yhj-related {
	margin-top: 36px;
	padding-top: 28px;
	border-top: 1px solid #f0f0f0;
}

.yhj-section-title {
	font-size: 18px;
	font-weight: 700;
	color: #222;
	margin-bottom: 20px;
	padding-left: 14px;
	border-left: 4px solid #007bff;
	line-height: 1.3;
}

.yhj-related__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

.yhj-related__item img {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	border-radius: 8px;
	margin-bottom: 10px;
}

.yhj-related__title {
	font-size: 14px;
	color: #333;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 0.2s;
}

.yhj-related__item:hover .yhj-related__title {
	color: #007bff;
}

/* Sidebar */
.yhj-sidebar {
	position: sticky;
	top: 90px;
}

.yhj-widget {
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
	padding: 24px;
}

.yhj-widget__title {
	font-size: 16px;
	font-weight: 700;
	color: #222;
	margin-bottom: 16px;
	padding-left: 12px;
	border-left: 4px solid #007bff;
	line-height: 1.3;
}

.yhj-hot-list {
	list-style: none;
}

.yhj-hot-list li {
	display: flex;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid #f0f0f0;
}

.yhj-hot-list li:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.yhj-hot-list li:first-child {
	padding-top: 0;
}

.yhj-hot-list__thumb {
	flex: 0 0 80px;
	width: 80px;
	height: 56px;
	border-radius: 6px;
	overflow: hidden;
	background: #eee;
}

.yhj-hot-list__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.yhj-hot-list__info {
	flex: 1;
	min-width: 0;
}

.yhj-hot-list__title {
	font-size: 13px;
	color: #333;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-bottom: 4px;
	transition: color 0.2s;
}

.yhj-hot-list a:hover .yhj-hot-list__title {
	color: #007bff;
}

.yhj-hot-list__date {
	font-size: 12px;
	color: #bbb;
}

/* Back to top */
.yhj-back-top {
	position: fixed;
	right: 24px;
	bottom: 24px;
	width: 40px;
	height: 40px;
	background: #007bff;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s, visibility 0.3s, background 0.2s;
	z-index: 99;
	box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.yhj-back-top.is-visible {
	opacity: 1;
	visibility: visible;
}

.yhj-back-top:hover {
	background: #0056b3;
}

.yhj-back-top img {
	width: 18px;
	height: 18px;
}

/* Responsive */
@media (max-width: 960px) {
	.yhj-single-wrap {
		grid-template-columns: 1fr;
	}

	.yhj-sidebar {
		position: static;
	}

	.yhj-related__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 640px) {
	.yhj-article {
		padding: 24px 20px;
	}

	.yhj-related__grid {
		grid-template-columns: 1fr;
	}

	.yhj-post-nav {
		grid-template-columns: 1fr;
	}

	.yhj-post-nav__item--next {
		text-align: left;
	}
}
