/* ============================================================
   TRAE AI 创造力大赛 · 灵感 Demo Hall
   深色科技风 + 荧光绿强调色
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base:        #08080c;
  --bg-card:        rgba(24,24,27,0.6);
  --bg-tag:         #27272a;
  --bg-tag-hover:   #3f3f46;
  --border:         rgba(255,255,255,0.06);
  --border-strong:  rgba(255,255,255,0.12);

  --accent:         #22c55e;
  --accent-deep:    #16a34a;
  --accent-glow:    rgba(34, 197, 94, 0.35);
  --accent-soft:    rgba(34, 197, 94, 0.12);

  --text-primary:   #ffffff;
  --text-secondary: #a1a1aa;
  --text-tertiary:  #d4d4d8;
  --text-muted:     #71717a;

  --container:      1280px;
  --radius-card:    16px;
  --radius-pill:    9999px;
  --radius-input:   8px;

  --glass-bg:       rgba(255,255,255,0.03);
  --glass-border:   rgba(255,255,255,0.08);
  --glass-blur:     10px;

  --font-sans: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont,
               "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(34,197,94,0.08), transparent),
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  pointer-events: none;
}

/* ---------- Particle Canvas ---------- */
#particle-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Disclaimer Bar ---------- */
.disclaimer-bar {
  position: relative;
  z-index: 1;
  margin-top: 64px;
  padding: 8px 32px;
  text-align: center;
  background: rgba(234, 179, 8, 0.1);
  border-bottom: 1px solid rgba(234, 179, 8, 0.2);
}

.disclaimer-text {
  font-size: 12px;
  color: #fbbf24;
  letter-spacing: 0.3px;
}

/* ---------- Contest Banner ---------- */
.contest-banner {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
}

.banner-close {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.banner-close:hover {
  background: rgba(0, 0, 0, 0.75);
}

.contest-banner img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(8,8,12,0.85) 0%, rgba(8,8,12,0.6) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-strong);
  transition: background 0.3s ease;
}

.navbar.scrolled { background: rgba(10, 10, 10, 0.85); }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
}

.logo-brand {
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  background: var(--bg-tag);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  color: var(--text-primary);
  font-size: 14px;
  width: 200px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box::placeholder { color: var(--text-muted); }
.search-box:focus { border-color: var(--accent); }

.search-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-wrapper .search-box {
  padding-right: 36px;
  width: 320px;
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.search-clear-btn.visible {
  display: inline-flex;
}

/* ---------- Layout ---------- */
main { position: relative; z-index: 1; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- HERO ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 64px;
  padding-bottom: 120px;
  overflow: hidden;
}

.hero-inner { max-width: 720px; }

.pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--accent);
  background: var(--accent-soft);
  margin-bottom: 28px;
}

.pill-tag .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.8); }
}

.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 20px;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--accent) 0%, #4ade80 60%, #86efac 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(34, 197, 94, 0.3);
}

.hero p {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 520px;
  font-weight: 500;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.hero-stats {
  display: flex;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  margin-top: 64px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  align-items: center;
}

.stat-item:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover {
  background: var(--accent-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.btn-sm { padding: 6px 14px; font-size: 13px; }

.btn:disabled, .btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ---------- Filter Bar ---------- */
.filter-bar {
  padding: 24px 0;
  border-top: 1px solid rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  position: sticky;
  top: 64px;
  background: rgba(8,8,12,0.8);
  backdrop-filter: blur(10px);
  z-index: 50;
}

.filter-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-pill {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-tag);
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  user-select: none;
}

.tag-pill:hover {
  background: var(--bg-tag-hover);
  color: var(--text-primary);
}

.tag-pill.active {
  background: var(--accent);
  color: #000;
}

.filter-sort select {
  background: var(--bg-tag);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.filter-inner-secondary {
  margin-top: 10px;
  justify-content: space-between;
}

.result-count {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.result-count .accent {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Search Highlight ---------- */
mark {
  background: rgba(34, 197, 94, 0.22);
  color: var(--accent);
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 600;
}

/* ---------- Approval Toggle ---------- */
.filter-approval {
  display: flex;
  align-items: center;
}

.approval-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-tertiary);
}

.approval-toggle input {
  display: none;
}

.toggle-slider {
  width: 44px;
  height: 24px;
  background: var(--bg-tag);
  border-radius: 12px;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.approval-toggle input:checked + .toggle-slider {
  background: var(--accent-soft);
}

.approval-toggle input:checked + .toggle-slider::after {
  left: 22px;
  background: var(--accent);
}

.approved-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  margin-left: 4px;
}

/* ---------- Cards Grid ---------- */
.cards-section { padding: 40px 0 80px; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  content-visibility: auto;
  contain-intrinsic-size: 0 300px;
  opacity: 0;
  transform: translateY(20px);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px var(--accent-glow);
}

.card.hidden { display: none; }

.card-tag-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-tag);
}

.card-tag-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.card-tag-icon svg {
  width: 100%;
  height: 100%;
}

.card-tag-text {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 500;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.meta-icon {
  width: 14px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  opacity: 0.7;
}

.btn-icon {
  width: 14px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
}

.card-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-screenshot {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-base);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card:hover .card-screenshot img {
  transform: scale(1.03);
}

.card-screenshot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.card-screenshot-placeholder .placeholder-icon {
  display: inline-block;
  width: 40px;
  height: 40px;
  opacity: 0.3;
}

.card-screenshot-placeholder .placeholder-icon svg {
  width: 100%;
  height: 100%;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* ---------- Footer ---------- */
.footer {
  padding: 32px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.04);
  color: var(--text-muted);
  font-size: 13px;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer a:hover { text-decoration: underline; }

/* ---------- Loading Indicator ---------- */
.loading-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- No Results ---------- */
.no-results {
  text-align: center;
  padding: 80px 0;
  color: var(--text-muted);
  font-size: 16px;
}

.no-results-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 520px;
  margin: 0 auto;
}

.no-results-title {
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 500;
}

.no-results-title mark {
  background: rgba(34, 197, 94, 0.22);
  color: var(--accent);
  padding: 0 4px;
  border-radius: 3px;
}

.no-results-tips {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

.no-results-tips .tip-line {
  display: block;
}

.no-results-tips .reset-hint-btn {
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  margin-left: 4px;
}

/* ---------- Load More Button ---------- */
.load-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 32px auto 48px;
  padding: 12px 32px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.load-more-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #000;
}
.load-more-btn:active:not(:disabled) {
  transform: scale(0.97);
}
.load-more-btn.loading {
  border-color: var(--text-muted);
  color: var(--text-muted);
  cursor: wait;
}
.load-more-btn.done {
  border-color: var(--border);
  color: var(--text-muted);
  cursor: default;
  opacity: 0.6;
}
.load-more-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-muted);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .container { padding: 0 16px; }
  .hero { min-height: 50vh; }
  .cards-grid { grid-template-columns: 1fr; }
  .filter-inner { flex-direction: column; align-items: stretch; }
  .search-box, .search-wrapper .search-box, .search-wrapper { width: 100%; }
  .hero-cta { flex-direction: column; }
}
