:root {
  --bg: #ffffff;
  --bg-secondary: #f8f9fa;
  --text: #2c3e50;
  --text-secondary: #6c757d;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e9ecef;
  --code-bg: #f1f3f5;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a2e;
    --bg-secondary: #16213e;
    --text: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent: #60a5fa;
    --accent-hover: #93bbfd;
    --border: #2a2a4a;
    --code-bg: #0f0f23;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

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

/* Header */
.site-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.site-header .avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.site-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

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

.site-header .tagline {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Entry list */
.entry-list {
  list-style: none;
}

.entry-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.entry-item:last-child {
  border-bottom: none;
}

.entry-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.entry-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0.15rem 0 0.3rem;
}

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

.entry-title a:hover {
  color: var(--accent);
}

.entry-description {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* Article */
.article-header {
  margin-bottom: 2rem;
}

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

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

.article-content h2 {
  font-size: 1.4rem;
  margin: 2rem 0 0.75rem;
}

.article-content h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
}

.article-content p {
  margin-bottom: 1rem;
}

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

.article-content a:hover {
  color: var(--accent-hover);
}

.article-content ul,
.article-content ol {
  margin: 0 0 1rem 1.5rem;
}

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

.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: 0 4px 4px 0;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1rem 0;
}

.article-content code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

.article-content pre {
  margin: 1rem 0;
  border-radius: 6px;
  overflow-x: auto;
}

.article-content pre code {
  display: block;
  padding: 1rem;
  background: var(--code-bg);
  line-height: 1.5;
}

/* Back link */
.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

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

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

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

/* Loading / Error */
.loading, .error {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem 0;
}

.error {
  color: #e74c3c;
}
