:root {
  --bg: #ffffff;
  --bg-card: #f8f9fa;
  --text: #1a1a2e;
  --text-muted: #6c757d;
  --accent: #4361ee;
  --accent-hover: #3a56d4;
  --border: #dee2e6;
  --badge-bg: #e9ecef;
  --badge-text: #495057;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  --bg: #1a1a2e;
  --bg-card: #16213e;
  --text: #e4e4e7;
  --text-muted: #9ca3af;
  --accent: #6d8dfc;
  --accent-hover: #5a7af0;
  --border: #2d3748;
  --badge-bg: #2d3748;
  --badge-text: #cbd5e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  position: relative;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
}

.subtitle {
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-size: 1rem;
}

#theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

#theme-toggle:hover {
  background: var(--accent);
  color: #fff;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

.controls {
  margin-bottom: 1.5rem;
}

#search {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

#search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.categories {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.cat-btn {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s;
}

.cat-btn:hover,
.cat-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

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

.plugin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.plugin-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.plugin-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.plugin-card .version {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.plugin-card .description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.plugin-card .meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.plugin-card .keywords {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.keyword {
  padding: 0.15rem 0.5rem;
  background: var(--badge-bg);
  color: var(--badge-text);
  border-radius: 4px;
  font-size: 0.72rem;
}

.skill-list {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0.6rem;
}

.skill-list li {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.15rem 0;
}

.skill-list li::before {
  content: "skill: ";
  color: var(--accent);
  font-weight: 600;
}

.no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
  font-size: 1.1rem;
}

@media (max-width: 600px) {
  header h1 {
    font-size: 1.5rem;
  }
  .plugin-grid {
    grid-template-columns: 1fr;
  }
}
