/* 正文排版：随 core/post-content 按需加载，同时作为编辑器样式，保证所见即所得。 */

.article-content {
	color: var(--rack-ink);
	font-size: 1.02rem;
	line-height: 1.85;
	overflow-wrap: anywhere;
}

.article-content > :first-child {
	margin-top: 0;
}

.article-content h2,
.article-content h3,
.article-content h4 {
	position: relative;
	scroll-margin-top: calc(var(--rack-header-height) + var(--rack-admin-bar) + 28px);
	color: var(--rack-ink);
	line-height: 1.35;
}

.article-content h2 {
	margin: 2.6em 0 0.8em;
	padding: 0.2em 0 0.2em 0.75em;
	font-size: 1.65rem;
}

.article-content h2::before {
	position: absolute;
	top: 0.32em;
	bottom: 0.32em;
	left: 0;
	width: 3px;
	content: "";
	background: var(--rack-accent);
	border-radius: 2px;
}

.article-content h3 {
	margin: 2em 0 0.7em;
	padding-bottom: 0.32em;
	border-bottom: 1px solid var(--rack-line);
	font-size: 1.3rem;
}

.article-content h4 {
	margin: 1.7em 0 0.6em;
	font-size: 1.08rem;
}

.heading-anchor {
	position: absolute;
	left: -1.1em;
	color: var(--rack-muted);
	opacity: 0;
	text-decoration: none;
}

.article-content h2 .heading-anchor {
	left: -0.6em;
}

