
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Serif+Display:ital@0;1&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Design System ─────────────────────────────────────────── */
:root {
  --bg:       #fafaf8;
  --bg2:      #f3f2ed;
  --bg3:      #e8e6de;
  --surface:  #ffffff;
  --text:     #18181b;
  --text2:    #52525b;
  --text3:    #a1a1aa;
  --accent:   #6366f1;
  --accent-r: 99;
  --accent-g: 102;
  --accent-b: 241;
  --accent2:  #4f46e5;
  --accent-s: #eef2ff;
  --gold:     #f59e0b;
  --border:   rgba(0,0,0,0.07);
  --border2:  rgba(0,0,0,0.10);
  --shadow-s: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-m: 0 4px 16px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-l: 0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);
  --radius:   14px;
  --radius-s: 8px;
  --nav-h:    64px;
  --sidebar-w: 272px;
  --font-sans: 'Sora', system-ui, -apple-system, sans-serif;
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  /* ── Color palette ── */
  --rose:    #f43f5e; --rose-s:    #fff1f3; --rose-t:    rgba(244,63,94,0.12);
  --orange:  #f97316; --orange-s:  #fff7ed; --orange-t:  rgba(249,115,22,0.12);
  --amber:   #f59e0b; --amber-s:   #fffbeb; --amber-t:   rgba(245,158,11,0.12);
  --emerald: #10b981; --emerald-s: #ecfdf5; --emerald-t: rgba(16,185,129,0.12);
  --cyan:    #06b6d4; --cyan-s:    #ecfeff; --cyan-t:    rgba(6,182,212,0.12);
  --violet:  #8b5cf6; --violet-s:  #f5f3ff; --violet-t:  rgba(139,92,246,0.12);
  --pink:    #ec4899; --pink-s:    #fdf2f8; --pink-t:    rgba(236,72,153,0.12);
  --sky:     #0ea5e9; --sky-s:     #f0f9ff; --sky-t:     rgba(14,165,233,0.12);
}
.dark {
  --bg:       #0f0f11;
  --bg2:      #18181c;
  --bg3:      #222228;
  --surface:  #1c1c22;
  --text:     #f0eff4;
  --text2:    #a0a0b0;
  --text3:    #606070;
  --accent:   #818cf8;
  --accent2:  #a5b4fc;
  --accent-s: #1e1b4b;
  --border:   rgba(255,255,255,0.06);
  --border2:  rgba(255,255,255,0.10);
  --shadow-s: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-m: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-l: 0 12px 40px rgba(0,0,0,0.5);
  --rose-s:    rgba(244,63,94,0.12);
  --orange-s:  rgba(249,115,22,0.12);
  --amber-s:   rgba(245,158,11,0.12);
  --emerald-s: rgba(16,185,129,0.12);
  --cyan-s:    rgba(6,182,212,0.12);
  --violet-s:  rgba(139,92,246,0.12);
  --pink-s:    rgba(236,72,153,0.12);
  --sky-s:     rgba(14,165,233,0.12);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent2); }
img { display: block; max-width: 100%; }

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ─── Navigation ─────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 200;
  height: var(--nav-h);
  background: rgba(250,250,248,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 clamp(16px, 4vw, 40px);
  gap: 20px;
}
.navbar::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, #f43f5e, #f97316, #f59e0b, #10b981, #06b6d4, #6366f1, #ec4899);
}
.dark .navbar { background: rgba(15,15,17,0.92); }
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-brand-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  border-radius: 9px;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99,102,241,0.35);
}
.nav-brand-icon svg { color: #fff; }
.nav-search {
  flex: 1; max-width: 460px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 12px;
  padding: 0 16px;
  height: 40px;
  box-shadow: var(--shadow-s);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.nav-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-r),var(--accent-g),var(--accent-b),0.12), var(--shadow-s);
}
.nav-search input {
  flex: 1; border: none; background: transparent;
  color: var(--text); font-size: 0.875rem;
  font-family: var(--font-sans);
  outline: none;
}
.nav-search input::placeholder { color: var(--text3); }
.nav-search svg { flex-shrink: 0; color: var(--text3); }
.nav-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.btn-icon {
  width: 36px; height: 36px; border: none; cursor: pointer;
  background: transparent; color: var(--text2);
  border-radius: var(--radius-s);
  display: grid; place-items: center;
  transition: background 0.15s, color 0.15s;
}
.btn-icon:hover { background: var(--bg2); color: var(--text); }

