/* ---------------------------------------------------------
 * ZXlib 界面增强：顶部居中搜索 + 首页幻灯片
 * 不改动主题原有导航、分类与站点卡片结构
 * --------------------------------------------------------- */

.zx-search {
	--zx-accent: #f1404b;
	display: flex;
	align-items: center;
	gap: 6px;
	height: 42px;
	padding: 4px 4px 4px 14px;
	background: rgba(136, 136, 136, .08);
	border: 1px solid rgba(136, 136, 136, .18);
	border-radius: 999px;
	transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.zx-search:focus-within {
	background: #fff;
	border-color: rgba(241, 64, 75, .45);
	box-shadow: 0 0 0 4px rgba(241, 64, 75, .12);
}

.zx-search__engine {
	position: relative;
	flex: 0 0 auto;
	margin: 0;
	padding-right: 12px;
	border-right: 1px solid rgba(136, 136, 136, .22);
}

.zx-search__engine select {
	-webkit-appearance: none;
	appearance: none;
	width: auto;
	min-width: 3.2em;
	height: 30px;
	padding: 0 18px 0 2px;
	background: transparent;
	border: 0;
	border-radius: 0;
	color: inherit;
	font-size: 13px;
	line-height: 30px;
	cursor: pointer;
	outline: 0;
}

.zx-search__engine select:focus {
	outline: 0;
	box-shadow: none;
}

.zx-search__engine select option {
	color: #333;
	background: #fff;
}

.zx-search__engine i {
	position: absolute;
	top: 50%;
	right: 8px;
	margin-top: -7px;
	font-size: 12px;
	opacity: .55;
	pointer-events: none;
}

.zx-search__input,
.zx-search .zx-search__input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	height: 32px;
	margin: 0;
	padding: 0 6px;
	color: inherit;
	background: transparent;
	border: 0;
	border-radius: 0;
	font-size: 14px;
	line-height: 32px;
	outline: 0;
	box-shadow: none;
}

.zx-search__input:focus {
	outline: 0;
	box-shadow: none;
}

.zx-search__input::placeholder {
	color: rgba(120, 125, 130, .85);
}

.zx-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.zx-search__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--zx-accent);
	color: #fff;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	transition: transform .2s ease, background .2s ease;
}

.zx-search__btn:hover,
.zx-search__btn:focus {
	background: #d92f3c;
	color: #fff;
	transform: scale(1.05);
}

.zx-search__btn:active {
	transform: scale(.96);
}

/* 桌面端：作为顶栏内常规流元素居中，位置由 flex 决定 */
.zx-nav-search {
	position: static;
	flex: 0 1 440px;
	width: auto;
	max-width: 440px;
	min-width: 0;
	margin: 0 auto;
	transform: none;
	z-index: auto;
}

.zx-search--mobile {
	display: none;
}

/* 顶栏：显式高度与定位，搜索框不会再被负边距/绝对定位顶出视口 */
.navbar.user-info-navbar {
	top: 0;
	left: 250px;
	right: 0;
	width: auto;
	min-height: 56px;
	margin: 0;
	background-color: #fff;
	box-shadow: 0 1px 0 rgba(15, 23, 42, .07);
}

.sidebar-menu.collapsed + .main-content > nav.navbar.user-info-navbar {
	left: 80px;
	width: auto;
}

.navbar .navbar-content {
	position: relative;
	min-height: 56px;
	padding: 0 14px;
	box-sizing: border-box;
	box-shadow: none;
}

.user-info-navbar .user-info-menu > li > a {
	padding: 15px 10px;
}

.user-info-navbar .user-info-menu > li a[data-toggle=sidebar] {
	padding: 15px 10px 15px 20px;
}

.user-info-navbar .zx-weather {
	max-height: 56px;
	overflow: hidden;
}

@media (min-width: 768px) and (max-width: 1199px) {
	.zx-weather {
		display: none !important;
	}
}

@media (min-width: 768px) and (max-width: 991px) {
	.zx-nav-search .zx-search__engine {
		display: none;
	}

	.zx-search {
		padding-left: 18px;
	}
}

