/*
Theme Name: FGamer
Theme URI: https://fullgame666.com/
Author: 充满游戏君
Author URI: https://space.bilibili.com/356156951
Description: 一款为游戏资源内容打造的主题，深色为主、可切浅色。视觉主导、时间流布局、正文长文优化，完整承接既有文章中的下载区块与图片样式。
Version: 0.5.18
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fgamer
Tags: dark, custom-colors, featured-images, translation-ready
*/

/* =========================================================================
   0. 设计系统
   ========================================================================= */

:root {
	/* —— 底色层 —— */
	--bg:          #0d0f13;
	--bg-elev:     #14171d;   /* 卡片、面板 */
	--bg-elev-2:   #1a1e26;   /* 悬浮、输入框 */
	--line:        #252a33;   /* 分隔线 */
	--line-soft:   #1d222a;

	/* —— 文字层 —— */
	--text:        #e8eaed;
	--text-2:      #c2cad6;   /* 正文 */
	--text-3:      #9ba4b4;   /* 次要信息 */
	--text-4:      #6b7484;   /* meta、占位 */

	/* —— 品牌色 —— */
	--brand:       #e8a33d;   /* 琥珀金 */

	/* 下面是主色的派生色。以前这三条写死成琥珀金的 rgba，
	   结果后台把主色从金色改成蓝色，按钮底变蓝了，
	   但底纹、描边、hover 还是金的——一整套配色只换了一半。

	   现在全部用 color-mix 从 --brand 现算：改主色，这一串自动跟上；
	   切到浅色模式，--brand 在那边被压深，这一串也跟着重算。
	   每条都留了一行静态值兜底，不支持 color-mix 的老浏览器用静态值，
	   不会出现「变量为空 → 按钮没底色」。 */
	--brand-dark:  #c9862a;
	--brand-dark:  color-mix(in oklab, var(--brand) 82%, #000);
	--brand-soft:  rgba(232, 163, 61, .12);
	--brand-soft:  color-mix(in oklab, var(--brand) 12%, transparent);
	--brand-line:  rgba(232, 163, 61, .28);
	--brand-line:  color-mix(in oklab, var(--brand) 28%, transparent);

	/* 压在品牌色上的字。深色模式下品牌是亮金、字要深；
	   浅色模式下品牌压深了、字要翻白——所以不能写死，见下方 light 段 */
	--brand-ink:   #1a1206;

	/* —— 功能色 —— */
	--ok:          #4ade80;
	--warn:        #fbbf24;
	--danger:      #f87171;

	/* —— 顶层覆盖色（跟着主题走，别写死） —— */
	--hd-bg:       rgba(13, 15, 19, .88);   /* 吸顶导航半透明底 */
	--tint:        rgba(255, 255, 255, .025); /* 表格斑马纹、极淡高光 */
	--shadow-card: 0 14px 34px -16px rgba(0, 0, 0, .8);
	--shadow-pop:  0 18px 44px -18px rgba(0, 0, 0, .85);

	/* —— 字体 —— */
	--font: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC",
	        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
	--display: "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
	--mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

	/* —— 布局 —— */
	--wrap:      1260px;   /* 全站最宽容器 */
	--wrap-wide: 1420px;   /* 满宽区块 */
	--read:      820px;    /* 纯文本阅读列（正文用 880） */
	--gap:       24px;
	--radius:    12px;
	--radius-lg: 16px;
	--radius-sm: 8px;

	/* —— 动效 —— */
	--ease: cubic-bezier(.22, .61, .36, 1);
	--t-fast: .16s;
	--t: .28s;

	/* 告诉浏览器这是深色界面：滚动条、输入框、下拉自动配深色，
	   否则浅色模式下会出现深色滚动条配白底这种情况 */
	color-scheme: dark;
}

/* =========================================================================
   0b. 浅色主题
   -------------------------------------------------------------------------
   只覆盖变量，规则一个字不改——这是当初把颜色全抽成变量的回报。

   默认（:root）就是深色，浅色靠 html[data-theme="light"] 往上盖。
   为什么默认深色而不是默认浅色：这个站一直是深色，深色那套值是反复调过的，
   把它当基准，浅色只是「另一种皮肤」，将来改深色不会牵连浅色。

   几个不是简单反色的地方，单独说明：
   - --brand 压深到 #b8791f。琥珀金 #e8a33d 在白底上对比度只有 2:1，
     当装饰色没问题，但当链接色、标签色就看不清了。
   - --brand-ink 跟着从深棕翻成白色。深色模式下品牌色是亮金、字要深；
     浅色模式下品牌色是深金、字要白。这条不改的话按钮上会出现深棕字压深金底。
   - --shadow-* 从黑色大阴影换成淡蓝灰，浅底上用黑阴影会像脏了。
   ========================================================================= */

html[data-theme="light"] {
	--bg:          #f6f7f9;
	--bg-elev:     #ffffff;
	--bg-elev-2:   #f0f2f5;
	--line:        #e2e6ec;
	--line-soft:   #edf0f4;

	--text:        #14171d;
	--text-2:      #333b47;
	/* text-3/4 比深色版压得更深：#8b95a3 在 #f6f7f9 上只有 2.8:1，
	   面包屑、日期、共 N 篇这些 13px 小字直接糊掉。要过 4.5:1。 */
	--text-3:      #4d5665;
	--text-4:      #667080;

	--brand:       #b8791f;
	/* 只换主色和字色。--brand-dark / -soft / -line 不在这里重写，
	   它们在上面用 color-mix 从 --brand 现算，一改就自动跟着变。
	   这里要是也写死一份，后台换主色时浅色模式又会掉回金色。 */
	--brand-ink:   #ffffff;

	/* 深绿/黄/红在浅底上要压深，不然提示条的图标糊成一片 */
	--ok:          #15803d;
	--warn:        #a16207;
	--danger:      #b91c1c;

	--hd-bg:       rgba(255, 255, 255, .88);
	--tint:        rgba(15, 23, 42, .028);
	--shadow-card: 0 14px 30px -18px rgba(15, 23, 42, .22);
	--shadow-pop:  0 18px 40px -20px rgba(15, 23, 42, .26);

	color-scheme: light;
}

/* 切换瞬间给个 180ms 的颜色过渡。
   不常驻 transition：全局 * 加过渡会把卡片 hover 位移、灯箱淡入这些
   本来就有的动效拖慢，而且和 transform 抢帧。只在换肤时临时挂上。 */
html.is-theming,
html.is-theming *,
html.is-theming *::before,
html.is-theming *::after {
	transition: background-color .18s ease,
	            border-color .18s ease,
	            color .18s ease,
	            box-shadow .18s ease,
	            fill .18s ease !important;
}

/* =========================================================================
   1. 重置
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	/* header 吸顶高度补偿，锚点跳转不被遮住 */
	scroll-padding-top: 90px;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text-2);
	font-family: var(--font);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-wrap: break-word;
}

