/* ============================================================
   Moe 前端精修层
   目标：统一卡片/侧栏视觉、修复搜索框错位、移动端适配、
        目录与返回顶部。所有规则只做增强，不改主题结构。
   ============================================================ */

:root {
	--moe-ink: #2f3440;
	--moe-sub: #8b93a7;
	--moe-line: #e9edf6;
	--moe-pink: #ffb3c6;
	--moe-blue: #a8c8f0;
	--moe-mint: #9fe3d4;
	--moe-card: #ffffff;
	--moe-radius: 16px;
	--moe-shadow: 0 10px 30px rgba(118, 138, 178, .10);
	--moe-shadow-hover: 0 18px 42px rgba(118, 138, 178, .18);
}

/* ---------- 全局底色与文字 ---------- */
body {
	color: var(--moe-ink);
	-webkit-font-smoothing: antialiased;
}

#kratos-blog-post {
	background: #f5f7fb !important;
}

a {
	transition: color .2s ease;
}

/* ---------- 顶部导航 ---------- */
#kratos-header-section .sf-menu > li > a {
	font-weight: 500;
	letter-spacing: .02em;
}

#kratos-header-section .sf-menu > li > a::after {
	content: "";
	display: block;
	height: 2px;
	width: 0;
	margin: 4px auto 0;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--moe-pink), var(--moe-blue));
	transition: width .25s ease;
}

#kratos-header-section .sf-menu > li > a:hover::after,
#kratos-header-section .sf-menu > li.current-menu-item > a::after {
	width: 70%;
}

/* ---------- 首屏 ---------- */
.kratos-cover .desc h1,
.kratos-cover .desc h2 {
	text-shadow: 0 2px 18px rgba(0, 0, 0, .28);
	letter-spacing: .04em;
}

.kratos-cover .desc p {
	text-shadow: 0 1px 10px rgba(0, 0, 0, .28);
}

/* ---------- 文章卡片 ---------- */
.kratos-hentry {
	background: var(--moe-card) !important;
	border: 1px solid var(--moe-line);
	border-radius: var(--moe-radius);
	box-shadow: var(--moe-shadow);
	overflow: hidden;
	margin-bottom: 26px;
}

.kratos-hentry:hover {
	box-shadow: var(--moe-shadow-hover);
}

.kratos-entry-thumb-new {
	overflow: hidden;
	background: #eef2f9;
}

.kratos-entry-thumb-new img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s cubic-bezier(.22, .61, .36, 1);
}

.kratos-hentry:hover .kratos-entry-thumb-new img {
	transform: scale(1.04);
}

.kratos-post-inner-new {
	padding: 22px 26px 18px;
}

.kratos-entry-title-new {
	font-size: 21px;
	line-height: 1.5;
	margin: 6px 0 10px;
	font-weight: 600;
}

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

.kratos-entry-title-new a:hover {
	color: #e0809e;
}

.kratos-hentry .label,
.kratos-entry-header-new .label {
	display: inline-block;
	padding: 3px 11px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	color: #d1738f;
	background: linear-gradient(135deg, rgba(255, 179, 198, .22), rgba(168, 200, 240, .28));
}

.kratos-entry-content-new {
	color: #5b6374;
	font-size: 14px;
	line-height: 1.9;
}

.kratos-entry-content-new p {
	margin: 0;
}

.kratos-post-meta-new {
	border-top: 1px dashed var(--moe-line);
	padding: 12px 26px;
	font-size: 13px;
	color: var(--moe-sub);
	background: #fcfdff;
}

.kratos-post-meta-new a {
	color: var(--moe-sub);
	margin-right: 14px;
}

.kratos-post-meta-new a:hover {
	color: #e0809e;
}

.kratos-post-meta-new .read-more {
	display: inline-block;
	padding: 4px 14px;
	border-radius: 999px;
	color: #6f7890;
	background: #f1f5fc;
	transition: all .25s ease;
}

.kratos-post-meta-new .read-more:hover {
	color: #fff;
	background: linear-gradient(135deg, #ffb3c6, #a8c8f0);
	box-shadow: 0 6px 16px rgba(168, 200, 240, .45);
}

/* ---------- 侧边栏 ---------- */
#kratos-widget-area .widget {
	background: var(--moe-card);
	border: 1px solid var(--moe-line);
	border-radius: var(--moe-radius);
	box-shadow: var(--moe-shadow);
	padding: 20px 22px;
	margin-bottom: 22px;
}

