/* ============================================================
   XBAOS 首页 - 内容区样式
   仅首页使用（404 页也复用少量基础变量）
   不修改 style.css，避免影响 games/ 与 app/ 下的子页面
   ============================================================ */

:root {
	/* ===== 莫兰迪基底（偏白的暖灰） ===== */
	--bg: #f2efe9;
	--text: #2b2825;
	--text-secondary: #6e675f;
	--card-bg: rgba(255, 255, 255, 0.58);
	--card-border: rgba(58, 50, 42, 0.1);
	--navbar-bg: rgba(246, 243, 238, 0.8);
	--footer-bg: transparent;
	--accent: #7d93a6;
	--link-line: #7d93a6;
	--shadow: rgba(58, 50, 42, 0.1);
	--toggle-bg: rgba(58, 50, 42, 0.07);

	--panel-bg: rgba(252, 250, 247, 0.96);
	--chip-bg: rgba(58, 50, 42, 0.05);
	--chip-border: rgba(58, 50, 42, 0.08);
	--card-hover-shadow: 0 18px 38px rgba(58, 50, 42, 0.14);
	--card-hover-border: rgba(58, 50, 42, 0.16);
	--pager-hover-bg: rgba(58, 50, 42, 0.05);
	--hairline: rgba(58, 50, 42, 0.08);
	--tip-bg: rgba(24, 24, 24, 0.95);
	--tip-fg: #f4f4f4;

	--glass-tint: rgba(255, 255, 255, 0.62);
	--glass-edge: rgba(255, 255, 255, 0.45);

	--pager-bg: rgba(255, 255, 255, 0.55);
	--pager-border: rgba(58, 50, 42, 0.12);
	--pager-active-bg: #dfe5ea;
	--pager-active-border: #b6c3ce;
	--pager-active-ink: #4c5e6e;
}

html[data-theme="dark"] {
	/* ===== 莫兰迪基底（偏黑的暖炭） ===== */
	--bg: #232120;
	--text: #ede9e3;
	--text-secondary: #a79e94;
	--card-bg: rgba(255, 255, 255, 0.055);
	--card-border: rgba(255, 255, 255, 0.085);
	--navbar-bg: rgba(28, 26, 25, 0.82);
	--footer-bg: transparent;
	--accent: #a3b8c8;
	--link-line: #a3b8c8;
	--shadow: rgba(0, 0, 0, 0.45);
	--toggle-bg: rgba(255, 255, 255, 0.09);

	--panel-bg: rgba(36, 34, 32, 0.96);
	--chip-bg: rgba(255, 255, 255, 0.07);
	--chip-border: rgba(255, 255, 255, 0.1);
	--card-hover-shadow: 0 18px 38px rgba(0, 0, 0, 0.5);
	--card-hover-border: rgba(255, 255, 255, 0.2);
	--pager-hover-bg: rgba(255, 255, 255, 0.08);
	--hairline: rgba(255, 255, 255, 0.1);
	--tip-bg: rgba(242, 242, 242, 0.96);
	--tip-fg: #141414;

	--glass-tint: rgba(26, 25, 24, 0.55);
	--glass-edge: rgba(255, 255, 255, 0.09);

	--pager-bg: rgba(255, 255, 255, 0.06);
	--pager-border: rgba(255, 255, 255, 0.1);
	--pager-active-bg: rgba(150, 170, 190, 0.22);
	--pager-active-border: rgba(165, 185, 205, 0.45);
	--pager-active-ink: #cbd7e1;
}

/* ===== 首页字体：思源黑体（Noto Sans SC 与 Source Han Sans SC 两个发行版） ===== */
body {
	font-family: 'Noto Sans SC', 'Source Han Sans SC', sans-serif;
	background: var(--bg);
}

