/* ============================================================
   布局优化层
   ------------------------------------------------------------
   保留原主题骨架：顶部白条 + 站点标题区 + 青色主导航
                    + 左内容 / 右侧栏 + 卡片式列表
   重做间距、对齐、层级与交互反馈，按现代中文技术博客的阅读习惯。
   本文件加载在 style.css / mediaqueries.css / fixes.css 之后。
   ============================================================ */

:root {
	--al-accent: #04a4cc;
	--al-accent-dark: #0389aa;
	--al-text: #333;
	--al-muted: #8b8b8b;
	--al-line: #e8e8e8;
	--al-line-strong: #d9d9d9;
	--al-bg-soft: #fafafa;
}

/* ============================================================
   1. 顶部白条
   ============================================================ */
#header-top {
	height: 44px;
	background: #fff;
	border-bottom: 1px solid var(--al-line);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

#top-nav {
	display: flex;
	align-items: stretch;
	width: 1080px;
	height: 44px;
	margin: 0 auto;
}

#top-nav .home_h {
	float: none;
	display: flex;
}

#top-nav .home_h a {
	float: none;
	width: 46px;
	height: 44px;
	line-height: 44px;
	font-size: 18px;
	color: #999;
	border: none;
	border-right: 1px solid var(--al-line);
	background: transparent;
}

#top-nav .home_h a:hover {
	background: var(--al-bg-soft);
	color: var(--al-accent);
}

#top-nav ul.menu {
	display: flex;
	align-items: stretch;
	float: none;
	height: 44px;
	margin: 0;
	padding: 0;
	list-style: none;
}

#top-nav ul.menu li.menu-item {
	display: flex;
	float: none;
	height: 44px;
	border: none;
}

#top-nav ul.menu li.menu-item > a {
	display: flex;
	align-items: center;
	height: 44px;
	padding: 0 16px;
	font-size: 13px;
	color: #666;
	text-decoration: none;
	border-bottom: 2px solid transparent;
	transition: color 0.15s, border-color 0.15s;
}

#top-nav ul.menu li.menu-item > a:hover {
	color: var(--al-accent);
	border-bottom-color: var(--al-accent);
	background: transparent;
}

#top-nav ul.menu li.current-menu-item,
#top-nav ul.menu li.current_page_item {
	background: transparent;
}

#top-nav ul.menu li.current-menu-item > a,
#top-nav ul.menu li.current_page_item > a {
	color: var(--al-accent) !important;
	font-weight: 600;
	border-bottom-color: var(--al-accent);
}

/* ============================================================
   2. 站点标题区
   ============================================================ */
.main-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	float: none;
	padding: 16px 0 14px;
	margin: 0;
	overflow: visible;
}

.logo-main {
	float: none;
	padding: 0;
}

.title-main {
	margin: 0;
}

.main-header h1.site-title {
	font-size: 22px;
	line-height: 1.3;
	margin: 0;
	letter-spacing: 0.5px;
}

.main-header h1.site-title a {
	color: var(--al-text);
}

.main-header h1.site-title a:hover {
	color: var(--al-accent);
}

.main-header h2#site-description {
	font-size: 13px;
	color: var(--al-muted);
	margin: 5px 0 0;
	font-weight: 400;
}

#set-main {
	float: none;
	display: flex;
	align-items: center;
	height: auto;
	margin: 0;
	padding: 0;
}

#nav-search {
	display: flex;
}

#searchform div {
	display: flex;
	align-items: center;
}

#searchform #s {
	width: 200px;
	height: 34px;
	line-height: 34px;
	padding: 0 12px;
	font-size: 13px;
	color: var(--al-text);
	background: #fff;
	border: 1px solid var(--al-line-strong);
	border-right: none;
	border-radius: 2px 0 0 2px;
	box-shadow: none;
	box-sizing: border-box;
}

#searchform #s:focus {
	outline: none;
	border-color: var(--al-accent);
}

#searchform #searchsubmit {
	width: 46px;
	height: 34px;
	padding: 0;
	font-size: 15px;
	color: #fff;
	background: var(--al-accent);
	border: 1px solid var(--al-accent);
	border-radius: 0 2px 2px 0;
	cursor: pointer;
	transition: background 0.15s;
}

#searchform #searchsubmit:hover {
	background: var(--al-accent-dark);
	border-color: var(--al-accent-dark);
}

/* ============================================================
   3. 青色主导航
   ============================================================ */
#site-nav {
	display: flex;
	align-items: stretch;
	height: 44px;
	background: var(--al-accent);
	border-radius: 2px 2px 0 0;
	overflow: hidden;
}

#site-nav ul.menu {
	display: flex;
	align-items: stretch;
	float: none;
	margin: 0;
	padding: 0;
	list-style: none;
}

#site-nav ul.menu li.menu-item {
	display: flex;
	float: none;
	height: 44px;
	border: none;
}

#site-nav ul.menu li.menu-item > a {
	display: flex;
	align-items: center;
	height: 44px;
	line-height: 1;
	padding: 0 24px;
	font-size: 14px;
	color: #fff;
	text-decoration: none;
	background: transparent;
	transition: background 0.15s;
}

