/* ==========================================================================
   FreeHub 主题主样式
   ========================================================================== */

/* ---------- 设计变量 ---------- */
:root {
	--brand: #4f46e5;
	--primary: var(--brand);
	--primary-weak: rgba(79, 70, 229, 0.1);

	--bg: #ffffff;
	--bg-soft: #f6f7f9;
	--bg-sink: #eef0f4;
	--card: #ffffff;

	--text: #16181d;
	--text-soft: #545c6b;
	--text-mute: #8b93a1;

	--border: #e6e8ee;
	--border-strong: #d3d7e0;

	--radius-sm: 8px;
	--radius: 14px;
	--radius-lg: 20px;

	--shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
	--shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px -16px rgba(16, 24, 40, 0.18);

	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", "Courier New", monospace;

	--container: 1180px;
	--header-h: 66px;

	--code-bg: #1b1f27;
	--code-text: #e6e9ef;
}

[data-theme="dark"] {
	--primary: #9aa3ff;
	--primary: color-mix(in srgb, var(--brand) 62%, white);
	--primary-weak: rgba(129, 140, 248, 0.14);

	--bg: #0e1013;
	--bg-soft: #16191e;
	--bg-sink: #1c2027;
	--card: #15181d;

	--text: #e9ebef;
	--text-soft: #a6aebb;
	--text-mute: #767f8d;

	--border: #252a32;
	--border-strong: #333a45;

	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 30px -18px rgba(0, 0, 0, 0.8);

	--code-bg: #101318;
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
	vertical-align: middle;
}

a {
	color: var(--primary);
	text-decoration: none;
	transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
	color: var(--primary);
	opacity: 0.82;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.6em;
	line-height: 1.35;
	font-weight: 700;
	letter-spacing: -0.01em;
}

p {
	margin: 0 0 1.1em;
}

ul,
ol {
	margin: 0 0 1.1em;
	padding-left: 1.4em;
}

button {
	font-family: inherit;
	font-size: inherit;
	cursor: pointer;
}

input,
textarea,
select {
	font-family: inherit;
	font-size: inherit;
}

hr {
	border: 0;
	border-top: 1px solid var(--border);
	margin: 2em 0;
}

.fh-icon {
	flex: 0 0 auto;
	display: inline-block;
	vertical-align: -0.16em;
}

.fh-muted {
	color: var(--text-mute);
	font-size: 13px;
}

.fh-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	padding: 10px 16px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
}

.fh-skip:focus {
	left: 12px;
	top: 12px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
	border-radius: 4px;
}

/* ---------- 布局 ---------- */
.fh-container {
	width: 100%;
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 22px;
}

.fh-container--narrow {
	max-width: 860px;
}

.fh-main {
	min-height: 55vh;
	padding-bottom: 60px;
}

.fh-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 312px;
	gap: 40px;
	align-items: start;
	padding-top: 26px;
}

.fh-layout--single {
	padding-top: 18px;
}

.fh-primary {
	min-width: 0;
}

.fh-sidebar-col {
	display: flex;
	flex-direction: column;
	gap: 20px;
	position: sticky;
	top: calc(var(--header-h) + 18px);
}

/* ---------- 页头 ---------- */
.fh-header {
	position: sticky;
	top: 0;
	z-index: 90;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	background: var(--bg);
	border-bottom: 1px solid var(--border);
	backdrop-filter: saturate(180%) blur(12px);
}

@supports (backdrop-filter: blur(6px)) {
	.fh-header {
		background: color-mix(in srgb, var(--bg) 82%, transparent);
	}
}

.fh-header-inner {
	display: flex;
	align-items: center;
	gap: 26px;
	height: var(--header-h);
}

.fh-brand {
	flex: 0 0 auto;
}

.fh-brand img {
	max-height: 40px;
	width: auto;
}

.fh-logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--text);
	font-weight: 800;
	font-size: 19px;
	letter-spacing: -0.02em;
}

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

