/*
Theme Name: 中医之道 Zhongyi
Theme URI: https://zhongyizhidao.com/
Description: 中医之道专用主题。宣纸底、朱砂印、楷体经文；典籍章节目录与上下章导航，原文 / 注释 / 宜忌 / 方笺自动排版；思源宋体按需切片加载，中文排版细调，深色模式、阅读设置、文章目录与结构化数据。
Author: 中医之道
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: zhongyi
*/

/* ==========================================================================
   0. 字体
   --------------------------------------------------------------------------
   · 正文用各平台系统黑体：苹方（Apple）/ 微软雅黑（Windows）/ 思源黑体（Android、Linux）。
   · 标题用思源宋体（assets/fonts-600.css，按 unicode-range 切片，只下载页面用到的字）。
   · 「ZYD Punct」只覆盖弯引号、破折号、省略号，指向系统中文字体：
     否则这些字符会由西文字体渲染成半角窄字形，中文里显得局促。
   ========================================================================== */
@font-face {
	font-family: "ZYD Punct";
	font-weight: 400;
	src: local("PingFangSC-Regular"), local("PingFang SC Regular"), local("Microsoft YaHei"), local("微软雅黑"),
		local("NotoSansCJKsc-Regular"), local("Noto Sans CJK SC"), local("SourceHanSansSC-Regular"), local("Source Han Sans SC");
	unicode-range: U+2018-2019, U+201C-201D, U+2014-2015, U+2026, U+2E3A;
}
@font-face {
	font-family: "ZYD Punct";
	font-weight: 600 700;
	src: local("PingFangSC-Semibold"), local("PingFang SC Semibold"), local("Microsoft YaHei Bold"), local("MicrosoftYaHei-Bold"),
		local("NotoSansCJKsc-Bold"), local("Noto Sans CJK SC Bold"), local("SourceHanSansSC-Bold"), local("Source Han Sans SC Bold");
	unicode-range: U+2018-2019, U+201C-201D, U+2014-2015, U+2026, U+2E3A;
}

/* ==========================================================================
   1. 设计变量
   ========================================================================== */
:root {
	/* 色彩：宣纸底、松烟墨、朱砂主色、青瓷点缀 */
	--bg: #f4eee3;
	--surface: #fffcf6;
	--surface-2: #f3ece0;
	--ink: #231e19;
	--ink-2: #4d453d;
	--muted: #75695c;
	--line: #e6dbc9;
	--line-2: #eee5d7;
	--brand: #9b3b2a;
	--brand-ink: #7c2c1f;
	--brand-soft: #f6e6de;
	--brand-faint: #ddb6a8;
	--mark: rgba(155, 59, 42, .12);
	--accent: #4f7d6e;
	--accent-soft: #e5eee9;
	--gold: #a7803f;
	--on-brand: #fff;
	--grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .24 0 0 0 0 .12 0 0 0 .075 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

	/* 字体栈 */
	--font-sans: "ZYD Punct", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif;
	--font-serif: "ZYD Serif Site", "ZYD Serif", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", "ZYD Punct", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
	/* 宋体正文：不含标题专用的 600 子集，否则子集里的常用字会被显示成半粗体 */
	--font-serif-text: "ZYD Serif", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", "ZYD Punct", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
	/* 楷体：经文原文、引言等，使用系统自带楷体，不额外下载 */
	--font-kai: "Kaiti SC", "STKaiti", "KaiTi", "楷体", "BiauKai", "AR PL UKai CN", "ZYD Serif", "Noto Serif SC", "Songti SC", serif;
	--font-latin: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
	--font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "ZYD Punct", "PingFang SC", "Microsoft YaHei", monospace;

	/* 正文字号（阅读设置可调） */
	--fs-body: 17px;

	--radius: 6px;
	--radius-sm: 4px;
	--shadow-sm: 0 0 0 1px rgba(120, 90, 50, .07), 0 1px 2px rgba(60, 40, 20, .04);
	--shadow: 0 0 0 1px rgba(120, 90, 50, .08), 0 12px 30px -14px rgba(60, 40, 20, .2);
	--shadow-lg: 0 30px 60px -24px rgba(60, 40, 20, .34);

	--container: 1200px;
	--gutter: 16px;
	--gap: 24px;
	--header-h: 68px;
	--ease: cubic-bezier(.2, .7, .2, 1);

	color-scheme: light;
}

html.dark {
	--bg: #15120f;
	--surface: #1d1915;
	--surface-2: #26211b;
	--ink: #ece4d6;
	--ink-2: #c4b8a6;
	--muted: #968a7b;
	--line: #352e26;
	--line-2: #2a241e;
	--brand: #e0907a;
	--brand-ink: #f0ab97;
	--brand-soft: #33221c;
	--brand-faint: #6e4034;
	--mark: rgba(224, 144, 122, .15);
	--accent: #93bfae;
	--accent-soft: #1f2a25;
	--gold: #d2b072;
	--on-brand: #1c0f0b;
	--grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .025 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	--shadow-sm: 0 0 0 1px rgba(255, 255, 255, .04);
	--shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 12px 30px -14px rgba(0, 0, 0, .7);
	--shadow-lg: 0 28px 56px -20px rgba(0, 0, 0, .7);
	color-scheme: dark;
}

html[data-size="s"]  { --fs-body: 16px; }
html[data-size="l"]  { --fs-body: 18.5px; }
html[data-size="xl"] { --fs-body: 20px; }

@media (min-width: 768px) {
	:root { --gutter: 28px; --gap: 32px; }
}
@media (max-width: 767px) {
	:root { --fs-body: 16.5px; --radius: 14px; --header-h: 60px; }
	html[data-size="s"]  { --fs-body: 15.5px; }
	html[data-size="l"]  { --fs-body: 18px; }
	html[data-size="xl"] { --fs-body: 19.5px; }
}

/* ==========================================================================
   2. 基础
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

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

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	font: 400 15px/1.75 var(--font-sans);
	color: var(--ink);
	background: var(--grain), var(--bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-kerning: normal;
	/* 中西文之间自动留出约 1/8 字宽的间隙（支持的浏览器生效） */
	text-autospace: normal;
	overflow-wrap: break-word;
}
body.has-bg { background: var(--bg) center / cover fixed; }
html.dark body.has-bg { background-blend-mode: multiply; }

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--brand); }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.4; color: var(--ink); text-wrap: pretty; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand); color: var(--on-brand); }

.icon { flex: none; width: 1em; height: 1em; }

.sr-only {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
	position: fixed !important; z-index: 1000; top: 12px; left: 12px; width: auto; height: auto; clip: auto;
	padding: 8px 16px; background: var(--surface); color: var(--ink); border-radius: 8px; box-shadow: var(--shadow);
}
.no-scroll { overflow: hidden; }

.container {
	width: 100%;
	max-width: calc(var(--container) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}
.site-main { flex: 1 0 auto; }

/* —— 兼容与触控 —— */
a, button, [role="button"], input, label, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
/* 刘海屏横屏时内容避开安全区 */
.container {
	padding-left: max(var(--gutter), env(safe-area-inset-left));
	padding-right: max(var(--gutter), env(safe-area-inset-right));
}
/* iOS 在输入框字号小于 16px 时会自动放大整页，移动端统一 16px */
@media (max-width: 767px) {
	input[type="text"], input[type="search"], input[type="email"], input[type="url"], textarea, select { font-size: 16px !important; }
}
/* 触屏设备的点击区域不小于 44px */
@media (pointer: coarse) {
	.icon-btn, .reader-toggle { width: 44px; height: 44px; }
	.pagination .page-numbers { min-width: 44px; height: 44px; }
}
/* 不支持 aspect-ratio 的旧浏览器（iOS 14 等） */
@supports not (aspect-ratio: 1 / 1) {
	.slider-track { height: 62.5vw; max-height: 560px; }
}
/* 滚动条与主题同色 */
html { scrollbar-color: var(--line) transparent; }
@media (hover: hover) {
	::-webkit-scrollbar { width: 10px; height: 10px; }
	::-webkit-scrollbar-thumb { background: var(--line); border: 3px solid var(--bg); border-radius: 10px; }
	::-webkit-scrollbar-thumb:hover { background: var(--muted); }
	::-webkit-scrollbar-track { background: transparent; }
}
/* Windows 高对比度模式 */
@media (forced-colors: active) {
	.card, .widget, .article, .comments, .pick, .post-nav-item { border: 1px solid CanvasText; }
	.slider-dots button[aria-selected="true"], .read-progress { background: Highlight; }
}
/* 图片载入时淡入（由 main.js 标记 is-loading） */
img.is-loading { opacity: 0; }
img.is-loaded { transition: opacity .5s var(--ease), transform .7s var(--ease); }

/* 宋体标题的公共设定：首个标点悬挂、禁止伪粗/伪斜 */
.serif,
.brand-name, .slide-title, .pick-title, .section-head h2, .page-title,
.card-title, .article-title, .entry-content :is(h1, h2, h3, h4, p.is-heading),
.related-title, .post-nav-item b, .not-found h1 {
	font-family: var(--font-serif);
	font-weight: 600;
	text-spacing-trim: trim-start;
	font-synthesis: none;
}

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	height: 42px; padding: 0 24px; border-radius: 999px;
	background: var(--brand); color: var(--on-brand); font-size: 14px; letter-spacing: .08em;
	transition: background .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { background: var(--brand-ink); color: var(--on-brand); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.btn-ghost:hover { background: transparent; color: var(--brand); border-color: var(--brand); }

.chip {
	display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
	border-radius: 999px; font-size: 12px; letter-spacing: .06em;
	background: var(--brand-soft); color: var(--brand);
}

.thumb { position: relative; display: block; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease), opacity .4s; }
.thumb-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: var(--brand-faint); font-size: 28px; }
/* 图片外缘的极细描边，让浅色图片在白底上也有轮廓 */
.thumb::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05); pointer-events: none; }
html.dark .thumb img { opacity: .92; }

.admin-notice {
	max-width: var(--container); margin: 16px auto 0; padding: 10px 16px; border-radius: var(--radius-sm);
	background: #fff6e0; color: #6b4b10; font-size: 14px;
}
.admin-notice a { text-decoration: underline; }

/* ==========================================================================
   3. 页头
   ========================================================================== */
.site-header {
	position: relative; z-index: 50;
	background: var(--surface);
	background: color-mix(in srgb, var(--surface) 82%, transparent);
	-webkit-backdrop-filter: saturate(1.5) blur(16px);
	backdrop-filter: saturate(1.5) blur(16px);
	border-bottom: 1px solid var(--line-2);
	transition: box-shadow .25s var(--ease);
}
.site-header.is-sticky { position: sticky; top: 0; }
.admin-bar .site-header.is-sticky { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header.is-sticky { top: 0; } }
.site-header.is-sticky.is-scrolled { box-shadow: 0 8px 28px -16px rgba(0, 0, 0, .22); }

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

