html.site-loading .profile-name,
html.site-loading .profile-bio,
html.site-loading .announcement-text,
html.site-loading .friends-lead,
html.site-loading .site-card-title,
html.site-loading .site-card-muted {
	visibility: hidden;
}

html.site-loading .profile-avatar-wrap img {
	opacity: 0;
}
/* Swup 过渡（对齐 blog1-master transition.css 要点） */
.transition-main {
	transition:
		opacity 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
		transform 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 默认可见；仅过渡时由 html.is-animating 压暗，避免类未卸导致整页「空白」 */
.transition-swup-fade {
	opacity: 1;
	transform: none;
}

.transition-leaving {
	transition:
		transform 300ms cubic-bezier(0.55, 0.055, 0.675, 0.19),
		opacity 300ms cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

html.is-changing .transition-swup-fade {
	transition: all 300ms ease-out;
}

html.is-animating .transition-swup-fade {
	opacity: 0;
	transform: translateY(1.5rem);
}

html.is-animating .transition-main {
	opacity: 0;
	transform: translateY(1.5rem) translateX(0.5rem);
}

.swup-main {
	min-width: 0;
	width: 100%;
}

@media (min-width: 768px) {
	#main-grid .swup-main {
		grid-column: 2 / 3;
	}
}

/* 浮动面板 */
.float-panel {
	position: fixed;
	z-index: 70;
	transition:
		opacity 0.2s ease,
		transform 0.2s ease;
}

.float-panel-closed {
	opacity: 0;
	pointer-events: none;
}

#search-panel.float-panel-closed {
	transform: translateX(-50%) translateY(-0.25rem);
}

#display-setting.float-panel-closed,
.mobile-toc-panel.float-panel-closed {
	transform: translateY(-0.25rem);
}

.search-panel {
	top: 5.25rem;
	left: 50%;
	transform: translateX(-50%);
	width: min(calc(100vw - 2rem), 28rem);
	background: var(--float-panel-bg);
	border-radius: var(--radius-large);
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
	padding: 1rem;
}

.search-inner input {
	width: 100%;
	padding: 0.65rem 0.85rem;
	border-radius: 0.5rem;
	border: 1px solid var(--line-divider);
	background: var(--btn-regular-bg);
	color: rgba(255, 255, 255, 0.9);
	font-size: 0.9375rem;
}

.search-results {
	margin-top: 0.75rem;
	max-height: 60vh;
	overflow-y: auto;
}

.search-results a {
	display: block;
	padding: 0.65rem 0.5rem;
	border-radius: 0.5rem;
	text-decoration: none;
	color: rgba(255, 255, 255, 0.85);
	font-weight: 600;
}

.search-results a:hover {
	background: var(--btn-plain-bg-hover);
	color: var(--primary);
}

.search-results mark {
	background: transparent;
	color: var(--primary);
	font-weight: 700;
}

#display-setting {
	top: 5.25rem;
	right: 1rem;
	background: var(--float-panel-bg);
	border-radius: var(--radius-large);
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.display-setting-inner {
	padding: 0.5rem 0.75rem 1rem;
}

.hue-value {
	display: inline-flex;
	min-width: 2.5rem;
	height: 1.75rem;
	padding: 0 0.5rem;
	border-radius: 0.375rem;
	background: var(--btn-regular-bg);
	color: var(--btn-content);
	font-weight: 700;
	font-size: 0.875rem;
	align-items: center;
	justify-content: center;
	margin: 0.5rem 0;
}

#colorSlider {
	width: 100%;
	height: 1.5rem;
	border-radius: 0.25rem;
	-webkit-appearance: none;
	appearance: none;
	background: linear-gradient(
		to right,
		oklch(0.7 0.12 0),
		oklch(0.7 0.12 60),
		oklch(0.7 0.12 120),
		oklch(0.7 0.12 180),
		oklch(0.7 0.12 240),
		oklch(0.7 0.12 300),
		oklch(0.7 0.12 360)
	);
}

#colorSlider::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 0.5rem;
	height: 1rem;
	border-radius: 0.125rem;
	background: rgba(255, 255, 255, 0.85);
	cursor: pointer;
}

.mobile-toc-panel {
	top: 5.25rem;
	right: 1rem;
	left: auto;
	width: min(20rem, calc(100vw - 2rem));
	background: var(--float-panel-bg);
	border-radius: var(--radius-large);
	border: 1px solid rgba(255, 255, 255, 0.08);
	max-height: 70vh;
	overflow: hidden;
}

