/* ============================================
   文章详情页样式
   ============================================ */

/* --------------------------------------------
   1. 主体包装容器
   -------------------------------------------- */
.article-main-wrapper {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 0px;
	width: 100%;
	box-sizing: border-box;
}

/* --------------------------------------------
   2. 容器区域
   -------------------------------------------- */
.article-detail-container {
	width: 100%;
}

/* --------------------------------------------
   2. 面包屑导航
   -------------------------------------------- */
.breadcrumb-nav {
	font-size: 0.9rem;
}

.breadcrumb {
	background-color: transparent;
	padding: 0;
}

.breadcrumb-item a {
	color: #6c757d;
	text-decoration: none;
}

.breadcrumb-item a:hover {
	color: var(--primary-color);
}

.breadcrumb-item.active {
	color: var(--text-primary);
}

/* --------------------------------------------
   3. 文章详情区域
   -------------------------------------------- */
.article-detail {
	background-color: #fff;
	border-radius: 8px;
	padding: 2.5rem 3rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	width: 100%;
	box-sizing: border-box;
}

/* 文章标题区域 */
.article-detail-header {
	margin-bottom: 2rem;
	padding-bottom: 1.5rem;
	border-bottom: 2px solid #f0f0f0;
}

.article-detail-title {
	font-size: 2rem;
	font-weight: 700;
	color: var(--text-primary);
	line-height: 1.4;
	margin-bottom: 1rem;
}

.article-detail-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	font-size: 0.9rem;
	color: var(--text-secondary);
}

.article-detail-meta span {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

.article-detail-meta i {
	font-size: 0.9rem;
}

/* 文章内容区域 */
.article-detail-content {
	margin-bottom: 2rem;
	line-height: 1.8;
	color: var(--text-primary);
	font-size: 1rem;
	width: 100%;
	box-sizing: border-box;
}

/* HTML 内容样式 */
.article-content-html {
	word-wrap: break-word;
	max-width: 100%;
	margin: 0 auto;
}

.article-content-html img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	margin: 1rem 0;
}

.article-content-html p {
	margin-bottom: 1rem;
}

.article-content-html h1,
.article-content-html h2,
.article-content-html h3,
.article-content-html h4,
.article-content-html h5,
.article-content-html h6 {
	margin-top: 1.5rem;
	margin-bottom: 1rem;
	font-weight: 600;
	color: #2290fd;
}

.article-content-html ul,
.article-content-html ol {
	margin-bottom: 1rem;
	padding-left: 2rem;
}

.article-content-html li {
	margin-bottom: 0.5rem;
}

.article-content-html a {
	color: var(--primary-color);
	text-decoration: none;
}

.article-content-html a:hover {
	text-decoration: underline;
}

.article-content-html blockquote {
	border-left: 4px solid var(--primary-color);
	padding-left: 1rem;
	margin: 1rem 0;
	color: var(--text-secondary);
	font-style: italic;
}

.article-content-html code {
	background-color: #f5f5f5;
	padding: 0.2rem 0.4rem;
	border-radius: 4px;
	font-family: 'Courier New', monospace;
	font-size: 0.9em;
}

.article-content-html pre {
	background-color: #f5f5f5;
	padding: 1rem;
	border-radius: 8px;
	overflow-x: auto;
	margin: 1rem 0;
}

.article-content-html pre code {
	background-color: transparent;
	padding: 0;
}

/* Markdown 内容样式 */
.markdown-body {
	word-wrap: break-word;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
	margin-top: 1.5rem;
	margin-bottom: 1rem;
	font-weight: 600;
	color: #278bee;
}

/* 文章底部区域 */
.article-detail-footer {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid #f0f0f0;
}

.copy-link-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.article-copyright {
	font-size: 0.85rem;
	margin-top: 1rem;
}

/* 上一篇/下一篇导航 */
.article-nav {
	margin-top: 2rem;
	padding-top: 2rem;
	border-top: 2px solid #f0f0f0;
}

.article-nav-item {
	display: block;
	padding: 1rem;
	background-color: #f8f9fa;
	border-radius: 8px;
	text-decoration: none;
	color: var(--text-primary);
	transition: all 0.3s;
	border: 1px solid #e9ecef;
	height: 100%;
}