/* ─── Layout ──────────────────────────────────────────────────── */
.site-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--nav-h));
  max-width: 1360px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .site-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.open {
    display: flex; flex-direction: column;
    position: fixed; inset: var(--nav-h) 0 0 0;
    z-index: 150; background: var(--bg);
    overflow-y: auto; padding: 20px;
    border-right: none;
    box-shadow: var(--shadow-l);
  }
}
.sidebar {
  display: flex; flex-direction: column; gap: 0;
  padding: 28px 0 28px 28px;
  border-right: 1px solid var(--border);
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
.main-content {
  padding: clamp(24px, 4vw, 48px);
  min-width: 0;
}
.footer {
  grid-column: 1 / -1;
  padding: 32px 48px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  color: var(--text3); font-size: 0.8rem;
}
.footer a { color: var(--text3); }
.footer a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 20px; }

/* ─── Sidebar Components ─────────────────────────────────────── */
.sidebar-section { margin-bottom: 28px; }
.sidebar-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text3);
  padding: 0 10px; margin-bottom: 6px;
}
.sidebar-links { list-style: none; display: flex; flex-direction: column; gap: 1px; }
.sidebar-links a {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: var(--radius-s);
  font-size: 0.825rem; font-weight: 400;
  color: var(--text2); transition: background 0.12s, color 0.12s;
  overflow: hidden;
}
.sidebar-links a span.link-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.sidebar-links a:hover { background: var(--bg2); color: var(--text); text-decoration: none; }
.sidebar-links a.active {
  background: var(--violet-s); color: var(--violet); font-weight: 500;
  border-right: 2px solid var(--violet);
}
.sidebar-links a .ext-badge {
  flex-shrink: 0; font-size: 0.6rem; padding: 1px 5px;
  border-radius: 4px; background: var(--bg3); color: var(--text3);
  font-weight: 700; letter-spacing: 0.04em; margin-left: auto;
  font-family: var(--font-mono);
}
.sidebar-links a[href*=".pdf"] .ext-badge   { background: var(--rose-s);    color: var(--rose); }
.sidebar-links a[href*=".docx"] .ext-badge  { background: var(--sky-s);     color: var(--sky); }
.sidebar-links a[href*=".html"] .ext-badge  { background: var(--emerald-s); color: var(--emerald); }
.sidebar-links a[href*=".txt"] .ext-badge   { background: var(--amber-s);   color: var(--amber); }
.sidebar-links a[href*=".md"] .ext-badge    { background: var(--violet-s);  color: var(--violet); }
.sidebar-home-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-s);
  font-size: 0.85rem; font-weight: 600;
  color: var(--text); transition: background 0.12s;
}
.sidebar-home-link:hover { background: var(--bg2); text-decoration: none; color: var(--text); }
.sidebar-home-link svg { color: var(--accent); flex-shrink: 0; }

/* ─── Page Header ────────────────────────────────────────────── */
.page-header { margin-bottom: 36px; }
.page-header-eyebrow {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--violet), var(--pink));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.page-header-eyebrow::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(139,92,246,0.3), transparent);
  -webkit-text-fill-color: initial;
}
.page-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 400; line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}
.page-header p { color: var(--text2); margin-top: 10px; font-size: 1rem; line-height: 1.7; }