.fh-logo-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 9px;
	background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #06b6d4));
	color: #fff;
	font-size: 17px;
	font-weight: 800;
	box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 60%, transparent);
}

.fh-nav {
	flex: 1 1 auto;
	min-width: 0;
}

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

.fh-menu > li {
	position: relative;
}

.fh-menu a {
	display: inline-block;
	padding: 7px 12px;
	border-radius: var(--radius-sm);
	color: var(--text-soft);
	font-size: 14.5px;
	font-weight: 500;
	white-space: nowrap;
}

.fh-menu a:hover,
.fh-menu .current-menu-item > a,
.fh-menu .current_page_item > a {
	color: var(--text);
	background: var(--bg-soft);
	opacity: 1;
}

.fh-menu .sub-menu {
	position: absolute;
	left: 0;
	top: calc(100% + 6px);
	min-width: 180px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: all 0.16s ease;
}

.fh-menu li:hover > .sub-menu,
.fh-menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.fh-menu .sub-menu a {
	display: block;
	padding: 8px 12px;
}

.fh-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
}

.fh-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 10px;
	background: transparent;
	color: var(--text-soft);
	transition: all 0.15s ease;
}

.fh-icon-btn:hover {
	background: var(--bg-soft);
	color: var(--text);
	border-color: var(--border);
}

.fh-menu-btn {
	display: none;
}

.fh-theme-moon,
[data-theme="dark"] .fh-theme-sun {
	display: none;
}

[data-theme="dark"] .fh-theme-moon {
	display: inline-flex;
}

.fh-menu-close {
	display: none;
}

/* ---------- 搜索条 ---------- */
.fh-searchbar {
	border-top: 1px solid var(--border);
	padding: 14px 0;
	background: var(--bg);
}

.fh-searchbar[hidden] {
	display: none;
}

.fh-search-form {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 14px;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: 12px;
	color: var(--text-mute);
}

.fh-search-form:focus-within {
	border-color: var(--primary);
	box-shadow: 0 0 0 3px var(--primary-weak);
}

.fh-search-form input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: transparent;
	color: var(--text);
	outline: none;
	font-size: 15px;
	padding: 2px 0;
}

.fh-search-form input::placeholder {
	color: var(--text-mute);
}

.fh-search-form button {
	flex: 0 0 auto;
	padding: 6px 16px;
	border: 0;
	border-radius: 8px;
	background: var(--primary);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
}

.fh-search-form button:hover {
	opacity: 0.9;
}

/* ---------- Hero ---------- */
.fh-hero {
	position: relative;
	border-bottom: 1px solid var(--border);
	background: var(--bg-soft);
	overflow: hidden;
}

.fh-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(600px 240px at 18% 0%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
		radial-gradient(520px 220px at 82% 20%, rgba(6, 182, 212, 0.12), transparent 70%);
	pointer-events: none;
}

.fh-hero-inner {
	position: relative;
	max-width: 780px;
	margin: 0 auto;
	padding: 62px 22px 58px;
	text-align: center;
}

.fh-hero-title {
	font-size: clamp(28px, 4.4vw, 42px);
	letter-spacing: -0.03em;
	margin-bottom: 12px;
}

.fh-hero-sub {
	color: var(--text-soft);
	font-size: 16px;
	max-width: 620px;
	margin: 0 auto 28px;
}

.fh-hero-search {
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 600px;
	margin: 0 auto;
	padding: 8px 8px 8px 18px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 14px;
	box-shadow: var(--shadow);
	color: var(--text-mute);
}

.fh-hero-search:focus-within {
	border-color: var(--primary);
	box-shadow: 0 0 0 3px var(--primary-weak), var(--shadow);
}

.fh-hero-search input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: transparent;
	color: var(--text);
	font-size: 15.5px;
	outline: none;
	padding: 6px 0;
}