.article-nav-item:hover {
	background-color: #e9ecef;
	border-color: var(--primary-color);
	color: var(--text-primary);
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.article-nav-item.disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

.article-nav-item.disabled:hover {
	transform: none;
	box-shadow: none;
	border-color: #e9ecef;
}

.article-nav-label {
	font-size: 0.85rem;
	color: var(--text-secondary);
	margin-bottom: 0.75rem;
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.article-nav-prev .article-nav-label {
	justify-content: flex-start;
}

.article-nav-next .article-nav-label {
	justify-content: flex-end;
}

.article-nav-content {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.article-nav-prev .article-nav-content {
	flex-direction: row;
}

.article-nav-next .article-nav-content {
	flex-direction: row-reverse;
}

.article-nav-thumb {
	width: 80px;
	height: 60px;
	object-fit: cover;
	border-radius: 4px;
	flex-shrink: 0;
}

.article-nav-title {
	flex: 1;
	font-size: 0.95rem;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* 相关资讯区域 */
.related-articles-section {
	background-color: #fff;
	border-radius: 8px;
	padding: 1.5rem 2rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	overflow: hidden;
}

.section-title {
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 2px solid #f0f0f0;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.section-title i {
	color: var(--primary-color);
}

/* Swiper 轮播图容器 */
.related-articles-swiper {
	position: relative;
	padding: 0.25rem 20px 0.75rem 20px;
	overflow: hidden;
}

.related-articles-swiper .swiper-wrapper {
	align-items: stretch;
}

.related-articles-swiper .swiper-slide {
	height: auto;
}

.related-article-slide-item {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: var(--text-primary);
	transition: all 0.3s;
	border-radius: 8px;
	overflow: hidden;
	background-color: #f8f9fa;
	height: 100%;
}

.related-article-slide-item:hover {
	transform: translateY(-5px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.related-article-slide-image {
	width: 100%;
	height: 140px;
	overflow: hidden;
	background-color: #e9ecef;
}

.related-article-slide-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s;
}

.related-article-slide-item:hover .related-article-slide-image img {
	transform: scale(1.1);
}

.related-article-slide-title {
	padding: 0.75rem;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.4;
	color: var(--text-primary);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-align: center;
	min-height: 2.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

.related-article-slide-item:hover .related-article-slide-title {
	color: var(--primary-color);
}

/* Swiper 导航按钮 - 使用 Bootstrap 按钮 */
.related-articles-swiper .swiper-button-prev-custom,
.related-articles-swiper .swiper-button-next-custom {
	position: absolute;
	width: 32px;
	height: 32px;
	padding: 0;
	border-radius: 50%;
	border: none;
	background-color: #fff;
	color: var(--primary-color);
	display: flex;
	align-items: center;
	justify-content: center;
	top: calc((140px + 2.5rem + 1.5rem) / 2);
	transform: translateY(-50%);
	z-index: 10;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: all 0.3s;
}

.related-articles-swiper .swiper-button-prev-custom {
	left: 0;
}

.related-articles-swiper .swiper-button-next-custom {
	right: 0;
}

.related-articles-swiper .swiper-button-prev-custom i,
.related-articles-swiper .swiper-button-next-custom i {
	font-size: 12px;
	line-height: 1;
}

.related-articles-swiper .swiper-button-prev-custom:hover,
.related-articles-swiper .swiper-button-next-custom:hover {
	background-color: #fff;
	color: var(--primary-color);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	transform: translateY(-50%) scale(1.05);
}

.related-articles-swiper .swiper-button-prev-custom:focus,
.related-articles-swiper .swiper-button-next-custom:focus {
	background-color: #fff;
	color: var(--primary-color);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.related-articles-swiper .swiper-button-disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}


/* --------------------------------------------
   4. 右侧边栏区域
   -------------------------------------------- */
/* 右侧边栏容器 - 右边距与文章详情左边距统一 */
.article-sidebar-container {
	/* 移除padding-right，由article-main-wrapper统一处理边距 */
}

.sidebar-widgets {
	position: sticky;
	top: 80px;
}

/* 右侧边栏顶部与 article-detail 顶部对齐 */
/* 计算：面包屑导航高度(约1.5rem) + mb-3(1rem) = 2.5rem */
.article-sidebar-container .sidebar-widgets {
	padding-top: 2.5rem;
}

/* Widget 通用样式 */
.widget {
	background-color: #fff;
	border-radius: 8px;
	padding: 1.25rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	margin-bottom: 1.5rem;
}

.widget-title {
	font-size: 1.1rem;
	font-weight: 600;
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 2px solid var(--border-color);
	display: flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--text-primary);
}

.widget-title i {
	color: var(--primary-color);
}

/* Widget 列表样式 */
.widget-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.widget-item {
	padding: 0.75rem 0;
	border-bottom: 1px solid #f5f5f5;
}

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

.widget-link {
	color: var(--text-primary);
	text-decoration: none;
	font-size: 0.9rem;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color 0.3s;
}

.widget-link:hover {
	color: var(--primary-color);
}

/* Widget 排行列表样式 */
.widget-ranking-list {
	list-style: none;
	padding: 0;
	margin: 0;
	counter-reset: ranking-counter;
}

.widget-ranking-item {
	padding: 0.75rem 0;
	border-bottom: 1px solid #f5f5f5;
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	counter-increment: ranking-counter;
}

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

.ranking-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	background-color: var(--primary-color);
	color: #fff;
	border-radius: 4px;
	font-size: 0.85rem;
	font-weight: 600;
	flex-shrink: 0;
}

.widget-ranking-item:nth-child(1) .ranking-number {
	background-color: #ff6b6b;
}

.widget-ranking-item:nth-child(2) .ranking-number {
	background-color: #ffa500;
}

.widget-ranking-item:nth-child(3) .ranking-number {
	background-color: #ffd700;
}

.widget-ranking-item .widget-link {
	flex: 1;
}

/* 精选资讯 Widget 样式 */
.widget-featured {
	padding-bottom: 1.25rem;
}

.featured-article-image {
	display: block;
	width: 100%;
	margin-bottom: 1rem;
	border-radius: 6px;
	overflow: hidden;
	transition: transform 0.3s;
}

.featured-article-image:hover {
	transform: scale(1.02);
}

.featured-article-image img {
	width: 100%;
	height: auto;
	display: block;
}

.featured-article-title {
	display: -webkit-box;
	font-size: 1rem;
	font-weight: 500;
	color: var(--text-primary);
	line-height: 1.5;
	margin-bottom: 1rem;
	text-decoration: none;
	-webkit-line-clamp: 1;
	line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color 0.3s;
}

.featured-article-title:hover {
	color: var(--primary-color);
}

.featured-articles-list {
	list-style: none;
	padding: 0;
	margin: 0;
	border-top: 1px solid #f5f5f5;
	padding-top: 1rem;
}

.featured-article-item {
	padding: 0.75rem 0;
	border-bottom: 1px solid #f5f5f5;
	position: relative;
	padding-left: 1rem;
}

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

.featured-article-item::before {
	content: '◆';
	position: absolute;
	left: 0;
	color: #999;
	font-size: 0.75rem;
	line-height: 1.5;
}

.featured-article-link {
	color: var(--text-primary);
	text-decoration: none;
	font-size: 0.9rem;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color 0.3s;
}

.featured-article-link:hover {
	color: var(--primary-color);
}

/* --------------------------------------------
   5. 响应式设计
   -------------------------------------------- */
@media (max-width: 1199.98px) {
	.article-main-wrapper {
		max-width: 100%;
		padding: 0 15px;
	}
	
	
	.article-detail {
		padding: 2rem 2.5rem;
	}
	
	/* 响应式下 article-detail padding 为 2rem，所以需要调整 */
	.article-sidebar-container .sidebar-widgets {
		padding-top: calc(1rem + 1.5rem + 2rem); /* mb-3 + breadcrumb + article-detail padding */
	}

	.related-article-slide-image {
		height: 160px;
	}
}

@media (max-width: 991.98px) {

	.sidebar-widgets {
		position: static;
		margin-top: 2rem;
		padding-right: 0;
		padding-top: 0;
	}

	.article-sidebar-container .sidebar-widgets {
		padding-top: 0;
	}


	.article-detail {
		padding: 2rem 2rem;
	}

	.article-detail-title {
		font-size: 1.5rem;
	}

	.article-detail-content {
		padding: 0 1rem;
	}

	.related-articles-section {
		padding: 1.25rem 1.5rem;
	}

	.related-article-slide-image {
		height: 150px;
	}

	.related-articles-swiper {
		padding: 0.25rem 15px 0.75rem 15px;
	}

	.related-article-slide-image {
		height: 120px;
	}

	.related-articles-swiper .swiper-button-prev-custom,
	.related-articles-swiper .swiper-button-next-custom {
		width: 28px;
		height: 28px;
		top: calc((120px + 2.5rem + 1.5rem) / 2);
	}

	.related-articles-swiper .swiper-button-prev-custom i,
	.related-articles-swiper .swiper-button-next-custom i {
		font-size: 10px;
	}
}

@media (max-width: 767.98px) {
	.article-main-wrapper {
		padding: 0 10px;
	}


	.article-detail {
		padding: 1.5rem 1rem;
	}

	.article-detail-title {
		font-size: 1.25rem;
	}

	.article-detail-content {
		padding: 0 0.5rem;
		max-width: 100%;
	}

	.sidebar-widgets {
		padding-right: 0;
		padding-top: 0;
	}

	.article-sidebar-container .sidebar-widgets {
		padding-top: 0;
	}

	.article-nav-content {
		flex-direction: column !important;
		align-items: flex-start;
	}

	.article-nav-thumb {
		width: 100%;
		height: 120px;
	}

	.related-articles-section {
		padding: 1rem 0.75rem;
	}

	.related-article-slide-image {
		height: 200px;
	}

	.related-articles-swiper {
		padding: 0.25rem 10px 0.75rem 10px;
	}

	.related-article-slide-image {
		height: 160px;
	}

	.related-articles-swiper .swiper-button-prev-custom,
	.related-articles-swiper .swiper-button-next-custom {
		width: 28px;
		height: 28px;
		top: calc((160px + 2.5rem + 1.5rem) / 2);
	}

	.related-articles-swiper .swiper-button-prev-custom i,
	.related-articles-swiper .swiper-button-next-custom i {
		font-size: 10px;
	}

}