/*
 * 注意：这里刻意不包含 iframe。
 * iframe 是替换元素但没有内在高度，`height: auto` 会掉到浏览器默认的 150px，
 * 正文里的 B 站 / 抖音播放器会全部塌成一条扁黑块（看着像“视频没了”）。
 * iframe 的尺寸统一由 inc/video-embed.php 的内联样式 + post.css 的 aspect-ratio 管。
 */
img, svg, video { max-width: 100%; height: auto; }
img { border: 0; display: block; }

a {
	color: inherit;
	text-decoration: none;
	transition: color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}

a:hover { color: var(--brand); }

h1, h2, h3, h4, h5, h6 {
	margin: 0;
	color: var(--text);
	font-family: var(--display);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -.02em;
}

p { margin: 0 0 1.2em; }

ul, ol { margin: 0 0 1.2em; padding-left: 1.4em; }
li { margin-bottom: .4em; }

button, input, select, textarea {
	font: inherit;
	color: inherit;
}

button { cursor: pointer; }

hr {
	border: 0;
	height: 1px;
	background: var(--line);
	margin: 40px 0;
}

/* 可访问性：仅屏幕阅读器可见 */
.sr-only {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* 键盘焦点可见 */
:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: 3px;
	border-radius: 4px;
}

/* 选中文字 */
::selection {
	background: var(--brand);
	color: #151007;
}

