/*
Theme Name: 浅蓝极简博客
Author: Codex
Description: 一款轻量、双栏、响应式且注重 SEO 的中文博客主题。左侧显示文章列表与正文，右侧提供可配置小工具区域。
Version: 1.0.9.4
Requires at least: 6.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: qinglan-minimal
Tags: blog, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, translation-ready
*/

:root {
	--qm-accent: #2f8fc4;
	--qm-accent-dark: #176d9b;
	--qm-accent-soft: #e9f6fd;
	--qm-bg: #f4f9fc;
	--qm-surface: #ffffff;
	--qm-text: #243542;
	--qm-muted: #647681;
	--qm-border: #dceaf2;
	--qm-radius: 10px;
	--qm-shadow: 0 5px 20px rgba(40, 100, 132, .07);
	--qm-content: 1180px;
}

body.qmb-accent-blue {
	--qm-accent: #2f8fc4;
	--qm-accent-dark: #176d9b;
	--qm-accent-soft: #e9f6fd;
}

body.qmb-accent-teal {
	--qm-accent: #198a87;
	--qm-accent-dark: #116967;
	--qm-accent-soft: #e6f7f5;
}

body.qmb-accent-violet {
	--qm-accent: #6864bb;
	--qm-accent-dark: #4d4994;
	--qm-accent-soft: #f0effb;
}

body.qmb-accent-slate {
	--qm-accent: #496f86;
	--qm-accent-dark: #35586e;
	--qm-accent-soft: #edf4f7;
}

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

html {
	font-size: 16px;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--qm-bg);
	color: var(--qm-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.72;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--qm-accent-dark);
	text-decoration-thickness: 1px;
	text-underline-offset: .18em;
}

a:hover {
	color: var(--qm-accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline: 3px solid rgba(47, 143, 196, .35);
	outline-offset: 2px;
}

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

figure {
	margin: 1.5rem 0;
}

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

.screen-reader-text:focus {
	top: 8px;
	left: 8px;
	z-index: 100000;
	display: block;
	width: auto;
	height: auto;
	padding: 10px 14px;
	clip: auto;
	background: #fff;
	color: #111;
	font-weight: 700;
}

.site-container {
	width: min(calc(100% - 36px), var(--qm-content));
	margin-inline: auto;
}

.site-header {
	background: var(--qm-surface);
	border-top: 4px solid var(--qm-accent);
	border-bottom: 1px solid var(--qm-border);
}

.masthead-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 94px;
	padding-block: 16px;
}

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

.custom-logo-link {
	display: block;
	flex: 0 0 auto;
}

.custom-logo {
	display: block;
	max-width: 72px;
	max-height: 72px;
	object-fit: contain;
}

.site-title {
	margin: 0;
	color: var(--qm-text);
	font-size: clamp(1.35rem, 2.6vw, 1.8rem);
	font-weight: 750;
	line-height: 1.25;
	letter-spacing: -.02em;
}

.site-description {
	margin: 5px 0 0;
	color: var(--qm-muted);
	font-size: .9rem;
}

.search-form {
	display: flex;
	align-items: center;
	width: 100%;
	gap: 8px;
}

.search-field {
	flex: 1 1 auto;
	min-width: 0;
	width: auto;
	height: 36px;
	padding: 5px 10px;
	border: 1px solid var(--qm-border);
	border-radius: 7px;
	background: #fff;
	color: var(--qm-text);
	font: inherit;
	font-size: .9rem;
	line-height: 1.25;
}

.search-form .search-submit {
	flex: 0 0 auto;
	min-width: 56px;
	height: 36px;
	padding: 5px 12px;
	font-size: .9rem;
	line-height: 1.25;
	white-space: nowrap;
	word-break: keep-all;
	writing-mode: horizontal-tb;
}

.search-submit,
.button,
button,
input[type="submit"] {
	padding: 9px 15px;
	border: 0;
	border-radius: 7px;
	background: var(--qm-accent);
	color: #fff;
	font: inherit;
	font-weight: 650;
	cursor: pointer;
}

.search-submit:hover,
.button:hover,
button:hover,
input[type="submit"]:hover {
	background: var(--qm-accent-dark);
	color: #fff;
}

.primary-nav-wrap {
	background: var(--qm-accent-soft);
	border-top: 1px solid var(--qm-border);
	border-bottom: 1px solid var(--qm-border);
}