/* ─── Stats Bar ──────────────────────────────────────────────── */
.stats-bar {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 20px;
}
.stat-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; background: var(--surface);
  border-radius: 99px; font-size: 0.8rem; color: var(--text2);
  border: 1px solid var(--border2); box-shadow: var(--shadow-s);
}
.stat-chip strong { color: var(--text); font-weight: 700; }
.stat-chip-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.stat-chip:nth-child(1) { border-color: rgba(99,102,241,0.2); }
.stat-chip:nth-child(1) .stat-chip-dot { background: var(--violet); }
.stat-chip:nth-child(2) { border-color: rgba(16,185,129,0.2); }
.stat-chip:nth-child(2) .stat-chip-dot { background: var(--emerald); }
.stat-chip:nth-child(3) { border-color: rgba(245,158,11,0.2); }
.stat-chip:nth-child(3) .stat-chip-dot { background: var(--amber); }
.stat-chip:nth-child(4) { border-color: rgba(244,63,94,0.2); }
.stat-chip:nth-child(4) .stat-chip-dot { background: var(--rose); }
.stat-chip:nth-child(5) { border-color: rgba(6,182,212,0.2); }
.stat-chip:nth-child(5) .stat-chip-dot { background: var(--cyan); }

/* ─── Filter Bar ─────────────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter-btn {
  padding: 6px 16px; border: 1.5px solid var(--border2);
  border-radius: 99px; background: var(--surface); cursor: pointer;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.03em;
  color: var(--text2); font-family: var(--font-sans);
  transition: all 0.15s;
  box-shadow: var(--shadow-s);
}
.filter-btn:hover { border-color: var(--violet); color: var(--violet); background: var(--violet-s); }
.filter-btn.active { background: var(--violet); color: #fff; border-color: var(--violet); box-shadow: 0 2px 8px rgba(139,92,246,0.3); }
.filter-btn[data-filter="pdf"]:hover, .filter-btn[data-filter="pdf"].active { background: var(--rose); border-color: var(--rose); color: #fff; box-shadow: 0 2px 8px rgba(244,63,94,0.3); }
.filter-btn[data-filter="docx"]:hover, .filter-btn[data-filter="docx"].active { background: var(--sky); border-color: var(--sky); color: #fff; box-shadow: 0 2px 8px rgba(14,165,233,0.3); }
.filter-btn[data-filter="html"]:hover, .filter-btn[data-filter="html"].active { background: var(--emerald); border-color: var(--emerald); color: #fff; box-shadow: 0 2px 8px rgba(16,185,129,0.3); }
.filter-btn[data-filter="txt"]:hover, .filter-btn[data-filter="txt"].active { background: var(--amber); border-color: var(--amber); color: #fff; box-shadow: 0 2px 8px rgba(245,158,11,0.3); }
.filter-btn[data-filter="md"]:hover, .filter-btn[data-filter="md"].active { background: var(--violet); border-color: var(--violet); color: #fff; box-shadow: 0 2px 8px rgba(139,92,246,0.3); }

/* ─── Cards Grid ─────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow-s);
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; transition: opacity 0.2s; opacity: 1;
}
.card[data-type=".pdf"]::before   { background: linear-gradient(90deg, var(--rose), #fb7185); }
.card[data-type=".docx"]::before,
.card[data-type=".doc"]::before   { background: linear-gradient(90deg, var(--sky), #38bdf8); }
.card[data-type=".html"]::before,
.card[data-type=".htm"]::before   { background: linear-gradient(90deg, var(--emerald), #34d399); }
.card[data-type=".txt"]::before   { background: linear-gradient(90deg, var(--amber), #fcd34d); }
.card[data-type=".md"]::before,
.card[data-type=".markdown"]::before { background: linear-gradient(90deg, var(--violet), #a78bfa); }
.card:not([data-type])::before    { background: linear-gradient(90deg, var(--cyan), #67e8f9); }
.card:hover {
  box-shadow: var(--shadow-m);
  transform: translateY(-3px);
  border-color: transparent;
}
.card-type {
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 5px;
  align-self: flex-start; font-family: var(--font-mono);
}
.type-pdf   { background: var(--rose-s);    color: var(--rose);    border: 1px solid var(--rose-t); }
.type-docx  { background: var(--sky-s);     color: var(--sky);     border: 1px solid var(--sky-t); }
.type-html  { background: var(--emerald-s); color: var(--emerald); border: 1px solid var(--emerald-t); }
.type-txt   { background: var(--amber-s);   color: var(--amber);   border: 1px solid var(--amber-t); }
.type-md    { background: var(--violet-s);  color: var(--violet);  border: 1px solid var(--violet-t); }
.type-other { background: var(--bg2); color: var(--text3); border: 1px solid var(--border2); }
.dark .type-pdf   { background: rgba(244,63,94,0.12);   color: #fb7185; border-color: rgba(244,63,94,0.2); }
.dark .type-docx  { background: rgba(14,165,233,0.12);  color: #38bdf8; border-color: rgba(14,165,233,0.2); }
.dark .type-html  { background: rgba(16,185,129,0.12);  color: #34d399; border-color: rgba(16,185,129,0.2); }
.dark .type-txt   { background: rgba(245,158,11,0.12);  color: #fcd34d; border-color: rgba(245,158,11,0.2); }
.dark .type-md    { background: rgba(139,92,246,0.12);  color: #a78bfa; border-color: rgba(139,92,246,0.2); }
.card h3 {
  font-size: 0.95rem; font-weight: 600; line-height: 1.45;
  letter-spacing: -0.01em;
}
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); }
.card-desc { font-size: 0.83rem; color: var(--text2); flex: 1; line-height: 1.6; }
.card-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.75rem; color: var(--text3);
  padding-top: 12px; border-top: 1px solid var(--border);
  font-family: var(--font-mono);
}
.card-path {
  font-size: 0.72rem; color: var(--text3);
  word-break: break-all; font-family: var(--font-mono);
  opacity: 0.7;
}

/* ─── Article / Page Content ─────────────────────────────────── */
.article-header {
  margin-bottom: 40px; padding-bottom: 32px;
  border-bottom: 1px solid var(--border2);
}
.article-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 400; line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}
.article-meta {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px;
}
.article-meta-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.775rem; color: var(--text2);
  background: var(--bg2); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 99px;
}
.article-meta-chip:nth-child(1) { background: var(--violet-s); border-color: var(--violet-t); color: var(--violet); }
.article-meta-chip:nth-child(2) { background: var(--emerald-s); border-color: var(--emerald-t); color: var(--emerald); }
.article-meta-chip:nth-child(3) { background: var(--amber-s); border-color: var(--amber-t); color: var(--amber); }
.article-meta-chip:nth-child(4) { background: var(--sky-s); border-color: var(--sky-t); color: var(--sky); }
.article-body { max-width: 72ch; }
.article-body h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem; font-weight: 400;
  margin: 2.2em 0 0.8em; line-height: 1.3;
  color: var(--text);
}
.article-body h3 {
  font-size: 1.1rem; font-weight: 700;
  margin: 1.8em 0 0.6em; letter-spacing: -0.01em;
}
.article-body p { margin-bottom: 1.4em; color: var(--text2); }
.article-body ul, .article-body ol { padding-left: 1.6em; margin-bottom: 1.4em; color: var(--text2); }
.article-body li { margin-bottom: 0.5em; }
.article-body blockquote {
  border-left: 3px solid var(--violet); padding: 14px 24px;
  background: var(--violet-s); margin: 2em 0;
  border-radius: 0 var(--radius-s) var(--radius-s) 0; color: var(--text2);
  font-style: italic;
}
.article-body code {
  background: var(--rose-s); padding: 2px 7px;
  border-radius: 5px; font-size: 0.82em;
  font-family: var(--font-mono); color: var(--rose);
}
.article-body pre {
  background: #18181c; padding: 20px 24px; border-radius: var(--radius);
  overflow-x: auto; margin: 1.8em 0; border: 1px solid var(--border);
}
.article-body pre code { background: none; padding: 0; color: #e4e4ef; font-size: 0.875em; }
.article-body table { width: 100%; border-collapse: collapse; margin: 2em 0; font-size: 0.875rem; }
.article-body th, .article-body td {
  border: 1px solid var(--border2); padding: 10px 14px; text-align: left;
}
.article-body th {
  background: var(--bg2); font-weight: 700;
  font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text3);
}

