:root {
  --bg: #fdfcfb;
  --fg: #1f2328;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --code-bg: #1e2027;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181d;
    --fg: #e6e6e6;
    --muted: #9ca3af;
    --border: #2a2d35;
    --accent: #60a5fa;
  }
}

* { box-sizing: border-box; }

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

.site-header {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.2rem 1.5rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--fg);
}

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

.site-header nav a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

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

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

h1 { font-size: 2rem; line-height: 1.3; letter-spacing: -0.02em; margin: 1.8rem 0 0.6rem; }
h2 { font-size: 1.35rem; letter-spacing: -0.01em; margin: 2.4rem 0 0.8rem; }
h3 { font-size: 1.1rem; margin: 1.8rem 0 0.6rem; }

p { margin: 0 0 1.15rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

img { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 1.5rem 0; }

blockquote {
  margin: 1.5rem 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

code {
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
}

pre {
  background: var(--code-bg);
  color: #e6e6e6;
  padding: 1.1rem 1.2rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

pre code { background: none; padding: 0; font-size: inherit; }

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { border-bottom: 1px solid var(--border); padding: 1.5rem 0; }
.post-list li:last-child { border-bottom: 0; }
.post-list a { text-decoration: none; color: var(--fg); }
.post-list a:hover h2 { color: var(--accent); }
.post-list h2 { margin: 0 0 0.35rem; font-size: 1.2rem; transition: color 0.15s; }

.post-meta {
  font-size: 0.83rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  align-items: center;
}

.post-desc { margin: 0; font-size: 0.92rem; color: var(--muted); line-height: 1.65; }

.tag {
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.05rem 0.55rem;
}

.empty { color: var(--muted); font-size: 0.95rem; padding: 3rem 0; text-align: center; }

.back-link {
  display: inline-block;
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 0.5rem;
}

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

article :global(ul), article :global(ol) { padding-left: 1.4rem; margin: 0 0 1.15rem; }
article :global(li) { margin-bottom: 0.4rem; }

article :global(table) { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.9rem; }
article :global(th), article :global(td) { border: 1px solid var(--border); padding: 0.5rem 0.7rem; text-align: left; }
article :global(th) { background: color-mix(in srgb, var(--fg) 5%, transparent); }

.site-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}

.site-footer p { margin: 0; }

@media (max-width: 600px) {
  html { font-size: 16px; }
  h1 { font-size: 1.6rem; }
  .site-header { padding: 1.6rem 1.1rem 1rem; }
  main { padding: 0 1.1rem 3.5rem; }
}