.primary-navigation {
	display: flex;
	align-items: center;
	min-height: 48px;
	overflow-x: auto;
	scrollbar-width: thin;
}

.primary-navigation ul {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.primary-navigation li {
	position: relative;
	flex: 0 0 auto;
}

.primary-navigation a {
	display: block;
	padding: 10px 12px;
	border-radius: 6px;
	color: var(--qm-text);
	font-size: .94rem;
	font-weight: 600;
	text-decoration: none;
}

.primary-navigation a:hover,
.primary-navigation .current-menu-item > a,
.primary-navigation .current-menu-ancestor > a {
	background: rgba(47, 143, 196, .12);
	color: var(--qm-accent-dark);
}

.primary-navigation .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 20;
	min-width: 180px;
	padding: 8px;
	border: 1px solid var(--qm-border);
	border-radius: 8px;
	background: #fff;
	box-shadow: var(--qm-shadow);
}

.primary-navigation li:hover > .sub-menu,
.primary-navigation li:focus-within > .sub-menu {
	display: block;
}

.primary-navigation .sub-menu .sub-menu {
	top: 0;
	left: 100%;
}

.breadcrumb-wrap {
	background: #fff;
}

.breadcrumb {
	padding-block: 11px;
	padding-inline: 12px;
	color: var(--qm-muted);
	font-size: .86rem;
	overflow-wrap: anywhere;
}

.breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.breadcrumb li:not(:last-child)::after {
	margin-left: 4px;
	color: #9aabb4;
	content: "/";
}

.breadcrumb a {
	color: var(--qm-muted);
	text-decoration: none;
}

.breadcrumb a:hover {
	color: var(--qm-accent);
}

.meta-tags a,
.tags-links a {
	text-decoration: none;
}

.meta-tags a:hover,
.tags-links a:hover {
	color: var(--qm-accent);
}

.site-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 28px;
	align-items: start;
	padding-block: 30px 42px;
}

.site-main,
.sidebar {
	min-width: 0;
}

.page-header,
.single-article,
.page-article,
.not-found {
	padding: clamp(22px, 4vw, 38px);
	border: 1px solid var(--qm-border);
	border-radius: var(--qm-radius);
	background: var(--qm-surface);
	box-shadow: var(--qm-shadow);
}

.page-header {
	margin-bottom: 18px;
	padding-block: 20px;
}

/* 首页和分类文章列表不显示任何顶部查询标题。 */
body.home .site-main > .page-header,
body.blog .site-main > .page-header,
body.category .site-main > .page-header,
body.home .page-article > .entry-header,
body.home .site-main > .wp-block-query-title,
body.blog .site-main > .wp-block-query-title,
body.category .site-main > .wp-block-query-title,
body.home .entry-content > .wp-block-query-title,
body.category .entry-content > .wp-block-query-title {
	display: none;
}

.page-title,
.entry-title {
	margin: 0;
	color: #172a36;
	font-weight: 750;
	line-height: 1.35;
	letter-spacing: -.02em;
	overflow-wrap: anywhere;
}

.page-title {
	font-size: clamp(1.55rem, 3vw, 1.95rem);
}

.single-article .entry-title,
.page-article .entry-title {
	font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.archive-description {
	margin-top: 8px;
	color: var(--qm-muted);
}

.archive-description > :last-child {
	margin-bottom: 0;
}

.post-list {
	display: grid;
	gap: 12px;
}

.post-card {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	overflow: hidden;
	border: 1px solid var(--qm-border);
	border-radius: var(--qm-radius);
	background: var(--qm-surface);
	box-shadow: var(--qm-shadow);
}

.post-card.no-thumbnail {
	grid-template-columns: 1fr;
}

.post-card-thumbnail {
	display: block;
	min-height: 100%;
	background: var(--qm-accent-soft);
}

.post-card-thumbnail img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 220px;
	object-fit: cover;
}

.post-card-body {
	padding: 17px 20px;
}

.post-card .entry-title {
	font-size: clamp(1.28rem, 2.4vw, 1.5rem);
}

.post-card .entry-title a {
	color: #172a36;
	text-decoration: none;
}

.post-card .entry-title a:hover {
	color: var(--qm-accent-dark);
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 5px 14px;
	margin-top: 10px;
	color: var(--qm-muted);
	font-size: .82rem;
}

