/* 博客页面特定的CSS变量 */
.blog-page {
  --primary: #ff79c6;
  --primary-light: #ffa5d8;
  --primary-dark: #ff4db4;
  --primary-transparent: rgba(255, 121, 198, 0.1);
  --text-dark: #1a1a1a;
  --text-light: #666;
  --white: #ffffff;
  --nav-bg: #f8f9ff;
  --error: #ff6b6b;
  --success: #51cf66;
  --section-bg: #f8f9ff;
  --transition-speed: 0.3s;
  --base-font-size: 15px;
}

/* 管理页面样式 */
.table th {
  font-weight: 600;
  color: var(--text-dark);
}

.table td {
  vertical-align: middle;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.btn-outline-danger {
  border-color: var(--error);
  color: var(--error);
}

.btn-outline-danger:hover {
  background-color: var(--error);
  color: var(--white);
}

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline-primary:hover {
  background-color: var(--primary);
  color: var(--white);
}

.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.form-control, .form-select {
  border: 1px solid #eee;
  border-radius: 5px;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 121, 198, 0.1);
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.3s ease;
  color: white;
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: #5a6268;
  border-color: #545b62;
  transform: translateY(-2px);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.mt-4 {
  margin-top: 2rem;
}

.mb-4 {
  margin-bottom: 1.5rem;
}

.mb-3 {
  margin-bottom: 1rem;
}

.d-flex {
  display: flex;
}

.justify-content-between {
  justify-content: space-between;
}

.align-items-center {
  align-items: center;
}

.table-responsive {
  overflow-x: auto;
}

/* 博客容器 */
.blog-container {
  margin-top: 60px;
  padding: 0;
}

/* 博客页面头部 */
.blog-hero {
  text-align: center;
  padding: 160px 20px 120px; /* 增加顶部和底部的padding */
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  position: relative;
  margin-top: 60px; /* 为固定导航栏留出空间 */
}

.blog-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255, 121, 198, 0.1) 0%, transparent 70%);
  z-index: 0;
}

.blog-hero .hero-content {
  position: relative;
  z-index: 1;
}

.blog-hero h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  color: #1a1a1a;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 10px rgba(255, 121, 198, 0.3);
}

.blog-hero p {
  font-size: 1.5rem;
  max-width: 800px;
  margin: 0 auto 40px;
  color: #666;
  position: relative;
  z-index: 1;
  line-height: 1.7;
}

.hero-subscribe {
  position: relative;
  z-index: 1;
  max-width: 500px;
  margin: 0 auto;
}

.subscribe-form {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.subscribe-form input {
  flex: 1;
  padding: 15px 20px;
  border: 1px solid #eee;
  border-radius: 30px;
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.subscribe-form input:focus {
  outline: none;
  border-color: #ff79c6;
  box-shadow: 0 0 0 3px rgba(255, 121, 198, 0.1);
}

.subscribe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 25px;
  background-color: #ff79c6;
  color: #fff;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  border: 2px solid #ff79c6;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 15px rgba(255, 121, 198, 0.3);
  cursor: pointer;
  gap: 0.5rem;
}

.subscribe-btn:hover {
  background-color: transparent;
  color: #ff79c6;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 121, 198, 0.5);
}

/* 主要内容区域 */
.blog-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
  display: flex;
  gap: 2rem;
}

/* 博客文章区域 */
.blog-posts {
  flex: 3;
  min-width: 0;
  margin-top: 40px; /* 增加顶部边距，将内容往下移 */
}

/* 侧边栏 */
.blog-sidebar {
  flex: 1;
  min-width: 0;
}

/* 分类标签 */
.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding-top: 20px; /* 增加顶部内边距，将分类标签往下移 */
  border: none; /* 去掉下划线 */
}

.categories a {
  text-decoration: none; /* 确保分类标签链接没有下划线 */
}

