/**
 * 帮助文档详情 / 分类目录页
 * template-docs.php、template-docs-index.php
 */

.page-template-template-docs .agmcn-docs-hero,
.page-template-template-docs-index .agmcn-docs-hero {
	padding-top: 5rem; /* 避开固定导航，避免面包屑被挡住 */
}

.page-template-template-docs .agmcn-docs-hero--light,
.page-template-template-docs-index .agmcn-docs-hero--light {
	min-height: 11.5rem;
}

.page-template-template-docs .agmcn-docs-page {
	/* 正文区接在 Banner 之后 */
}

.page-template-template-docs .agmcn-docs-layout {
	display: flex;
	flex-direction: column;
	gap: 0;
	min-height: 60vh;
}

@media (min-width: 1024px) {
	.page-template-template-docs .agmcn-docs-layout {
		flex-direction: row;
		align-items: stretch;
	}

	.page-template-template-docs .agmcn-docs-sidebar {
		width: 16.5rem;
		flex-shrink: 0;
		border-right: 1px solid #e2e8f0;
	}

	.page-template-template-docs .agmcn-docs-sidebar-inner {
		position: sticky;
		top: 5rem;
		max-height: calc(100vh - 5rem);
		overflow-y: auto;
		padding: 1.25rem 1rem 2rem 0;
	}

	.page-template-template-docs .agmcn-docs-article {
		flex: 1;
		min-width: 0;
		max-width: 48rem;
		padding: 2rem 0 3rem 2.5rem;
	}
}

@media (max-width: 1023px) {
	.page-template-template-docs .agmcn-docs-sidebar {
		padding: 1rem 0;
		border-bottom: 1px solid #e2e8f0;
	}

	.page-template-template-docs .agmcn-docs-article {
		padding: 1.5rem 0 2.5rem;
	}
}

.page-template-template-docs .agmcn-docs-sidebar-title {
	font-size: 0.6875rem;
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #94a3b8;
	margin: 0 0 0.65rem 0.75rem;
}

