/* ==========================================================================
   文章正文统一排版 · 方案 C（折中）
   --------------------------------------------------------------------------
   用户选定：2026-09-20 「你推荐那个可以」（= C 折中：缩进 2 字符 + 藏蓝下划线标题）
   数值：正文 16.8px / 行高 1.92 / 首行缩进 2 字符 / 段间距 0.6em
        h2 23px 藏蓝下划线 · h3 19px 藏蓝虚线 · h4 17px 深灰
        正文限宽 760px

   ⚠️ 同时管两处（这样编辑器里看到的就是前台最终效果）：
      .article-body          → 网站前台的文章正文
      .editor-styles-wrapper → 后台编辑器的书写区
   用 :is() 把两个选择器并起来写，改一处两边同步。
   ========================================================================== */

/* ---------- 正文容器：限宽，一行 30~40 个汉字最舒服 ---------- */
.article-body{
	max-width:760px;
	margin:0 auto;
	color:#1f2937;
	-webkit-font-smoothing:antialiased;
}

/* ==========================================================================
   ⚠️ 居中修正（2026-09-20 用户发现：1920px 下正文偏左，左右留白 20% : 39%）
   原因：`.article-body` 只是"在父容器里居中" —— 而父容器（主题的 .wrap）
        本身是偏左的，所以正文跟着偏。
   做法：**只针对文章详情页**（body.single）把这一列拽到视口正中，
        绝不动全站（上一次改 theme.json 全站标题变黑，就是范围放太大了）。
   ========================================================================== */
body.single .section > .wrap,
body.single .entry,
body.single .article-body{
	max-width:760px;
	margin-left:auto !important;
	margin-right:auto !important;
}
body.single .article-body{ width:100%; }

/* 横幅（page hero）的标题也对齐正文 —— 用户选 B：
   横幅标题左边缘 = 正文左边缘，一眼看过去整整齐齐。只作用于文章详情页。 */
body.single .phero > .wrap{
	max-width:760px !important;
	margin-left:auto !important;
	margin-right:auto !important;
}

/* ==========================================================================
   ⚠️ 手机自适应修正（2026-09-20 用户发现）
   问题：引用/抓取的外部文章（如发改委那篇）里带**很长的网址**，
        长串不会自动换行 → 把页面撑宽 → 手机上整页不能自适应、出现横向滚动。
   做法（只作用于正文区，前后台都管）：
     · 超长单词/网址 → 强制换行
     · 图片、视频、嵌入 → 不许超出容器宽度
     · 表格 → 太宽时自己在里面横向滚动，不撑破整页
     · 代码/预格式 → 允许折行
   ========================================================================== */
:is(.article-body,.editor-styles-wrapper){
	overflow-wrap:break-word;
	word-wrap:break-word;
	max-width:100%;
}
:is(.article-body,.editor-styles-wrapper) p,
:is(.article-body,.editor-styles-wrapper) li,
:is(.article-body,.editor-styles-wrapper) a,
:is(.article-body,.editor-styles-wrapper) td,
:is(.article-body,.editor-styles-wrapper) span{
	overflow-wrap:break-word;
	word-break:break-word;
}
:is(.article-body,.editor-styles-wrapper) img,
:is(.article-body,.editor-styles-wrapper) video,
:is(.article-body,.editor-styles-wrapper) iframe,
:is(.article-body,.editor-styles-wrapper) embed,
:is(.article-body,.editor-styles-wrapper) object{
	max-width:100% !important;
	height:auto;
}
:is(.article-body,.editor-styles-wrapper) table{
	display:block;
	width:100% !important;
	max-width:100% !important;
	overflow-x:auto;
	-webkit-overflow-scrolling:touch;
}
:is(.article-body,.editor-styles-wrapper) pre,
:is(.article-body,.editor-styles-wrapper) code{
	white-space:pre-wrap;
	word-break:break-all;
	max-width:100%;
}
/* 安全网：文章页不许出现横向滚动（抓来的内容千奇百怪，兜一层） */
body.single{ overflow-x:hidden; }
@media(max-width:860px){
	:is(.article-body,.editor-styles-wrapper) p,
	:is(.article-body,.editor-styles-wrapper) li{ font-size:16.5px; line-height:1.9; }
	:is(.article-body,.editor-styles-wrapper) h2{ font-size:20px; margin:28px 0 13px; }
	:is(.article-body,.editor-styles-wrapper) h3{ font-size:17.5px; margin:22px 0 11px; }
}

/* ---------- 段落 ---------- */
:is(.article-body,.editor-styles-wrapper) p{
	font-size:16.8px;
	line-height:1.92;
	text-indent:2em;
	margin:0 0 .6em;
	color:#1f2937;
	letter-spacing:.01em;
}