.category {
  padding: 0.5rem 1rem;
  background-color: var(--section-bg);
  border-radius: 25px;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  transition: all var(--transition-speed);
  border: none; /* 去掉边框 */
}

.category:hover,
.category.active {
  background-color: var(--primary);
  color: var(--white);
}

/* 文章网格 */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.post-card {
  background-color: var(--white);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: all var(--transition-speed);
  border: 1px solid #eee;
}

.post-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(255, 121, 198, 0.1);
  border-color: #ff79c6;
}

.post-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-content {
  padding: 1.5rem;
}

.post-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: var(--section-bg);
  border-radius: 20px;
  font-size: calc(var(--base-font-size) * 0.875);
  margin-bottom: 0.75rem;
  color: var(--text-dark);
}

.post-title {
  font-size: calc(var(--base-font-size) * 1.25);
  margin-bottom: 0.75rem;
  color: var(--text-dark);
}

.post-title a {
  color: inherit;
  text-decoration: none;
}

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

.post-excerpt {
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  font-size: calc(var(--base-font-size) * 0.875);
  color: #999;
}

/* 侧边栏部件 */
.sidebar-widget {
  background: var(--white);
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
  transition: all 0.3s ease;
}

.sidebar-widget:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(255, 121, 198, 0.1);
  border-color: #ff79c6;
}

.sidebar-widget h3 {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  /* 去掉border-bottom */
  color: var(--text-dark);
  font-size: 1.5rem;
}

/* 热门文章 */
.popular-posts {
  list-style: none;
  padding: 0;
}

.popular-posts li {
  padding: 0.75rem 0;
  /* 去掉border-bottom */
}

.popular-posts li:last-child {
  /* 去掉border-bottom */
}

.popular-posts a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  display: block;
  margin-bottom: 0.25rem;
  transition: color var(--transition-speed);
}

.popular-posts a:hover {
  color: var(--primary);
}

.popular-posts span {
  font-size: calc(var(--base-font-size) * 0.875);
  color: #999;
}

/* 分类列表 */
.categories-list {
  list-style: none;
  padding: 0;
}

.categories-list li {
  padding: 0.5rem 0;
  /* 去掉border-bottom */
}

.categories-list li:last-child {
  /* 去掉border-bottom */
}

.categories-list a {
  text-decoration: none;
  color: var(--text-dark);
  display: flex;
  justify-content: space-between;
  transition: color var(--transition-speed);
}

.categories-list a:hover {
  color: var(--primary);
}

.categories-list span {
  color: #999;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  transition: all var(--transition-speed);
  border: 1px solid #eee;
}

.page-link:hover,
.page-link.active {
  background-color: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* 响应式设计 */
@media (max-width: 992px) {
  .blog-content {
    flex-direction: column;
  }
  
  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  
  .blog-hero h1 {
    font-size: 2.8rem;
  }
  
  .blog-hero p {
    font-size: 1.2rem;
  }
}

@media (max-width: 768px) {
  .blog-hero {
    padding: 120px 20px 80px; /* 调整移动端的padding */
    margin-top: 60px;
  }
  
  .blog-hero h1 {
    font-size: 2.2rem;
  }
  
  .blog-hero p {
    font-size: 1.1rem;
  }
  
  .subscribe-form {
    flex-direction: column;
  }
  
  .posts-grid {
    grid-template-columns: 1fr;
  }
  
  .categories {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .blog-container {
    margin: 60px auto 40px;
    padding: 0 15px;
  }
  
  .blog-hero {
    padding: 100px 15px 60px; /* 调整小屏幕的padding */
  }
  
  .blog-hero h1 {
    font-size: 1.8rem;
  }
  
  .blog-hero p {
    font-size: 1rem;
  }
  
  .blog-content {
    padding: 0 15px 3rem;
  }
  
  .post-card, .sidebar-widget {
    padding: 20px 15px;
  }
  
  .post-card h3, .sidebar-widget h3 {
    font-size: 1.3rem;
  }
}