.fh-hero-search button {
	flex: 0 0 auto;
	padding: 10px 22px;
	border: 0;
	border-radius: 10px;
	background: var(--primary);
	color: #fff;
	font-weight: 600;
	font-size: 14.5px;
}

.fh-hero-tags {
	margin-top: 20px;
	font-size: 13.5px;
	color: var(--text-mute);
}

.fh-hero-tags a {
	color: var(--text-soft);
	margin: 0 6px;
	border-bottom: 1px dashed transparent;
}

.fh-hero-tags a:hover {
	color: var(--primary);
	border-bottom-color: var(--primary);
}

/* ---------- 区块 ---------- */
.fh-section {
	margin-bottom: 44px;
}

.fh-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 18px;
}

.fh-section-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 17px;
	margin: 0;
}

.fh-section-title .fh-icon {
	color: var(--primary);
}

.fh-section-sub {
	font-size: 13px;
	color: var(--text-mute);
}

/* ---------- 网格与卡片 ---------- */
.fh-grid {
	display: grid;
	gap: 22px;
}

.fh-grid--2 {
	grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
}

.fh-grid--3 {
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 18px;
}

.fh-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

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

.fh-card-thumb {
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--bg-sink);
}

.fh-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

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

.fh-card-thumb--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 14%, transparent), var(--bg-soft));
}

.fh-card-thumb--empty span {
	font-size: 30px;
	font-weight: 800;
	color: color-mix(in srgb, var(--brand) 55%, var(--text-mute));
	letter-spacing: 0.06em;
}

.fh-card-body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px 18px 14px;
	flex: 1 1 auto;
}

.fh-card-title {
	font-size: 16.5px;
	line-height: 1.5;
	margin: 0;
	font-weight: 650;
}

.fh-card-title a {
	color: var(--text);
}

.fh-card-title a:hover {
	color: var(--primary);
	opacity: 1;
}

.fh-card-excerpt {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.7;
	color: var(--text-soft);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.fh-card-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: auto;
	padding-top: 10px;
	border-top: 1px dashed var(--border);
	font-size: 12.5px;
	color: var(--text-mute);
}

.fh-card-foot span {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

/* ---------- 标签胶囊 ---------- */
.fh-chip {
	display: inline-flex;
	align-items: center;
	padding: 4px 11px;
	border-radius: 999px;
	background: var(--primary-weak);
	color: var(--primary);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.6;
	white-space: nowrap;
}

.fh-chip:hover {
	background: color-mix(in srgb, var(--primary) 18%, transparent);
	color: var(--primary);
	opacity: 1;
}

.fh-chip--sm {
	padding: 2px 9px;
	font-size: 12px;
}

.fh-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.fh-tags--center {
	justify-content: center;
	margin-top: 18px;
}

/* ---------- 分类导航 ---------- */
.fh-cats {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 12px;
}

.fh-cat {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 13px 15px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: all 0.16s ease;
}

.fh-cat:hover {
	border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
	box-shadow: var(--shadow-sm);
	transform: translateY(-2px);
	opacity: 1;
}

.fh-cat-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: var(--primary-weak);
	color: var(--primary);
	font-weight: 700;
	font-size: 15px;
	flex: 0 0 auto;
}