/* ===== 首屏：固定在最底层，不随页面滚动 ===== */
.hero {
	position: fixed;
	inset: 0;
	height: auto;
	z-index: -1;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

/* 顶部压暗，保证透明顶栏的白字在亮部也能读 */
.hero-scrim {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: min(260px, 36vh);
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(to bottom, rgba(16, 14, 12, 0.5), rgba(16, 14, 12, 0));
}

/* 欢迎语轮播：接管 style.css 的首屏淡入，进出场改由 .hero-title-text 的过渡负责 */
.hero-title {
	animation: none;
}

/* 默认是"已收起"态，加上 .is-shown 才浮出。
   用 transition 而非 keyframes：滚动打断时能从当前视觉状态接着走，不会跳帧。 */
.hero-title-text {
	display: inline-block;
	/* 末字后面也带着 letter-spacing，补一个负边距让整行真正视觉居中 */
	margin-right: -12px;
	opacity: 0;
	filter: blur(18px);
	transform: scale(1.06);
	will-change: opacity, filter, transform;
	backface-visibility: hidden;
	/* 收起：稍快，像散焦退远 */
	transition:
		opacity 0.34s ease,
		filter 0.4s ease,
		transform 0.4s cubic-bezier(0.4, 0, 0.6, 1);
}

.hero-title-text.is-shown {
	opacity: 1;
	filter: blur(0);
	transform: scale(1);
	/* 浮出：模糊先收敛，缩放最后落定 */
	transition:
		opacity 0.5s ease,
		filter 0.58s ease,
		transform 0.62s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 滚动后淡出「上滑查看更多」提示，避免在底栏处透出来 */
.hero-hint {
	transition: opacity 0.35s ease;
}

.hero-hint.is-hidden {
	opacity: 0;
}

/* ===== 顶栏：页面顶部透明，滚动后转为毛玻璃 ===== */
.navbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	background: transparent;
	border-bottom: none;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
}

/* 毛玻璃放在伪元素上：opacity 过渡比 backdrop-filter 过渡更顺滑，
   同时避免顶栏自身成为 backdrop root 导致子元素（移动端下拉菜单）糊不到页面。 */
.navbar::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--navbar-bg);
	border-bottom: 1px solid var(--card-border);
	backdrop-filter: blur(16px) saturate(1.2);
	-webkit-backdrop-filter: blur(16px) saturate(1.2);
	opacity: 0;
	transition: opacity 0.4s ease;
	pointer-events: none;
}

.navbar.is-scrolled::before {
	opacity: 1;
}

/* 透明态：统一白字（窄屏菜单展开时顶栏转为毛玻璃，白字规则随之让位） */
.navbar:not(.is-scrolled):not(.is-menu-open) .nav-brand,
.navbar:not(.is-scrolled):not(.is-menu-open) .nav-links a {
	color: #ffffff;
}

.navbar:not(.is-scrolled):not(.is-menu-open) .nav-links a:hover {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.16);
}

.navbar:not(.is-scrolled):not(.is-menu-open) .nav-toggle-label span {
	background: #ffffff;
}

.navbar:not(.is-scrolled):not(.is-menu-open) .theme-toggle {
	background: rgba(255, 255, 255, 0.16);
}

.navbar:not(.is-scrolled):not(.is-menu-open) .theme-toggle:hover {
	background: rgba(255, 255, 255, 0.26);
}

/* ===== 内容纸张：盖在固定 hero 之上 ===== */
.hero-spacer {
	height: 100vh;
	height: 100svh;
	pointer-events: none;
}

/* 主内容区（整块纯色纸张）：直角，不做圆角。
   只改这一层，内部卡片/条目的圆角不受影响。 */
.page-main {
	position: relative;
	z-index: 1; /* 压住固定底栏，滚动到页尾之外时底栏不可见 */
	background: var(--bg);
	border-radius: 0;
	box-shadow: 0 -20px 44px rgba(20, 16, 12, 0.26);
}

/* ===== 搜索区 ===== */
.search-area {
	padding: 56px 24px 0;
}

.search-area-inner {
	position: relative;
	max-width: 960px;
	margin: 0 auto;
}

.search-form {
	display: flex;
	align-items: stretch;
}

.search-field {
	position: relative;
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	min-width: 0;
}

.search-field-icon {
	position: absolute;
	left: 16px;
	width: 19px;
	height: 19px;
	color: var(--text-secondary);
	pointer-events: none;
	opacity: 0.75;
}