/* ---------- 一级章节 h2 ---------- */
:is(.article-body,.editor-styles-wrapper) h2{
	font-size:23px;
	font-weight:800;
	line-height:1.45;
	color:#0f3a75;
	margin:36px 0 16px;
	padding-bottom:9px;
	border-bottom:2px solid #184890;
	text-indent:0;
}
/* ---------- 二级章节 h3 ---------- */
:is(.article-body,.editor-styles-wrapper) h3{
	font-size:19px;
	font-weight:700;
	line-height:1.5;
	color:#184890;
	margin:26px 0 12px;
	padding-bottom:6px;
	border-bottom:1px dashed #c9d6e8;
	text-indent:0;
}
/* ---------- 三级小标题 h4 ---------- */
:is(.article-body,.editor-styles-wrapper) h4{
	font-size:17px;
	font-weight:700;
	line-height:1.6;
	color:#374151;
	margin:20px 0 10px;
	text-indent:0;
}
/* h5 / h6 平时用不到，但万一用了也别丑 */
:is(.article-body,.editor-styles-wrapper) h5,
:is(.article-body,.editor-styles-wrapper) h6{
	font-size:16.5px;font-weight:700;color:#374151;margin:16px 0 8px;text-indent:0;
}

/* ---------- 第一个元素不要顶出空白 ---------- */
:is(.article-body,.editor-styles-wrapper) > :first-child{margin-top:0}

/* ---------- 列表（一二三步骤就用这个）---------- */
:is(.article-body,.editor-styles-wrapper) ul,
:is(.article-body,.editor-styles-wrapper) ol{
	font-size:16.8px;line-height:1.9;margin:.7em 0 .95em;padding-left:2.2em;
}
:is(.article-body,.editor-styles-wrapper) li{margin:.3em 0}
:is(.article-body,.editor-styles-wrapper) li > ul,
:is(.article-body,.editor-styles-wrapper) li > ol{margin:.25em 0 .25em}

/* ---------- 引用（政策原文、领导讲话）---------- */
:is(.article-body,.editor-styles-wrapper) blockquote{
	border-left:4px solid #184890;
	background:#f2f6fc;
	border-radius:0 6px 6px 0;
	padding:14px 18px;
	margin:1.4em 0;
	color:#334155;
}
:is(.article-body,.editor-styles-wrapper) blockquote p{
	text-indent:0;margin:0;color:#334155;font-size:16.5px;
}
:is(.article-body,.editor-styles-wrapper) blockquote cite{
	display:block;margin-top:8px;font-size:13px;color:#7b8aa3;font-style:normal;
}

/* ---------- 图片 ---------- */
:is(.article-body,.editor-styles-wrapper) img{
	max-width:100%;height:auto;display:block;
	border-radius:8px;margin:1.6em auto .5em;
}
:is(.article-body,.editor-styles-wrapper) figure{margin:1.6em 0}
:is(.article-body,.editor-styles-wrapper) figcaption{
	text-align:center;font-size:12.8px;color:#8a94a6;line-height:1.7;margin-top:.5em;text-indent:0;
}

