/* macOS-style code blocks for dark reading mode. */
.entry-content .ps-code-window {
	position: relative;
	margin: 1.8em 0;
	overflow: hidden;
	border: 1px solid rgba(148, 163, 184, 0.24);
	border-radius: 18px;
	background:
		radial-gradient(circle at 18% 0%, rgba(59, 130, 246, 0.18), transparent 32%),
		linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(3, 7, 18, 0.94));
	box-shadow:
		0 24px 58px rgba(0, 0, 0, 0.34),
		inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.entry-content .ps-code-window::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.04)),
		radial-gradient(circle at 80% 20%, rgba(216, 164, 81, 0.10), transparent 28%);
	opacity: 0.9;
}

.entry-content .ps-code-window__toolbar {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 12px;
	min-height: 46px;
	padding: 0 12px 0 16px;
	border-bottom: 1px solid rgba(148, 163, 184, 0.18);
	background:
		linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.90));
}

.entry-content .ps-code-window__dots {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.entry-content .ps-code-window__dots span {
	width: 12px;
	height: 12px;
	border-radius: 999px;
	box-shadow:
		inset 0 0 0 1px rgba(0, 0, 0, 0.18),
		0 0 12px rgba(255, 255, 255, 0.08);
}

.entry-content .ps-code-window__dots span:nth-child(1) {
	background: linear-gradient(180deg, #ff6b6b, #e5484d);
}

.entry-content .ps-code-window__dots span:nth-child(2) {
	background: linear-gradient(180deg, #ffd166, #f59e0b);
}

.entry-content .ps-code-window__dots span:nth-child(3) {
	background: linear-gradient(180deg, #5ee28c, #22c55e);
}

.entry-content .ps-code-window__title {
	min-width: 0;
	color: rgba(203, 213, 225, 0.76);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	line-height: 1;
	text-transform: uppercase;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.entry-content .ps-code-window__copy {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 58px;
	height: 30px;
	padding: 0 12px;
	border: 1px solid rgba(148, 163, 184, 0.24);
	border-radius: 999px;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
		rgba(15, 23, 42, 0.78);
	color: rgba(226, 232, 240, 0.9);
	font-size: 12px;
	font-weight: 800;
	line-height: 1;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
	transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.entry-content .ps-code-window__copy:hover {
	transform: translateY(-1px);
	border-color: rgba(255, 236, 184, 0.42);
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
		rgba(30, 41, 59, 0.86);
	color: #fff4c7;
}

.entry-content .ps-code-window__copy.is-copied {
	border-color: rgba(94, 226, 140, 0.42);
	color: #bbf7d0;
}

.entry-content .ps-code-window pre,
.entry-content .ps-code-window .ps-code-window__pre {
	position: relative;
	z-index: 1;
	margin: 0 !important;
	padding: 22px 24px 24px !important;
	max-width: 100%;
	overflow: auto;
	border: 0 !important;
	border-radius: 0 !important;
	background:
		linear-gradient(180deg, rgba(2, 6, 23, 0.10), rgba(2, 6, 23, 0.38)),
		transparent !important;
	color: #e5edf8 !important;
	box-shadow: none !important;
	font-size: 14px;
	line-height: 1.82;
	tab-size: 4;
	-webkit-overflow-scrolling: touch;
}

.entry-content .ps-code-window pre code,
.entry-content .ps-code-window .ps-code-window__pre code {
	display: block;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	color: inherit !important;
	font-family: "Maple Mono CN", "SFMono-Regular", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
	font-size: inherit;
	line-height: inherit;
	white-space: pre;
}

.entry-content .ps-code-window pre::-webkit-scrollbar {
	height: 12px;
	width: 12px;
}

.entry-content .ps-code-window pre::-webkit-scrollbar-track {
	background: rgba(15, 23, 42, 0.72);
}

.entry-content .ps-code-window pre::-webkit-scrollbar-thumb {
	border: 3px solid rgba(15, 23, 42, 0.72);
	border-radius: 999px;
	background: rgba(148, 163, 184, 0.46);
}

.entry-content .ps-code-window pre::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 236, 184, 0.58);
}

.entry-content :not(pre) > code {
	border: 1px solid rgba(148, 163, 184, 0.18);
	background: rgba(15, 23, 42, 0.62) !important;
	color: #ffe7a6 !important;
}

@media (max-width: 760px) {
	.entry-content .ps-code-window {
		border-radius: 15px;
	}

	.entry-content .ps-code-window__toolbar {
		grid-template-columns: auto 1fr auto;
		min-height: 42px;
		padding: 0 10px 0 12px;
	}

	.entry-content .ps-code-window__dots {
		gap: 6px;
	}

	.entry-content .ps-code-window__dots span {
		width: 10px;
		height: 10px;
	}

	.entry-content .ps-code-window__title {
		font-size: 11px;
		text-align: left;
	}

	.entry-content .ps-code-window__copy {
		min-width: 50px;
		height: 28px;
		padding: 0 10px;
	}

	.entry-content .ps-code-window pre,
	.entry-content .ps-code-window .ps-code-window__pre {
		padding: 18px 16px 20px !important;
		font-size: 13px;
		line-height: 1.76;
	}
}