.search-input {
	width: 100%;
	height: 52px;
	padding: 0 44px 0 44px;
	font-family: inherit;
	font-size: 0.98rem;
	color: var(--text);
	background: var(--panel-bg);
	border: 1px solid var(--card-border);
	border-radius: 14px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
	outline: none;
	transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-input::placeholder {
	color: var(--text-secondary);
	opacity: 0.75;
}

.search-input:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.16);
}

html[data-theme="dark"] .search-input:focus {
	box-shadow: 0 0 0 3px rgba(90, 155, 245, 0.22);
}

.search-clear {
	position: absolute;
	right: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	color: var(--text-secondary);
	background: transparent;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.search-clear[hidden] {
	display: none;
}

.search-clear svg {
	width: 16px;
	height: 16px;
}

.search-clear:hover {
	color: var(--text);
	background: var(--pager-hover-bg);
}

/* ===== 搜索结果下拉面板 ===== */
.search-panel {
	position: absolute;
	top: calc(100% + 12px);
	left: 0;
	right: 0;
	z-index: 80;
	padding: 16px;
	background: var(--panel-bg);
	border: 1px solid var(--card-border);
	border-radius: 16px;
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	max-height: min(66vh, 620px);
	overflow-y: auto;
	overscroll-behavior: contain;
	/* 收起态：淡出并微微上收。面板是绝对定位，展开/收起都不会顶动页面内容 */
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px) scale(0.985);
	transform-origin: 50% 0;
	transition: opacity 0.16s ease, transform 0.2s ease, visibility 0s linear 0.16s;
}

/* 展开态：带一点回弹浮出 */
.search-panel.is-open {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.26, 1.16, 0.44, 1), visibility 0s;
}

html[data-theme="dark"] .search-panel {
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
}

.search-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--hairline);
}

.search-panel-count {
	font-size: 0.85rem;
	color: var(--text-secondary);
}

.search-panel-count strong {
	color: var(--text);
	font-weight: 700;
}

.search-panel-close {
	padding: 4px 12px;
	font-family: inherit;
	font-size: 0.78rem;
	color: var(--text-secondary);
	background: var(--pager-hover-bg);
	border: 1px solid var(--card-border);
	border-radius: 8px;
	cursor: pointer;
	transition: color 0.2s ease, background 0.2s ease;
}

.search-panel-close:hover {
	color: var(--text);
}

.search-empty {
	padding: 28px 8px 16px;
	font-size: 0.9rem;
	color: var(--text-secondary);
	text-align: center;
}

/* ===== 板块容器 ===== */
.content-root {
	padding-bottom: 72px;
}

.content-section {
	max-width: 960px;
	margin: 0 auto;
	padding: 64px 24px 0;
	scroll-margin-top: calc(var(--nav-height) + 20px);
}

.content-section:first-child {
	padding-top: 56px;
}

.block-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 24px;
}

.block-title {
	margin: 0;
	font-size: 1.65rem;
	font-weight: 700;
	letter-spacing: 0.5px;
	color: var(--text);
}

.block-count {
	font-size: 0.82rem;
	color: var(--text-secondary);
}

/* ===== 卡片网格 ===== */
.entry-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 22px;
	/* 翻页时整片网格做模糊淡出 / 淡入，时长在下面的状态类里切换 */
	transition: opacity 0.14s ease, filter 0.14s ease, transform 0.14s ease;
}

/* 翻页：旧卡片模糊散去 */
.entry-grid.is-page-out {
	opacity: 0;
	filter: blur(16px);
	transform: scale(0.988);
}

/* 新卡片从更糊的位置浮出（起点态，随后移除触发过渡） */
.entry-grid.is-page-in {
	opacity: 0;
	filter: blur(22px);
	transform: scale(0.98);
}

.entry-grid.is-page-enter {
	transition-duration: 0.26s;
}

/* ===== 卡片 ===== */
.entry-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 300px;
	min-width: 0;
	overflow: hidden;
	color: var(--text);
	text-decoration: none;
	/* 底色由 .entry-bg 铺满，卡片本体保持透明，避免边框处透出彩色横线 */
	background: transparent;
	border: 1px solid var(--card-border);
	border-radius: 16px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
	isolation: isolate;
	transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