.mobile-toc-body {
	padding: 0.75rem 1rem;
	max-height: 65vh;
	overflow-y: auto;
}

.mobile-toc-body a {
	display: block;
	padding: 0.35rem 0.25rem;
	color: rgba(255, 255, 255, 0.75);
	text-decoration: none;
	font-size: 0.9rem;
	border-radius: 0.35rem;
}

.mobile-toc-body a:hover {
	color: var(--primary);
	background: var(--btn-plain-bg-hover);
}

/* 归档时间线 */
.archive-year-row {
	display: flex;
	align-items: center;
	height: 3.75rem;
	width: 100%;
}

.archive-year {
	width: 15%;
	text-align: right;
	font-size: 1.5rem;
	font-weight: 700;
	color: rgba(255, 255, 255, 0.75);
}

@media (min-width: 768px) {
	.archive-year {
		width: 10%;
	}
}

.archive-dot-wrap {
	width: 15%;
	display: flex;
	justify-content: center;
	position: relative;
}

@media (min-width: 768px) {
	.archive-dot-wrap {
		width: 10%;
	}
}

.archive-dot {
	width: 0.75rem;
	height: 0.75rem;
	border-radius: 999px;
	background: transparent;
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

.archive-count {
	width: 70%;
	color: rgba(255, 255, 255, 0.5);
	font-size: 0.9375rem;
}

@media (min-width: 768px) {
	.archive-count {
		width: 80%;
	}
}

.archive-row {
	display: flex;
	align-items: center;
	min-height: 2.5rem;
	text-decoration: none;
	color: rgba(255, 255, 255, 0.75);
	border-radius: 0.5rem;
	padding: 0 0.25rem;
}

.archive-row:hover {
	color: var(--primary);
	background: var(--btn-plain-bg-hover);
}

.archive-date {
	width: 15%;
	text-align: right;
	font-size: 0.875rem;
	color: rgba(255, 255, 255, 0.5);
}

.archive-line {
	width: 15%;
	display: flex;
	justify-content: center;
	position: relative;
	min-height: 2.5rem;
}

.archive-line::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 1px;
	background: var(--line-divider);
}

.archive-line-dot {
	width: 0.25rem;
	height: 0.25rem;
	border-radius: 999px;
	background: oklch(0.5 0.05 var(--hue));
	align-self: center;
	outline: 4px solid var(--card-bg);
	transition: all 0.15s ease;
}

.archive-row:hover .archive-line-dot {
	height: 1.25rem;
	background: var(--primary);
}

.archive-title {
	width: 70%;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding-right: 1rem;
}

.archive-tags {
	display: none;
	width: 15%;
	font-size: 0.8125rem;
	color: rgba(255, 255, 255, 0.25);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

@media (min-width: 768px) {
	.archive-tags {
		display: block;
	}
}

/* 友链 */
.friends-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
}

