/* LLM Wiki — GitHub Pages theme */
:root {
  --bg: #fafafa;
  --sidebar-bg: #1a1a2e;
  --sidebar-text: #e0e0e0;
  --sidebar-active: #e94560;
  --text: #1a1a2e;
  --text-secondary: #555;
  --border: #e0e0e0;
  --accent: #4361ee;
  --accent-hover: #3a56d4;
  --max-width: 900px;
  --sidebar-width: 260px;
  --radius: 6px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 10;
}

.sidebar-header h1 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
}

.sidebar-header h1 a {
  color: #fff;
  text-decoration: none;
}

.nav-section {
  margin-bottom: 1.2rem;
}

.nav-section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin-bottom: 0.4rem;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin: 0.15rem 0;
}

.sidebar-nav a {
  display: block;
  padding: 0.25rem 0.5rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: background 0.15s;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.08);
}

.sidebar-nav a.active {
  color: var(--sidebar-active);
  background: rgba(233,69,96,0.1);
  font-weight: 600;
}

/* Main content */
.content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2.5rem 3rem;
  max-width: calc(100vw - var(--sidebar-width));
}

.page-content {
  max-width: var(--max-width);
}

/* Page header */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-technology { background: #e3f2fd; color: #1565c0; }
.badge-science { background: #e8f5e9; color: #2e7d32; }
.badge-business { background: #fff3e0; color: #e65100; }
.badge-health { background: #fce4ec; color: #c62828; }
.badge-education { background: #f3e5f5; color: #6a1b9a; }
.badge-personal { background: #fff8e1; color: #f57f17; }
.badge-reference { background: #e0f2f1; color: #00695c; }
.badge-general { background: #eceff1; color: #546e7a; }

.tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  background: #f0f0f0;
  border-radius: 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-left: auto;
}

/* Typography */
.page-content h2 {
  font-size: 1.5rem;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--border);
}

.page-content h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.5rem;
}

.page-content p {
  margin-bottom: 1rem;
}

.page-content ul, .page-content ol {
  margin: 0.5rem 0 1rem 1.5rem;
}

.page-content li {
  margin-bottom: 0.3rem;
}

.page-content blockquote {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-left: 4px solid var(--accent);
  background: #f8f9ff;
  color: var(--text-secondary);
}

.page-content code {
  background: #f0f0f0;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: "SF Mono", "Monaco", "Inconsolata", "Fira Code", monospace;
}

.page-content pre {
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.page-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.page-content a {
  color: var(--accent);
  text-decoration: none;
}

.page-content a:hover {
  text-decoration: underline;
}

.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.page-content th, .page-content td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}

.page-content th {
  background: #f5f5f5;
  font-weight: 600;
}

.page-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Wikilinks styling */
.page-content a[href^="http"]::after {
  content: " ↗";
  font-size: 0.75em;
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .content {
    margin-left: 0;
    padding: 1.5rem;
    max-width: 100%;
  }
  .page-content {
    max-width: 100%;
  }
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  pre {
    max-width: 100%;
    overflow-x: auto;
  }
}
