/*
Theme Name: 学伴教育 Xueban Edu
Theme URI: https://example.com/xuebanedu
Author: Xueban Edu
Author URI: https://example.com
Description: 学伴教育是一款以中式书法美学为灵感的现代 WordPress 内容主题。深藏蓝与金色搭配、宣纸暖白背景、衬线标题，支持响应式布局、暗色模式、自定义 LOGO、文章目录与主题自定义器，适合教育机构官网、知识博客与内容型网站。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: xuebanedu
Tags: education, blog, news, one-column, two-columns, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* =========================================================
   1. 设计变量
   ========================================================= */
:root {
	--color-bg: #fbf9f5;            /* 宣纸暖白 */
	--color-surface: #ffffff;
	--color-surface-2: #f4efe4;
	--color-text: #1f2a3d;
	--color-text-soft: #5d6a80;
	--color-border: #e6dfd0;
	--color-primary: #123a6b;       /* 藏蓝 */
	--color-primary-600: #1b4d8f;
	--color-primary-700: #0e2c52;
	--color-primary-050: #eef3fa;
	--color-gold: #b8893a;          /* 金 */
	--color-gold-600: #9a6f2a;
	--color-gold-050: #f7efdd;
	--color-seal: #b23b2e;          /* 印章红 */
	--color-seal-050: #f9ecea;
	--radius-sm: 8px;
	--radius: 14px;
	--radius-lg: 20px;
	--shadow-sm: 0 1px 2px rgba(18, 25, 40, 0.05);
	--shadow-md: 0 6px 18px rgba(18, 25, 40, 0.08);
	--shadow-lg: 0 16px 40px rgba(18, 25, 40, 0.12);
	--font-heading: "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Source Han Serif SC", serif;
	--font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
	--max-width: 1200px;
	--content-width: 760px;
}

html[data-theme="dark"] {
	--color-bg: #0f1626;            /* 深蓝黑 */
	--color-surface: #17213a;
	--color-surface-2: #1e2a46;
	--color-text: #e7ebf4;
	--color-text-soft: #97a5bd;
	--color-border: #2a3a58;
	--color-primary: #86a9e8;       /* 亮化藏蓝 */
	--color-primary-600: #a6c2f2;
	--color-primary-700: #c6d9f8;
	--color-primary-050: #1c2b49;
	--color-gold: #d9b36a;
	--color-gold-600: #e6c98f;
	--color-gold-050: #332a17;
	--color-seal: #d46a5c;
	--color-seal-050: #3a2420;
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
	--shadow-md: 0 6px 18px rgba(0, 0, 0, 0.35);
	--shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.75;
	color: var(--color-text);
	background: var(--color-bg);
	transition: background-color 0.3s ease, color 0.3s ease;
	-webkit-font-smoothing: antialiased;
}

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

a { color: var(--color-primary-600); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--color-gold-600); }

/* 标题字号使用 clamp() 随视口平滑缩放，保证电脑 / 平板 / 手机视觉一致 */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-heading);
	line-height: 1.35;
	color: var(--color-text);
	margin: 0 0 0.6em;
	font-weight: 700;
}
h1 { font-size: clamp(1.7rem, 3.2vw + 0.9rem, 2.4rem); }
h2 { font-size: clamp(1.4rem, 2vw + 0.8rem, 1.8rem); }
h3 { font-size: clamp(1.15rem, 1vw + 0.9rem, 1.35rem); }
h4 { font-size: clamp(1.02rem, 0.6vw + 0.9rem, 1.15rem); }

p { margin: 0 0 1.2em; }

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

blockquote {
	margin: 1.6em 0;
	padding: 0.9em 1.2em;
	border-left: 4px solid var(--color-gold);
	background: var(--color-gold-050);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	color: var(--color-text);
	font-family: var(--font-heading);
	font-size: 1.05em;
}
blockquote p:last-child { margin-bottom: 0; }

