:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #5a5a6e;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --border: #e9ecef;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 4px 6px rgba(0, 0, 0, 0.04), 0 10px 24px rgba(0, 0, 0, 0.06);
  --radius: 12px;
  --max-width: 760px;
  --header-height: 64px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.site-brand:hover {
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Main */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

/* Hero */
.hero {
  padding: 3rem 0 3.5rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Section title */
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  color: var(--text);
}

/* Post cards */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: #d0d4dc;
}

.post-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text);
  line-height: 1.35;
}

.post-card:hover .post-card-title {
  color: var(--accent);
}

.post-card-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.post-card-description {
  color: var(--text-secondary);
  margin: 0 0 1rem;
  line-height: 1.6;
}

/* Tag pills */
.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: #f1f3f9;
  color: var(--text-secondary);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.tag-pill:hover {
  background: var(--accent);
  color: #fff;
}

/* Article page */
article header {
  text-align: center;
  padding: 2rem 0 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

article header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin: 0 0 1rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

article .meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

article .meta time {
  color: var(--text-secondary);
}

/* Post content typography */
.post-content {
  font-size: 1.0625rem;
  line-height: 1.8;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  color: var(--text);
}

.post-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.post-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.post-content p {
  margin: 0 0 1.25rem;
}

.post-content ul,
.post-content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: #f1f3f9;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
  font-style: italic;
}

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

.post-content code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
  background: #f1f3f9;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  color: #c7254e;
}

.post-content pre {
  background: #1e1e2e;
  color: #e4e4e7;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
}

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

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

/* Post navigation */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.post-nav a {
  display: block;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-nav a:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.post-nav-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.post-nav-title {
  font-weight: 600;
  color: var(--text);
}

.post-nav a:hover .post-nav-title {
  color: var(--accent);
}

.post-nav-next {
  text-align: right;
}

/* Footer */
.site-footer {
  margin-top: 4rem;
  padding: 2rem 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

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

.site-footer a:hover {
  color: var(--accent);
}

/* Utilities */
.text-center {
  text-align: center;
}

.mb-8 {
  margin-bottom: 2rem;
}

.view-all {
  display: inline-flex;
  align-items: center;
  margin-top: 1.5rem;
  font-weight: 600;
}

.view-all::after {
  content: "→";
  margin-left: 0.375rem;
  transition: transform 0.2s ease;
}

.view-all:hover::after {
  transform: translateX(3px);
}

/* Responsive */
@media (max-width: 640px) {
  :root {
    --header-height: 56px;
  }

  .site-header-inner {
    padding: 0 1rem;
  }

  .site-brand {
    font-size: 1rem;
  }

  .site-nav {
    gap: 1rem;
  }

  .site-nav a {
    font-size: 0.875rem;
  }

  main {
    padding: 1.5rem 1rem 3rem;
  }

  .hero {
    padding: 2rem 0 2.5rem;
  }

  .hero h1 {
    font-size: 1.875rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .post-card {
    padding: 1.25rem;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav-next {
    text-align: left;
  }
}
