@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@500&display=swap');

:root {
  --bg: #f0f4f8;
  --card: #ffffff;
  --ink: #1a2332;
  --muted: #5c6b7a;
  --accent: #2563eb;
  --accent2: #7c3aed;
  --green: #059669;
  --orange: #ea580c;
  --rose: #e11d48;
  --teal: #0d9488;
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.infographic {
  width: 900px;
  margin: 24px auto;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.header {
  padding: 28px 32px 24px;
  color: white;
  position: relative;
}

.header h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.header .subtitle {
  font-size: 0.9rem;
  opacity: 0.88;
  font-weight: 400;
}

.header .badge {
  position: absolute;
  top: 24px;
  right: 28px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.header.theme-chem { background: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%); }
.header.theme-bio { background: linear-gradient(135deg, #047857 0%, #0d9488 100%); }
.header.theme-dna { background: linear-gradient(135deg, #be185d 0%, #7c3aed 100%); }
.header.theme-virus { background: linear-gradient(135deg, #c2410c 0%, #dc2626 100%); }
.header.theme-summary { background: linear-gradient(135deg, #4338ca 0%, #2563eb 100%); }

.content { padding: 24px 28px 32px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  position: relative;
}

.card.accent-blue { border-left: 4px solid #2563eb; }
.card.accent-purple { border-left: 4px solid #7c3aed; }
.card.accent-green { border-left: 4px solid #059669; }
.card.accent-orange { border-left: 4px solid #ea580c; }
.card.accent-rose { border-left: 4px solid #e11d48; }
.card.accent-teal { border-left: 4px solid #0d9488; }

.card h3 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  color: var(--ink);
}

.card h3 .formula {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.card ul { list-style: none; font-size: 0.78rem; color: var(--muted); }
.card ul li { padding: 2px 0 2px 14px; position: relative; }
.card ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 20px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.formula-box {
  font-family: 'JetBrains Mono', monospace;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  display: inline-block;
  margin: 4px 4px 4px 0;
}

.tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  margin: 2px 3px 2px 0;
}

.tag-blue { background: #dbeafe; color: #1d4ed8; }
.tag-green { background: #d1fae5; color: #047857; }
.tag-purple { background: #ede9fe; color: #6d28d9; }
.tag-orange { background: #ffedd5; color: #c2410c; }
.tag-rose { background: #ffe4e6; color: #be123c; }

.flow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.flow-step {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.76rem;
  text-align: center;
  flex: 1;
  min-width: 100px;
}

.flow-arrow { color: var(--accent); font-weight: 700; font-size: 1.1rem; }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-top: 8px;
}

.compare-table th {
  background: #f1f5f9;
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  border: 1px solid var(--border);
}

.compare-table td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.footer {
  padding: 12px 28px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
}

.wide-card { grid-column: 1 / -1; }

.hierarchy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hierarchy-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.h-label {
  min-width: 130px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
}

.h-items {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.h-item {
  font-size: 0.72rem;
  background: white;
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--muted);
}

@media print {
  body { background: white; }
  .infographic { box-shadow: none; margin: 0; width: 100%; }
}
