* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* 站点头部 */
.site-header {
  padding: 30px 0;
  border-bottom: 1px solid #eaecef;
  margin-bottom: 30px;
}

.site-title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
}

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

.site-title a:hover {
  color: #0366d6;
}

.site-description {
  margin: 10px 0;
  color: #666;
  font-size: 16px;
}

.site-nav a {
  margin-right: 15px;
  color: #0366d6;
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
}

.site-nav-divider {
  margin-right: 15px;
  color: #dfe2e5;
}

/* 文章列表 */
.posts-list h2 {
  font-size: 24px;
  margin-bottom: 20px;
}

.post-preview {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eaecef;
}

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

.post-title {
  margin: 0 0 8px 0;
  font-size: 17px;
  font-weight: 500;
}

.post-preview-body {
  display: flex;
  gap: 15px;
  margin-top: 8px;
}

.post-preview-thumbnail {
  width: 200px;
  height: 112px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background-color: #f6f8fa;
}

.post-preview-excerpt {
  flex: 1;
  min-width: 0;
}

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

.post-title a:hover {
  color: #0366d6;
}

.post-meta {
  margin: 4px 0;
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.post-meta time {
  margin-right: 0;
}

.post-categories a,
.post-tags a {
  color: #0366d6;
  text-decoration: none;
  font-size: 12px;
}

.post-categories a:hover,
.post-tags a:hover {
  text-decoration: underline;
}

.post-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.post-tag-item {
  display: inline-block;
  background-color: #f6f8fa;
  color: #0366d6;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  text-decoration: none;
}

.post-tag-item:hover {
  background-color: #e1e4e8;
}

.post-excerpt {
  margin-top: 6px;
  color: #666;
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 文章页面 */
.post {
  padding: 20px 0;
}

.post-header {
  margin-bottom: 30px;
}

.post-title {
  font-size: 24px;
  margin-bottom: 10px;
  font-weight: 500;
}

.post-content {
  line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin-top: 25px;
  margin-bottom: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.post-content h1 {
  font-size: 22px;
  border-bottom: 1px solid #eaecef;
  padding-bottom: 8px;
}

.post-content h2 {
  font-size: 19px;
  border-bottom: 1px solid #eaecef;
  padding-bottom: 6px;
}

.post-content h3 {
  font-size: 17px;
}

.post-content h4 {
  font-size: 16px;
}

.post-content p {
  margin: 15px 0;
}

.post-content a {
  color: #0366d6;
  text-decoration: none;
}

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

.post-content code {
  background-color: #f6f8fa;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 85%;
}

.post-content pre {
  background-color: #f6f8fa;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 15px 0;
}

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

.post-content blockquote {
  padding: 0 15px;
  margin: 15px 0;
  color: #666;
  border-left: 4px solid #dfe2e5;
}

.post-content ul,
.post-content ol {
  padding-left: 30px;
  margin: 15px 0;
}

.post-content li {
  margin: 5px 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
}

.post-content table th,
.post-content table td {
  padding: 8px 13px;
  border: 1px solid #dfe2e5;
}

.post-content table th {
  background-color: #f6f8fa;
  font-weight: 500;
}

.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 15px 0;
}

/* 分页 */
.pagination {
  margin: 30px 0;
  text-align: center;
}

.pagination a {
  display: inline-block;
  padding: 8px 16px;
  margin: 0 5px;
  background-color: #f6f8fa;
  color: #0366d6;
  text-decoration: none;
  border-radius: 6px;
}

.pagination a:hover {
  background-color: #0366d6;
  color: #fff;
}

.pagination .page-number {
  display: inline-block;
  padding: 8px 16px;
  margin: 0 5px;
}

/* 站点底部 */
.site-footer {
  margin-top: 50px;
  padding: 20px 0;
  border-top: 1px solid #eaecef;
  text-align: center;
  font-size: 14px;
  color: #666;
}

.site-footer a {
  color: #0366d6;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 600px) {
  .container {
    padding: 15px;
  }

  .site-header {
    padding: 20px 0;
  }

  .site-title {
    font-size: 24px;
  }

  .post-title {
    font-size: 20px;
  }

  .post-content h1 {
    font-size: 19px;
  }

  .post-content h2 {
    font-size: 17px;
  }

  /* 移动端隐藏缩略图，摘要占满宽度 */
  .post-preview-thumbnail {
    display: none;
  }

  .post-preview-body {
    display: block;
  }
}