/* 侧栏导航：与帮助中心一致，激活态右侧色条 */
.page-template-template-docs .agmcn-docs-nav {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.page-template-template-docs .agmcn-docs-nav a {
	display: block;
	padding: 0.45rem 0.75rem;
	border-radius: 0.5rem 0 0 0.5rem;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: #475569;
	text-decoration: none;
	border-right: 2px solid transparent;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.page-template-template-docs .agmcn-docs-nav a:hover {
	background-color: #f1f5f9;
	color: #0f172a;
}

.page-template-template-docs .agmcn-docs-nav a.is-active {
	background-color: #eff6ff;
	color: #003399;
	font-weight: 700;
	border-right-color: #003399;
}

.page-template-template-docs .agmcn-docs-nav a.is-parent {
	color: #003399;
	font-weight: 700;
	margin-bottom: 0.35rem;
}

/* 正文排版 — 提高优先级，压过 Tailwind preflight / .wp-block-heading */
.page-template-template-docs .doc-content {
	font-size: 0.9375rem;
	line-height: 1.75;
	color: #334155;
}

.page-template-template-docs .doc-content > *:first-child {
	margin-top: 0 !important;
}

.page-template-template-docs .doc-content h2,
.page-template-template-docs .doc-content h2.wp-block-heading {
	font-size: 1.375rem !important;
	font-weight: 800 !important;
	color: #0f172a !important;
	margin: 2rem 0 0.75rem !important;
	padding-bottom: 0.4rem;
	border-bottom: 2px solid #e2e8f0;
	line-height: 1.35;
}

.page-template-template-docs .doc-content h3,
.page-template-template-docs .doc-content h3.wp-block-heading {
	font-size: 1.125rem !important;
	font-weight: 700 !important;
	color: #1e293b !important;
	margin: 1.5rem 0 0.5rem !important;
	line-height: 1.4;
}

.page-template-template-docs .doc-content h4,
.page-template-template-docs .doc-content h4.wp-block-heading {
	font-size: 1.05rem !important;
	font-weight: 700 !important;
	color: #0f172a !important;
	margin: 1.75rem 0 0.65rem !important;
	padding: 0;
	background: none;
	border: 0;
	border-left: 3px solid #003399;
	padding-left: 0.75rem;
	line-height: 1.4;
	border-radius: 0;
}

.page-template-template-docs .doc-content p,
.page-template-template-docs .doc-content .wp-block-paragraph {
	margin: 0 0 0.9rem !important;
	line-height: 1.75;
	color: #334155;
}

.page-template-template-docs .doc-content p:empty {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.page-template-template-docs .doc-content ul,
.page-template-template-docs .doc-content ol {
	margin: 0 0 0.9rem !important;
	padding-left: 1.25rem;
}

.page-template-template-docs .doc-content li {
	margin-bottom: 0.3rem;
}

.page-template-template-docs .doc-content a {
	color: #003399;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.page-template-template-docs .doc-content a:hover {
	color: #1e40af;
}

.page-template-template-docs .doc-content code {
	background: #f1f5f9;
	padding: 0.1rem 0.35rem;
	border-radius: 0.2rem;
	font-size: 0.8125rem;
	color: #b91c1c;
}

.page-template-template-docs .doc-content pre {
	background: #1e293b;
	color: #e2e8f0;
	padding: 0.875rem 1.125rem;
	border-radius: 0.5rem;
	overflow-x: auto;
	margin: 1rem 0 !important;
	font-size: 0.8125rem;
	line-height: 1.5;
}

.page-template-template-docs .doc-content pre code {
	background: none;
	color: inherit;
	padding: 0;
}

.page-template-template-docs .doc-content img,
.page-template-template-docs .doc-content .wp-block-image img {
	display: block;
	max-width: 100%;
	width: auto;
	height: auto;
	margin: 0.75rem auto;
	border-radius: 0.375rem;
	border: 0;
	box-shadow: none;
	background: #f8fafc;
}

/* 破损图（natural size 为 0）不占尴尬边框 */
.page-template-template-docs .doc-content img:not([src]),
.page-template-template-docs .doc-content img[src=""] {
	display: none;
}

.page-template-template-docs .doc-content figure,
.page-template-template-docs .doc-content .wp-block-image {
	margin: 1.25rem 0 !important;
	text-align: center;
}

.page-template-template-docs .doc-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 1rem 0 !important;
	font-size: 0.8125rem;
}

.page-template-template-docs .doc-content th,
.page-template-template-docs .doc-content td {
	padding: 0.5rem 0.75rem;
	border: 1px solid #e2e8f0;
}

.page-template-template-docs .doc-content th {
	background: #f8fafc;
	font-weight: 700;
	color: #0f172a;
	text-align: left;
}

.page-template-template-docs .doc-content .ez-toc-container {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 0.5rem;
	padding: 0.75rem 1.25rem;
	margin-bottom: 1.5rem !important;
	display: inline-block;
	max-width: 100%;
}

/* 上下篇 */
.page-template-template-docs .agmcn-docs-pager {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid #e2e8f0;
}

.page-template-template-docs .agmcn-docs-pager a {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 1rem 1.1rem;
	border: 1px solid #e2e8f0;
	border-radius: 0.75rem;
	font-size: 0.875rem;
	font-weight: 700;
	color: #0f172a;
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.page-template-template-docs .agmcn-docs-pager a:hover {
	border-color: #003399;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
	color: #003399;
}

.page-template-template-docs .agmcn-docs-pager-label {
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #94a3b8;
}

.page-template-template-docs .agmcn-docs-pager-next {
	text-align: right;
}

.page-template-template-docs .agmcn-docs-pager-next a {
	align-items: flex-end;
}

@media (max-width: 640px) {
	.page-template-template-docs .agmcn-docs-pager {
		grid-template-columns: 1fr;
	}

	.page-template-template-docs .agmcn-docs-pager-next {
		text-align: left;
	}

	.page-template-template-docs .agmcn-docs-pager-next a {
		align-items: flex-start;
	}
}
