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

:root {
  --bg: #ffffff;
  --bg2: #f8f8f6;
  --text: #1a1a1a;
  --text2: #666;
  --accent: #3b5bdb;
  --accent-light: #eef2ff;
  --border: #e8e8e4;
  --radius: 10px;
  --max-w: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --bg2: #1e1e1e;
    --text: #e8e8e4;
    --text2: #999;
    --accent: #748ffc;
    --accent-light: #1e2340;
    --border: #2e2e2e;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

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

a:hover {
  text-decoration: underline;
}

/* Header */
header {
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

header nav {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.blog-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.blog-title:hover {
  text-decoration: none;
  color: var(--accent);
}

/* Main */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px;
}

/* Post list */
.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.post-item {
  background: var(--bg);
  transition: background 0.15s;
}

.post-item:hover {
  background: var(--bg2);
}

.post-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  color: var(--text);
  gap: 16px;
}

.post-link:hover {
  text-decoration: none;
}

.post-title {
  font-size: 16px;
  font-weight: 500;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.post-date {
  font-size: 13px;
  color: var(--text2);
}

.post-category {
  font-size: 12px;
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 20px;
}

/* Post content */
.post-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.post-header h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
}

.post-content {
  line-height: 1.9;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  margin: 2em 0 0.6em;
  font-weight: 600;
  line-height: 1.3;
}

.post-content h1 { font-size: 24px; }
.post-content h2 { font-size: 20px; }
.post-content h3 { font-size: 17px; }

.post-content p {
  margin-bottom: 1.2em;
}

.post-content ul,
.post-content ol {
  margin: 0 0 1.2em 1.4em;
}

.post-content li {
  margin-bottom: 0.4em;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.2em 0;
  padding: 0.6em 0 0.6em 1.2em;
  color: var(--text2);
  font-style: italic;
}

.post-content code {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 14px;
  background: var(--bg2);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.post-content pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  margin: 1.2em 0;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
}

.post-content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1em 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 15px;
}

.post-content th,
.post-content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

.post-content th {
  background: var(--bg2);
  font-weight: 600;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text2);
  font-size: 14px;
  margin-bottom: 32px;
}

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

/* Loading / Error */
.loading {
  color: var(--text2);
  text-align: center;
  padding: 60px 0;
}

.error-msg {
  color: #c0392b;
  background: #fdf0ee;
  padding: 16px;
  border-radius: var(--radius);
  font-size: 14px;
}

/* Footer */
footer {
  margin-top: 80px;
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text2);
}