.friends-header-icon {
	width: 2rem;
	height: 2rem;
	border-radius: 0.5rem;
	background: var(--primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.1rem;
}

.friends-h1 {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0;
}

.friends-h2 {
	font-size: 1.25rem;
	font-weight: 700;
	margin: 0 0 0.75rem;
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.friends-lead {
	color: rgba(255, 255, 255, 0.55);
	font-size: 0.9375rem;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.friends-lead code {
	overflow-wrap: anywhere;
	word-break: break-all;
}

.friends-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
}

@media (min-width: 768px) {
	.friends-grid {
		grid-template-columns: 1fr 1fr;
	}
}

.friend-card {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 1rem;
	border-radius: 0.5rem;
	background: var(--card-bg);
	text-decoration: none;
	color: inherit;
	transition: background 0.15s ease;
}

.friend-card:hover {
	background: rgba(255, 255, 255, 0.06);
}

.friend-card img {
	width: 1.25rem;
	height: 1.25rem;
	border-radius: 0.25rem;
}

.bookmark-card-url {
	color: rgba(255, 255, 255, 0.45);
	overflow-wrap: anywhere;
	word-break: break-all;
	line-height: 1.45;
}

:root:not(.dark) .bookmark-card-url {
	color: color-mix(in oklch, var(--content-meta) 88%, transparent);
}

.sponsors-section {
	margin-top: 2rem;
}

.site-card {
	margin-top: 1rem;
	padding: 1.5rem;
	border-radius: 1rem;
	border: 1px solid var(--line-divider);
	background: rgba(0, 0, 0, 0.15);
}

.site-card-title {
	font-size: 1.25rem;
	font-weight: 700;
	margin: 0 0 0.5rem;
}

.site-card-muted {
	color: rgba(255, 255, 255, 0.45);
	font-size: 0.875rem;
	margin: 0.35rem 0 0;
	overflow-wrap: anywhere;
	word-break: break-all;
}

/* 右侧目录栏（大屏）：固定在页面右缘外的空白区，不压住主内容 */
.toc-dock {
	display: none;
	position: fixed;
	top: 5.5rem;
	right: var(--toc-gap);
	left: auto;
	z-index: 10;
	width: var(--toc-width);
	max-height: calc(100vh - 8rem);
	pointer-events: none;
}

@media (min-width: 1280px) {
	.toc-dock:has(.toc-nav a) {
		display: block;
	}

	/* 有目录时为主栏预留右侧槽位，整体略向左让出目录区 */
	body:has(.toc-dock .toc-nav a) .page-shell,
	body:has(.toc-dock .toc-nav a) #top-row {
		max-width: min(var(--page-width), calc(100vw - var(--toc-slot) - 1.5rem));
		margin-left: auto;
		margin-right: var(--toc-slot);
	}

	body:has(.toc-dock .toc-nav a) .back-to-top-btn {
		right: calc(var(--toc-slot) + 0.75rem);
	}
}

.toc-dock-inner {
	pointer-events: auto;
	position: sticky;
	top: 5rem;
	padding: 0.55rem 0.6rem;
	margin: 0;
	border-radius: 1rem;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)),
		var(--card-bg-transparent);
	backdrop-filter: blur(18px) saturate(140%);
	border: 1px solid rgba(255, 255, 255, 0.12);
	box-shadow:
		0 14px 28px rgba(0, 0, 0, 0.14),
		inset 0 1px 0 rgba(255, 255, 255, 0.12);
	max-height: calc(100vh - 10rem);
	overflow: auto;
}

.toc-title {
	font-weight: 700;
	font-size: 0.78rem;
	margin-bottom: 0.35rem;
	color: rgba(255, 255, 255, 0.55);
}

.toc-nav a {
	display: block;
	font-size: 0.75rem;
	line-height: 1.35;
	padding: 0.2rem 0.3rem;
	margin: 0.08rem 0;
	border-radius: 0.3rem;
	color: rgba(255, 255, 255, 0.55);
	text-decoration: none;
	border-left: 2px solid transparent;
	padding-left: 0.45rem;
}

.toc-nav a:hover {
	color: var(--primary);
	background: var(--btn-plain-bg-hover);
}

.toc-nav a.visible {
	color: var(--primary);
	border-left-color: var(--primary);
	font-weight: 600;
}

.toc-nav a.toc-h3 {
	padding-left: 0.8rem;
	font-size: 0.72rem;
}

/* 回到顶部 */
.back-to-top-wrap {
	position: relative;
}

.back-to-top-btn {
	position: fixed;
	bottom: 6rem;
	right: 1.5rem;
	z-index: 60;
	width: 3.75rem;
	height: 3.75rem;
	border: none;
	border-radius: 1rem;
	cursor: pointer;
	background: var(--card-bg);
	color: var(--primary);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
	transition:
		opacity 0.25s ease,
		transform 0.25s ease;
}

.back-to-top-btn.hide {
	opacity: 0;
	pointer-events: none;
	transform: translateY(0.5rem) scale(0.95);
}

.stub-banner {
	font-size: 0.8125rem;
	color: rgba(255, 255, 255, 0.45);
	margin: 0 0 1rem;
	padding: 0.5rem 0.75rem;
	border-radius: 0.5rem;
	background: var(--btn-regular-bg);
	border: 1px dashed var(--line-divider);
}

.post-cover-fig {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin: 0;
	border-radius: 1.25rem;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.12);
	box-shadow: 0 18px 34px rgba(0, 0, 0, 0.14);
}

.post-cover-fig img {
	width: 100%;
	max-width: 100%;
	height: auto;
	display: block;
	object-fit: contain;
	object-position: center center;
}

