:root {
  --bg: #0b0e17;
  --card: #141926;
  --card-2: #1b2233;
  --text: #eef1f8;
  --muted: #9aa4bd;
  --accent: #6c8cff;
  --accent-2: #ff7ab6;
  --accent-3: #35e0c8;
  --border: rgba(255,255,255,0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-orbs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35; }
.orb1 { width: 420px; height: 420px; background: var(--accent); top: -120px; left: -100px; animation: float1 18s ease-in-out infinite; }
.orb2 { width: 360px; height: 360px; background: var(--accent-2); bottom: -100px; right: -80px; animation: float2 22s ease-in-out infinite; }
.orb3 { width: 300px; height: 300px; background: var(--accent-3); top: 40%; right: 10%; animation: float1 26s ease-in-out infinite reverse; }

@keyframes float1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(40px, 60px); } }
@keyframes float2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-50px, -40px); } }

.wrap { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; padding: 48px 20px 60px; }

.hero { text-align: center; margin-bottom: 32px; }
.badge {
  display: inline-block; font-size: 13px; padding: 6px 14px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(108,140,255,0.18), rgba(255,122,182,0.18));
  border: 1px solid var(--border); color: var(--accent); margin-bottom: 16px;
  letter-spacing: 0.02em;
}
h1 {
  font-size: 40px; font-weight: 800; margin: 0 0 12px;
  background: linear-gradient(135deg, #fff 20%, var(--accent) 60%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
}
.sub { color: var(--muted); font-size: 15px; max-width: 520px; margin: 0 auto; line-height: 1.6; }

.search-card {
  display: flex; gap: 10px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.search-card input {
  flex: 1; background: transparent; border: none; outline: none; color: var(--text);
  font-size: 15px; padding: 12px 16px; min-width: 0;
}
.search-card input::placeholder { color: #5a6480; }
.search-card button {
  background: linear-gradient(135deg, var(--accent), #7c5cff);
  color: #fff; border: none; border-radius: 12px; padding: 0 22px; font-size: 15px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 8px; white-space: nowrap;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.search-card button:active { transform: scale(0.97); }
.search-card button:disabled { opacity: 0.6; cursor: not-allowed; }

.spinner {
  width: 15px; height: 15px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hint { text-align: center; margin-top: 12px; font-size: 13px; color: var(--muted); }
.example-btn {
  background: none; border: none; color: var(--accent); cursor: pointer; font-size: 13px;
  text-decoration: underline; text-underline-offset: 3px; padding: 0;
}

.status {
  margin-top: 20px; padding: 14px 18px; border-radius: 12px; font-size: 14px; line-height: 1.5;
}
.status.error { background: rgba(255,90,90,0.1); border: 1px solid rgba(255,90,90,0.3); color: #ff9d9d; }
.status.warn { background: rgba(255,190,80,0.1); border: 1px solid rgba(255,190,80,0.3); color: #ffd18a; }
.status.info { background: rgba(108,140,255,0.1); border: 1px solid rgba(108,140,255,0.3); color: #a9bcff; }

.meta-card {
  margin-top: 24px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; font-size: 14px;
}
.meta-row { display: flex; gap: 10px; padding: 6px 0; color: var(--text); }
.meta-row + .meta-row { border-top: 1px solid var(--border); }
.meta-label { color: var(--muted); min-width: 70px; flex-shrink: 0; }
#metaText { white-space: pre-wrap; word-break: break-word; }

.results {
  margin-top: 28px; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px;
}

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:hover { transform: translateY(-3px); border-color: rgba(108,140,255,0.4); }

.card-media {
  width: 100%; aspect-ratio: 1 / 1; background: var(--card-2); display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.card-media img, .card-media video { width: 100%; height: 100%; object-fit: contain; }
.card-media .lottie-box { width: 90%; height: 90%; }

.card-type-tag {
  position: absolute; top: 8px; left: 8px; font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px); color: #fff; letter-spacing: 0.03em;
}

.card-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; }
.card-actions button, .card-actions a {
  flex: 1 1 auto; min-width: 72px; text-align: center; font-size: 12px; padding: 8px 6px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--card-2); color: var(--text); cursor: pointer; text-decoration: none; transition: background 0.15s ease;
}
.card-actions button:hover, .card-actions a:hover { background: #232b41; }
.card-actions .primary { background: linear-gradient(135deg, var(--accent), #7c5cff); border: none; color: #fff; font-weight: 600; flex-basis: 100%; }
.card-actions button:disabled { opacity: 0.7; cursor: wait; }

.loading-placeholder { color: var(--muted); font-size: 12px; }

.footer { margin-top: 56px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.8; }

@media (max-width: 520px) {
  h1 { font-size: 30px; }
  .search-card { flex-direction: column; }
  .search-card button { justify-content: center; padding: 12px; }
}
