/* 博客页面专用样式 */

/* 博客页面限定前缀，确保不影响首页 */
{
  /* 此处不需要实际样式，仅用于限定选择器范围 */
}

/* 博客页面标题区域 */
.blog-header {
  background-color: #f8f9fa;
  padding: 40px 0;
  text-align: center;
}

.blog-intro {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  font-size: 1.2rem;
  color: #666;
  margin-top: -20px;
}

/* 博客主体布局 */
.blog-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.blog-articles {
  flex: 1;
  min-width: 280px;
}

.blog-sidebar {
  width: 320px;
}

/* 博客文章样式 */
.blog-post {
  margin-bottom: 40px;
  background: #fff;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: transform 0.3s ease;
}

.blog-post:hover {
  transform: translateY(-5px);
}

.blog-post-img {
  overflow: hidden;
  height: 250px;
}

.blog-post-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-post:hover .blog-post-img img {
  transform: scale(1.05);
}

.blog-post-content {
  padding: 20px;
}

.blog-post .post-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  color: #777;
}

.blog-post .post-meta span i {
  margin-right: 5px;
  color: var(--primary-color);
}

.blog-post .post-title {
  font-size: 1.5rem;
  margin-bottom: 15px;
  font-weight: 700;
  color: #333;
  transition: color 0.3s ease;
}

.blog-post:hover .post-title {
  color: var(--primary-color);
}

.post-excerpt {
  color: #666;
  margin-bottom: 20px;
  line-height: 1.6;
}



/* 侧边栏样式 */
.blog-sidebar .sidebar-section {
  background: #fff;
  padding: 20px;
  margin-bottom: 30px;
  border-radius: 5px;
  box-shadow: var(--box-shadow);
}

.blog-sidebar .sidebar-title {
  position: relative;
  font-size: 1.2rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  color: #333;
  font-weight: 700;
}

.blog-sidebar .sidebar-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 3px;
  background: var(--primary-color);
}

/* 搜索框 */
.blog-sidebar .sidebar-search {
  position: relative;
  display: flex;
}

.blog-sidebar .sidebar-search input {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 0.9rem;
}

.blog-sidebar .sidebar-search button {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 45px;
  background: var(--primary-color);
  border: none;
  border-radius: 0 5px 5px 0;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s ease;
}

.blog-sidebar .sidebar-search button:hover {
  background: #005bb5;
}

/* 分类列表 */
.blog-sidebar .category-list {
  margin: 0;
  padding: 0;
}

.blog-sidebar .category-list li {
  border-bottom: 1px solid #f0f0f0;
  padding: 10px 0;
}

.blog-sidebar .category-list li:last-child {
  border-bottom: none;
}

.blog-sidebar .category-list a {
  display: flex;
  justify-content: space-between;
  color: #666;
  transition: color 0.3s ease;
}

.blog-sidebar .category-list a:hover {
  color: var(--primary-color);
}

.blog-sidebar .category-list span {
  color: #999;
  font-size: 0.85rem;
}

/* 热门文章 */
.blog-sidebar .popular-posts {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.blog-sidebar .popular-post {
  display: flex;
  gap: 15px;
}

.blog-sidebar .post-thumb {
  width: 80px;
  height: 80px;
  border-radius: 5px;
  overflow: hidden;
}

.blog-sidebar .post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-sidebar .post-info h4 {
  font-size: 0.95rem;
  margin-bottom: 5px;
}

.blog-sidebar .post-info h4 a {
  color: #333;
  transition: color 0.3s ease;
}

.blog-sidebar .post-info h4 a:hover {
  color: var(--primary-color);
}

.blog-sidebar .post-info .post-date {
  font-size: 0.8rem;
  color: #999;
}

/* 标签云 */
.blog-sidebar .tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-sidebar .tags-cloud a {
  display: inline-block;
  padding: 5px 12px;
  background: #f0f0f0;
  border-radius: 3px;
  color: #666;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.blog-sidebar .tags-cloud a:hover {
  background: var(--primary-color);
  color: #fff;
}

/* 联系我们区块 */
.blog-sidebar .contact-section p {
  margin-bottom: 15px;
  color: #666;
}

/* 订阅区域 */
.subscribe-section {
  background: #f8f9fa;
  padding: 50px 0;
}

.subscribe-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
}

.subscribe-text {
  flex: 1;
  min-width: 280px;
}

.subscribe-text h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: #333;
}

.subscribe-text p {
  color: #666;
  font-size: 1.1rem;
}

.subscribe-form {
  flex: 1;
  min-width: 280px;
}

.subscribe-form form {
  display: flex;
  max-width: 500px;
}

.subscribe-form input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 5px 0 0 5px;
  font-size: 1rem;
}

.subscribe-form button {
  padding: 12px 25px;
  border-radius: 0 5px 5px 0;
  font-size: 1rem;
}