code, kbd, pre {
	font-family: "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
	font-size: 0.92em;
}
code { background: var(--color-surface-2); padding: 0.15em 0.4em; border-radius: 4px; }
pre {
	background: var(--color-surface-2);
	padding: 1.1em 1.3em;
	border-radius: var(--radius-sm);
	overflow-x: auto;
	line-height: 1.6;
	border: 1px solid var(--color-border);
}
pre code { background: transparent; padding: 0; }

table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 0.95em; }
th, td { border: 1px solid var(--color-border); padding: 0.6em 0.9em; text-align: left; }
th { background: var(--color-surface-2); font-family: var(--font-heading); }

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

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; overflow: hidden;
	padding: 0; position: absolute !important; word-wrap: normal !important;
}
.screen-reader-text:focus {
	background: var(--color-primary); color: #fff; clip: auto !important;
	clip-path: none; display: block; font-size: 0.9em; font-weight: 700;
	height: auto; left: 8px; top: 8px; line-height: normal; padding: 14px 20px;
	text-decoration: none; z-index: 100000; border-radius: var(--radius-sm);
}

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 9999; }
.skip-link:focus { left: 8px; }

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

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

/* =========================================================
   3. 顶部条与页头
   ========================================================= */
.topbar {
	background: var(--color-primary);
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.82em;
	padding: 6px 0;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.topbar p { margin: 0; letter-spacing: 0.08em; }
.topbar .topbar-gold { color: var(--color-gold); font-weight: 700; }
html[data-theme="dark"] .topbar { background: var(--color-primary-700); }

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--color-surface);
	border-bottom: 1px solid var(--color-border);
	box-shadow: var(--shadow-sm);
	transition: background-color 0.3s ease;
}
.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	min-height: 72px;
}
.site-branding { display: flex; align-items: center; gap: 12px; min-width: 0; }
.site-branding .custom-logo-link { display: block; line-height: 0; flex-shrink: 0; }
.site-branding .custom-logo {
	width: 48px;
	height: 48px;
	object-fit: contain;
	border-radius: var(--radius-sm);
	background: var(--color-primary);
	padding: 2px;
}
.site-title {
	font-family: var(--font-heading);
	font-size: 1.35em;
	font-weight: 700;
	margin: 0;
	line-height: 1.2;
	letter-spacing: 0.04em;
}
.site-title a { color: var(--color-primary); }
html[data-theme="dark"] .site-title a { color: var(--color-text); }
.site-description {
	margin: 2px 0 0;
	font-size: 0.78em;
	color: var(--color-text-soft);
	letter-spacing: 0.1em;
}
.site-title-suffix { color: var(--color-gold); }

.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 6px;
}
.main-navigation li { position: relative; margin: 0; }
.main-navigation a {
	display: block;
	padding: 10px 14px;
	color: var(--color-text);
	font-size: 0.95em;
	font-weight: 500;
	border-radius: var(--radius-sm);
	letter-spacing: 0.03em;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
	color: var(--color-primary-600);
	background: var(--color-primary-050);
}
.main-navigation .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-md);
	padding: 8px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: all 0.2s ease;
	z-index: 50;
	flex-direction: column;
	align-items: stretch;
}
.main-navigation li:hover > .sub-menu,
.main-navigation li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* 暗色切换按钮 */
.theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 1px solid var(--color-border);
	border-radius: 50%;
	background: var(--color-surface);
	color: var(--color-text);
	cursor: pointer;
	font-size: 16px;
	transition: all 0.2s ease;
	flex-shrink: 0;
}
.theme-toggle:hover {
	border-color: var(--color-gold);
	color: var(--color-gold-600);
	transform: rotate(12deg);
}
.theme-toggle .icon-moon { display: inline; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }

/* 汉堡菜单 */
.menu-toggle {
	display: none;
	width: 40px;
	height: 40px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: var(--color-surface);
	cursor: pointer;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	flex-shrink: 0;
}
.menu-toggle span {
	display: block;
	width: 18px;
	height: 2px;
	background: var(--color-text);
	border-radius: 2px;
	transition: all 0.25s ease;
}
.menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   4. 主内容布局
   ========================================================= */
