/* 整个容器，固定最大宽度 1200px */
.post-container {
  max-width: 1200px;
  width: 100%;
  margin: 2rem auto;
  padding: 6rem 1rem;
  color: #333;
  line-height: 1.8;
}

/* 横向布局，文章和侧栏并排，间距 2rem */
.post-layout {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

/* ----------------------------
   左侧：文章内容卡片
   ---------------------------- */
.post-card {
  flex: 0 0 800px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 特色图依旧全宽 */
.post-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
}

/* 标题区 */
.post-header {
  padding: 2rem;
  text-align: center;
}
.post-title {
  margin: 0;
  font-size: 2.5rem;
  line-height: 1.2;
}
/* 发布日期（新闻中心分类文章） */
.post-header .post-date {
  display: block;
  margin-top: 0.75rem;
  color: #999;
  font-size: 0.875rem;
}

/* 正文区 */
.post-content {
  padding: 0 3rem 3rem;
  font-size: 16px;
  line-height: 1.8;
  color: #2c3e50;
}

/* 段落样式 */
.post-content p {
  margin: 1.5rem 0;
  text-align: justify;
  letter-spacing: 0.02em;
}

/* 标题样式 */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin: 2.5rem 0 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: #1a202c;
}

.post-content h1 {
  font-size: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid #3498db;
}

.post-content h2 {
  font-size: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.post-content h3 {
  font-size: 1.25rem;
  color: #2d3748;
}

.post-content h4 {
  font-size: 1.125rem;
  color: #4a5568;
}

.post-content h5 {
  font-size: 1rem;
  color: #718096;
}

.post-content h6 {
  font-size: 1rem;
  color: #a0aec0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* 列表样式 */
.post-content ul,
.post-content ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.post-content ul {
  list-style: none;
}

.post-content ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.8;
}

.post-content ul li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #3498db;
  font-weight: bold;
  font-size: 1.2rem;
  line-height: 1.4;
}

.post-content ol {
  counter-reset: ordered-list;
}

.post-content ol li {
  counter-increment: ordered-list;
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.75rem;
}

.post-content ol li::before {
  content: counter(ordered-list) ".";
  position: absolute;
  left: 0;
  color: #3498db;
  font-weight: 600;
  font-size: 1.1rem;
}

/* 嵌套列表 */
.post-content ul ul,
.post-content ol ul,
.post-content ul ol,
.post-content ol ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.post-content ul ul li::before {
  content: "◦";
  font-size: 1rem;
}

/* 图片样式 */
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 2rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.post-content img:hover {
  transform: scale(1.02);
}

/* 引用样式 */
.post-content blockquote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  background: #f7fafc;
  border-left: 4px solid #3498db;
  font-style: italic;
  color: #4a5568;
}

.post-content blockquote p {
  margin: 0;
}

/* 代码样式 */
.post-content code {
  background: #f1f5f9;
  color: #e53e3e;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

.post-content pre {
  background: #1a202c;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 2rem 0;
}

.post-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

/* 表格样式 */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

.post-content table th,
.post-content table td {
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.post-content table th {
  background: #f7fafc;
  font-weight: 600;
  color: #2d3748;
}

.post-content table tr:nth-child(even) {
  background: #f7fafc;
}

/* 链接样式 */
.post-content a {
  color: #3498db;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s ease;
}

.post-content a:hover {
  border-bottom-color: #3498db;
}

/* 强调文本 */
.post-content strong {
  font-weight: 600;
  color: #1a202c;
}

.post-content em {
  font-style: italic;
  color: #4a5568;
}

/* 水平线 */
.post-content hr {
  margin: 3rem 0;
  border: none;
  height: 2px;
  background: linear-gradient(to right, transparent, #e2e8f0, transparent);
}

/* 标签&页脚 */
.post-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #eee;
}
.post-tags span {
  font-weight: bold;
  margin-right: 0.5rem;
}
.post-tags a {
  color: #0066cc;
  text-decoration: none;
}
.post-tags a:hover {
  text-decoration: underline;
}

/* 作者信息卡片底部 */
.author-box {
  display: flex;
  background: #f9f9f9;
  padding: 1rem 1.5rem;
  border-top: 1px solid #eee;
}
.author-avatar img {
  border-radius: 50%;
}
.author-info {
  margin-left: 1rem;
}
.author-info h4 {
  margin: 0 0 0.5rem;
}
.author-info p {
  margin: 0;
  color: #555;
}

/* ----------------------------
   右侧：相关文章卡片
   ---------------------------- */
.related-posts-sidebar {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 4rem; 
  flex: 1;
}
.related-title {
  font-size: 1.25rem;
  margin: 0 0 1rem;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.5rem;
}
.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1; /* 如果想让列表撑满侧栏高度 */
  display: flex;
  flex-direction: column;
  gap: 1rem;
  line-height: 1.5;
}
.related-list a {
  color: #0066cc;
  text-decoration: none;
}
.related-list a:hover {
  text-decoration: underline;
}

/* ------ 响应式 ------ */
@media (max-width: 1024px) {
  .post-layout {
    flex-direction: column;
  }
  .post-card,
  .related-posts-sidebar {
    flex: 0 0 auto;
    width: 100%;
  }
  .related-posts-sidebar {
    margin-top: 2rem;
    position: static;
  }
}

@media (max-width: 768px) {
  .post-container {
    padding: 2rem 0.5rem;
  }
  
  .post-header {
    padding: 1.5rem;
  }
  
  .post-title {
    font-size: 2rem;
  }
  
  .post-content {
    padding: 0 1.5rem 1.5rem;
    font-size: 15px;
  }
  
  .post-content h1 {
    font-size: 1.75rem;
  }
  
  .post-content h2 {
    font-size: 1.5rem;
  }
  
  .post-content h3 {
    font-size: 1.25rem;
  }
  
  .post-content h4 {
    font-size: 1.125rem;
  }
  
  .post-content ul,
  .post-content ol {
    padding-left: 1.5rem;
  }
  
  .post-content ul li {
    padding-left: 1.25rem;
  }
  
  .post-content ol li {
    padding-left: 1.5rem;
  }
  
  .post-content blockquote {
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
  }
  
  .post-content pre {
    padding: 1rem;
    font-size: 0.875rem;
  }
  
  .post-content table {
    font-size: 0.875rem;
  }
  
  .post-content table th,
  .post-content table td {
    padding: 0.5rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .post-card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }
  
  .post-header {
    padding: 1rem;
  }
  
  .post-title {
    font-size: 1.75rem;
  }
  
  .post-content {
    padding: 0 1rem 1rem;
    font-size: 14px;
  }
  
  .post-content p {
    text-align: left;
  }
  
  .post-content h1,
  .post-content h2,
  .post-content h3,
  .post-content h4,
  .post-content h5,
  .post-content h6 {
    margin: 2rem 0 0.75rem;
  }
  
  .related-posts-sidebar {
    padding: 1rem;
  }
  
  .related-title {
    font-size: 1.125rem;
  }
}
