:root {
  --bg: #fafafa;
  --fg: #1a1a1a;
  --muted: #666;
  --accent: #2563eb;
  --border: #e5e5e5;
  --code-bg: #f5f5f5;
  --max-width: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --fg: #e5e5e5;
    --muted: #999;
    --accent: #60a5fa;
    --border: #333;
    --code-bg: #2a2a2a;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, "Noto Sans SC", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.8;
  font-size: 16px;
}

header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.9rem;
}

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

main {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 0 1rem;
}

h1 { font-size: 1.8rem; margin-bottom: 0.5rem; line-height: 1.3; }
h2 { font-size: 1.4rem; margin: 2rem 0 0.5rem; }
h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }

p { margin-bottom: 1rem; }

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

.meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.meta time { margin-right: 1rem; }

.tags a, .tag {
  background: var(--code-bg);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  margin-right: 0.3rem;
}

.content { margin-top: 1rem; }
.content img { max-width: 100%; border-radius: 4px; }

pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

code {
  background: var(--code-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
}

pre code { background: none; padding: 0; }

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

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

th, td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

th { background: var(--code-bg); font-weight: 600; }

.post-list {
  list-style: none;
  margin-top: 0.5rem;
}

.post-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-list a { font-weight: 500; }
.post-list time { color: var(--muted); font-size: 0.85rem; }

.home section { margin-bottom: 2.5rem; }
.tagline { color: var(--muted); margin-bottom: 2rem; font-size: 1.05rem; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-item {
  background: var(--code-bg);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--fg);
  text-decoration: none;
}

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4rem;
}

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