.site-content { padding: 48px 0 64px; }
.page-template-full-width .site-content,
.no-sidebar .site-content { }

.content-area { display: flex; gap: 40px; align-items: flex-start; }
.content-area > main { flex: 1 1 auto; min-width: 0; }
.content-area > aside {
	flex: 0 0 320px;
	position: sticky;
	top: 96px;
	max-height: calc(100vh - 120px);
	overflow-y: auto;
}

/* 区块标题 */
.section-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 28px;
}
.section-head .seal {
	width: 34px;
	height: 34px;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--color-seal);
	color: #fff;
	font-family: var(--font-heading);
	font-size: 0.8em;
	font-weight: 700;
	border-radius: 4px;
	transform: rotate(-3deg);
	box-shadow: var(--shadow-sm);
}
.section-head h2 { margin: 0; font-size: 1.5em; }
.section-head .section-sub { color: var(--color-text-soft); font-size: 0.9em; margin: 0 0 0 auto; }

/* =========================================================
   5. 首页 Hero
   ========================================================= */
.hero {
	position: relative;
	background: linear-gradient(135deg, var(--color-primary-700) 0%, var(--color-primary) 55%, var(--color-primary-600) 100%);
	color: #fff;
	padding: clamp(56px, 9vw, 92px) 0 clamp(60px, 10vw, 100px);
	overflow: hidden;
	text-align: center;
}
.hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.06) 0, transparent 38%),
		radial-gradient(circle at 88% 78%, rgba(184, 137, 58, 0.18) 0, transparent 42%);
}
.hero .container { position: relative; z-index: 1; }
.hero-seal {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border: 2px solid var(--color-gold);
	color: var(--color-gold);
	font-family: var(--font-heading);
	font-size: 0.95em;
	font-weight: 700;
	border-radius: 6px;
	transform: rotate(-4deg);
	margin-bottom: 22px;
	background: rgba(184, 137, 58, 0.12);
	letter-spacing: 0.1em;
}
.hero h1 {
	color: #fff;
	font-size: clamp(2rem, 4.6vw + 1rem, 3.4rem);
	letter-spacing: 0.06em;
	margin: 0 0 18px;
	text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
}
.hero h1 .hero-gold { color: var(--color-gold); }
.hero .hero-sub {
	max-width: 640px;
	margin: 0 auto 34px;
	color: rgba(255, 255, 255, 0.85);
	font-size: 1.08em;
	line-height: 1.9;
}
.hero-actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 28px;
	border-radius: 999px;
	font-size: 0.95em;
	font-weight: 600;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: all 0.2s ease;
	border: 1px solid transparent;
}
.btn-primary { background: var(--color-gold); color: #1c1404; }
.btn-primary:hover { background: var(--color-gold-600); color: #1c1404; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.1); color: #fff; }

.hero-stats {
	display: flex;
	justify-content: center;
	gap: 56px;
	margin-top: 56px;
	flex-wrap: wrap;
}
.hero-stats .stat { text-align: center; }
.hero-stats .stat-num {
	font-family: var(--font-heading);
	font-size: 2em;
	font-weight: 700;
	color: var(--color-gold);
	display: block;
	line-height: 1.2;
}
.hero-stats .stat-label { font-size: 0.82em; color: rgba(255, 255, 255, 0.7); letter-spacing: 0.12em; }

/* =========================================================
   6. 文章卡片
   ========================================================= */
/* 自适应列数：宽屏约 3 列、平板约 2 列、手机 1 列，任意中间宽度也保持平衡 */
.post-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: clamp(18px, 2.4vw, 28px);
}
.entry-card {
	display: flex;
	flex-direction: column;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.entry-card:hover {
	transform: translateY(-6px);
	box-shadow: var(--shadow-lg);
	border-color: var(--color-gold);
}
.entry-card .card-thumb { display: block; position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.entry-card .card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}
.entry-card:hover .card-thumb img { transform: scale(1.05); }
.card-thumb .thumb-seal {
	position: absolute;
	top: 14px;
	left: 14px;
	background: rgba(178, 59, 46, 0.94);
	color: #fff;
	font-family: var(--font-heading);
	font-size: 0.72em;
	padding: 3px 10px;
	border-radius: 4px;
	letter-spacing: 0.08em;
	box-shadow: var(--shadow-sm);
	z-index: 2;
}
.entry-card .card-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.entry-card .card-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 0.8em;
	color: var(--color-text-soft);
	margin-bottom: 12px;
}
.entry-card .card-meta .meta-cat {
	background: var(--color-gold-050);
	color: var(--color-gold-600);
	font-weight: 600;
	padding: 2px 10px;
	border-radius: 999px;
	letter-spacing: 0.04em;
}
.entry-card .entry-title { font-size: clamp(1.05rem, 0.6vw + 0.9rem, 1.18rem); margin: 0 0 10px; line-height: 1.45; }
.entry-card .entry-title a { color: var(--color-text); }
.entry-card .entry-title a:hover { color: var(--color-primary-600); }
.entry-card .entry-summary { font-size: 0.92em; color: var(--color-text-soft); margin: 0 0 18px; flex: 1; }
.entry-card .card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-top: 1px dashed var(--color-border);
	padding-top: 14px;
	font-size: 0.8em;
	color: var(--color-text-soft);
}
.card-footer .read-more { color: var(--color-primary-600); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.card-footer .read-more:hover { color: var(--color-gold-600); }

/* =========================================================
   7. 页头标题区（归档/搜索/页面）
   ========================================================= */
.page-head {
	background: var(--color-surface-2);
	border-bottom: 1px solid var(--color-border);
	padding: clamp(32px, 5vw, 48px) 0;
	margin-bottom: clamp(28px, 4vw, 44px);
	text-align: center;
}
.page-head h1 { margin: 0 0 8px; font-size: clamp(1.5rem, 2.4vw + 0.9rem, 1.9rem); letter-spacing: 0.04em; }
.page-head .page-head-sub { color: var(--color-text-soft); font-size: 0.95em; margin: 0; }
.page-head .head-seal {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 2px solid var(--color-seal);
	color: var(--color-seal);
	font-family: var(--font-heading);
	font-size: 0.78em;
	border-radius: 5px;
	transform: rotate(-4deg);
	margin-bottom: 14px;
	letter-spacing: 0.08em;
}

/* =========================================================
   8. 单篇文章
   ========================================================= */
.single-head { margin-bottom: 28px; }
.single-head .cat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.single-head .cat-row a {
	background: var(--color-gold-050);
	color: var(--color-gold-600);
	font-size: 0.8em;
	font-weight: 600;
	padding: 3px 12px;
	border-radius: 999px;
	letter-spacing: 0.06em;
}
.single-head h1 { font-size: clamp(1.6rem, 2.8vw + 0.9rem, 2.1rem); line-height: 1.4; margin: 0 0 16px; letter-spacing: 0.02em; }
.entry-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 14px;
	font-size: 0.85em;
	color: var(--color-text-soft);
}
.entry-meta .meta-sep { color: var(--color-gold); }