.fh-cat-body {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.fh-cat-name {
	color: var(--text);
	font-size: 14px;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.fh-cat-count {
	color: var(--text-mute);
	font-size: 12px;
}

/* ---------- 侧栏 ---------- */
.fh-sidebar {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.widget {
	padding: 20px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	font-size: 14px;
}

.widget-title {
	font-size: 14.5px;
	font-weight: 700;
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--border);
	display: flex;
	align-items: center;
	gap: 8px;
}

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

.widget li {
	padding: 7px 0;
	border-bottom: 1px dashed var(--border);
	line-height: 1.6;
}

.widget li:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.widget li a {
	color: var(--text-soft);
}

.widget li a:hover {
	color: var(--primary);
}

.widget .fh-muted {
	line-height: 1.7;
}

.fh-sidebar-text {
	color: var(--text-soft);
	font-size: 13.5px;
	margin-bottom: 14px;
}

.fh-side-list li {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
}

.fh-side-date {
	flex: 0 0 auto;
	font-size: 12px;
	color: var(--text-mute);
}

.widget .fh-search-form {
	padding: 7px 10px;
}

.widget .fh-search-form button {
	padding: 5px 12px;
	font-size: 13px;
}

/* ---------- 面包屑 ---------- */
.fh-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	padding: 18px 0 4px;
	font-size: 13px;
	color: var(--text-mute);
}

.fh-breadcrumb a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--text-soft);
}

.fh-breadcrumb a:hover {
	color: var(--primary);
}

.fh-sep {
	color: var(--border-strong);
}

.fh-current {
	color: var(--text-mute);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 46ch;
}

/* ---------- 文章页 ---------- */
.fh-article {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 34px 38px 30px;
	box-shadow: var(--shadow-sm);
}

.fh-article--page {
	margin-top: 16px;
}

.fh-article-head {
	margin-bottom: 22px;
}

.fh-article-title {
	font-size: clamp(24px, 3.2vw, 33px);
	line-height: 1.35;
	margin: 12px 0 14px;
	letter-spacing: -0.025em;
}

.fh-article-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 16px;
	font-size: 13px;
	color: var(--text-mute);
}

.fh-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.fh-meta-item a {
	color: var(--text-soft);
}

.fh-meta-avatar {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	margin-right: 2px;
}

.fh-edit-link {
	color: var(--primary);
}

.fh-article-cover {
	margin: 0 0 26px;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--bg-sink);
}

.fh-article-cover img {
	width: 100%;
	display: block;
}

/* 正文排版 */
.fh-entry {
	font-size: 16.5px;
	line-height: 1.85;
	color: var(--text);
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.fh-entry > *:first-child {
	margin-top: 0;
}

.fh-entry h2 {
	font-size: 22px;
	margin: 2em 0 0.8em;
	padding-bottom: 0.4em;
	border-bottom: 1px solid var(--border);
	scroll-margin-top: calc(var(--header-h) + 20px);
}

.fh-entry h3 {
	font-size: 18.5px;
	margin: 1.7em 0 0.6em;
	scroll-margin-top: calc(var(--header-h) + 20px);
}

.fh-entry h4 {
	font-size: 16.5px;
	margin: 1.4em 0 0.5em;
}

.fh-entry a {
	color: var(--primary);
	border-bottom: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
}

.fh-entry a:hover {
	border-bottom-color: var(--primary);
	opacity: 1;
}

.fh-entry ul,
.fh-entry ol {
	padding-left: 1.5em;
}

.fh-entry li {
	margin-bottom: 0.4em;
}

.fh-entry blockquote {
	margin: 1.6em 0;
	padding: 14px 20px;
	border-left: 4px solid var(--primary);
	background: var(--bg-soft);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	color: var(--text-soft);
}

.fh-entry blockquote > *:last-child {
	margin-bottom: 0;
}

.fh-entry img {
	border-radius: var(--radius-sm);
	display: block;
	margin: 1.4em auto;
}

.fh-entry figure {
	margin: 1.6em 0;
}

.fh-entry figcaption {
	text-align: center;
	font-size: 13px;
	color: var(--text-mute);
	margin-top: 8px;
}

.fh-entry table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.6em 0;
	font-size: 14.5px;
	display: block;
	overflow-x: auto;
}

.fh-entry th,
.fh-entry td {
	border: 1px solid var(--border);
	padding: 10px 13px;
	text-align: left;
}

.fh-entry th {
	background: var(--bg-soft);
	font-weight: 600;
}

.fh-entry tr:nth-child(even) td {
	background: color-mix(in srgb, var(--bg-soft) 55%, transparent);
}

