/*
Theme Name: 水墨 Shuimo
Theme URI: https://zhangpu.me
Author: ZhangPu
Author URI: https://zhangpu.me
Description: 取《庄子》水墨意象的个人博客主题。纸白为底、浓墨为字、朱砂点缀，竖排题词与远山点缀，营造「无何有之乡」的空灵。
Version: 1.0.0
Requires at least: 5.9
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: shuimo
Tags: blog, one-column, custom-colors, custom-menu, featured-images, translation-ready
*/

/* ==========================================================================
   1. 设计变量
   ========================================================================== */
:root {
	--paper: #f7f4ee;         /* 纸白 */
	--paper-deep: #f1ece2;    /* 米色纸（区块底） */
	--ink: #26241f;           /* 浓墨 */
	--ink-soft: #47423a;      /* 淡墨 */
	--ink-mid: #6f695e;       /* 中灰墨 */
	--ink-faint: #98917f;     /* 更淡墨 */
	--seal: #b03a2e;          /* 朱砂红 */
	--seal-deep: #8c2b21;     /* 深朱砂 */
	--line: #e4ddd0;          /* 细线 */
	--line-soft: #ede7db;
	--hairline: rgba(38, 36, 31, 0.08);
	--paper-card: #fffdf8;

	--serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, "SimSun", serif;
	--kai: "Ma Shan Zheng", "KaiTi", "STKaiti", "Kaiti SC", "Noto Serif SC", serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

	--wrap: 46rem;
	--wrap-wide: 60rem;
	--radius: 2px;
	--ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
	margin: 0;
	font-family: var(--serif);
	font-size: 1.0625rem;
	line-height: 1.95;
	color: var(--ink);
	background-color: var(--paper);
	background-image:
		radial-gradient(900px 420px at 50% -6%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0));
	background-repeat: no-repeat;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

a {
	color: var(--ink);
	text-decoration: none;
	transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

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

img {
	max-width: 100%;
	height: auto;
	display: block;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--serif);
	font-weight: 600;
	line-height: 1.45;
	color: var(--ink);
	margin: 0 0 0.6em;
	overflow-wrap: break-word;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.4em; }

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

blockquote { margin: 0; }

::selection {
	background: var(--seal);
	color: #fdf6ec;
}

:focus-visible {
	outline: 2px solid var(--seal);
	outline-offset: 3px;
}

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin-inline: auto;
	padding-inline: 1.5rem;
}

.wrap--wide {
	max-width: var(--wrap-wide);
}

/* 无障碍辅助文本 */
.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;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	background: var(--ink);
	color: #fdf6ec;
	padding: 0.5rem 1rem;
}

.skip-link:focus {
	left: 0.5rem;
	top: 0.5rem;
	color: #fdf6ec;
}

/* 阅读进度条 */
.reading-progress {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	z-index: 90;
	pointer-events: none;
}

.reading-progress span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--seal);
}

/* ==========================================================================
   3. 页头
   ========================================================================== */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(247, 244, 238, 0.88);
	-webkit-backdrop-filter: saturate(140%) blur(10px);
	backdrop-filter: saturate(140%) blur(10px);
	border-bottom: 1px solid var(--hairline);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	min-height: 72px;
}

.site-branding {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	min-width: 0;
}

.site-titles {
	min-width: 0;
}

.site-title {
	font-family: var(--kai);
	font-size: 1.55rem;
	font-weight: 400;
	margin: 0;
	letter-spacing: 0.06em;
	line-height: 1.2;
}

.site-title a {
	color: var(--ink);
}

.site-title a:hover {
	color: var(--seal);
}

.site-description {
	margin: 0.15rem 0 0;
	font-size: 0.78rem;
	color: var(--ink-mid);
	letter-spacing: 0.16em;
}

/* 导航 */
.main-nav ul {
	display: flex;
	align-items: center;
	gap: 1.7rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.main-nav li {
	position: relative;
}

.main-nav a {
	display: inline-block;
	font-size: 0.95rem;
	letter-spacing: 0.12em;
	color: var(--ink-soft);
	padding: 0.3rem 0;
	position: relative;
}

.main-nav a::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 0;
	height: 1px;
	background: var(--seal);
	transition: width 0.3s var(--ease);
}

.main-nav a:hover::after,
.main-nav .current-menu-item > a::after,
.main-nav .current_page_item > a::after {
	width: 100%;
}

.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
	color: var(--seal);
}

/* 子菜单 */
.main-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 10rem;
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	background: var(--paper-card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: 0 12px 32px rgba(38, 36, 31, 0.1);
	padding: 0.4rem 0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
}

.main-nav li:hover > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.main-nav .sub-menu a {
	display: block;
	padding: 0.5rem 1.2rem;
	font-size: 0.9rem;
}

