/* EastDigi — single.php 新闻详情：左侧 H2 目录（对齐 Shopify 指南页） */
.ed-single-body-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.75rem;
	margin-top: 1.5rem;
	align-items: start;
}

.ed-single-body-main {
	min-width: 0;
	max-width: 100%;
}

@media (min-width: 1024px) {
	.ed-single-body-layout {
		grid-template-columns: 220px minmax(0, 1fr);
		gap: 2rem;
	}
}

.ed-single-toc {
	--ed-violet: #8200fa;
	--ed-magenta: #f024f6;
	--ed-surface: #faf8fc;
	--ed-border: rgba(130, 0, 250, 0.18);
	background: var(--ed-surface);
	border: 1px solid var(--ed-border);
	border-radius: 12px;
	padding: 1.15rem 1rem;
	min-width: 0;
	max-width: 100%;
	box-sizing: border-box;
}

.ed-single-toc--empty,
.ed-single-toc:has(nav:empty) {
	display: none;
}

@media (min-width: 1024px) {
	.ed-single-toc {
		position: sticky;
		top: 5.5rem;
		max-height: calc(100vh - 7rem);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}
}

.ed-single-toc__title {
	margin: 0 0 0.75rem;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ed-violet);
}

.ed-single-toc nav {
	font-size: 15px;
	line-height: 1.65;
}

.ed-single-toc a {
	display: block;
	padding: 0.4rem 0.5rem;
	color: #666;
	text-decoration: none;
	border-left: 2px solid transparent;
	border-radius: 0 6px 6px 0;
	transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
	word-break: break-word;
}

.ed-single-toc a:hover,
.ed-single-toc a.is-active {
	color: var(--ed-violet);
	border-left-color: var(--ed-magenta);
	background: rgba(130, 0, 250, 0.06);
	font-weight: 600;
}

.ed-single-toc__empty {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: #888;
}

/* 移动端：目录置于正文上方，可横向浏览长标题 */
@media (max-width: 1023px) {
	.ed-single-toc {
		padding: 1rem 0.85rem;
	}

	.ed-single-toc nav {
		display: flex;
		flex-wrap: wrap;
		gap: 0.45rem;
	}

	.ed-single-toc a {
		flex: 0 1 auto;
		border-left: none;
		border: 1px solid rgba(130, 0, 250, 0.15);
		border-radius: 999px;
		padding: 0.4rem 0.85rem;
		font-size: 13px;
		white-space: nowrap;
		max-width: 100%;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.ed-single-toc a.is-active,
	.ed-single-toc a:hover {
		border-color: rgba(130, 0, 250, 0.35);
		background: rgba(130, 0, 250, 0.08);
	}
}

/* H2 锚点滚动偏移（避开固定顶栏） */
.ed-article-content h2[id] {
	scroll-margin-top: 5.5rem;
}