/* 响应式设计 */
@media (max-width: 992px) {
  .blog-container {
    flex-direction: column;
  }

  .blog-sidebar {
    width: 100%;
  }

  .subscribe-content {
    flex-direction: column;
    text-align: center;
  }

  .subscribe-form form {
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .blog-post-img {
    height: 200px;
  }

  .blog-post .post-title {
    font-size: 1.3rem;
  }



  .subscribe-text h2 {
    font-size: 1.5rem;
  }

  .subscribe-text p {
    font-size: 1rem;
  }

  .subscribe-form form {
    flex-direction: column;
    gap: 10px;
  }

  .subscribe-form input,
  .subscribe-form button {
    width: 100%;
    border-radius: 5px;
  }
}

/* 文章详情页样式 */
.article-main {
  flex: 1;
  min-width: 280px;
  background: #fff;
  border-radius: 5px;
  box-shadow: var(--box-shadow);
  padding: 30px;
}

.article-header {
  margin-bottom: 25px;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 20px;
}

.article-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: #333;
  line-height: 1.3;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: #777;
  font-size: 0.9rem;
}

.article-featured-image {
  margin-bottom: 25px;
  border-radius: 5px;
  overflow: hidden;
}

.article-featured-image img {
  width: 100%;
  border-radius: 5px;
  transition: transform 0.5s ease;
}

.article-content {
  line-height: 1.8;
  color: #444;
  margin-bottom: 30px;
}

.article-content p {
  margin-bottom: 20px;
  font-size: 1.05rem;
}

.article-content h2 {
  margin: 30px 0 15px;
  font-size: 1.5rem;
  color: #333;
  font-weight: 600;
}

.article-conclusion {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 5px;
  margin-top: 30px;
  border-left: 4px solid var(--primary-color);
}

.article-conclusion p {
  margin-bottom: 10px;
}

.article-conclusion p:last-child {
  margin-bottom: 0;
}

.article-conclusion a {
  color: var(--primary-color);
  font-weight: 500;
  text-decoration: underline;
}

/* 文章标签 */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0;
  padding: 15px 0;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  align-items: center;
}

.tag-title {
  font-weight: 500;
  color: #333;
}

.article-tags .tag {
  display: inline-block;
  padding: 5px 12px;
  background: #f0f0f0;
  border-radius: 3px;
  color: #666;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

/*
.article-tags .tag:hover {
  background: var(--primary-color);
  color: #fff;
}
*/

/* 文章分享 */
.article-share {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  gap: 15px;
}

.share-title {
  font-weight: 500;
  color: #333;
}

.share-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f0f0;
  color: #666;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.share-button:hover {
  background: var(--primary-color);
  color: #fff;
}

/* 文章导航 */
.article-navigation {
  display: flex;
  justify-content: space-between;
  margin: 30px 0;
  gap: 15px;
}

.prev-article,
.next-article {
  flex: 1;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 5px;
  color: #333;
  transition: all 0.3s ease;
  font-weight: 500;
}

.prev-article i {
  margin-right: 8px;
}

.next-article {
  text-align: right;
}

.next-article i {
  margin-left: 8px;
}

.prev-article:hover,
.next-article:hover {
  background: #f0f0f0;
  color: var(--primary-color);
}

/* 相关文章 */
.related-articles {
  margin-top: 40px;
}

.related-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
  color: #333;
  font-weight: 600;
}

.related-posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.related-post {
  background: #f9f9f9;
  border-radius: 5px;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.related-post:hover {
  transform: translateY(-5px);
}

.related-post-img {
  height: 150px;
  overflow: hidden;
}

.related-post-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.related-post:hover .related-post-img img {
  transform: scale(1.05);
}

.related-post h4 {
  padding: 10px 15px 5px;
  font-size: 1rem;
  font-weight: 600;
}

.related-post h4 a {
  color: #333;
  transition: color 0.3s ease;
}

.related-post h4 a:hover {
  color: var(--primary-color);
}

.related-post .post-date {
  display: block;
  padding: 0 15px 10px;
  font-size: 0.8rem;
  color: #999;
}

/* 文章目录导航 */
.article-toc {
  background: #f8f9fa;
  padding: 20px;
  margin-bottom: 30px;
  border-radius: 5px;
  border-left: 4px solid var(--primary-color);
}

.article-toc h3 {
  margin-bottom: 15px;
  font-size: 1.2rem;
  color: #333;
  font-weight: 600;
}

.article-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-toc ul li {
  margin-bottom: 8px;
  padding-left: 15px;
  position: relative;
}

.article-toc ul li:before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary-color);
}

.article-toc ul li a {
  color: #666;
  transition: color 0.2s ease;
  text-decoration: none;
  display: block;
  padding: 2px 0;
}

.article-toc ul li a:hover {
  color: var(--primary-color);
}

/* 文章内容滚动到标题时的高亮 */
.article-content h2:target {
  padding-top: 70px;
  margin-top: -70px;
}

.article-content h2:target:before {
  content: "";
  display: block;
  height: 70px;
  margin-top: -70px;
  visibility: hidden;
}

/* 响应式设计 - 文章详情部分 */
@media (max-width: 768px) {
  .article-main {
    padding: 20px;
  }

  .article-title {
    font-size: 1.6rem;
  }

  .article-meta {
    gap: 15px;
    font-size: 0.85rem;
  }

  .article-content p {
    font-size: 1rem;
  }

  .article-content h2 {
    font-size: 1.3rem;
  }

  .article-navigation {
    flex-direction: column;
  }

  .prev-article,
  .next-article {
    text-align: left;
  }

  .related-posts {
    grid-template-columns: 1fr;
  }
}
