:root {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b1020;
  color: #e2e8f0;
  box-sizing: border-box;
}

*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, #0f172a, #0b1020 55%, #080c1a);
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid #1f2937;
  background: rgba(11, 18, 35, 0.7);
  backdrop-filter: blur(8px);
  padding: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand {
  display: block;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: 0.3px;
}

.side-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-link {
  color: #94a3b8;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all .15s ease;
}

.side-link:hover {
  color: #e2e8f0;
  border-color: #334155;
  background: rgba(30, 41, 59, 0.45);
}

.side-empty { color: #64748b; }

.main {
  padding: 22px;
}

.main-full {
  width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.title {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.2px;
}

.meta {
  color: #94a3b8;
  font-size: 13px;
}

.panel {
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.grid {
  display: grid;
  gap: 10px;
}

.search-box {
  margin-bottom: 14px;
}

.search-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 14px;
  outline: none;
}

.search-input:focus {
  border-color: #3b82f6;
}

.search-meta {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 8px;
}

.is-hidden {
  display: none;
}

.note-card.is-hidden,
.side-link.is-hidden {
  display: none;
}

.note-card {
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 12px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note-card:hover { border-color: #3b82f6; }

.note-name { color: #e2e8f0; font-weight: 700; }
.note-meta { color: #94a3b8; font-size: 12px; }
.note-hits {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.search-block-source {
  display: none;
}

.hit-block {
  padding: 10px 12px;
  background: rgba(2, 6, 23, 0.58);
  border: 1px solid #243244;
  border-radius: 10px;
}

.hit-label {
  color: #93c5fd;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 700;
  margin-bottom: 6px;
}

.hit-block > *:first-child { margin-top: 0; }
.hit-block > *:last-child { margin-bottom: 0; }
.hit-block p, .hit-block li, .hit-block blockquote {
  color: #dbeafe;
  line-height: 1.55;
}
.empty { color: #94a3b8; }

.article h1, .article h2, .article h3, .article h4 {
  margin: 1.2em 0 0.5em;
  color: #f8fafc;
}

.article p, .article li, .article blockquote {
  line-height: 1.6;
  color: #dbeafe;
}

.article strong {
  color: #86efac;
}

.article a { color: #7dd3fc; text-decoration: none; }
.article a:hover { text-decoration: underline; }
.article ul { padding-left: 20px; }
.article hr { border: none; border-top: 1px solid #243244; margin: 16px 0; }

.article pre {
  background: #020617;
  color: #e2e8f0;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 12px;
  overflow-x: auto;
  tab-size: 2;
}

.article code {
  font-family: "SFMono-Regular", Menlo, Consolas, "JetBrains Mono", monospace;
  font-size: 13px;
  tab-size: 2;
}

.embed-note {
  border-left: 3px solid #3b82f6;
  background: rgba(59, 130, 246, 0.12);
  padding: 10px 12px;
  border-radius: 8px;
}

.broken-link {
  color: #fca5a5;
  border-bottom: 1px dotted #ef4444;
}

.article img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid #1f2937;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #1f2937;
  }
}