/* Blog-specific styles that extend the main style.css */

/* 博客列表样式 */
.posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  border-bottom: 1px solid #eaeaea;
  padding: 1.5em 0;
  transition: background-color 0.2s ease;
}

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

.post-item:hover {
  background-color: #fafafa;
  padding-left: 10px;
  margin-left: -10px;
  padding-right: 10px;
  margin-right: -10px;
  border-radius: 4px;
}

.post-date {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 0.3em;
  font-family: 'Inter', sans-serif;
}

.post-item h3 {
  margin: 0.3em 0;
  font-size: 1.4em;
  font-family: 'Merriweather', serif;
  font-weight: 600;
}

.post-item h3 a {
  color: #1d1d1f;
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-item h3 a:hover {
  color: #8C1515;
}

.post-description {
  color: #555;
  margin: 0.5em 0;
  line-height: 1.6;
}

/* 标签样式 */
.tags {
  display: inline-flex;
  gap: 0.5em;
  flex-wrap: wrap;
  margin-top: 0.5em;
}

.tag {
  display: inline-block;
  background-color: #f0f0f0;
  color: #666;
  padding: 0.2em 0.6em;
  border-radius: 3px;
  font-size: 0.85em;
  font-weight: 500;
}

/* 文章元数据样式 */
.post-meta {
  color: #666;
  font-size: 0.95em;
  margin: 0.5em 0;
}

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

/* 文章内容样式 */
#post-content {
  font-family: 'Inter', sans-serif;
  line-height: 1.8;
  color: #1d1d1f;
}

#post-content h1,
#post-content h2,
#post-content h3,
#post-content h4,
#post-content h5,
#post-content h6 {
  font-family: 'Merriweather', serif;
  margin-top: 1.5em;
  margin-bottom: 0.8em;
  font-weight: 600;
  line-height: 1.3;
}

#post-content h1 {
  font-size: 2em;
  color: #8C1515;
  border-bottom: 2px solid #8C1515;
  padding-bottom: 0.3em;
}

#post-content h2 {
  font-size: 1.6em;
  color: #8C1515;
  border-left: 4px solid #8C1515;
  padding-left: 10px;
}

#post-content h3 {
  font-size: 1.3em;
  color: #333;
}

#post-content h4 {
  font-size: 1.1em;
  color: #444;
}

#post-content p {
  margin: 1em 0;
}

#post-content a {
  color: #8C1515;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

#post-content a:hover {
  border-bottom-color: #8C1515;
}

/* 代码样式 */
#post-content code {
  background-color: #f5f5f5;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  font-size: 0.9em;
  color: #d73a49;
}

#post-content pre {
  background-color: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 1em;
  overflow-x: auto;
  margin: 1.5em 0;
}

#post-content pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.9em;
  line-height: 1.6;
}

/* 引用块样式 */
#post-content blockquote {
  border-left: 4px solid #8C1515;
  margin: 1.5em 0;
  padding-left: 1em;
  color: #555;
  font-style: italic;
  background-color: #fafafa;
  padding: 0.8em 1em;
  border-radius: 0 4px 4px 0;
}

/* 列表样式 */
#post-content ul,
#post-content ol {
  margin: 1em 0;
  padding-left: 2em;
}

#post-content li {
  margin: 0.5em 0;
}

/* 表格样式 */
#post-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5em 0;
  font-size: 0.95em;
}

#post-content th,
#post-content td {
  border: 1px solid #e1e4e8;
  padding: 0.6em 1em;
  text-align: left;
}

#post-content th {
  background-color: #f6f8fa;
  font-weight: 600;
  color: #333;
}

#post-content tr:nth-child(even) {
  background-color: #fafafa;
}

/* 图片样式 */
#post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5em auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 水平分割线 */
#post-content hr {
  border: none;
  border-top: 1px solid #eaeaea;
  margin: 2em 0;
}

/* 加载和错误消息样式 */
.loading,
.error,
.no-posts {
  text-align: center;
  color: #666;
  padding: 2em;
  font-style: italic;
}

.error {
  color: #d73a49;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .post-item h3 {
    font-size: 1.2em;
  }

  #post-content h1 {
    font-size: 1.6em;
  }

  #post-content h2 {
    font-size: 1.3em;
  }

  #post-content h3 {
    font-size: 1.1em;
  }

  #post-content pre {
    padding: 0.8em;
    font-size: 0.85em;
  }

  #post-content table {
    font-size: 0.85em;
  }

  #post-content th,
  #post-content td {
    padding: 0.4em 0.6em;
  }
}
