/* ================================
   知识库文章页：正文与右侧大纲布局
================================ */

.common-post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 14px;
  align-items: start;
}

.common-post-shell {
  width: 100%;
}

.common-post-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 8px 28px 20px 30px;
  box-shadow: none;
}

.common-post-header {
  margin-bottom: 24px;
}

.common-post-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 16px;
}

.common-post-category {
  color: #2563eb;
}

.common-post-category:hover {
  color: #1d4ed8;
}

.common-post-title {
  margin: 0 0 22px;
  font-size: 42px;
  line-height: 1.22;
  color: #111827;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.common-post-content {
  color: #1f2937;
  font-size: 16px;
  line-height: 1.95;
}

.common-post-content p {
  margin: 0 0 1.15em;
}

.common-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.common-post-content h2,
.common-post-content h3,
.common-post-content h4 {
  margin-top: 1.7em;
  margin-bottom: 0.75em;
  color: #111827;
}

.common-post-content pre {
  overflow: auto;
  border-radius: 12px;
  padding: 16px;
  background: #0f172a;
  color: #e5e7eb;
}

.common-post-content blockquote {
  margin: 1.2em 0;
  padding: 12px 16px;
  border-left: 4px solid #1677ff;
  background: #f8fbff;
  color: #374151;
  border-radius: 0 10px 10px 0;
}


/* ================================
   知识库文章页：右侧文章目录
================================ */

.post-toc {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  width: 210px;
  max-height: calc(100vh - 128px);
  padding: 24px 0 0 20px;
  border-left: 1px solid #e5e7eb;
  overflow: hidden;
}

.post-toc-title {
  flex-shrink: 0;
  margin-bottom: 10px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.post-toc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.post-toc-list::-webkit-scrollbar {
  width: 5px;
}

.post-toc-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}

.post-toc-link {
  display: block;
  padding: 5px 8px;
  border-left: 3px solid transparent;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.5;
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.post-toc-link:hover {
  color: #1677ff;
}

.post-toc-link.active {
  color: #1677ff;
  font-weight: 600;
  border-left-color: #1677ff;
}

.post-toc-link.h3 {
  padding-left: 14px;
  color: #6b7280;
  font-size: 12px;
}

.post-toc-link.h3.active {
  color: #1d4ed8;
}


/* ================================
   知识库文章页：上一篇 / 下一篇
================================ */

.common-post-nav {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.common-post-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.common-post-nav-item {
  display: flex;
  flex-direction: column;
  min-height: 84px;
  padding: 16px 18px;
  text-decoration: none;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.common-post-nav-item:hover {
  border-color: #bfdbfe;
  background: #f9fbff;
  transform: translateY(-2px);
}

.common-post-nav-item.empty {
  visibility: hidden;
}

.common-post-nav-label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}

.common-post-nav-title {
  font-size: 15px;
  line-height: 1.6;
  color: #111827;
  font-weight: 600;
}


/* ================================
   响应式
================================ */

@media (max-width: 1200px) {
  .common-post-layout {
    grid-template-columns: 1fr;
  }

  .post-toc {
    display: none;
  }
}

@media (max-width: 768px) {
  .common-post-card {
    padding: 18px 14px;
  }

  .common-post-title {
    font-size: 30px;
  }

  .common-post-nav-grid {
    grid-template-columns: 1fr;
  }
}
