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

:root {
  --bg: #1a1a1a;
  --surface: #2a2a2a;
  --border: #3a3a3a;
  --primary: #4a9eff;
  --primary-hover: #3a8eef;
  --text: #e0e0e0;
  --text-muted: #999;
  --text-dim: #ccc;
  --tag-bg: #2a3a4a;
  --tag-color: #4a9eff;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}
.header-inner {
  max-width: 780px;
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-title:hover { color: var(--primary); text-decoration: none; }
.site-nav { display: flex; gap: 1rem; }
.nav-link { color: var(--text-muted); font-size: 0.875rem; }
.nav-link:hover { color: var(--text); text-decoration: none; }

/* Main */
.main-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* Timeline */
.timeline-container {
  position: relative;
}
.timeline-container::before {
  content: '';
  position: absolute;
  left: 88px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.post-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0 2rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.post-card:last-child { border-bottom: none; }
.post-card::before {
  content: '';
  position: absolute;
  left: 84px;
  top: 2.15rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg);
  transition: background 0.2s;
}
.post-card:hover::before { background: var(--primary); }

.post-card-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
  padding-top: 0.2rem;
  line-height: 1.3;
}
.post-card-date .day {
  display: block;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-dim);
  line-height: 1;
  margin-bottom: 2px;
}
.post-card-date .month-year {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
}

.post-card-body { min-width: 0; }
.post-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
  display: block;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.15s;
}
.post-card-title:hover { color: var(--primary); text-decoration: none; }
.post-card-excerpt {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tag {
  font-size: 0.72rem;
  color: var(--tag-color);
  background: var(--tag-bg);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-weight: 500;
}

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

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 0;
  color: var(--text-muted);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.page-info { font-size: 0.85rem; color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: #555; }

/* Single Post */
.post-container { max-width: 700px; }
.back-link {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}
.back-link:hover { color: var(--text); text-decoration: none; }

.post-article { }
.post-header { margin-bottom: 2rem; }
.post-title {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.post-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.post-date { font-size: 0.875rem; color: var(--text-muted); }

.post-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-dim);
}
.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
  color: var(--text);
  margin: 1.8em 0 0.6em;
  font-weight: 600;
  line-height: 1.3;
}
.post-content h1 { font-size: 1.7rem; }
.post-content h2 { font-size: 1.35rem; }
.post-content h3 { font-size: 1.1rem; }
.post-content p { margin-bottom: 1.2em; }
.post-content a { color: var(--primary); }
.post-content a:hover { text-decoration: underline; }
.post-content code {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  font-size: 0.88em;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: #e06c75;
}
.post-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.2rem;
  overflow-x: auto;
  margin-bottom: 1.2em;
}
.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-dim);
  font-size: 0.875rem;
}
.post-content blockquote {
  border-left: 3px solid var(--primary);
  margin: 1.2em 0;
  padding: 0.5em 1em;
  color: var(--text-muted);
  font-style: italic;
}
.post-content ul, .post-content ol {
  margin-bottom: 1.2em;
  padding-left: 1.5em;
}
.post-content li { margin-bottom: 0.3em; }
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}
.post-content img {
  max-width: 100%;
  border-radius: 6px;
  margin: 0.5em 0;
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.2em;
  font-size: 0.9em;
}
.post-content th, .post-content td {
  border: 1px solid var(--border);
  padding: 0.5em 0.8em;
  text-align: left;
}
.post-content th { background: var(--surface); color: var(--text); font-weight: 500; }

.error-state {
  text-align: center;
  padding: 4rem 0;
  color: var(--text-muted);
}
.error-state p { margin-bottom: 1.5rem; }

/* Responsive */
@media (max-width: 600px) {
  .timeline-container::before { left: 68px; }
  .post-card { grid-template-columns: 68px 1fr; gap: 0 1.2rem; }
  .post-card::before { left: 64px; }
  .post-card-date .day { font-size: 1.1rem; }
  .post-title { font-size: 1.5rem; }
}