.post-thumbnail { margin: 28px 0 32px; }
.post-thumbnail img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }

.entry-content {
	font-size: clamp(1rem, 0.5vw + 0.9rem, 1.05rem);
	line-height: 1.9;
	max-width: var(--content-width);
	margin: 0 auto;
}
.entry-content h2, .entry-content h3, .entry-content h4 {
	margin-top: 2em;
	scroll-margin-top: 110px;
}
.entry-content h2 { position: relative; padding-left: 16px; }
.entry-content h2::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.18em;
	width: 4px;
	height: 0.82em;
	background: var(--color-gold);
	border-radius: 2px;
}
.entry-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--color-gold); }
.entry-content img { border-radius: var(--radius); }
.entry-content .wp-caption, .entry-content figure { margin: 1.6em 0; }
.entry-content .wp-caption-text { font-size: 0.82em; color: var(--color-text-soft); text-align: center; margin-top: 8px; }
.entry-content .alignleft { float: left; margin: 0.4em 1.4em 1em 0; }
.entry-content .alignright { float: right; margin: 0.4em 0 1em 1.4em; }
.entry-content .aligncenter { display: block; margin: 1.6em auto; }
.entry-content .wp-block-quote.is-style-large { font-size: 1.2em; }

/* 标签 */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 2em 0 0; }
.tag-row .tag-label { font-size: 0.82em; color: var(--color-text-soft); margin-right: 4px; }
.tag-row a {
	font-size: 0.8em;
	background: var(--color-surface-2);
	border: 1px solid var(--color-border);
	padding: 3px 12px;
	border-radius: 999px;
	color: var(--color-text-soft);
}
.tag-row a:hover { border-color: var(--color-gold); color: var(--color-gold-600); }

