/* ═══════════════════════════════════════════════════════════
   의찬의 개발 블로그 — 커스텀 스타일시트
   ═══════════════════════════════════════════════════════════ */

/* ── 1. Design Tokens ────────────────────────────────────── */
:root {
  --bg:           #f8fafc;
  --surface:      #ffffff;
  --surface-2:    #f1f5f9;
  --border:       #e2e8f0;
  --border-light: #f1f5f9;
  --text:         #0f172a;
  --text-2:       #475569;
  --text-muted:   #94a3b8;
  --accent:       #3b82f6;
  --accent-d:     #2563eb;
  --accent-bg:    rgba(59, 130, 246, 0.08);
  --success:      #10b981;
  --warn:         #f59e0b;
  --danger:       #ef4444;
  --sidebar-w:    268px;
  --toc-w:        210px;
  --content-max:  740px;
  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    14px;
  --shadow-sm:    0 1px 2px rgba(0,0,0,.05);
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:    0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:    0 10px 28px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.06);
  --font: 'Pretendard Variable','Pretendard',-apple-system,BlinkMacSystemFont,'Apple SD Gothic Neo','Noto Sans KR',system-ui,sans-serif;
  --font-mono: 'JetBrains Mono','Fira Code','D2Coding',Consolas,monospace;
  --transition: 0.15s ease;
}

[data-theme="dark"] {
  --bg:           #0f172a;
  --surface:      #1e293b;
  --surface-2:    #162032;
  --border:       #334155;
  --border-light: #1e293b;
  --text:         #f1f5f9;
  --text-2:       #cbd5e1;
  --text-muted:   #64748b;
  --accent:       #60a5fa;
  --accent-d:     #93c5fd;
  --accent-bg:    rgba(96, 165, 250, 0.10);
  --shadow-sm:    0 1px 2px rgba(0,0,0,.3);
  --shadow:       0 1px 3px rgba(0,0,0,.35);
  --shadow-md:    0 4px 12px rgba(0,0,0,.4);
  --shadow-lg:    0 10px 28px rgba(0,0,0,.5);
}

/* ── 2. Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; font-size: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ── 3. Page Layout ──────────────────────────────────────── */
.page-wrap {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  z-index: 100;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.page-main {
  flex: 1;
  min-width: 0;
  padding: 32px 28px;
}

/* ── 4. Sidebar Profile ──────────────────────────────────── */
.sb-profile {
  padding: 24px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.sb-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  margin-bottom: 12px;
}
.sb-avatar-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.sb-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.sb-role {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}
.sb-bio {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 10px;
  line-height: 1.6;
}

.sb-links {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.sb-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.sb-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-bg);
}
.sb-link svg { width: 16px; height: 16px; }

/* ── 5. Sidebar Navigation ───────────────────────────────── */
.sb-nav {
  flex: 1;
  padding: 12px 0 8px;
  overflow-y: auto;
}

.sb-nav-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 0 18px;
  margin: 8px 0 4px;
}

.sb-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 18px;
}

.sb-static-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  font-size: 13.5px;
  color: var(--text-2);
  transition: all var(--transition);
  border-radius: 0;
}
.sb-static-link:hover { background: var(--accent-bg); color: var(--accent); }
.sb-static-link.active { color: var(--accent); background: var(--accent-bg); font-weight: 600; }

/* ── 6. Category Tree ────────────────────────────────────── */
.cat-tree { list-style: none; padding: 0; margin: 0; }
.cat-tree ul { list-style: none; padding: 0; margin: 0; }

/* Group node */
.cat-group { }
.cat-group-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 5px 18px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  text-align: left;
  transition: color var(--transition);
  cursor: pointer;
  background: none;
  border: none;
}
.cat-group-btn:hover { color: var(--text); }

.cat-group-arrow {
  font-size: 7px;
  transition: transform .15s;
  flex-shrink: 0;
  color: var(--text-muted);
  display: inline-block;
}
.cat-group.open > .cat-group-btn > .cat-group-arrow { transform: rotate(90deg); }
.cat-group:not(.open) > .cat-children { display: none; }

