:root {
  --ink: #172033;
  --muted: #667085;
  --line: #e4e8ef;
  --panel: #ffffff;
  --bg: #f7f9fc;
  --accent: #3157a4;
  --accent-2: #2a7b70;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.hero {
  padding: 58px 24px 46px;
  background: linear-gradient(135deg, #f3f7ff 0%, #f5fbf8 52%, #fff8f0 100%);
  border-bottom: 1px solid var(--line);
}
.hero-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: end; justify-content: space-between; gap: 28px; }
.eyebrow { margin: 0 0 10px; font-size: 12px; letter-spacing: .15em; font-weight: 800; color: var(--accent-2); }
h1 { margin: 0; font-size: clamp(48px, 8vw, 86px); letter-spacing: -.06em; line-height: .95; }
.subtitle { max-width: 760px; margin: 20px 0 0; color: var(--muted); font-size: 19px; line-height: 1.6; }
.github, .button {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 10px;
  padding: 11px 15px; text-decoration: none; font-weight: 700; font-size: 14px; border: 1px solid var(--line);
  font-family: inherit;
}
.github { background: var(--ink); color: white; border-color: var(--ink); white-space: nowrap; }
main { max-width: 1180px; margin: 0 auto; padding: 30px 24px 70px; }
.notice { padding: 16px 18px; background: #eef7f4; border: 1px solid #d5ebe4; border-radius: 12px; color: #254b43; }
.toolbar { display: grid; grid-template-columns: minmax(0,1fr) 220px auto; gap: 12px; margin: 28px 0 12px; align-items: center; }
input, select { width: 100%; height: 44px; border: 1px solid #d7dde7; background: white; border-radius: 10px; padding: 0 13px; color: var(--ink); font: inherit; }
.count { color: var(--muted); font-size: 14px; text-align: right; min-width: 82px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  border: 1px solid #d7dde7; background: white; color: var(--muted);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; text-transform: capitalize;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: white; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 8px 30px rgba(22, 32, 51, .04); }
.preview { height: 210px; padding: 26px; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #fff, #fafbfc); border-bottom: 1px solid var(--line); }
.preview img { width: 100%; height: 100%; object-fit: contain; }
.card-body { padding: 16px; }
.card h2 { margin: 0; font-size: 17px; }
.meta { margin: 6px 0 0; color: var(--muted); font-size: 13px; text-transform: capitalize; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { text-transform: none; font-size: 11px; font-weight: 700; letter-spacing: .02em; background: #eef2f8; color: #3157a4; border: 1px solid #d8e2f2; border-radius: 999px; padding: 2px 9px; }
.desc { margin: 8px 0 14px; color: var(--muted); font-size: 13.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions .button { padding: 9px 10px; font-size: 13px; }
.button { background: white; color: var(--ink); cursor: pointer; }
.button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.empty { padding: 60px 20px; text-align: center; border: 1px dashed #cfd6e2; border-radius: 16px; background: white; color: var(--muted); }
.empty h2 { color: var(--ink); }
footer { border-top: 1px solid var(--line); padding: 28px 24px 42px; text-align: center; color: var(--muted); font-size: 14px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(23, 32, 51, .55); }
.modal-panel {
  position: relative; background: white; border-radius: 18px; max-width: 760px; width: 100%;
  max-height: 92vh; overflow-y: auto; display: grid; grid-template-columns: 300px 1fr;
  box-shadow: 0 30px 80px rgba(23, 32, 51, .35);
}
.modal-close { position: absolute; top: 10px; right: 12px; z-index: 2; border: none; background: #f1f4f9; border-radius: 999px; width: 34px; height: 34px; font-size: 15px; cursor: pointer; color: var(--ink); }
.modal-preview { display: flex; align-items: center; justify-content: center; padding: 28px; background: linear-gradient(180deg, #fff, #fafbfc); border-right: 1px solid var(--line); }
.modal-preview img { width: 100%; height: auto; }
.modal-body { padding: 26px 26px 28px; }
.modal-body h2 { margin: 0 0 4px; font-size: 24px; }
.modal-desc { margin: 12px 0; color: var(--muted); line-height: 1.55; }
.modal-fields { margin: 16px 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
.modal-fields dt { color: var(--muted); font-size: 13px; }
.modal-fields dd { margin: 0; font-size: 14px; font-weight: 600; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
body.modal-open { overflow: hidden; }
@media (max-width: 720px) {
  .hero-inner { align-items: flex-start; flex-direction: column; }
  .toolbar { grid-template-columns: 1fr; }
  .count { text-align: left; }
  .modal-panel { grid-template-columns: 1fr; }
  .modal-preview { border-right: none; border-bottom: 1px solid var(--line); }
}
