/**
 * 文章页常规版式（single）
 *
 * 2026-10-16 改版：文章页从论坛帖形态改为常规 WordPress 文章页。
 * 之前的正文套在 Discuz 的 .t_f 表格里，吃 body 的 16px/2 Tahoma，
 * 显小且密。这里给标题 / 头图 / 正文 / 评论区一套独立样式。
 *
 * 配套模板：single.php、inc/comments-render.php、comments.php。
 * 只在 is_singular('post') 时加载（functions.php）。
 */

/* ------------------------------------------------------------------
 * 标题与元信息
 * ------------------------------------------------------------------ */

.ldx-article-head {
	margin-bottom: 22px;
}

.ldx-article-title {
	font-size: 30px;
	line-height: 1.4;
	color: #001f89;
	font-weight: 400;
	margin: 0 0 14px;
	text-align: center;
}

.ldx-article-meta {
	font-size: 14px;
	line-height: 20px;
	color: #999999;
	text-align: center;
}

.ldx-article-meta a {
	color: #999999;
}

.ldx-article-meta a:hover {
	color: #185fa5;
	text-decoration: none;
}

.ldx-article-meta .pipe {
	margin: 0 10px;
	color: #dddddd;
}

/* ------------------------------------------------------------------
 * 头图（特色图 / 正文首图，1200x 缩略）
 * ------------------------------------------------------------------ */

.ldx-article-cover {
	margin: 0 0 26px;
}

.ldx-article-cover img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
}

/* ------------------------------------------------------------------
 * 正文排版（17px / 1.9，图片、表格、列表常规化）
 * ------------------------------------------------------------------ */

.ldx-article-content {
	font-size: 18px;
	line-height: 2;
	color: #333333;
	word-wrap: break-word;
	overflow-x: auto;      /* 宽参数表格防撑破：超宽时横向滚动 */
}

.ldx-article-content p {
	margin: 0 0 20px;
}

.ldx-article-content img {
	max-width: 100%;
	height: auto;
	border-radius: 6px;
}

.ldx-article-content h2 {
	font-size: 21px;
	line-height: 1.5;
	color: #001f89;
	font-weight: 500;
	margin: 30px 0 14px;
}

.ldx-article-content h3 {
	font-size: 18px;
	line-height: 1.6;
	font-weight: 500;
	margin: 26px 0 12px;
}

.ldx-article-content ul,
.ldx-article-content ol {
	margin: 0 0 18px;
	padding-left: 2em;
}

.ldx-article-content li {
	margin-bottom: 6px;
}

.ldx-article-content a {
	color: #185fa5;
}

.ldx-article-content table {
	border-collapse: collapse;
	margin: 16px 0;
	max-width: 100%;
}

.ldx-article-content td,
.ldx-article-content th {
	border: 1px solid #e5e5e5;
	padding: 8px 12px;
	font-size: 16px;
	line-height: 1.7;
	color: #333333;
}

.ldx-article-content blockquote {
	margin: 0 0 18px;
	padding: 10px 18px;
	border-left: 3px solid #d9e4ef;
	background: #f7fafc;
	color: #666666;
}

/* ------------------------------------------------------------------
 * 代码块（正文与回复共用）
 *
 * 迁移过来的技术帖大量是 <pre class="dz-code"><code>…</code></pre>。
 * 浏览器对 pre 默认 white-space: pre —— 不折行，长代码直接顶出容器
 * 右边界；回复区尤其明显，因为 .ldx-comment-body 自己没有 overflow。
 * 这里改成 pre-wrap，让代码跟着容器宽度折行；极长的无空格串
 * （URL、base64、压缩过的 JS）再用 overflow-wrap 强制断开。
 * ------------------------------------------------------------------ */

.ldx-article-content pre,
.ldx-comment-body pre {
	box-sizing: border-box;
	max-width: 100%;
	margin: 0 0 18px;
	padding: 16px 18px;
	background: #f6f8fa;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-family: Menlo, Consolas, "Courier New", monospace;
	font-size: 13px;
	line-height: 1.7;
	color: #24292f;
	white-space: pre-wrap;      /* 关键：长行自动折行 */
	overflow-wrap: break-word;  /* 超长无空格串强制断开 */
	word-break: break-word;
	tab-size: 4;
	overflow-x: auto;           /* 万一还是断开不了，横向滚动兜底 */
}

.ldx-article-content pre code,
.ldx-comment-body pre code {
	display: block;
	padding: 0;
	background: none;
	color: inherit;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	white-space: inherit;
}

.ldx-article-pages {
	margin: 20px 0;
}

/* ------------------------------------------------------------------
 * 评论区（原论坛回帖楼层，常规化）
 *
 * 2026-10-16 美化：卡片化评论条目 + 左竖线标题 + WordPress 标准
 * 评论表单（comment-respond）样式，去 Discuz 的 attach_tips/pn pnc 风格。
 * ------------------------------------------------------------------ */

.ldx-comments-title {
	font-size: 20px;
	line-height: 1.5;
	color: #001f89;
	font-weight: 500;
	margin: 36px 0 20px;
	padding-left: 12px;
	border-left: 4px solid #185fa5;
}

.ldx-comments-title em {
	font-style: normal;
	font-size: 14px;
	color: #999999;
	margin-left: 6px;
}

/* 评论条目卡片化 */
.ldx-comment {
	padding: 18px 20px;
	margin-bottom: 14px;
	background: #f9fafb;
	border: 1px solid #eef2f7;
	border-radius: 8px;
	transition: border-color 0.2s;
}

.ldx-comment:hover {
	border-color: #d9e4ef;
}

