/* 博客样式：复用站点既有的设计变量与页头/页脚，仅追加博客特有版式。 */

/* ---------- 页面骨架 ---------- */
.blog-wrap {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

/* 博客页页头：窄屏也保留全部导航入口（覆盖 styles.css 中的全局隐藏规则） */
@media (max-width: 900px) {
  .blog-body .site-header {
    gap: 18px;
    padding-inline: 16px;
  }

  .blog-body .site-header .nav-links {
    gap: 16px;
    margin-left: auto;
  }

  .blog-body .site-header .nav-links a {
    display: inline;
    font-size: 13px;
  }
}

@media (max-width: 600px) {
  .blog-body .site-header .brand {
    gap: 8px;
    font-size: 18px;
  }

  .blog-body .site-header .brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .blog-body .site-header .brand small {
    display: none;
  }

  .blog-body .site-header .nav-links {
    gap: 11px;
  }

  .blog-body .site-header .nav-links a {
    font-size: 12px;
  }
}

/* ---------- 博客首页 ---------- */
.blog-hero {
  padding: 74px 0 52px;
  text-align: center;
  background: linear-gradient(180deg, #f5fbff, #fff);
}

.blog-kicker {
  display: block;
  color: var(--purple);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
}

.blog-hero h1 {
  margin: 16px 0 18px;
  font-size: clamp(42px, 5.6vw, 68px);
  line-height: 1.05;
  letter-spacing: -.06em;
}

.blog-hero p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.blog-section {
  padding: 8px 0 110px;
}

.blog-count {
  margin: 0 0 26px;
  color: #8c8799;
  font-size: 13px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}

/* ---------- 文章卡片 ---------- */
.post-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: #cfe4f2;
  box-shadow: 0 20px 44px rgba(25, 94, 138, .12);
}

.post-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.post-card-cover {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #eef8ff, #f7f2ff);
  overflow: hidden;
}

.post-card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.post-card:hover .post-card-cover img {
  transform: scale(1.04);
}

.post-card-body {
  flex: 1;
  padding: 26px 28px 30px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8c8799;
  font-size: 12px;
  letter-spacing: .02em;
}

.post-meta i {
  width: 3px;
  height: 3px;
  background: #c8d4e2;
  border-radius: 50%;
}

.post-card h2 {
  margin: 14px 0 12px;
  font-size: 23px;
  line-height: 1.35;
  letter-spacing: -.03em;
}

.post-card-link:hover h2 {
  color: var(--purple);
}

.post-card-body > p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.post-tags li {
  padding: 6px 11px;
  color: #5f5a6d;
  background: var(--soft);
  border-radius: 100px;
  font-size: 12px;
}

.blog-empty {
  padding: 70px 30px;
  color: var(--muted);
  text-align: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 22px;
}

/* ---------- 文章页 ---------- */
.post-page {
  padding: 56px 0 100px;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 34px;
  color: #5d5969;
  font-size: 14px;
  text-decoration: none;
}

.post-back:hover {
  color: var(--purple);
}

.post-shell {
  width: min(760px, calc(100% - 40px));
  margin-inline: auto;
}

.post-head h1 {
  margin: 16px 0 20px;
  font-size: clamp(36px, 4.6vw, 54px);
  line-height: 1.14;
  letter-spacing: -.055em;
}

.post-excerpt {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.post-cover {
  margin: 34px 0 0;
  border-radius: 22px;
  overflow: hidden;
}

.post-cover img {
  display: block;
  width: 100%;
  height: auto;
}

/* 正文排版 */
.post-content {
  margin-top: 42px;
  color: #4f5d74;
  font-size: 17px;
  line-height: 1.95;
}

.post-content > *:first-child {
  margin-top: 0;
}

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

.post-content h2 {
  margin: 46px 0 16px;
  color: var(--ink);
  font-size: 27px;
  line-height: 1.3;
  letter-spacing: -.035em;
}

.post-content h3 {
  margin: 34px 0 14px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.4;
  letter-spacing: -.02em;
}

.post-content h4 {
  margin: 28px 0 12px;
  color: var(--ink);
  font-size: 18px;
}

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

.post-content li {
  margin-bottom: 9px;
}

/* 段落对齐（由后台工具栏写入的受限类；左对齐即无类）
   类名与后台编辑器共用，见 blog-admin/public/admin.css */
.post-content .ta-center {
  text-align: center;
}

.post-content .ta-right {
  text-align: right;
}

.post-content a {
  color: var(--purple);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-content strong,
.post-content b {
  color: var(--ink);
}

.post-content blockquote {
  margin: 28px 0;
  padding: 18px 24px;
  color: #4f5d74;
  background: var(--soft);
  border-left: 4px solid var(--purple);
  border-radius: 0 16px 16px 0;
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 30px auto;
  border-radius: 18px;
}

.post-content figure {
  margin: 30px 0;
}

.post-content figcaption {
  margin-top: 10px;
  color: #8c8799;
  font-size: 13px;
  text-align: center;
}

.post-content hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.post-content code {
  padding: 2px 7px;
  color: #22406a;
  background: #eef5fb;
  border-radius: 6px;
  font-size: .92em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.post-content pre {
  margin: 26px 0;
  padding: 20px 22px;
  background: #0f2743;
  border-radius: 16px;
  overflow-x: auto;
}

.post-content pre code {
  padding: 0;
  color: #d8e8f6;
  background: transparent;
  font-size: 13.5px;
  line-height: 1.7;
}

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

.post-content th,
.post-content td {
  padding: 11px 14px;
  border: 1px solid var(--line);
  text-align: left;
}

.post-content th {
  color: var(--ink);
  background: var(--soft);
}

/* 文章页脚 */
.post-foot {
  margin-top: 56px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.post-foot a {
  color: var(--purple);
  font-size: 14px;
  text-decoration: none;
}

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

.post-foot span {
  color: #8c8799;
  font-size: 13px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .blog-hero {
    padding: 56px 0 40px;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .post-page {
    padding: 36px 0 80px;
  }

  .post-content {
    font-size: 16.5px;
  }
}

@media (max-width: 600px) {
  .blog-wrap,
  .post-shell {
    width: min(100% - 28px, 1120px);
  }

  .post-card-body {
    padding: 22px 20px 26px;
  }

  .post-card h2 {
    font-size: 21px;
  }

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

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

  .post-foot {
    flex-direction: column;
    align-items: flex-start;
  }
}