.main-nav .sub-menu a::after {
	display: none;
}

/* 移动端汉堡按钮 */
.nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	padding: 8px;
	background: transparent;
	border: 0;
	cursor: pointer;
}

.nav-toggle__bar {
	display: block;
	height: 2px;
	width: 100%;
	background: var(--ink);
	border-radius: 1px;
	transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

/* ==========================================================================
   4. 首页题词区
   ========================================================================== */
.hero {
	position: relative;
	overflow: hidden;
	padding: clamp(3.5rem, 9vw, 6.5rem) 0 clamp(2rem, 6vw, 4rem);
	border-bottom: 1px solid var(--hairline);
}

.hero__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 3rem;
	position: relative;
	z-index: 2;
}

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

.hero__title {
	font-family: var(--kai);
	font-size: clamp(2.6rem, 7vw, 4rem);
	font-weight: 400;
	margin: 0;
	letter-spacing: 0.08em;
	line-height: 1.15;
}

.hero__sub {
	color: var(--ink-mid);
	letter-spacing: 0.14em;
	margin: 0.9rem 0 0;
	font-size: 1rem;
}

/* 竖排题词 */
.hero__quote {
	display: flex;
	gap: 1.7rem;
	flex: 0 0 auto;
	border-right: 1px solid var(--line);
	padding-right: 1.6rem;
	align-self: stretch;
	align-items: flex-start;
}

.hero-quote__col {
	writing-mode: vertical-rl;
	text-orientation: upright;
	font-family: var(--kai);
	font-size: 1.5rem;
	line-height: 1.85;
	letter-spacing: 0.28em;
	color: var(--ink-soft);
	white-space: nowrap;
}

.hero__mountains {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	z-index: 1;
	pointer-events: none;
}

.ink-mountains {
	display: block;
	width: 100%;
	height: 200px;
}

/* ==========================================================================
   5. 文章列表
   ========================================================================== */
.site-main {
	padding-block: 2.5rem 4rem;
}

.page-header {
	padding: 1rem 0 2rem;
}

.page-title {
	font-family: var(--kai);
	font-weight: 400;
	letter-spacing: 0.08em;
	margin: 0 0 0.4rem;
	font-size: 2rem;
}

.archive-description {
	color: var(--ink-mid);
}

.posts-list {
	border-top: 1px solid var(--hairline);
}

.post-card {
	padding: 2.7rem 0;
	border-bottom: 1px solid var(--hairline);
}

.entry-meta--top {
	font-size: 0.82rem;
	color: var(--ink-faint);
	letter-spacing: 0.16em;
	margin-bottom: 0.7rem;
	display: flex;
	align-items: center;
	gap: 0.9rem;
}

.entry-date {
	color: var(--seal);
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.1em;
}

.entry-title {
	margin: 0 0 0.6rem;
}

.entry-title a {
	color: var(--ink);
}

.entry-title a:hover {
	color: var(--seal);
}

.post-thumb {
	display: block;
	margin: 1.1rem 0 1.3rem;
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--paper-deep);
}

.post-thumb img {
	width: 100%;
	transition: transform 0.7s var(--ease), filter 0.7s var(--ease);
	filter: saturate(0.9);
}

.post-thumb:hover img {
	transform: scale(1.03);
	filter: saturate(1);
}

.entry-summary {
	color: var(--ink-soft);
}

.entry-summary p {
	margin: 0;
}

.entry-footer {
	margin-top: 1.1rem;
}

