/* ===== Mobile menu toggle ===== */
.menu-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 36px;
	height: 36px;
	padding: 6px;
	border: 0;
	background: transparent;
	cursor: pointer;
	z-index: 50;
}

.menu-toggle-bar {
	display: block;
	width: 100%;
	height: 2px;
	background: var(--atom-text);
	border-radius: 2px;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle.is-active .menu-toggle-bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.menu-toggle.is-active .menu-toggle-bar:nth-child(2) {
	opacity: 0;
}

.menu-toggle.is-active .menu-toggle-bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}


@media (max-width: 768px) {
	.menu-toggle {
		display: flex;
	}

	.header-actions {
		display: none;
	}

	/* ── Stripe-style mobile nav overlay (slide from right) ── */
	.nav {
		display: flex;
		flex-direction: column;
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		width: min(360px, 85vw);
		justify-content: flex-start;
		align-items: stretch;
		flex: none;
		flex-wrap: nowrap;
		gap: 0;
		padding: 5rem 1.5rem calc(4rem + env(safe-area-inset-bottom));
		background: var(--atom-surface);
		color: var(--atom-text);
		box-shadow: -4px 0 24px rgba(0, 0, 0, 0.10);
		transform: translateX(100%);
		transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
		z-index: 45;
		overflow-y: auto;
	}

	.nav.is-open {
		transform: translateX(0);
	}

	/* Overlay backdrop */
	.nav::before {
		content: '';
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.30);
		z-index: -1;
		opacity: 0;
		transition: opacity 0.3s ease;
		pointer-events: none;
	}

	.nav.is-open::before {
		opacity: 1;
		pointer-events: auto;
	}

	.nav a {
		display: flex;
		align-items: center;
		width: 100%;
		padding: 1rem 1rem;
		font-size: 1.05rem;
		font-weight: 500;
		color: var(--atom-text);
		text-decoration: none;
		border-radius: var(--atom-radius-sm);
		transition: background-color 0.2s ease;
	}

	.nav a:hover,
	.nav a.is-current {
		background: var(--atom-primary-soft);
		color: var(--atom-primary);
	}

	.mobile-btns {
		margin-top: auto;
		width: auto;
		display: flex;
		gap: 0.75rem;
	}

	.mobile-btns a {
		flex: 1;
		justify-content: center;
		text-align: center;
		padding: 0.85rem 1rem;
		border-radius: var(--atom-radius-sm);
		font-size: 0.95rem;
		font-weight: 600;
		text-decoration: none;
	}

	.mobile-btns a:first-child {
		background: var(--atom-primary);
		color: var(--atom-white);
	}

	.mobile-btns a:last-child {
		border: 1px solid var(--atom-border);
		color: var(--atom-text);
	}

	/* ── Mobile fixed bottom bar ── */
	.mobile-bar {
		display: flex;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 30;
		background: rgba(255, 255, 255, 0.96);
		backdrop-filter: blur(12px);
		border-top: 1px solid var(--atom-border);
		padding: 0.5rem 1rem;
		padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
		gap: 0.75rem;
	}

	.mobile-bar a {
		flex: 1;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 0.4rem;
		padding: 0.7rem 0.5rem;
		border-radius: var(--atom-radius-sm);
		font-size: 0.88rem;
		font-weight: 600;
		text-decoration: none;
	}

	.mobile-bar a:first-child {
		background: var(--atom-primary);
		color: var(--atom-white);
	}

	.mobile-bar a:last-child {
		border: 1px solid var(--atom-border);
		color: var(--atom-text);
	}

	/* Push page content up so it's not hidden behind the fixed bar */
	.section {
		padding-bottom: 4rem;
	}
}



/* ── Article mobile ── */
@media (max-width: 1200px) {
	.article-layout {
		grid-template-columns: 56px minmax(0, 1fr) minmax(0, 320px);
		gap: 1.5rem;
	}

	.article-main {
		padding: 1.75rem;
	}
}

@media (max-width: 992px) {
	.article-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 1.25rem;
		padding: 0 1rem;
	}

	aside.article-right {
		display: none;
	}

	.article-left {
		position: fixed;
		left: 50%;
		bottom: 1rem;
		top: auto;
		transform: translateX(-50%);
		padding-bottom: 0;
		width: auto;
		z-index: 100;
	}

	.article-action-bar {
		flex-direction: row;
		/* 横排 */
		gap: 0.4rem;
		padding: 0.4rem;
		background: var(--atom-surface);
		border-radius: 999px;
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	}

	.article-action-btn {
		width: 3rem;
		height: 3rem;
		font-size: 0.55rem;
		background: transparent;
		/* 去掉单个按钮背景 */
	}

	/* 重置 "跨第2列" 的规则，改为自动跨整行 */
	.article-page #related-posts,
	.article-page #comments.article-comments {
		grid-column: auto;
	}

	/* 底部给固定操作栏留空间 */
	.article-page #comments.article-comments {
		margin-bottom: 6rem;
	}

	/* 返回顶部按钮上移，避免与操作栏重叠 */
	.return-top-button {
		right: 1rem;
		bottom: 5.5rem;
	}

	/* 相关文章仍保留两列 */
	.article-page #related-posts .atomic-article-container {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ═══════════════════════════════════════════════
   3. 手机 (≤768px)
   —— 单栏，进一步压缩间距
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {

	.page-hero {
		min-height: unset;
		padding: 1.5rem 0;
	}

	.page-hero h1 {
		margin-top: 2.5rem;
	}

	nav.breadcrumb {
		display: none;
	}

	.article-page .page-hero .hero-image img {
		max-height: 200px;
	}

	.article-page .page-hero .inner {
		flex-direction: column;
		gap: 2rem;
	}

	.article-layout {
		gap: 1rem;
		padding: 0 0.75rem;
	}

	.article-main {
		padding: 1rem;
		border-radius: var(--atom-radius-sm);
	}

	/* 相关文章 → 单列 */
	.article-page #related-posts .atomic-article-container {
		grid-template-columns: 1fr;
	}

	/* 操作栏更小 */
	.article-action-btn {
		width: 2.75rem;
		height: 2.75rem;
	}

	.article-action-btn i {
		font-size: 1rem;
	}
}

/* Article Style END */