/* =========================================================================
   2. 布局容器
   ========================================================================= */

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 24px;
}

.wrap-wide {
	width: 100%;
	max-width: var(--wrap-wide);
	margin: 0 auto;
	padding: 0 24px;
}

.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-main { flex: 1 0 auto; }

.section {
	padding: 48px 0;
}

/* 区块标题 */
.sec-hd {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 22px;
}

.sec-hd::before {
	content: "";
	width: 4px;
	height: 18px;
	background: var(--brand);
	border-radius: 2px;
	flex: none;
}

.sec-hd h2 {
	font-size: 17px;
	font-weight: 700;
	letter-spacing: -.02em;
}

.sec-hd .sec-more {
	margin-left: auto;
	font-size: 12.5px;
	color: var(--text-4);
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.sec-hd .sec-more:hover { color: var(--brand); }

/* =========================================================================
   3. 顶部导航
   ========================================================================= */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--hd-bg);
	backdrop-filter: saturate(160%) blur(12px);
	-webkit-backdrop-filter: saturate(160%) blur(12px);
	border-bottom: 1px solid var(--line-soft);
}

.hd-inner {
	display: flex;
	align-items: center;
	gap: 32px;
	height: 76px;
}

/* Logo */
.logo {
	display: flex;
	align-items: center;
	gap: 12px;
	font-family: var(--display);
	font-size: 20px;
	font-weight: 900;
	letter-spacing: -.03em;
	color: var(--text);
	white-space: nowrap;
	flex: none;
}

.logo:hover { color: var(--text); }

.logo-mark {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
	display: grid;
	place-items: center;
	color: var(--brand-ink);
	font-size: 18px;
	font-weight: 900;
	flex: none;
}

.logo-img {
	max-height: 42px;
	width: auto;
}

/* 主菜单 */
.nav-main {
	display: flex;
	align-items: center;
	gap: 4px;
	flex: 1;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: none;
}

.nav-main::-webkit-scrollbar { display: none; }

.nav-main a {
	padding: 9px 16px;
	border-radius: var(--radius-sm);
	font-size: 15px;
	color: var(--text-3);
	white-space: nowrap;
	transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.nav-main a:hover {
	color: var(--text);
	background: var(--bg-elev-2);
}

.nav-main .current-menu-item > a,
.nav-main .current_page_item > a,
.nav-main .current-menu-parent > a {
	color: var(--brand);
	background: var(--brand-soft);
}

.nav-main ul {
	display: flex;
	align-items: center;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.nav-main li { margin: 0; }

/* 子菜单 */
.nav-main .sub-menu {
	display: none;
	position: absolute;
}

/* 搜索 */
.hd-search {
	position: relative;
	flex: none;
	width: 240px;
}

.hd-search input[type="search"],
.hd-search input[type="text"] {
	width: 100%;
	height: 42px;
	padding: 0 42px 0 16px;
	background: var(--bg-elev-2);
	border: 1px solid transparent;
	border-radius: 21px;
	color: var(--text);
	font-size: 14px;
	transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.hd-search input::placeholder { color: var(--text-4); }

.hd-search input:focus {
	outline: none;
	background: var(--bg-elev);
	border-color: var(--brand-line);
}

.hd-search button {
	position: absolute;
	right: 5px;
	top: 5px;
	width: 32px;
	height: 32px;
	border: 0;
	background: transparent;
	color: var(--text-4);
	display: grid;
	place-items: center;
	border-radius: 50%;
}

.hd-search button:hover { color: var(--brand); }

/* 深/浅色切换 */
.hd-theme {
	flex: none;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid var(--line);
	border-radius: 50%;
	background: transparent;
	color: var(--text-3);
	transition: color var(--t-fast) var(--ease),
	            border-color var(--t-fast) var(--ease),
	            background var(--t-fast) var(--ease),
	            transform var(--t-fast) var(--ease);
}

.hd-theme:hover {
	color: var(--brand);
	border-color: var(--brand-line);
	background: var(--brand-soft);
}

.hd-theme:active {
	transform: scale(.92);
}

.hd-theme:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: 2px;
}

/* 按钮上两个图标同屏，按当前主题显示其中一个：
   深色时给「太阳」（点了变亮），浅色时给「月亮」（点了变暗）。
   比用 JS 换 innerHTML 稳——首屏不会有一帧空按钮，也省一次 DOM 操作。 */
.hd-theme__sun { display: none; }

html[data-theme="light"] .hd-theme__sun  { display: block; }
html[data-theme="light"] .hd-theme__moon { display: none; }

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

/* 移动端菜单按钮 */
.hd-toggle {
	display: none;
	width: 36px;
	height: 36px;
	border: 1px solid var(--line);
	background: transparent;
	border-radius: var(--radius-sm);
	color: var(--text-2);
	place-items: center;
	flex: none;
}

/* =========================================================================
   4. 卡片（列表）
   ========================================================================= */

/* 用 flex 而不是 grid，只为了一件事：末行没排满时不留大片空白。
   grid 的列宽是写死的，最后一页只剩 1 篇时，右边必定空两格。
   flex 的 flex-grow 会把剩下的空间分掉：
     剩 3 篇 → 各 1/3（满行）
     剩 2 篇 → 各 1/2（正好填满，比原来空一半好看得多）
     剩 1 篇 → 撑到 max-width 一半为止，由 justify-content 居中
   单篇不撑满整行是有意的：一张 1200px 宽的卡配 16:9 封面会变成巨型横幅。 */
.card-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--gap);
}