/* ─── Related Links ──────────────────────────────────────────── */
.related-links {
  margin: 48px 0 0; padding: 28px;
  background: linear-gradient(135deg, var(--violet-s), var(--sky-s));
  border: 1px solid rgba(139,92,246,0.15);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
}
.related-links-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.related-links h3 {
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--violet);
}
.related-count {
  font-size: 0.75rem; color: var(--violet);
  background: var(--violet-t); padding: 2px 8px; border-radius: 99px;
  font-family: var(--font-mono); border: 1px solid var(--violet-t);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.related-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; background: rgba(255,255,255,0.7);
  border: 1px solid rgba(139,92,246,0.12); border-radius: var(--radius-s);
  font-size: 0.8rem; color: var(--text2);
  transition: all 0.15s; text-decoration: none;
  overflow: hidden;
}
.dark .related-item { background: rgba(255,255,255,0.04); }
.related-item-title {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.related-item:hover {
  border-color: var(--violet); color: var(--violet);
  background: var(--violet-s); text-decoration: none;
  box-shadow: 0 2px 8px var(--violet-t);
}

/* ─── Page Navigation ────────────────────────────────────────── */
.page-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px;
}
.page-nav-btn {
  display: flex; flex-direction: column; gap: 5px;
  padding: 18px 20px; background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius); text-decoration: none;
  transition: all 0.18s; box-shadow: var(--shadow-s);
}
.page-nav-btn:hover {
  border-color: var(--accent); text-decoration: none;
  box-shadow: var(--shadow-m), 0 0 0 3px rgba(var(--accent-r),var(--accent-g),var(--accent-b),0.08);
  transform: translateY(-1px);
}
.page-nav-btn .nav-dir {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text3); font-weight: 800; font-family: var(--font-mono);
}
.page-nav-btn .nav-title {
  font-size: 0.9rem; color: var(--text); font-weight: 600; line-height: 1.4;
}
.page-nav-btn.next { text-align: right; }

