/*
Theme Name: 吾侪模板资料库
Theme URI: http://wuchai.net/
Author: 吾侪主题
Author URI: http://wuchai.net/
Description: 专业的模板资料库WordPress主题，支持自适应布局、多栏首页、模板下载、作者空间等功能。
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wuchai-templates
Tags: responsive-layout, two-columns, three-columns, custom-header, custom-background, custom-menu, featured-images, threaded-comments, translation-ready
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	font-weight: inherit;
	font-style: inherit;
	font-size: 100%;
	font-family: inherit;
	vertical-align: baseline;
}

body {
	line-height: 1.6;
	color: #333;
	background: #f5f5f5;
	font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

#header {
	background: #fff;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	position: sticky;
	top: 0;
	z-index: 100;
}

/* 顶部工具栏 */
.top-toolbar {
	padding: 5px 0;
	border-bottom: 1px solid #eee;
	display: flex;
	justify-content: center;
	gap: 20px;
	flex-wrap: wrap;
}

.toolbar-widget {
	display: flex;
	align-items: center;
	gap: 10px;
}

.site-title-link {
	color: inherit;
	text-decoration: none;
}

.site-title-link:hover {
	text-decoration: underline;
}

.site-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 0;
}

/* 顶部导航模块区域 */
.header-section {
	flex: 1;
	display: flex;
	align-items: center;
}

.header-left {
	justify-content: flex-start;
}

.header-center {
	justify-content: center;
}

.header-right {
	justify-content: flex-end;
}

/* 导航小工具 */
.header-widget {
	display: flex;
	align-items: center;
}

.site-logo {
	display: flex;
	align-items: center;
}

.site-logo img {
	height: 48px;
	width: auto;
}

.site-title {
	font-size: 24px;
	font-weight: bold;
	color: #2c3e50;
	margin-left: 10px;
}

.main-navigation ul {
	display: flex;
	list-style: none;
}

.main-navigation li {
	margin-left: 30px;
}

.main-navigation a {
	font-size: 16px;
	color: #333;
	transition: color 0.3s;
}

.main-navigation a:hover {
	color: #3498db;
	text-decoration: none;
}

.search-box {
	display: flex;
	align-items: center;
}

.search-box input {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px 0 0 4px;
	font-size: 14px;
}

.search-box button {
	padding: 8px 16px;
	background: #3498db;
	color: #fff;
	border: none;
	border-radius: 0 4px 4px 0;
	cursor: pointer;
	transition: background 0.3s;
}

.search-box button:hover {
	background: #2980b9;
}

#hero {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	color: #fff;
	padding: 80px 0;
	text-align: center;
	position: relative;
}

#hero::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
	z-index: 0;
}

#hero .hero-content {
	position: relative;
	z-index: 1;
}

/* Banner区域 */
.banner-section {
	padding: 20px 0;
	background: #fff;
}

.banner-widget {
	max-width: 100%;
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.banner-widget img {
	width: 100%;
	height: auto;
	display: block;
}

/* 展示区域 */
.featured-section {
	padding: 40px 0;
	background: #fff;
}

.section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
}

.scroll-btn {
	width: 40px;
	height: 40px;
	background: #f0f0f0;
	border: none;
	border-radius: 50%;
	font-size: 24px;
	cursor: pointer;
	transition: all 0.3s;
}

.scroll-btn:hover {
	background: #3498db;
	color: #fff;
}

.featured-wrapper {
	overflow: hidden;
	position: relative;
}

.featured-grid {
	display: flex;
	gap: 20px;
	transition: transform 0.3s ease;
}

.featured-widget {
	flex: 0 0 calc(33.333% - 14px);
	min-width: calc(33.333% - 14px);
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0,0,0,0.1);
	cursor: pointer;
	transition: transform 0.3s;
}

.featured-widget:hover {
	transform: translateY(-5px);
}

.featured-widget img {
	width: 100%;
	height: 100px;
	object-fit: cover;
}

.featured-widget .widget-content {
	padding: 15px;
}

.featured-widget .widget-title {
	font-size: 16px;
	font-weight: bold;
	color: #2c3e50;
	margin-bottom: 5px;
}