#kratos-widget-area .widget .wp-block-heading,
#kratos-widget-area .widget h2,
#kratos-widget-area .widget h3,
#kratos-widget-area .widget .widget-title {
	position: relative;
	font-size: 16px;
	font-weight: 600;
	color: var(--moe-ink);
	margin: 0 0 16px;
	padding-left: 13px;
	line-height: 1.4;
}

#kratos-widget-area .widget .wp-block-heading::before,
#kratos-widget-area .widget h2::before,
#kratos-widget-area .widget h3::before,
#kratos-widget-area .widget .widget-title::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 4px;
	height: 16px;
	border-radius: 3px;
	background: linear-gradient(180deg, var(--moe-pink), var(--moe-blue));
}

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

#kratos-widget-area .widget ul li {
	padding: 9px 0;
	border-bottom: 1px dashed var(--moe-line);
	line-height: 1.6;
}

#kratos-widget-area .widget ul li:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

#kratos-widget-area .widget ul li a {
	color: #4d5568;
	font-size: 14px;
}

#kratos-widget-area .widget ul li a:hover {
	color: #e0809e;
}

/* ---------- 搜索框（修复按钮掉行/错位） ---------- */
#kratos-widget-area .widget_search {
	padding: 18px 20px;
}

#kratos-widget-area .widget_search .wp-block-search__label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--moe-sub);
	margin-bottom: 10px;
	letter-spacing: .08em;
}

#kratos-widget-area .wp-block-search__inside-wrapper {
	display: flex;
	align-items: stretch;
	gap: 8px;
	background: #f6f8fd;
	border: 1px solid var(--moe-line);
	border-radius: 12px;
	padding: 5px;
	transition: border-color .2s ease, box-shadow .2s ease;
}

#kratos-widget-area .wp-block-search__inside-wrapper:focus-within {
	border-color: rgba(168, 200, 240, .85);
	box-shadow: 0 0 0 4px rgba(168, 200, 240, .16);
}

#kratos-widget-area .wp-block-search__input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	padding: 9px 12px !important;
	font-size: 14px;
	color: var(--moe-ink);
	outline: none;
}

#kratos-widget-area .wp-block-search__button {
	flex: 0 0 auto;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 9px;
	padding: 0 18px !important;
	font-size: 13px;
	font-weight: 600;
	color: #fff;
	background: linear-gradient(135deg, #ffb3c6, #a8c8f0);
	box-shadow: 0 6px 14px rgba(168, 200, 240, .40);
	transition: transform .2s ease, box-shadow .2s ease;
}

#kratos-widget-area .wp-block-search__button:hover {
	transform: translateY(-1px);
	box-shadow: 0 9px 20px rgba(168, 200, 240, .55);
}

/* 近期文章：两行截断 + 章节感 */
#kratos-widget-area .wp-block-latest-posts__post-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------- 文章目录 ---------- */
.moe-toc {
	background: #fbfcff;
	border: 1px solid var(--moe-line);
	border-left: 4px solid var(--moe-pink);
	border-radius: 12px;
	padding: 16px 20px;
	margin: 0 0 26px;
	font-size: 14px;
}

.moe-toc-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	color: var(--moe-ink);
	margin-bottom: 10px;
	font-size: 14px;
}

.moe-toc-title::before {
	content: "\f0ca";
	font-family: FontAwesome;
	color: #e0809e;
	font-size: 13px;
}

.moe-toc ol {
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: moe-toc;
}

.moe-toc li {
	position: relative;
	padding: 5px 0 5px 22px;
	line-height: 1.5;
}

.moe-toc li::before {
	counter-increment: moe-toc;
	content: counter(moe-toc);
	position: absolute;
	left: 0;
	top: 5px;
	width: 16px;
	text-align: center;
	font-size: 11px;
	color: #b7c0d4;
}

.moe-toc li.moe-toc-l3 {
	padding-left: 40px;
	font-size: 13px;
}

.moe-toc li.moe-toc-l3::before {
	left: 18px;
}

.moe-toc a {
	color: #5b6374;
}

.moe-toc a:hover,
.moe-toc li.active > a {
	color: #e0809e;
	font-weight: 600;
}

