:root {
  color-scheme: light;
  --background: #ffffff;
  --text: #1f2328;
  --muted: #66707b;
  --border: #d8dee4;
  --soft: #f6f8fa;
  --link: #1f5f99;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -80px;
  left: 16px;
  z-index: 10;
  padding: 8px 12px;
  color: #ffffff;
  background: #111827;
}

.skip-link:focus {
  top: 12px;
}

.site-header,
.site-footer,
.page {
  width: min(820px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-block: 26px 18px;
  border-bottom: 1px solid var(--border);
}

.site-brand {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
}

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

.page {
  min-height: calc(100vh - 190px);
  padding-block: 64px 80px;
}

.home-intro {
  max-width: 640px;
  margin-bottom: 72px;
}

.home-intro h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 7vw, 52px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.home-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 19px;
}

.section-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.post-item {
  padding-block: 28px;
  border-bottom: 1px solid var(--border);
}

.post-item time,
.post-meta {
  color: var(--muted);
  font-size: 14px;
}

.post-item h2 {
  margin: 6px 0 8px;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

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

.post-item p {
  margin: 0;
  color: var(--muted);
}

.post-body {
  overflow-wrap: anywhere;
}

.post-body h1,
.post-body h2,
.post-body h3 {
  color: #111827;
  line-height: 1.35;
}

.post-body h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 6vw, 44px);
  letter-spacing: -0.035em;
}

.post-body h2 {
  margin: 2.2em 0 0.75em;
  padding-bottom: 0.35em;
  font-size: 28px;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border);
}

.post-body h3 {
  margin: 1.65em 0 0.55em;
  font-size: 21px;
}

.post-body p,
.post-body ul,
.post-body ol,
.post-body blockquote,
.post-body pre,
.post-body table {
  margin-top: 0;
  margin-bottom: 1.15em;
}

.post-body ul,
.post-body ol {
  padding-left: 1.6em;
}

.post-body li + li {
  margin-top: 0.3em;
}

.post-body blockquote {
  margin-left: 0;
  padding-left: 1em;
  color: var(--muted);
  border-left: 3px solid var(--border);
}

.post-body code {
  padding: 0.14em 0.34em;
  border-radius: 3px;
  background: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
  font-size: 0.86em;
}

.post-body pre {
  padding: 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--soft);
  line-height: 1.55;
  white-space: pre-wrap;
}

.post-body pre code {
  padding: 0;
  background: transparent;
  font-size: 14px;
}

.post-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 15px;
}

.post-body th,
.post-body td {
  padding: 8px 10px;
  vertical-align: top;
  text-align: left;
  border: 1px solid var(--border);
}

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

.post-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5em auto 0.6em;
}

.post-body p:has(> em:only-child) {
  margin-top: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-block: 22px 34px;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .site-header,
  .site-footer,
  .page {
    width: min(100% - 28px, 820px);
  }

  .page {
    padding-block: 42px 64px;
  }

  .home-intro {
    margin-bottom: 52px;
  }

  .post-body h2 {
    font-size: 24px;
  }

  .site-footer {
    display: block;
  }
}

@media print {
  .site-header,
  .site-footer,
  .skip-link {
    display: none;
  }

  .page {
    width: auto;
    padding: 0;
  }

  a {
    color: inherit;
  }

  .post-body pre,
  .post-body img,
  .post-body blockquote {
    break-inside: avoid-page;
  }
}