.more-link {
	font-family: var(--kai);
	color: var(--seal);
	letter-spacing: 0.12em;
	font-size: 0.95rem;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.more-link:hover {
	color: var(--seal-deep);
}

.more-link span {
	transition: transform 0.3s var(--ease);
}

.more-link:hover span {
	transform: translateX(4px);
}

/* 分页 */
.posts-navigation .nav-links {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 2.6rem 0 0;
}

.posts-navigation a {
	font-family: var(--kai);
	color: var(--seal);
	letter-spacing: 0.08em;
}

/* ==========================================================================
   6. 单篇 / 页面
   ========================================================================== */
.post-single {
	padding: 2rem 0 3.5rem;
}

.post-single .entry-title,
.page .entry-title {
	font-family: var(--kai);
	font-weight: 400;
	font-size: clamp(1.9rem, 4.6vw, 2.7rem);
	letter-spacing: 0.04em;
	margin: 0.4rem 0 1.6rem;
}

.entry-meta--top .entry-cats {
	color: var(--ink-faint);
}

.entry-cats a {
	color: var(--ink-faint);
}

.entry-cats a:hover {
	color: var(--seal);
}

.entry-content {
	color: var(--ink);
	font-size: 1.0625rem;
}

.entry-content h2,
.entry-content h3 {
	margin-top: 2.2em;
}

.entry-content h2 {
	font-family: var(--kai);
	font-weight: 400;
	letter-spacing: 0.04em;
}

.entry-content a {
	color: var(--seal);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-color: rgba(176, 58, 46, 0.35);
}

.entry-content a:hover {
	text-decoration-color: var(--seal);
}

.entry-content blockquote {
	margin: 2.2em 0;
	padding: 0.1em 0 0.1em 1.4em;
	border-left: 3px solid var(--seal);
	font-family: var(--kai);
	font-size: 1.14em;
	line-height: 1.85;
	color: var(--ink-soft);
}

.entry-content blockquote p {
	margin: 0;
}

.entry-content img {
	border-radius: var(--radius);
	margin: 1.6rem auto;
}

.entry-content figure {
	margin: 1.6rem 0;
}

.entry-content figcaption {
	text-align: center;
	font-size: 0.85rem;
	color: var(--ink-faint);
	margin-top: 0.6rem;
}

.entry-content pre {
	background: var(--paper-deep);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1.2rem 1.3rem;
	overflow: auto;
	line-height: 1.7;
	font-size: 0.92rem;
}

.entry-content code {
	font-family: var(--mono);
	font-size: 0.9em;
	background: var(--paper-deep);
	padding: 0.12em 0.4em;
	border-radius: 3px;
}

.entry-content pre code {
	background: transparent;
	padding: 0;
}

.entry-content hr {
	border: 0;
	border-top: 1px solid var(--hairline);
	margin: 2.5em auto;
	width: 40%;
}

/* 分页链接 */
.page-links {
	margin-top: 2rem;
	font-size: 0.95rem;
}

.page-links .post-page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 2rem;
	height: 2rem;
	margin: 0 0.2rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
}

.page-links .post-page-numbers.current {
	background: var(--seal);
	border-color: var(--seal);
	color: #fff;
}

/* 标签 */
.entry-tags {
	margin-top: 2.4rem;
	font-size: 0.9rem;
}

.entry-tags a {
	display: inline-block;
	margin: 0 0.4rem 0.4rem 0;
	padding: 0.2rem 0.8rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	color: var(--ink-mid);
	font-size: 0.82rem;
	letter-spacing: 0.06em;
}

.entry-tags a::before {
	content: "#";
	color: var(--seal);
	margin-right: 0.15rem;
}

.entry-tags a:hover {
	border-color: var(--seal);
	color: var(--seal);
}

/* 作者信息 */
.entry-author {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid var(--hairline);
}

.entry-author .avatar {
	border-radius: 50%;
	width: 56px;
	height: 56px;
}

.entry-author .author-name {
	font-family: var(--kai);
	font-size: 1.1rem;
	margin: 0 0 0.15rem;
}

.entry-author .author-bio {
	color: var(--ink-mid);
	font-size: 0.9rem;
	margin: 0;
}

/* ==========================================================================
   7. 评论
   ========================================================================== */
.comments-area {
	margin-top: 3rem;
	padding-top: 2.2rem;
	border-top: 1px solid var(--hairline);
}

.comments-title {
	font-family: var(--kai);
	font-weight: 400;
	letter-spacing: 0.06em;
}

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

.comment-list .comment {
	padding: 1.5rem 0;
	border-bottom: 1px solid var(--hairline);
}

.comment-list .children {
	list-style: none;
	margin: 1rem 0 0 1.5rem;
	padding-left: 1rem;
	border-left: 1px solid var(--line);
}

.comment-meta {
	font-size: 0.85rem;
	color: var(--ink-faint);
	margin-bottom: 0.5rem;
}

.comment-meta .fn {
	font-style: normal;
	font-family: var(--kai);
	font-size: 1.05rem;
	color: var(--ink);
}

.comment-meta .says {
	display: none;
}

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

.reply {
	margin-top: 0.6rem;
}

.comment-reply-link {
	font-size: 0.85rem;
	color: var(--seal);
	letter-spacing: 0.08em;
}

.comment-form {
	margin-top: 2rem;
}

