:root {
  --ink: #0b1728;
  --muted: #5d6977;
  --paper: #f5f5f1;
  --white: #fff;
  --line: #d9e0e8;
  --blue: #155eef;
  --soft-blue: #eaf1ff;
  font-family: Inter, "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 80% 0, rgba(21, 94, 239, .12), transparent 30rem),
    var(--paper);
}
a { color: inherit; text-decoration: none; }

.blog-header, .blog-main, .article-main, .blog-footer {
  width: min(1060px, calc(100% - 48px));
  margin: 0 auto;
}
.blog-header {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.blog-brand { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 750; letter-spacing: .12em; }
.blog-brand b { color: var(--blue); }
.blog-mark { width: 34px; height: 34px; display: grid; place-items: center; color: white; background: var(--ink); border-radius: 9px; font: 21px Georgia, serif; }
.blog-header nav { display: flex; gap: 24px; }
.blog-header nav a { color: var(--muted); font-size: 13px; }
.blog-header nav a:hover { color: var(--blue); }

.blog-hero { max-width: 900px; padding: 110px 0 100px; }
.blog-eyebrow { margin: 0 0 18px; color: var(--blue); font: 800 11px ui-monospace, monospace; letter-spacing: .15em; }
.blog-hero h1, .article-header h1 { margin: 0; font-size: clamp(44px, 7vw, 76px); line-height: 1.06; letter-spacing: -.055em; }
.blog-hero > p:last-child { max-width: 690px; margin: 28px 0 0; color: var(--muted); font-size: 18px; line-height: 1.8; }

.post-list { padding: 40px 0 100px; border-top: 1px solid var(--ink); }
.post-list > header { display: flex; align-items: baseline; gap: 20px; margin-bottom: 28px; }
.post-list h2 { margin: 0; font-size: 32px; letter-spacing: -.035em; }
.post-list .blog-eyebrow { margin: 0; }
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.post-card { min-height: 300px; display: flex; flex-direction: column; padding: 34px; background: rgba(255,255,255,.78); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.post-meta, .article-meta { color: var(--muted); font: 11px ui-monospace, monospace; letter-spacing: .04em; }
.post-card h3 { margin: 24px 0 14px; font-size: 28px; line-height: 1.25; letter-spacing: -.035em; }
.post-card h3 a:hover { color: var(--blue); }
.post-card > p:not(.post-meta) { flex: 1; margin: 0; color: var(--muted); line-height: 1.75; }
.read-more { margin-top: 30px; color: var(--blue); font-size: 13px; font-weight: 750; }

.article-main { max-width: 860px; padding: 92px 0 80px; }
.article-header { padding-bottom: 46px; border-bottom: 1px solid var(--ink); }
.article-header h1 { max-width: 820px; font-size: clamp(44px, 7vw, 72px); }
.article-summary { max-width: 700px; margin: 26px 0 0; color: var(--muted); font-size: 18px; line-height: 1.75; }
.article-meta { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 28px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.article-tags li { padding: 6px 10px; color: var(--blue); background: var(--soft-blue); border-radius: 999px; font-size: 11px; font-weight: 700; }
.article-content { padding: 48px 0 30px; font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: 18px; }
.article-content h2 { margin: 58px 0 18px; font-family: Inter, "PingFang SC", sans-serif; font-size: 30px; letter-spacing: -.03em; }
.article-content h2:first-child { margin-top: 0; }
.article-content h3 { margin: 40px 0 14px; font-family: Inter, "PingFang SC", sans-serif; font-size: 22px; }
.article-content p, .article-content li { color: #334154; line-height: 1.95; }
.article-content li + li { margin-top: 8px; }
.article-content a { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }
.article-content code { padding: 2px 6px; color: #173866; background: var(--soft-blue); border-radius: 5px; font: .88em ui-monospace, monospace; }
.article-content pre { overflow-x: auto; padding: 22px; color: #e8eef7; background: #101c2b; border-radius: 12px; line-height: 1.65; }
.article-content pre code { padding: 0; color: inherit; background: transparent; }
.article-content .mermaid-diagram { margin: 30px 0; overflow-x: auto; padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.article-content .mermaid-diagram .mermaid { min-width: 680px; margin: 0; padding: 0; color: var(--ink); background: transparent; border-radius: 0; font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; text-align: center; }
.article-content .mermaid-diagram svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.article-content blockquote { margin: 28px 0; padding: 12px 22px; border-left: 4px solid var(--blue); background: var(--soft-blue); }
.article-content .katex-display { overflow-x: auto; overflow-y: hidden; padding: 8px 0; }
.article-content .katex { font-size: 1.06em; }
.article-back { padding-top: 28px; border-top: 1px solid var(--line); }
.article-back a { color: var(--blue); font-size: 14px; font-weight: 750; }

.blog-footer { padding: 34px 0 50px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.blog-footer a:hover { color: var(--blue); }

@media (max-width: 700px) {
  .blog-header, .blog-main, .article-main, .blog-footer { width: min(100% - 28px, 1060px); }
  .blog-header nav { gap: 15px; }
  .blog-hero { padding: 72px 0 70px; }
  .post-grid { grid-template-columns: 1fr; }
  .post-card { min-height: 0; }
  .article-main { padding-top: 62px; }
  .article-content { font-size: 17px; }
  .article-content .mermaid-diagram { margin-right: -7px; margin-left: -7px; padding: 16px; }
  .article-content .mermaid-diagram .mermaid { min-width: 620px; }
  .blog-footer { align-items: flex-start; flex-direction: column; gap: 14px; line-height: 1.5; }
}
