.shen-article-content {
	width: 100%;
	min-width: 0;
	color: #3f4859;
	font-size: 15px;
	line-height: 2;
	overflow-wrap: anywhere;
}

.shen-article-content > :first-child { margin-top: 0; }
.shen-article-content > :last-child { margin-bottom: 0; }

.shen-article-content :is(h1, h2, h3, h4, h5, h6)[id] {
	scroll-margin-top: 100px;
}

/* 标题样式排除嵌套小部件（类名带 shen- 前缀），
   否则会覆盖 CTA、FAQ、提示框等自己的标题配色与边框。 */
.shen-article-content h2:not([class*="shen-"]) {
	margin: 48px 0 22px;
	padding-bottom: 14px;
	border-bottom: 1px solid #e8ebf1;
	color: #1a2440;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.5;
}
.shen-article-content h3:not([class*="shen-"]) {
	margin: 34px 0 16px;
	color: #1a2440;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.6;
}
.shen-article-content h4:not([class*="shen-"]) {
	margin: 26px 0 12px;
	color: #1a2440;
	font-size: 17px;
	font-weight: 600;
}

/* 正文段落。注意：小部件可能嵌套在正文内，
   各小部件的 CSS 需自行重置段落边距与对齐（见 callout/notice/faq/cta 等）。 */
.shen-article-content p {
	margin: 0 0 20px;
	text-align: justify;
	text-justify: inter-ideograph;
}

/* 同样排除小部件内部链接，避免给 CTA 按钮加上下划线边框 */
.shen-article-content a:not([class*="shen-"]):not([class*="elementor-"]) {
	color: #1d4ed8;
	text-decoration: none;
	border-bottom: 1px solid rgba(29, 78, 216, .3);
}
.shen-article-content a:not([class*="shen-"]):not([class*="elementor-"]):hover {
	border-bottom-color: currentColor;
}

