/* 站点头部样式 */
.site-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #eee;
}

.site-header h1 {
  font-size: 2.2em;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: #333;
}

.site-header h1 a {
  color: #333;
  text-decoration: none;
}

.site-header h1 a:hover {
  color: #0066cc;
}

.site-header h2 {
  font-size: 1.1em;
  font-weight: 400;
  color: #666;
  margin: 0;
}

/* 主容器布局 */
.main-container {
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 50px;
}

.posts-section {
  flex: 1;
  min-width: 0;
}

/* 文章预览样式 */
.post-preview {
  margin-bottom: 35px;
  padding-bottom: 35px;
  border-bottom: 1px solid #e0e0e0;
}

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

.post-title {
  margin: 0 0 12px 0;
  font-size: 1.6em;
  line-height: 1.3;
}

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

.post-title a:hover {
  color: #0066cc;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  font-size: 0.9em;
  color: #666;
}

.post-date {
  color: #999;
}

.post-category {
  display: flex;
  gap: 8px;
}

.category-tag {
  background-color: #f0f0f0;
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 0.85em;
  color: #555;
}

.post-excerpt {
  line-height: 1.7;
  color: #555;
  margin-bottom: 15px;
  font-size: 1em;
}

.read-more {
  color: #0066cc;
  text-decoration: none;
  font-size: 0.95em;
  font-weight: 500;
}

.read-more:hover {
  text-decoration: underline;
}

/* 侧边栏样式 */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  padding-right: 0;
}

.widget {
  background: #f8f8f8;
  padding: 20px;
  margin-bottom: 30px;
  border-radius: 5px;
}

.widget-title {
  font-size: 1.2em;
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #ddd;
}

.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-list li {
  margin-bottom: 10px;
}

.category-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #555;
  text-decoration: none;
  padding: 5px 0;
  transition: color 0.3s;
}

.category-list a:hover {
  color: #0066cc;
}

.category-list .count {
  background: #e0e0e0;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.85em;
  color: #666;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-item {
  background: #fff;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.9em;
  color: #666;
  text-decoration: none;
  border: 1px solid #ddd;
  transition: all 0.3s;
}

.tag-item:hover {
  background: #0066cc;
  color: #fff;
  border-color: #0066cc;
}

/* 响应式设计 */
@media (max-width: 968px) {
  .main-container {
    flex-direction: column;
    gap: 30px;
  }
  
  .sidebar {
    width: 100%;
  }
  
  .widget {
    padding: 15px;
  }
}

@media (max-width: 768px) {
  .main-container {
    padding: 0 15px;
  }
  
  .post-title {
    font-size: 1.4em;
  }
  
  .post-meta {
    flex-wrap: wrap;
    font-size: 0.85em;
  }
}

/* 文章页面样式 */
.post-header {
  margin-bottom: 30px;
}

.breadcrumb {
  margin-bottom: 20px;
}

.breadcrumb a {
  color: #0066cc;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.post-author a {
  color: #0066cc;
  text-decoration: none;
}

.repo-intro {
  padding: 15px;
  background: #f0f9ff;
  border-left: 4px solid #0066cc;
  margin-bottom: 25px;
  font-size: 0.95em;
  color: #555;
}

.repo-intro a {
  color: #0066cc;
  font-weight: bold;
}

.post-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.post-tags .tag {
  display: inline-block;
  background: #f0f0f0;
  padding: 5px 12px;
  margin: 5px 5px 5px 0;
  border-radius: 15px;
  font-size: 0.85em;
  color: #555;
}

/* 分类页面样式 */
.category-section {
  margin-bottom: 40px;
}

.category-section h2 {
  color: #333;
  border-bottom: 2px solid #0066cc;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.category-posts {
  list-style: none;
  padding: 0;
}

.category-posts li {
  margin-bottom: 10px;
}

.category-posts a {
  display: flex;
  justify-content: space-between;
  color: #333;
  text-decoration: none;
  padding: 10px;
  background: #f8f8f8;
  border-radius: 5px;
  transition: all 0.3s;
}

.category-posts a:hover {
  background: #0066cc;
  color: white;
  transform: translateX(5px);
}

/* 性能优化：减少重绘和重排 */
.post-preview,
.widget,
.related-posts {
  will-change: transform;
}

/* 优化字体加载 */
body {
  font-display: swap;
}

/* 相关文章样式 */
.related-posts {
  margin-top: 50px;
  padding: 25px;
  background: #f8f8f8;
  border-radius: 8px;
}

.related-posts h3 {
  margin: 0 0 20px 0;
  font-size: 1.3em;
  color: #333;
  border-bottom: 2px solid #0066cc;
  padding-bottom: 10px;
}

.related-posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-posts-list li {
  margin-bottom: 12px;
}

.related-posts-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: #333;
  padding: 10px;
  background: white;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.related-posts-list a:hover {
  background: #0066cc;
  color: white;
  transform: translateX(5px);
}

.related-title {
  flex: 1;
  margin-right: 15px;
}

.related-date {
  font-size: 0.85em;
  opacity: 0.7;
}