/* 作者框 */
.author-box {
	display: flex;
	gap: 18px;
	background: var(--color-surface-2);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	padding: 24px;
	margin-top: 40px;
}
.author-box .author-avatar { flex-shrink: 0; }
.author-box .author-avatar img { border-radius: 50%; width: 64px; height: 64px; }
.author-box .author-name { font-family: var(--font-heading); font-weight: 700; margin: 0 0 6px; }
.author-box .author-desc { font-size: 0.9em; color: var(--color-text-soft); margin: 0; }

/* 上一篇 / 下一篇 */
.post-nav { display: flex; gap: 20px; margin-top: 40px; }
.post-nav a {
	flex: 1;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: 16px 20px;
	transition: all 0.2s ease;
}
.post-nav a:hover { border-color: var(--color-gold); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.post-nav .nav-label { display: block; font-size: 0.75em; color: var(--color-text-soft); margin-bottom: 4px; letter-spacing: 0.1em; }
.post-nav .nav-title { font-family: var(--font-heading); font-weight: 600; font-size: 0.95em; color: var(--color-text); }
.post-nav .nav-next { text-align: right; }

/* =========================================================
   9. 侧边栏
   ========================================================= */
.widget {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: 24px;
	margin-bottom: 24px;
	box-shadow: var(--shadow-sm);
}
.widget-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 1.05em;
	margin: 0 0 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--color-border);
}
.widget-title::before {
	content: "";
	width: 4px;
	height: 1em;
	background: var(--color-gold);
	border-radius: 2px;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li { padding: 7px 0; border-bottom: 1px dashed var(--color-border); margin: 0; }
.widget ul li:last-child { border-bottom: 0; }
.widget ul li a { color: var(--color-text-soft); font-size: 0.92em; }
.widget ul li a:hover { color: var(--color-gold-600); }
.widget .wp-block-tag-cloud a, .widget_tag_cloud .tagcloud a {
	display: inline-block;
	background: var(--color-surface-2);
	border: 1px solid var(--color-border);
	padding: 2px 10px;
	margin: 0 4px 8px 0;
	border-radius: 999px;
	font-size: 0.82em !important;
	color: var(--color-text-soft);
	line-height: 1.8;
}
.widget .wp-block-tag-cloud a:hover, .widget_tag_cloud .tagcloud a:hover {
	border-color: var(--color-gold);
	color: var(--color-gold-600);
}

/* 文章目录 */
#xuebanedu-toc { display: none; }
#xuebanedu-toc.active { display: block; }
#xuebanedu-toc ul { list-style: none; padding: 0; margin: 0; }
#xuebanedu-toc .toc-level-2 { padding-left: 0; }
#xuebanedu-toc .toc-level-3 { padding-left: 16px; font-size: 0.92em; }
#xuebanedu-toc a { display: block; padding: 5px 0; }
#xuebanedu-toc a.active { color: var(--color-gold-600); font-weight: 600; }

/* =========================================================
   10. 分页
   ========================================================= */
.pagination {
	margin-top: 48px;
	display: flex;
	justify-content: center;
}
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 14px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: var(--color-surface);
	color: var(--color-text-soft);
	font-size: 0.92em;
	transition: all 0.2s ease;
}
.pagination .page-numbers:hover { border-color: var(--color-gold); color: var(--color-gold-600); }
.pagination .page-numbers.current {
	background: var(--color-primary);
	border-color: var(--color-primary);
	color: #fff;
	font-weight: 600;
}
html[data-theme="dark"] .pagination .page-numbers.current { color: var(--color-primary-700); }