.shen-article-content :is(ul, ol) {
	margin: 0 0 22px;
	padding-inline-start: 1.45em;
}
.shen-article-content li { margin-bottom: 10px; }
.shen-article-content li::marker { color: #6b7688; }

.shen-article-content img {
	max-width: 100%;
	height: auto;
	display: block;
}

.shen-article-content :is(figure, .wp-caption) {
	max-width: 100%;
	margin-right: 0;
	margin-left: 0;
}
.shen-article-content :is(figcaption, .wp-caption-text) {
	margin-top: 8px;
	color: #7b8494;
	font-size: 13px;
	line-height: 1.6;
	text-align: left;
}
.shen-article-content :is(iframe, video, embed, object) {
	display: block;
	max-width: 100%;
}
.shen-article-content iframe { width: 100%; }

/* 兜底：没有任何 class 的裸 SVG 限制为 1em。
   SVG 默认宽高是 100%，一旦嵌套小部件的类名丢失（例如内容未经 Elementor
   渲染），图标会被撑满整个画布。各小部件自己的 .shen-xxx__icon svg 规则
   优先级更高，不受影响。 */
.shen-article-content svg:not([class]) {
	width: 1em;
	height: 1em;
	vertical-align: -.125em;
}

.shen-article-content blockquote {
	margin: 26px 0;
	padding: 4px 0 4px 18px;
	border-left: 3px solid #1d4ed8;
	color: #5a6478;
}

.shen-article-content :is(code, pre) {
	background: #f4f6fa;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: .92em;
}
.shen-article-content code { padding: 2px 6px; border-radius: 3px; }
.shen-article-content pre { padding: 16px; overflow-x: auto; }

/* 正文里手写的表格样式。
   :not(.shen-table) 用于排除「对比表格」小部件，
   否则会给它叠加多余的外边距、边框与内边距。 */
.shen-article-content table:not(.shen-table) {
	width: 100%;
	margin: 0 0 24px;
	border-collapse: collapse;
}
.shen-article-content__table-scroll {
	width: 100%;
	max-width: 100%;
	margin-bottom: 24px;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	border: 1px solid #e3e7ee;
	border-radius: 4px;
}
.shen-article-content__table-scroll table:not(.shen-table) {
	min-width: 560px;
	margin-bottom: 0;
}
.shen-article-content__table-scroll table:not(.shen-table) :is(th, td) { border-width: 0 1px 1px 0; }
.shen-article-content__table-scroll table:not(.shen-table) tr:last-child > :is(th, td) { border-bottom: 0; }
.shen-article-content__table-scroll table:not(.shen-table) tr > :last-child { border-right: 0; }
.shen-article-content table:not(.shen-table) :is(th, td) {
	padding: 10px 12px;
	border: 1px solid #e3e7ee;
	text-align: left;
}
.shen-article-content table:not(.shen-table) th {
	background: #f6f8fb;
	font-weight: 600;
}

@media (max-width: 767px) {
	.shen-ac { width: 100%; padding-right: 20px; padding-left: 20px; box-sizing: border-box; }
	.shen-article-content { font-size: 16px; line-height: 1.8; }
	.shen-article-content h2:not([class*="shen-"]) { margin: 36px 0 18px; padding-bottom: 11px; font-size: 23px; line-height: 1.4; }
	.shen-article-content h3:not([class*="shen-"]) { margin: 28px 0 13px; font-size: 19px; line-height: 1.5; }
	.shen-article-content h4:not([class*="shen-"]) { margin: 23px 0 10px; font-size: 17px; line-height: 1.5; }
	.shen-article-content p { text-align: left; }
	.shen-article-content :is(ul, ol) { margin-bottom: 20px; padding-inline-start: 1.35em; }
	.shen-article-content li { margin-bottom: 8px; padding-left: 2px; }
	.shen-article-content blockquote { margin: 22px 0; padding: 3px 0 3px 14px; }
	.shen-article-content pre { max-width: 100%; padding: 14px; font-size: 13px; white-space: pre; }
	.shen-article-content__table-scroll { margin-right: 0; margin-bottom: 22px; margin-left: 0; }
	.shen-article-content__table-scroll table:not(.shen-table) { min-width: 520px; }
	.shen-article-content table:not(.shen-table) :is(th, td) { padding: 10px; font-size: 14px; line-height: 1.55; }

	/* 兼容旧版 Elementor 栏位与正文内手工设计区块，避免继续保持桌面并排宽度。 */
	.shen-article-content :is(.elementor-section, .elementor-container, .elementor-row, .e-con, .wp-block-columns) { max-width: 100%; }
	.shen-article-content :is(.elementor-row, .wp-block-columns) { flex-wrap: wrap !important; }
	.shen-article-content .elementor-column,
	.shen-article-content .wp-block-column { width: 100% !important; max-width: 100% !important; flex-basis: 100% !important; }
	.shen-article-content .elementor-widget-wrap { padding-right: 0; padding-left: 0; }

	/* 正文内设计小部件的统一安全宽度与手机间距。 */
	.shen-article-content :where(.shen-callout, .shen-table-wrap, .shen-faq, .shen-sources, .shen-hlbox, .shen-cta, .shen-notice, .shen-terms) { width: 100%; max-width: 100%; }
	.shen-article-content .shen-callout { padding: 18px 18px 19px; }
	.shen-article-content .shen-sources { padding: 22px 18px; }
	.shen-article-content .shen-cta { padding: 26px 20px; }
	.shen-article-content .shen-notice { padding-top: 24px; padding-bottom: 24px; }
	.shen-article-content .shen-notice__card { padding: 24px 20px; border-radius: 14px; }
}

/* ===================================================================
   内置侧边目录：正文与目录并排
   =================================================================== */
.shen-ac {
	--shen-ac-toc-width: 200px;
	display: flex;
	gap: 40px;
	align-items: flex-start;
}

/* 无目录时正文独占整行 */
.shen-ac:not(.has-toc) .shen-article-content {
	width: 100%;
}

.shen-ac.toc-right {
	flex-direction: row-reverse;
}

.shen-ac__toc {
	flex: 0 0 var(--shen-ac-toc-width);
	width: var(--shen-ac-toc-width);
	max-width: var(--shen-ac-toc-width);
	font-size: 13px;
}
.shen-ac__toc.is-sticky {
	position: sticky;
	top: 90px;
	max-height: calc(100vh - 120px);
	overflow-y: auto;
	scrollbar-width: thin;
}

/* 正文占据剩余空间，min-width: 0 防止长内容把它撑出容器 */
.shen-ac.has-toc .shen-article-content {
	flex: 1 1 auto;
	min-width: 0;
}

.shen-ac__toc-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	margin: 0 0 16px;
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid #0052CC;
	border-radius: 0;
	background-color: transparent;
	color: #0052CC;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size:13px;
	font-weight: 500;
	letter-spacing: 1.5px;
	text-align: left;
	text-transform: uppercase;
	cursor: default;
	box-sizing: border-box;
	transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.shen-ac__toc-heading:hover,
.shen-ac__toc-heading:focus-visible {
	border-color: #0052CC;
	background-color: #0052CC;
	color: #fff;
}

.shen-ac__toc-heading:focus-visible {
	outline: 2px solid rgba(0, 82, 204, .24);
	outline-offset: 2px;
}

.shen-ac__toc-caret {
	display: none;
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform .2s ease;
}

.shen-ac__toc-list {
	margin: 0;
	padding: 0 0 0 1px;
	border-left: 1px solid #e8ebf1;
	list-style: none;
	counter-reset: shen-ac-toc;
}

.shen-ac__toc-item {
	position: relative;
	margin: 0 0 6px;
	padding: 0;
	list-style: none;
}
.shen-ac__toc-item::before {
	content: "";
	position: absolute;
	left: -2px;
	top: 2px;
	bottom: 2px;
	width: 3px;
	background-color: transparent;
	transition: background-color .2s ease;
}
.shen-ac__toc-item.is-active::before {
	background-color: #0052CC;
}

.shen-ac__toc-link {
	display: block;
	padding: 5px 0 5px 12px;
	color: #5a6478;
	font-size: 13px;
	line-height: 1.65;
	text-decoration: none;
	overflow-wrap: break-word;
	transition: color .2s ease;
}
.shen-ac__toc-link:hover,
.shen-ac__toc-link:focus-visible { color: #0052CC; }
.shen-ac__toc-link:focus-visible { outline: 2px solid rgba(0, 82, 204, .24); outline-offset: 2px; }
.shen-ac__toc-item.is-active > .shen-ac__toc-link { color: #0052CC; }

/* 层级缩进 */
.shen-ac__toc-item.is-level-3 .shen-ac__toc-link { padding-left: 24px; font-size: .95em; }
.shen-ac__toc-item.is-level-4 .shen-ac__toc-link { padding-left: 34px; font-size: .9em; }

/* 序号 */
.shen-ac__toc.is-numbered .shen-ac__toc-item { counter-increment: shen-ac-toc; }
.shen-ac__toc.is-numbered .shen-ac__toc-link::before {
	content: counter(shen-ac-toc) ". ";
	color: #aeb5c0;
}

/* ---- 窄屏：目录移到正文上方 ---- */
@media (max-width: 1024px) {
	.shen-ac,
	.shen-ac.toc-right {
		flex-direction: column;
		gap: 24px;
	}
	.shen-ac__toc {
		flex: 1 1 auto;
		width: 100%;
		max-width: 100%;
	}
	.shen-ac__toc.is-sticky {
		position: static;
		max-height: none;
		overflow: visible;
	}

	/* 隐藏模式 */
	.shen-ac.toc-mobile-hide .shen-ac__toc {
		display: none;
	}

	/* 折叠模式：点击标题展开收起 */
	.shen-ac.toc-mobile-collapse .shen-ac__toc {
		padding: 14px 16px;
		border: 1px solid #e8ebf1;
		border-radius: 4px;
	}
	.shen-ac.toc-mobile-collapse .shen-ac__toc-heading {
		margin-bottom: 0;
		cursor: pointer;
	}
	.shen-ac.toc-mobile-collapse .shen-ac__toc-caret { display: block; }
	.shen-ac.toc-mobile-collapse .shen-ac__toc:not(.is-collapsed) .shen-ac__toc-list { margin-top: 14px; }
	.shen-ac.toc-mobile-collapse .shen-ac__toc.is-collapsed .shen-ac__toc-list { display: none; }
	.shen-ac.toc-mobile-collapse .shen-ac__toc.is-collapsed .shen-ac__toc-caret { transform: rotate(-90deg); }
}

@media (prefers-reduced-motion: reduce) {
	.shen-ac__toc-caret,
	.shen-ac__toc-item::before,
	.shen-ac__toc-link { transition: none; }
}