.nav-chev {
	flex-shrink: 0;
	font-size: 1.5rem;
	color: var(--primary);
}

.nav-text-ellipsis {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex: 1;
}

.btn-card {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

/* 浅色主题（与 variables.styl light 分支对齐） */
:root:not(.dark) {
	--primary: oklch(0.7 0.14 var(--hue));
	--page-bg: oklch(0.95 0.01 var(--hue));
	--card-bg: white;
	--card-bg-transparent: rgba(255, 255, 255, 0.8);
	--btn-content: oklch(0.55 0.12 var(--hue));
	--btn-regular-bg: oklch(0.95 0.025 var(--hue));
	--btn-regular-bg-hover: oklch(0.9 0.05 var(--hue));
	--btn-regular-bg-active: oklch(0.85 0.08 var(--hue));
	--btn-plain-bg-hover: oklch(0.95 0.025 var(--hue));
	--btn-plain-bg-active: oklch(0.98 0.01 var(--hue));
	--float-panel-bg: white;
	--line-divider: rgba(0, 0, 0, 0.08);
	--deep-text: oklch(0.25 0.02 var(--hue));
}

:root:not(.dark) .top-gradient-highlight {
	background: linear-gradient(
		to bottom,
		rgba(255, 255, 255, 0.5) 0%,
		rgba(255, 255, 255, 0.2) 60%,
		transparent 100%
	);
}

.markdown-content img {
	cursor: zoom-in;
}

/* 加密文章：磨砂 + 解锁面板 */
.post-encrypted-root {
	position: relative;
}

.post-encrypted-blur-stack {
	position: relative;
	min-height: 14rem;
	border-radius: 1.25rem;
	overflow: hidden;
	border: 1px solid color-mix(in oklch, var(--line-divider) 85%, transparent);
}

.post-encrypted-blur-text {
	filter: blur(10px);
	transform: scale(1.02);
	user-select: none;
	pointer-events: none;
	opacity: 0.55;
	padding: 1.25rem 1.35rem;
}

.post-encrypted-fake-line {
	margin: 0 0 0.65rem;
	line-height: 1.75;
	color: var(--deep-text);
}

.post-encrypted-frost {
	position: absolute;
	inset: 0;
	background: color-mix(in oklch, var(--card-bg-transparent) 55%, transparent);
	backdrop-filter: blur(18px) saturate(1.35);
	-webkit-backdrop-filter: blur(18px) saturate(1.35);
}

.post-encrypted-dialog {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(22rem, calc(100% - 2.5rem));
	padding: 1.35rem 1.25rem 1.25rem;
	border-radius: 1rem;
	background: color-mix(in oklch, var(--card-bg) 92%, transparent);
	border: 1px solid color-mix(in oklch, var(--line-divider) 90%, transparent);
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
	text-align: center;
}

.post-encrypted-heading {
	margin: 0 0 0.35rem;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--deep-text);
}

.post-encrypted-sub {
	margin: 0 0 1rem;
	font-size: 0.86rem;
	color: var(--content-meta, #8892a6);
}

.post-encrypted-input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.55rem 0.65rem;
	border-radius: 0.55rem;
	border: 1px solid var(--line-divider);
	background: var(--card-bg);
	color: var(--deep-text);
	margin-bottom: 0.65rem;
	font: inherit;
}

.post-encrypted-btn {
	width: 100%;
	justify-content: center;
}

.post-encrypted-msg {
	margin: 0.55rem 0 0;
	font-size: 0.82rem;
	color: #e57373;
}

.post-encrypted-root.is-unlocked .post-encrypted-locked-view {
	display: none;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.post-card-encrypted-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	margin-left: 0.35rem;
	font-size: 0.78rem;
	font-weight: 600;
	color: color-mix(in oklch, var(--primary) 75%, var(--content-meta));
	vertical-align: middle;
}

@media (prefers-reduced-motion: reduce) {
	html.is-animating .transition-main,
	html.is-animating .transition-swup-fade {
		transition: none !important;
		transform: none !important;
		opacity: 1 !important;
	}
}

.about-page-placeholder {
	margin: 0;
}

.about-page-empty {
	margin: 0 0 0.75rem;
}

.about-page-md-fallback {
	margin: 0;
	white-space: pre-wrap;
	font-size: 0.9rem;
	overflow-x: auto;
}
