/**
 * WPDevBase - Single Post & Documentation Typography
 * Version: 1.0.0
 * Stripe / GitHub Docs Reading Standards
 */

.post-layout-wrap {
  padding: 48px 0 80px;
}

/* 左右两栏主栅格 (内容 72% + 粘性目录 28%) */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
  align-items: start;
}

/* ==========================================================================
   1. 文章头部元信息 (Header Metadata)
   ========================================================================== */
.post-header {
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 28px;
}

.post-meta-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 13px;
}

.post-category-badge {
  background-color: #ede9fe;
  color: #6366f1;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-reading-time {
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 20px;
}

.post-author-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
}

.author-details {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.post-date {
  font-size: 12px;
  color: var(--text-dim);
}

/* ==========================================================================
   2. GEO 友好型 TL;DR 核心要点总结卡片 (AI 最爱抓取)
   ========================================================================== */
.tldr-box {
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #6366f1;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 36px;
}

.tldr-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6366f1;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tldr-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   3. 正文排印规范 (Typography)
   ========================================================================== */
.entry-content {
  font-size: 17px;
  line-height: 1.8;
  color: #334155; /* Slate 700，极度适合长文阅读 */
}

.entry-content p {
  margin-bottom: 24px;
}

.entry-content h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--text-main);
  margin-top: 48px;
  margin-bottom: 16px;
  scroll-margin-top: 90px; /* 避开吸顶导航遮挡 */
}

.entry-content h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-main);
  margin-top: 36px;
  margin-bottom: 14px;
  scroll-margin-top: 90px;
}

.entry-content ul, .entry-content ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

.entry-content li {
  margin-bottom: 8px;
}

.entry-content blockquote {
  border-left: 3px solid #0284c7;
  background-color: #f0f9ff;
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 28px 0;
  color: #0369a1;
  font-style: italic;
}

/* ==========================================================================
   4. 极客深色代码块 + 一键复制按钮 (Code Container)
   ========================================================================== */
.entry-content pre {
  background-color: #0f172a; /* 深色沉浸式代码背景 */
  color: #e2e8f0;
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
  margin: 28px 0;
  position: relative;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.entry-content code {
  font-family: var(--font-mono);
  font-size: 14px;
  background-color: #f1f5f9;
  color: #0f172a;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.entry-content pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
  border: none;
}

/* 动态插入的代码块复制按钮 */
.copy-code-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.copy-code-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.copy-code-btn.copied {
  color: #10b981;
  border-color: #10b981;
}

/* ==========================================================================
   5. 右侧粘性自动目录 (Sticky Table of Contents)
   ========================================================================== */
.toc-sidebar {
  position: sticky;
  top: 92px; /* 吸顶距离 */
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.toc-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toc-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.4;
  display: block;
  transition: all var(--trans-fast);
  border-left: 2px solid transparent;
  padding-left: 10px;
  margin-left: -10px;
}

.toc-link:hover {
  color: #0284c7;
}

.toc-link.active {
  color: #6366f1;
  font-weight: 700;
  border-left-color: #6366f1;
}

/* ==========================================================================
   6. 文末 E-E-A-T 作者名片
   ========================================================================== */
.post-author-box {
  margin-top: 56px;
  padding: 28px;
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  display: flex;
  gap: 20px;
  align-items: center;
}

.author-box-bio {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
}

@media (max-width: 992px) {
  .post-layout {
    grid-template-columns: 1fr;
  }
  .toc-sidebar {
    display: none; /* 移动端隐藏侧栏目录 */
  }
}