.comment-form label {
	display: block;
	font-size: 0.9rem;
	color: var(--ink-soft);
	margin-bottom: 0.4rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 0.65rem 0.9rem;
	border: 1px solid var(--line);
	background: var(--paper-card);
	border-radius: var(--radius);
	font-family: inherit;
	font-size: 0.95rem;
	color: var(--ink);
	transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.comment-form input:focus,
.comment-form textarea:focus {
	outline: none;
	border-color: var(--seal);
	box-shadow: 0 0 0 3px rgba(176, 58, 46, 0.12);
}

.comment-form textarea {
	resize: vertical;
	min-height: 9rem;
}

.comment-form .submit,
button,
input[type="submit"] {
	background: var(--seal);
	color: #fdf6ec;
	border: 0;
	padding: 0.6rem 1.5rem;
	border-radius: var(--radius);
	cursor: pointer;
	font-family: var(--kai);
	letter-spacing: 0.14em;
	font-size: 0.95rem;
	transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.comment-form .submit:hover,
button:hover,
input[type="submit"]:hover {
	background: var(--seal-deep);
	transform: translateY(-1px);
}

/* ==========================================================================
   8. 侧边栏 / 小工具
   ========================================================================== */
.widget-area {
	margin-top: 3rem;
	border-top: 1px solid var(--hairline);
}

.widget {
	padding: 1.6rem 0;
	border-bottom: 1px solid var(--hairline);
}

.widget-title {
	font-size: 1.05rem;
	letter-spacing: 0.12em;
	margin-bottom: 1rem;
}

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

.widget li {
	padding: 0.32rem 0;
}

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

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

/* ==========================================================================
   9. 搜索表单
   ========================================================================== */
.search-form {
	display: flex;
	gap: 0.5rem;
	max-width: 26rem;
}

.search-field {
	flex: 1;
	padding: 0.6rem 0.9rem;
	border: 1px solid var(--line);
	background: var(--paper-card);
	border-radius: var(--radius);
	font-family: inherit;
	font-size: 0.95rem;
	color: var(--ink);
}

.search-field:focus {
	outline: none;
	border-color: var(--seal);
	box-shadow: 0 0 0 3px rgba(176, 58, 46, 0.12);
}

.search-submit {
	background: var(--seal);
	color: #fdf6ec;
	border: 0;
	padding: 0.6rem 1.2rem;
	border-radius: var(--radius);
	cursor: pointer;
	font-family: var(--kai);
	letter-spacing: 0.1em;
}

.search-submit:hover {
	background: var(--seal-deep);
}

/* ==========================================================================
   10. 404
   ========================================================================== */
.error-404 {
	text-align: center;
	padding: 5rem 0 6rem;
}

.error-404__seal {
	width: 66px;
	height: 66px;
	margin: 0 auto 1.6rem;
	display: grid;
	place-items: center;
	background: var(--seal);
	color: #fdf6ec;
	font-family: var(--kai);
	font-size: 2.1rem;
	border-radius: 4px;
	transform: rotate(-3deg);
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28), 0 2px 8px rgba(140, 43, 33, 0.22);
}

.error-404 .page-title {
	margin-bottom: 0.5rem;
}

.error-404 .page-desc {
	color: var(--ink-mid);
	margin-bottom: 2.2rem;
}

.error-404 .search-form {
	margin-inline: auto;
}

/* ==========================================================================
   11. 页脚
   ========================================================================== */
.site-footer {
	margin-top: 2rem;
	border-top: 1px solid var(--hairline);
	background: var(--paper-deep);
}

.site-footer .wrap {
	padding-block: 3rem;
	text-align: center;
}

.footer-quote {
	font-family: var(--kai);
	font-size: 1.12rem;
	color: var(--ink-mid);
	letter-spacing: 0.16em;
	margin: 0 0 0.9rem;
}

.footer-copy {
	font-size: 0.8rem;
	color: var(--ink-faint);
	letter-spacing: 0.12em;
	margin: 0;
}

.footer-copy a {
	color: var(--ink-faint);
}

.footer-copy a:hover {
	color: var(--seal);
}

/* ==========================================================================
   12. 入场动画（仅 JS 可用时生效）
   ========================================================================== */
.js .reveal {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.js .reveal.is-visible {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	.js .reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}
}

/* ==========================================================================
   13. 响应式
   ========================================================================== */
@media (max-width: 720px) {
	.site-header__inner {
		min-height: 62px;
		flex-wrap: wrap;
	}

	.nav-toggle {
		display: flex;
	}

	.main-nav {
		flex-basis: 100%;
		display: none;
		padding-bottom: 1rem;
	}

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

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

	.main-nav a {
		display: block;
		padding: 0.7rem 0;
		border-bottom: 1px solid var(--hairline);
	}

	.main-nav a::after {
		display: none;
	}

	.main-nav .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: 0;
		border-radius: 0;
		padding: 0 0 0 1rem;
		background: transparent;
	}

	.hero__inner {
		flex-direction: column-reverse;
		align-items: flex-start;
		gap: 2.2rem;
	}

	.hero__quote {
		flex-direction: row;
		border-right: 0;
		border-bottom: 1px solid var(--line);
		padding-right: 0;
		padding-bottom: 1.4rem;
		align-self: stretch;
	}

	.hero-quote__col {
		font-size: 1.3rem;
		line-height: 1.8;
	}

	.ink-mountains {
		height: 140px;
	}

	h1 { font-size: 1.7rem; }
}