.featured-widget .widget-desc {
	font-size: 14px;
	color: #666;
}

.hero-title {
	font-size: 36px;
	font-weight: bold;
	margin-bottom: 20px;
}

.hero-description {
	font-size: 18px;
	margin-bottom: 40px;
	opacity: 0.9;
}

.hero-search-wrapper {
	max-width: 700px;
	margin: 0 auto;
	position: relative;
}

.hero-search-form {
	margin: 0;
}

.hero-search-inner {
	display: flex;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.hero-search-post-type {
	padding: 15px 20px;
	font-size: 16px;
	border: none;
	background: rgba(255,255,255,0.95);
	color: #333;
	cursor: pointer;
	min-width: 120px;
	border-right: 1px solid #ddd;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 16px;
}

.hero-search-input {
	flex: 1;
	padding: 15px 20px;
	font-size: 16px;
	border: none;
	background: rgba(255,255,255,0.95);
}

.hero-search-btn {
	padding: 15px 30px;
	background: #2ecc71;
	color: #fff;
	border: none;
	font-size: 16px;
	cursor: pointer;
	transition: background 0.3s;
}

.hero-search-btn:hover {
	background: #27ae60;
}

/* 实时搜索结果 */
.hero-search-results {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	right: 0;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.15);
	z-index: 100;
	max-height: 400px;
	overflow-y: auto;
	display: none;
}

.hero-search-results.show {
	display: block;
}

.search-result-item {
	display: flex;
	align-items: center;
	padding: 12px 15px;
	border-bottom: 1px solid #eee;
	cursor: pointer;
	transition: background 0.2s;
}

.search-result-item:hover {
	background: #f8f9fa;
}

.search-result-item:last-child {
	border-bottom: none;
}

.search-result-thumbnail {
	width: 48px;
	height: 48px;
	border-radius: 4px;
	overflow: hidden;
	margin-right: 12px;
	flex-shrink: 0;
	background: #f0f0f0;
}

.search-result-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.search-result-info {
	flex: 1;
	min-width: 0;
}

.search-result-title {
	font-size: 14px;
	font-weight: 600;
	color: #333;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-bottom: 2px;
}

.search-result-type {
	font-size: 12px;
	color: #999;
}

.search-results-empty {
	padding: 20px;
	text-align: center;
	color: #999;
	font-size: 14px;
}

#categories {
	padding: 40px 0;
	background: #fff;
}

.section-title {
	font-size: 24px;
	font-weight: bold;
	text-align: center;
	margin-bottom: 30px;
	color: #2c3e50;
}

.categories-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 20px;
}

.category-item {
	text-align: center;
	padding: 20px;
	border-radius: 8px;
	transition: all 0.3s;
	cursor: pointer;
}

.category-item:hover {
	background: #f8f9fa;
	transform: translateY(-2px);
}

.category-item span {
	font-size: 14px;
	color: #666;
	margin-top: 8px;
	display: block;
}

.category-icon {
	font-size: 36px;
}

#featured-templates {
	padding: 60px 0;
}

.templates-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 30px;
}

.template-card {
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0,0,0,0.1);
	transition: transform 0.3s, box-shadow 0.3s;
}

.template-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.template-thumbnail {
	position: relative;
	height: 180px;
	overflow: hidden;
}

.template-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s;
}

.template-card:hover .template-thumbnail img {
	transform: scale(1.1);
}

.template-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: rgba(255,255,255,0.9);
	padding: 5px 10px;
	border-radius: 4px;
	font-size: 12px;
	color: #3498db;
}

.template-info {
	padding: 12px 14px;
}

.template-title {
	font-size: 15px;
	font-weight: 600;
	margin-bottom: 6px;
	color: #2c3e50;
}

.template-title a {
	color: inherit;
	text-decoration: none;
}

.template-title a:hover {
	color: #3498db;
}

.template-excerpt {
	font-size: 12px;
	color: #888;
	margin-bottom: 6px;
	line-height: 1.4;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.template-terms {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 8px;
}

.template-term {
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 4px;
	text-decoration: none;
	transition: all 0.2s;
}

.template-category {
	background: #e8f4fd;
	color: #3498db;
}

.template-category:hover {
	background: #3498db;
	color: #fff;
}

.template-tag {
	background: #f5f5f5;
	color: #666;
}

.template-tag:hover {
	background: #666;
	color: #fff;
}

.template-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 12px;
	color: #888;
}