#site-nav ul.menu li.menu-item > a:hover {
	background: rgba(0, 0, 0, 0.12);
}

#site-nav ul.menu li.current-menu-item > a,
#site-nav ul.menu li.current-cat > a,
#site-nav ul.menu li.current-menu-parent > a {
	background: rgba(0, 0, 0, 0.16);
	font-weight: 600;
}

/* ============================================================
   4. 面包屑
   ============================================================ */
.crumbs {
	float: none;
	width: auto;
	margin: 0 0 12px;
	padding: 8px 14px;
	font-size: 13px;
	color: var(--al-muted);
	background: var(--al-bg-soft);
	border: 1px solid var(--al-line);
	border-top: none;
	border-radius: 0 0 2px 2px;
	line-height: 1.6;
	box-sizing: border-box;
}

.crumbs a {
	color: #777;
}

.crumbs a:hover {
	color: var(--al-accent);
}

/* ============================================================
   5. 文章卡片
   ============================================================ */
.content {
	padding: 18px 22px;
	margin-bottom: 14px;
	background: #fff;
	border: 1px solid var(--al-line);
	border-radius: 2px;
	transition: box-shadow 0.18s, border-color 0.18s;
}

.content:hover {
	border-color: var(--al-line-strong);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.entry-header h1.entry-title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.5;
	margin: 0 0 8px;
}

.entry-header h1.entry-title a {
	color: var(--al-text);
}

.entry-header h1.entry-title a:hover {
	color: var(--al-accent);
}

.title-heavy {
	top: 3px;
}

.entry-site {
	font-size: 14px;
	line-height: 1.8;
	color: #555;
}

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

/* 元信息与"阅读全文"同一行，去掉绝对定位 */
.entry-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid #f0f0f0;
	font-size: 12px;
}

.entry-meta .meta-site {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	color: var(--al-muted);
}

.entry-more {
	flex: 0 0 auto;
}

.entry-more a {
	position: static;
	display: inline-block;
	padding: 4px 12px;
	font-size: 12px;
	color: #fff;
	background: var(--al-accent);
	border: 1px solid var(--al-accent);
	border-radius: 2px;
	line-height: 1.6;
	transition: background 0.15s, color 0.15s;
}

.entry-more a:hover {
	color: var(--al-accent);
	background: #fff;
	border-color: var(--al-accent);
}

/* 缩略图 */
.thumbnail {
	float: left;
	margin: 3px 16px 4px 0;
}

.thumbnail img.home-thumb,
.thumbnail img {
	width: 150px;
	height: 104px;
	object-fit: cover;
	border: 1px solid var(--al-line);
	border-radius: 2px;
	background: var(--al-bg-soft);
}

/* ============================================================
   6. 侧栏
   ============================================================ */
#sidebar .widget {
	margin-bottom: 14px;
	background: #fff;
	border: 1px solid var(--al-line);
	border-radius: 2px;
	overflow: hidden;
}

#sidebar .widget-title,
#sidebar .widget h3 {
	position: relative;
	height: auto;
	line-height: 1.4;
	margin: 0;
	padding: 11px 14px 11px 16px;
	font-size: 14px;
	font-weight: 600;
	color: var(--al-text);
	background: var(--al-bg-soft);
	border-bottom: 1px solid var(--al-line);
}

#sidebar .widget-title::before,
#sidebar .widget h3::before {
	content: "";
	position: absolute;
	left: 0;
	top: 11px;
	bottom: 11px;
	width: 3px;
	background: var(--al-accent);
	border-radius: 0 2px 2px 0;
}

#sidebar .widget ul {
	margin: 0;
	padding: 8px 14px 10px;
	list-style: none;
}

#sidebar .widget ul li {
	line-height: 1.75;
	padding: 0;
	border: none;
}

#sidebar .widget ul li a {
	color: #555;
	font-size: 13px;
	transition: color 0.15s;
}

#sidebar .widget ul li a:hover {
	color: var(--al-accent);
}

#sidebar .widget ul li ul.children {
	padding: 2px 0 2px 14px;
}

/* 分类/归档计数弱化 */
#sidebar .widget .count,
#sidebar .widget .cat-item .count {
	color: #aaa;
	font-size: 12px;
}

/* ============================================================
   7. 分页
   ============================================================ */
#pagenavi {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	float: none;
	clear: both;
	padding: 14px 0 4px;
}

#pagenavi span,
#pagenavi a {
	float: none;
	display: inline-block;
	min-width: 32px;
	height: 32px;
	padding: 0 10px;
	margin: 0;
	line-height: 30px;
	text-align: center;
	font-size: 13px;
	color: #666;
	background: #fff;
	border: 1px solid var(--al-line-strong);
	border-radius: 2px;
}

#pagenavi a:hover {
	color: var(--al-accent);
	border-color: var(--al-accent);
}

#pagenavi span.current {
	color: #fff;
	background: var(--al-accent);
	border-color: var(--al-accent);
}

