/**
 * 鸭先知风格主题 - 主样式
 */
:root {
	--yxzhi-primary: #e84545;
	--yxzhi-primary-dark: #d63a3a;
	--yxzhi-green: #2ecc71;
	--yxzhi-bg: #f4f5f7;
	--yxzhi-card: #ffffff;
	--yxzhi-text: #333333;
	--yxzhi-text-muted: #888888;
	--yxzhi-border: #eeeeee;
	--yxzhi-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
	--yxzhi-radius: 10px;
	--yxzhi-header-h: 56px;
	--yxzhi-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
	--yxzhi-container: 1200px;
}

[data-theme="dark"] {
	--yxzhi-bg: #1a1a1e;
	--yxzhi-card: #25252b;
	--yxzhi-text: #e8e8e8;
	--yxzhi-text-muted: #9a9a9a;
	--yxzhi-border: #3a3a42;
	--yxzhi-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

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

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--yxzhi-font);
	font-size: 14px;
	line-height: 1.6;
	color: var(--yxzhi-text);
	background: var(--yxzhi-bg);
}

a {
	color: var(--yxzhi-text);
	text-decoration: none;
	transition: color 0.2s;
}

a:hover {
	color: var(--yxzhi-primary);
}

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

.container {
	max-width: var(--yxzhi-container);
	margin: 0 auto;
	padding: 0 16px;
}

.card {
	background: var(--yxzhi-card);
	border-radius: var(--yxzhi-radius);
	box-shadow: var(--yxzhi-shadow);
}

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: var(--yxzhi-card);
	box-shadow: 0 1px 0 var(--yxzhi-border);
}

.header-inner {
	display: flex;
	align-items: center;
	height: var(--yxzhi-header-h);
	gap: 12px;
}

.site-branding a,
.site-logo-text {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	font-size: 18px;
	color: var(--yxzhi-text);
}

.site-branding a:hover,
.site-logo-text:hover {
	color: var(--yxzhi-primary);
}

.logo-duck {
	font-size: 24px;
}

.main-nav {
	flex: 1;
	overflow: hidden;
}

.nav-menu {
	display: flex;
	flex-wrap: nowrap;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	scrollbar-width: none;
}

.nav-menu::-webkit-scrollbar {
	display: none;
}

.nav-menu li a {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 8px 12px;
	white-space: nowrap;
	border-radius: 6px;
	font-size: 14px;
}

.nav-menu li a:hover,
.nav-menu .current-menu-item > a {
	background: rgba(232, 69, 69, 0.08);
	color: var(--yxzhi-primary);
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.btn-icon {
	border: none;
	background: transparent;
	cursor: pointer;
	font-size: 18px;
	padding: 6px 8px;
	border-radius: 6px;
	color: var(--yxzhi-text);
}

.btn-icon:hover {
	background: var(--yxzhi-bg);
}

.theme-toggle .icon-moon,
[data-theme="dark"] .theme-toggle .icon-sun {
	display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
	display: inline;
}

.mobile-menu-toggle {
	display: none;
	flex-direction: column;
	gap: 4px;
	padding: 8px;
	border: none;
	background: none;
	cursor: pointer;
}

.mobile-menu-toggle span {
	display: block;
	width: 20px;
	height: 2px;
	background: var(--yxzhi-text);
}

.search-panel {
	padding: 12px 0;
	background: var(--yxzhi-card);
	border-top: 1px solid var(--yxzhi-border);
}

.search-panel[hidden] {
	display: none !important;
}

/* Layout */
.site-main {
	padding: 20px 0 80px;
}

.layout-two-col {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 20px;
	align-items: start;
}

.content-area {
	min-width: 0;
}

/* Hero */
.hero-section {
	display: grid;
	grid-template-columns: 1fr 140px;
	gap: 12px;
	margin-bottom: 20px;
}

.hero-main {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 24px 28px;
	min-height: 140px;
	background: linear-gradient(135deg, #fff5f5 0%, #ffffff 60%);
	overflow: hidden;
}

[data-theme="dark"] .hero-main {
	background: linear-gradient(135deg, #2a2020 0%, var(--yxzhi-card) 60%);
}

.hero-title {
	margin: 0 0 8px;
	font-size: 26px;
	font-weight: 800;
	color: var(--yxzhi-text);
}

.hero-subtitle {
	margin: 0 0 16px;
	color: var(--yxzhi-text-muted);
	font-size: 14px;
}

.btn {
	display: inline-block;
	padding: 8px 20px;
	border-radius: 20px;
	font-size: 14px;
	font-weight: 600;
}

.btn-primary {
	background: var(--yxzhi-primary);
	color: #fff !important;
}

.btn-primary:hover {
	background: var(--yxzhi-primary-dark);
	color: #fff !important;
}

.hero-visual {
	position: relative;
	width: 120px;
	height: 100px;
}

.hero-icons span {
	position: absolute;
	font-size: 28px;
	animation: float 3s ease-in-out infinite;
}

.hi-1 { top: 0; left: 0; }
.hi-2 { top: 20px; right: 0; animation-delay: 0.5s; }
.hi-3 { bottom: 10px; left: 20px; animation-delay: 1s; }
.hi-4 { bottom: 0; right: 20px; animation-delay: 1.5s; }

@keyframes float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-6px); }
}