/* 行内代码 */
.fh-entry :not(pre) > code {
	padding: 2px 6px;
	margin: 0 1px;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: 6px;
	color: color-mix(in srgb, var(--brand) 78%, var(--text));
	font-family: var(--mono);
	font-size: 0.88em;
	word-break: break-word;
}

/* 代码块 */
.fh-entry pre {
	position: relative;
	margin: 1.6em 0;
	padding: 18px 20px;
	background: var(--code-bg);
	color: var(--code-text);
	border-radius: var(--radius);
	overflow-x: auto;
	font-family: var(--mono);
	font-size: 13.5px;
	line-height: 1.75;
	tab-size: 4;
}

.fh-entry pre code {
	background: none;
	border: 0;
	padding: 0;
	color: inherit;
	font-size: inherit;
	font-family: inherit;
}

.fh-code-wrap {
	position: relative;
	margin: 1.6em 0;
}

.fh-code-wrap pre {
	margin: 0;
}

.fh-copy-code {
	position: absolute;
	top: 9px;
	right: 10px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 10px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 7px;
	background: rgba(255, 255, 255, 0.07);
	color: rgba(255, 255, 255, 0.72);
	font-size: 12px;
	line-height: 1;
	opacity: 0;
	transition: all 0.15s ease;
}

.fh-code-wrap:hover .fh-copy-code,
.fh-copy-code:focus-visible {
	opacity: 1;
}

.fh-copy-code:hover {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
}

.fh-copy-code.is-done {
	color: #6ee7b7;
	border-color: rgba(110, 231, 183, 0.4);
}

/* 文章底部 */
.fh-article-foot {
	margin-top: 32px;
	padding-top: 22px;
	border-top: 1px solid var(--border);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.fh-article-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--text-mute);
}

.fh-share {
	display: flex;
	align-items: center;
	gap: 8px;
}

.fh-share-label {
	font-size: 13px;
	color: var(--text-mute);
}

.fh-share-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 12px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--card);
	color: var(--text-soft);
	font-size: 13px;
	transition: all 0.15s ease;
}

.fh-share-btn:hover {
	border-color: var(--primary);
	color: var(--primary);
	opacity: 1;
}

.fh-share-btn.is-done {
	border-color: #10b981;
	color: #10b981;
}

/* 来源卡片 */
.fh-source {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0 0 26px;
	padding: 13px 16px;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-left: 3px solid var(--primary);
	border-radius: var(--radius-sm);
	color: var(--text-soft);
}

.fh-source .fh-icon {
	margin-top: 3px;
	color: var(--primary);
}

.fh-source-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 13.5px;
	min-width: 0;
}

.fh-source-label {
	font-size: 12px;
	color: var(--text-mute);
	letter-spacing: 0.04em;
}

.fh-source-body a {
	color: var(--text);
	word-break: break-all;
}

.fh-source-body a:hover {
	color: var(--primary);
}

/* TOC */
.fh-toc {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px 18px;
	box-shadow: var(--shadow-sm);
	max-height: 52vh;
	overflow-y: auto;
}

.fh-toc[hidden] {
	display: none;
}

.fh-toc-head {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 13.5px;
	font-weight: 700;
	margin-bottom: 10px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--border);
}

.fh-toc-nav {
	display: flex;
	flex-direction: column;
	gap: 1px;
	font-size: 13px;
}

.fh-toc-nav a {
	display: block;
	padding: 5px 10px;
	border-left: 2px solid transparent;
	border-radius: 0 6px 6px 0;
	color: var(--text-soft);
	line-height: 1.55;
}

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

.fh-toc-nav a.is-active {
	color: var(--primary);
	border-left-color: var(--primary);
	background: var(--primary-weak);
	font-weight: 600;
}

.fh-toc-nav a[data-level="3"] {
	padding-left: 22px;
	font-size: 12.5px;
	color: var(--text-mute);
}

