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

:root {
  --accent: #16a34a;
  --accent-light: #f0fdf4;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #ffffff;
  --sidebar-bg: #fafafa;
  --sidebar-text: #4b5563;
  --sidebar-width: 220px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;
}

html { font-size: 16px; }

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

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

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
}

.sidebar-header {
  padding: 1.5rem 1.25rem 0.75rem;
}

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

.sidebar-nav {
  padding: 0.25rem 0;
  flex: 1;
}

.sidebar-nav a {
  display: block;
  padding: 0.35rem 1.25rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}

.sidebar-nav a:hover { color: var(--text); }

.sidebar-nav a.active {
  color: var(--accent);
  font-weight: 600;
}

.sidebar-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
}

.sidebar-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.sidebar-footer a:hover { color: var(--accent); }

/* ─── Content ─── */
.content {
  margin-left: var(--sidebar-width);
  padding: 3rem 4rem;
  max-width: 720px;
  flex: 1;
}

.content h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.35rem;
}

.content p, .content li { font-size: 0.95rem; }

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

.content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.content a:hover { text-decoration: none; }

.content ul, .content ol { margin-bottom: 1rem; padding-left: 1.25rem; }

.content li { margin-bottom: 0.25rem; }

.content code {
  background: var(--sidebar-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.85rem;
  font-family: var(--mono);
}

.content pre {
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  line-height: 1.5;
}

.content pre code {
  background: none;
  padding: 0;
}

.content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.35rem 1rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

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

.content th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.content .sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.origin-notice {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.origin-notice a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.origin-notice a:hover { color: var(--accent); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .content {
    margin-left: 0;
    padding: 2rem 1.5rem;
  }
}