.hero-side {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.hero-side-card {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 16px;
	text-align: center;
	transition: transform 0.2s;
}

.hero-side-card:hover {
	transform: translateY(-2px);
	color: var(--yxzhi-primary);
}

.fav-card { background: linear-gradient(180deg, #fff9e6, var(--yxzhi-card)); }
.forum-card { background: linear-gradient(180deg, #e8f4ff, var(--yxzhi-card)); }

.side-icon { font-size: 28px; }
.side-label { font-weight: 600; font-size: 14px; }

/* Sections */
.section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.section-title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	padding-left: 10px;
	border-left: 4px solid var(--yxzhi-primary);
}

.section-more {
	font-size: 13px;
	color: var(--yxzhi-text-muted);
}

.section-more:hover {
	color: var(--yxzhi-primary);
}

/* Topic grid */
.topic-section {
	margin-bottom: 24px;
}

.topic-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
}

.topic-card {
	padding: 12px;
	overflow: hidden;
	transition: transform 0.2s;
}

.topic-card:hover {
	transform: translateY(-2px);
}

.topic-card img {
	border-radius: 6px;
	margin-bottom: 8px;
	aspect-ratio: 16/10;
	object-fit: cover;
}

.topic-card h3 {
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Post cards */
.post-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.post-card {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 0;
	overflow: hidden;
	transition: box-shadow 0.2s;
}

.post-card:hover {
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.post-card-thumb {
	position: relative;
	display: block;
	overflow: hidden;
}

.post-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	min-height: 130px;
}

.thumb-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 130px;
	background: var(--yxzhi-bg);
	color: var(--yxzhi-text-muted);
	font-size: 13px;
}

.badge {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
	z-index: 2;
}

.badge-sticky,
.badge-inline {
	background: var(--yxzhi-primary);
}

.badge-rec {
	background: #ff9800;
}

.cat-tag {
	position: absolute;
	bottom: 10px;
	left: 10px;
	padding: 2px 8px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 11px;
	border-radius: 4px;
}

.post-card-body {
	padding: 16px 18px;
	display: flex;
	flex-direction: column;
}

.post-card-title {
	margin: 0 0 8px;
	font-size: 16px;
	line-height: 1.4;
}

.post-card-title a:hover {
	color: var(--yxzhi-primary);
}

.post-card-excerpt {
	margin: 0;
	flex: 1;
	color: var(--yxzhi-text-muted);
	font-size: 13px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.post-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin-top: 12px;
	font-size: 12px;
	color: var(--yxzhi-text-muted);
}

/* Sidebar */
.site-sidebar .widget {
	margin-bottom: 16px;
	padding: 16px;
	background: var(--yxzhi-card);
	border-radius: var(--yxzhi-radius);
	box-shadow: var(--yxzhi-shadow);
}

.widget-title {
	margin: 0 0 12px;
	font-size: 15px;
	font-weight: 700;
}

.yxzhi-search-form {
	display: flex;
	gap: 0;
}

.yxzhi-search-form .search-field {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid var(--yxzhi-border);
	border-right: none;
	border-radius: 6px 0 0 6px;
	background: var(--yxzhi-bg);
	color: var(--yxzhi-text);
	font-size: 13px;
}

.yxzhi-search-form .search-submit {
	padding: 10px 16px;
	border: none;
	border-radius: 0 6px 6px 0;
	background: var(--yxzhi-primary);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
	font-size: 13px;
}

.yxzhi-search-form .search-submit:hover {
	background: var(--yxzhi-primary-dark);
}

.tools-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.tool-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 12px 8px;
	background: var(--yxzhi-bg);
	border-radius: 8px;
	text-align: center;
	font-size: 12px;
	transition: background 0.2s;
}

.tool-item:hover {
	background: rgba(232, 69, 69, 0.1);
	color: var(--yxzhi-primary);
}

.tool-icon { font-size: 22px; }

.widget-calendar-card table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
}

.widget-calendar-card caption {
	font-weight: 700;
	margin-bottom: 8px;
}

.widget-calendar-card td,
.widget-calendar-card th {
	text-align: center;
	padding: 4px;
}

.widget-calendar-card #today {
	background: var(--yxzhi-primary);
	color: #fff;
	border-radius: 50%;
}