/* 作者卡 */
.fh-author {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	margin-top: 22px;
	padding: 22px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.fh-author-avatar {
	border-radius: 50%;
	flex: 0 0 auto;
}

.fh-author-name {
	font-weight: 700;
	font-size: 15px;
	margin-bottom: 4px;
}

.fh-author-name a {
	color: var(--text);
}

.fh-author-desc {
	margin: 0;
	font-size: 13.5px;
	color: var(--text-soft);
	line-height: 1.7;
}

/* 上下篇 */
.fh-postnav {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 14px;
	margin-top: 22px;
}

.fh-postnav-item {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: all 0.16s ease;
}

.fh-postnav-item:hover {
	border-color: var(--primary);
	opacity: 1;
}

.fh-postnav-item--next {
	text-align: right;
}

.fh-postnav-label {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12.5px;
	color: var(--text-mute);
}

.fh-postnav-item--next .fh-postnav-label {
	justify-content: flex-end;
}

.fh-postnav-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--text);
	line-height: 1.5;
}

/* 相关推荐 */
.fh-related {
	margin-top: 34px;
}

.fh-related .fh-section-title {
	margin-bottom: 16px;
}

.fh-related .fh-card-title {
	font-size: 15px;
}

/* 分页 */
.fh-pagination,
.navigation.pagination {
	margin-top: 34px;
}

.fh-pagination .nav-links,
.navigation.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.fh-pagination .page-numbers,
.navigation.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--card);
	color: var(--text-soft);
	font-size: 14px;
	justify-content: center;
}

.fh-pagination .page-numbers:hover,
.navigation.pagination .page-numbers:hover {
	border-color: var(--primary);
	color: var(--primary);
	opacity: 1;
}

.fh-pagination .page-numbers.current,
.navigation.pagination .page-numbers.current {
	background: var(--primary);
	border-color: var(--primary);
	color: #fff;
}

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

/* 分页链接（wp_link_pages） */
.fh-page-links {
	margin: 1.6em 0;
	font-size: 14px;
	color: var(--text-mute);
}

/* 归档头 */
.fh-archive-head {
	margin-bottom: 24px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--border);
}

.fh-archive-title {
	font-size: 26px;
	margin: 0 0 8px;
}

.fh-archive-desc {
	color: var(--text-soft);
	font-size: 14px;
	margin-bottom: 8px;
}

.fh-archive-count {
	font-size: 13px;
	color: var(--text-mute);
}

.fh-archive-search {
	margin-top: 14px;
	max-width: 460px;
}

/* 空状态 */
.fh-empty {
	text-align: center;
	padding: 56px 20px;
	background: var(--card);
	border: 1px dashed var(--border-strong);
	border-radius: var(--radius-lg);
}

.fh-empty-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 62px;
	height: 62px;
	border-radius: 50%;
	background: var(--bg-soft);
	color: var(--text-mute);
	margin-bottom: 16px;
}

.fh-empty-title {
	font-size: 18px;
	margin-bottom: 8px;
}

.fh-empty-text {
	color: var(--text-mute);
	font-size: 14px;
}

.fh-empty-search {
	max-width: 420px;
	margin: 20px auto 0;
}

/* 404 */
.fh-404 {
	text-align: center;
	padding: 80px 20px;
}

.fh-404-code {
	font-size: clamp(72px, 16vw, 132px);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.05em;
	background: linear-gradient(135deg, var(--brand), #06b6d4);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.fh-404-title {
	font-size: 24px;
	margin: 14px 0 8px;
}

.fh-404-text {
	color: var(--text-soft);
	margin-bottom: 26px;
}

.fh-404-search {
	max-width: 420px;
	margin: 0 auto 24px;
}

.fh-404-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

/* 按钮 */
.fh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 20px;
	border: 1px solid var(--primary);
	border-radius: 10px;
	background: var(--primary);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	transition: all 0.15s ease;
}