/* 深色模式 */
.black .zx-search {
	background: rgba(255, 255, 255, .05);
	border-color: rgba(255, 255, 255, .12);
}

.black .zx-search:focus-within {
	background: #33363a;
	border-color: rgba(241, 64, 75, .5);
}

.black .zx-search__engine {
	border-right-color: rgba(255, 255, 255, .14);
}

.black .zx-search__engine select {
	color: #cfd3d6;
}

.black .zx-search__engine select option {
	color: #e4e7e9;
	background: #2c2e2f;
}

.black .zx-search__input,
.black .zx-search .zx-search__input {
	color: #eef0f2;
	background: transparent;
	border: 0;
	padding: 0 6px;
	box-shadow: none;
}

.black .zx-search__input::placeholder {
	color: rgba(180, 186, 191, .7);
}

/* ---------------------------------------------------------
 * 首页幻灯片
 * --------------------------------------------------------- */
.zx-hero {
	position: relative;
	max-width: 1170px;
	margin: 100px auto 18px;
}

.zx-hero__viewport {
	position: relative;
	overflow: hidden;
	border-radius: 20px;
	background: #232629;
	box-shadow: 0 24px 48px -26px rgba(0, 0, 0, .55);
}

.zx-hero__track {
	display: flex;
	margin: 0;
	transition: transform .65s cubic-bezier(.22, .61, .36, 1);
	will-change: transform;
}

.zx-hero__slide {
	position: relative;
	display: flex;
	align-items: center;
	flex: 0 0 100%;
	min-height: 328px;
	padding: 44px 56px;
	overflow: hidden;
	color: #fff;
}

.zx-hero__slide--sunset {
	background-image: linear-gradient(120deg, #ff8a5b 0%, #f1404b 52%, #9d1139 100%);
}

.zx-hero__slide--ocean {
	background-image: linear-gradient(120deg, #2b6cb0 0%, #2c5282 52%, #16294a 100%);
}

.zx-hero__slide--forest {
	background-image: linear-gradient(120deg, #12a594 0%, #0b7a75 55%, #084c61 100%);
}

.zx-hero__slide::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(120% 90% at 82% 16%, rgba(255, 255, 255, .22), transparent 56%);
	pointer-events: none;
}

.zx-hero__orb {
	position: absolute;
	right: -70px;
	bottom: -130px;
	width: 280px;
	height: 280px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
}

.zx-hero__content {
	position: relative;
	z-index: 2;
	max-width: 620px;
}

.zx-hero__badge {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 5px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .18);
	font-size: 12px;
	letter-spacing: .06em;
	line-height: 1.4;
}

.zx-hero__badge i {
	font-size: 12px;
	line-height: 1;
}

.zx-hero__title {
	margin: 16px 0 10px;
	color: #fff;
	font-size: clamp(24px, 3vw, 36px);
	font-weight: 700;
	line-height: 1.28;
	letter-spacing: .01em;
}

.zx-hero__desc {
	max-width: 520px;
	margin: 0 0 22px;
	color: rgba(255, 255, 255, .84);
	font-size: 15px;
	line-height: 1.75;
}

.zx-hero__cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 22px;
	border-radius: 999px;
	background: #fff;
	color: #232629;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	transition: transform .25s ease, box-shadow .25s ease;
}

.zx-hero__cta:hover,
.zx-hero__cta:focus {
	color: #232629;
	transform: translateY(-2px);
	box-shadow: 0 12px 26px rgba(0, 0, 0, .25);
}

.zx-hero__cta i {
	font-size: 14px;
}

.zx-hero__deco {
	position: absolute;
	top: 50%;
	right: 8%;
	z-index: 1;
	color: #fff;
	font-size: 150px;
	line-height: 1;
	opacity: .14;
	transform: translateY(-50%) rotate(-8deg);
}

.zx-hero__deco i {
	line-height: 1;
}

/* 切换按钮 */
.zx-hero__nav {
	position: absolute;
	top: 50%;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 50%;
	background: rgba(20, 22, 24, .22);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	transform: translateY(-50%);
	transition: opacity .25s ease, background .25s ease;
}

.zx-hero__nav--prev {
	left: 14px;
}

