*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font: 16px/1.8 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; color: #27272a; background: #fafafa; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.blog-header { padding: 28px 0 20px; text-align: center; }
.blog-header-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.blog-title { font-size: 30px; font-weight: 800; color: #18181b; }
.blog-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 15px; }
.blog-nav a { color: #52525b; }
.blog-nav a.active { color: var(--accent); font-weight: 700; }
.blog-intro h1 { margin: 0 0 6px; font-size: 26px; color: #18181b; }
.blog-intro p { margin: 0; color: #52525b; }
.blog-intro .chips { margin-top: 12px; }
.recent-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.recent-list li { padding: 6px 0; border-bottom: 1px dashed #ececf0; }
.recent-list li:last-child { border-bottom: 0; }
.recent-list a { display: block; color: #3f3f46; }
.recent-list time { font-size: 12px; color: #a1a1aa; }
.side-toc ol { margin: 0; padding-left: 18px; font-size: 14px; }
.side-toc a { color: #3f3f46; }
.post-author { color: #52525b; font-weight: 600; }
.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; align-items: start; }
.card { background: #fff; border: 1px solid #ececf0; border-radius: 12px; padding: 20px 24px; margin-bottom: 20px; }

.post-card h2 { margin: 4px 0 6px; font-size: 22px; line-height: 1.4; }
.post-card h2 a { color: #18181b; }
.post-card p { margin: 0 0 8px; color: #52525b; }
.post-cover img { width: calc(100% + 48px); max-width: none; margin: -20px -24px 14px; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 12px 12px 0 0; }
.post-meta { color: #a1a1aa; font-size: 13px; }
.read-more { font-size: 14px; font-weight: 600; }

.blog-side { position: sticky; top: 16px; }
.blog-side h2 { font-size: 15px; margin: 0 0 8px; }
.about { text-align: center; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 28px; display: grid; place-items: center; margin: 0 auto 8px; }
.about p { color: #52525b; font-size: 14px; text-align: left; }
.cat-list, .cat-list ul { list-style: none; margin: 0; padding: 0; }
.cat-list ul { padding-left: 14px; }
.cat-list a { display: block; padding: 3px 0; color: #3f3f46; font-size: 14px; }
.cat-list a.active { color: var(--accent); font-weight: 700; }

.archive-head h1 { margin: 0; }
.crumbs { margin: 0; font-size: 13px; color: #a1a1aa; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.chips a { background: #f4f4f5; border-radius: 999px; padding: 0 12px; font-size: 13px; color: #3f3f46; }

.post h1 { font-size: 30px; line-height: 1.35; margin: 6px 0; color: #18181b; }
.post-hero { margin: 16px -24px; }
.post-hero img { width: 100%; }
.toc { background: #fafafa; border: 1px solid #ececf0; border-radius: 8px; padding: 8px 16px; margin: 12px 0; font-size: 14px; }
.toc summary { font-weight: 700; cursor: pointer; }
.toc ol { margin: 6px 0 0; padding-left: 20px; }
.toc-l3 { margin-left: 16px; }
.post-body { font-size: 17px; }
.post-body h2 { font-size: 22px; margin: 32px 0 10px; scroll-margin-top: 16px; }
.post-body h3 { scroll-margin-top: 16px; }
.post-body blockquote { margin: 16px 0; padding: 4px 16px; border-left: 4px solid var(--accent); color: #52525b; background: #faf5ff; }
.post-body pre { background: #18181b; color: #f4f4f5; padding: 12px; border-radius: 8px; overflow: auto; }
.post-body table { border-collapse: collapse; width: 100%; }
.post-body th, .post-body td { border: 1px solid #e4e4e7; padding: 6px 10px; }
.post-body img { margin: 16px auto; border-radius: 8px; }
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.prev-next a { border: 1px solid #ececf0; border-radius: 8px; padding: 10px 14px; color: #27272a; font-size: 15px; }
.prev-next .next { grid-column: 2; text-align: right; }
.prev-next small { display: block; color: #a1a1aa; }
.section-title { font-size: 18px; margin: 0 0 8px; }
.related { margin: 0; padding-left: 18px; }
.related time { color: #a1a1aa; font-size: 13px; }

.pagination { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.pagination a { background: #fff; border: 1px solid #ececf0; border-radius: 999px; padding: 4px 16px; }
.empty { text-align: center; color: #71717a; }
.blog-footer { text-align: center; color: #a1a1aa; font-size: 13px; padding: 20px 0 40px; }
.blog-footer a { color: #a1a1aa; }

@media (min-width: 861px) {
  .toc-inline { display: none; }
}

@media (max-width: 860px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-side { position: static; }
  .side-toc { display: none; }
  .blog-nav { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; white-space: nowrap; padding-bottom: 4px; }
  .post h1 { font-size: 24px; }
  .card { padding: 16px 18px; }
  .post-cover img { width: calc(100% + 36px); margin: -16px -18px 12px; }
  .post-hero { margin: 12px -18px; }
  .prev-next { grid-template-columns: 1fr; }
  .prev-next .next { grid-column: 1; text-align: left; }
}

/* ---- SEO 公共区块与响应式基础（各主题共用，类名以 seo- 开头） ---- */
img,
video {
  max-width: 100%;
  height: auto;
}

table:not([class]) {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  -webkit-overflow-scrolling: touch;
}

pre {
  max-width: 100%;
  overflow-x: auto;
}

.seo-footer-nav {
  margin: 0 0 12px;
  font-size: 13px;
}

.seo-footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.seo-footer-nav ul ul {
  display: inline-flex;
  gap: 4px 10px;
  margin-left: 8px;
  opacity: 0.8;
}

.seo-footer-nav a {
  color: inherit;
  text-decoration: none;
}

.seo-footer-nav a:hover {
  text-decoration: underline;
}

.seo-related,
.seo-tags,
nav.seo-back {
  margin: 24px 0;
}

.seo-related h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.seo-related ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.seo-related ul a,
.seo-chip,
.seo-tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: inherit;
  text-decoration: none;
  border: 1px solid rgba(127, 127, 127, 0.35);
  border-radius: 999px;
}

.seo-tag {
  background: rgba(127, 127, 127, 0.08);
}

.seo-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.seo-tags-label {
  font-size: 13px;
  opacity: 0.75;
}

.seo-back {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.seo-back-link {
  font-weight: 600;
}

.seo-paged-title {
  margin: 0 0 16px;
  font-size: 22px;
}

@media (max-width: 640px) {
  .seo-footer-nav ul ul {
    display: none;
  }

  .seo-related ul a,
  .seo-chip {
    padding: 6px 12px;
  }
}