.article-content h2:hover .heading-anchor,
.article-content h3:hover .heading-anchor,
.heading-anchor:focus-visible {
	opacity: 1;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content figure,
.article-content .table-scroll,
.article-content pre {
	margin-top: 1.25em;
	margin-bottom: 1.25em;
}

.article-content ul,
.article-content ol {
	padding-left: 1.45em;
}

.article-content li + li {
	margin-top: 0.45em;
}

.article-content a {
	font-weight: 560;
}

.article-content a[rel~="sponsored"]::after {
	content: attr(data-sponsored-label);
	margin-left: 5px;
	padding: 1px 4px;
	color: var(--rack-amber);
	background: var(--rack-amber-soft);
	border-radius: 2px;
	font-family: var(--rack-font-mono);
	font-size: 0.62rem;
	font-weight: 700;
	vertical-align: 0.12em;
}

.article-content img {
	height: auto;
	margin-inline: auto;
	border-radius: var(--rack-radius);
}

.article-content figcaption,
.article-content .wp-element-caption {
	margin-top: 8px;
	color: var(--rack-muted);
	font-size: 0.78rem;
	text-align: center;
}

.article-content blockquote {
	margin-inline: 0;
	padding: 16px 18px;
	color: var(--rack-ink-soft);
	background: var(--rack-accent-soft);
	border-left: 4px solid var(--rack-accent);
	border-radius: 0 var(--rack-radius) var(--rack-radius) 0;
}

.article-content blockquote.affiliate-disclosure {
	background: var(--rack-amber-soft);
	border-left-color: var(--rack-amber);
}

.article-content blockquote > :first-child {
	margin-top: 0;
}

.article-content blockquote > :last-child {
	margin-bottom: 0;
}

.article-content :not(pre) > code {
	padding: 0.15em 0.38em;
	color: var(--rack-accent);
	background: var(--rack-accent-soft);
	border: 0;
	border-radius: 3px;
	font-family: var(--rack-font-mono);
	font-size: 0.88em;
}

.article-content pre {
	overflow: auto;
	padding: 18px;
	color: var(--rack-code-text);
	background: var(--rack-code);
	border: 1px solid var(--rack-line-strong);
	border-radius: var(--rack-radius);
	font-family: var(--rack-font-mono);
	font-size: 0.84rem;
	line-height: 1.68;
	tab-size: 2;
}

.article-content pre code {
	color: inherit;
	background: none;
	font: inherit;
}

.code-block {
	position: relative;
	overflow: hidden;
	margin: 1.5em 0;
	background: var(--rack-code);
	border: 1px solid var(--rack-line-strong);
	border-radius: var(--rack-radius);
}

.code-toolbar {
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 0 8px 0 14px;
	color: #8fa098;
	background: #0b1210;
	border-bottom: 1px solid #25332d;
	font-family: var(--rack-font-mono);
	font-size: 0.7rem;
	text-transform: uppercase;
}

.code-copy {
	min-width: 34px;
	height: 30px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 0 8px;
	color: #aebdb6;
	background: transparent;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
}

.code-copy:hover {
	color: #fff;
	background: #1d2b25;
}

.code-copy svg {
	width: 15px;
	height: 15px;
}

.code-block pre {
	margin: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
}

.code-block pre code {
	display: block;
	min-width: max-content;
	white-space: pre;
	overflow-wrap: normal;
}

.hljs-comment,
.hljs-quote {
	color: #7a8c83;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-section,
.hljs-link {
	color: #ff8f86;
}

.hljs-string,
.hljs-title,
.hljs-name,
.hljs-type,
.hljs-attribute,
.hljs-symbol,
.hljs-bullet,
.hljs-addition,
.hljs-variable,
.hljs-template-tag,
.hljs-template-variable {
	color: #79dcb9;
}

.hljs-number,
.hljs-meta,
.hljs-built_in,
.hljs-builtin-name,
.hljs-params {
	color: #f0bd6c;
}

.hljs-deletion {
	color: #ff8f86;
	background: #3a1c1a;
}

.table-scroll,
.article-content .wp-block-table {
	width: 100%;
	overflow-x: auto;
	border: 1px solid var(--rack-line);
	border-radius: var(--rack-radius);
	scrollbar-width: thin;
}

.article-content .wp-block-table .table-scroll {
	border: 0;
	border-radius: 0;
}

.article-content table {
	width: 100%;
	min-width: 620px;
	border-collapse: collapse;
	font-size: 0.88rem;
	line-height: 1.5;
}

.article-content th,
.article-content td {
	padding: 11px 13px;
	border: 0;
	border-bottom: 1px solid var(--rack-line);
	text-align: left;
	vertical-align: top;
}

.article-content th {
	color: var(--rack-ink);
	background: color-mix(in srgb, var(--rack-paper) 80%, var(--rack-surface));
	font-size: 0.78rem;
	font-weight: 700;
	white-space: nowrap;
}

.article-content thead {
	border-bottom: 0;
}

.article-content tr:last-child td {
	border-bottom: 0;
}

.article-content tbody tr:hover {
	background: var(--rack-accent-soft);
}

.article-content .product-table td[data-column="price"] {
	color: var(--rack-signal);
	font-family: var(--rack-font-mono);
	font-weight: 700;
	white-space: nowrap;
}

.article-content .product-table td[data-column="buy"] {
	white-space: nowrap;
}

.article-content .product-table td[data-column="buy"] a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	padding: 6px 11px;
	color: #fff;
	background: var(--rack-accent);
	border-radius: 4px;
	font-size: 0.78rem;
	font-weight: 700;
	text-decoration: none;
}

.article-content .product-table td[data-column="buy"] a:hover {
	background: var(--rack-accent-hover);
}

.article-content hr,
.article-content .wp-block-separator {
	margin: 2.5em 0;
	border: 0;
	border-top: 1px solid var(--rack-line);
}

.article-content img.is-zoomable {
	cursor: zoom-in;
}

@media (max-width: 720px) {
	.article-content {
		font-size: 1rem;
		line-height: 1.78;
	}

	.article-content h2 {
		font-size: 1.42rem;
	}

	.heading-anchor {
		display: none;
	}
}

@media print {
	.article-content a {
		color: #000;
		text-decoration: underline;
	}

	.article-content a[href]::after {
		content: " (" attr(href) ")";
		font-size: 0.85em;
		word-break: break-all;
	}

	.article-content a[href^="#"]::after,
	.article-content a[href^="/"]::after {
		content: none;
	}

	.table-scroll,
	.code-block {
		break-inside: avoid;
	}
}