/* Leaf node (actual category) */
.cat-children { padding: 2px 0; }
.cat-leaf { list-style: none; }
.cat-leaf a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 28px;
  font-size: 13.5px;
  color: var(--text-2);
  transition: all var(--transition);
  border-radius: 6px;
  margin: 1px 5px;
}
.cat-leaf a:hover { background: var(--accent-bg); color: var(--accent); }
.cat-leaf a.active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.cat-leaf.cat-empty a { opacity: .5; }

.cat-icon { font-size: .95em; flex-shrink: 0; }
.cat-name { flex: 1; }
.cat-count {
  font-size: 10.5px;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

/* Nested groups */
.cat-subgroup { }
.cat-subgroup-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 6px;
  margin: 1px 5px;
  transition: all var(--transition);
}
.cat-subgroup-btn:hover { background: var(--surface-2); }
.cat-subgroup-arrow {
  font-size: 7px;
  transition: transform .15s;
  color: var(--text-muted);
  display: inline-block;
}
.cat-subgroup.open > .cat-subgroup-btn > .cat-subgroup-arrow { transform: rotate(90deg); }
.cat-subgroup:not(.open) > .cat-children { display: none; }

/* ── 7. Sidebar Footer ───────────────────────────────────── */
.sb-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  transition: all var(--transition);
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-muted); }
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark  { display: inline; }

.sb-admin-link {
  font-size: 12px;
  color: var(--text-muted);
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.sb-admin-link:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }

/* ── 8. Mobile Header ────────────────────────────────────── */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 18px;
  align-items: center;
  justify-content: space-between;
}
.mobile-logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 24px;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all .2s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}

/* ── 9. Home Page ────────────────────────────────────────── */
.hero {
  max-width: var(--content-max);
  margin: 0 auto 48px;
  padding: 40px 0 44px;
  border-bottom: 1px solid var(--border);
}
.hero-greeting {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}
.hero-name {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin-bottom: 14px;
}
.hero-bio {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.75;
  max-width: 560px;
}
.hero-links {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  color: var(--text-2);
  transition: all var(--transition);
}
.hero-link:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.hero-link svg { width: 15px; height: 15px; }

.section-header {
  max-width: var(--content-max);
  margin: 0 auto 20px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.section-more {
  font-size: 13px;
  color: var(--accent);
  margin-left: auto;
}
.section-more:hover { text-decoration: underline; }

/* ── 10. Post Cards ──────────────────────────────────────── */
.post-list {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  transition: transform .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(59, 130, 246, .25);
}

.post-card-thumb {
  width: 200px;
  flex-shrink: 0;
  overflow: hidden;
}
.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: linear-gradient(135deg, var(--surface-2), var(--border-light));
}