.wechat-box {
	text-align: center;
	background: linear-gradient(180deg, #e8f9ef, var(--yxzhi-card)) !important;
	padding: 16px !important;
}

.wechat-title {
	margin: 0 0 6px;
	color: var(--yxzhi-green);
	font-size: 15px;
}

.wechat-desc {
	margin: 0 0 10px;
	font-size: 12px;
	color: var(--yxzhi-text-muted);
}

.wechat-qr {
	max-width: 140px;
	margin: 0 auto;
	border-radius: 6px;
}

.wechat-qr-placeholder {
	padding: 24px;
	background: var(--yxzhi-bg);
	border-radius: 6px;
	font-size: 12px;
	color: var(--yxzhi-text-muted);
}

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

.hot-item {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 8px;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px solid var(--yxzhi-border);
}

.hot-item:last-child {
	border-bottom: none;
}

.hot-rank {
	font-size: 11px;
	font-weight: 800;
	padding: 2px 6px;
	border-radius: 4px;
	color: #fff;
}

.hot-item.top-1 .hot-rank { background: #e84545; }
.hot-item.top-2 .hot-rank { background: #ff9800; }
.hot-item.top-3 .hot-rank { background: #ffc107; color: #333; }

.hot-rank-num {
	width: 20px;
	text-align: center;
	font-size: 12px;
	color: var(--yxzhi-text-muted);
}

.hot-link {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.hot-thumb {
	width: 36px;
	height: 36px;
	border-radius: 6px;
	object-fit: cover;
	flex-shrink: 0;
}

.hot-title {
	font-size: 13px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hot-views {
	font-size: 11px;
	color: var(--yxzhi-text-muted);
}

.widget-empty {
	margin: 0;
	font-size: 13px;
	color: var(--yxzhi-text-muted);
	text-align: center;
}

/* Single */
.single-article {
	padding: 24px 28px;
	margin-bottom: 20px;
}

.single-cat {
	display: inline-block;
	margin-bottom: 8px;
	padding: 2px 10px;
	background: rgba(232, 69, 69, 0.1);
	color: var(--yxzhi-primary);
	border-radius: 4px;
	font-size: 12px;
}

.single-title {
	margin: 0 0 12px;
	font-size: 24px;
	line-height: 1.35;
}

.single-meta {
	display: flex;
	gap: 16px;
	font-size: 13px;
	color: var(--yxzhi-text-muted);
	margin-bottom: 20px;
}

.single-featured {
	margin-bottom: 20px;
	border-radius: var(--yxzhi-radius);
	overflow: hidden;
}

.single-content {
	font-size: 15px;
	line-height: 1.8;
}

.single-content img {
	border-radius: 6px;
	margin: 12px 0;
}

.single-content h2,
.single-content h3 {
	margin-top: 1.5em;
}

.page-header {
	padding: 20px 24px;
	margin-bottom: 16px;
}

.page-title {
	margin: 0;
	font-size: 20px;
}

.page-title span {
	color: var(--yxzhi-primary);
}

/* Pagination */
.pagination,
.nav-links {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 24px;
	flex-wrap: wrap;
}

.pagination .page-numbers,
.nav-links a,
.nav-links span {
	padding: 8px 14px;
	background: var(--yxzhi-card);
	border-radius: 6px;
	box-shadow: var(--yxzhi-shadow);
	font-size: 13px;
}

.pagination .current {
	background: var(--yxzhi-primary);
	color: #fff !important;
}

/* Footer */
.site-footer {
	background: var(--yxzhi-card);
	border-top: 1px solid var(--yxzhi-border);
	padding: 32px 0;
	margin-top: 20px;
}

.footer-inner {
	text-align: center;
}

.footer-tagline {
	color: var(--yxzhi-text-muted);
	font-size: 13px;
	margin: 8px 0 16px;
}

.footer-menu {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 16px;
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
}

.footer-copy {
	font-size: 12px;
	color: var(--yxzhi-text-muted);
	margin: 0;
}

/* Bottom nav */
.bottom-nav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 999;
	background: var(--yxzhi-card);
	border-top: 1px solid var(--yxzhi-border);
	box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
	padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}

.bottom-nav-menu {
	display: flex;
	justify-content: space-around;
	list-style: none;
	margin: 0;
	padding: 0;
	max-width: var(--yxzhi-container);
	margin-inline: auto;
}

.bottom-nav-menu a {
	display: flex;
	flex-direction: column;
	align-items: center;
	font-size: 11px;
	padding: 4px 8px;
	color: var(--yxzhi-text-muted);
}

.bottom-nav-menu a:hover {
	color: var(--yxzhi-primary);
}

.back-to-top {
	position: fixed;
	right: 20px;
	bottom: 72px;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: var(--yxzhi-primary);
	color: #fff;
	font-size: 18px;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s, visibility 0.2s;
	z-index: 998;
	box-shadow: var(--yxzhi-shadow);
}

.back-to-top.visible {
	opacity: 1;
	visibility: visible;
}

.error-404 {
	text-align: center;
	padding: 48px 24px;
	max-width: 480px;
	margin: 40px auto;
}

.error-404 h1 {
	font-size: 64px;
	margin: 0;
	color: var(--yxzhi-primary);
}

.no-posts {
	padding: 32px;
	text-align: center;
}

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
}

/* Comments */
.comments-area {
	margin-top: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
	.layout-two-col {
		grid-template-columns: 1fr;
	}

	.site-sidebar {
		display: none !important;
	}
}

@media (max-width: 768px) {
	.main-nav {
		display: none;
		position: absolute;
		top: var(--yxzhi-header-h);
		left: 0;
		right: 0;
		background: var(--yxzhi-card);
		padding: 12px 16px;
		box-shadow: var(--yxzhi-shadow);
	}

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

	.main-nav .nav-menu {
		flex-direction: column;
	}

	.mobile-menu-toggle {
		display: flex;
	}

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

	.post-card-thumb img,
	.thumb-placeholder {
		min-height: 180px;
	}

	body:has(.bottom-nav) .site-main {
		padding-bottom: 100px;
	}
}