/* 悬停：不做位移，只加深一点边框与投影 */
.entry-card:hover,
.entry-card:focus-visible {
	box-shadow: var(--card-hover-shadow);
	border-color: var(--card-hover-border);
}

/* 高光层：跟着鼠标走的柔和径向光，位置与强度由 home.js 写入
   --glare-x / --glare-y / --glare-o，可同时照亮多张卡片（仿 Win10 磁贴） */
.entry-card::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
	border-radius: inherit;
	opacity: var(--glare-o, 0);
	background: radial-gradient(240px circle at var(--glare-x, 50%) var(--glare-y, 50%),
			rgba(255, 255, 255, 0.185),
			rgba(255, 255, 255, 0.05) 45%,
			rgba(255, 255, 255, 0) 74%);
	mix-blend-mode: screen;
}

.entry-card:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

.entry-card--static {
	cursor: default;
}

.entry-card--static:hover {
	transform: none;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
	border-color: var(--card-border);
}

/* 背景层：铺满整张卡片（上方露出，下方被毛玻璃盖住） */
.entry-bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	background-color: var(--media-solid, #aeb7ac);
	background-image: var(--media-grad, linear-gradient(135deg, #b9c0b4, #9aa697));
}

.entry-bg-img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* 深色模式下把莫兰迪渐变压暗，避免亮色卡片在暗色页面里跳出来 */
html[data-theme="dark"] .entry-bg--grad::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(12, 10, 9, 0.44);
}

/* 上方图片区：略大于卡片一半，只承载图标与角标，底色由 .entry-bg 提供 */
.entry-media {
	position: relative;
	z-index: 1;
	flex: 0 0 168px;
	height: 168px;
}

/* 图标：靠左垂直居中 */
.entry-icon {
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 68px;
	height: 68px;
	overflow: hidden;
	color: #ffffff;
	background: rgba(255, 255, 255, 0.26);
	border: 1px solid rgba(255, 255, 255, 0.38);
	border-radius: 18px;
	transform: translate(-50%, -50%);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.entry-icon svg {
	display: block;
	width: 34px;
	height: 34px;
}

.entry-icon img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* 搜索结果里的板块来源角标 */
.entry-source {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	padding: 2px 9px;
	font-size: 0.68rem;
	line-height: 1.7;
	color: #ffffff;
	background: rgba(0, 0, 0, 0.42);
	border-radius: 20px;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

/* 文字区：下三分之一，毛玻璃盖住背景层 */
.entry-body {
	position: relative;
	z-index: 1;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 5px;
	min-height: 0;
	padding: 10px 16px 12px;
	text-align: left;
	background: var(--glass-tint);
	/* 毛玻璃层需要自己的圆角，否则会盖住卡片底部的圆角裁剪 */
	border-radius: 0 0 15px 15px;
	box-shadow: inset 0 1px 0 var(--glass-edge);
	backdrop-filter: blur(20px) saturate(1.6);
	-webkit-backdrop-filter: blur(20px) saturate(1.6);
}

.entry-name {
	margin: 0;
	font-size: 1.3rem;
	font-weight: 700;
	line-height: 1.34;
	color: var(--text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.entry-tags {
	display: flex;
	flex-wrap: nowrap;
	gap: 6px;
	min-width: 0;
	overflow: hidden;
}

.entry-tag {
	flex: 0 1 auto;
	min-width: 0;
	padding: 2px 10px;
	font-size: 0.8rem;
	line-height: 1.65;
	color: var(--text-secondary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	background: var(--chip-bg);
	border: 1px solid var(--chip-border);
	border-radius: 20px;
}

.entry-desc {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.5;
	color: var(--text-secondary);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	word-break: break-word;
}

/* ===== 分页 ===== */
.pager {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 28px;
	transition: opacity 0.22s ease, filter 0.22s ease;
}

/* 翻页时页码组跟着做一次模糊淡入（起点态无过渡，避免先看见淡出） */
.pager.is-pager-enter {
	transition: none;
	opacity: 0;
	filter: blur(8px);
}

.pager-btn {
	min-width: 38px;
	height: 38px;
	padding: 0 14px;
	font-family: inherit;
	font-size: 0.86rem;
	color: var(--text-secondary);
	background: var(--pager-bg);
	border: 1px solid var(--pager-border);
	border-radius: 11px;
	cursor: pointer;
	transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.pager-btn:hover:not(:disabled) {
	color: var(--text);
	background: var(--pager-hover-bg);
	border-color: var(--card-hover-border);
}

/* 点下时按钮自己也轻微压缩 + 模糊一下，翻页不至于只有卡片在动 */
.pager-btn.is-tapped {
	animation: pagerTap 0.28s ease;
}

@keyframes pagerTap {
	0% {
		transform: scale(1);
		filter: blur(0);
	}

	32% {
		transform: scale(0.9);
		filter: blur(1.2px);
	}

	66% {
		transform: scale(1.02);
		filter: blur(0);
	}

	100% {
		transform: scale(1);
		filter: blur(0);
	}
}

.pager-btn:disabled {
	opacity: 0.38;
	cursor: default;
}

.pager-btn.is-active {
	color: var(--pager-active-ink);
	background: var(--pager-active-bg);
	border-color: var(--pager-active-border);
	font-weight: 700;
}

.pager-btn.is-active:hover {
	color: var(--pager-active-ink);
	background: var(--pager-active-bg);
	border-color: var(--pager-active-border);
}

.pager-gap {
	min-width: 22px;
	font-size: 0.84rem;
	color: var(--text-secondary);
	text-align: center;
}

/* ===== 悬停提示 ===== */
.entry-tip {
	position: fixed;
	z-index: 300;
	max-width: min(320px, 78vw);
	padding: 8px 11px;
	font-size: 0.78rem;
	line-height: 1.6;
	color: var(--tip-fg);
	background: var(--tip-bg);
	border-radius: 10px;
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
	pointer-events: none;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.16s ease, transform 0.16s ease;
	white-space: pre-wrap;
	word-break: break-word;
}

.entry-tip.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* ===== 底栏：固定在视口底部，贴在 hero 背景层上 =====
   hero 是 z-index:-1，底栏 z-index:0 压在它上面；内容纸张提到 z-index:1 再盖住底栏。
   页尾留出等高的 .footer-spacer，滚到那里才把底栏露出来。
   注意：z-index 不能用负值——负层虽然画得出来，Chrome 的命中测试会被 body 吃掉，按钮点不动。 */
.footer {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: clamp(280px, 36vh, 400px);
	padding: 64px clamp(16px, 4vw, 32px) 52px;
	background: transparent;
	border-top: none;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	/* 未露出时不吃指针事件，露出后再由内层接管 */
	pointer-events: none;
}

/* 占位：保证页面末尾有一段和底栏等高的空白（高度由脚本按实际高度同步） */
.footer-spacer {
	height: clamp(280px, 36vh, 400px);
	pointer-events: none;
}

/* 内容显隐：默认就是收起态，由 JS 在「露出 2/5」时加 .is-revealed 浮出。
   不能反过来等 JS 来加隐藏类——脚本在 body 末尾执行，首帧会先亮一下（刷新恢复滚动位置时尤其明显）。
   过渡参数与 hero 文字一致。 */
.footer .footer-inner {
	width: 100%;
	opacity: 0;
	filter: blur(16px);
	transform: translateY(14px);
	/* 内容还没亮出来之前不接管指针，避免隐形层挡住底部 */
	pointer-events: none;
	will-change: opacity, filter, transform;
	backface-visibility: hidden;
	/* 收起：稍快，像散焦退远 */
	transition:
		opacity 0.34s ease,
		filter 0.4s ease,
		transform 0.4s cubic-bezier(0.4, 0, 0.6, 1);
}

.footer.is-revealed .footer-inner {
	opacity: 1;
	filter: blur(0);
	transform: translateY(0);
	pointer-events: auto;
	/* 浮出：模糊先收敛，位移最后落定 */
	transition:
		opacity 0.5s ease,
		filter 0.58s ease,
		transform 0.62s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer .footer-copy {
	color: #ffffff;
}

.footer .footer-desc {
	color: rgba(255, 255, 255, 0.82);
}

/* 底栏直接压在背景图上，用文字投影保证亮部也读得清（不再铺整层渐变遮罩） */
.footer .footer-copy,
.footer .footer-desc {
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.footer .footer-logo {
	opacity: 0.92;
}

/* 复制按钮：点击后模糊拉伸、文字换成「已复制」，1 秒后复原 */
.footer .copy-btn {
	color: rgba(255, 255, 255, 0.92);
	background: rgba(255, 255, 255, 0.16);
	border-color: rgba(255, 255, 255, 0.3);
	white-space: nowrap;
	overflow: hidden;
	text-align: center;
	transition:
		color 0.24s ease,
		background 0.24s ease,
		border-color 0.24s ease,
		width 0.2s cubic-bezier(0.22, 0.9, 0.3, 1);
}

.footer .copy-btn:hover {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.26);
	border-color: rgba(255, 255, 255, 0.55);
}

.footer .copy-btn.is-copied {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.3);
	border-color: rgba(255, 255, 255, 0.6);
	animation: copyStretch 0.44s ease-out;
}

@keyframes copyStretch {
	0% {
		filter: blur(2.2px);
		opacity: 0.5;
		transform: scaleX(0.86);
	}

	58% {
		filter: blur(0);
		opacity: 1;
		transform: scaleX(1.06);
	}

	100% {
		filter: blur(0);
		opacity: 1;
		transform: scaleX(1);
	}
}

/* ===== 底栏平台按钮（莫兰迪淡胶囊，白字） ===== */
.footer-social {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 14px;
}

.social-btn {
	--sb-bg: rgba(255, 255, 255, 0.14);
	--sb-bg-hover: rgba(255, 255, 255, 0.24);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 3px 12px;
	font-size: 0.78rem;
	font-weight: 500;
	line-height: 1.75;
	color: #ffffff;
	text-decoration: none;
	background: var(--sb-bg);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 20px;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.social-btn:hover {
	background: var(--sb-bg-hover);
	border-color: rgba(255, 255, 255, 0.4);
}

.social-btn:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.7);
	outline-offset: 2px;
}

/* ===== 无脚本提示 ===== */
.noscript-box {
	max-width: 960px;
	margin: 0 auto;
	padding: 24px;
	font-size: 0.9rem;
	color: var(--text-secondary);
}

.noscript-box ul {
	margin: 12px 0 0 18px;
}

.noscript-box a {
	color: var(--accent);
}

/* ===== 响应式：平板两列 ===== */
@media (min-width: 600px) and (max-width: 1024px) {
	.entry-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ===== 响应式：手机单列 ===== */
@media (max-width: 599px) {
	.search-area {
		padding: 36px 16px 0;
	}

	.search-input {
		height: 48px;
		padding-right: 38px;
		font-size: 0.92rem;
	}

	.search-panel {
		padding: 14px;
		max-height: 70vh;
	}

	.content-section {
		padding: 48px 16px 0;
	}

	.content-section:first-child {
		padding-top: 40px;
	}

	.block-title {
		font-size: 1.4rem;
	}

	.entry-grid {
		grid-template-columns: 1fr;
		gap: 18px;
	}

	.entry-card {
		height: auto;
	}

	.entry-media {
		flex: 0 0 140px;
		height: 140px;
	}
}

/* ===== 小屏微调 ===== */
@media (max-width: 380px) {
	.block-head {
		gap: 4px;
	}

	.entry-media {
		flex: 0 0 128px;
		height: 128px;
	}
}

/* ===== 移动端下拉菜单：与顶栏同一套毛玻璃 =====
   窄屏只要展开菜单，顶栏就切到毛玻璃态（即便页面还在顶部），
   这样顶栏与菜单面板是同一材质，不会出现「顶栏透出 hero、面板却是实心玻璃」的割裂感。 */
@media (max-width: 768px) {
	.navbar.is-menu-open::before {
		opacity: 1;
	}

	.nav-links {
		background: rgba(250, 247, 242, 0.88);
		border-bottom: 1px solid var(--card-border);
		backdrop-filter: blur(22px) saturate(1.5);
		-webkit-backdrop-filter: blur(22px) saturate(1.5);
		box-shadow: 0 16px 32px rgba(0, 0, 0, 0.16);
		transform-origin: 50% 0;
		/* 收起态：略微上收并压扁一点，展开时带一点回弹落回原位 */
		transform: translateY(-8px) scaleY(0.965);
		/* 展开动画 + 主题切换时的颜色过渡：颜色那几项由 site-chrome.css 挪到这里，
		   否则全局的 transition-property 会把 max-height / transform 顶掉。 */
		transition: max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1),
			padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
			opacity 0.18s ease,
			transform 0.44s cubic-bezier(0.34, 1.4, 0.5, 1),
			background-color 0.45s ease,
			border-color 0.45s ease,
			box-shadow 0.45s ease;
	}

	html[data-theme="dark"] .nav-links {
		background: rgba(26, 24, 23, 0.86);
		backdrop-filter: blur(22px) saturate(1.3) brightness(0.86);
		-webkit-backdrop-filter: blur(22px) saturate(1.3) brightness(0.86);
		box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
	}

	.nav-toggle:checked~.nav-links {
		padding: 12px 0 24px;
		/* 上限贴着实际内容（约 226px）：写 70vh 的话高度在前 1/3 就到顶，
		   后面全程空跑，看起来像瞬间弹开。留一点余量给将来加菜单项。 */
		max-height: min(70vh, 360px);
		overflow-y: auto;
		transform: translateY(0) scaleY(1);
	}

	/* 内部条目依次浮出：每条都带一点点回弹，顺序由上到下 */
	.nav-links>* {
		opacity: 0;
		transform: translateY(-7px);
		transition: opacity 0.16s ease,
			transform 0.26s ease,
			background 0.25s ease,
			color 0.25s ease;
	}

	.nav-toggle:checked~.nav-links>* {
		opacity: 1;
		transform: translateY(0);
		transition: opacity 0.22s ease,
			transform 0.36s cubic-bezier(0.34, 1.42, 0.5, 1),
			background 0.25s ease,
			color 0.25s ease;
	}

	.nav-toggle:checked~.nav-links>*:nth-child(1) {
		transition-delay: 0.05s;
	}

	.nav-toggle:checked~.nav-links>*:nth-child(2) {
		transition-delay: 0.09s;
	}

	.nav-toggle:checked~.nav-links>*:nth-child(3) {
		transition-delay: 0.13s;
	}

	.nav-toggle:checked~.nav-links>*:nth-child(4) {
		transition-delay: 0.17s;
	}

	.nav-toggle:checked~.nav-links>*:nth-child(5) {
		transition-delay: 0.21s;
	}

	.nav-toggle:checked~.nav-links>*:nth-child(6) {
		transition-delay: 0.25s;
	}

	/* 汉堡图标的三根线也带一点回弹，跟菜单同频 */
	.nav-toggle-label span {
		transition: transform 0.34s cubic-bezier(0.34, 1.36, 0.5, 1),
			opacity 0.2s ease,
			background 0.3s ease;
	}
}

/* ===== 降低动态效果偏好 ===== */
@media (prefers-reduced-motion: reduce) {

	.entry-card,
	.social-btn,
	.search-panel,
	.nav-links,
	.nav-links>*,
	.nav-toggle-label span,
	.entry-tip,
	.pager-btn,
	.footer-inner {
		transition: none;
		animation: none;
	}

	.entry-card:hover {
		transform: none;
	}

	/* 欢迎语只做淡入淡出，不做模糊与缩放 */
	.hero-title-text,
	.hero-title-text.is-shown {
		filter: none;
		transform: none;
		transition: opacity 0.25s ease;
	}

	/* 翻页直接到位，不做模糊与逐行靠拢 */
	.entry-grid {
		transition: none;
	}

	.entry-grid.is-page-out,
	.entry-grid.is-page-in {
		filter: none;
		transform: none;
	}

	.pager-btn.is-tapped {
		animation: none;
	}
}
