/* 导航文章列表组件样式 */
.elementor-nav-posts-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.nav-posts-container {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 导航栏样式 */
.nav-posts-nav {
	background-color: #f8f9fa;
	padding: 20px;
	border-radius: 8px;
	height: fit-content;
	flex: 0 0 280px; /* 固定宽度 */
	min-width: 280px; /* 最小宽度 */
	max-width: 280px; /* 最大宽度 */
}

.nav-title {
	margin: 0 0 20px 0;
	font-size: 18px;
	font-weight: 600;
	color: #333333;
}

.nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nav-item {
	position: relative;
	margin-bottom: 8px;
	cursor: pointer;
	transition: all 0.3s ease;
	border-radius: 4px;
	padding: 8px 12px;
	padding-right: 35px; /* 为下拉图标留出空间 */
}

.nav-item:hover {
	background-color: rgba(0, 124, 186, 0.1);
}

.nav-item.active {
	/* 移除背景颜色，只改变文字颜色 */
	background-color: transparent;
	color: #007cba;
	font-weight: 600;
}

.nav-item.active::before {
	/* 移除背景指示器 */
	display: none;
}

.nav-item span {
	display: block;
	transition: color 0.3s ease;
	word-wrap: break-word; /* 防止文字溢出 */
	overflow-wrap: break-word;
	cursor: pointer; /* 确保鼠标悬停时显示手型 */
	padding: 2px 0; /* 增加点击区域 */
}

.nav-item.active span {
	color: #007cba;
}

/* 二级分类样式 */
.nav-sub-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: none; /* 默认隐藏 */
	margin-left: 20px;
	margin-top: 8px;
}

.nav-sub-list.show {
	display: block; /* 显示时改为block */
}

.nav-sub-item {
	position: relative;
	margin-bottom: 6px;
	cursor: pointer;
	transition: all 0.3s ease;
	border-radius: 4px;
	padding: 6px 10px;
	font-size: 14px;
}

.nav-sub-item:hover {
	background-color: rgba(0, 124, 186, 0.05);
}

.nav-sub-item.active {
	/* 移除背景颜色，只改变文字颜色 */
	background-color: transparent;
	color: #007cba;
	font-weight: 600;
}

.nav-sub-item span {
	display: block;
	transition: color 0.3s ease;
	word-wrap: break-word; /* 防止文字溢出 */
	overflow-wrap: break-word;
	cursor: pointer; /* 确保鼠标悬停时显示手型 */
	padding: 2px 0; /* 增加点击区域 */
}

.nav-sub-item.active span {
	color: #007cba;
}

/* 展开/收起指示器 */
.nav-item.has-children {
	position: relative;
}

/* .nav-item.has-children::after {
	content: '▼';
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 12px;
	color: #666;
	transition: transform 0.3s ease;
	z-index: 1; 
} */

.nav-item.has-children.expanded::after {
	transform: translateY(-50%) rotate(180deg);
}

.nav-item.has-children.active::after {
	color: #007cba;
}

/* 二级分类不显示下拉图标 */
.nav-sub-item.has-children::after {
	display: none;
}

/* 添加展开/收缩指示器 */
.nav-item > span {
    position: relative;
    padding-right: 20px;
}

.nav-item > span::after {
    content: '▼';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #999;
    transition: transform 0.3s ease;
}

.nav-item:hover > span::after {
    transform: translateY(-50%) rotate(180deg);
}

/* 二级分类不显示箭头图标 */
.nav-sub-item > span {
    position: relative;
    padding-right: 0; /* 移除右边距，因为不需要箭头 */
}

.nav-sub-item > span::after {
    display: none; /* 隐藏二级分类的箭头 */
}