.template-author {
	display: flex;
	align-items: center;
}

.template-author img {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	margin-right: 6px;
}

.template-stats {
	display: flex;
	gap: 10px;
}

.template-stat {
	display: flex;
	align-items: center;
}

.template-stat i {
	margin-right: 4px;
}

#footer {
	background: #2c3e50;
	color: #fff;
	padding: 40px 0;
	margin-top: 60px;
}

/* 页脚行结构 */
.footer-row {
	padding: 20px 0;
}

.footer-row-1 {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 30px;
	border-bottom: 1px solid #34495e;
}

.footer-row-2 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 30px;
	border-bottom: 1px solid #34495e;
}

.footer-row-3 {
	text-align: center;
	color: #bdc3c7;
	font-size: 14px;
}

/* 页脚列 */
.footer-column {
	padding: 10px;
}

/* 页脚小工具 */
.footer-widget {
	margin-bottom: 20px;
}

.footer-widget-title {
	font-size: 18px;
	font-weight: bold;
	margin-bottom: 15px;
	color: #fff;
}

.footer-widget ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.footer-widget li {
	margin-bottom: 10px;
}

.footer-widget a {
	color: #bdc3c7;
	transition: color 0.3s;
}

.footer-widget a:hover {
	color: #fff;
}

/* 版权小工具 */
.copyright-widget {
	display: flex;
	justify-content: center;
	align-items: center;
}

/* 原有页脚区域 */
.footer-section h3 {
	font-size: 18px;
	font-weight: bold;
	margin-bottom: 20px;
}

.footer-section ul {
	list-style: none;
}

.footer-section li {
	margin-bottom: 10px;
}

.footer-section a {
	color: #bdc3c7;
	transition: color 0.3s;
}

.footer-section a:hover {
	color: #fff;
}

.resource-type-link {
	color: #3498db;
	text-decoration: none;
	font-weight: 500;
}

.resource-type-link:hover {
	color: #2980b9;
	text-decoration: underline;
}

.btn {
	display: inline-block;
	padding: 10px 20px;
	border-radius: 4px;
	font-size: 14px;
	font-weight: bold;
	text-align: center;
	cursor: pointer;
	transition: all 0.3s;
	border: none;
}

.btn-primary {
	background: #3498db;
	color: #fff;
}

.btn-primary:hover {
	background: #2980b9;
	text-decoration: none;
}

.btn-success {
	background: #2ecc71;
	color: #fff;
}

.btn-success:hover {
	background: #27ae60;
	text-decoration: none;
}

/* 响应式菜单按钮 */
.mobile-menu-toggle {
	display: none;
	position: relative;
	width: 40px;
	height: 40px;
	background: transparent;
	color: #333;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 24px;
	transition: all 0.3s;
	justify-content: center;
	align-items: center;
}

.mobile-menu-toggle:hover {
	background: #f0f0f0;
}

.menu-icon {
	font-size: 24px;
}

.menu-text {
	display: none;
}

/* 侧边栏菜单 */
.mobile-sidebar {
	display: none;
	position: fixed;
	left: -320px;
	top: 0;
	width: 320px;
	height: 100vh;
	background: #2c3e50;
	color: #fff;
	z-index: 999;
	transition: left 0.3s;
	overflow-y: auto;
}

.mobile-sidebar.open {
	left: 0;
}

.sidebar-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.sidebar-title {
	font-size: 16px;
	font-weight: bold;
}

.sidebar-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 24px;
	cursor: pointer;
	padding: 5px 10px;
}

.sidebar-content {
	padding: 10px 0;
}

.sidebar-menu {
	list-style: none;
	padding: 0;
	margin: 0;
}

.sidebar-menu li {
	border-bottom: none;
}

.sidebar-menu a {
	display: block;
	padding: 15px 20px;
	color: #bdc3c7;
	text-decoration: none;
	transition: all 0.3s;
	font-size: 16px;
	border-radius: 4px;
	margin: 5px 10px;
}