.entry-meta a {
	color: var(--qm-muted);
}

.post-card .entry-meta {
	gap: 4px 12px;
	margin-top: 6px;
	line-height: 1.45;
}

.entry-summary {
	margin-top: 8px;
	color: #40535f;
}

.post-card .entry-summary {
	line-height: 1.55;
}

.post-card .entry-summary p {
	margin: 0;
}

.entry-summary > :last-child {
	margin-bottom: 0;
}

.single-article .entry-header,
.page-article .entry-header {
	margin-bottom: 25px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--qm-border);
}

.single-thumbnail {
	margin: 0 0 28px;
	overflow: hidden;
	border-radius: 8px;
}

.single-thumbnail img {
	display: block;
	width: 100%;
}

.entry-content {
	font-size: 1.0625rem;
	line-height: 1.82;
	overflow-wrap: anywhere;
}

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

.entry-content > :last-child {
	margin-bottom: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	margin-top: 1.8em;
	margin-bottom: .7em;
	color: #172a36;
	line-height: 1.4;
}

.entry-content h2 {
	font-size: 1.55rem;
	padding-left: 12px;
	border-left: 4px solid var(--qm-accent);
}

.entry-content h3 {
	font-size: 1.3rem;
}

.entry-content h4 {
	font-size: 1.12rem;
}

.entry-content blockquote {
	margin: 1.5em 0;
	padding: 14px 20px;
	border-left: 4px solid var(--qm-accent);
	background: var(--qm-accent-soft);
	color: #3d5564;
}

.entry-content pre,
.entry-content code {
	font-family: SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.entry-content pre {
	max-width: 100%;
	padding: 16px;
	overflow-x: auto;
	border-radius: 7px;
	background: #172a36;
	color: #eaf6fb;
}

.entry-content table {
	width: 100%;
	margin: 1.5em 0;
	border-collapse: collapse;
}

.entry-content th,
.entry-content td {
	padding: 9px 11px;
	border: 1px solid var(--qm-border);
	text-align: left;
}

.entry-content th {
	background: var(--qm-accent-soft);
}

.entry-footer {
	margin-top: 28px;
	padding-top: 18px;
	border-top: 1px solid var(--qm-border);
	color: var(--qm-muted);
	font-size: .9rem;
}

.entry-footer > span {
	display: block;
	margin-top: 5px;
}

.post-navigation {
	margin-top: 20px;
}

.post-navigation-grid {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 14px;
}

.post-nav-item {
	min-width: 0;
}

.post-navigation a,
.post-nav-item.is-unavailable {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 88px;
	padding: 14px 16px;
	border: 1px solid var(--qm-border);
	border-radius: 8px;
	background: #fff;
	text-decoration: none;
}

.post-navigation a {
	height: 100%;
}

.post-nav-next {
	text-align: right;
}

.post-nav-item.is-unavailable {
	border-style: dashed;
	background: #f8fcfe;
	color: var(--qm-muted);
}

.nav-subtitle {
	display: block;
	color: var(--qm-muted);
	font-size: .78rem;
}

.nav-title {
	display: block;
	font-weight: 650;
	overflow-wrap: anywhere;
}

.post-nav-empty {
	display: block;
	font-size: .92rem;
}

.pagination {
	margin-top: 24px;
}

.pagination .nav-links,
.page-links {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.page-numbers,
.page-links > a,
.page-links > span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	min-height: 38px;
	padding: 5px 10px;
	border: 1px solid var(--qm-border);
	border-radius: 6px;
	background: #fff;
	text-decoration: none;
}

.page-numbers.current,
.page-links > .current {
	border-color: var(--qm-accent);
	background: var(--qm-accent);
	color: #fff;
}

.sidebar {
	position: sticky;
	top: 20px;
	display: grid;
	gap: 18px;
}

.widget {
	padding: 15px 16px;
	border: 1px solid var(--qm-border);
	border-radius: var(--qm-radius);
	background: var(--qm-surface);
	box-shadow: var(--qm-shadow);
}

.widget-title {
	margin: 0 0 10px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--qm-accent-soft);
	color: #172a36;
	font-size: 1.05rem;
	line-height: 1.4;
}

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

.widget li {
	padding: 2px 0;
	line-height: 1.38;
}