.post-card-body {
  flex: 1;
  padding: 18px 20px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.post-card-cat {
  background: var(--accent-bg);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11.5px;
}

.post-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
  letter-spacing: -.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card:hover .post-card-title { color: var(--accent); }

.post-card-desc {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.post-card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.post-tag {
  font-size: 11.5px;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ── 11. List Page Header ────────────────────────────────── */
.list-header {
  max-width: var(--content-max);
  margin: 0 auto 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.list-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.list-desc {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-muted);
}
.list-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── 12. Pagination ──────────────────────────────────────── */
.pagination {
  max-width: var(--content-max);
  margin: 36px auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}
.pagination a, .pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--transition);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.pagination .active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ── 13. Single Post ─────────────────────────────────────── */
.post-wrap {
  display: grid;
  grid-template-columns: minmax(0, var(--content-max)) var(--toc-w);
  gap: 40px;
  max-width: calc(var(--content-max) + var(--toc-w) + 40px);
  margin: 0 auto;
  align-items: start;
}

.post-header {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.post-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.post-breadcrumb a { color: var(--text-muted); }
.post-breadcrumb a:hover { color: var(--accent); }
.post-breadcrumb-sep { opacity: .4; }

.post-title {
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -.025em;
  margin-bottom: 14px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.post-meta-dot { opacity: .4; }

.post-tags-header {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.post-tag-link {
  font-size: 12.5px;
  background: var(--surface-2);
  color: var(--text-2);
  padding: 3px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.post-tag-link:hover { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }

.post-thumb {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 28px;
}

/* ── 14. Post Content (Markdown) ─────────────────────────── */
.post-content {
  font-size: 1.05rem;
  line-height: 1.88;
  color: var(--text);
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.02em;
  color: var(--text);
  word-break: keep-all;
}
.post-content h2 {
  font-size: 1.55rem;
  margin: 2.5em 0 .75em;
  padding-bottom: .45em;
  border-bottom: 2px solid var(--accent);
}
.post-content h3 {
  font-size: 1.22rem;
  margin: 2em 0 .55em;
}
.post-content h4 {
  font-size: 1.05rem;
  margin: 1.6em 0 .4em;
  color: var(--accent);
}

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

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(59,130,246,.35);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition);
}
.post-content a:hover { text-decoration-color: var(--accent); }

.post-content strong { font-weight: 700; }
.post-content em { font-style: italic; }

/* Code blocks */
.post-content pre {
  background: #0f172a;
  border-radius: var(--radius);
  padding: 1.2em 1.4em;
  overflow-x: auto;
  margin: 1.4em 0;
  position: relative;
  border: 1px solid rgba(255,255,255,.06);
}
[data-theme="dark"] .post-content pre { border-color: rgba(255,255,255,.10); }

.post-content pre code {
  font-family: var(--font-mono);
  font-size: .855rem;
  line-height: 1.7;
  color: #e2e8f0;
  background: none;
  padding: 0;
  border: none;
}

/* Inline code */
.post-content :not(pre) > code {
  background: var(--accent-bg);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .855em;
  padding: .15em .45em;
  border-radius: 4px;
  border: 1px solid rgba(59,130,246,.18);
}
[data-theme="dark"] .post-content :not(pre) > code {
  border-color: rgba(96,165,250,.2);
}

/* Blockquotes */
.post-content blockquote {
  border-left: 4px solid var(--accent);
  background: var(--accent-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: .85em 1.2em;
  margin: 1.4em 0;
  color: var(--text-2);
}
.post-content blockquote p { margin: 0; }

/* Lists */
.post-content ul, .post-content ol {
  padding-left: 1.6em;
  margin-bottom: 1.2em;
}
.post-content li { margin-bottom: .35em; line-height: 1.75; }
.post-content li > ul, .post-content li > ol { margin: .3em 0; }

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  margin: 1.5em 0;
  display: block;
  overflow-x: auto;
}
.post-content th {
  background: var(--surface-2);
  font-weight: 600;
  padding: .6em 1em;
  border: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.post-content td {
  padding: .5em 1em;
  border: 1px solid var(--border);
}
.post-content tr:nth-child(even) td { background: rgba(0,0,0,.02); }
[data-theme="dark"] .post-content tr:nth-child(even) td { background: rgba(255,255,255,.03); }

/* HR */
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

/* Images */
.post-content img {
  border-radius: var(--radius-sm);
  max-width: 100%;
  margin: 1em auto;
  box-shadow: var(--shadow);
}

/* ── 15. TOC ─────────────────────────────────────────────── */
.toc-wrap {
  position: sticky;
  top: 28px;
}
.toc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.toc-list { list-style: none; padding: 0; }
.toc-item { margin: 0; }
.toc-link {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 3px 0 3px 10px;
  border-left: 2px solid var(--border);
  line-height: 1.5;
  transition: all var(--transition);
  text-decoration: none;
}
.toc-link:hover { color: var(--text); border-left-color: var(--text-muted); }
.toc-link.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc-depth-3 { padding-left: 20px; }
.toc-depth-4 { padding-left: 30px; }

/* ── 16. Comments ────────────────────────────────────────── */
.comments-wrap {
  margin-top: 52px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.comments-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

/* ── 17. Page Layout (About etc) ─────────────────────────── */
.page-article {
  max-width: var(--content-max);
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 40px 44px;
  box-shadow: var(--shadow-sm);
}
.page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -.02em;
}

/* ── 18. Archives ────────────────────────────────────────── */
.archive-list {
  max-width: var(--content-max);
  margin: 0 auto;
}
.archive-year {
  margin-bottom: 32px;
}
.archive-year-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.archive-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}
.archive-date { color: var(--text-muted); flex-shrink: 0; font-size: 12.5px; }
.archive-item a { color: var(--text-2); flex: 1; }
.archive-item a:hover { color: var(--accent); }

/* ── 19. 404 ─────────────────────────────────────────────── */
.not-found {
  max-width: var(--content-max);
  margin: 80px auto;
  text-align: center;
}
.not-found-code {
  font-size: 80px;
  font-weight: 900;
  color: var(--border);
  line-height: 1;
}
.not-found-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 16px 0 8px;
}
.not-found-desc { font-size: 15px; color: var(--text-muted); }
.not-found-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: background var(--transition);
}
.not-found-back:hover { background: var(--accent-d); color: #fff; }

/* ── 20. Syntax Highlight (Chroma / monokai) ─────────────── */
.chroma { background: #0f172a !important; }
.chroma .err  { color:#f87171 }
.chroma .k    { color:#f472b6 }
.chroma .kd   { color:#f472b6 }
.chroma .kn   { color:#f472b6 }
.chroma .kp   { color:#f472b6 }
.chroma .kr   { color:#f472b6 }
.chroma .kt   { color:#fbbf24 }
.chroma .n    { color:#e2e8f0 }
.chroma .na   { color:#34d399 }
.chroma .nb   { color:#fbbf24 }
.chroma .nc   { color:#fbbf24 }
.chroma .nd   { color:#34d399 }
.chroma .ni   { color:#e2e8f0 }
.chroma .ne   { color:#f87171 }
.chroma .nf   { color:#38bdf8 }
.chroma .nl   { color:#e2e8f0 }
.chroma .nn   { color:#fbbf24 }
.chroma .nx   { color:#38bdf8 }
.chroma .py   { color:#e2e8f0 }
.chroma .nt   { color:#f472b6 }
.chroma .nv   { color:#e2e8f0 }
.chroma .s    { color:#a3e635 }
.chroma .sa   { color:#a3e635 }
.chroma .sb   { color:#a3e635 }
.chroma .sc   { color:#a3e635 }
.chroma .dl   { color:#a3e635 }
.chroma .sd   { color:#a3e635 }
.chroma .s2   { color:#a3e635 }
.chroma .se   { color:#fb923c }
.chroma .sh   { color:#a3e635 }
.chroma .si   { color:#a3e635 }
.chroma .sx   { color:#a3e635 }
.chroma .sr   { color:#a3e635 }
.chroma .s1   { color:#a3e635 }
.chroma .ss   { color:#a3e635 }
.chroma .m    { color:#c084fc }
.chroma .mb   { color:#c084fc }
.chroma .mf   { color:#c084fc }
.chroma .mh   { color:#c084fc }
.chroma .mi   { color:#c084fc }
.chroma .il   { color:#c084fc }
.chroma .mo   { color:#c084fc }
.chroma .c    { color:#64748b; font-style:italic }
.chroma .ch   { color:#64748b; font-style:italic }
.chroma .cm   { color:#64748b; font-style:italic }
.chroma .c1   { color:#64748b; font-style:italic }
.chroma .cs   { color:#64748b; font-style:italic }
.chroma .cp   { color:#64748b }
.chroma .cpf  { color:#64748b }
.chroma .o    { color:#94a3b8 }
.chroma .ow   { color:#94a3b8 }
.chroma .p    { color:#e2e8f0 }
.chroma .ln   { color:#64748b }
.chroma .lnl  { color:#64748b }
.chroma .ge   { font-style:italic }
.chroma .gs   { font-weight:700 }
.chroma .gu   { color:#94a3b8 }
.chroma .gl   { text-decoration:underline }

/* ── 21. Responsive ──────────────────────────────────────── */
@media (max-width: 1100px) {
  .post-wrap {
    grid-template-columns: 1fr;
  }
  .toc-wrap { display: none; }
}

@media (max-width: 768px) {
  .mobile-header { display: flex; }

  .page-wrap { display: block; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 200;
    width: 280px;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
  }
  .sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .page-main { padding: 20px 16px; }

  .post-card { flex-direction: column; }
  .post-card-thumb { width: 100%; height: 180px; }
  .post-card-thumb-placeholder { min-height: 120px; }

  .post-wrap { grid-template-columns: 1fr; }

  .page-article { padding: 24px 20px; border-radius: var(--radius); }
}

@media (max-width: 480px) {
  .hero-name { font-size: 24px; }
  .post-title { font-size: 20px; }
}