.card-grid > .card {
	flex: 1 1 calc((100% - var(--gap) * 2) / 3);
	max-width: calc((100% - var(--gap)) / 2);
	min-width: 0;
}

.card {
	display: flex;
	flex-direction: column;
	background: var(--bg-elev);
	border: 1px solid var(--line-soft);
	border-radius: var(--radius);
	overflow: hidden;
	transition: transform var(--t) var(--ease),
	            border-color var(--t) var(--ease),
	            box-shadow var(--t) var(--ease);
}

.card:hover {
	transform: translateY(-3px);
	border-color: var(--line);
	box-shadow: var(--shadow-card);
}

.card:hover .card-t { color: var(--brand); }

/* 封面 */
.card-thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;      /* 必须和 fg-card 烘焙尺寸一致 */
	background: var(--bg-elev-2);
	overflow: hidden;
}

.card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s var(--ease), opacity var(--t) var(--ease);
}

.card:hover .card-thumb img { transform: scale(1.04); }

/* 热度角标：压在封面右上角，不占文字区。
   放 meta 行的话，「分类 · 日期 · 9.3万」在窄卡里必定折行，把卡片撑高。 */
.card-hot {
	position: absolute;
	top: 9px;
	right: 9px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 4px 8px 4px 6px;
	border-radius: 999px;
	background: rgba(10, 12, 16, .68);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	pointer-events: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

.card-hot svg {
	flex: none;
	color: var(--brand);
}

.card-thumb--placeholder {
	display: grid;
	place-items: center;
	color: var(--text-4);
	font-size: 12px;
}

/* 正文区 */
.card-body {
	padding: 14px 16px 16px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.card-t {
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.55;
	letter-spacing: -.012em;
	color: var(--text);
	margin-bottom: 8px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color var(--t-fast) var(--ease);
}

.card-ex {
	font-size: 12.5px;
	line-height: 1.7;
	color: var(--text-3);
	margin: 0 0 12px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* meta 行 */
.card-meta {
	margin-top: auto;
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 11.5px;
	color: var(--text-4);
}

.card-meta .dot {
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: currentColor;
	flex: none;
	opacity: .6;
}

.card-meta .cat {
	color: var(--text-3);
}

/* =========================================================================
   5. 页脚
   ========================================================================= */

.site-footer {
	margin-top: 64px;
	background: var(--bg-elev);
	border-top: 1px solid var(--line-soft);
	/* 底部留出鲸鱼按钮的高度，避免她压住版权行 */
	padding: 48px 0 152px;
	font-size: 13px;
	color: var(--text-3);
}

.ft-grid {
	display: grid;
	grid-template-columns: 1.6fr 1fr 1fr 1fr;
	gap: 40px;
	margin-bottom: 40px;
}

.ft-brand .logo { margin-bottom: 14px; }

.ft-desc {
	font-size: 12.5px;
	line-height: 1.85;
	color: var(--text-4);
	max-width: 320px;
	margin: 0;
}

.ft-col h3 {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--text);
	margin-bottom: 14px;
	letter-spacing: .02em;
}

.ft-col ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ft-col li { margin-bottom: 9px; }

.ft-col a {
	font-size: 12.5px;
	color: var(--text-4);
}

.ft-col a:hover { color: var(--brand); }

.ft-bottom {
	padding-top: 22px;
	border-top: 1px solid var(--line-soft);
	display: flex;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding-right: 140px; /* 给右下角的鲸鱼按钮让位 */
	font-size: 12px;
	color: var(--text-4);
}

/* =========================================================================
   6. 通用小组件
   ========================================================================= */

/* 按钮 */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	height: 40px;
	padding: 0 20px;
	border-radius: var(--radius-sm);
	font-size: 13.5px;
	font-weight: 700;
	border: 1px solid transparent;
	transition: all var(--t-fast) var(--ease);
	white-space: nowrap;
}

.btn-main {
	background: var(--brand);
	color: var(--brand-ink);
}

.btn-main:hover {
	background: var(--brand-dark);
	color: var(--brand-ink);
}

.btn-ghost {
	background: transparent;
	border-color: var(--line);
	color: var(--text-2);
}

.btn-ghost:hover {
	border-color: var(--brand-line);
	color: var(--brand);
}

/* 标签 chip */
.chip {
	display: inline-flex;
	align-items: center;
	height: 26px;
	padding: 0 11px;
	border-radius: 13px;
	background: var(--bg-elev-2);
	border: 1px solid var(--line-soft);
	font-size: 12px;
	color: var(--text-3);
	transition: all var(--t-fast) var(--ease);
}

.chip:hover {
	border-color: var(--brand-line);
	color: var(--brand);
}

/* 广告位：明确标注，绝不空着（AdSense 政策要求） */
.ad-slot {
	position: relative;
	margin: 32px 0;
	padding: 18px;
	background: var(--bg-elev);
	border: 1px dashed var(--line);
	border-radius: var(--radius);
	text-align: center;
	min-height: 90px;
	display: grid;
	place-items: center;
}

.ad-slot::before {
	content: "广告";
	position: absolute;
	top: 6px;
	left: 10px;
	font-size: 10px;
	letter-spacing: .08em;
	color: var(--text-4);
	opacity: .7;
}

.ad-slot .ad-placeholder {
	font-size: 12px;
	color: var(--text-4);
}

/* 分页 */
.pagination {
	margin: 48px 0 0;
}

/* the_posts_pagination() 会在页码外再包一层 .nav-links，必须单独拉成横向 */
.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 10px;
}

