@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --radius-sm: 6px;
  --radius-md: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

header .logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-primary);
  text-decoration: none;
}

header nav {
  display: flex;
  gap: 1.5rem;
}

header nav a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 200ms ease;
}

header nav a:hover {
  color: var(--color-primary);
}

main {
  max-width: 800px;
  margin: 2.5rem auto;
  padding: 0 1rem;
}

main > a {
  display: inline-block;
  color: var(--color-primary);
  font-weight: 500;
  margin-bottom: 1.5rem;
  text-decoration: none;
}

main > a:hover {
  text-decoration: underline;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

#kb-search input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font: inherit;
  margin-bottom: 2rem;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

#kb-search input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.kb-category {
  margin-bottom: 2rem;
}

.kb-category h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-primary);
  color: var(--color-text);
}

.kb-category ul {
  list-style: none;
}

.kb-category li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.kb-category li a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  transition: color 200ms ease;
}

.kb-category li a:hover {
  color: var(--color-primary);
}

.kb-date {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

article h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.kb-meta {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
}

.kb-meta .category {
  background: #dbeafe;
  color: #1e40af;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.kb-body {
  line-height: 1.8;
  font-size: 1rem;
}

.kb-body h2 { font-size: 1.3rem; margin: 2rem 0 1rem; }
.kb-body h3 { font-size: 1.1rem; margin: 1.5rem 0 0.75rem; }
.kb-body code { background: #f1f5f9; padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.9em; }
.kb-body p { margin-bottom: 1rem; }

.empty-state, .error {
  padding: 2rem;
  text-align: center;
  color: var(--color-text-muted);
}

@media (max-width: 640px) {
  header {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }
}