.fh-btn:hover {
	opacity: 0.9;
	color: #fff;
}

.fh-btn--ghost {
	background: var(--card);
	border-color: var(--border);
	color: var(--text-soft);
}

.fh-btn--ghost:hover {
	border-color: var(--primary);
	color: var(--primary);
	opacity: 1;
}

/* ---------- 评论 ---------- */
.fh-comments {
	margin-top: 40px;
	padding: 26px 30px 30px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
}

.fh-comment-list {
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
}

.fh-comment-list .comment-body {
	padding: 18px 0;
	border-bottom: 1px solid var(--border);
}

.fh-comment-list .children {
	list-style: none;
	margin: 0;
	padding-left: 46px;
}

.fh-comment-list .comment-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 12px;
	font-size: 13px;
	margin-bottom: 8px;
}

.fh-comment-list .comment-author {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: 14px;
	color: var(--text);
}

.fh-comment-list .comment-author img {
	border-radius: 50%;
}

.fh-comment-list .comment-author .says {
	display: none;
}

.fh-comment-list .comment-metadata {
	color: var(--text-mute);
	font-size: 12.5px;
}

.fh-comment-list .comment-metadata a {
	color: var(--text-mute);
}

.fh-comment-list .comment-content {
	font-size: 14.5px;
	line-height: 1.8;
	color: var(--text-soft);
}

.fh-comment-list .comment-content p:last-child {
	margin-bottom: 0;
}

.fh-comment-list .reply {
	font-size: 13px;
}

.fh-comment-list .comment-reply-link {
	color: var(--primary);
}

.fh-comment-form p {
	margin-bottom: 16px;
}

.fh-comment-form label {
	display: block;
	font-size: 13.5px;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--text-soft);
}

.fh-comment-form input[type="text"],
.fh-comment-form input[type="email"],
.fh-comment-form input[type="url"],
.fh-comment-form textarea {
	width: 100%;
	padding: 11px 14px;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: 10px;
	color: var(--text);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fh-comment-form input:focus,
.fh-comment-form textarea:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px var(--primary-weak);
}

.fh-comment-form .comment-form-cookies-consent {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--text-mute);
}

.fh-comment-form .comment-form-cookies-consent label {
	margin: 0;
	font-weight: 400;
}

.fh-comment-form .form-submit {
	margin-bottom: 0;
}

/* ---------- 页脚 ---------- */
.fh-footer {
	margin-top: 40px;
	border-top: 1px solid var(--border);
	background: var(--bg-soft);
	padding: 44px 0 22px;
}

.fh-footer-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 32px;
	padding-bottom: 30px;
	border-bottom: 1px solid var(--border);
}

.fh-footer .widget {
	padding: 0;
	background: none;
	border: 0;
	box-shadow: none;
}

.fh-footer .widget-title,
.fh-footer-col h3 {
	font-size: 14px;
	font-weight: 700;
	margin: 0 0 14px;
	padding: 0;
	border: 0;
	color: var(--text);
}

.fh-footer p {
	font-size: 13.5px;
	color: var(--text-soft);
	line-height: 1.75;
	margin: 0;
}

.fh-footer-brand {
	font-size: 16px;
	font-weight: 800;
	margin-bottom: 10px;
	letter-spacing: -0.01em;
}

.fh-footer-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.fh-footer-menu li {
	padding: 0;
	border: 0;
}

.fh-footer-menu a {
	font-size: 13.5px;
	color: var(--text-soft);
}

.fh-footer-menu a:hover {
	color: var(--primary);
}

.fh-social {
	display: flex;
	gap: 10px;
}

.fh-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: var(--card);
	border: 1px solid var(--border);
	color: var(--text-soft);
}

.fh-social a:hover {
	color: var(--primary);
	border-color: var(--primary);
	opacity: 1;
}

.fh-footer-bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding-top: 20px;
	font-size: 13px;
	color: var(--text-mute);
}

