:root[data-theme="light"] {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #1e293b;
  --text-muted: #64748b;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --nav-border: #e5e7eb;
  --planner: #7c3aed;
  --planner-bg: #f5f3ff;
  --accent-generate: #2563eb;
  --accent-generate-bg: #eff6ff;
  --accent-edit: #059669;
  --accent-edit-bg: #ecfdf5;
  --accent-extend: #d97706;
  --accent-extend-bg: #fffbeb;
  --accent-report: #7c3aed;
  --accent-report-bg: #f5f3ff;
  --node-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --node-glow: none;
}

:root[data-theme="dark"] {
  --bg: #1a1a2e;
  --surface: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.9);
  --text-muted: rgba(255, 255, 255, 0.4);
  --nav-bg: rgba(26, 26, 46, 0.9);
  --nav-border: rgba(255, 255, 255, 0.08);
  --planner: #f472b6;
  --planner-bg: rgba(244, 114, 182, 0.15);
  --accent-generate: #818cf8;
  --accent-generate-bg: rgba(99, 102, 241, 0.15);
  --accent-edit: #22d3ee;
  --accent-edit-bg: rgba(34, 211, 238, 0.15);
  --accent-extend: #fbbf24;
  --accent-extend-bg: rgba(251, 191, 36, 0.15);
  --accent-report: #f472b6;
  --accent-report-bg: rgba(244, 114, 182, 0.15);
  --node-shadow: none;
  --node-glow: 0 0 12px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-width: 900px;
}

section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 40px;
}

#nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nav-border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-logo {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-link.active {
  color: var(--text);
  background: var(--surface);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

:root[data-theme="light"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }

#hero {
  text-align: center;
  padding-top: 80px;
  padding-bottom: 40px;
}

#hero h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.flow-diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  box-shadow: var(--node-shadow);
}

.flow-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  gap: 12px;
}

.flow-node {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

.flow-node.input {
  border-color: var(--text-muted);
  color: var(--text-muted);
}

.flow-node.planner {
  border-color: var(--planner);
  color: var(--planner);
  background: var(--planner-bg);
}

.flow-node.output {
  border-color: var(--accent-generate);
  color: var(--accent-generate);
}

.flow-arrow {
  text-align: center;
  color: var(--text-muted);
  font-size: 20px;
}

.flow-caption {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.pipelines-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.pipeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--node-shadow);
}

.pipeline-bar {
  height: 4px;
}

.pipeline-card[data-kind="generate"] .pipeline-bar { background: var(--accent-generate); }
.pipeline-card[data-kind="edit"] .pipeline-bar { background: var(--accent-edit); }
.pipeline-card[data-kind="extend"] .pipeline-bar { background: var(--accent-extend); }
.pipeline-card[data-kind="report"] .pipeline-bar { background: var(--accent-report); }

.pipeline-body {
  padding: 22px 24px;
}

.pipeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pipeline-header h3 {
  font-size: 18px;
  font-weight: 700;
  font-family: "SF Mono", "Fira Code", monospace;
}

.pipeline-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 5px;
}

.pipeline-card[data-kind="generate"] .pipeline-badge { background: var(--accent-generate-bg); color: var(--accent-generate); }
.pipeline-card[data-kind="edit"] .pipeline-badge { background: var(--accent-edit-bg); color: var(--accent-edit); }
.pipeline-card[data-kind="extend"] .pipeline-badge { background: var(--accent-extend-bg); color: var(--accent-extend); }
.pipeline-card[data-kind="report"] .pipeline-badge { background: var(--accent-report-bg); color: var(--accent-report); }

.pipeline-role {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.pipeline-io {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
}

.pipeline-io h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.pipeline-io ul {
  list-style: none;
  font-size: 13px;
}

.pipeline-io li {
  padding: 2px 0;
  padding-left: 14px;
  position: relative;
}

.pipeline-io li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.pipeline-io code {
  font-size: 12px;
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: "SF Mono", "Fira Code", monospace;
}

.pipeline-steps {
  font-size: 13px;
  line-height: 1.7;
  padding-left: 18px;
}

.pipeline-steps li {
  padding: 2px 0;
}

.pipeline-steps code {
  font-size: 12px;
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: "SF Mono", "Fira Code", monospace;
}

.errors-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.error-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
}

.error-card h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  color: var(--planner);
}

.error-card ul {
  list-style: none;
  font-size: 13px;
}

.error-card li {
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}

.error-card li:last-child {
  border-bottom: none;
}

.error-card code {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 12px;
  color: var(--planner);
  background: var(--planner-bg);
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 8px;
}

footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

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

.footer-inner a:hover {
  color: var(--text);
}

.footer-inner code {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 12px;
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 3px;
}