/* ---------- 正文排版 ---------- */
.kratos-post-content {
	font-size: 16px;
	line-height: 2;
	color: #3c4353;
}

.kratos-post-content h2 {
	position: relative;
	font-size: 22px;
	margin: 38px 0 18px;
	padding-left: 14px;
	font-weight: 600;
}

.kratos-post-content h2::before {
	content: "";
	position: absolute;
	left: 0;
	top: .35em;
	width: 5px;
	height: 1em;
	border-radius: 3px;
	background: linear-gradient(180deg, var(--moe-pink), var(--moe-blue));
}

.kratos-post-content blockquote {
	border-left: 4px solid rgba(255, 179, 198, .75);
	background: #fbf7f9;
	border-radius: 0 10px 10px 0;
	padding: 16px 20px;
	color: #5b5260;
}

.kratos-post-content img {
	border-radius: 12px;
	height: auto;
}

/* ---------- 返回顶部 ---------- */
#moe-top {
	position: fixed;
	right: 26px;
	bottom: 92px;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 16px;
	cursor: pointer;
	background: linear-gradient(135deg, #ffb3c6, #a8c8f0);
	box-shadow: 0 10px 24px rgba(168, 200, 240, .45);
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: all .3s ease;
	z-index: 9998;
}

#moe-top.on {
	opacity: 1;
	visibility: visible;
	transform: none;
}

#moe-top:hover {
	box-shadow: 0 14px 30px rgba(168, 200, 240, .6);
}

/* ---------- 移动端 ---------- */
@media (max-width: 991px) {
	.kratos-post-inner-new {
		padding: 18px 20px 14px;
	}

	.kratos-entry-title-new {
		font-size: 19px;
	}

	.kratos-post-meta-new {
		padding: 10px 20px;
	}
}

@media (max-width: 767px) {
	#kratos-blog-post {
		padding-top: 12px;
	}

	.kratos-hentry {
		border-radius: 14px;
		margin-bottom: 18px;
	}

	.kratos-entry-thumb-new {
		max-height: 200px;
	}

	.kratos-entry-title-new {
		font-size: 17px;
		margin: 4px 0 8px;
	}

	.kratos-entry-content-new {
		font-size: 13px;
		line-height: 1.8;
	}

	.kratos-post-meta-new {
		font-size: 12px;
		flex-wrap: wrap;
	}

	.kratos-post-meta-new .visible-lg,
	.kratos-post-meta-new .visible-md,
	.kratos-post-meta-new .visible-sm {
		display: none !important;
	}

	#moe-top {
		right: 16px;
		bottom: 78px;
		width: 40px;
		height: 40px;
	}

	.kratos-post-content {
		font-size: 15px;
		line-height: 1.95;
	}

	.kratos-post-content h2 {
		font-size: 19px;
		margin-top: 30px;
	}
}

/* ---------- 无障碍 ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible {
	outline: 2px solid #a8c8f0;
	outline-offset: 2px;
}

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

/* ---------- 卡片高度自适应（修复摘要被裁切） ---------- */
.kratos-post-inner-new {
	height: auto !important;
	min-height: 168px;
}

.kratos-entry-title-new {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.kratos-entry-content-new {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	height: auto !important;
	min-height: 80px;
}

@media (max-width: 767px) {
	.kratos-post-inner-new {
		min-height: 0;
	}

	.kratos-entry-content-new {
		min-height: 0;
	}
}

/* ---------- 搜索按钮尺寸与文字居中 ---------- */
#kratos-widget-area .wp-block-search__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 66px;
	padding: 0 18px !important;
	line-height: 1;
	white-space: nowrap;
}

/* ---------- 移动端左右留白 ---------- */
@media (max-width: 767px) {
	#kratos-blog-post > .container {
		padding-left: 12px;
		padding-right: 12px;
		box-sizing: border-box;
	}

	.kratos-hentry {
		width: 100%;
	}
}

/* ---------- 搜索按钮对比度增强 ---------- */
#kratos-widget-area .wp-block-search__button {
	color: #fff !important;
	background: #e8879f !important;
	text-shadow: 0 1px 2px rgba(120, 60, 80, .22);
	font-weight: 600;
	letter-spacing: .04em;
}

#kratos-widget-area .wp-block-search__button:hover,
#kratos-widget-area .wp-block-search__button:focus {
	background: #d9738e !important;
}