.pagination .page-numbers {
	display: grid;
	place-items: center;
	min-width: 42px;
	height: 42px;
	padding: 0 14px;
	border-radius: var(--radius-sm);
	background: var(--bg-elev);
	border: 1px solid var(--line-soft);
	font-size: 14px;
	color: var(--text-3);
}

.pagination .page-numbers:hover {
	border-color: var(--brand-line);
	color: var(--brand);
}

.pagination .page-numbers.current {
	background: var(--brand);
	border-color: var(--brand);
	color: var(--brand-ink);
	font-weight: 700;
}

.pagination .page-numbers.dots {
	background: transparent;
	border-color: transparent;
}

/* 分页：跳到第 N 页 */
.page-jump {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 16px;
	font-size: 13px;
	color: var(--text-4);
}

.page-jump__input {
	width: 76px;
	height: 38px;
	padding: 0 8px;
	border-radius: var(--radius-sm);
	background: var(--bg-elev);
	border: 1px solid var(--line-soft);
	color: var(--text);
	font-family: var(--mono);
	font-size: 14px;
	text-align: center;
	transition: border-color .18s, box-shadow .18s;
	/* 去掉数字输入框自带的上下箭头，跟站点风格统一 */
	appearance: textfield;
	-moz-appearance: textfield;
}