/* =========================================================
   11. 表单与搜索
   ========================================================= */
.search-form { display: flex; gap: 0; }
.search-form .search-field {
	flex: 1;
	border: 1px solid var(--color-border);
	border-right: 0;
	border-radius: var(--radius-sm) 0 0 var(--radius-sm);
	background: var(--color-surface);
	color: var(--color-text);
	padding: 11px 16px;
	font-size: 0.92em;
	font-family: var(--font-body);
	outline: none;
	transition: border-color 0.2s ease;
	min-width: 0;
}
.search-form .search-field:focus { border-color: var(--color-gold); }
.search-form .search-submit {
	border: 1px solid var(--color-primary);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	background: var(--color-primary);
	color: #fff;
	padding: 0 20px;
	font-size: 0.9em;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease;
	font-family: var(--font-body);
}
.search-form .search-submit:hover { background: var(--color-primary-600); border-color: var(--color-primary-600); }
html[data-theme="dark"] .search-form .search-submit { color: var(--color-primary-700); }

input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="search"],
input[type="number"], input[type="tel"], textarea, select {
	width: 100%;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: var(--color-surface);
	color: var(--color-text);
	padding: 11px 14px;
	font-size: 0.95em;
	font-family: var(--font-body);
	outline: none;
	transition: border-color 0.2s ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--color-gold); }

/* =========================================================
   12. 评论
   ========================================================= */
.comments-area { margin-top: 48px; max-width: var(--content-width); margin-left: auto; margin-right: auto; }
.comments-title, .comment-reply-title { font-size: 1.3em; margin-bottom: 20px; }
.comment-list { list-style: none; margin: 0 0 30px; padding: 0; }
.comment-list .comment { margin-bottom: 22px; }
.comment-body {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: 20px 22px;
}
.comment-author { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.comment-author .avatar { border-radius: 50%; }
.comment-author .fn { font-family: var(--font-heading); font-weight: 700; font-style: normal; }
.comment-metadata { font-size: 0.78em; color: var(--color-text-soft); margin-bottom: 10px; }
.comment-content { font-size: 0.95em; }
.comment-content p:last-child { margin-bottom: 0; }
.reply { text-align: right; }
.reply a {
	font-size: 0.8em;
	color: var(--color-primary-600);
	border: 1px solid var(--color-border);
	padding: 4px 14px;
	border-radius: 999px;
	display: inline-block;
}
.reply a:hover { border-color: var(--color-gold); color: var(--color-gold-600); }
.comment-list .children { list-style: none; padding-left: 28px; margin-top: 22px; }
.comment-form label { display: block; font-size: 0.85em; font-weight: 600; margin-bottom: 6px; color: var(--color-text); }
.comment-form textarea, .comment-form input { margin-bottom: 16px; }
.comment-form .submit {
	background: var(--color-primary);
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 12px 32px;
	font-size: 0.95em;
	font-weight: 600;
	cursor: pointer;
	font-family: var(--font-body);
	transition: all 0.2s ease;
}
.comment-form .submit:hover { background: var(--color-primary-600); transform: translateY(-1px); }
html[data-theme="dark"] .comment-form .submit { color: var(--color-primary-700); }

/* =========================================================
   13. 页脚
   ========================================================= */
.site-footer {
	background: var(--color-primary-700);
	color: rgba(255, 255, 255, 0.82);
	margin-top: 64px;
}
html[data-theme="dark"] .site-footer { background: #0a111f; }
/* 页脚自适应列：宽屏 4 列，窄屏自动收拢，保持各列比例一致 */
.footer-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: clamp(24px, 3vw, 40px);
	padding: clamp(40px, 6vw, 56px) 0 40px;
}
.footer-brand .site-title a { color: #fff; }
.footer-brand .site-description { color: rgba(255, 255, 255, 0.6); }
.footer-brand .footer-logo { width: 56px; height: 56px; border-radius: var(--radius-sm); margin-bottom: 14px; background: var(--color-primary); padding: 2px; }
.site-footer .widget-title {
	color: var(--color-gold);
	border-bottom-color: rgba(255, 255, 255, 0.15);
	font-size: 0.95em;
}
.site-footer .widget ul li { border-bottom-color: rgba(255, 255, 255, 0.1); }
.site-footer .widget ul li a { color: rgba(255, 255, 255, 0.75); }
.site-footer .widget ul li a:hover { color: var(--color-gold); }
.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	padding: 20px 0;
	font-size: 0.82em;
	color: rgba(255, 255, 255, 0.55);
}
.footer-bottom .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-bottom a { color: var(--color-gold); }
.footer-nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.footer-nav a { color: rgba(255, 255, 255, 0.7); }
.footer-nav a:hover { color: var(--color-gold); }

/* =========================================================
   14. 404 / 无结果
   ========================================================= */
.error-404, .no-results {
	text-align: center;
	padding: 60px 0;
}
.error-404 .error-code {
	font-family: var(--font-heading);
	font-size: 6em;
	font-weight: 700;
	line-height: 1;
	color: var(--color-gold);
	margin: 0 0 10px;
}
.error-404 h1, .no-results h1 { font-size: 1.6em; }
.error-404 .search-form, .no-results .search-form { max-width: 420px; margin: 28px auto; }

/* =========================================================
   15. 页面
   ========================================================= */
.page-content { max-width: var(--content-width); margin: 0 auto; font-size: 1.02em; line-height: 1.9; }
.page-content h2 { position: relative; padding-left: 16px; }
.page-content h2::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.18em;
	width: 4px;
	height: 0.82em;
	background: var(--color-gold);
	border-radius: 2px;
}

