:root {
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f8fafc;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --code: #0f172a;
  --max: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.72;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0;
}

.brand span {
  color: var(--blue);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.site-header nav a {
  padding: 6px 0;
}

.site-header nav a:hover,
.site-header nav a.active {
  color: var(--blue);
}

main {
  max-width: var(--max);
  min-height: calc(100vh - 180px);
  margin: 0 auto;
  padding: 0 24px 72px;
}

.hero {
  padding: 80px 0 44px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.hero h1,
.page-title h1,
.article-header h1 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 780px;
  font-size: clamp(48px, 8vw, 92px);
}

.hero-copy {
  max-width: 680px;
  margin: 24px 0 0;
  color: #374151;
  font-size: 19px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0 48px;
}

.category-card {
  display: flex;
  min-height: 116px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.category-card:hover {
  border-color: #bfdbfe;
  background: var(--blue-soft);
}

.category-card span {
  color: var(--muted);
  font-size: 14px;
}

.category-card strong {
  font-size: 22px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-head h2,
.page-title h1 {
  margin: 0;
  font-size: 32px;
}

.section-head a {
  color: var(--blue);
  font-weight: 700;
}

.post-list {
  display: grid;
  gap: 16px;
}

.post-card {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.post-card h3 {
  margin: 8px 0;
  font-size: 24px;
  line-height: 1.35;
}

.post-card h3 a:hover {
  color: var(--blue);
}

.post-card p {
  max-width: 780px;
  margin: 0 0 14px;
  color: #4b5563;
}

.post-meta,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.post-meta span,
.post-meta a,
.tag-row span {
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 2px 9px;
}

.page-title {
  padding: 58px 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.page-title p:last-child {
  max-width: 680px;
  color: var(--muted);
}

.article {
  padding-top: 58px;
}

.article-header {
  max-width: 820px;
  margin-bottom: 34px;
}

.article-header h1 {
  margin-top: 14px;
  font-size: clamp(34px, 5vw, 56px);
}

.article-header p {
  color: #4b5563;
  font-size: 18px;
}

.article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  gap: 44px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.toc strong {
  color: var(--text);
}

.toc a:hover {
  color: var(--blue);
}

.toc-l3 {
  padding-left: 12px;
}

.article-body {
  min-width: 0;
  font-size: 17px;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 2em 0 0.75em;
  line-height: 1.32;
}

.article-body h2 {
  font-size: 30px;
}

.article-body h3 {
  font-size: 23px;
}

.article-body p,
.article-body ul,
.article-body blockquote,
.article-body table,
.article-body pre {
  margin: 0 0 1.2em;
}

.article-body a {
  color: var(--blue);
  border-bottom: 1px solid #bfdbfe;
}

.article-body code {
  border-radius: 5px;
  background: #eef2ff;
  color: #1e3a8a;
  padding: 0.15em 0.35em;
  font-size: 0.88em;
}

.article-body pre {
  overflow-x: auto;
  border-radius: 8px;
  background: var(--code);
  color: #e5e7eb;
  padding: 18px;
}

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

.article-body blockquote {
  border-left: 3px solid var(--blue);
  margin-left: 0;
  padding: 8px 0 8px 18px;
  color: #4b5563;
  background: var(--soft);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
}

.article-body th,
.article-body td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}

.article-body th {
  background: var(--soft);
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
}

.post-nav a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
}

.post-nav a:hover {
  border-color: #bfdbfe;
  background: var(--blue-soft);
}

.post-nav strong {
  color: var(--text);
}

.archive-list {
  display: grid;
}

.archive-list a {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.archive-list time,
.archive-list strong {
  color: var(--muted);
  font-size: 14px;
}

.search-box input {
  width: 100%;
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  font: inherit;
  outline: none;
}

.search-box input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
}

.empty-state {
  color: var(--muted);
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 24px 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 4px 0;
}

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

@media (max-width: 820px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero {
    padding-top: 48px;
  }

  .category-grid,
  .article-layout,
  .post-nav {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
  }

  .archive-list a {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
