:root {
  --bg: #fafafa;
  --bg-card: #ffffff;
  --border: #e4e4e7;
  --text: #18181b;
  --text-muted: #71717a;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --code-bg: #f4f4f5;
  --max: 720px;
  --wide: 960px;
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "Fira Code", "JetBrains Mono", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.container-wide {
  width: min(var(--wide), calc(100% - 40px));
  margin-inline: auto;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(250, 250, 250, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.site-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.site-title:hover {
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--text-muted);
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
  text-decoration: none;
}

/* Hero / intro */
.blog-intro {
  padding: 48px 0 32px;
}

.blog-intro h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  line-height: 1.3;
}

.blog-intro .subtitle {
  color: var(--text-muted);
  margin: 0;
  font-size: 1rem;
}

/* Article list */
.article-list {
  list-style: none;
  padding: 0;
  margin: 0 0 48px;
}

.article-item {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.article-item:first-child {
  border-top: 1px solid var(--border);
}

.article-item h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.article-item h2 a {
  color: var(--text);
}

.article-item h2 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.article-excerpt {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-right: 6px;
}

/* Article page */
.article-header {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.article-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  line-height: 1.35;
}

.article-body h2 {
  font-size: 1.25rem;
  margin: 36px 0 12px;
  letter-spacing: -0.02em;
}

.article-body h3 {
  font-size: 1.05rem;
  margin: 28px 0 8px;
}

.article-body p {
  margin: 0 0 16px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 16px;
  padding-left: 1.5em;
}

.article-body li {
  margin-bottom: 6px;
}

.article-body code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.article-body pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0 0 20px;
}

.article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.article-body blockquote {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text-muted);
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* About */
.about-section {
  padding: 40px 0;
}

.about-section h2 {
  font-size: 1.25rem;
  margin: 32px 0 12px;
}

.about-section p {
  margin: 0 0 16px;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 48px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.site-footer a {
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .site-nav {
    gap: 14px;
    font-size: 0.85rem;
  }

  .blog-intro h1,
  .article-header h1 {
    font-size: 1.45rem;
  }
}
