/*
Theme Name: push-dux
Description: 对手同款 DUX 展示界面（手写复刻：固定顶栏、两栏布局、文章页白卡片、文末签名、上下篇、相关推荐）
Author: push
Version: 1.0.0
*/

/* ============ 0. 变量与基础 ============ */
:root {
	--tb--main: #007bff;
	--tb--base: #333;
	--tb--white: #fff;
	--tb--bdbg: #f4f4f4;
	--tb--tint: #fbfbfb;
	--tb--line: #f3f3f3;
	--tb--gray: #999;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	padding-top: 70px;
	font-family: "Microsoft Yahei", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: var(--tb--base);
	background-color: var(--tb--bdbg);
	-webkit-font-smoothing: antialiased;
	word-wrap: break-word;
}

a { color: var(--tb--base); text-decoration: none; }
a:hover { color: var(--tb--main); }

h1, h2, h3, h4, h5, h6 { font-weight: bold; }
ul, ol, p { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { border: 0; vertical-align: middle; }
time { color: inherit; }

.container { max-width: 1240px; padding: 0 20px; margin: 0 auto; }
.container::after { content: ""; display: block; clear: both; }

/* ============ 1. 顶栏（固定） ============ */
.header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	padding: 15px 0;
	z-index: 999;
	background-color: var(--tb--white);
	box-shadow: 0 1px 5px rgba(0, 0, 0, .02);
}

.admin-bar .header { top: 32px; }

.header::after { content: ""; display: block; clear: both; }

.logo { float: left; }
.logo a {
	display: block;
	height: 32px;
	line-height: 32px;
	font-size: 28px;
	font-weight: bold;
	letter-spacing: 1px;
	color: var(--tb--main);
	white-space: nowrap;
}

.site-navbar { float: right; }
.site-navbar::after { content: ""; display: block; clear: both; }
.site-navbar li { position: relative; float: left; font-size: 17px; }
.site-navbar > ul > li { margin-left: 25px; }
.site-navbar li:hover { z-index: 2; }
.site-navbar a { display: block; padding: 3px 0; }
.site-navbar a:hover,
.site-navbar li.current-menu-item > a,
.site-navbar li.current_page_item > a { color: var(--tb--main); }

/* 下拉子菜单 */
.site-navbar .sub-menu {
	visibility: hidden;
	opacity: 0;
	z-index: -1;
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	margin-top: 8px;
	background-color: var(--tb--white);
	font-size: 14px;
	padding: 6px 0;
	min-width: 160px;
	box-shadow: 0 0 5px rgba(0, 0, 0, .1);
	line-height: 1.4;
	text-align: center;
	border-radius: 6px;
	transition: all .3s ease-in-out;
}
.site-navbar .sub-menu li { float: none; margin-left: 0; display: block; white-space: nowrap; }
.site-navbar .sub-menu a { padding: 7px 10px; }
.site-navbar .sub-menu a:hover { color: var(--tb--base); background-color: var(--tb--bdbg); }
.site-navbar li:hover > .sub-menu { visibility: visible; opacity: 1; margin-top: 3px; }

/* 顶栏搜索 */
.site-search-form { float: right; margin-left: 20px; }
.site-search-form form::after { content: ""; display: block; clear: both; }
.search-input {
	float: left;
	width: 160px;
	height: 32px;
	line-height: 32px;
	font-size: 14px;
	padding: 0 10px;
	border: 1px solid #eee;
	border-right: none;
	border-radius: 6px 0 0 6px;
	outline: none;
	color: var(--tb--base);
	background-color: var(--tb--white);
}
.search-input:focus { border-color: var(--tb--main); }
.search-btn {
	float: left;
	width: 36px;
	height: 32px;
	padding: 0;
	border: 1px solid #eee;
	border-radius: 0 6px 6px 0;
	background-color: var(--tb--tint);
	color: var(--tb--gray);
	font-size: 14px;
	cursor: pointer;
}
.search-btn:hover { color: var(--tb--main); }

/* ============ 2. 两栏布局 ============ */
.content-wrap { width: 100%; float: left; }
.content {
	position: relative;
	min-height: 600px;
	margin-right: 380px;
	margin-bottom: 20px;
}
.content::after { content: ""; display: block; clear: both; }

.sidebar {
	float: left;
	margin-left: -360px;
	width: 360px;
	position: relative;
}