/* ---------- 表格 ---------- */
:is(.article-body,.editor-styles-wrapper) table{
	width:100%;border-collapse:collapse;font-size:14.5px;margin:1.3em 0;
}
:is(.article-body,.editor-styles-wrapper) th{
	background:#184890;color:#fff;font-weight:600;text-align:left;
}
:is(.article-body,.editor-styles-wrapper) th,
:is(.article-body,.editor-styles-wrapper) td{
	border:1px solid #dbe3ee;padding:9px 12px;line-height:1.7;
}
:is(.article-body,.editor-styles-wrapper) tbody tr:nth-child(even){background:#f7f9fc}

/* ---------- 链接 ---------- */
:is(.article-body,.editor-styles-wrapper) a{
	color:#20a838;text-decoration:none;border-bottom:1px solid rgba(32,168,56,.35);
}
:is(.article-body,.editor-styles-wrapper) a:hover{
	color:#18892d;border-bottom-color:#20a838;
}

/* ---------- 分隔线 / 按钮 ---------- */
:is(.article-body,.editor-styles-wrapper) hr{
	border:0;border-top:1px solid #e5e9f0;margin:2em 0;
}
:is(.article-body,.editor-styles-wrapper) code{
	background:#f0f3f7;border-radius:4px;padding:1px 6px;font-size:14px;color:#b03a2e;
}

/* ==========================================================================
   附：后台编辑器「画布」专用 —— 提高优先级，压过 WordPress 自带的编辑器样式
   --------------------------------------------------------------------------
   ⚠️ 踩坑（2026-09-20，用户发现）：上面那套 `:is(.article-body,.editor-styles-wrapper) p`
      优先级只有 0,1,1，跟 WordPress 自带的 `.editor-styles-wrapper p` **一样重** ——
      而 WP 的编辑器样式**加载在后面**，于是**我们被它盖住了**。
      症状很典型：**图片圆角生效了**（那个 WP 没设），**字体/字号/行距全没生效**（被 WP 盖了）。
   办法：编辑器这半边用 `.editor-styles-wrapper.editor-styles-wrapper`（0,2,1，比 WP 高）
        + !important 双保险 —— 一定压得住。
   ========================================================================== */
.editor-styles-wrapper.editor-styles-wrapper p {
	font-size:16.8px !important; line-height:1.92 !important;
	text-indent:2em !important; margin:0 0 .6em !important; color:#1f2937 !important;
}
.editor-styles-wrapper.editor-styles-wrapper h2 {
	font-size:23px !important; font-weight:800 !important; line-height:1.45 !important;
	color:#0f3a75 !important; margin:36px 0 16px !important;
	padding-bottom:9px !important; border-bottom:2px solid #184890 !important; text-indent:0 !important;
}
.editor-styles-wrapper.editor-styles-wrapper h3 {
	font-size:19px !important; font-weight:700 !important; line-height:1.5 !important;
	color:#184890 !important; margin:26px 0 12px !important;
	padding-bottom:6px !important; border-bottom:1px dashed #c9d6e8 !important; text-indent:0 !important;
}
.editor-styles-wrapper.editor-styles-wrapper h4 {
	font-size:17px !important; font-weight:700 !important; line-height:1.6 !important;
	color:#374151 !important; margin:20px 0 10px !important; text-indent:0 !important;
}
.editor-styles-wrapper.editor-styles-wrapper h5,
.editor-styles-wrapper.editor-styles-wrapper h6 {
	font-size:16.5px !important; font-weight:700 !important; color:#374151 !important;
	margin:16px 0 8px !important; text-indent:0 !important;
}
.editor-styles-wrapper.editor-styles-wrapper ul,
.editor-styles-wrapper.editor-styles-wrapper ol {
	font-size:16.8px !important; line-height:1.9 !important;
	margin:.7em 0 .95em !important; padding-left:2.2em !important;
}
.editor-styles-wrapper.editor-styles-wrapper li { margin:.3em 0 !important }
.editor-styles-wrapper.editor-styles-wrapper blockquote {
	border-left:4px solid #184890 !important; background:#f2f6fc !important;
	border-radius:0 6px 6px 0 !important; padding:14px 18px !important;
	margin:1.4em 0 !important; color:#334155 !important;
}
.editor-styles-wrapper.editor-styles-wrapper blockquote p {
	text-indent:0 !important; margin:0 !important; font-size:16.5px !important;
}
.editor-styles-wrapper.editor-styles-wrapper img,
.editor-styles-wrapper.editor-styles-wrapper .wp-block-image img {
	max-width:100% !important; height:auto !important; display:block !important;
	border-radius:8px !important; margin:1.6em auto .5em !important;
}
.editor-styles-wrapper.editor-styles-wrapper figcaption {
	text-align:center !important; font-size:12.8px !important;
	color:#8a94a6 !important; line-height:1.7 !important; text-indent:0 !important;
}
.editor-styles-wrapper.editor-styles-wrapper table { width:100% !important; border-collapse:collapse !important; font-size:14.5px !important }
.editor-styles-wrapper.editor-styles-wrapper th {
	background:#184890 !important; color:#fff !important; font-weight:600 !important; text-align:left !important;
}
.editor-styles-wrapper.editor-styles-wrapper th,
.editor-styles-wrapper.editor-styles-wrapper td {
	border:1px solid #dbe3ee !important; padding:9px 12px !important; line-height:1.7 !important;
}
.editor-styles-wrapper.editor-styles-wrapper a {
	color:#20a838 !important; text-decoration:none !important;
	border-bottom:1px solid rgba(32,168,56,.35) !important;
}
/* 编辑器画布本身的内边距/宽度 */
.editor-styles-wrapper { padding-bottom:40px }
.editor-styles-wrapper .wp-block { max-width:760px }

/* ==========================================================================
   编辑器画布：正文内容居中（和前台一样 760px 居中）
   --------------------------------------------------------------------------
   theme.json 里的 layout.contentSize 只管前台；编辑区里内容默认还是贴着左边排，
   所以这里显式把画布根容器设成 760px 居中 —— 前后台看起来才一致。
   ========================================================================== */
.editor-styles-wrapper .is-root-container,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container,
.editor-styles-wrapper .wp-block-post-content {
	max-width:760px !important;
	margin-left:auto !important;
	margin-right:auto !important;
}
/* 图片在编辑区也居中 */
.editor-styles-wrapper .wp-block-image,
.editor-styles-wrapper figure.wp-block-image {
	margin-left:auto !important;
	margin-right:auto !important;
	text-align:center !important;
}
.editor-styles-wrapper .wp-block-image img { margin-left:auto !important; margin-right:auto !important }
.editor-styles-wrapper .wp-block-image figcaption { text-align:center !important }