.zx-hero__nav--next {
	right: 14px;
}

.zx-hero:hover .zx-hero__nav,
.zx-hero:focus-within .zx-hero__nav {
	opacity: 1;
}

.zx-hero__nav:hover,
.zx-hero__nav:focus {
	background: rgba(255, 255, 255, .28);
	color: #fff;
}

/* 指示点 */
.zx-hero__dots {
	position: absolute;
	left: 50%;
	bottom: 14px;
	z-index: 4;
	display: flex;
	align-items: center;
	gap: 8px;
	transform: translateX(-50%);
}

.zx-hero__dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, .45);
	cursor: pointer;
	transition: width .3s ease, background .3s ease;
}

.zx-hero__dot.is-active {
	width: 26px;
	background: #fff;
}

.zx-hero__dot:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

@media (min-width: 768px) and (max-width: 991px) {
	.zx-hero__slide {
		min-height: 290px;
		padding: 36px 40px;
	}

	.zx-hero__deco {
		font-size: 120px;
	}
}

@media (max-width: 767px) {
	.zx-search--mobile {
		display: flex;
		margin: 0 0 12px;
	}

	.zx-hero {
		margin: 12px auto 16px;
	}

	.zx-hero__viewport {
		border-radius: 16px;
	}

	.zx-hero__slide {
		min-height: 236px;
		padding: 26px 24px 34px;
	}

	.zx-hero__title {
		margin: 10px 0 8px;
		font-size: 22px;
	}

	.zx-hero__desc {
		margin-bottom: 16px;
		font-size: 13px;
		line-height: 1.65;
	}

	.zx-hero__cta {
		padding: 8px 18px;
		font-size: 13px;
	}

	.zx-hero__deco {
		right: -12px;
		font-size: 104px;
		opacity: .12;
	}

	.zx-hero__nav {
		display: none;
	}

	.zx-hero__dots {
		bottom: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.zx-hero__track {
		transition: none;
	}
}

/* 移动端隐藏桌面端搜索（顶栏在移动端整体隐藏） */
@media (max-width: 767px) {
	.zx-nav-search {
		display: none;
	}
}

/* ===== 阅读体验：浮动目录 + 书签 ===== */
.zx-toc {
	position: fixed;
	top: 96px;
	right: 20px;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	width: 232px;
	max-height: calc(100vh - 132px);
	padding: 12px 10px 10px;
	background: #fff;
	border: 1px solid rgba(15, 23, 42, .07);
	border-radius: 14px;
	box-shadow: 0 12px 34px rgba(15, 23, 42, .12);
	font-size: 13px;
	line-height: 1.5;
}

.zx-toc__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 0 4px 8px;
	border-bottom: 1px solid rgba(15, 23, 42, .07);
	color: #64748b;
}

.zx-toc__title {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	color: #1f2937;
}

.zx-toc__progress {
	font-variant-numeric: tabular-nums;
	font-size: 12px;
	padding: 1px 7px;
	border-radius: 999px;
	background: rgba(59, 130, 246, .1);
	color: #2563eb;
}

