/* Blog 頁面的頁首樣式覆蓋 */
html body .container .site-header,
html body .site-header {
  position: static !important;
  top: auto !important;
  left: auto !important;
  width: auto !important;
  background-color: white !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  border-bottom: 1px solid #e5e5e5 !important;
  padding: 15px 0 !important;
}

/* 確保頁首導航連結樣式正確 */
html body .site-header .nav-link {
  background: transparent !important;
  border-radius: 0 !important;
  padding: 5px 0 !important;
  transform: none !important;
  max-width: none !important;
  flex: none !important;
}

html body .site-header .nav-link:hover {
  background: transparent !important;
  transform: none !important;
}

/* 確保 body 有適當的 padding */
body {
  padding-top: 0 !important;
}

/* Blog Styles */
.blog-header {
  text-align: center;
  padding: 80px 20px 40px;
  background-color: #f8f8f8;
}

.blog-header h1 {
  font-size: 2.5rem;
  margin-bottom: 16px;
  font-weight: 600;
  color: #333;
}

.blog-header p {
  font-size: 1.2rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto 30px auto;
}

/* 搜索和篩選控制 */
.blog-controls {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.search-box {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.search-box input {
  flex: 1;
  max-width: 400px;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}

.search-box button {
  padding: 12px 24px;
  background: #4a6cf7;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s ease;
}

.search-box button:hover {
  background: #3b5ce6;
}

.filter-controls {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.filter-controls select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  background: white;
  cursor: pointer;
}

/* 載入更多按鈕 */
.load-more-container {
  text-align: center;
  margin-top: 40px;
}

.load-more-container button {
  padding: 12px 30px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.load-more-container button:hover {
  background: #e9ecef;
  transform: translateY(-2px);
}

.blog-content {
  display: flex;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  justify-content: space-between;
}

.blog-main {
  flex: 1;
  min-width: 280px;
  padding-right: 40px;
}

.blog-posts {
  width: 100%;
}

.blog-post {
  margin-bottom: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid #eee;
}

.blog-post:last-child {
  border-bottom: none;
}

.post-date {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 10px;
}

.post-title {
  font-size: 1.8rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.post-title a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-title a:hover {
  color: #4a6cf7;
}

.post-excerpt {
  font-size: 1rem;
  line-height: 1.6;
  color: #555;
  margin-bottom: 20px;
}

.read-more {
  display: inline-block;
  color: #4a6cf7;
  font-weight: 500;
  text-decoration: none;
  position: relative;
}

.read-more:after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: #4a6cf7;
  transition: width 0.3s ease;
}

.read-more:hover:after {
  width: 100%;
}

/* Sidebar Styles */
.blog-sidebar {
  width: 300px;
  padding-left: 20px;
  border-left: 1px solid #eee;
}

.sidebar-section {
  margin-bottom: 40px;
}

.sidebar-section h3 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  font-weight: 600;
  color: #333;
}

.sidebar-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-section li {
  margin-bottom: 10px;
}

.sidebar-section a {
  color: #555;
  text-decoration: none;
  transition: color 0.3s ease;
}

.sidebar-section a:hover {
  color: #4a6cf7;
}

/* Active Navigation Link */
.nav-link.active {
  color: #4a6cf7;
  font-weight: 500;
}

/* 分類和統計樣式 */
.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.category-item a {
  color: #555;
  text-decoration: none;
  transition: color 0.3s ease;
}

.category-item a:hover {
  color: #4a6cf7;
}

.category-count {
  font-size: 0.8rem;
  color: #888;
  background: #f0f0f0;
  padding: 2px 8px;
  border-radius: 12px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.stat-number {
  font-size: 1.2rem;
  font-weight: 600;
  color: #4a6cf7;
}

.stat-label {
  color: #666;
  font-size: 0.9rem;
}

.stat-date {
  color: #888;
  font-size: 0.8rem;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .blog-controls {
    padding: 0 20px;
  }
  
  .search-box {
    flex-direction: column;
  }
  
  .search-box input {
    max-width: 100%;
    margin-bottom: 10px;
  }
  
  .filter-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-controls select {
    margin-bottom: 10px;
  }
  
  .blog-content {
    flex-direction: column;
  }
  
  .blog-main {
    padding-right: 0;
    margin-bottom: 40px;
  }
  
  .blog-posts {
    width: 100%;
  }
  
  .blog-sidebar {
    width: 100%;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid #eee;
    padding-top: 40px;
  }
}

/* Blog Post Page Styles */
.post-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  line-height: 1.8;
}

.post-content h1 {
  font-size: 2.2rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.post-content h2 {
  font-size: 1.8rem;
  margin: 40px 0 20px;
  font-weight: 600;
}

.post-content h3 {
  font-size: 1.4rem;
  margin: 30px 0 16px;
  font-weight: 600;
}

.post-content p {
  margin-bottom: 24px;
  color: #444;
}

.post-content ul, 
.post-content ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

.post-content li {
  margin-bottom: 8px;
}

.post-content blockquote {
  border-left: 4px solid #4a6cf7;
  padding-left: 20px;
  margin-left: 0;
  margin-right: 0;
  font-style: italic;
  color: #555;
}

.post-meta {
  margin-bottom: 30px;
  font-size: 0.9rem;
  color: #888;
}

.post-meta .author {
  font-weight: 500;
}

.post-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid #eee;
}

.post-navigation a {
  color: #4a6cf7;
  text-decoration: none;
}

.post-navigation .prev:before {
  content: '← ';
}

.post-navigation .next:after {
  content: ' →';
}