.brand { display: inline-flex; align-items: center; gap: 12px; flex: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-logo { width: 38px; height: 38px; border-radius: 5px; object-fit: cover; }
/* 朱砂方印：印中一只葫芦（悬壶济世） */
.brand-mark {
	display: grid; place-items: center; width: 38px; height: 38px; border-radius: 5px;
	background: var(--grain), linear-gradient(150deg, #b0473a, #9b3b2a 55%, #842f22); color: #fff; font-size: 22px;
	box-shadow: inset 0 0 0 3px #9b3b2a, inset 0 0 0 4px rgba(255, 246, 236, .55), 0 6px 14px -8px rgba(130, 40, 25, .7);
}
.brand-mark .icon { stroke-width: 1.6; }
html.dark .brand-mark { background: var(--grain), linear-gradient(150deg, #b85646, #a2432f); box-shadow: inset 0 0 0 3px #a2432f, inset 0 0 0 4px rgba(255, 246, 236, .45); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { line-height: inherit; font-size: 21px; letter-spacing: .2em; margin-right: -.2em; }
.brand-tag { margin-top: 5px; font: 400 9.5px/1 var(--font-sans); letter-spacing: .22em; color: var(--muted); white-space: nowrap; }

.main-nav { flex: 1; margin-left: 40px; }
.main-nav .menu { display: flex; align-items: center; gap: 6px; }
.main-nav .menu > li { position: relative; }
.main-nav .menu > li > a {
	position: relative; display: flex; align-items: center; height: var(--header-h); padding: 0 14px;
	font-size: 15px; letter-spacing: .06em; color: var(--ink-2);
}
.main-nav .menu > li > a::after {
	content: ""; position: absolute; left: 50%; bottom: 16px; width: 16px; height: 2px; margin-left: -8px;
	border-radius: 2px; background: var(--brand); transform: scaleX(0); transition: transform .25s var(--ease);
}
.main-nav .menu > li > a:hover { color: var(--ink); }
.main-nav .menu > li > a:hover::after { transform: scaleX(.6); }
.main-nav .menu > li.current-menu-item > a,
.main-nav .menu > li.current-menu-ancestor > a,
.main-nav .menu > li.current-post-ancestor > a,
.main-nav .menu > li.current-category-ancestor > a { color: var(--brand); font-weight: 600; }
.main-nav .menu > li.current-menu-item > a::after,
.main-nav .menu > li.current-menu-ancestor > a::after,
.main-nav .menu > li.current-post-ancestor > a::after,
.main-nav .menu > li.current-category-ancestor > a::after { transform: none; }
.main-nav .sub-menu {
	position: absolute; top: calc(100% - 8px); left: 0; min-width: 180px; padding: 6px;
	background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
	opacity: 0; visibility: hidden; transform: translateY(-4px);
	transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.main-nav .sub-menu a { display: block; padding: 8px 12px; border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.main-nav .sub-menu a:hover { background: var(--surface-2); color: var(--brand); }

.header-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.icon-btn {
	display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
	font-size: 19px; color: var(--ink-2); transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.when-dark { display: none; }
html.dark .when-dark { display: block; }
html.dark .when-light { display: none; }

.search-panel { padding: 16px 0 20px; border-top: 1px solid var(--line-2); animation: fade-down .2s var(--ease); }
.search-panel .search-form { max-width: 640px; margin: 0 auto; }

.search-form {
	position: relative; display: flex; align-items: center; height: 46px;
	background: var(--surface-2); border: 1px solid transparent; border-radius: 999px;
	transition: border-color .2s, background .2s, box-shadow .2s;
}
.search-form:focus-within { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.search-form > .icon { position: absolute; left: 16px; color: var(--muted); font-size: 17px; pointer-events: none; }
.search-form input {
	flex: 1; min-width: 0; height: 100%; padding: 0 8px 0 44px; border: 0; background: none; outline: 0; font-size: 15px;
}
.search-form input::placeholder { color: var(--muted); }
.search-form input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-form button {
	height: 36px; margin-right: 5px; padding: 0 18px; border-radius: 999px;
	background: var(--brand); color: var(--on-brand); font-size: 14px; letter-spacing: .1em;
}

.only-mobile { display: none; }

@media (max-width: 960px) {
	.main-nav { display: none; }
	.only-mobile { display: grid; margin-left: -8px; }
	.header-inner { gap: 4px; }
	.brand { gap: 10px; }
	.brand-name { font-size: 19px; }
	.brand-tag { display: none; }
	.brand-logo, .brand-mark { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
}

/* 阅读进度条 */
.read-progress {
	position: fixed; z-index: 60; top: 0; left: 0; right: 0; height: 3px;
	background: linear-gradient(90deg, var(--brand), var(--gold));
	transform: scaleX(0); transform-origin: 0 50%;
}
.admin-bar .read-progress { top: 32px; }

/* 抽屉菜单 */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100; }
.drawer-backdrop { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(26, 18, 12, .45); opacity: 0; transition: opacity .25s var(--ease); }
.drawer-panel {
	position: absolute; top: 0; bottom: 0; left: 0; width: min(84vw, 340px);
	display: flex; flex-direction: column; gap: 18px; padding: 16px 18px max(16px, env(safe-area-inset-bottom));
	background: var(--surface); box-shadow: var(--shadow-lg); overflow-y: auto;
	transform: translateX(-100%); transition: transform .28s var(--ease);
}
.drawer.is-open .drawer-backdrop { opacity: 1; }
.drawer.is-open .drawer-panel { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-nav .menu > li { border-bottom: 1px solid var(--line-2); }
.drawer-nav li { position: relative; }
.drawer-nav a { display: block; padding: 14px 44px 14px 2px; font-size: 16px; letter-spacing: .06em; color: var(--ink); }
.drawer-nav .current-menu-item > a { color: var(--brand); font-weight: 600; }
.drawer-nav .sub-menu { display: none; padding: 0 0 8px 12px; }
.drawer-nav .sub-menu a { padding: 9px 4px; font-size: 15px; color: var(--ink-2); }
.drawer-nav .is-open > .sub-menu { display: block; }
.submenu-toggle {
	position: absolute; top: 8px; right: 0; display: grid; place-items: center;
	width: 38px; height: 38px; font-size: 18px; color: var(--muted); transition: transform .2s;
}
.is-open > .submenu-toggle { transform: rotate(180deg); }

/* ==========================================================================
   4. 区块标题（单字朱印 + 中文宋体 + 细线）
   ========================================================================== */
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
/* 单字朱印：区块标题前的小印章 */
.section-head .kicker {
	align-self: center; display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 3px;
	background: var(--grain), var(--brand); color: #fff; font: 600 14px/1 var(--font-serif); letter-spacing: 0; font-synthesis: none;
	box-shadow: inset 0 0 0 2px var(--brand), inset 0 0 0 3px rgba(255, 246, 236, .55);
}
html.dark .section-head .kicker { background: var(--grain), #a2432f; box-shadow: inset 0 0 0 2px #a2432f, inset 0 0 0 3px rgba(255, 246, 236, .45); }
.section-head h2 { display: flex; align-items: baseline; gap: 10px; font-size: 21px; letter-spacing: .08em; white-space: nowrap; }
.section-head h2 small { font: 400 13px var(--font-sans); letter-spacing: .02em; color: var(--muted); }
.section-rule { flex: 1; align-self: center; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* ==========================================================================
   5. 首页焦点区
   ========================================================================== */
.hero { padding: 24px 0 4px; }
.hero-grid { display: grid; gap: 16px; }
@media (min-width: 992px) {
	.hero { padding-top: 36px; }
	.hero-grid { grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr); gap: var(--gap); }
}

.slider { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow); isolation: isolate; }
.slider-track { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 16 / 10; }
@media (min-width: 992px) {
	.slider { display: flex; flex-direction: column; }
	.slider-track { flex: 1; aspect-ratio: auto; min-height: 400px; }
}
.slider-track::-webkit-scrollbar { display: none; }
/*
 * 鼠标 / 触控板设备：轮播不作为原生横向滚动区域。
 * 否则触控板（及妙控鼠标）竖向滑动时附带的微小横向位移会让浏览器把整个手势"锁定"到轮播上，
 * 页面就上下划不动。切换改由箭头、圆点、自动播放和明确的横向滑动（main.js）完成。
 * 触屏设备仍保留原生手指滑动。
 */
@media (hover: hover) and (pointer: fine) {
	.slider-track { overflow: hidden; }
}
.slide { position: relative; flex: 0 0 100%; overflow: hidden; scroll-snap-align: start; color: #fff; } /* 裁掉悬停放大的图片，避免轮播出现竖向可滚动区域 */
.slide:hover { color: #fff; }
.slide img, .slide .thumb-placeholder { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s var(--ease); }
.slide:hover img { transform: scale(1.035); }
.slide::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(180deg, rgba(22, 14, 9, 0) 30%, rgba(22, 14, 9, .35) 60%, rgba(22, 14, 9, .82) 100%); }
.slide-caption {
	position: absolute; z-index: 1; left: 0; right: 0; bottom: 0;
	display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
	padding: 20px 20px 52px;
}
.slide-kicker { font-size: 12px; letter-spacing: .24em; color: rgba(255, 255, 255, .78); }
.slide-kicker::before { content: ""; display: inline-block; width: 18px; height: 1px; margin-right: 10px; vertical-align: middle; background: currentColor; }
.slide-title { max-width: 30em; font-size: clamp(21px, 2.7vw, 32px); line-height: 1.38; letter-spacing: .03em; text-wrap: pretty; text-shadow: 0 2px 16px rgba(0, 0, 0, .3); }
.slide-excerpt { display: none; max-width: 36em; font-size: 14px; line-height: 1.8; letter-spacing: .02em; color: rgba(255, 255, 255, .8); }
@media (min-width: 768px) {
	.slide-caption { padding: 36px 40px 60px; }
	.slide-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
/* 小屏：轮播改为 4:3，给标题留足空间；标题最多三行 */
@media (max-width: 639px) {
	.slider-track { aspect-ratio: 4 / 3; }
	.slide-caption { padding: 16px 16px 50px; gap: 8px; }
	.slide-title { font-size: clamp(19px, 5.6vw, 23px); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
	.slider .slider-arrow { display: none; }
}
/* 平板：焦点图通栏时改为 2:1，避免占满一屏 */
@media (min-width: 640px) and (max-width: 991px) {
	.slider-track { aspect-ratio: 2 / 1; }
}
/* 横屏手机等矮屏：焦点图不超过可视高度的 75% */
@media (max-width: 991px) {
	.slider-track { width: 100%; max-height: 75vh; min-height: 220px; }
}
@supports not (aspect-ratio: 1 / 1) {
	@media (max-width: 639px) { .slider-track { height: 75vw; } }
	@media (min-width: 640px) and (max-width: 991px) { .slider-track { height: 50vw; } }
}
.slider-ui { position: absolute; z-index: 2; left: 20px; right: 16px; bottom: 18px; display: flex; align-items: center; gap: 6px; }
@media (min-width: 768px) { .slider-ui { left: 40px; right: 24px; bottom: 22px; } }
.slider-dots { display: flex; gap: 6px; margin-right: auto; }
.slider-dots button { position: relative; width: 18px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .35); transition: width .35s var(--ease), background .3s; }
.slider-dots button::before { content: ""; position: absolute; top: -14px; right: -3px; bottom: -14px; left: -3px; } /* 扩大点击区 */
.slider-dots button[aria-selected="true"] { width: 34px; background: #fff; }
.slider-arrow {
	display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .28); color: #fff; font-size: 15px;
	background: rgba(255, 255, 255, .08); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .2s;
}
.slider-arrow:hover { background: rgba(255, 255, 255, .24); }

.picks { display: grid; gap: 14px; align-content: start; }
.pick {
	display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 16px; align-items: center;
	padding: 12px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
	transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.pick:hover { color: inherit; box-shadow: var(--shadow); transform: translateY(-2px); }
.pick .thumb { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); }
.pick:hover img { transform: scale(1.05); }
.pick-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* 标题在上，下面一行是「分类 · 日期」 */
.pick-meta { display: flex; flex-wrap: wrap; align-items: center; margin-top: 2px; font-size: 12px; line-height: 1.5; }
.pick-meta > * + *::before { content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 8px; border-radius: 50%; background: var(--muted); opacity: .45; vertical-align: middle; }
.pick-cat { letter-spacing: .08em; color: var(--brand); }
/* 阅读数靠右，与文章列表一致 */
.pick-views { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; margin-right: 10px; padding-left: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pick-meta > .pick-views::before { display: none; }
.pick-views .icon { font-size: 13px; }
@media (max-width: 639px) { .pick-views { display: none; } } /* 手机卡片太窄，同文章列表只留分类与日期 */
.pick-title { font-size: 15px; font-weight: 600; line-height: 1.55; letter-spacing: .02em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick:hover .pick-title { color: var(--brand); }
.pick time { color: var(--muted); font-variant-numeric: tabular-nums; }
.pick.is-lead { grid-template-columns: 1fr; padding: 0; overflow: hidden; gap: 0; }
.pick.is-lead .thumb { aspect-ratio: 32 / 15; border-radius: 0; }
.pick.is-lead .pick-body { padding: 16px 20px 20px; }
.pick.is-lead .pick-title { font-size: 18px; line-height: 1.5; letter-spacing: .03em; }
@media (max-width: 991px) {
	.picks { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
	.pick.is-lead { grid-template-columns: 108px minmax(0, 1fr); padding: 12px; gap: 16px; }
	.pick.is-lead .thumb { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); }
	.pick.is-lead .pick-body { padding: 0; }
	.pick.is-lead .pick-title { font-size: 15px; }
}
/* 平板：精选三栏等宽，图上文下 */
@media (min-width: 640px) and (max-width: 991px) {
	.picks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.pick, .pick.is-lead { grid-template-columns: 1fr; align-content: start; gap: 0; padding: 0; overflow: hidden; }
	.pick .thumb, .pick.is-lead .thumb { aspect-ratio: 16 / 10; border-radius: 0; }
	.pick .pick-body, .pick.is-lead .pick-body { padding: 12px 14px 14px; }
}
/* 手机：精选改为可横向滑动的一行 */
@media (max-width: 639px) {
	.picks {
		display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
		margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter) 6px; scroll-padding: 0 var(--gutter);
	}
	.picks::-webkit-scrollbar { display: none; }
	.pick, .pick.is-lead { flex: 0 0 84%; scroll-snap-align: start; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; }
	.pick:hover { transform: none; }
}


/* ==========================================================================
   6. 布局 / 页面标题
   ========================================================================== */
.layout { display: grid; gap: var(--gap); padding-top: 32px; padding-bottom: 64px; }
@media (min-width: 992px) {
	.layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
}
@media (min-width: 1200px) {
	.layout { grid-template-columns: minmax(0, 1fr) 320px; }
}
.content { min-width: 0; }

.page-hero { padding: 40px 0 0; }
.page-title { margin-top: 14px; font-size: clamp(26px, 3.6vw, 38px); letter-spacing: .06em; }
.page-desc { max-width: 40em; margin-top: 12px; color: var(--ink-2); letter-spacing: .02em; line-height: 1.85; }
.page-count { margin-top: 10px; font-size: 13px; color: var(--muted); }
.page-count::before { content: ""; display: inline-block; width: 18px; height: 1px; margin-right: 10px; vertical-align: middle; background: var(--brand); }

.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.breadcrumb a { display: inline-flex; align-items: center; gap: 4px; }
.breadcrumb .sep { opacity: .45; }
.breadcrumb [aria-current] { color: var(--ink-2); }

/* ==========================================================================
   7. 文章列表：同一张纸面上用细线分隔，比一张张悬浮卡片更沉静
   ========================================================================== */
.post-list {
	background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
	padding: 0 18px;
}
@media (min-width: 768px) { .post-list { padding: 0 28px; } }
/* 列表上方的区块标题与卡片内的内容左对齐 */
.section-head:has(+ .post-list) { padding-left: 18px; }
@media (min-width: 768px) { .section-head:has(+ .post-list) { padding-left: 28px; } }

.card { position: relative; padding: 20px 0; }
.card + .card { border-top: 1px solid var(--line-2); }
.card:hover .thumb img { transform: scale(1.045); }
.card-title { font-size: 19px; line-height: 1.5; letter-spacing: .03em; }
.card-title a { transition: color .2s; }
.card-title a::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 0; }
.card:hover .card-title a { color: var(--brand); }
.card-excerpt {
	margin-top: 8px; color: var(--ink-2); font-size: 14.5px; line-height: 1.85; letter-spacing: .02em;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .post-meta { position: relative; z-index: 1; margin-top: auto; padding-top: 12px; }
/* 列表卡片：阅读数靠右，不再用分隔点 */
.card .post-meta .meta-views { margin-left: auto; margin-right: 10px; padding-left: 16px; }
.card .post-meta .meta-views::before { display: none; }

.card-row { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 16px; }
.card-row .thumb { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); align-self: start; }
.card-row .card-body { display: flex; flex-direction: column; min-width: 0; }
.card-row .card-title { font-size: 16.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-row .card-excerpt { display: none; }
/* 手机上信息行只保留分类与日期，避免折行后出现孤立的分隔点 */
@media (max-width: 639px) { .card .post-meta > :nth-child(n+3) { display: none; } }
.card .post-meta > *, .pick-meta > * { white-space: nowrap; }
@media (max-width: 374px) {
	.card .post-meta, .pick-meta { flex-direction: column; align-items: flex-start; gap: 2px; }
	.card .post-meta > * + *::before, .pick-meta > * + *::before { display: none; }
}
@media (min-width: 640px) {
	.card { padding: 26px 0; }
	.card-row { grid-template-columns: 224px minmax(0, 1fr); gap: 26px; }
	.card-row .card-title { font-size: 19px; }
	.card-row .card-excerpt { display: -webkit-box; }
}

.card-image .thumb { aspect-ratio: 16 / 7; border-radius: var(--radius-sm); }
.card-image .card-body { display: flex; flex-direction: column; padding-top: 18px; }
.card-image .card-title { font-size: 22px; }

.card-gallery { display: flex; flex-direction: column; gap: 14px; }
.card-gallery-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.card-gallery-grid .thumb { aspect-ratio: 4 / 3; border-radius: 8px; }
@media (max-width: 639px) { .card-gallery-grid { grid-template-columns: repeat(2, 1fr); } }
.card-gallery .post-meta { padding-top: 0; }

.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: 12.5px; letter-spacing: .02em; color: var(--muted); }
.post-meta > * { display: inline-flex; align-items: center; gap: 5px; }
.post-meta > * + *::before { content: ""; width: 3px; height: 3px; margin: 0 10px; border-radius: 50%; background: currentColor; opacity: .45; }
.post-meta .meta-cat { color: var(--brand); }
.post-meta .meta-cat:hover { color: var(--brand-ink); }
.post-meta .icon { font-size: 13px; }
.post-meta time, .post-meta span { font-variant-numeric: tabular-nums; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 36px; }
.pagination .page-numbers {
	display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px;
	border-radius: 999px; color: var(--ink-2); font-variant-numeric: tabular-nums; transition: all .2s;
}
.pagination a.page-numbers:hover { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.pagination .current { background: var(--brand); color: var(--on-brand); }
.pagination .dots { color: var(--muted); }

.load-more { margin-top: 32px; text-align: center; }
.load-more .is-loading { pointer-events: none; opacity: .7; }
.load-end { font-size: 13px; letter-spacing: .1em; color: var(--muted); }

.empty-state { padding: 64px 24px; text-align: center; background: var(--surface); border-radius: var(--radius); color: var(--ink-2); }
.empty-state > .icon { margin: 0 auto 14px; font-size: 40px; color: var(--brand); }
.empty-state .search-form { max-width: 420px; margin: 22px auto 0; }

/* ==========================================================================
   8. 侧栏与小工具
   ========================================================================== */
.sidebar { min-width: 0; }
.sidebar-inner { display: grid; gap: 20px; }
/* 只让最后一个模块（文章页为目录）吸附，避免侧栏过长时底部永远看不到。 */
@media (min-width: 992px) {
	.sidebar { align-self: stretch; }
	.sidebar-inner { height: 100%; align-content: start; }
	.sidebar-inner > :last-child { position: sticky; top: 24px; }
	.site-header.is-sticky ~ .site-main .sidebar-inner > :last-child { top: calc(var(--header-h) + 24px); }
}

.widget { padding: 22px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.widget-title {
	display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2);
	font-size: 15px; font-weight: 600; letter-spacing: .14em;
}
.widget-title::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--brand); }
.widget-empty { font-size: 14px; color: var(--muted); }
.widget .search-form { height: 42px; }
.widget .search-form button { height: 32px; padding: 0 14px; }

.w-posts { display: grid; }
.w-post + .w-post { border-top: 1px dashed var(--line); }
.w-post a { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 12px 0; }
.w-rank { font: italic 400 20px/1 var(--font-latin); color: var(--brand-faint); font-variant-numeric: lining-nums; font-synthesis: none; }
.w-post:nth-child(-n+3) .w-rank { color: var(--brand); }
.w-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.w-title { font-size: 14px; line-height: 1.6; letter-spacing: .02em; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.w-post a:hover .w-title { color: var(--brand); }
.w-meta { display: flex; align-items: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* 评论数靠右：评论图标 + 数字 */
.w-cmt { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; margin-right: 10px; padding-left: 12px; }
.w-cmt .icon { font-size: 13px; }
.w-post.is-lead a { row-gap: 12px; padding-top: 2px; }
.w-post.is-lead .w-thumb { grid-column: 1 / -1; } /* 头条：大图通栏，下面同样是「序号 + 标题」 */
.w-thumb { display: block; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.w-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.w-post a:hover img { transform: scale(1.05); }
.w-post.is-lead .w-title { font-family: var(--font-serif); font-size: 16px; font-weight: 600; line-height: 1.55; letter-spacing: .03em; }

.w-comments { display: grid; gap: 16px; }
.w-comments li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
.w-comments img { width: 32px; height: 32px; border-radius: 50%; }
.w-comments a { font-size: 14px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.w-comments span { font-size: 12px; color: var(--muted); }

.w-author { display: grid; grid-template-columns: 52px 1fr; gap: 4px 12px; align-items: center; margin-bottom: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.w-author img { width: 52px; height: 52px; border-radius: 50%; }
.w-author b { display: block; font-size: 16px; letter-spacing: .04em; }
.w-author span { font-size: 12px; color: var(--muted); }
.w-author p { grid-column: 1 / -1; margin-top: 8px; font-size: 13px; line-height: 1.75; color: var(--ink-2); }

.tag-cloud, .article-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tag-cloud { justify-content: flex-start; }
.tag-cloud a, .article-tags a {
	display: inline-flex; align-items: center; height: 30px; padding: 0 13px;
	border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; letter-spacing: .04em;
}
.tag-cloud a::before, .article-tags a::before { content: "#"; margin-right: 3px; font-family: var(--font-latin); color: var(--brand); opacity: .7; }
.tag-cloud a:hover, .article-tags a:hover { background: var(--brand-soft); color: var(--brand); }

/* 默认小工具 */
.widget_recent_entries ul { display: grid; }
.widget_recent_entries li { padding: 10px 0; font-size: 14px; line-height: 1.6; letter-spacing: .02em; }
.widget_recent_entries li + li { border-top: 1px dashed var(--line); }
.widget_recent_entries li a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.widget_recent_entries .post-date { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.widget_media_image { padding: 0; overflow: hidden; }
.widget_media_image .widget-title { margin: 22px 22px 0; }
.widget_media_image img { width: 100%; }
.widget_text { font-size: 14px; color: var(--ink-2); }

/* 文章目录 */
.toc ol { position: relative; display: grid; max-height: 62vh; overflow-y: auto; border-left: 1px solid var(--line); scrollbar-width: thin; }
.toc a {
	display: block; margin-left: -1px; padding: 6px 0 6px 14px; border-left: 2px solid transparent;
	font-size: 13.5px; line-height: 1.55; letter-spacing: .02em; color: var(--ink-2);
	transition: color .2s, border-color .2s;
}
.toc .is-sub a { padding-left: 26px; font-size: 13px; color: var(--muted); }
.toc a:hover { color: var(--brand); }
.toc a.is-active { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
@media (max-width: 991px) { .toc { display: none; } }
/* 平板：侧栏排成两列，避免一长串单列 */
@media (min-width: 640px) and (max-width: 991px) {
	.sidebar.has-many .sidebar-inner { display: block; columns: 2; column-gap: 20px; }
	.sidebar.has-many .sidebar-inner > * { display: inline-block; width: 100%; margin-bottom: 20px; break-inside: avoid; }
	.sidebar.has-many .sidebar-inner > .toc { display: none; }
}

/* ==========================================================================
   9. 文章页
   ========================================================================== */
.article { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 26px 20px 30px; }
@media (min-width: 768px) { .article { padding: 48px 64px 48px; } }
@media (min-width: 1200px) { .article { padding: 56px 80px 52px; } }

.article-header { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding-bottom: 26px; margin-bottom: 34px; border-bottom: 1px solid var(--line-2); }
/* 正文上方的篇幅提示：安静的一行小字，不抢标题 */
.article-readtime { display: flex; align-items: center; gap: 6px; margin: -10px 0 22px; font-size: 12.5px; letter-spacing: .06em; color: var(--muted); font-variant-numeric: tabular-nums; }
.article-readtime .icon { font-size: 14px; color: var(--brand-faint); }
.article-title { font-size: clamp(26px, 3.7vw, 37px); line-height: 1.42; letter-spacing: .03em; }

.article-byline { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 4px; }
.article-byline > img { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
.byline-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.byline-author { font-size: 14px; font-weight: 600; letter-spacing: .06em; color: var(--ink); }
.byline-who .post-meta { font-size: 12px; }
/* 窄屏：信息行不折行，最窄时只留日期与阅读数 */
.byline-who .post-meta { flex-wrap: nowrap; white-space: nowrap; }
@media (max-width: 400px) { .byline-who .post-meta > :nth-child(n+3) { display: none; } }
@media (max-width: 360px) { .byline-who .post-meta > :nth-child(n+2) { display: none; } }

.reader-tools { position: relative; margin-left: auto; }
.reader-toggle {
	display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
	font: 400 15px/1 var(--font-latin); color: var(--ink-2); transition: all .2s;
}
.reader-toggle:hover, .reader-toggle[aria-expanded="true"] { border-color: var(--brand); color: var(--brand); }
.reader-panel {
	position: absolute; z-index: 30; top: calc(100% + 10px); right: 0; width: 248px; padding: 16px;
	background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
	animation: fade-down .18s var(--ease);
}
.reader-label { margin: 0 0 8px; font-size: 12px; letter-spacing: .14em; color: var(--muted); }
.reader-label + .seg { margin-bottom: 14px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.seg:last-child { margin-bottom: 0; }
.seg button { height: 32px; border-radius: 8px; font-size: 13px; color: var(--ink-2); transition: all .2s; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--brand); font-weight: 600; box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.seg .is-serif { font-family: var(--font-serif-text); }

/* —— 正文排版 —— */
.entry-content {
	font-size: var(--fs-body);
	line-height: 1.92;
	letter-spacing: .025em;
	color: var(--ink);
	hanging-punctuation: allow-end;
}
html[data-font="serif"] .entry-content { font-family: var(--font-serif-text); letter-spacing: .03em; }
html[data-font="serif"] .entry-content :is(strong, b, h4, h5, h6) { font-family: var(--font-serif); }
.entry-content > * + * { margin-top: 1.05em; }
.entry-content > :first-child { margin-top: 0; }
.entry-content p, .entry-content li, .entry-content blockquote { text-wrap: pretty; }
.entry-content a {
	color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .28em;
	text-decoration-color: var(--brand-faint);
	text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent);
}
.entry-content a:hover { text-decoration-color: currentColor; }

/* 加粗：只加字重，不加底纹；标题里的加粗沿用标题本身的字体与字重 */
.entry-content strong, .entry-content b { font-weight: 600; color: var(--ink); }
.entry-content :is(h2, h3, h4, h5, h6, p.is-heading) :is(strong, b) { font: inherit; color: inherit; }
/* 斜体：只给西文（如学名 Adenium obesum）用真正的意大利体；中文不做伪斜体 */
.entry-content em, .entry-content i, .entry-content cite {
	font-style: italic; font-synthesis: none; letter-spacing: .01em;
	font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "ZYD Punct", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
html[data-font="serif"] .entry-content em,
html[data-font="serif"] .entry-content i {
	font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "ZYD Serif", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
}
.entry-content mark { background: var(--mark); color: inherit; padding: 0 .1em; }
.entry-content small { font-size: .85em; color: var(--ink-2); }

/* 导语 */
.entry-content p.is-lead {
	position: relative; padding-left: 1.2em; font-size: 1.06em; line-height: 1.95; color: var(--ink-2);
}
.entry-content p.is-lead::before { content: ""; position: absolute; left: 0; top: .5em; bottom: .5em; width: 3px; border-radius: 2px; background: var(--brand-faint); }

/*
 * 小标题分四档。文章里的标题级别并不统一（有的用 h3 当一级、有的用 h4/h5，
 * 还有 <p><strong>一、xxx</strong></p> 写法），main.js 按每篇文章实际用到的级别
 * 从高到低标记 data-rank="1~4"；下面按标签写的是没有脚本时的兜底。
 */
.entry-content :is(h1, h2, h3, h4, h5, h6, p.is-heading) { line-height: 1.5; color: var(--ink); }
.entry-content :is(h1, h2), .entry-content p.is-heading { margin-top: 2.3em; margin-bottom: -.1em; font-size: 1.3em; letter-spacing: .05em; }
.entry-content h3 { margin-top: 1.9em; font-size: 1.13em; letter-spacing: .04em; }
.entry-content h4 { margin-top: 1.7em; font-size: 1.04em; letter-spacing: .03em; }
.entry-content :is(h5, h6) { margin-top: 1.5em; font-size: 1em; font-weight: 600; letter-spacing: .02em; }
.entry-content :is(h1, h2, h3, h4, h5, h6, p)[data-rank="1"] { margin-top: 2.3em; margin-bottom: -.1em; font-size: 1.3em; letter-spacing: .05em; }
.entry-content :is(h1, h2, h3, h4, h5, h6, p)[data-rank="2"] { margin-top: 1.9em; margin-bottom: 0; font-size: 1.13em; letter-spacing: .04em; }
.entry-content :is(h1, h2, h3, h4, h5, h6, p)[data-rank="3"] { margin-top: 1.7em; margin-bottom: 0; font-size: 1.04em; letter-spacing: .03em; }
.entry-content :is(h1, h2, h3, h4, h5, h6, p)[data-rank="4"] { margin-top: 1.5em; margin-bottom: 0; font-size: 1em; letter-spacing: .02em; }
.entry-content :is(h1, h2, h3, h4, h5, h6, p)[data-rank]:not([data-rank="4"]) { font-family: var(--font-serif); font-weight: 600; font-synthesis: none; }
.entry-content :is(h1, h2, h3, h4, h5, h6, p)[data-rank="4"] { font-family: inherit; font-weight: 600; }
html[data-font="serif"] .entry-content [data-rank="4"] { font-family: var(--font-serif); }
.entry-content .h-num {
	display: inline-grid; place-items: center; min-width: 1.75em; height: 1.75em; margin-right: .55em; padding: 0 .3em;
	border-radius: 3px; font-size: .74em; line-height: 1; vertical-align: .16em; letter-spacing: 0; text-indent: 0;
	background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand-faint);
}

.entry-content ul, .entry-content ol { padding-left: 1.5em; }
.entry-content ul { list-style: none; }
.entry-content ul > li { position: relative; }
.entry-content ul > li::before { content: ""; position: absolute; left: -1em; top: .82em; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); opacity: .7; }
.entry-content ol { list-style: decimal; }
.entry-content ol > li::marker { color: var(--brand); font-family: var(--font-latin); font-style: italic; }
.entry-content li + li { margin-top: .4em; }

.entry-content figure { margin-inline: 0; }
.entry-content > figure, .entry-content > .wp-block-image { margin-top: 1.8em; margin-bottom: 1.8em; }
.entry-content img { margin-inline: auto; border-radius: 12px; cursor: zoom-in; }
.entry-content .wp-block-image, .entry-content figure.wp-caption { text-align: center; }
.entry-content .wp-block-image img { max-height: 78vh; width: auto; }
.entry-content figcaption, .entry-content .wp-caption-text {
	margin-top: 12px; font-size: 13px; line-height: 1.7; letter-spacing: .06em; color: var(--muted); text-align: center;
}
.entry-content figcaption::before, .entry-content .wp-caption-text::before {
	content: ""; display: inline-block; width: 14px; height: 1px; margin-right: 8px; vertical-align: middle; background: currentColor; opacity: .6;
}
.entry-content .aligncenter { margin-inline: auto; }
.entry-content .alignleft { float: left; margin: .3em 1.4em 1em 0; }
.entry-content .alignright { float: right; margin: .3em 0 1em 1.4em; }

.entry-content blockquote {
	position: relative; margin-inline: 0; padding: 1em 1.3em 1em 2.6em;
	background: var(--surface-2); border-radius: 12px; color: var(--ink-2);
}
.entry-content blockquote::before {
	content: "“"; position: absolute; left: .45em; top: .1em; font: 400 2.4em/1 var(--font-serif); color: var(--brand-faint);
}
.entry-content blockquote > * + * { margin-top: .6em; }
.entry-content hr { width: 64px; height: 1px; margin: 2.6em auto; border: 0; background: var(--line); }
.entry-content code { padding: .12em .42em; border-radius: 5px; background: var(--surface-2); font: .86em var(--font-mono); letter-spacing: 0; }
/* 预排版：保持原样不折行（字符画、示意图靠空格对齐），放不下时左右滑动 */
.entry-content pre { padding: 16px 20px; border-radius: 12px; background: var(--surface-2); overflow-x: auto; white-space: pre; font: 14px/1.7 var(--font-mono); letter-spacing: 0; tab-size: 4; }
.entry-content pre code { padding: 0; background: none; font-size: inherit; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
/* 表格：表头可换行；每列至少约 4 个字宽，放不下时整表左右滑动 */
.entry-content table { width: 100%; table-layout: auto; border-collapse: collapse; font-size: .9em; line-height: 1.7; }
.entry-content th, .entry-content td { min-width: 4.6em; padding: 10px 14px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.entry-content th { background: var(--surface-2); font-weight: 600; letter-spacing: .04em; }
.entry-content tbody th { background: none; }
.entry-content table > :last-child > tr:last-child > * { border-bottom: 0; }
.entry-content tfoot td { background: var(--surface-2); font-weight: 600; }
.entry-content .is-style-stripes tbody tr:nth-child(even) > * { background: var(--surface-2); }
/* WordPress 会内联表格区块自带样式（等宽列、黑色粗边框），这里用更高优先级覆盖 */
.entry-content .wp-block-table { margin-inline: 0; overflow: visible; }
.entry-content .wp-block-table table.has-fixed-layout { table-layout: auto; }
.entry-content .wp-block-table :is(thead, tfoot) { border: 0; }
.entry-content .wp-block-table :is(th, td) { border: 0; border-bottom: 1px solid var(--line-2); padding: 10px 14px; word-break: normal; }
.entry-content .wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: none; }
.entry-content .wp-block-table figcaption { margin-top: 10px; }
@media (max-width: 639px) { .entry-content th, .entry-content td, .entry-content .wp-block-table :is(th, td) { padding: 8px 10px; } }
.entry-content iframe, .entry-content video { max-width: 100%; border-radius: 12px; }

/* —— 正文：其余编辑器元素（区块样式已整体移除，这里按本主题风格补齐） —— */
.entry-content::after { content: ""; display: table; clear: both; }
.entry-content :is(h1, h2, h3, hr, .wp-block-gallery, .wp-block-columns, .wp-block-table) { clear: both; }

/* 行内格式 */
.entry-content :is(sub, sup) { position: relative; font-size: .72em; line-height: 0; vertical-align: baseline; letter-spacing: 0; }
.entry-content sup { top: -.5em; }
.entry-content sub { bottom: -.25em; }
.entry-content :is(del, s) { color: var(--muted); text-decoration-thickness: 1px; }
.entry-content :is(ins, u) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .28em; text-decoration-color: var(--brand); }
.entry-content kbd {
	display: inline-block; padding: .05em .45em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
	background: var(--surface); font: .82em/1.5 var(--font-mono); letter-spacing: 0;
}
.entry-content abbr[title] { text-decoration: underline dotted; text-underline-offset: .28em; cursor: help; }
.entry-content q { font-style: normal; }

/* 嵌套列表 */
.entry-content li > :is(ul, ol) { margin-top: .4em; }
.entry-content ul ul > li::before { background: none; border: 1px solid var(--brand); }
.entry-content ol ol { list-style: lower-alpha; }

/* 定义列表 */
.entry-content dt { font-weight: 600; }
.entry-content dd { margin: .2em 0 0 1.5em; color: var(--ink-2); }
.entry-content dd + dt { margin-top: .8em; }

/* 折叠详情 */
.entry-content details { padding: .75em 1.1em; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.entry-content summary { display: flex; align-items: center; gap: .6em; font-weight: 600; cursor: pointer; list-style: none; }
.entry-content summary::-webkit-details-marker { display: none; }
.entry-content summary::before {
	content: ""; flex: none; width: .45em; height: .45em; margin-left: .1em; border: solid var(--brand); border-width: 0 1.5px 1.5px 0;
	transform: rotate(-45deg); transition: transform .2s var(--ease);
}
.entry-content details[open] > summary { margin-bottom: .6em; }
.entry-content details[open] > summary::before { transform: rotate(45deg); }
.entry-content details > :not(summary) + * { margin-top: .8em; }

/* 引用出处 */
.entry-content blockquote :is(cite, footer) { display: block; margin-top: .6em; font-size: .86em; font-weight: 400; line-height: 1.6; font-style: normal; letter-spacing: .04em; color: var(--muted); }
.entry-content blockquote :is(cite, footer)::before { content: "—— "; }
.entry-content blockquote.has-text-align-center { padding-inline: 1.3em; }

/* 醒目引用 */
.entry-content .wp-block-pullquote { margin: 2.2em 0; padding: 1.6em 1em; border-block: 1px solid var(--line); text-align: center; }
.entry-content .wp-block-pullquote blockquote { padding: 0; background: none; color: var(--ink); }
.entry-content .wp-block-pullquote blockquote::before { content: none; }
.entry-content .wp-block-pullquote p { font: 600 1.22em/1.7 var(--font-serif); letter-spacing: .06em; }

/* 诗歌 */
.entry-content pre.wp-block-verse {
	padding: .2em 0 .2em 1.2em; border-left: 3px solid var(--brand-faint); border-radius: 0; background: none;
	white-space: pre-wrap; font: inherit; line-height: 2; letter-spacing: .06em; overflow: visible;
}

/* 按钮 */
.entry-content .wp-block-buttons { display: flex; flex-wrap: wrap; gap: .6em; }
.entry-content .wp-block-buttons.is-content-justification-center { justify-content: center; }
.entry-content .wp-block-buttons.is-content-justification-right { justify-content: flex-end; }
.entry-content .wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: .5em 1.4em; border-radius: 999px;
	background: var(--brand); color: var(--on-brand); font-size: .92em; letter-spacing: .08em; text-decoration: none; transition: background .2s;
}
.entry-content .wp-block-button__link:hover { background: var(--brand-ink); color: var(--on-brand); }
.entry-content .is-style-outline .wp-block-button__link { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1px currentColor; }
.entry-content .is-style-outline .wp-block-button__link:hover { background: var(--brand-soft); color: var(--brand); }

/* 多栏、图文 */
.entry-content .wp-block-columns { display: flex; flex-wrap: wrap; gap: 1.2em 2em; }
.entry-content .wp-block-column { flex: 1 1 0; min-width: 0; }
.entry-content .wp-block-column > * + * { margin-top: 1.05em; }
.entry-content .wp-block-media-text { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2em 2em; align-items: center; }
.entry-content .wp-block-media-text.has-media-on-the-right .wp-block-media-text__media { order: 2; }
.entry-content .wp-block-media-text__media img { width: 100%; }
.entry-content .wp-block-media-text__content > * + * { margin-top: 1em; }
@media (max-width: 639px) {
	.entry-content .wp-block-column { flex-basis: 100% !important; }
	.entry-content .wp-block-media-text { grid-template-columns: 1fr; }
	.entry-content .wp-block-media-text.has-media-on-the-right .wp-block-media-text__media { order: 0; }
}

/* 画廊：电脑 3 列（可按编辑器的栏数）、手机 2 列；单张图按普通图片显示 */
.entry-content .wp-block-gallery.has-nested-images { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.entry-content .wp-block-gallery.has-nested-images > figure.wp-block-image { flex: 1 1 calc(33.333% - 8px); max-width: 100%; margin: 0; }
.entry-content .wp-block-gallery.columns-1 > figure.wp-block-image, .entry-content .wp-block-gallery > figure.wp-block-image:only-of-type { flex-basis: 100%; }
.entry-content .wp-block-gallery.columns-2 > figure.wp-block-image { flex-basis: calc(50% - 8px); }
.entry-content .wp-block-gallery.columns-4 > figure.wp-block-image { flex-basis: calc(25% - 8px); }
.entry-content .wp-block-gallery:is(.columns-5, .columns-6, .columns-7, .columns-8) > figure.wp-block-image { flex-basis: calc(20% - 8px); }
.entry-content .wp-block-gallery > figure.wp-block-image:not(:only-of-type) img { width: 100%; max-height: none; border-radius: 8px; }
.entry-content .wp-block-gallery.is-cropped > figure.wp-block-image:not(:only-of-type) img { aspect-ratio: 4 / 3; height: auto; object-fit: cover; }
.entry-content .wp-block-gallery > figure.wp-block-image:not(:only-of-type) figcaption { margin-top: 6px; font-size: 12px; }
.entry-content .wp-block-gallery > figure.wp-block-image:not(:only-of-type) figcaption::before { content: none; }
.entry-content .wp-block-gallery > .blocks-gallery-caption { flex-basis: 100%; }
@media (max-width: 639px) {
	.entry-content .wp-block-gallery.has-nested-images:not(.columns-1) > figure.wp-block-image:not(:only-of-type) { flex-basis: calc(50% - 8px); }
}

/* 图片变体 */
.entry-content .is-style-rounded img { border-radius: 50%; }
.entry-content :is(.alignwide, .alignfull) { margin-inline: auto; max-width: 100%; }

/* 视频、音频、嵌入：常见视频站按 16:9 自适应 */
.entry-content video { width: 100%; height: auto; }
.entry-content audio { display: block; width: 100%; }
.entry-content .wp-block-embed { margin-inline: 0; }
.entry-content .wp-block-embed__wrapper { position: relative; }
.entry-content :is(.wp-embed-aspect-16-9, .wp-embed-aspect-4-3, .wp-embed-aspect-21-9) iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; }
.entry-content .wp-embed-aspect-4-3 iframe { aspect-ratio: 4 / 3; }
.entry-content .wp-embed-aspect-21-9 iframe { aspect-ratio: 21 / 9; }
.entry-content iframe:is([src*="bilibili.com"], [src*="v.qq.com"], [src*="youku.com"], [src*="ixigua.com"], [src*="youtube"], [src*="vimeo.com"]) {
	width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0;
}

/* 文件下载 */
.entry-content .wp-block-file {
	display: flex; flex-wrap: wrap; align-items: center; gap: .6em 1em; padding: .8em 1.1em;
	border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.entry-content .wp-block-file > a:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.entry-content .wp-block-file__button {
	flex: none; padding: .3em 1.1em; border-radius: 999px; background: var(--brand); color: var(--on-brand);
	font-size: .85em; letter-spacing: .06em; text-decoration: none;
}
.entry-content .wp-block-file__button:hover { background: var(--brand-ink); color: var(--on-brand); }
.entry-content .wp-block-file__embed { display: none; }

/* 脚注 */
.entry-content sup.fn a, .entry-content sup a[href^="#"] { text-decoration: none; padding: 0 .1em; }
.entry-content .wp-block-footnotes { margin-top: 2.4em; padding: 1em 0 0 1.4em; border-top: 1px solid var(--line); font-size: .88em; color: var(--ink-2); }
.entry-content .wp-block-footnotes li + li { margin-top: .3em; }

/* 分隔线变体、间距块 */
.entry-content hr.is-style-wide { width: 100%; }
.entry-content hr.is-style-dots { width: auto; height: auto; background: none; text-align: center; line-height: 1; }
.entry-content hr.is-style-dots::before { content: "···"; padding-left: 1em; letter-spacing: 1em; color: var(--brand-faint); font-size: 1.2em; }
.entry-content .wp-block-spacer { margin-top: 0; }
.entry-content .wp-block-spacer + * { margin-top: 0; }

/* 封面 */
.entry-content .wp-block-cover {
	position: relative; display: flex; align-items: center; justify-content: center; min-height: 300px; padding: 2em 1.4em;
	border-radius: 12px; overflow: hidden; color: #fff; text-align: center;
}
.entry-content :is(.wp-block-cover__image-background, .wp-block-cover__video-background) {
	position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; object-fit: cover; border-radius: 0; cursor: default;
}
.entry-content .wp-block-cover__background { position: absolute; inset: 0; background: #000; opacity: .45; }
.entry-content .wp-block-cover__inner-container { position: relative; z-index: 1; width: 100%; }
.entry-content .wp-block-cover__inner-container :is(h1, h2, h3, h4, p) { color: inherit; }

/* 对齐、首字下沉 */
.entry-content .has-text-align-left { text-align: left; }
.entry-content .has-text-align-center { text-align: center; }
.entry-content .has-text-align-right { text-align: right; }
.entry-content .has-text-align-justify { text-align: justify; }
.entry-content .has-drop-cap:not(:focus)::first-letter {
	float: left; margin: .08em .14em 0 0; font: 600 3.1em/.9 var(--font-serif); color: var(--brand);
}

/* 编辑器里的字号预设、文字颜色和背景色由 WordPress 全局样式提供，这里只处理链接颜色 */
.entry-content :is(p, h1, h2, h3, h4, h5, h6).has-background { padding: .9em 1.2em; border-radius: 10px; }
.entry-content .has-text-color a { color: inherit; }
.page-links { display: flex; gap: 8px; }

/* 文末记号 */
.article-end { display: flex; align-items: center; gap: 16px; margin: 44px 0 0; color: var(--brand-faint); }
.article-end::before, .article-end::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line)); }
.article-end::after { background: linear-gradient(90deg, var(--line), transparent); }
.article-end span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); font-size: 15px; color: var(--brand); }

.article-footer { display: flex; flex-direction: column; align-items: center; gap: 22px; margin-top: 30px; }
.article-actions { display: flex; align-items: center; justify-content: center; gap: 12px; }
.like-btn {
	display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 24px;
	border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); font-size: 15px; letter-spacing: .08em;
	transition: all .25s var(--ease);
}
.like-btn .icon { font-size: 18px; transition: transform .35s var(--ease); }
.like-btn b { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.like-btn:hover { border-color: var(--brand); color: var(--brand); }
.like-btn.is-done { background: var(--brand-soft); border-color: var(--brand-faint); color: var(--brand); }
.like-btn.is-done .icon { fill: currentColor; transform: scale(1.12); }
/* 窄屏：互动按钮文字不折行 */
.like-btn, .ghost-link, .share-btn { white-space: nowrap; }
@media (max-width: 400px) {
	.like-btn { padding: 0 16px; gap: 6px; }
	.ghost-link { padding: 0 10px; }
	.article-actions { gap: 6px; }
}
.ghost-link { display: inline-flex; align-items: center; gap: 6px; height: 46px; padding: 0 18px; color: var(--ink-2); font-size: 15px; letter-spacing: .08em; }

.post-nav { display: grid; gap: 14px; margin-top: 22px; }
@media (min-width: 640px) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav-item {
	display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px;
	background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
	transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.post-nav-item:hover { color: inherit; box-shadow: var(--shadow); transform: translateY(-2px); }
.post-nav-item .thumb { aspect-ratio: 4 / 3; border-radius: 8px; }
.post-nav-item small { display: block; margin-bottom: 3px; font-size: 12px; letter-spacing: .14em; color: var(--muted); }
.post-nav-item b { font-size: 15px; line-height: 1.55; letter-spacing: .02em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-nav-item:hover b { color: var(--brand); }
.post-nav-item.is-next { grid-template-columns: minmax(0, 1fr) 76px; text-align: right; }
.post-nav-item.is-next .thumb { order: 2; }
.post-nav-item.is-empty { background: none; box-shadow: none; }
@media (max-width: 639px) { .post-nav-item.is-empty { display: none; } }

.related { margin-top: 44px; }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
@media (min-width: 768px) { .related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 20px; } }
.related-item { display: flex; flex-direction: column; gap: 12px; }
.related-item .thumb { aspect-ratio: 20 / 13; border-radius: 12px; }
.related-item:hover img { transform: scale(1.045); }
.related-title { font-size: 15.5px; line-height: 1.6; letter-spacing: .03em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ==========================================================================
   10. 评论
   ========================================================================== */
.comments { margin-top: 44px; padding: 26px 20px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
@media (min-width: 768px) { .comments { padding: 36px 44px; } }
.comment-respond { margin-bottom: 8px; }
.comment-list .comment-respond { margin: 16px 0 8px; padding: 16px; border-radius: 12px; background: var(--surface-2); }
.comment-reply-title { display: flex; justify-content: space-between; align-items: center; font-size: 15px; margin-bottom: 10px; letter-spacing: .04em; }
.comment-respond > .comment-reply-title { display: none; }
.comment-list .comment-respond > .comment-reply-title { display: flex; gap: 12px; color: var(--ink-2); font-weight: 600; }
.comment-reply-title small a { font-size: 13px; font-weight: 400; color: var(--muted); }
.comment-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.comment-form > p { margin: 0; }
.comment-form-comment, .form-submit, .comment-form-cookies-consent, .comment-form .logged-in-as { grid-column: 1 / -1; }
@media (max-width: 639px) { .comment-form-author, .comment-form-email, .comment-form-url { grid-column: 1 / -1; } }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 11px 15px; border: 1px solid var(--line); border-radius: 12px;
	background: var(--surface); font-size: 15px; letter-spacing: .02em; outline: 0; transition: border-color .2s, box-shadow .2s;
}
.comment-form ::placeholder { color: var(--muted); }
.comment-form textarea { min-height: 116px; resize: vertical; line-height: 1.8; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.comment-form-cookies-consent { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.comment-form-cookies-consent input { flex: none; width: 18px; height: 18px; accent-color: var(--brand); }
.form-submit { display: flex; justify-content: flex-end; }
.form-submit .btn { border: 0; cursor: pointer; }
.form-submit .btn:disabled { opacity: .6; cursor: progress; }

.comment-list { margin-top: 24px; }
.comment-list > li + li { border-top: 1px solid var(--line-2); }
.comment-list .children { margin-left: 52px; border-left: 2px solid var(--line-2); padding-left: 16px; }
@media (max-width: 639px) { .comment-list .children { margin-left: 12px; padding-left: 12px; } }
.comment-body { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 20px 0; }
.comment-avatar img { width: 40px; height: 40px; border-radius: 50%; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.comment-author { font-size: 14px; font-weight: 600; letter-spacing: .04em; }
.comment-head time { font-size: 12px; color: var(--muted); }
.badge { padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 11px; letter-spacing: .08em; }
.comment-content { margin-top: 6px; font-size: 15px; line-height: 1.85; letter-spacing: .02em; color: var(--ink-2); overflow-wrap: anywhere; }
.comment-content p + p { margin-top: .6em; }
.comment-at { color: var(--brand); margin-right: 2px; }
.comment-pending { margin-top: 6px; font-size: 12px; color: var(--accent); }
.comment-actions { margin-top: 6px; }
.comment-reply-link { font-size: 13px; color: var(--muted); letter-spacing: .06em; }
.comment-reply-link:hover { color: var(--brand); }
.comment-list li.is-new > .comment-body { animation: flash 1.6s var(--ease); }
.comments-empty, .comments-closed { padding: 22px 0 4px; font-size: 14px; letter-spacing: .06em; color: var(--muted); text-align: center; }
.comments .nav-links { display: flex; justify-content: center; gap: 8px; margin-top: 12px; font-size: 14px; }

/* ==========================================================================
   11. 页脚、友情链接、杂项
   ========================================================================== */
.friend-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; padding-bottom: 48px; font-size: 13px; color: var(--muted); }
.friend-links h2 { font-size: 13px; font-weight: 600; letter-spacing: .14em; color: var(--ink-2); }
.friend-links > span { opacity: .4; }
.friend-links div { display: flex; flex-wrap: wrap; gap: 6px 18px; }

.site-footer {
	position: relative; overflow: hidden; margin-top: auto; padding: 48px 0 max(28px, env(safe-area-inset-bottom));
	background: var(--surface); border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted);
}
.site-footer::before {
	/* 角落里一枚很淡的叶形，作为页脚的落款 */
	content: ""; position: absolute; right: -40px; bottom: -60px; width: 260px; height: 260px; opacity: .06; pointer-events: none;
	background: var(--brand);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.2' stroke-linecap='round'%3E%3Cpath d='M12 2.6v2.1M10.4 4.7h3.2'/%3E%3Cpath d='M12 4.7c-1.8 0-3 1.2-3 2.9 0 1.1.5 1.9 1.4 2.5C7.8 11 6.2 13.2 6.2 15.8a5.8 5.8 0 0 0 11.6 0c0-2.6-1.6-4.8-4.2-5.7.9-.6 1.4-1.4 1.4-2.5 0-1.7-1.2-2.9-3-2.9Z'/%3E%3Cpath d='M10 10.4h4'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.2' stroke-linecap='round'%3E%3Cpath d='M12 2.6v2.1M10.4 4.7h3.2'/%3E%3Cpath d='M12 4.7c-1.8 0-3 1.2-3 2.9 0 1.1.5 1.9 1.4 2.5C7.8 11 6.2 13.2 6.2 15.8a5.8 5.8 0 0 0 11.6 0c0-2.6-1.6-4.8-4.2-5.7.9-.6 1.4-1.4 1.4-2.5 0-1.7-1.2-2.9-3-2.9Z'/%3E%3Cpath d='M10 10.4h4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.footer-top { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line-2); }
.footer-brand { max-width: 440px; }
.footer-brand p { margin-top: 14px; line-height: 1.9; letter-spacing: .03em; }
.footer-nav .menu { display: flex; flex-wrap: wrap; gap: 0 26px; }
.footer-nav a { display: inline-block; padding: 7px 0; color: var(--ink-2); font-size: 14px; letter-spacing: .08em; }
.footer-bottom { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-top: 22px; letter-spacing: .02em; }
@media (max-width: 1360px) { .footer-bottom { padding-right: 56px; } }
.beian { display: flex; flex-wrap: wrap; gap: 0 20px; }
.beian a { display: inline-flex; align-items: center; gap: 5px; padding: 5px 0; }
.beian img { width: 14px; height: auto; }

.to-top {
	position: fixed; z-index: 40; right: 20px; bottom: max(24px, env(safe-area-inset-bottom));
	display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
	background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-lg), 0 0 0 1px var(--line-2); font-size: 18px;
	opacity: 0; visibility: hidden; transform: translateY(8px); transition: all .25s var(--ease);
}
.to-top.is-show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--brand); }

.toast {
	position: fixed; z-index: 300; left: 50%; bottom: 40px; max-width: calc(100% - 32px);
	padding: 11px 22px; border-radius: 999px; background: var(--ink); color: var(--bg);
	font-size: 14px; letter-spacing: .04em; box-shadow: var(--shadow-lg);
	opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: all .25s var(--ease);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

.lightbox {
	position: fixed; z-index: 200; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
	padding: 24px; background: rgba(20, 14, 10, .94); cursor: zoom-out; opacity: 0; transition: opacity .2s var(--ease);
}
.lightbox.is-open { opacity: 1; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 100px); width: auto; border-radius: 6px; object-fit: contain; }
.lightbox p { color: rgba(255, 255, 255, .78); font-size: 14px; letter-spacing: .08em; }

.not-found { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 88px var(--gutter) 104px; text-align: center; }
.not-found-mark { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 24px; background: var(--brand-soft); color: var(--brand); font-size: 36px; }
.not-found-code { font: italic 400 15px var(--font-latin); letter-spacing: .4em; color: var(--muted); }
.not-found h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: .1em; }
.not-found > p:not(.not-found-code) { color: var(--ink-2); letter-spacing: .04em; }
.not-found .search-form { width: 100%; max-width: 440px; margin: 10px 0; }

/* ==========================================================================
   12. 第四轮：分享、关于页、分类页头部、空内容
   ========================================================================== */

/* 编辑器残留的空段落不占位 */
.entry-content p:empty { display: none; }

/* —— 文章分享 —— */
.article-share { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; }
.share-label { font-size: 12px; letter-spacing: .2em; color: var(--muted); margin-right: 2px; }
.share-btn {
	display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
	border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; letter-spacing: .06em;
	transition: background .2s, color .2s;
}
.share-btn .icon { font-size: 15px; }
.share-btn:hover, .share-btn[aria-expanded="true"] { background: var(--brand-soft); color: var(--brand); }
.share-wechat { position: relative; }
.wechat-pop {
	position: absolute; z-index: 30; bottom: calc(100% + 12px); left: 50%; width: 196px; margin-left: -98px; padding: 16px 16px 12px;
	text-align: center;
	background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
	animation: fade-down .18s var(--ease);
}
.wechat-pop::after {
	content: ""; position: absolute; top: 100%; left: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px;
	background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg);
}
/* 窄屏：弹层与按钮右对齐，箭头仍指向按钮 */
@media (max-width: 480px) {
	.wechat-pop { left: auto; right: 0; margin-left: 0; }
	.wechat-pop::after { left: auto; right: 28px; margin-left: 0; }
}
.wechat-qr { width: 156px; height: 156px; margin: 0 auto 10px; padding: 8px; background: #fff; border-radius: 8px; }
.wechat-qr:empty { background: var(--surface-2); }
.wechat-qr svg { display: block; width: 100%; height: 100%; }
.wechat-qr svg path, .wechat-qr svg rect[fill="black"] { fill: #231e19; }
.wechat-pop p { font-size: 12px; line-height: 1.6; letter-spacing: .04em; color: var(--ink-2); }

/* —— 关于页 —— */
.about { max-width: 820px; padding-top: 40px; padding-bottom: 64px; }
.about-card { position: relative; overflow: hidden; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 40px 22px 32px; }
@media (min-width: 768px) { .about-card { padding: 64px 72px 52px; } }
.about-card::before {
	content: ""; position: absolute; top: -80px; right: -60px; width: 300px; height: 300px; opacity: .07; pointer-events: none;
	background: var(--brand);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.2' stroke-linecap='round'%3E%3Cpath d='M12 2.6v2.1M10.4 4.7h3.2'/%3E%3Cpath d='M12 4.7c-1.8 0-3 1.2-3 2.9 0 1.1.5 1.9 1.4 2.5C7.8 11 6.2 13.2 6.2 15.8a5.8 5.8 0 0 0 11.6 0c0-2.6-1.6-4.8-4.2-5.7.9-.6 1.4-1.4 1.4-2.5 0-1.7-1.2-2.9-3-2.9Z'/%3E%3Cpath d='M10 10.4h4'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.2' stroke-linecap='round'%3E%3Cpath d='M12 2.6v2.1M10.4 4.7h3.2'/%3E%3Cpath d='M12 4.7c-1.8 0-3 1.2-3 2.9 0 1.1.5 1.9 1.4 2.5C7.8 11 6.2 13.2 6.2 15.8a5.8 5.8 0 0 0 11.6 0c0-2.6-1.6-4.8-4.2-5.7.9-.6 1.4-1.4 1.4-2.5 0-1.7-1.2-2.9-3-2.9Z'/%3E%3Cpath d='M10 10.4h4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.about-hero { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding-bottom: 32px; margin-bottom: 32px; border-bottom: 1px solid var(--line-2); }
.about-mark {
	display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; font-size: 32px; color: #fff;
	background: var(--grain), linear-gradient(150deg, #b0473a, #9b3b2a 55%, #842f22); border-radius: 8px;
	box-shadow: inset 0 0 0 4px #9b3b2a, inset 0 0 0 5px rgba(255, 246, 236, .55), 0 12px 26px -12px rgba(130, 40, 25, .7);
}
.about-kicker { margin-top: 20px; font: italic 400 15px var(--font-latin); letter-spacing: .04em; color: var(--brand); font-synthesis: none; }
.about-title { margin-top: 6px; font-family: var(--font-serif); font-weight: 600; font-size: clamp(28px, 4.4vw, 40px); letter-spacing: .12em; margin-right: -.12em; }
.about-tagline { max-width: 30em; margin-top: 14px; font-size: 15px; line-height: 1.9; letter-spacing: .04em; color: var(--ink-2); }
.about-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 28px 0 0; }
.about-stats > div { min-width: 120px; padding: 14px 20px; border-radius: 12px; background: var(--surface-2); }
.about-stats dt { font-size: 12px; letter-spacing: .14em; color: var(--muted); }
.about-stats dd { margin: 4px 0 0; font: 400 30px/1.1 var(--font-latin); color: var(--ink); font-variant-numeric: lining-nums; }
/* 手机：三个数字等宽排成一行，避免宽窄不一地各占一行 */
@media (max-width: 479px) {
	.about-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
	.about-stats > div { min-width: 0; padding: 12px 4px; }
	.about-stats dt { font-size: 11.5px; letter-spacing: .04em; }
	.about-stats dd { font-size: 20px; white-space: nowrap; }
	.about-stats dd small { margin-left: 2px; font-size: 11px; }
}
.about-stats dd small { margin-left: 4px; font: 400 13px var(--font-sans); color: var(--muted); }
.about-content { max-width: 36em; margin: 0 auto; text-align: center; }
.about-cats { margin-top: 44px; }
.about-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.about-cat {
	position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 44px 18px 20px;
	background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.about-cat:hover { color: inherit; box-shadow: var(--shadow); transform: translateY(-2px); }
.about-cat-name { font-family: var(--font-serif); font-weight: 600; font-size: 18px; letter-spacing: .08em; }
.about-cat:hover .about-cat-name { color: var(--brand); }
.about-cat-count { font-size: 12px; color: var(--muted); }
.about-cat-desc { margin-top: 4px; font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.about-cat-arrow { position: absolute; top: 50%; right: 18px; margin-top: -.5em; color: var(--brand-faint); transition: transform .3s var(--ease), color .3s; }
.about-cat:hover .about-cat-arrow { color: var(--brand); transform: translateX(3px); }

/* —— 分类 / 标签页头部 —— */
.page-hero.is-term .term-band {
	position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px;
	padding: 26px 22px; border-radius: var(--radius);
	background: linear-gradient(120deg, var(--brand-soft), var(--surface) 70%);
	box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line-2);
}
@media (min-width: 768px) { .page-hero.is-term .term-band { padding: 36px 40px; } }
.page-hero.is-term .term-band::before {
	content: ""; position: absolute; left: -50px; bottom: -70px; width: 220px; height: 220px; opacity: .06; pointer-events: none;
	background: var(--brand);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.2' stroke-linecap='round'%3E%3Cpath d='M12 2.6v2.1M10.4 4.7h3.2'/%3E%3Cpath d='M12 4.7c-1.8 0-3 1.2-3 2.9 0 1.1.5 1.9 1.4 2.5C7.8 11 6.2 13.2 6.2 15.8a5.8 5.8 0 0 0 11.6 0c0-2.6-1.6-4.8-4.2-5.7.9-.6 1.4-1.4 1.4-2.5 0-1.7-1.2-2.9-3-2.9Z'/%3E%3Cpath d='M10 10.4h4'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.2' stroke-linecap='round'%3E%3Cpath d='M12 2.6v2.1M10.4 4.7h3.2'/%3E%3Cpath d='M12 4.7c-1.8 0-3 1.2-3 2.9 0 1.1.5 1.9 1.4 2.5C7.8 11 6.2 13.2 6.2 15.8a5.8 5.8 0 0 0 11.6 0c0-2.6-1.6-4.8-4.2-5.7.9-.6 1.4-1.4 1.4-2.5 0-1.7-1.2-2.9-3-2.9Z'/%3E%3Cpath d='M10 10.4h4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.term-text { position: relative; min-width: 0; }
.term-collage { position: relative; flex: none; display: none; width: 236px; height: 150px; }
@media (min-width: 768px) { .term-collage { display: block; } }
.term-collage .thumb {
	position: absolute; top: 10px; width: 108px; height: 132px; border-radius: 12px;
	box-shadow: 0 0 0 4px var(--surface), var(--shadow);
	transition: transform .4s var(--ease);
}
.term-collage .thumb:nth-child(1) { left: 0; transform: rotate(-6deg); z-index: 1; }
.term-collage .thumb:nth-child(2) { left: 64px; top: 0; transform: rotate(1deg); z-index: 3; }
.term-collage .thumb:nth-child(3) { left: 128px; transform: rotate(7deg); z-index: 2; }
.term-band:hover .term-collage .thumb:nth-child(1) { transform: rotate(-9deg) translateX(-6px); }
.term-band:hover .term-collage .thumb:nth-child(3) { transform: rotate(10deg) translateX(6px); }

@keyframes fade-down { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes flash { 0% { background: var(--brand-soft); } 100% { background: transparent; } }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
	.site-header, .site-footer, .sidebar, .post-nav, .related, .comments, .article-actions, .to-top, .breadcrumb, .reader-tools, .read-progress { display: none !important; }
	body { background: #fff; }
	.layout { display: block; padding: 0; }
	.article { box-shadow: none; padding: 0; }
}

/* ==========================================================================
   公众号页（page-wechat.php）
   ========================================================================== */
.wechat .wechat-hero { margin-bottom: 36px; }
.wechat-scan { display: grid; gap: 28px; justify-items: center; }
@media (min-width: 720px) {
	.wechat-scan { grid-template-columns: 280px minmax(0, 1fr); gap: 52px; align-items: center; justify-items: stretch; max-width: 640px; margin-inline: auto; }
}

/* 二维码：深色模式下也保持白底，保证能扫出来 */
.wechat-code { margin: 0; text-align: center; }
.wechat-code-frame {
	position: relative; width: 240px; max-width: 100%; margin: 0 auto; padding: 14px; border-radius: 22px; background: #fff;
	box-shadow: 0 0 0 1px var(--line), 0 18px 40px -22px rgba(130, 40, 25, .45);
}
@media (min-width: 720px) { .wechat-code-frame { width: 280px; } }
.wechat-code-frame::before, .wechat-code-frame::after {
	content: ""; position: absolute; width: 26px; height: 26px; border: 2.5px solid var(--brand); pointer-events: none;
}
.wechat-code-frame::before { top: -7px; left: -7px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.wechat-code-frame::after { right: -7px; bottom: -7px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.wechat-code-frame img { display: block; width: 100%; height: auto; border-radius: 10px; -webkit-touch-callout: default; }
.wechat-code-line {
	position: absolute; left: 22px; right: 22px; top: 22px; height: 2px; border-radius: 2px; pointer-events: none; opacity: .55;
	background: linear-gradient(90deg, transparent, #9b3b2a, transparent);
	animation: wechat-scan 3.2s var(--ease) infinite;
}
@keyframes wechat-scan { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: .55; } 88% { opacity: .55; } 100% { transform: translateY(var(--scan-h, 230px)); opacity: 0; } }
@media (min-width: 720px) { .wechat-code-line { --scan-h: 270px; } }
@media (max-width: 719px) { .wechat-code-line { --scan-h: 196px; } }
@media (prefers-reduced-motion: reduce) { .wechat-code-line { display: none; } }
.wechat-code figcaption { margin-top: 18px; font-size: 14px; letter-spacing: .12em; color: var(--brand); font-weight: 600; }

/* 按设备显示对应的说明（main.js 根据浏览器设置 data-ua） */
.wechat-scan .for-mobile, .wechat-scan .for-wechat { display: none; }
.wechat-scan[data-ua="mobile"] .for-desktop, .wechat-scan[data-ua="wechat"] .for-desktop { display: none; }
.wechat-scan[data-ua="mobile"] .for-mobile, .wechat-scan[data-ua="wechat"] .for-wechat { display: revert; }
.wechat-scan[data-ua="wechat"] .wechat-save { display: none; }

.wechat-steps { width: 100%; max-width: 360px; }
.wechat-steps h2 { font: 600 17px/1.4 var(--font-serif); letter-spacing: .14em; text-align: center; }
@media (min-width: 720px) { .wechat-steps h2 { text-align: left; } }
.wechat-steps ol { counter-reset: step; display: grid; gap: 4px; margin-top: 16px; }
.wechat-steps li { position: relative; counter-increment: step; display: grid; gap: 2px; padding: 10px 0 10px 44px; }
.wechat-steps li::before {
	content: counter(step); position: absolute; left: 0; top: 10px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
	background: var(--brand-soft); color: var(--brand); font: italic 400 15px/1 var(--font-latin); font-variant-numeric: lining-nums;
}
.wechat-steps li + li::after { content: ""; position: absolute; left: 13.5px; top: -14px; height: 20px; width: 1px; background: var(--brand-faint); opacity: .7; }
.wechat-steps li b { font-weight: 600; font-size: 15px; letter-spacing: .04em; }
.wechat-steps li span { font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.wechat-save { width: 100%; margin-top: 16px; }

/* 正文：小标题居中，列表排成三张卡片 */
.wechat-content { max-width: 680px; margin: 44px auto 0; padding-top: 36px; border-top: 1px solid var(--line-2); }
.wechat-content :is(h2, h3)[data-rank], .wechat-content > :is(h2, h3) { margin-top: 0; margin-bottom: 0; text-align: center; font-size: 1.15em; letter-spacing: .12em; }
.wechat-content > ul { display: grid; gap: 12px; margin-top: 22px; padding: 0; }
@media (min-width: 720px) { .wechat-content > ul { grid-template-columns: repeat(3, 1fr); } }
.wechat-content > ul > li { margin: 0; padding: 18px 18px 16px; border-radius: 14px; background: var(--surface-2); font-size: 14px; line-height: 1.8; color: var(--ink-2); }
.wechat-content > ul > li::before { display: none; }
.wechat-content > ul > li strong { display: block; margin-bottom: 6px; font: 600 16px/1.5 var(--font-serif); letter-spacing: .06em; color: var(--ink); }
.wechat-content > ul > li strong::before { content: ""; display: block; width: 18px; height: 2px; margin-bottom: 12px; border-radius: 2px; background: var(--brand); }
.wechat-content > p:last-child { margin-top: 30px; text-align: center; font-family: var(--font-serif-text); letter-spacing: .1em; color: var(--muted); }
.wechat-content > p.is-lead { padding-left: 0; text-align: center; }
.wechat-content > p.is-lead::before { display: none; }

/* ==========================================================================
   中医之道：视觉与典籍组件
   --------------------------------------------------------------------------
   · 宣纸底 + 松烟墨字 + 朱砂印；圆角收小，按钮与输入框取方整的书卷感。
   · 经文原文用楷体（系统自带，不额外下载），注释小字，宜忌提示框，方笺式配方。
   ========================================================================== */

/* 方整的按钮、输入框与标签 */
.btn, .btn-ghost, .share-btn, .like-btn, .ghost-link, .wechat-save, .search-form, .search-form button,
.pagination .page-numbers, .tag-cloud a, .article-tags a, .load-more { border-radius: 4px; }
.pagination .page-numbers { font-family: var(--font-latin); }

/* 页头：底部一道浅墨线 + 朱砂细线 */
.site-header { box-shadow: 0 1px 0 var(--line), 0 3px 0 -1px var(--surface), 0 4px 0 -2px var(--brand-faint); }
.brand-name { font-weight: 600; }
.brand-tag { letter-spacing: .3em; }

/* 区块标题的细线换成「一粗一细」的书线 */
.section-rule { background: linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--line-2), var(--line-2)) 0 4px / 100% 1px no-repeat; height: 5px; }

/* 首页「门类」 */
.gates { display: grid; gap: 14px; margin-top: 22px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.gate {
	position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 14px; padding: 18px 18px 16px;
	background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: inherit;
	transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.gate:hover { color: inherit; box-shadow: var(--shadow); transform: translateY(-2px); }
.gate-seal {
	display: grid; place-items: center; width: 46px; height: 46px; border-radius: 4px;
	font: 600 22px/1 var(--font-serif); color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand), inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--brand-faint);
}
.gate.is-book .gate-seal { background: var(--grain), var(--brand); color: #fff; box-shadow: inset 0 0 0 3px var(--brand), inset 0 0 0 4px rgba(255, 246, 236, .55); }
html.dark .gate.is-book .gate-seal { background: var(--grain), #a2432f; box-shadow: inset 0 0 0 3px #a2432f, inset 0 0 0 4px rgba(255, 246, 236, .45); }
.gate-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gate-name { display: flex; align-items: baseline; gap: 8px; font: 600 18px/1.3 var(--font-serif); letter-spacing: .1em; }
.gate-name small { font: italic 400 13px var(--font-latin); letter-spacing: 0; color: var(--muted); }
.gate:hover .gate-name { color: var(--brand); }
.gate-desc { font-size: 13px; line-height: 1.75; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gate-kids { font-size: 12px; letter-spacing: .06em; color: var(--accent); }
.gate-go { display: inline-flex; align-items: center; gap: 2px; margin-top: auto; padding-top: 4px; font-size: 12.5px; letter-spacing: .1em; color: var(--brand); }
.gate-go .icon { transition: transform .3s var(--ease); }
.gate:hover .gate-go .icon { transform: translateX(3px); }
@media (max-width: 639px) {
	.gates { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; padding-bottom: 4px; }
	.gates::-webkit-scrollbar { display: none; }
	.gate { flex: 0 0 82%; scroll-snap-align: start; }
	.gate:hover { transform: none; }
}

/* 典籍分类页：章节目录 */
.book-toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 20px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); counter-reset: none; }
.book-toc a {
	display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: baseline;
	height: 100%; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); transition: background .2s, color .2s, box-shadow .2s;
}
.book-toc a:hover { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand-faint); }
.toc-no { grid-row: span 2; font: italic 400 13px/1.6 var(--font-latin); color: var(--brand-faint); font-variant-numeric: lining-nums; }
.book-toc a:hover .toc-no { color: var(--brand); }
.toc-name { font: 600 15.5px/1.5 var(--font-serif); letter-spacing: .06em; }
.book-toc small { grid-column: 2; font-size: 11.5px; line-height: 1.5; color: var(--muted); letter-spacing: .02em; }
@media (max-width: 479px) { .book-toc { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; gap: 8px; } }

/* 文章页：典籍章节导航 */
.chapter-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; margin-top: 22px; }
.chapter-link, .chapter-toc {
	display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 84px; padding: 14px 18px;
	background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: var(--ink); transition: box-shadow .3s, color .2s;
}
.chapter-link:hover, .chapter-toc:hover { box-shadow: var(--shadow); color: var(--brand); }
.chapter-link small, .chapter-toc small { font-size: 12px; letter-spacing: .12em; color: var(--muted); }
.chapter-link b { font: 600 17px/1.4 var(--font-serif); letter-spacing: .08em; }
.chapter-link.is-next { align-items: flex-end; text-align: right; }
.chapter-link.is-empty { background: transparent; box-shadow: none; }
.chapter-toc { align-items: center; text-align: center; padding-inline: 22px; color: var(--brand); }
.chapter-toc .icon { font-size: 20px; }
.chapter-toc span { font: 600 14px/1.3 var(--font-serif); letter-spacing: .1em; }
@media (max-width: 639px) {
	.chapter-nav { grid-template-columns: 1fr 1fr; }
	.chapter-toc { grid-column: 1 / -1; grid-row: 2; flex-direction: row; gap: 10px; min-height: 52px; }
	.chapter-link.is-empty { display: none; }
}

/* 正文：经文原文（楷体）、注释、宜忌、方笺 */
.entry-content p.is-label[data-rank] { font-size: 1.04em; letter-spacing: .14em; }
.entry-content p.is-classic {
	position: relative; margin-inline: 0; padding: .1em 0 .1em 1.15em;
	font-family: var(--font-kai); font-size: 1.1em; line-height: 2; letter-spacing: .04em; color: var(--ink);
	border-left: 2px solid var(--brand-faint);
}
.entry-content p.is-classic + p.is-classic { margin-top: 0; padding-top: .8em; }
.entry-content p.is-note { font-size: .88em; line-height: 1.85; color: var(--ink-2); }
.entry-content p.is-note + p.is-note { margin-top: .4em; }
.entry-content p.is-caution {
	position: relative; padding: .8em 1.1em .8em 2.6em; border-radius: var(--radius-sm);
	background: var(--brand-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--brand);
}
.entry-content p.is-caution::before {
	content: "忌"; position: absolute; left: .75em; top: .95em; display: grid; place-items: center; width: 1.35em; height: 1.35em; border-radius: 2px;
	background: var(--brand); color: #fff; font: 600 .78em/1 var(--font-serif);
}
.entry-content p.is-caution + p.is-caution { margin-top: .5em; }
/* 方笺：组成（配方）排成一张小笺，名称与用量成对，朱砂双线框 */
.entry-content ul.recipe {
	position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 30px; list-style: none;
	margin-inline: 0; padding: 18px 22px 18px 58px; border-radius: 4px; background: var(--surface-2);
	box-shadow: inset 0 0 0 1px var(--brand-faint), inset 0 0 0 4px var(--surface-2), inset 0 0 0 5px var(--mark);
}
.entry-content ul.recipe::before {
	content: "方"; position: absolute; left: 20px; top: 19px; display: grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 2px;
	background: var(--brand); color: #fff; font: 600 .8em/1 var(--font-serif);
}
.entry-content ul.recipe::after {
	content: "共 " attr(data-count) " 味"; position: absolute; top: -.75em; right: 16px; padding: 0 8px;
	background: var(--surface); font: .74em/1.5 var(--font-kai); letter-spacing: .2em; color: var(--muted);
}
.entry-content ul.recipe > li { display: inline-flex; align-items: baseline; gap: 8px; margin: 0; padding: 0; line-height: 1.6; }
.entry-content ul.recipe > li::before { display: none; }
.entry-content ul.recipe b { font: 600 1.02em var(--font-serif); letter-spacing: .1em; color: var(--ink); }
.entry-content ul.recipe span { font: 1em var(--font-kai); letter-spacing: .04em; color: var(--brand); white-space: nowrap; }
@media (max-width: 479px) { .entry-content ul.recipe { gap: 10px 22px; padding: 16px 16px 16px 50px; } .entry-content ul.recipe::before { left: 16px; top: 17px; } }
.entry-content blockquote { font-family: var(--font-kai); font-size: 1.05em; }
html[data-font="serif"] .entry-content p.is-classic { font-family: var(--font-kai); }

/* 文末提示 */
.disclaimer {
	display: flex; gap: 12px; margin-top: 36px; padding: 14px 16px; border-radius: var(--radius-sm);
	background: var(--surface-2); color: var(--muted); font-size: 13px; line-height: 1.85; letter-spacing: .02em;
}
.disclaimer .icon { flex: none; margin-top: .3em; font-size: 15px; color: var(--gold); }
.disclaimer p { margin: 0; }

/* 侧栏：门类导航 */
.w-cats { display: grid; gap: 4px; }
.w-cat { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 10px; border-radius: var(--radius-sm); font: 600 15px var(--font-serif); letter-spacing: .08em; color: var(--ink); }
.w-cat small { font: italic 400 13px var(--font-latin); color: var(--muted); letter-spacing: 0; }
.w-cat:hover, .w-cat.is-current { background: var(--brand-soft); color: var(--brand); }
.w-subcats { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 10px 8px; }
.w-subcats a { padding: 2px 9px; border-radius: 3px; font-size: 12.5px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.w-subcats a:hover, .w-subcats a.is-current { color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand-faint); }

/* 缩略图占位：宣纸底上的淡葫芦 */
.thumb-placeholder { background: var(--surface-2); color: var(--brand-faint); }
.entry-content p.is-classic strong { font-weight: inherit; color: inherit; } /* 原文整段加粗时，以楷体正常字重呈现 */

/* 主菜单三级：二级分类作栏目标题，三级分类列在其下（如 茶方 → 内科 → 感冒、失眠…） */
.main-nav .sub-menu:has(> li > .sub-menu) {
	display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, auto); gap: 4px 18px; padding: 14px 16px 12px; min-width: 0;
}
.main-nav .sub-menu > li.menu-item-has-children > a {
	padding: 6px 10px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line-2); border-radius: 0;
	font: 600 15px/1.4 var(--font-serif); letter-spacing: .1em; color: var(--brand);
}
.main-nav .sub-menu > li.menu-item-has-children > a:hover { background: none; color: var(--brand-ink); }
.main-nav .sub-menu .sub-menu {
	position: static; display: grid; grid-template-columns: repeat(2, minmax(64px, auto)); gap: 2px; min-width: 0; padding: 0;
	border: 0; box-shadow: none; background: none; opacity: 1; visibility: visible; transform: none;
}
.main-nav .sub-menu .sub-menu a { padding: 6px 10px; font-size: 13.5px; white-space: nowrap; }
.main-nav .sub-menu .sub-menu:has(> li:only-child) { grid-template-columns: auto; }

/* 手机抽屉菜单：三级再缩进一层 */
.drawer-nav .sub-menu .sub-menu { padding: 0 0 6px 14px; border-left: 1px solid var(--line); margin-left: 4px; }
.drawer-nav .sub-menu .sub-menu a { font-size: 14px; padding: 7px 4px; }

/* 侧栏门类：二级分类带三级时，按组显示 */
.w-subgroup { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; width: 100%; }
.w-subgroup + .w-subgroup, .w-subgroup + a, a + .w-subgroup { margin-top: 4px; }
.w-subgroup > .w-subhead { flex: none; min-width: 3.4em; padding: 2px 0; box-shadow: none; font: 600 13px var(--font-serif); letter-spacing: .08em; color: var(--brand); }
.w-subgroup > .w-subhead:hover { box-shadow: none; text-decoration: underline; text-underline-offset: .3em; }
/* 实心葫芦（印章内）：腰间细绳取印章底色 */
.brand-mark .gourd-tie, .about-mark .gourd-tie { stroke: #9b3b2a; }
html.dark .brand-mark .gourd-tie, html.dark .about-mark .gourd-tie { stroke: #a2432f; }
@media (max-width: 1023px) { .w-subcats a { padding: 5px 11px; } .w-subgroup > .w-subhead { padding: 5px 0; } }