/* 右边文章列表样式 */
.nav-posts-content {
    flex: 1;
    min-height: 400px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.post-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.post-thumbnail {
    position: relative;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-item:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-content {
    padding: 20px;
}

.post-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: #007cba;
}

.post-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.post-date {
    color: #999;
}

.post-category {
    background: #f0f0f0;
    color: #666;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-posts-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .nav-posts-nav {
        flex: none; /* 移除固定宽度 */
        min-width: auto; /* 移除最小宽度限制 */
        max-width: none; /* 移除最大宽度限制 */
        width: 100%; /* 占满宽度 */
    }
    
    /* 移动端多级分类样式 */
    .nav-sub-list {
        margin-left: 15px;
    }
    
    .nav-sub-item {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .post-thumbnail img {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .nav-posts-nav {
        padding: 15px;
    }
    
    .nav-title {
        font-size: 16px;
    }
    
    .nav-item {
        padding: 10px 12px;
    }
    
    .post-content {
        padding: 15px;
    }
    
    .post-title {
        font-size: 15px;
    }
    
    .post-excerpt {
        font-size: 13px;
    }
}

/* 动画效果 */
.post-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.post-item:nth-child(1) { animation-delay: 0.1s; }
.post-item:nth-child(2) { animation-delay: 0.2s; }
.post-item:nth-child(3) { animation-delay: 0.3s; }
.post-item:nth-child(4) { animation-delay: 0.4s; }
.post-item:nth-child(5) { animation-delay: 0.5s; }
.post-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 加载状态 */
.posts-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 过滤动画 */
.post-item.filtered {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.post-item.show {
    opacity: 1;
    transform: scale(1);
} 

/* 分页样式 */
.nav-posts-pagination {
    margin-top: 30px;
    text-align: center;
}

.nav-posts-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    background-color: #f8f9fa;
    color: #333333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
    line-height: 1.4;
}

.nav-posts-pagination .page-numbers:hover {
    background-color: #005a87;
    color: #FFFFFF;
    text-decoration: none;
}

.nav-posts-pagination .current {
    background-color: #007cba;
    color: #FFFFFF;
    font-weight: bold;
}

.nav-posts-pagination .prev,
.nav-posts-pagination .next {
    font-weight: bold;
}

/* 上一页/下一页样式 */
.pagination-prev-next {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.pagination-prev-next .page-numbers {
    padding: 10px 20px;
    font-weight: 500;
}

/* 加载更多按钮样式 */
.pagination-load-more {
    text-align: center;
}

.load-more-btn {
    background-color: #007cba;
    color: #FFFFFF;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.load-more-btn:hover {
    background-color: #005a87;
    color: #FFFFFF;
    text-decoration: none;
}

.load-more-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.load-more-btn.loading {
    position: relative;
    color: transparent;
}

.load-more-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #FFFFFF;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* AJAX 分页加载样式 */
.elementor-nav-posts-widget.loading {
	position: relative;
}

.elementor-nav-posts-widget.loading::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.8);
	z-index: 10;
}

.elementor-nav-posts-widget.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #007cba;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	z-index: 11;
}

/* 分页链接悬停效果 */
.nav-posts-pagination .page-numbers:hover {
	background-color: #005a87 !important;
	color: #FFFFFF !important;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 加载更多按钮加载状态 */
.load-more-btn.loading {
	position: relative;
	color: transparent !important;
}

.load-more-btn.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border: 2px solid transparent;
	border-top: 2px solid #FFFFFF;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

/* 分页链接禁用状态 */
.nav-posts-pagination .page-numbers.disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

/* 平滑过渡效果 */
.posts-grid {
	transition: opacity 0.3s ease;
}

.posts-grid.loading {
	opacity: 0.6;
}

/* 文章项动画 - 移除动画效果 */
.post-item {
	/* 移除动画，直接显示 */
	/* animation: fadeInUp 0.5s ease-out; */
}

/* 移除动画关键帧 */
/* @keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
} */

/* 响应式分页 */
@media (max-width: 768px) {
	.nav-posts-pagination .page-numbers {
		padding: 6px 8px;
		margin: 0 2px;
		font-size: 14px;
	}
	
	.pagination-prev-next {
		flex-direction: column;
		gap: 10px;
	}
	
	.pagination-prev-next .page-numbers {
		margin: 0;
	}
} 