#comment_area .ldx-comment:first-of-type {
	margin-top: 14px;
}

.ldx-comment-child {
	margin-left: 32px;
}

.ldx-comment-head {
	margin-bottom: 8px;
	font-size: 14px;
	line-height: 20px;
	color: #999999;
}

.ldx-comment-author {
	color: #185fa5;
	font-weight: 500;
	margin-right: 12px;
}

.ldx-comment-body {
	font-size: 15px;
	line-height: 1.8;
	color: #333333;
	word-wrap: break-word;
}

.ldx-comment-body img {
	max-width: 100%;
	height: auto;
}

/* 未登录提示框（替代原 Discuz attach_nopermission attach_tips） */
.ldx-comment-login {
	margin: 30px 0;
	padding: 24px 26px;
	background: #f7fafc;
	border: 1px solid #d9e4ef;
	border-radius: 8px;
	text-align: center;
}

.ldx-comment-login h3 {
	font-size: 16px;
	color: #001f89;
	margin: 0 0 10px;
	font-weight: 500;
}

.ldx-comment-login p {
	margin: 0;
	font-size: 14px;
	color: #666666;
	line-height: 1.7;
}

.ldx-comment-login a {
	color: #185fa5;
}

.ldx-comment-login a:hover {
	text-decoration: underline;
}

/* 评论已关闭提示 */
.comments-area .locked {
	margin: 24px 0;
	padding: 16px 22px;
	background: #f7fafc;
	border: 1px solid #d9e4ef;
	border-radius: 8px;
	color: #666666;
	text-align: center;
	font-size: 14px;
}

/* ------------------------------------------------------------------
 * WordPress 标准评论表单（comment-respond / comment-form）
 * ------------------------------------------------------------------ */

.comment-respond {
	margin: 30px 0;
	padding: 26px 28px;
	background: #f9fafb;
	border: 1px solid #eef2f7;
	border-radius: 8px;
}

.comment-reply-title {
	font-size: 18px;
	color: #001f89;
	font-weight: 500;
	margin: 0 0 18px;
	padding-left: 10px;
	border-left: 3px solid #185fa5;
	line-height: 1.4;
}

.comment-reply-title small {
	font-size: 12px;
	margin-left: 10px;
}

.comment-form {
	margin: 0;
}

.comment-form p {
	margin: 0 0 14px;
}

.comment-form label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	color: #555555;
	font-weight: 500;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d9e0e8;
	border-radius: 6px;
	background: #ffffff;
	font-size: 14px;
	line-height: 1.6;
	color: #333333;
	box-sizing: border-box;
	transition: border-color 0.2s, box-shadow 0.2s;
	font-family: inherit;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
	border-color: #185fa5;
	outline: none;
	box-shadow: 0 0 0 2px rgba(24, 95, 165, 0.12);
}

.comment-form textarea {
	resize: vertical;
	min-height: 130px;
}

.comment-form .comment-form-comment {
	margin-bottom: 16px;
}

.comment-form .comment-notes,
.comment-form .logged-in-as {
	margin: 0 0 16px;
	font-size: 13px;
	color: #999999;
	line-height: 1.6;
}

.comment-form .logged-in-as a {
	color: #185fa5;
}

.comment-form .form-submit {
	margin: 0;
}

.comment-form .submit {
	display: inline-block;
	padding: 10px 32px;
	background: #185fa5;
	color: #ffffff;
	border: 0;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.5;
	cursor: pointer;
	transition: background 0.2s;
	font-family: inherit;
}

.comment-form .submit:hover,
.comment-form .submit:focus {
	background: #144a82;
	outline: none;
}

/* 评论列表/表单里的「取消回复」链接 */
.comment-form .cancel-comment-reply-link {
	margin-left: 12px;
	font-size: 13px;
	color: #999999;
}

.comment-form .cancel-comment-reply-link:hover {
	color: #185fa5;
}

/* ------------------------------------------------------------------
 * 附件内嵌预览（PDF / 音视频）
 * 由 inc/attachments.php 的 ldx_attachment_embed() 输出在附件链接下方。
 * ------------------------------------------------------------------ */

.ldx-attach-embed {
	margin: 16px 0 28px;
}

/* PDF：浏览器内置阅读器，给足高度免得要反复滚动 */
.ldx-attach-frame {
	display: block;
	width: 100%;
	height: 800px;
	border: 1px solid #e3e8ee;
	border-radius: 8px;
	background: #f7fafc;
}

/* 视频：黑底 + 圆角，限制最大高度 */
.ldx-attach-video {
	display: block;
	width: 100%;
	max-height: 560px;
	border-radius: 8px;
	background: #000000;
}

.ldx-attach-audio {
	display: block;
	width: 100%;
}

/* ------------------------------------------------------------------
 * 移动端响应式
 * ------------------------------------------------------------------ */

@media (max-width: 768px) {
	.ldx-article-title {
		font-size: 24px;
	}

	.ldx-article-content {
		font-size: 16px;
		line-height: 1.85;
	}

	/* 窄屏代码块：字号再降一档，内边距收紧，尽量一行多放几个字符 */
	.ldx-article-content pre,
	.ldx-comment-body pre {
		padding: 12px 14px;
		font-size: 12px;
		line-height: 1.65;
	}

	.ldx-comment {
		padding: 14px 16px;
	}

	.ldx-comment-child {
		margin-left: 18px;
	}

	.comment-respond {
		padding: 18px 18px;
	}

	.ldx-comment-login {
		padding: 18px 18px;
	}

	.comment-form .submit {
		padding: 10px 24px;
	}

	.ldx-attach-frame {
		height: 480px;
	}
}