.zx-toc__list {
	margin: 6px 0 0;
	padding: 0 2px;
	list-style: none;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.zx-toc__list::-webkit-scrollbar {
	width: 6px;
}

.zx-toc__list::-webkit-scrollbar-thumb {
	background: rgba(100, 116, 139, .3);
	border-radius: 3px;
}

.zx-toc__item {
	margin: 0;
}

.zx-toc__item--h3 {
	padding-left: 12px;
}

.zx-toc__item a {
	display: block;
	padding: 5px 8px;
	border-radius: 8px;
	color: #4b5563;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	transition: background .15s ease, color .15s ease;
}

.zx-toc__item a:hover {
	background: rgba(59, 130, 246, .08);
	color: #1d4ed8;
}

.zx-toc__item a.is-active {
	background: rgba(59, 130, 246, .12);
	color: #1d4ed8;
	font-weight: 600;
}

.zx-toc__bookmark,
.zx-bookmark-fab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 10px;
	padding: 8px 10px;
	border: 1px solid rgba(15, 23, 42, .1);
	border-radius: 10px;
	background: #f8fafc;
	color: #334155;
	font-size: 13px;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.zx-toc__bookmark:hover,
.zx-bookmark-fab:hover {
	background: #eef2ff;
	border-color: rgba(99, 102, 241, .35);
	color: #4338ca;
}

.zx-toc__bookmark.is-saved,
.zx-bookmark-fab.is-saved {
	background: rgba(59, 130, 246, .12);
	border-color: rgba(59, 130, 246, .3);
	color: #1d4ed8;
}

.zx-bookmark-fab {
	position: fixed;
	right: 24px;
	top: 96px;
	z-index: 1000;
	flex-direction: column;
	gap: 2px;
	width: 56px;
	padding: 9px 4px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 22px rgba(15, 23, 42, .12);
	font-size: 11px;
	line-height: 1.2;
}

.zx-bookmark-fab .fa {
	font-size: 16px;
}

.is-pulse {
	animation: zx-pulse .6s ease;
}

@keyframes zx-pulse {
	0% { transform: scale(1); }
	45% { transform: scale(1.08); }
	100% { transform: scale(1); }
}

.zx-toc-toggle {
	display: none;
}

.zx-resume {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	z-index: 1001;
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 6px;
	background: rgba(17, 24, 39, .92);
	border-radius: 999px;
	box-shadow: 0 12px 30px rgba(15, 23, 42, .28);
	transition: opacity .25s ease, transform .25s ease;
}

.zx-resume.is-idle {
	opacity: .45;
}

.zx-resume.is-hidden {
	opacity: 0;
	transform: translateX(-50%) translateY(12px);
	pointer-events: none;
}

.zx-resume__go,
.zx-resume__close {
	border: 0;
	background: transparent;
	color: #f8fafc;
	font-size: 13px;
	cursor: pointer;
}

.zx-resume__go {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 12px;
	white-space: nowrap;
}

.zx-resume__close {
	padding: 4px 8px;
	opacity: .7;
}

.zx-resume__close:hover {
	opacity: 1;
}

/* 窄屏改为悬浮按钮 + 抽屉目录 */
@media (max-width: 1399px) {
	.zx-toc {
		display: none;
		right: 12px;
		width: 240px;
	}

	.zx-toc.is-open {
		display: flex;
	}

	.zx-toc-toggle {
		position: fixed;
		right: 16px;
		bottom: 88px;
		z-index: 1001;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 46px;
		height: 46px;
		border: 0;
		border-radius: 50%;
		background: #2563eb;
		color: #fff;
		font-size: 17px;
		box-shadow: 0 10px 24px rgba(37, 99, 235, .35);
		cursor: pointer;
	}

	.zx-bookmark-fab {
		top: auto;
		bottom: 24px;
		right: 16px;
		width: 46px;
		height: 46px;
		padding: 0;
		border-radius: 50%;
		background: #fff;
	}

	.zx-bookmark-fab span {
		display: none;
	}
}

@media (max-width: 767px) {
	.zx-resume {
		left: 12px;
		right: 12px;
		bottom: 16px;
		transform: none;
		justify-content: space-between;
	}

	.zx-resume.is-hidden {
		transform: translateY(12px);
	}

	.zx-resume__go {
		font-size: 12px;
	}
}

/* ===== 回到顶部 ===== */
/* 主题自带 .go-up 与自建按钮位置重叠，只保留一个 */
footer.main-footer .go-up {
	display: none !important;
}

.zx-backtop {
	position: fixed;
	right: 24px;
	bottom: 28px;
	z-index: 1030;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: rgba(44, 46, 47, .86);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	box-shadow: 0 6px 18px rgba(15, 23, 42, .22);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity .25s ease, transform .25s ease, background .2s ease;
}

.zx-backtop:hover,
.zx-backtop:focus-visible {
	background: rgba(44, 46, 47, 1);
	color: #fff;
}

.zx-backtop.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
}

@media (max-width: 991px) {
	.zx-backtop {
		right: 14px;
		bottom: 78px;
		width: 42px;
		height: 42px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.zx-backtop {
		transition: none;
	}
}