.fh-footer-bottom a {
	color: var(--text-soft);
}

.fh-icp {
	font-size: 12.5px;
}

/* 回到顶部 */
.fh-top {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 80;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--card);
	color: var(--text-soft);
	box-shadow: var(--shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: all 0.2s ease;
}

.fh-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.fh-top:hover {
	color: var(--primary);
	border-color: var(--primary);
}

/* ---------- WordPress 默认类 ---------- */
.alignleft {
	float: left;
	margin: 0 1.4em 1em 0;
}

.alignright {
	float: right;
	margin: 0 0 1em 1.4em;
}

.aligncenter {
	display: block;
	margin: 1.4em auto;
}

.wp-caption {
	max-width: 100%;
}

.wp-caption-text {
	font-size: 13px;
	color: var(--text-mute);
	text-align: center;
	margin-top: 8px;
}

.sticky .fh-card-title::before {
	content: "推荐";
	display: inline-block;
	margin-right: 8px;
	padding: 1px 7px;
	border-radius: 5px;
	background: var(--primary);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	vertical-align: 2px;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 10px;
}

.gallery-item {
	margin: 0;
}

.wp-block-image img {
	border-radius: var(--radius-sm);
}

.screen-reader-shortcut {
	display: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
	.fh-layout,
	.fh-layout--single {
		grid-template-columns: minmax(0, 1fr);
		gap: 30px;
	}

	.fh-sidebar-col {
		position: static;
	}

	.fh-toc {
		max-height: none;
	}
}

@media (max-width: 860px) {
	.fh-menu-btn {
		display: inline-flex;
	}

	.fh-nav {
		position: fixed;
		inset: var(--header-h) 0 auto 0;
		background: var(--bg);
		border-bottom: 1px solid var(--border);
		padding: 10px 22px 18px;
		max-height: calc(100vh - var(--header-h));
		overflow-y: auto;
		display: none;
		box-shadow: var(--shadow);
	}

	body.fh-nav-open .fh-nav {
		display: block;
	}

	body.fh-nav-open .fh-menu-open {
		display: none;
	}

	body.fh-nav-open .fh-menu-close {
		display: inline-flex;
	}

	.fh-menu {
		flex-direction: column;
		align-items: stretch;
		gap: 2px;
	}

	.fh-menu a {
		display: block;
		padding: 11px 12px;
		font-size: 15px;
	}

	.fh-menu .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: 0;
		border-left: 2px solid var(--border);
		border-radius: 0;
		margin-left: 12px;
		padding: 2px 0 2px 6px;
		background: transparent;
	}

	.fh-article {
		padding: 26px 22px 22px;
		border-radius: var(--radius);
	}

	.fh-hero-inner {
		padding: 44px 20px 40px;
	}

	.fh-comments {
		padding: 22px 20px;
	}
}

@media (max-width: 600px) {
	.fh-container {
		padding: 0 16px;
	}

	body {
		font-size: 15.5px;
	}

	.fh-grid,
	.fh-grid--2,
	.fh-grid--3 {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.fh-cats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.fh-cat {
		padding: 11px 12px;
		gap: 9px;
	}

	.fh-cat-icon {
		width: 30px;
		height: 30px;
		font-size: 13px;
	}

	.fh-hero-search {
		flex-wrap: nowrap;
		padding-left: 14px;
	}

	.fh-hero-search button {
		padding: 9px 15px;
		font-size: 14px;
	}

	.fh-article-foot {
		flex-direction: column;
		align-items: flex-start;
	}

	.fh-entry {
		font-size: 16px;
	}

	.fh-entry h2 {
		font-size: 20px;
	}

	.fh-comment-list .children {
		padding-left: 18px;
	}

	.fh-top {
		right: 16px;
		bottom: 16px;
	}

	.fh-footer {
		padding-top: 32px;
	}

	.fh-logo-name {
		max-width: 140px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
