/* ===================== GenSpectrum static viewer ===================== */
.gs-viewer {
  --gv-accent: #6366f1;
  background: #fff;
  border: 1px solid #e7e9f0;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(20,22,45,0.07);
  overflow: hidden;
}
.gs-viewer-loading, .gs-viewer-error {
  padding: 3rem; text-align: center; color: #8b91bd; font-size: 0.95rem;
}
.gs-spin {
  display: inline-block; width: 15px; height: 15px; margin-right: 8px;
  border: 2px solid #d8dbef; border-top-color: var(--gv-accent);
  border-radius: 50%; animation: gv-spin 0.7s linear infinite; vertical-align: middle;
}
@keyframes gv-spin { to { transform: rotate(360deg); } }

/* ---- category pills ---- */
.gv-cats {
  display: flex; flex-wrap: wrap; gap: 0.45rem;
  padding: 1rem 1.1rem; border-bottom: 1px solid #eef0f6; background: #fafbff;
}
.gv-cat {
  border: 1px solid #e1e4f0; background: #fff; color: #4b5168;
  border-radius: 999px; padding: 0.32rem 0.85rem; font-size: 0.86rem;
  cursor: pointer; transition: all 0.12s; white-space: nowrap; user-select: none;
}
.gv-cat:hover { border-color: #c3c8e6; background: #f3f4ff; }
.gv-cat.active { background: var(--gv-accent); border-color: var(--gv-accent); color: #fff; font-weight: 600; }
.gv-cat .gv-cat-n { opacity: 0.6; font-size: 0.78em; margin-left: 0.3rem; }

/* ---- prompt strip ---- */
.gv-strip {
  display: flex; gap: 0.6rem; overflow-x: auto; padding: 0.9rem 1.1rem;
  border-bottom: 1px solid #eef0f6; scroll-snap-type: x proximity;
}
.gv-strip::-webkit-scrollbar { height: 7px; }
.gv-strip::-webkit-scrollbar-thumb { background: #d4d8ea; border-radius: 4px; }
.gv-thumb {
  position: relative; flex: 0 0 auto; width: 104px; height: 104px;
  border-radius: 10px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; background: #f1f2f8; scroll-snap-align: start;
  transition: border-color 0.12s, transform 0.12s;
}
.gv-thumb:hover { transform: translateY(-2px); }
.gv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gv-thumb.active { border-color: var(--gv-accent); }
.gv-thumb .gv-thumb-tag {
  position: absolute; top: 5px; left: 5px; background: rgba(22,163,74,0.92);
  color: #fff; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 1px 5px; border-radius: 4px;
}

/* ---- detail panel ---- */
.gv-detail { padding: 1.2rem 1.3rem 1.6rem; }
.gv-prompt-head {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.gv-badge {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 2px 7px; border-radius: 5px;
}
.gv-badge.src-pexels   { background: #dcfce7; color: #15803d; }
.gv-badge.src-crawl    { background: #f3f4f6; color: #4b5563; }
.gv-badge.src-dreamina { background: #dbeafe; color: #1d4ed8; }
.gv-cat-label { color: #8b91bd; font-size: 0.82rem; }
.gv-prompt-text {
  background: #f7f8fc; border: 1px solid #eef0f6; border-radius: 10px;
  padding: 0.85rem 1rem; color: #3a4055; font-size: 0.94rem; line-height: 1.6;
  margin-bottom: 1.1rem; max-height: 9rem; overflow-y: auto;
}
.gv-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 0.85rem;
}
.gv-cell { border: 1px solid #eef0f6; border-radius: 12px; overflow: hidden; background: #fff; }
.gv-cell.is-real { border-color: #86efac; box-shadow: 0 0 0 2px rgba(34,197,94,0.18); }
.gv-cell-img {
  position: relative; background: #f1f2f8; aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center; cursor: zoom-in;
}
.gv-cell-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gv-cell-lab {
  display: flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.65rem;
  font-size: 0.82rem; font-weight: 600; color: #2a2f44;
}
.gv-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.gv-cell-lab .gv-real-tag { margin-left: auto; font-size: 0.66rem; color: #16a34a; font-weight: 700; }
.gv-cell-lab .gv-noeval { margin-left: auto; font-size: 0.64rem; color: #9aa0b8; font-weight: 600; }

/* ---- lightbox ---- */
.gv-lightbox {
  position: fixed; inset: 0; background: rgba(10,10,20,0.92); z-index: 9999;
  display: none; align-items: center; justify-content: center; cursor: zoom-out; padding: 2rem;
}
.gv-lightbox.open { display: flex; }
.gv-lightbox figure { text-align: center; max-width: 92vw; max-height: 92vh; }
.gv-lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 8px; }
.gv-lightbox figcaption { color: #d7dcff; margin-top: 0.8rem; font-size: 0.9rem; }

@media (max-width: 540px) {
  .gv-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .gv-thumb { width: 88px; height: 88px; }
}
