/* LocusUnfold DUGU — Web UI Styles */

/* Card Grid — responsive */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
@media (max-width: 1200px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .card-grid { grid-template-columns: 1fr; } }

/* Card */
.card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
.card .stars { color: #f59e0b; font-weight: 600; }
.card .trap-preview { color: #6b7280; font-size: 0.85rem; margin: 0.4rem 0; }
.card .skill-name { color: #374151; font-size: 0.9rem; font-weight: 500; }

/* Sword tags — 9 colors */
.sword-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
}
.sword-time      { background: #ef4444; }  /* red */
.sword-space     { background: #3b82f6; }  /* blue */
.sword-condition { background: #10b981; }  /* green */
.sword-layer     { background: #f59e0b; }  /* amber */
.sword-form      { background: #8b5cf6; }  /* purple */
.sword-source    { background: #ec4899; }  /* pink */
.sword-order     { background: #06b6d4; }  /* cyan */
.sword-boundary  { background: #f97316; }  /* orange */
.sword-self      { background: #6366f1; }  /* indigo */

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.hidden { display: none; }
.modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 720px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 1rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #9ca3af; }
.modal-section { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #f3f4f6; }
.modal-section:last-child { border-bottom: none; }
.modal-section h3 { font-size: 0.85rem; color: #9ca3af; text-transform: uppercase; margin-bottom: 0.3rem; }

/* Search */
.search-highlight { background: #fef08a; padding: 0 2px; border-radius: 2px; }

/* Sword filter buttons */
.sword-filter-btn {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.sword-filter-btn.active { border-color: #374151; transform: scale(1.05); }
.sword-filter-btn:hover { opacity: 0.85; }

/* Network panel */
.network-panel {
  height: 600px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
  margin-top: 1rem;
  position: relative;
}
.network-panel svg { width: 100%; height: 100%; }
.network-panel.hidden { display: none; }

/* Stats bar */
#stats-bar { font-size: 0.85rem; color: #6b7280; }
#stats-bar span { margin-right: 1rem; }

/* Code display */
.code-block {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre;
  max-height: 300px;
  overflow-y: auto;
}

/* Copy-protected (view-only source) */
.no-copy {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Test output */
.test-output {
  background: #0f172a;
  color: #10b981;
  border-radius: 8px;
  padding: 0.75rem;
  font-family: monospace;
  font-size: 0.8rem;
  max-height: 200px;
  overflow-y: auto;
}

/* Related projects */
.related-list { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.related-item {
  padding: 4px 10px;
  border-radius: 6px;
  background: #f3f4f6;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}
.related-item:hover { background: #e5e7eb; }

/* Egg Wall */
.egg-card { cursor: default; }
.egg-license {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #ecfdf5;
  color: #059669;
}
.egg-download {
  display: inline-block;
  padding: 4px 14px;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.egg-download:hover { background: #1d4ed8; }

/* Brand host — top-left maximized */
.brand-host { display: flex; flex-direction: column; gap: 2px; }
.brand-host-name {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 900;
  color: #111827;
  line-height: 1.15;
  letter-spacing: 0.02em;
}
.brand-host-alias { color: #2563eb; font-weight: 900; }
.brand-host-sub { font-size: 0.8rem; color: #6b7280; }

/* Contact panel — official account QR */
.contact-panel {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(135deg, #065f46 0%, #0f766e 55%, #1d4ed8 100%);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  color: #fff;
}
.contact-qr {
  width: 110px;
  height: 110px;
  flex: 0 0 auto;
  background: #fff;
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.contact-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 6px; }
.contact-sub { font-size: 0.85rem; color: rgba(255,255,255,0.85); }
@media (max-width: 640px) {
  .contact-panel { flex-direction: column; text-align: center; }
}

/* Footer — company + ICP, bottom-right */
.site-footer {
  border-top: 1px solid #e5e7eb;
  margin-top: 2.5rem;
  padding: 1.1rem 1.5rem;
  display: flex;
  justify-content: flex-end;
}
.footer-right { font-size: 0.8rem; color: #6b7280; }
.footer-right a { color: #6b7280; text-decoration: none; margin-left: 8px; }
.footer-right a:hover { text-decoration: underline; }

/* Loading spinner */
.spinner {
  border: 3px solid #e5e7eb;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
