:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #21262d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --accent-dim: #1f6feb22;
  --code-bg: #161b22;
  --tag-bg: #21262d;
  --max-w: 680px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.site-name:hover { text-decoration: none; }
nav { display: flex; gap: 1.5rem; }
nav a { font-size: 0.9rem; color: var(--muted); }
nav a:hover { color: var(--text); text-decoration: none; }

main {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.footer-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

.post-list { display: flex; flex-direction: column; gap: 2.5rem; }
.section-title { font-size: 1.1rem; font-weight: 600; color: var(--muted); margin-bottom: 0.5rem; }

.post-card { border-bottom: 1px solid var(--border); padding-bottom: 2.5rem; }
.post-card:last-child { border-bottom: none; }
.post-meta { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.4rem; }
.post-card h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.3; }
.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { color: var(--accent); text-decoration: none; }
.summary { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.75rem; }
.read-more { font-size: 0.875rem; font-weight: 500; }
.empty { color: var(--muted); font-style: italic; }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
.tag {
  background: var(--tag-bg);
  color: var(--muted);
  font-size: 0.75rem;
  padding: 0.15em 0.6em;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.post { max-width: 100%; }
.back { font-size: 0.85rem; color: var(--muted); display: inline-block; margin-bottom: 2rem; }
.back:hover { color: var(--accent); text-decoration: none; }
.post-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.post-header h1 { font-size: 1.9rem; line-height: 1.25; margin-bottom: 0.75rem; letter-spacing: -0.02em; }
.post-header .post-meta { font-size: 0.875rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
}
.toc summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; list-style: none; padding-left: 0; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::marker { display: none; }
.toc summary::before { content: "▸ "; }
details[open] .toc summary::before { content: "▾ "; }
.toc ul { list-style: none; padding: 0; margin-top: 0.75rem; }
.toc ul ul { padding-left: 1rem; }
.toc li { margin: 0.2rem 0; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--accent); }

.post-content { line-height: 1.8; }
.post-content h2 { font-size: 1.35rem; margin: 2.5rem 0 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.post-content h3 { font-size: 1.1rem; margin: 2rem 0 0.5rem; }
.post-content h4 { font-size: 1rem; margin: 1.5rem 0 0.4rem; color: var(--muted); }
.post-content p { margin-bottom: 1.25rem; }
.post-content ul, .post-content ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.post-content li { margin: 0.3rem 0; }
.post-content hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.post-content blockquote { border-left: 3px solid var(--accent); padding: 0.25rem 1rem; color: var(--muted); margin: 1.5rem 0; background: var(--accent-dim); border-radius: 0 4px 4px 0; }
.post-content img { max-width: 100%; border-radius: 6px; margin: 1.5rem 0; }

table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.9rem; }
th { background: var(--surface); text-align: left; padding: 0.6rem 0.8rem; border: 1px solid var(--border); font-weight: 600; }
td { padding: 0.5rem 0.8rem; border: 1px solid var(--border); }
tr:nth-child(even) td { background: var(--surface); }

code { background: var(--code-bg); border: 1px solid var(--border); border-radius: 4px; padding: 0.15em 0.4em; font-size: 0.875em; font-family: "SF Mono", "Fira Code", Consolas, monospace; }
pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: 1.25rem; overflow-x: auto; margin: 1.5rem 0; }
pre code { background: none; border: none; padding: 0; font-size: 0.85rem; }

.search-page { display: flex; flex-direction: column; gap: 2rem; }
#search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
  padding: 0.65rem 1rem;
  outline: none;
  transition: border-color 0.15s;
}
#search-input:focus { border-color: var(--accent); }

@media (max-width: 600px) {
  .post-header h1 { font-size: 1.5rem; }
  main { padding: 2rem 1rem; }
}
