:root {
  --text-primary: #000000;
  --text-secondary: #666666;
  --bg-primary: #ffffff;
  --link-color: #0066cc;
  --link-hover: #0052a3;
  --code-bg: #f6f8fa;
  --border-color: #e1e4e8;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #ffffff;
    --text-secondary: #999999;
    --bg-primary: #000000;
    --link-color: #4db2ff;
    --link-hover: #66c2ff;
    --code-bg: #161b22;
    --border-color: #30363d;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
}

h1 { font-size: 2rem; margin: 2rem 0 1rem 0; font-weight: 600; }
h2 { font-size: 1.5rem; margin: 1.5rem 0 0.75rem 0; font-weight: 600; }
h3 { font-size: 1.25rem; margin: 1.25rem 0 0.5rem 0; font-weight: 600; }

code {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 6px;
  line-height: 1.4;
}

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

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

nav {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

article {
  margin-bottom: 4rem;
}

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

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

nav a:first-child { margin-left: 0; }
nav a:hover { color: var(--link-color); }
nav .current { font-weight: 600; }

.nav-left { display: flex; align-items: center; }
.nav-right { display: flex; align-items: center; }

@media (max-width: 600px) {
  nav { flex-direction: column; gap: 1rem; }
  .nav-left, .nav-right { gap: 1rem; }
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.25rem 0;
}

.post-title { flex: 1; }
.post-date { 
  color: var(--text-secondary);
  font-size: 0.9rem;
  white-space: nowrap;
  margin-left: 1rem;
}

/* KEEP favorite posts - just make them bold */
.favorite-post .post-title { font-weight: 600; }


blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--link-color);
  background: var(--code-bg);
  font-style: italic;
  color: var(--text-secondary);
}

blockquote p {
  margin: 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
}

.table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
}

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

th {
  font-weight: 600;
  background: var(--code-bg);
  border-bottom: 2px solid var(--border-color);
}

tbody tr:nth-child(even) {
  background: var(--code-bg);
}

tbody tr:hover {
  background: var(--border-color);
}

/* Responsive images */
article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
}

@media (max-width: 600px) {
  .post-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .post-date { margin-left: 0; margin-top: 0.25rem; }
}