:root {
  --bg: #0f1117;
  --bg2: #1a1d27;
  --bg3: #252836;
  --border: #2d3147;
  --text: #e2e8f0;
  --muted: #8892a4;
  --accent: #7c5cfc;
  --accent2: #5b8dee;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --code-bg: #161b27;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.7;
  font-size: 16px;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.logo span { color: var(--accent); }

nav { margin-left: auto; display: flex; gap: 1.5rem; font-size: 0.9rem; }
nav a { color: var(--muted); }
nav a:hover { color: var(--text); text-decoration: none; }

.hero {
  background: linear-gradient(135deg, #1a1d27 0%, #0f1117 50%, #1a1427 100%);
  padding: 4rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.search-box {
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.9rem 1.2rem 0.9rem 3rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus { border-color: var(--accent); }
.search-box input::placeholder { color: var(--muted); }

.search-box svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: 3rem 0; }
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.error-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.error-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  transition: border-color 0.2s, transform 0.1s;
  text-decoration: none !important;
  display: block;
}

.error-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.error-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.status-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.status-4xx { background: rgba(239,68,68,0.15); color: #f87171; }
.status-5xx { background: rgba(245,158,11,0.15); color: #fbbf24; }
.status-cc { background: rgba(124,92,252,0.15); color: #a78bfa; }

.error-type {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
}

.error-card p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Error page layout */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  padding: 2.5rem 0;
}

@media (max-width: 768px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
}

.error-header {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.error-header h1 {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.error-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 1rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--muted);
}

.error-header .lead {
  color: var(--muted);
  font-size: 1.05rem;
}

.content-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.content-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.content-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent2);
  margin: 1rem 0 0.4rem;
}

.content-card p { color: var(--muted); margin-bottom: 0.6rem; font-size: 0.95rem; }

.content-card ul {
  list-style: none;
  padding: 0;
}

.content-card ul li {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0.3rem 0 0.3rem 1.2rem;
  position: relative;
}

.content-card ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 0.75rem 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #a9c0f0;
}

p code, li code {
  background: var(--code-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.83rem;
  color: #a9c0f0;
}

.faq-item {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}

.faq-item:first-child { border-top: none; }

.faq-q {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.faq-a {
  color: var(--muted);
  font-size: 0.9rem;
}

.sidebar-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.sidebar-card h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.sidebar-card ul { list-style: none; }
.sidebar-card ul li { padding: 0.25rem 0; font-size: 0.88rem; }
.sidebar-card ul li a { color: var(--muted); }
.sidebar-card ul li a:hover { color: var(--accent2); }

.alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  border-left: 3px solid;
}

.alert-warn { background: rgba(245,158,11,0.08); border-color: var(--yellow); color: #fcd34d; }
.alert-tip { background: rgba(34,197,94,0.08); border-color: var(--green); color: #86efac; }

footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 3rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1rem;
}

.footer-links a { font-size: 0.85rem; color: var(--muted); }
.footer-links a:hover { color: var(--accent2); }

.footer-copy { font-size: 0.8rem; color: var(--muted); opacity: 0.6; }

/* Highlight for search */
.highlight { background: rgba(124,92,252,0.25); border-radius: 2px; }

@media (max-width: 640px) {
  .hero { padding: 2.5rem 1rem; }
  .error-grid { grid-template-columns: 1fr; }
  .header-inner nav { display: none; }
}
