/* ============ 文章增强：代码高亮 + 目录 TOC（2026-08-15） ============ */

/* ---- 代码高亮容器（磨砂玻璃，光斑透过来） ---- */
.post-content pre {
	position: relative;
	background: var(--glass-bg, rgba(255, 255, 255, 0.22));
	-webkit-backdrop-filter: blur(16px) saturate(170%);
	backdrop-filter: blur(16px) saturate(170%);
	border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.55));
	border-radius: 14px;
	padding: 18px 20px;
	margin: 18px 0;
	overflow: auto;
	box-shadow: var(--glass-shadow, 0 8px 32px rgba(31, 35, 41, 0.08));
	scrollbar-width: thin;
}

.post-content pre code.hljs {
	background: transparent;
	padding: 0;
	font-size: 14px;
	line-height: 1.7;
	color: #1f2329;
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, "Courier New", monospace;
}

/* 代码块语言角标 */
.post-content pre[data-lang]::after {
	content: attr(data-lang);
	position: absolute;
	top: 8px;
	right: 12px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: #8b949e;
	background: rgba(31, 35, 41, 0.06);
	padding: 2px 8px;
	border-radius: 20px;
	pointer-events: none;
	user-select: none;
}

/* hljs 浅色主题微调（配合玻璃底） */
.post-content .hljs-keyword,
.post-content .hljs-selector-tag,
.post-content .hljs-literal { color: #d73a49; }
.post-content .hljs-string,
.post-content .hljs-regexp { color: #032f62; }
.post-content .hljs-number { color: #005cc5; }
.post-content .hljs-title,
.post-content .hljs-function .hljs-title { color: #6f42c1; }
.post-content .hljs-comment,
.post-content .hljs-quote { color: #6a737d; font-style: italic; }
.post-content .hljs-built_in,
.post-content .hljs-type { color: #e36209; }
.post-content .hljs-attr,
.post-content .hljs-attribute { color: #005cc5; }

/* ---- 目录 TOC ---- */
.linyu-toc {
	margin: 0 0 26px;
	padding: 14px 18px;
	background: var(--glass-bg, rgba(255, 255, 255, 0.22));
	border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.55));
	border-radius: 14px;
	box-shadow: var(--glass-shadow, 0 8px 32px rgba(31, 35, 41, 0.08));
	backdrop-filter: blur(16px) saturate(170%);
	-webkit-backdrop-filter: blur(16px) saturate(170%);
}

.linyu-toc summary {
	cursor: pointer;
	font-weight: 600;
	font-size: 15px;
	color: var(--text-color, #1f2329);
	list-style: none;
	user-select: none;
	display: flex;
	align-items: center;
	gap: 6px;
}

.linyu-toc summary::-webkit-details-marker { display: none; }

.linyu-toc summary::after {
	content: "▾";
	margin-left: auto;
	transition: transform 0.2s ease;
	color: #8b949e;
	font-size: 13px;
}

.linyu-toc[open] summary::after { transform: rotate(180deg); }

.linyu-toc-nav {
	margin-top: 12px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	max-height: 340px;
	overflow-y: auto;
	scrollbar-width: thin;
}

.linyu-toc-link {
	display: block;
	padding: 5px 10px;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.5;
	color: #4b5563;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
	border-left: 2px solid transparent;
}

.linyu-toc-link:hover {
	background: rgba(59, 130, 246, 0.08);
	color: #2563eb;
}

.linyu-toc-link.is-current {
	background: rgba(59, 130, 246, 0.1);
	color: #2563eb;
	border-left-color: #3b82f6;
	font-weight: 500;
}

.linyu-toc-h3 {
	padding-left: 26px;
	font-size: 13px;
}

/* 标题锚点滚动偏移（避开吸顶 header） */
.post-content h2[id],
.post-content h3[id] {
	scroll-margin-top: 90px;
}