.page-jump__input::-webkit-outer-spin-button,
.page-jump__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.page-jump__input::placeholder {
	color: var(--text-4);
}

.page-jump__input:focus {
	outline: none;
	border-color: var(--brand);
	box-shadow: 0 0 0 3px var(--brand-soft);
}

.page-jump__total {
	margin-left: 2px;
	color: var(--text-4);
	white-space: nowrap;
}

.page-jump__btn {
	height: 38px;
	padding: 0 16px;
	border-radius: var(--radius-sm);
	background: var(--bg-elev);
	border: 1px solid var(--line-soft);
	color: var(--text-3);
	font-family: inherit;
	font-size: 13px;
	cursor: pointer;
	transition: border-color .18s, color .18s, background .18s;
}

.page-jump__btn:hover {
	border-color: var(--brand-line);
	color: var(--brand);
	background: var(--brand-soft);
}

.page-jump__btn:active {
	transform: translateY(1px);
}

/* 回到顶部 · 鲸鱼娘 */
.whale-top {
	position: fixed;
	right: 24px;
	bottom: 22px;
	z-index: 95;
	width: 118px;
	height: 118px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	opacity: 0;
	transform: translateY(26px) scale(.86);
	pointer-events: none;
	transition: opacity .35s ease, transform .45s cubic-bezier(.34, 1.56, .64, 1);
	-webkit-tap-highlight-color: transparent;
}

.whale-top.is-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

/* 身后的柔光圆盘 */
.whale-top::before {
	content: "";
	position: absolute;
	inset: 14px;
	border-radius: 50%;
	background: radial-gradient(circle at 50% 30%, #ffffff 0%, #f2f8ff 48%, #dbeaff 78%, #c3dcff 100%);
	box-shadow:
		0 12px 26px rgba(6, 20, 48, .55),
		0 0 0 2px rgba(255, 255, 255, .9),
		0 0 0 7px rgba(122, 178, 255, .14);
	transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), box-shadow .3s ease;
}

.whale-top img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
	filter: drop-shadow(0 6px 10px rgba(6, 20, 48, .45));
	animation: whaleFloat 3.4s ease-in-out infinite;
	transform-origin: 50% 88%;
}

@keyframes whaleFloat {
	0%, 100% { transform: translateY(0) rotate(0deg); }
	50%      { transform: translateY(-6px) rotate(-1.6deg); }
}

.whale-top:hover::before,
.whale-top:focus-visible::before {
	transform: scale(1.06);
	box-shadow:
		0 14px 30px rgba(6, 20, 48, .55),
		0 0 0 2px rgba(255, 255, 255, .95),
		0 0 0 9px rgba(122, 178, 255, .26);
}

.whale-top:hover img {
	animation-play-state: paused;
	transform: translateY(-4px) scale(1.05);
}

.whale-top:focus-visible {
	outline: none;
}

/* 点击时向上「咻」一下 */
.whale-top.is-jumping img {
	animation: whaleJump .62s cubic-bezier(.3, 1.4, .5, 1);
}

.whale-top.is-jumping::before {
	animation: haloPulse .62s ease-out;
}

@keyframes whaleJump {
	0%   { transform: translateY(0) scale(1); }
	35%  { transform: translateY(-20px) scale(1.08, .94); }
	60%  { transform: translateY(-6px) scale(.96, 1.06); }
	100% { transform: translateY(0) scale(1); }
}

@keyframes haloPulse {
	0%   { transform: scale(1);   box-shadow: 0 12px 26px rgba(6,20,48,.5), 0 0 0 2px rgba(255,255,255,.85), 0 0 0 7px rgba(122,178,255,.16); }
	45%  { transform: scale(1.1); box-shadow: 0 12px 26px rgba(6,20,48,.5), 0 0 0 2px rgba(255,255,255,.95), 0 0 0 18px rgba(122,178,255,.05); }
	100% { transform: scale(1);   box-shadow: 0 12px 26px rgba(6,20,48,.5), 0 0 0 2px rgba(255,255,255,.85), 0 0 0 7px rgba(122,178,255,.16); }
}

