:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f7f8fa;
  --text: #1f2328;
  --muted: #59636e;
  --border: #e5e8ec;
  --border-strong: #c8cfd8;
  --accent: #24292f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --surface: #181c22;
    --text: #e6edf3;
    --muted: #9198a1;
    --border: #262c36;
    --border-strong: #3d444d;
    --accent: #f0f6fc;
  }
}

* {
  box-sizing: border-box;
}

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

.wrap {
  max-width: 740px;
  margin: 0 auto;
  padding: 40px 24px 32px;
}

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

.brand-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-title a {
  color: inherit;
  text-decoration: none;
}

.brand-sub {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--muted);
}

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

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

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

.site-nav a.active {
  font-weight: 600;
}

main {
  padding: 24px 0 12px;
}

.intro {
  margin: 0 0 28px;
  padding: 14px 18px;
  background: var(--surface);
  border-left: 3px solid var(--border-strong);
  border-radius: 0 6px 6px 0;
  font-size: 14.5px;
  color: var(--muted);
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

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

.post-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.post-meta {
  display: flex;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.post-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.45;
}

.post-title a {
  color: var(--text);
  text-decoration: none;
}

.post-title a:hover {
  text-decoration: underline;
}

.post-excerpt {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

.article h2 {
  margin: 6px 0 18px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.4;
}

.article h3 {
  margin: 24px 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.article p {
  margin: 0 0 14px;
  font-size: 15px;
}

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

.article li {
  margin-bottom: 8px;
  font-size: 15px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
}

pre.tpl {
  margin: 0 0 24px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre-wrap;
}

.section-desc {
  margin: 0 0 14px;
  font-size: 14.5px;
  color: var(--muted);
}

.site-footer {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}
