:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #ffffff;
  padding: 56px 0 48px;
  margin-bottom: 32px;
}

.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.hero p {
  max-width: 680px;
  color: #e2e8f0;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

#searchInput {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--surface);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.summary {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
  margin-bottom: 48px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.card-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  background: #eff6ff;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  width: fit-content;
}

.card h3 {
  font-size: 1.08rem;
  margin-bottom: 8px;
}

.card p {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.detail-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  background: var(--surface);
  max-width: 500px;
  width: 100%;
  border-radius: 12px;
  padding: 28px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
}

.modal h2 {
  margin-bottom: 10px;
}

.modal-meta {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  font-size: 0.88rem;
  color: var(--muted);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}