#pagenavi span.pages {
	min-width: auto;
	color: var(--al-muted);
	background: transparent;
	border: none;
	padding-left: 0;
}

/* ============================================================
   8. 移动端：保持可读
   ============================================================ */
@media screen and (max-width: 900px) {
	.main-header {
		display: block;
		padding: 12px 0 10px;
	}

	#set-main {
		margin-top: 10px;
	}

	#searchform #s {
		width: 100%;
	}

	.content {
		padding: 14px;
	}

	.thumbnail img.home-thumb,
	.thumbnail img {
		width: 110px;
		height: 78px;
	}

	.entry-meta {
		flex-wrap: wrap;
		gap: 8px;
	}

	.entry-meta .meta-site {
		gap: 10px;
	}

	.crumbs {
		padding: 6px 10px;
	}
}

/* ============================================================
   9. 文章页排版优化
   ============================================================ */
.single-header {
	margin: 0 0 14px;
}

.single-header h1.single-title {
	font-size: 20px;
	line-height: 1.5;
	font-weight: 600;
	margin: 0 0 8px;
	color: var(--al-text);
}

.single-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	font-size: 12px;
	color: var(--al-muted);
}

.single-meta a {
	color: var(--al-muted);
}

.single-meta a:hover {
	color: var(--al-accent);
}

/* 正文小标题：去掉 3em 缩进与负边距，改为紧凑的左侧色条 */
.single-content-article h1,
.single-content-article h2,
.single-content-article h3,
.single-content h1,
.single-content h2,
.single-content h3 {
	position: relative;
	font-size: 16px;
	line-height: 1.6;
	font-weight: 600;
	color: var(--al-text);
	text-indent: 0;
	margin: 22px 0 10px;
	padding: 0 0 0 12px;
	border-left: 3px solid var(--al-accent);
}

.single-content-article h1:first-child,
.single-content-article h2:first-child,
.single-content h1:first-child {
	margin-top: 0;
}

.single-content-article p,
.single-content p {
	text-indent: 2em;
	margin: 0 0 10px;
	line-height: 1.85;
	color: #444;
}

.single-content-article blockquote,
.single-content blockquote {
	margin: 14px 0;
	padding: 10px 16px;
	background: var(--al-bg-soft);
	border-left: 3px solid var(--al-line-strong);
	color: #666;
	font-size: 13px;
}

.single-content-article img,
.single-content img {
	border-radius: 2px;
}

/* 上下篇 */
.nav-single {
	margin: 14px 0;
	padding: 12px 16px;
	background: #fff;
	border: 1px solid var(--al-line);
	border-radius: 2px;
	font-size: 13px;
	line-height: 2;
}

.single-tag {
	margin: 14px 0 0;
	padding: 10px 16px;
	background: #fff;
	border: 1px solid var(--al-line);
	border-radius: 2px;
	font-size: 13px;
}

/* ============================================================
   10. 窄屏修正：解除原主题的固定高度裁切
   原 mediaqueries.css 用 height + overflow:hidden 固定卡片高度，
   窄屏下会把摘要截成半截，改为自然撑开
   ============================================================ */
@media screen and (max-width: 1024px) {
	.entry-site {
		height: auto !important;
		overflow: visible !important;
	}
}

@media screen and (max-width: 900px) {
	.entry-content {
		height: auto !important;
		overflow: visible !important;
	}

	.entry-site {
		height: auto !important;
		overflow: visible !important;
		word-break: break-word;
	}

	.content {
		overflow: visible;
	}

	/* 窄屏缩略图与文字的两栏关系 */
	.thumbnail {
		margin: 2px 12px 6px 0;
	}

	.thumbnail img.home-thumb,
	.thumbnail img {
		width: 104px !important;
		height: 74px !important;
	}

	.entry-header h1.entry-title {
		font-size: 15px;
		white-space: normal;
		overflow: visible;
		text-overflow: clip;
	}

	/* 元信息与按钮堆叠更自然 */
	.entry-meta {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.entry-meta .meta-site {
		gap: 10px;
		font-size: 12px;
	}

	.entry-more {
		align-self: flex-end;
	}

	/* 简化头部：图标与站点名垂直居中 */
	#simple-top {
		display: flex;
		align-items: center;
		height: 48px;
		line-height: 48px;
		padding: 0 10px;
		background: #fff;
		border-bottom: 1px solid var(--al-line);
	}

	#simple-menu {
		display: inline-flex;
		align-items: center;
		margin-right: 10px;
	}

	.logo-simple {
		float: none;
		width: auto;
		line-height: 48px;
	}

	.logo-simple .logo-title,
	#simple-top .logo-title {
		font-size: 17px;
		line-height: 48px;
		margin: 0;
		padding: 0;
		font-weight: 600;
	}

	/* 面包屑在窄屏不显示排序链接，避免占位 */
	.crumbs {
		border-radius: 0;
		border-left: none;
		border-right: none;
		margin-bottom: 10px;
	}
}

@media screen and (max-width: 550px) {
	.entry-content,
	.entry-site {
		height: auto !important;
		overflow: visible !important;
	}
}