/* 悬停气泡 */
.whale-top__bubble {
	position: absolute;
	right: 104px;
	top: 26px;
	white-space: nowrap;
	font-size: 13px;
	font-weight: 600;
	color: #10305e;
	background: #fff;
	padding: 8px 14px;
	border-radius: 14px;
	box-shadow: 0 8px 20px rgba(6, 20, 48, .35);
	opacity: 0;
	transform: translateX(8px) scale(.9);
	transform-origin: 100% 50%;
	transition: opacity .22s ease, transform .28s cubic-bezier(.34, 1.56, .64, 1);
	pointer-events: none;
}

.whale-top__bubble::after {
	content: "";
	position: absolute;
	right: -5px;
	top: 50%;
	width: 11px;
	height: 11px;
	background: #fff;
	transform: translateY(-50%) rotate(45deg);
	border-radius: 2px;
}

.whale-top:hover .whale-top__bubble,
.whale-top:focus-visible .whale-top__bubble {
	opacity: 1;
	transform: translateX(0) scale(1);
}

@media (max-width: 640px) {
	.whale-top {
		right: 8px;
		bottom: 10px;
		width: 88px;
		height: 88px;
	}

	.whale-top__bubble {
		display: none;
	}

	.ft-bottom {
		padding-right: 104px;
	}

	.page-jump__total {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.whale-top img {
		animation: none;
	}

	.whale-top,
	.whale-top::before,
	.whale-top__bubble {
		transition-duration: .01ms;
	}
}

/* 空状态 */
.empty {
	text-align: center;
	padding: 80px 20px;
	color: var(--text-4);
}

.empty h2 {
	font-size: 20px;
	margin-bottom: 10px;
	color: var(--text-2);
}

.empty p { font-size: 13.5px; margin-bottom: 20px; }

/* =========================================================================
   7. 响应式
   ========================================================================= */

@media (max-width: 1100px) {
	/* 两列：末行剩 1 篇时占一半居中，剩 2 篇正好填满 */
	.card-grid > .card { flex-basis: calc((100% - var(--gap)) / 2); }

	.ft-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 860px) {
	:root {
		--gap: 18px;
	}

	.wrap, .wrap-wide { padding: 0 18px; }

	/* 导航折叠 */
	.hd-inner { gap: 14px; height: 62px; }

	.nav-main {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		background: var(--bg-elev);
		border-bottom: 1px solid var(--line);
		padding: 8px;
		max-height: 70vh;
		overflow-y: auto;
	}

	.nav-main.is-open { display: flex; }

	.nav-main ul { flex-direction: column; align-items: stretch; gap: 0; }

	.nav-main a {
		display: block;
		padding: 11px 14px;
		font-size: 14.5px;
		border-radius: var(--radius-sm);
	}

	.hd-toggle { display: grid; order: 4; }

	/* 手机上四个元素挤一行（logo / 搜索 / 换色 / 菜单），
	   换色按钮得排在搜索之后，否则默认 order:0 会跑到 logo 前面去 */
	.hd-theme {
		order: 3;
		width: 32px;
		height: 32px;
	}

	.hd-search { width: auto; flex: 1; order: 2; min-width: 0; }

	/* 手机上把 logo 收回来：桌面放大的那套尺寸会把搜索框挤没 */
	.logo { order: 1; font-size: 16px; gap: 8px; }

	.logo-mark {
		width: 32px;
		height: 32px;
		border-radius: 8px;
		font-size: 15px;
	}

	.section { padding: 32px 0; }

	.site-footer { padding: 32px 0 20px; }
	.ft-grid { grid-template-columns: 1fr 1fr; gap: 26px; margin-bottom: 28px; }
	.ft-brand { grid-column: 1 / -1; }
	.ft-desc { max-width: none; }
}

@media (max-width: 620px) {
	/* 手机上单列大图，长标题才读得顺。单列必须解除一半宽的封顶，
	   否则每张卡只占屏幕一半。 */
	.card-grid > .card {
		flex: 0 0 100%;
		max-width: 100%;
	}

	/* 别在手机上改比例：fg-card 烘焙的是 16:10，
	   这里改成 16:9 会让 cover 把上下连内容一起切掉。 */
	.card-t { font-size: 15.5px; -webkit-line-clamp: 3; }

	.card-body { padding: 13px 14px 15px; }

	.ft-grid { grid-template-columns: 1fr 1fr; }
}

/* =========================================================================
   8. 首页置顶大卡
   ========================================================================= */

/* 三列网格下独占一整行：1 张大卡 + 9 张普通卡 = 4 整行，
   避免末行只挂 2 个、右边空一格 */
.card--hero {
	grid-column: 1 / -1;
	flex-direction: row;
}

.card--hero .card-thumb {
	width: 52%;
	aspect-ratio: 16 / 9;      /* 必须和 fg-cover 烘焙尺寸一致，否则 cover 二次裁切 */
	flex: none;
	align-self: center;        /* 别拉伸：高度由比例定，文字多少都不影响取景 */
}

.card--hero .card-thumb img {
	height: 100%;
	object-fit: cover;
}

.card--hero .card-body {
	padding: 28px 30px;
	justify-content: center;
}

.card--hero .card-t {
	font-size: clamp(20px, 2.1vw, 26px);
	font-weight: 900;
	line-height: 1.34;
	letter-spacing: -.038em;
	-webkit-line-clamp: 3;
	margin-bottom: 12px;
}

.card--hero .card-ex {
	font-size: 13.5px;
	line-height: 1.88;
	-webkit-line-clamp: 3;
	margin-bottom: 16px;
}

.hero-flag {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	height: 22px;
	padding: 0 9px;
	margin-bottom: 12px;
	border-radius: 5px;
	background: var(--brand-soft);
	border: 1px solid var(--brand-line);
	color: var(--brand);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .04em;
}

/* =========================================================================
   9. 归档页头
   ========================================================================= */

.archive-hd {
	padding: 44px 0 8px;
}

.archive-hd h1 {
	font-size: clamp(24px, 3vw, 34px);
	font-weight: 900;
	letter-spacing: -.045em;
	line-height: 1.25;
	margin-bottom: 10px;
}

.archive-desc {
	font-size: 13.5px;
	line-height: 1.85;
	color: var(--text-3);
	max-width: 720px;
	margin-bottom: 10px;
}

.archive-desc p { margin-bottom: .8em; }

.archive-count {
	font-size: 12.5px;
	color: var(--text-4);
	margin: 0;
}

/* 首屏大卡已经独立成 .home-hero，列表不再需要「首篇跨两格」，
   原来的 grid-auto-flow: dense 在 flex 布局下无效，已移除。 */

/* =========================================================================
   10. 面包屑
   ========================================================================= */

.breadcrumb {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 7px;
	font-size: 12.5px;
	color: var(--text-4);
	padding: 20px 0 0;
}

.breadcrumb a { color: var(--text-4); }
.breadcrumb a:hover { color: var(--brand); }

.breadcrumb .sep { opacity: .45; }

.breadcrumb .cur {
	color: var(--text-3);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 46%;
}

/* =========================================================================
   11. 大卡响应式
   ========================================================================= */

@media (max-width: 1100px) {
	/* 两列网格下 hero 占满整行，改成上下结构 */
	.card--hero {
		grid-column: span 2;
		flex-direction: column;
	}

	.card--hero .card-thumb {
		width: 100%;
		aspect-ratio: 16 / 9;
	}

	.card--hero .card-body { padding: 20px 22px 22px; }
}

@media (max-width: 620px) {
	.card--hero { grid-column: span 1; }
	.card--hero .card-body { padding: 16px 15px 18px; }
	.card--hero .card-t { font-size: 19px; -webkit-line-clamp: 4; }
	.card--hero .card-ex { -webkit-line-clamp: 2; }
	.breadcrumb .cur { max-width: 100%; white-space: normal; }
	.archive-hd { padding: 28px 0 4px; }
}
