
:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --link: #1a73e8;
  --border: #e0e0e0;
  --code-bg: #f5f5f5;
  --blockquote-border: #ddd;
  --blockquote-bg: #f9f9f9;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --text: #e0e0e0;
    --text-secondary: #999999;
    --link: #8ab4f8;
    --border: #333333;
    --code-bg: #2d2d2d;
    --blockquote-border: #444;
    --blockquote-bg: #222;
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 18px;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

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

header a {
  text-decoration: none;
  color: var(--text);
}

header h1 {
  font-size: 1.4rem;
  font-weight: 600;
}

header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

nav {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-right: 1rem;
}

nav a:hover {
  color: var(--text);
}

article h1 {
  font-size: 2rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

article .date {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

article .content h2 { font-size: 1.4rem; margin: 2rem 0 1rem; font-weight: 600; }
article .content h3 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; font-weight: 600; }
article .content p { margin-bottom: 1.25rem; }
article .content a { color: var(--link); text-decoration: underline; }
article .content a:hover { opacity: 0.8; }

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

article .content blockquote {
  border-left: 3px solid var(--blockquote-border);
  background: var(--blockquote-bg);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-secondary);
}

article .content blockquote p { margin-bottom: 0; }

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

article .content pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

article .content pre code {
  background: none;
  padding: 0;
}

article .content ul, article .content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

article .content li { margin-bottom: 0.5rem; }

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

/* Index page */
.year-group { margin-bottom: 2.5rem; }
.year-group h2 {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-weight: 400;
}

.post-list { list-style: none; padding: 0; }
.post-list li { margin-bottom: 1rem; }
.post-list a {
  color: var(--text);
  text-decoration: none;
  font-size: 1.1rem;
}
.post-list a:hover { color: var(--link); }
.post-list .post-date {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.post-list .post-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.15rem;
  display: block;
}

footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

footer a { color: var(--text-secondary); }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { padding: 1.5rem 1rem; }
  article h1 { font-size: 1.6rem; }
}