/* =========================================================
   16. 响应式
   ========================================================= */
@media (max-width: 1024px) {
	/* 卡片列数与页脚列数由 auto-fill / auto-fit 自适应，不在断点强制，保证任意宽度一致 */
	.content-area { flex-direction: column; }
	.content-area > aside {
		flex: none;
		width: 100%;
		position: static;
		max-height: none;
		overflow: visible;
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: 0 24px;
	}
}

@media (max-width: 768px) {
	.site-content { padding: 32px 0 48px; }
	.header-inner { min-height: 64px; }
	.menu-toggle { display: inline-flex; }

	.main-navigation {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--color-surface);
		border-bottom: 1px solid var(--color-border);
		box-shadow: var(--shadow-md);
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.3s ease;
	}
	.menu-open .main-navigation { max-height: calc(100vh - 64px); overflow-y: auto; }
	.main-navigation ul {
		flex-direction: column;
		align-items: stretch;
		padding: 12px;
		gap: 2px;
	}
	.main-navigation a { padding: 13px 16px; font-size: 1em; }
	.main-navigation .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: 0;
		border-left: 2px solid var(--color-gold);
		border-radius: 0;
		margin: 2px 0 6px 16px;
		padding: 0;
		min-width: 0;
	}

	.post-grid { grid-template-columns: 1fr; } /* 手机单列，避免卡片过窄 */
	.hero-stats { gap: 28px; }
	.footer-widgets { grid-template-columns: 1fr; gap: 28px; padding: 44px 0 28px; }
	.content-area > aside { grid-template-columns: 1fr; }
	.post-nav { flex-direction: column; }
	.author-box { flex-direction: column; align-items: center; text-align: center; }
	.comment-list .children { padding-left: 12px; }
	.entry-content .alignleft, .entry-content .alignright { float: none; margin: 1.2em 0; }
}

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

/* =========================================================
   17. 打印
   ========================================================= */
@media print {
	.topbar, .site-header, .site-footer, .sidebar, .post-nav, .author-box, .comments-area, .theme-toggle, .menu-toggle { display: none !important; }
	.site-content { padding: 0; }
	body { background: #fff; color: #000; }
	a { color: #000; text-decoration: underline; }
}
