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

:root {
  --bg-body: #f0f7ff;
  --bg-header: #e8f4fc;
  --bg-sidebar: #e8f4fc;
  --bg-card: #ffffff;
  --bg-input: #f5f9fc;
  --border-color: #c5e0f5;
  --border-light: #d6eaf7;
  --text-primary: #1a3a52;
  --text-secondary: #3d6b8a;
  --text-muted: #7a9eb4;
  --accent: #3498db;
  --accent-light: #e3f2fd;
  --accent-border: #b3d7f0;
  --accent-warm: #5dade2;
  --shadow-sm: 0 1px 3px rgba(26,58,82,0.04);
  --shadow-md: 0 4px 14px rgba(26,58,82,0.07);
  --shadow-lg: 0 8px 28px rgba(26,58,82,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

body {
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg-sidebar);
  padding: 20px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex-shrink: 0;
}

.right-panel {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  position: sticky;
  top: 0;
  background: var(--bg-header);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 48px 14px;
  z-index: 90;
  gap: 10px;
}

.header-intro {
  width: 100%;
  text-align: center;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 1200px;
  margin: 0 auto 6px;
}

.header-search-row {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.header-search {
  flex: 1;
  position: relative;
}

.header-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.header-search input {
  width: 100%;
  padding: 14px 18px 14px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.2rem;
  font-family: 'Quicksand', sans-serif;
  font-weight: 500;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.header-search input::placeholder { color: var(--text-muted); }
.header-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
  background: #fff;
}

.main-content {
  flex: 1;
  padding: 24px 28px;
}

.filter-group h3 {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding: 0 8px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.filter-option:hover { background: var(--bg-body); }

.filter-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-color);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all var(--transition);
}

.filter-option input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.filter-option input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.filter-option .count {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sort-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sort-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.sort-pill:hover { border-color: var(--accent); color: var(--text-primary); }
.sort-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.clear-btn {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--accent);
  cursor: pointer;
  border: none;
  background: none;
  padding: 4px 0;
  transition: opacity var(--transition);
}

.clear-btn:hover { opacity: 0.7; }

.active-filters-bar {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.active-filters-bar.visible { display: flex; }

.active-filter-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--accent);
  border-radius: 12px;
  font-size: 0.7rem;
  color: #fff;
  cursor: pointer;
}

.results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.results-count {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.results-count strong { color: var(--text-primary); font-weight: 600; }

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  opacity: 0;
  transform: translateY(12px);
  animation: cardIn 0.35s ease forwards;
}

@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}

.card:hover {
  transform: translateY(-2px);
  border-color: #b3d7f0;
  box-shadow: var(--shadow-md);
}

.card-screenshot {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.card-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}

.card-screenshot-link {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  text-decoration: none;
}

.card-screenshot-link img {
  transition: transform var(--transition);
}

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

.card-screenshot .screenshot-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
}

.card-screenshot .screenshot-fallback svg {
  width: 32px;
  height: 32px;
  opacity: 0.4;
}

.card-screenshot .screenshot-fallback span {
  font-size: 0.75rem;
  opacity: 0.5;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--border-color);
  background: var(--bg-body);
}

.card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-content {
  flex: 1;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.card-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.card-handle {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-description.truncated { cursor: pointer; }
.card-description.truncated:hover { color: var(--text-primary); }
.card-description.expanded { -webkit-line-clamp: unset; }

.card-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.card-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-stat svg { width: 14px; height: 14px; }

.card-links {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.card-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--accent-light);
  text-decoration: none;
  transition: background var(--transition);
}

.card-link:hover { background: var(--accent-border); }
.card-link svg { width: 12px; height: 12px; }

.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  gap: 14px;
}

.loading-indicator.hidden { display: none; }

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

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

.loading-indicator p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.scroll-sentinel { height: 1px; width: 100%; }

.no-results {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.no-results.visible { display: flex; }

.no-results svg {
  width: 44px;
  height: 44px;
  color: var(--text-muted);
  margin-bottom: 16px;
  opacity: 0.4;
}

.no-results h3 {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 600;
}

.no-results p {
  font-size: 0.84rem;
  color: var(--text-muted);
}

::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d5d5d5; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #bbb; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .right-panel { margin-left: 0; }
  .main-content { padding: 20px 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .header { padding: 16px; }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

.site-hero {
  background: linear-gradient(160deg, #daeef9 0%, #eaf4fb 60%, var(--bg-body) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
}

.site-hero-inner {
  width: 80%;
  margin: 0 auto;
  text-align: center;
}

.site-hero h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.site-hero__tagline {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.site-hero__body {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 0.4rem;
}

.site-hero__body:last-child {
  margin-bottom: 0;
  font-style: italic;
}
.site-about-footer {
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
}

.site-footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 72rem;
  margin: 0 auto;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-footer-links {
  display: flex;
  gap: 1.5rem;
}

.site-footer-meta a {
  color: var(--text-secondary);
  text-decoration: none;
}

.site-footer-meta a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .site-hero {
    padding: 2rem 1.25rem 1.75rem;
  }

  .site-footer-meta {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
}