.sidebar-menu a:hover {
	background: #34495e;
	color: #fff;
}

/* 移除所有链接的下划线 */
a {
	text-decoration: none;
}

/* Hero区域链接样式 */
.hero-link {
	color: inherit;
	text-decoration: none;
}

.hero-link:hover {
	text-decoration: underline;
}

.sidebar-search {
	padding: 20px;
	border-top: 1px solid #34495e;
	margin-top: 10px;
}

.sidebar-search form {
	display: flex;
}

.sidebar-search input {
	flex: 1;
	padding: 10px;
	border: none;
	border-radius: 4px 0 0 4px;
	font-size: 14px;
}

.sidebar-search button {
	padding: 10px 20px;
	background: #3498db;
	color: #fff;
	border: none;
	border-radius: 0 4px 4px 0;
	cursor: pointer;
}

/* 遮罩层 */
.sidebar-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.5);
	z-index: 998;
}

.sidebar-overlay.show {
	display: block;
}




@media screen and (max-width: 960px) {
	/* 显示移动端菜单按钮 */
	.mobile-menu-toggle {
		display: flex !important;
		position: relative !important;
		width: auto !important;
		height: auto !important;
		background: transparent !important;
		color: #333 !important;
		border-radius: 0 !important;
		box-shadow: none !important;
		padding: 10px !important;
		flex-direction: row !important;
		gap: 5px !important;
		margin-right: 10px;
	}
	
	.mobile-menu-toggle:hover {
		background: #f0f0f0 !important;
	}
	
	.mobile-sidebar {
		display: block !important;
	}
	
	/* 隐藏顶部导航菜单 */
	#header .site-header .main-navigation {
		display: none !important;
	}
	
	/* 隐藏顶部搜索框（在侧边栏显示） */
	#header .site-header .search-box {
		display: none !important;
	}
	
	/* 导航区域自适应布局 - 菜单居左，标题居中 */
	.site-header {
		flex-direction: row;
		justify-content: center;
		align-items: center;
	}

	/* 导航区域模块自适应 */
	.header-section {
		flex: none !important;
		width: auto !important;
	}

	.header-left {
		flex: 1;
		justify-content: flex-start;
	}

	.header-center {
		display: none !important;
	}

	.header-right {
		display: none !important;
	}

	.site-logo {
		flex: 1;
		text-align: center;
	}

	.site-title {
		font-size: 18px;
	}


@media screen and (max-width: 960px) {
	/* 显示移动端菜单按钮和侧边栏（中屏幕和小屏幕） */
	.mobile-menu-toggle {
		display: flex !important;
	}
	
	.mobile-sidebar {
		display: block !important;
	}
	
	/* 隐藏顶部导航菜单 */
	#header .site-header .main-navigation {
		display: none !important;
	}
	
	/* 隐藏顶部搜索框（在侧边栏显示） */
	#header .site-header .search-box {
		display: none !important;
	}
	
	/* 导航区域自适应布局 */
	.site-header {
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}

	/* 导航区域模块自适应 */
	.header-section {
		flex: none !important;
		width: auto !important;
	}

	.header-left {
		flex: 1;
		justify-content: center;
	}

	.header-center {
		display: none !important;
	}

	.header-right {
		display: none !important;
	}

	.site-logo {
		flex: 1;
		text-align: center;
	}

	.site-title {
		font-size: 20px;
	}

	.hero-title {
		font-size: 28px;
	}

	.templates-grid {
		grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	}
}

@media (max-width: 768px) {
	.hero-search-inner {
		flex-wrap: wrap;
	}

	.hero-search-post-type {
		width: 100%;
		border-right: none;
		border-bottom: 1px solid #ddd;
		border-radius: 8px 8px 0 0;
	}

	.hero-search-input {
		border-radius: 0;
	}

	.hero-search-btn {
		border-radius: 0 0 8px 8px;
	}
}

@media (max-width: 480px) {
	.hero-search-inner {
		flex-direction: column;
	}

	.hero-search-post-type,
	.hero-search-input,
	.hero-search-btn {
		border-radius: 8px;
		margin-bottom: 10px;
		border-right: none;
		border-bottom: none;
	}

	.hero-search-inner {
		flex-direction: column;
	}
}