:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --text: #1d1f23;
  --muted: #5f6672;
  --line: #e3e6ea;
  --accent: #1f6feb;
  --accent-soft: #e8f0fe;
  --maxw: 760px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1e2125;
    --text: #e6e8eb;
    --muted: #9aa1ab;
    --line: #2d3137;
    --accent: #6ea8fe;
    --accent-soft: #1d2a3d;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.8 "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-top: 14px; padding-bottom: 14px; }
.logo { font-weight: 800; font-size: 1.15rem; color: var(--text); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .95rem; }
.nav a { color: var(--muted); }

.main { padding-top: 28px; padding-bottom: 56px; min-height: 60vh; }
.hero { padding: 12px 0 20px; }
.hero h1 { margin: 0 0 6px; font-size: 1.7rem; line-height: 1.35; }
.hero p { margin: 0; color: var(--muted); }
.page-title { font-size: 1.5rem; margin: 0 0 16px; }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-card { border-bottom: 1px solid var(--line); }
.post-card a { display: block; padding: 18px 0; color: inherit; }
.post-card a:hover { text-decoration: none; }
.post-card a:hover h2 { color: var(--accent); }
.post-card h2 { margin: 6px 0 4px; font-size: 1.2rem; line-height: 1.45; }
.post-card p { margin: 0 0 6px; color: var(--muted); font-size: .95rem; }
.post-card time, .post-meta, .sitemap-group time { color: var(--muted); font-size: .85rem; }
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .8rem; font-weight: 600; }
.empty { color: var(--muted); }

.pager, .post-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; font-size: .95rem; }
.post-nav { border-top: 1px solid var(--line); padding-top: 18px; }
.post-nav a { max-width: 48%; }

.post-header h1 { font-size: 1.75rem; line-height: 1.4; margin: 10px 0 6px; }
.post-body h2 { font-size: 1.35rem; margin: 2.2em 0 .6em; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.post-body h3 { font-size: 1.15rem; margin: 1.8em 0 .5em; }
.post-body img { max-width: 100%; height: auto; border-radius: 8px; }
.post-body blockquote { margin: 1.2em 0; padding: 10px 16px; background: var(--surface); border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0; }
.post-body blockquote p { margin: .3em 0; }
.post-body table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; font-size: .95rem; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.post-body th { background: var(--surface); }
.post-body code { background: var(--surface); padding: 1px 5px; border-radius: 4px; font-size: .9em; }

.toc { background: var(--surface); border-radius: 10px; padding: 12px 18px; margin: 18px 0; font-size: .95rem; }
.toc summary { font-weight: 700; cursor: pointer; }
.toc ul { margin: 6px 0; padding-left: 18px; }

.sources, .related { margin-top: 32px; }
.sources h2, .related h2, .sitemap-group h2 { font-size: 1.1rem; }
.tags span { display: inline-block; margin: 0 8px 6px 0; color: var(--muted); font-size: .9rem; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 24px 0; font-size: .9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.footer-links a { color: var(--text); }
.footer-meta { margin: 2px 0; color: var(--muted); }