/* ─── Back Home / Back Top ───────────────────────────────────── */
.back-home {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 16px; background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 99px; font-size: 0.825rem; font-weight: 500;
  color: var(--text2); text-decoration: none;
  transition: all 0.15s; margin-bottom: 24px;
  box-shadow: var(--shadow-s);
}
.back-home:hover {
  background: var(--accent); color: #fff;
  border-color: var(--accent); text-decoration: none;
  box-shadow: 0 4px 14px rgba(var(--accent-r),var(--accent-g),var(--accent-b),0.35);
}
.back-top {
  position: fixed; bottom: 28px; right: 28px;
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: #fff; border: none; border-radius: 14px; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
  opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none;
}
.back-top.visible { opacity: 1; pointer-events: auto; }
.back-top:hover { transform: translateY(-2px); }

/* ─── Search Results ─────────────────────────────────────────── */
#search-results {
  position: absolute; top: var(--nav-h); left: 50%;
  transform: translateX(-50%); width: min(660px, 92vw);
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-l);
  max-height: 460px; overflow-y: auto; display: none; z-index: 300;
}
#search-results.open { display: block; }
.search-result-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 13px 20px; border-bottom: 1px solid var(--border);
  color: var(--text); text-decoration: none; transition: background 0.1s;
}
.search-result-item:hover { background: var(--bg2); text-decoration: none; }
.search-result-item:last-child { border-bottom: none; }
.sr-title { font-weight: 600; font-size: 0.9rem; }
.sr-snippet { font-size: 0.8rem; color: var(--text2); line-height: 1.5; }
mark { background: #fef08a; color: #78350f; border-radius: 3px; padding: 1px 3px; }
.dark mark { background: #854d0e; color: #fef3c7; }
.sr-empty { padding: 20px; text-align: center; color: var(--text3); font-size: 0.875rem; }

/* ─── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 0.78rem; color: var(--text3); margin-bottom: 20px;
}
.breadcrumb a { color: var(--text3); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--text3); opacity: 0.4; }
.breadcrumb-current { color: var(--text2); }

/* ─── Progress Bar ───────────────────────────────────────────── */
.read-progress {
  position: fixed; top: var(--nav-h); left: 0;
  height: 2px; background: linear-gradient(90deg, #f43f5e, #f97316, #f59e0b, #10b981, #6366f1, #ec4899);
  transition: width 0.1s linear; z-index: 199;
  box-shadow: 0 0 8px rgba(139,92,246,0.5);
}

/* ─── Section Divider ────────────────────────────────────────── */
.section-divider {
  height: 1px; background: linear-gradient(90deg, var(--border2), transparent);
  margin: 0 0 24px;
}