.widget li + li {
	margin-top: 1px;
}

.widget .search-form {
	gap: 6px;
}

.widget .search-field,
.widget .search-form .search-submit {
	height: 32px;
}

.widget .search-form .search-submit {
	min-width: 54px;
	padding-inline: 10px;
}

/* WordPress “搜索”区块小工具使用独立的 class，需单独压缩。 */
.sidebar .wp-block-search__inside-wrapper {
	display: flex;
	align-items: center;
	width: 100%;
	gap: 6px;
}

.sidebar .wp-block-search__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 32px;
	margin: 0;
	padding: 4px 9px;
	border: 1px solid var(--qm-border);
	border-radius: 7px;
	font: inherit;
	font-size: .88rem;
	line-height: 1.2;
}

.sidebar .wp-block-search__button {
	flex: 0 0 auto;
	min-width: 54px;
	height: 32px;
	margin: 0;
	padding: 4px 10px;
	border-radius: 7px;
	font: inherit;
	font-size: .88rem;
	line-height: 1.2;
	white-space: nowrap;
	word-break: keep-all;
	writing-mode: horizontal-tb;
}

.widget a {
	text-decoration: none;
}

.widget_recent_entries .post-date,
.related-post-date {
	display: block;
	margin-top: 2px;
	color: var(--qm-muted);
	font-size: .78rem;
}

.tagcloud {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.tag-cloud-link {
	display: inline-block;
	padding: 4px 9px;
	border: 1px solid var(--qm-border);
	border-radius: 999px;
	background: var(--qm-accent-soft);
	font-size: .82rem !important;
}

.site-footer {
	border-top: 1px solid var(--qm-border);
	background: var(--qm-accent-soft);
	color: #526773;
}

.footer-inner {
	padding-block: 26px;
	text-align: center;
}

.friend-links {
	margin-bottom: 22px;
	padding-bottom: 20px;
	border-bottom: 1px solid rgba(47, 143, 196, .18);
	text-align: left;
}

.friend-links-title {
	margin: 0 0 10px;
	color: #263d4b;
	font-size: 1rem;
}

.friend-links-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.friend-links-list a {
	display: inline-block;
	color: #526773;
	font-size: .9rem;
	text-decoration: none;
}

.friend-links-list a:hover {
	color: var(--qm-accent-dark);
	text-decoration: underline;
}

.footer-inner p {
	margin: 0;
}

.footer-description {
	margin-top: 5px !important;
	font-size: .86rem;
}

.alignwide {
	max-width: 100%;
}

.alignleft {
	float: left;
	margin: .4em 1.4em 1em 0;
}

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

.aligncenter {
	display: block;
	margin-right: auto;
	margin-left: auto;
}

.wp-caption-text,
.gallery-caption {
	color: var(--qm-muted);
	font-size: .84rem;
	text-align: center;
}

.sticky {
	border-top: 4px solid var(--qm-accent);
}

@media (max-width: 900px) {
	.site-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.sidebar {
		position: static;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.widget:last-child:nth-child(odd) {
		grid-column: 1 / -1;
	}
}

@media (max-width: 680px) {
	.site-container {
		width: min(calc(100% - 24px), var(--qm-content));
	}

	.masthead-inner {
		align-items: stretch;
		flex-direction: column;
		min-height: auto;
	}

	.primary-navigation .sub-menu {
		display: none !important;
	}

	.site-layout {
		gap: 20px;
		padding-block: 20px 32px;
	}

	.post-card {
		grid-template-columns: 1fr;
	}

	.post-card-thumbnail img {
		min-height: 190px;
		max-height: 260px;
	}

	.page-header,
	.single-article,
	.page-article,
	.not-found {
		padding: 20px;
	}

	.sidebar {
		grid-template-columns: 1fr;
	}

	.widget:last-child:nth-child(odd) {
		grid-column: auto;
	}

	.post-navigation-grid {
		grid-template-columns: 1fr;
	}

	.post-nav-next {
		text-align: left;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

@media print {
	.site-header,
	.sidebar,
	.site-footer,
	.post-navigation {
		display: none !important;
	}

	body,
	.site-layout,
	.single-article,
	.page-article {
		background: #fff;
		box-shadow: none;
	}

	.site-layout {
		display: block;
		width: 100%;
	}
}