/* ============ 3. 列表卡片 ============ */
.excerpt {
	padding: 20px 20px 20px 220px;
	overflow: hidden;
	background-color: var(--tb--white);
	border-bottom: 1px solid var(--tb--line);
}
.excerpt:first-of-type { border-radius: 6px 6px 0 0; }
.excerpt:nth-last-of-type(1) { border-radius: 0 0 6px 6px; }
.excerpt .focus {
	float: left;
	margin-left: -200px;
	width: 180px;
	height: 123px;
	display: flex;
	border-radius: 6px;
	overflow: hidden;
}
.excerpt .focus img { flex: 1; width: 100%; height: 100%; object-fit: cover; }
.excerpt header { position: relative; margin-bottom: 10px; }
.excerpt h2 { display: inline; font-size: 18px; margin-top: 0; font-weight: bold; }
.excerpt h2 a:hover { color: var(--tb--main); }
.excerpt .note {
	font-size: 14px;
	color: #666;
	margin-bottom: 0;
	max-height: 46px;
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}
.excerpt .cat, .excerpt time, .excerpt .-tags, .excerpt .author { margin-right: 15px; display: inline-block; }
.excerpt .author img {
	vertical-align: middle;
	display: inline-block;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	margin-right: 8px;
}
.excerpt .meta { color: var(--tb--gray); margin-top: 20px; overflow: hidden; height: 24px; }
.excerpt .meta a { color: var(--tb--gray); }
.excerpt .meta a:hover { color: var(--tb--main); }
.excerpt .-tags { display: inline; }
.excerpt .-tags a { margin-right: 22px; display: inline-block; position: relative; }
.excerpt .-tags a::before {
	display: inline-block;
	content: "";
	position: absolute;
	top: 9px;
	left: -13px;
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background-color: var(--tb--gray);
}
.excerpt .-tags a:first-child::before { display: none; }
.excerpt .-tags a:last-child { margin-right: 0; }

/* 无缩略图变体 */
.excerpt-text { padding-left: 20px; }
.excerpt-text .note { margin-bottom: 0; }

