/*
 * Rackora 全局样式：设计令牌、页面骨架与模板结构。
 * 区块自身的样式位于 blocks/<name>/style.css 与 assets/css/blocks/<core-block>.css，按需加载。
 */

:root {
	color-scheme: light;
	--rack-paper: var(--wp--preset--color--paper);
	--rack-surface: var(--wp--preset--color--surface);
	--rack-ink: var(--wp--preset--color--ink);
	--rack-ink-soft: var(--wp--preset--color--ink-soft);
	--rack-muted: var(--wp--preset--color--muted);
	--rack-line: var(--wp--preset--color--line);
	--rack-line-strong: var(--wp--preset--color--line-strong);
	--rack-accent-user: var(--wp--preset--color--accent);
	--rack-accent: var(--rack-accent-user);
	--rack-accent-hover: color-mix(in srgb, var(--rack-accent-user) 82%, #000);
	--rack-accent-soft: color-mix(in srgb, var(--rack-accent-user) 14%, #fff);
	--rack-signal: var(--wp--preset--color--signal);
	--rack-signal-soft: #fbeae8;
	--rack-amber: var(--wp--preset--color--amber);
	--rack-amber-soft: #fff3df;
	--rack-code: #111a17;
	--rack-code-text: #dce9e3;
	--rack-radius: 7px;
	--rack-header-height: 62px;
	--rack-admin-bar: var(--wp-admin--admin-bar--height, 0px);
	--rack-font-sans: var(--wp--preset--font-family--sans);
	--rack-font-display: var(--wp--preset--font-family--serif);
	--rack-font-mono: var(--wp--preset--font-family--mono);
	font-synthesis: none;
	text-rendering: optimizeLegibility;
}

/*
 * 深色配色。中性色同时覆盖核心调色板，正文里使用了预设颜色的区块也会随之切换；
 * 强调色由用户在「样式」中设置的浅色值推导，避免变量互相引用形成循环。
 */
:root[data-color-scheme="dark"] {
	color-scheme: dark;
	--rack-paper: #111312;
	--rack-surface: #181b19;
	--rack-ink: #edf0ee;
	--rack-ink-soft: #c2c7c4;
	--rack-muted: #969c98;
	--rack-line: #2b302d;
	--rack-line-strong: #454b47;
	--rack-accent: color-mix(in srgb, var(--rack-accent-user) 62%, #9dffd8);
	--rack-accent-hover: color-mix(in srgb, var(--rack-accent) 72%, #fff);
	--rack-accent-soft: color-mix(in srgb, var(--rack-accent) 22%, #111312);
	--rack-signal: #ef7e75;
	--rack-signal-soft: #3b2422;
	--rack-amber: #e4a651;
	--rack-amber-soft: #382b19;
	--rack-code: #0a100e;
	--wp--preset--color--paper: #111312;
	--wp--preset--color--surface: #181b19;
	--wp--preset--color--ink: #edf0ee;
	--wp--preset--color--ink-soft: #c2c7c4;
	--wp--preset--color--muted: #969c98;
	--wp--preset--color--line: #2b302d;
	--wp--preset--color--line-strong: #454b47;
	--wp--preset--color--signal: #ef7e75;
	--wp--preset--color--amber: #e4a651;
}

@media (prefers-color-scheme: dark) {
	:root[data-color-scheme="auto"] {
		color-scheme: dark;
		--rack-paper: #111312;
		--rack-surface: #181b19;
		--rack-ink: #edf0ee;
		--rack-ink-soft: #c2c7c4;
		--rack-muted: #969c98;
		--rack-line: #2b302d;
		--rack-line-strong: #454b47;
		--rack-accent: color-mix(in srgb, var(--rack-accent-user) 62%, #9dffd8);
		--rack-accent-hover: color-mix(in srgb, var(--rack-accent) 72%, #fff);
		--rack-accent-soft: color-mix(in srgb, var(--rack-accent) 22%, #111312);
		--rack-signal: #ef7e75;
		--rack-signal-soft: #3b2422;
		--rack-amber: #e4a651;
		--rack-amber-soft: #382b19;
		--rack-code: #0a100e;
		--wp--preset--color--paper: #111312;
		--wp--preset--color--surface: #181b19;
		--wp--preset--color--ink: #edf0ee;
		--wp--preset--color--ink-soft: #c2c7c4;
		--wp--preset--color--muted: #969c98;
		--wp--preset--color--line: #2b302d;
		--wp--preset--color--line-strong: #454b47;
		--wp--preset--color--signal: #ef7e75;
		--wp--preset--color--amber: #e4a651;
	}
}

/* ---------- 基础 ---------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--rack-header-height) + var(--rack-admin-bar) + 24px);
}

body {
	min-height: 100vh;
	letter-spacing: 0;
}

/* 渐变背景放在固定定位的伪元素上：滚动时不重绘整页背景，iOS 上也不会被拉伸到整篇文章高度 */
body::before {
	position: fixed;
	z-index: -1;
	inset: 0;
	content: "";
	background:
		radial-gradient(ellipse 120% 60% at 50% -10%, color-mix(in srgb, var(--rack-accent) 10%, transparent), transparent 55%),
		linear-gradient(
			180deg,
			color-mix(in srgb, var(--rack-paper) 92%, #fff) 0%,
			var(--rack-paper) 40%,
			color-mix(in srgb, var(--rack-paper) 96%, var(--rack-accent-soft)) 100%
		);
	pointer-events: none;
}

.editor-styles-wrapper::before {
	content: none;
}

button,
input,
textarea,
select {
	font: inherit;
}

button,
a {
	-webkit-tap-highlight-color: transparent;
}

a {
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--rack-accent) 45%, transparent);
	outline-offset: 3px;
}

img,
svg,
video {
	max-width: 100%;
}

img {
	height: auto;
}

.rackora-icon {
	display: block;
	flex: none;
}

/* 区块主题的根容器与结构分组不使用流式布局的默认间距，由下方规则精确控制 */
.wp-site-blocks > *,
.site-main > *,
.shell > *,
.header-inner > *,
.header-actions > *,
.footer-inner > *,
.footer-brand > *,
.home-grid > *,
.home-sidebar > *,
.content-section > *,
.article-layout > *,
.article > *,
.article-header > *,
.article-sidebar > *,
.article-footer > *,
.article-footer__meta > *,
.profile-panel > *,
.profile-panel__copy > *,
.sidebar-panel > *,
.sidebar-panel__header > *,
.section-heading > *,
.about-heading > *,
.about-heading__copy > *,
.brand > *,
.brand-copy > *,
.post-navigation > *,
.empty-state > *,
.error-page > * {
	margin-block: 0;
}

.shell {
	width: min(calc(100% - 40px), var(--wp--style--global--wide-size, 1240px));
	margin-inline: auto;
}

.site-main {
	min-height: calc(100vh - 210px);
	padding: 56px 0 80px;
}

.eyebrow {
	margin: 0 0 10px;
	color: var(--rack-accent);
	font-family: var(--rack-font-mono);
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.icon-button,
.back-to-top {
	width: 38px;
	height: 38px;
	display: inline-grid;
	place-items: center;
	padding: 0;
	color: var(--rack-ink-soft);
	background: transparent;
	border: 1px solid transparent;
	border-radius: 5px;
	cursor: pointer;
}

.icon-button:hover,
.back-to-top:hover {
	color: var(--rack-ink);
	background: var(--rack-accent-soft);
	border-color: var(--rack-line);
}

.icon-button svg,
.back-to-top svg,
.pagination svg {
	width: 18px;
	height: 18px;
	stroke-width: 1.8;
}

/* ---------- 页头 ---------- */

.site-header {
	position: sticky;
	z-index: 100;
	top: var(--rack-admin-bar);
	min-height: var(--rack-header-height);
	border-bottom: 1px solid color-mix(in srgb, var(--rack-line) 86%, transparent);
}

/* 毛玻璃背景放在伪元素上：直接给页头加 backdrop-filter 会让它成为 fixed 子元素的包含块，导航遮罩层只能铺满页头 */
.site-header::before {
	position: absolute;
	z-index: -1;
	inset: 0;
	content: "";
	background: color-mix(in srgb, var(--rack-paper) 92%, transparent);
	backdrop-filter: blur(12px);
}

.header-inner {
	min-height: var(--rack-header-height);
	display: grid;
	grid-template-columns: minmax(150px, auto) 1fr auto;
	align-items: center;
	gap: 24px;
}

.brand {
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 10px;
}

/* Logo 只固定高度、宽度按比例：方形图标为 34×34，横向 Logo 自动变宽。主题图标 SVG 没有固有尺寸，不能用 auto 高度。 */
.brand-mark img {
	width: auto;
	height: 34px;
	object-fit: contain;
	border-radius: 7px;
}

.brand-copy {
	min-width: 0;
	display: grid;
	line-height: 1.12;
}

.brand-title {
	overflow: hidden;
	color: var(--rack-ink);
	font-size: 1rem;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.brand-title a {
	color: inherit;
	text-decoration: none;
}

.brand-tagline {
	max-width: 240px;
	overflow: hidden;
	margin-top: 4px !important;
	color: var(--rack-muted);
	font-size: 0.72rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.header-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 4px;
}

/* ---------- 首页 ---------- */

.home-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	grid-template-areas:
		"heading sidebar"
		"content sidebar";
	gap: 44px 48px;
	align-items: start;
}

.home-grid:not(:has(> .home-sidebar)) {
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"heading"
		"content";
}

.home-grid > .home-heading {
	grid-area: heading;
}

.home-grid > .content-section {
	grid-area: content;
}

.home-grid > .home-sidebar {
	grid-area: sidebar;
}

.home-sidebar {
	position: sticky;
	top: calc(var(--rack-header-height) + var(--rack-admin-bar) + 28px);
	display: grid;
	gap: 14px;
}

.section-heading {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 14px !important;
}

.section-heading__title,
.comments__title {
	font-size: 1.32rem;
	line-height: 1.2;
}

.text-link {
	flex: none;
	font-size: 0.88rem;
	font-weight: 650;
}

:is(.shell, .content-section) > .wp-block-rackora-pagination {
	margin-top: 32px;
}

.profile-panel {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	align-items: center;
	gap: 14px 16px;
	padding: 18px;
	background: var(--rack-surface);
	border: 1px solid var(--rack-line);
	border-radius: 8px;
}

.profile-panel__mark img {
	width: auto;
	height: 64px;
	object-fit: contain;
	border: 1px solid var(--rack-line);
	border-radius: 8px;
}

.profile-panel__copy {
	min-width: 0;
}

.profile-panel__copy .wp-block-site-title {
	color: var(--rack-ink);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
}

.profile-panel__copy .wp-block-site-tagline {
	margin-top: 5px;
	color: var(--rack-muted);
	font-size: 0.8rem;
	line-height: 1.55;
}

.profile-panel > .profile-socials,
.profile-panel > .wp-block-rackora-site-stats {
	grid-column: 1 / -1;
}

.sidebar-panel {
	padding: 16px;
	background: color-mix(in srgb, var(--rack-surface) 94%, var(--rack-paper));
	border: 1px solid color-mix(in srgb, var(--rack-line) 82%, transparent);
	border-radius: 8px;
}

.sidebar-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-bottom: 8px;
}

.sidebar-panel__title {
	color: var(--rack-ink);
	font-size: 1rem;
	line-height: 1.3;
}

.sidebar-panel__more {
	font-size: 0.72rem;
}

/* ---------- 文章列表 ---------- */

.post-list {
	display: grid;
	gap: 12px;
}

.post-list > li {
	margin: 0;
	animation: rack-rise 480ms ease both;
}

.post-list > li:nth-child(1) {
	animation-delay: 40ms;
}

.post-list > li:nth-child(2) {
	animation-delay: 80ms;
}

.post-list > li:nth-child(3) {
	animation-delay: 120ms;
}

.post-list > li:nth-child(4) {
	animation-delay: 160ms;
}

.post-list > li:nth-child(5) {
	animation-delay: 200ms;
}

.pagination {
	width: 100%;
	min-height: 44px;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 16px;
	margin: 32px 0 0;
}

.wp-block-rackora-pagination .pagination {
	margin-top: 0;
}

.pagination__link {
	width: max-content;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	color: var(--rack-ink-soft);
	border: 1px solid var(--rack-line);
	border-radius: 5px;
	font-size: 0.86rem;
	font-weight: 650;
	text-decoration: none;
}

.pagination__link:hover {
	color: var(--rack-accent);
	border-color: color-mix(in srgb, var(--rack-accent) 28%, var(--rack-line));
}

.pagination__link[rel="prev"] {
	grid-column: 1;
	justify-self: start;
}

.pagination__link[rel="next"] {
	grid-column: 3;
	justify-self: end;
}

.pagination__status {
	grid-column: 2;
	color: var(--rack-muted);
	font-family: var(--rack-font-mono);
	font-size: 0.78rem;
}

/* ---------- 文章与页面 ---------- */

.article-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 280px;
	gap: 52px;
	width: 100%;
}

.article-layout:not(:has(> .article-sidebar)) {
	grid-template-columns: minmax(0, 1fr);
}

.article {
	min-width: 0;
}

.article-header {
	margin-bottom: 32px !important;
}

.article-header > .wp-block-breadcrumbs {
	margin-bottom: 24px;
}

.article-title {
	color: var(--rack-ink);
	font-family: var(--rack-font-display);
	font-size: clamp(2rem, 3.6vw, 2.75rem);
	font-weight: 600;
	line-height: 1.16;
	letter-spacing: -0.02em;
	overflow-wrap: anywhere;
}

.article-header > .wp-block-rackora-post-meta {
	margin-bottom: 0;
}

.article-footer {
	margin-top: 52px !important;
	padding-top: 24px;
	border-top: 1px solid var(--rack-line);
}

.article-footer__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
}

.series-posts,
.related-posts {
	margin-top: 28px;
	padding: 18px 0 0;
	border-top: 1px solid var(--rack-line);
}

.series-posts h2,
.related-posts h2 {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 12px;
	font-size: 0.92rem;
}

.series-posts ol,
.related-posts ol {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.series-posts a,
.related-posts a {
	color: var(--rack-ink);
	font-size: 0.92rem;
	font-weight: 600;
	text-decoration: none;
}

.series-posts li.is-current a,
.series-posts a:hover,
.related-posts a:hover {
	color: var(--rack-accent);
}

.post-navigation {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin-top: 28px;
}

.post-navigation:not(:has(a)) {
	display: none;
}

.about-heading {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 18px 20px;
	margin-bottom: 36px !important;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--rack-line);
}

.about-heading__mark img {
	width: auto;
	height: 88px;
	object-fit: contain;
	border-radius: 16px;
}

.about-heading__copy .article-title {
	margin-bottom: 8px;
}

.about-heading > .profile-socials {
	grid-column: 1 / -1;
}

/* ---------- 文章侧栏 ---------- */

.article-sidebar {
	position: sticky;
	top: calc(var(--rack-header-height) + var(--rack-admin-bar) + 30px);
	align-self: start;
	display: grid;
	gap: 28px;
	min-width: 0;
}

.article-sidebar__section {
	min-width: 0;
}

.article-sidebar__section > * {
	margin-block: 0;
}

.article-sidebar__heading {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 10px !important;
	color: var(--rack-ink);
	font-family: var(--rack-font-sans);
	font-size: 0.8rem;
	font-weight: 700;
	white-space: nowrap;
}

.article-sidebar__heading::after {
	height: 1px;
	flex: 1;
	content: "";
	background: var(--rack-line);
}

.article-sidebar__heading h2 {
	margin: 0;
	color: inherit;
	font: inherit;
}

.article-sidebar [data-toc] {
	display: grid;
	gap: 1px;
	border-left: 1px solid var(--rack-line-strong);
}

.article-sidebar [data-toc] a {
	position: relative;
	display: block;
	margin-left: -1px;
	padding: 7px 10px 7px 14px;
	color: var(--rack-ink-soft);
	border-left: 2px solid transparent;
	font-size: 0.8rem;
	line-height: 1.5;
	text-decoration: none;
	transition:
		color 160ms ease,
		background-color 160ms ease,
		border-color 160ms ease;
}

.article-sidebar [data-toc] a[data-level="3"] {
	padding-left: 28px;
}

.article-sidebar [data-toc] a:hover,
.article-sidebar [data-toc] a.is-active {
	color: var(--rack-accent-hover);
	background: var(--rack-accent-soft);
	border-left-color: var(--rack-accent);
}

.article-sidebar [data-toc] a.is-active {
	font-weight: 650;
}

.article-sidebar__posts,
.article-sidebar__comments {
	display: grid;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.article-sidebar__posts li + li,
.article-sidebar__comments li + li {
	border-top: 1px solid var(--rack-line);
}

.article-sidebar__posts li {
	margin: 0;
}

.article-sidebar__posts a {
	display: block;
	padding: 9px 0;
	color: var(--rack-ink-soft);
	font-size: 0.8rem;
	line-height: 1.5;
	text-decoration: none;
}

.article-sidebar__posts a:hover,
.article-sidebar__posts a.is-active {
	color: var(--rack-accent);
}

.article-sidebar__comments li {
	padding: 9px 0;
}

.article-sidebar__comments strong {
	display: block;
	overflow: hidden;
	color: var(--rack-ink-soft);
	font-size: 0.72rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.article-sidebar__comments p,
.article-sidebar__empty {
	display: -webkit-box;
	overflow: hidden;
	margin: 4px 0 0;
	color: var(--rack-muted);
	font-size: 0.72rem;
	line-height: 1.45;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

/* ---------- 空状态、错误页与按钮 ---------- */

.empty-state,
.error-page {
	width: 100%;
	padding: 54px 20px;
	text-align: center;
}

.empty-state h2,
.error-page h1 {
	margin: 0 0 8px;
}

.empty-state p,
.error-page > p:not(.error-code) {
	margin: 0;
	color: var(--rack-muted);
}

.error-code {
	color: var(--rack-accent);
	font-family: var(--rack-font-mono);
	font-size: 7rem;
	font-weight: 800;
	line-height: 1;
}

.error-actions {
	justify-content: center;
	gap: 10px;
	margin-top: 24px !important;
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--rack-ink);
	background: var(--rack-surface);
	border: 1px solid var(--rack-line-strong);
}

/* ---------- 页脚 ---------- */

.site-footer {
	padding: 34px 0;
	color: var(--rack-muted);
	background: var(--rack-surface);
	border-top: 1px solid var(--rack-line);
}

.footer-inner {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: start;
	gap: 20px 40px;
}

.footer-title {
	color: var(--rack-ink);
	font-weight: 700;
}

.footer-credit,
.footer-compliance {
	grid-column: 1 / -1;
	color: var(--rack-muted);
	font-size: 0.7rem;
}

.footer-credit a,
.footer-compliance a,
.footer-compliance span {
	color: var(--rack-muted);
}

.footer-compliance {
	display: flex;
	flex-wrap: wrap;
	gap: 5px 14px;
	margin-top: -10px !important;
	font-size: 0.72rem;
}

.footer-compliance > * + *::before {
	margin-right: 14px;
	color: var(--rack-line-strong);
	content: "·";
}

/* ---------- 浮动控件 ---------- */

.back-to-top {
	position: fixed;
	z-index: 80;
	right: max(18px, env(safe-area-inset-right));
	bottom: max(18px, env(safe-area-inset-bottom));
	color: var(--rack-ink);
	background: var(--rack-surface);
	border-color: var(--rack-line-strong);
	box-shadow: 0 4px 16px rgb(0 0 0 / 10%);
	opacity: 0;
	pointer-events: none;
	transform: translateY(8px);
	transition:
		opacity 220ms ease,
		transform 220ms ease,
		color 160ms ease,
		background-color 160ms ease,
		border-color 160ms ease;
}

.back-to-top.is-visible {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

.reading-progress {
	position: fixed;
	z-index: 110;
	top: var(--rack-admin-bar);
	left: 0;
	width: 100%;
	height: 2px;
	pointer-events: none;
}

.reading-progress span {
	width: 100%;
	height: 100%;
	display: block;
	background: var(--rack-accent);
	transform: scaleX(0);
	transform-origin: left center;
}

.mobile-toc-toggle {
	position: fixed;
	z-index: 85;
	left: max(18px, env(safe-area-inset-left));
	bottom: max(18px, env(safe-area-inset-bottom));
	display: none;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	color: var(--rack-ink);
	background: var(--rack-surface);
	border: 1px solid var(--rack-line-strong);
	border-radius: 999px;
	box-shadow: 0 4px 16px rgb(0 0 0 / 10%);
	font-size: 0.82rem;
	font-weight: 650;
	cursor: pointer;
}

.mobile-toc-toggle svg {
	width: 16px;
	height: 16px;
	stroke-width: 1.8;
}

.mobile-toc-panel {
	position: fixed;
	inset: 0;
	z-index: 140;
	display: grid;
	align-items: end;
	background: rgb(0 0 0 / 36%);
}

.mobile-toc-panel[hidden] {
	display: none;
}

.mobile-toc-panel__sheet {
	max-height: min(72vh, 520px);
	overflow: auto;
	padding: 16px 18px 24px;
	background: var(--rack-paper);
	border-radius: 16px 16px 0 0;
}

.mobile-toc-panel__sheet header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.mobile-toc-panel__sheet nav {
	display: grid;
	gap: 4px;
}

.mobile-toc-panel__sheet a {
	display: block;
	padding: 10px 8px;
	color: var(--rack-ink-soft);
	border-radius: 6px;
	text-decoration: none;
}

.mobile-toc-panel__sheet a[data-level="3"] {
	padding-left: 18px;
	font-size: 0.92rem;
}

.mobile-toc-panel__sheet a.is-active,
.mobile-toc-panel__sheet a:hover {
	color: var(--rack-accent);
	background: var(--rack-accent-soft);
}

body.toc-open {
	overflow: hidden;
}

.image-lightbox {
	max-width: min(96vw, 1200px);
	max-height: 92vh;
	padding: 0;
	color: inherit;
	background: transparent;
	border: 0;
}

.image-lightbox::backdrop {
	background: rgb(8 12 10 / 78%);
}

.image-lightbox img {
	max-width: min(96vw, 1200px);
	max-height: 88vh;
	margin: 0 auto;
	object-fit: contain;
}

.image-lightbox__close {
	position: fixed;
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	color: #fff;
	background: rgb(0 0 0 / 42%);
	border: 0;
	border-radius: 999px;
	cursor: pointer;
}

@keyframes rack-rise {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ---------- 响应式 ---------- */

@media (max-width: 960px) {
	.header-inner {
		grid-template-columns: minmax(0, 1fr) auto auto;
		gap: 6px;
	}

	.brand-tagline {
		display: none;
	}

	.site-nav {
		grid-column: 2;
	}

	.header-actions {
		grid-column: 3;
	}

	.article-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.article-sidebar {
		display: none;
	}

	.mobile-toc-toggle {
		display: inline-flex;
	}

	.home-grid {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"heading"
			"content"
			"sidebar";
		gap: 32px;
	}

	.home-sidebar {
		position: static;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 720px) {
	.shell {
		width: min(calc(100% - 28px), var(--wp--style--global--wide-size, 1240px));
	}

	.site-main {
		padding: 38px 0 60px;
	}

	.home-sidebar {
		grid-template-columns: minmax(0, 1fr);
	}

	.article-title {
		font-size: 2rem;
	}

	.error-code {
		font-size: 4.5rem;
	}

	.post-navigation,
	.footer-inner {
		grid-template-columns: 1fr;
	}

	.footer-credit,
	.footer-compliance {
		grid-column: 1;
	}
}

@media (max-width: 440px) {
	.brand-title {
		max-width: 132px;
	}

	.pagination {
		gap: 8px;
	}

	.pagination__link {
		padding: 8px;
	}

	.pagination__status {
		font-size: 0.7rem;
	}
}

@media print {
	body::before,
	.site-header,
	.site-footer,
	.article-sidebar,
	.reading-progress,
	.back-to-top,
	.mobile-toc-toggle,
	.code-copy,
	.post-navigation,
	.share-bar,
	.ad-slot,
	.comments {
		display: none !important;
	}

	body,
	.site-main {
		color: #000;
		background: #fff !important;
	}

	.article-layout {
		display: block;
	}

	.article-title {
		font-family: Georgia, "Noto Serif SC", serif;
	}

	.series-posts,
	.related-posts {
		break-inside: avoid;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-delay: 0ms !important;
		animation-iteration-count: 1 !important;
	}
}