/* 归档/作者页标题条 */
.catleader {
	background-color: var(--tb--white);
	border-radius: 6px 6px 0 0;
	padding: 17px 20px;
	border-bottom: 1px solid var(--tb--line);
}
.catleader h1 { position: relative; font-size: 17px; margin: 0; padding-left: 17px; font-weight: bold; }
.catleader h1::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	margin-top: -8px;
	height: 16px;
	width: 4px;
	border-radius: 10px;
	background-color: var(--tb--main);
}
.catleader h1 small { color: #999; font-size: 14px; font-weight: normal; position: relative; top: -1px; margin-left: 15px; }

/* 无内容卡片 */
.no-content {
	background-color: var(--tb--white);
	border-radius: 6px;
	padding: 60px 20px;
	text-align: center;
	color: var(--tb--gray);
}

/* ============ 4. 分页 ============ */
.pagination { padding: 20px; text-align: center; }
.pagination ul::after { content: ""; display: block; clear: both; }
.pagination li { vertical-align: top; display: inline-block; }
.pagination a, .pagination span {
	display: block;
	margin: 0 3px;
	padding: 7px 15px;
	background-color: #eee;
	color: #777;
	border-radius: 6px;
	border: 1px solid transparent;
}
.pagination a:hover, .pagination a:focus {
	color: var(--tb--main);
	border-color: var(--tb--main);
	background-color: transparent;
}
.pagination .page-numbers.current { cursor: default; background-color: var(--tb--main); color: #fff; }

/* ============ 5. 文章页（白卡片） ============ */
.single .content {
	background-color: var(--tb--white);
	border-radius: 6px;
	padding: 30px;
}

.article-header { margin-bottom: 30px; text-align: center; }
.article-title { font-size: 25px; margin: 0; line-height: 1.4; }
.article-meta { margin-top: 10px; color: var(--tb--gray); }
.article-meta .item { margin-right: 15px; }
.article-meta a { color: var(--tb--gray); }
.article-meta a:hover { color: var(--tb--main); }

/* 正文排版 */
.article-content {
	font-size: 16px;
	line-height: 1.8;
	word-wrap: break-word;
}
.article-content::after { display: block; clear: both; content: ""; }
.article-content img { margin: 0 auto; display: block; max-width: 100%; height: auto; }
.article-content h1, .article-content h2, .article-content h3,
.article-content h4, .article-content h5, .article-content h6 {
	line-height: 1.4;
	font-weight: bold;
	margin: 20px 0;
	padding: 0;
}
.article-content h1 { font-size: 24px; }
.article-content h2 {
	font-size: 22px;
	position: relative;
	padding-left: 22px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--tb--line);
}
.article-content h2::before {
	position: absolute;
	left: 0;
	top: 5px;
	bottom: 13px;
	content: "";
	width: 5px;
	border-radius: 10px;
	background-color: var(--tb--main);
}
.article-content h3 { font-size: 20px; }
.article-content h4 { font-size: 18px; }
.article-content h5, .article-content h6 { font-size: 16px; }
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content ul, .article-content ol { margin: 0 0 20px 50px; }
.article-content li { margin-bottom: 6px; }
.article-content p { margin: 20px 0; word-wrap: break-word; }
.article-content a { text-decoration: underline; color: var(--tb--main); }
.article-content a:hover { color: #ff5e52; }
.article-content blockquote {
	margin: 30px;
	padding: 10px 20px;
	font-size: 16px;
	color: #999;
	border-left: 4px solid var(--tb--line);
}
.article-content blockquote p { margin: 0 0 10px; }
.article-content code {
	position: relative;
	top: -1px;
	display: inline-block;
	margin: 0 5px;
	padding: 0 10px;
	font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	border-radius: 6px;
	opacity: .8;
	font-size: 14px;
	color: #d76821;
	background-color: var(--tb--tint);
}
.article-content pre { word-wrap: break-word; }
.article-content pre code { top: 0; margin: 0; padding: 0; border-radius: 0; opacity: 1; font-size: inherit; font-family: inherit; background-color: transparent; }
.article-content table { width: 100%; margin-bottom: 20px; border-collapse: collapse; }
.article-content td, .article-content th { padding: 8px 12px; border: 1px solid #eee; }
.article-content .alignleft { float: left; text-align: left; margin-right: 10px; }
.article-content .aligncenter { margin: 0 auto; text-align: center; display: block; }
.article-content .alignright { float: right; text-align: right; margin-left: 10px; }
.article-content .wp-caption { margin-bottom: 20px; max-width: 100%; }
.article-content .wp-block-image { text-align: center; }
.article-content h2[id], .article-content h3[id] { scroll-margin-top: 75px; }

/* 两端对齐 + 首行缩进（body class 开关） */
.text-justify-on .article-content { text-align: justify; }
.p_indent .article-content p { text-indent: 32px; }
.p_indent .article-content p code,
.p_indent .article-content p em,
.p_indent .article-content p li,
.p_indent .article-content p strong,
.p_indent .article-content p span,
.p_indent .article-content p b,
.p_indent .article-content p i { text-indent: 0; }

/* 文末签名 */
.article-sign { text-align: left; }

/* 免责声明块 */
.post-copyright-custom {
	border: 1px solid var(--tb--line);
	background-color: #fdfdfd;
	border-radius: 6px;
	padding: 18px 20px;
	margin-bottom: 40px;
	color: var(--tb--gray);
	font-size: 13px;
}
.post-copyright-custom .title { margin-bottom: 5px; line-height: 2; }
.post-copyright-custom .item { color: var(--tb--gray); line-height: 2; }
.post-copyright-custom .item .red, .post-copyright-custom .red { color: #ff5e52; }
.post-copyright-custom a { color: var(--tb--gray); word-break: break-all; }
.post-copyright-custom a:hover { color: var(--tb--main); }
.post-copyright-custom p { margin: 0 0 5px; line-height: 2; }
.post-copyright-custom p:last-child { margin-bottom: 0; }

/* 标签 */
.article-tags { margin-bottom: 40px; text-align: center; color: #999; }
.article-tags a {
	display: inline-block;
	padding: 5px 12px;
	margin: 0 5px 5px 0;
	color: #fff;
	font-size: 14px;
	background-color: var(--tb--main);
	opacity: .85;
	border-radius: 6px;
}
.article-tags a:hover { color: #fff; opacity: 1; }

/* 上下篇 */
.article-nav { overflow: hidden; margin-bottom: 40px; font-size: 12px; color: var(--tb--gray); word-break: break-word; }
.article-nav span { float: left; position: relative; width: 50%; }
.article-nav .article-nav-next { float: right; text-align: right; }
.article-nav .article-nav-next::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	display: block;
	width: 1px;
	background-color: var(--tb--line);
}
.article-nav a { margin-right: 10px; display: inline-block; font-size: 14px; }
.article-nav .article-nav-next a { margin-left: 10px; margin-right: 0; }

/* 相关推荐 */
.relates { margin-bottom: 10px; }
.relates .title h3 { position: relative; display: inline-block; font-size: 17px; margin: 0; padding-left: 17px; }
.relates .title h3::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	margin-top: -8px;
	height: 16px;
	width: 4px;
	border-radius: 10px;
	background-color: var(--tb--main);
}
.relates ul { overflow: hidden; margin: 10px 0 0; }
.relates li { position: relative; word-break: break-word; padding-left: 17px; margin-bottom: 12px; }
.relates li::before {
	content: "";
	position: absolute;
	top: 9px;
	left: 0;
	width: 5px;
	height: 5px;
	border-radius: 10px;
	background-color: #999;
}
.relates a span { color: #ff5e52; }
.relates a:hover span { color: var(--tb--main); }
.relates-text { margin-bottom: 28px; }

/* 独立页面 */
.content-page { background-color: var(--tb--white); border-radius: 6px; padding: 30px; }

/* ============ 6. 侧栏 widget ============ */
.sidebar .widget {
	background-color: var(--tb--white);
	border-radius: 6px;
	margin-bottom: 20px;
	overflow: hidden;
}
.widget h3 {
	position: relative;
	font-size: 15px;
	margin: 0;
	padding: 10px 20px 10px 37px;
	background-color: var(--tb--tint);
	border-bottom: 1px solid var(--tb--line);
	font-weight: bold;
}
.widget h3::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 20px;
	margin-top: -7.5px;
	height: 15px;
	width: 4px;
	border-radius: 10px;
	background-color: var(--tb--main);
}

/* 文章目录 */
.posttoc { margin-right: 3px; padding: 0 20px; overflow-y: auto; max-height: 316px; }
.posttoc ul { padding: 12px 0 15px; border-left: 2px solid var(--tb--line); }
.posttoc li { position: relative; padding: 3px 0; cursor: pointer; }
.posttoc li::after {
	content: "";
	position: absolute;
	top: 13px;
	left: 0;
	width: 16px;
	height: 2px;
	background-color: var(--tb--line);
	border-radius: 10px;
}
.posttoc li::before {
	content: "";
	z-index: 2;
	position: absolute;
	top: 10px;
	left: -5px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: var(--tb--white);
	border: 2px solid var(--tb--main);
	display: none;
}
.posttoc a { color: inherit; display: block; }
.posttoc li:hover, .posttoc li.active { color: var(--tb--main); }
.posttoc li.active::before { display: block; background-color: var(--tb--main); }
.posttoc li.active::after { background-color: var(--tb--main); }
.posttoc .-level-1 { padding-left: 28px; font-weight: bold; }
.posttoc .-level-2 { padding-left: 56px; }
.posttoc .-level-2::after { width: 44px; }

/* 最新文章 */
.widget_ui_posts ul { padding: 0; }
.widget_ui_posts li { border-bottom: solid 1px var(--tb--line); }
.widget_ui_posts li:last-child { border-bottom: none; }
.widget_ui_posts li a { padding: 15px 20px 15px 150px; overflow: hidden; position: relative; display: block; }
.widget_ui_posts li a:hover { background-color: var(--tb--tint); }
.widget_ui_posts li.noimg a { padding: 12px 20px; }
.widget_ui_posts li a:hover .text { color: var(--tb--main); }
.widget_ui_posts .text {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	color: var(--tb--base);
}
.widget_ui_posts .text span { color: #ff5e52; }
.widget_ui_posts a:hover .text span { color: var(--tb--main); }
.widget_ui_posts .thumbnail {
	float: left;
	margin-left: -130px;
	position: relative;
	top: 2px;
	width: 117px;
	height: 80px;
	border-radius: 6px;
	overflow: hidden;
	display: flex;
}
.widget_ui_posts .thumbnail img { object-fit: cover; flex: 1; width: 100%; }
.widget_ui_posts .muted { display: inline-block; margin-right: 15px; font-size: 12px; color: #bbb; }
.widget_ui_posts .nopic li a { padding: 10px 15px; }
.widget_ui_posts .nopic .text { margin-top: 0; color: #555; display: block; }
.widget_ui_posts .nopic .text:hover { color: var(--tb--main); }
.widget_ui_posts .nopic .muted { margin-right: 0; margin-left: 10px; }

/* 热门标签 */
.widget_ui_tags .items { overflow: hidden; padding: 16px 20px; margin-right: -3%; }
.widget_ui_tags .items a {
	float: left;
	width: 30.33333333%;
	margin-right: 3%;
	margin-top: 12px;
	font-size: 14px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.widget_ui_tags .items a:nth-child(-n+3) { margin-top: 0; }
.widget_ui_tags .items a span { position: relative; top: -1px; margin-left: 5px; font-size: 12px; color: #bbb; }

/* ============ 7. 页脚 ============ */
.footer {
	position: relative;
	z-index: 9;
	clear: both;
	padding: 40px 20px;
	font-size: 12px;
	text-align: center;
	color: var(--tb--gray);
}
.footer p { margin: 0 0 7.5px; }
.footer a { color: var(--tb--gray); }
.footer a:hover { color: var(--tb--main); }

/* ============ 8. 响应式 ============ */
@media (max-width: 1024px) {
	.content { margin-right: 0; }
	.sidebar { display: none; }
	.m-sidebar .sidebar { display: block; float: none; margin-left: 0; width: auto; clear: both; }
}

@media (max-width: 768px) {
	body { padding-top: 50px; }
	.admin-bar .header { top: 46px; }
	.header { text-align: center; height: 50px; padding: 11px 0; }
	.header::before {
		content: "";
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		border-top: 1px solid #eee;
		transform: scaleY(0.5);
		transform-origin: 0 0;
	}
	.logo { float: none; }
	.logo a { font-size: 18px; line-height: 24px; }
	.site-navbar, .site-search-form { display: none; }
	.sidebar { padding: 20px 0; }
}

@media (max-width: 600px) {
	.content { min-height: auto; margin-bottom: 0; }
	.single .content { padding: 0 15px; border-radius: 0; }
	.content-page { padding: 0 15px; border-radius: 0; }

	.article-header { text-align: left; padding: 12px 0 15px; margin-bottom: 0; }
	.article-title { font-size: 20px !important; }
	.article-meta { font-size: 12px; margin-top: 5px; }
	.article-meta .item { margin-right: 10px; }

	.article-content { line-height: 1.7; }
	.article-content h1 { font-size: 22px; }
	.article-content h2 { font-size: 20px; }
	.article-content h3 { font-size: 18px; }
	.article-content h4 { font-size: 16px; }
	.article-content ul, .article-content ol { margin-left: 30px; }

	.article-tags { margin-bottom: 20px; }
	.article-nav { margin-bottom: 20px; }

	/* 列表卡片：缩略图右置 */
	.excerpt {
		border: none;
		padding: 14px 150px 15px 15px;
		border-radius: 0 !important;
		position: relative;
	}
	.excerpt::before {
		content: "";
		position: absolute;
		bottom: 0;
		left: 15px;
		right: 15px;
		border-top: 1px solid var(--tb--line);
		transform: scaleY(0.5);
		transform-origin: 0 0;
	}
	.excerpt:last-child::before { display: none; }
	.excerpt .focus { float: right; margin-right: -135px; width: 120px; height: 82px; }
	.excerpt header { margin-bottom: 0; }
	.excerpt h2 {
		font-size: 15px;
		line-height: 1.4;
		font-weight: normal;
		position: relative;
		top: -2px;
	}
	.excerpt .author { display: none; }
	.excerpt .meta {
		position: absolute;
		bottom: 11px;
		left: 15px;
		right: 150px;
		font-size: 12px;
		margin-top: 0;
		height: 19px;
	}
	.excerpt .meta .cat, .excerpt .meta time, .excerpt .meta .-tags { margin-right: 10px; }
	.excerpt-text { padding-left: 15px; padding-right: 15px; }

	/* 列表描述（m-excerpt-desc 开关：无图卡片显示描述） */
	.m-excerpt-desc .excerpt-text .note { display: block; max-height: 44px; color: var(--tb--gray); margin-top: 3px; font-size: 13px; }
	.m-excerpt-desc .excerpt .note { display: none; }
	/* 有图卡片隐藏描述 */
	.excerpt:not(.excerpt-text) .note { display: none; }

	.catleader { padding: 10px 15px; border-bottom: none; border-radius: 0; }
	.catleader h1 { font-size: 14px; }
	.catleader h1::before { margin-top: -7px; height: 14px; }

	.pagination { padding: 15px; font-size: 12px; }
	.pagination li { display: none; }
	.pagination li.prev-page, .pagination li.next-page { display: inline-block; }
	.pagination li.next-page a { background-color: var(--tb--main); color: #fff; }
	.pagination a, .pagination span { padding: 5px 11px; }

	.widget h3 { font-size: 14px; padding-left: 28px; }
	.widget h3::before { left: 15px; margin-top: -7px; height: 14px; }
	.widget_ui_posts li a { padding: 15px 15px 15px 145px; }
	.widget_ui_posts li.noimg a { padding: 12px 15px; }

	.footer { padding: 15px; }
	.footer p { margin: 0 0 5px; }
}
