/* ================================================================
   shared.css — Agent Skills Leaderboard · shared styles
================================================================ */

/* ── CSS Variables (dark default) ─────────────────────────────── */
:root {
  --bg:        #0d1117;
  --surface:   #161b22;
  --surface2:  #21262d;
  --surface3:  #2d333b;
  --border:    #30363d;
  --border2:   #444c56;
  --text:      #e6edf3;
  --text2:     #c9d1d9;
  --muted:     #8b949e;
  --accent:    #58a6ff;
  --accent-h:  #79c0ff;
  --gold:      #e3b341;
  --silver:    #adbac7;
  --bronze:    #c77834;
  --green:     #3fb950;
  --red:       #f85149;
  --radius:    10px;
  --radius-sm: 6px;
  --shadow:    0 8px 24px rgba(0,0,0,.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
  --nav-h:     54px;
  --transition: .18s ease;
}

[data-theme="light"] {
  --bg:        #f6f8fa;
  --surface:   #ffffff;
  --surface2:  #f0f2f5;
  --surface3:  #e8eaed;
  --border:    #d0d7de;
  --border2:   #b4bcc5;
  --text:      #1f2328;
  --text2:     #2c3036;
  --muted:     #656d76;
  --accent:    #0969da;
  --accent-h:  #0550ae;
  --gold:      #bf8700;
  --silver:    #57606a;
  --bronze:    #953800;
  --shadow:    0 4px 16px rgba(0,0,0,.12);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.1);
}

/* ── Page loader / skeleton ─────────────────────────────────────── */
#pageLoader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.35s ease;
}
#pageLoader.fade-out { opacity: 0; pointer-events: none; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0%   { background-position: -700px 0; }
  100% { background-position:  700px 0; }
}
.skel {
  background: linear-gradient(90deg,
    var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 700px 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 6px;
}
.skel-navbar {
  height: 54px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 12px;
}
.skel-navbar-logo { width: 160px; height: 18px; }
.skel-navbar-right { margin-left: auto; display: flex; gap: 8px; }
.skel-navbar-btn { width: 32px; height: 18px; }
.skel-hero {
  max-width: 700px;
  margin: 40px auto 28px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.skel-hero-title { width: 300px; height: 30px; }
.skel-hero-sub   { width: 200px; height: 14px; }
.skel-pills { display: flex; gap: 8px; }
.skel-pill  { width: 90px; height: 26px; border-radius: 20px; }
.skel-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}
.skel-card { height: 162px; border-radius: 12px; }

/* ── Clickable badges ───────────────────────────────────────────── */
.clickable { cursor: pointer; }
.clickable:hover { opacity: 0.75; }

/* ── Visit counter badge ────────────────────────────────────────── */
#visitBadge > a { display: none; }

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}
a { text-decoration: none; color: inherit; }
button, select, input { font: inherit; }

/* ── Navbar ─────────────────────────────────────────────────────── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  padding: 0 20px;
  backdrop-filter: blur(8px);
  overflow: visible;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  flex-shrink: 0;
  margin-right: 20px;
  white-space: nowrap;
}
.nav-brand img { width: 26px; height: 26px; border-radius: 6px; }
.nav-brand-text { color: var(--text); white-space: nowrap; }

.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: var(--surface2); color: var(--text); }
.nav-link.active { background: var(--surface2); color: var(--text); font-weight: 600; }

.nav-divider {
  display: inline-block;
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 6px;
  align-self: center;
  flex-shrink: 0;
}
.nav-friend {
  display: flex;
  align-items: center;
  gap: 5px;
}
.nav-friend img {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-btn {
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 12px;
  font-weight: 600;
  gap: 4px;
  padding: 5px 10px;
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-btn:hover { background: var(--surface3); border-color: var(--border2); color: var(--text); }
.nav-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="light"] .nav-btn.active { color: #fff; }
.nav-btn .fav-count {
  background: var(--red);
  border-radius: 9px;
  color: #fff;
  font-size: 10px;
  padding: 0 5px;
  display: none;
}
.nav-btn .fav-count.visible { display: inline-block; }

/* ── Hero ───────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, var(--bg) 0%, var(--surface) 60%, var(--surface2) 100%);
  border-bottom: 1px solid var(--border);
  padding: 28px 24px 22px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 100% at 50% -5%, rgba(88,166,255,.1), transparent);
  pointer-events: none;
}
[data-theme="light"] .hero::before {
  background: radial-gradient(ellipse 60% 100% at 50% -5%, rgba(9,105,218,.06), transparent);
}

.hero-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}
.hero-logo img { width: 48px; height: 48px; border-radius: 12px; }
.hero h1 {
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 800;
  letter-spacing: -.4px;
  background: linear-gradient(135deg, var(--text) 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
  position: relative;
}
.hero-meta {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  position: relative;
}
.meta-pill {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  font-size: 12px;
  padding: 3px 12px;
}
.meta-pill strong { color: var(--text); }

/* ── Container ──────────────────────────────────────────────────── */
.container { max-width: 1320px; margin: 0 auto; padding: 18px 16px 60px; }

/* ── MCP usage ──────────────────────────────────────────────────── */
.mcp-usage {
  background:
    linear-gradient(135deg, rgba(88,166,255,.18), rgba(63,185,80,.08) 48%, transparent),
    linear-gradient(180deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid rgba(88,166,255,.42);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.22), 0 0 0 1px rgba(88,166,255,.08) inset;
  margin-bottom: 14px;
  overflow: hidden;
  padding: 14px 16px;
  position: relative;
}
.mcp-usage::before {
  background: linear-gradient(180deg, var(--accent), var(--green));
  content: '';
  inset: 0 auto 0 0;
  position: absolute;
  width: 4px;
}
.mcp-usage-main {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(210px, .75fr) minmax(320px, 1.25fr) auto;
  min-width: 0;
}
.mcp-usage-copy { min-width: 0; }
.mcp-usage-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  margin-bottom: 3px;
  text-transform: uppercase;
}
.mcp-usage h2 {
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
  margin-bottom: 3px;
}
.mcp-usage p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.mcp-command {
  align-items: center;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(88,166,255,.38);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 8px;
  margin-top: 0;
  min-width: 0;
  padding: 9px 11px;
}
.mcp-command span {
  color: var(--accent-h);
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.mcp-command code {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, SFMono, Consolas, 'Liberation Mono', monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.mcp-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 0;
}
.mcp-link {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 8px 11px;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.mcp-link:hover {
  background: var(--surface3);
  border-color: var(--border2);
  color: var(--text);
}
.mcp-link-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.mcp-link-primary:hover {
  background: var(--accent-h);
  border-color: var(--accent-h);
  color: #fff;
}
.mcp-quick-examples {
  border-top: 1px solid rgba(88,166,255,.18);
  margin-top: 12px;
  padding-top: 10px;
  position: relative;
}
.mcp-quick-examples summary {
  color: var(--accent-h);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
  outline: none;
}
.mcp-quick-examples summary::-webkit-details-marker { display: none; }
.mcp-quick-examples summary::after {
  content: '›';
  font-size: 16px;
  line-height: 1;
  margin-left: 6px;
  transform: translateY(-1px);
  transition: transform .16s ease;
}
.mcp-quick-examples[open] summary::after {
  transform: translateY(-1px) rotate(90deg);
}
.mcp-quick-body {
  display: grid;
  gap: 9px;
  margin-top: 9px;
}
.mcp-example-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.mcp-example-grid div {
  background: rgba(0,0,0,.14);
  border: 1px solid rgba(139,148,158,.22);
  border-radius: var(--radius-sm);
  min-width: 0;
  padding: 8px 9px;
}
.mcp-example-grid span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 5px;
}
.mcp-example-grid code {
  color: var(--text);
  display: block;
  font-family: ui-monospace, SFMono-Regular, SFMono, Consolas, 'Liberation Mono', monospace;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.mcp-quick-doc {
  color: var(--accent-h);
  font-size: 12px;
  font-weight: 800;
  justify-self: start;
}

/* ── Tabs ───────────────────────────────────────────────────────── */
.tabs-wrap {
  position: relative;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.tabs {
  display: flex;
  gap: 3px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs-scroll-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 10px;
  width: 48px;
  border: none;
  background: linear-gradient(to right, transparent, var(--bg) 55%);
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 4px;
  transition: opacity 0.2s;
  pointer-events: auto;
}
.tabs-scroll-btn--left {
  right: auto;
  left: 0;
  background: linear-gradient(to left, transparent, var(--bg) 55%);
  justify-content: flex-start;
  padding-right: 0;
  padding-left: 4px;
}
.tabs-scroll-btn:hover { color: var(--text); }
.tabs-scroll-btn.hidden { opacity: 0; pointer-events: none; }

/* ── Brand spotlight ─────────────────────────────────────────────── */
.brand-spotlight {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 14px;
  animation: fadeIn .18s ease;
}
.bs-logo {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.bs-logo .brand-logo, .bs-logo svg, .bs-logo img {
  width: 40px !important; height: 40px !important;
  min-width: 40px;
  display: block;
  object-fit: contain;
}
.bs-body { flex: 1; min-width: 0; }
.bs-name { font-size: 14px; font-weight: 600; color: var(--text); }
.bs-count { font-weight: 400; color: var(--muted); font-size: 12px; }
.bs-desc { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.bs-links { display: flex; gap: 8px; flex-shrink: 0; }
.bs-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface2);
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.bs-link:hover { color: var(--text); border-color: var(--accent); }
.bs-primary {
  background: var(--accent);
  color: #fff !important;
  border-color: transparent !important;
}
.bs-primary:hover { opacity: .88; }
@media (max-width: 600px) {
  .brand-spotlight { flex-wrap: wrap; }
  .bs-links { width: 100%; }
}
.tab {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 13px;
  gap: 5px;
  padding: 5px 11px;
  transition: all var(--transition);
}
.tab:hover { background: var(--surface2); color: var(--text); }
.tab.active { background: var(--surface2); border-color: var(--border); color: var(--text); font-weight: 600; }
.tab .cnt { background: var(--surface3); border-radius: 9px; font-size: 11px; padding: 1px 6px; }
.tab.active .cnt { background: var(--accent); color: #fff; }
[data-theme="light"] .tab.active .cnt { color: #fff; }

.tab[data-id=claude].active  { border-color:#f97316; }
.tab[data-id=claude].active .cnt  { background:#f97316; }
.tab[data-id=codex].active   { border-color:#10b981; }
.tab[data-id=codex].active .cnt   { background:#10b981; }
.tab[data-id=cursor].active  { border-color:#a78bfa; }
.tab[data-id=cursor].active .cnt  { background:#a78bfa; }
.tab[data-id=copilot].active { border-color:#22d3ee; }
.tab[data-id=copilot].active .cnt { background:#22d3ee; color:#0d1117; }
.tab[data-id=gemini].active  { border-color:#4285F4; }
.tab[data-id=gemini].active .cnt  { background:#4285F4; }
.tab[data-id=deepseek].active { border-color:#4D6BFE; }
.tab[data-id=deepseek].active .cnt { background:#4D6BFE; }
.tab[data-id=openclaw].active { border-color:#f43f5e; }
.tab[data-id=openclaw].active .cnt { background:#f43f5e; }
.tab[data-id=hermes].active   { border-color:#7C3AED; }
.tab[data-id=hermes].active .cnt   { background:#7C3AED; }
.tab[data-id=other].active   { border-color:#f59e0b; }
.tab[data-id=other].active .cnt   { background:#f59e0b; color:#0d1117; }

/* ── Brand logos ────────────────────────────────────────────────── */
.nav-icon { display: block; flex-shrink: 0; line-height: 0; }

.brand-logo {
  width: 12px !important;
  height: 12px !important;
  min-width: 12px;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
}
[data-theme="dark"] .brand-logo--dark-invert { filter: brightness(0) invert(1); }
.brand-logo--dark-invert { fill: #111; }

/* ── Filter Bar ─────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}
.filter-bar input[type=search] {
  flex: 1;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  padding: 8px 12px;
  transition: border-color var(--transition);
}
.filter-bar input[type=search]:focus { border-color: var(--accent); }
.filter-bar input[type=search]::placeholder { color: var(--muted); }
.filter-bar select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 12px;
  outline: none;
  padding: 6px 8px;
  cursor: pointer;
  transition: border-color var(--transition);
}
.filter-bar select:focus { border-color: var(--accent); }

.preset-group {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.preset-btn {
  background: var(--surface);
  border: none;
  border-right: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 8px 10px;
  transition: all var(--transition);
  white-space: nowrap;
}
.preset-btn:last-child { border-right: none; }
.preset-btn:hover { background: var(--surface2); color: var(--text); }
.preset-btn.active { background: var(--surface3); color: var(--text); font-weight: 600; }

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.view-btn {
  background: var(--surface);
  border: none;
  border-right: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 8px 11px;
  transition: all var(--transition);
}
.view-btn:last-child { border-right: none; }
.view-btn:hover { background: var(--surface2); color: var(--text); }
.view-btn.active { background: var(--surface3); color: var(--text); }

/* ── Active Filters ─────────────────────────────────────────────── */
.active-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 12px;
}
.active-filters.hidden { display: none; }
.af-label { color: var(--muted); }
.af-chip {
  background: rgba(88,166,255,.12);
  border: 1px solid rgba(88,166,255,.3);
  border-radius: 5px;
  color: var(--accent);
  cursor: pointer;
  padding: 2px 8px;
  transition: all var(--transition);
}
.af-chip:hover { background: rgba(88,166,255,.2); }
.af-chip::after { content: ' ×'; opacity: .6; }
.af-clear {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  text-decoration: underline;
  transition: color var(--transition);
}
.af-clear:hover { color: var(--text); }

/* ── Use Case Chips ─────────────────────────────────────────────── */
.uc-scroller-wrap {
  position: relative;
  margin-bottom: 12px;
}
.uc-scroller {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.uc-scroller::-webkit-scrollbar { display: none; }
.uc-scroll-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 8px;
  width: 48px;
  border: none;
  background: linear-gradient(to right, transparent, var(--bg) 55%);
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 4px;
  transition: opacity 0.2s;
  pointer-events: auto;
}
.uc-scroll-btn--left {
  right: auto;
  left: 0;
  background: linear-gradient(to left, transparent, var(--bg) 55%);
  justify-content: flex-start;
  padding-right: 0;
  padding-left: 4px;
}
.uc-scroll-btn:hover { color: var(--text); }
.uc-scroll-btn.hidden { opacity: 0; pointer-events: none; }
.uc-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 12px;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.uc-chip:hover { background: var(--surface3); color: var(--text); border-color: var(--border2); }
.uc-chip.active {
  background: rgba(88,166,255,.15);
  border-color: rgba(88,166,255,.4);
  color: var(--accent);
  font-weight: 600;
}
.uc-chip .uc-cnt { font-size: 10px; opacity: .7; margin-left: 3px; }

/* ── Grid ───────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 750px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .grid { grid-template-columns: 1fr; } }

/* ── Card ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  padding: 14px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card.rank-1 { border-color: rgba(227,179,65,.35); }
.card.rank-1::before {
  content:''; position:absolute; inset:0;
  background: linear-gradient(135deg, rgba(227,179,65,.07), transparent 55%);
  pointer-events: none;
}
.card.rank-2 { border-color: rgba(173,186,199,.28); }
.card.rank-3 { border-color: rgba(199,120,52,.28); }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 6px;
}
.rank-badge {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}
.rank-1 .rank-badge { background: rgba(227,179,65,.2); color: var(--gold); }
.rank-2 .rank-badge { background: rgba(173,186,199,.15); color: var(--silver); }
.rank-3 .rank-badge { background: rgba(199,120,52,.15); color: var(--bronze); }

.card-actions { display: flex; gap: 5px; align-items: center; }

.star-box {
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.fav-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 3px;
  transition: color var(--transition), transform .1s;
  flex-shrink: 0;
}
.fav-btn:hover  { color: var(--red); transform: scale(1.2); }
.fav-btn.saved  { color: var(--red); }

.card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 5px;
}
.card-name .owner { color: var(--muted); font-weight: 400; }
.card-desc {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin-bottom: 10px;
}
.card-footer { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.card-ucs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 7px;
}
.uc-tag {
  background: rgba(88,166,255,.1);
  border: 1px solid rgba(88,166,255,.2);
  border-radius: 4px;
  color: var(--accent);
  font-size: 10px;
  padding: 1px 6px;
  cursor: pointer;
  transition: background var(--transition);
}
.uc-tag:hover { background: rgba(88,166,255,.2); }
.uc-tag.active { background: rgba(88,166,255,.25); font-weight: 600; }
.card-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 4px;
  font-size: 10px;
  padding: 2px 6px;
}
.lang-badge { background: var(--surface2); border: 1px solid var(--border); color: var(--muted); }
.cat-badge { font-weight: 600; }
.agent-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  flex-shrink: 0;
  vertical-align: middle;
}
.agent-tag .brand-logo {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
}
.cat-badge.claude  { background:rgba(249,115,22,.15); color:#fb923c; border:1px solid rgba(249,115,22,.3); }
.cat-badge.codex   { background:rgba(16,185,129,.15); color:#34d399; border:1px solid rgba(16,185,129,.3); }
.cat-badge.cursor  { background:rgba(167,139,250,.15);color:#c4b5fd; border:1px solid rgba(167,139,250,.3); }
.cat-badge.copilot  { background:rgba(34,211,238,.15); color:#67e8f9; border:1px solid rgba(34,211,238,.3); }
.cat-badge.gemini   { background:rgba(66,133,244,.15); color:#8ab4f8; border:1px solid rgba(66,133,244,.3); }
.cat-badge.deepseek { background:rgba(77,107,254,.15); color:#818cf8; border:1px solid rgba(77,107,254,.3); }
.cat-badge.openclaw { background:rgba(239,68,68,.15);  color:#f87171; border:1px solid rgba(239,68,68,.3); }
.cat-badge.hermes   { background:rgba(124,58,237,.15); color:#a78bfa; border:1px solid rgba(124,58,237,.3); }
.cat-badge.other    { background:rgba(245,158,11,.15); color:#fbbf24; border:1px solid rgba(245,158,11,.3); }
.cat-badge.deep_research  { background:rgba(249,115,22,.15); color:#fb923c; border:1px solid rgba(249,115,22,.3); }
.cat-badge.web_research   { background:rgba(16,185,129,.15); color:#34d399; border:1px solid rgba(16,185,129,.3); }
.cat-badge.literature     { background:rgba(167,139,250,.15);color:#c4b5fd; border:1px solid rgba(167,139,250,.3); }
.cat-badge.data_research  { background:rgba(34,211,238,.15); color:#67e8f9; border:1px solid rgba(34,211,238,.3); }
.cat-badge.knowledge_base { background:rgba(245,158,11,.15); color:#fbbf24; border:1px solid rgba(245,158,11,.3); }
.cat-badge.general        { background:rgba(139,148,158,.15);color:#8b949e; border:1px solid rgba(139,148,158,.3); }
/* MCP */
.cat-badge.official      { background:rgba(249,115,22,.15);  color:#fb923c; border:1px solid rgba(249,115,22,.3); }
.cat-badge.database      { background:rgba(16,185,129,.15);  color:#34d399; border:1px solid rgba(16,185,129,.3); }
.cat-badge.filesystem    { background:rgba(167,139,250,.15); color:#c4b5fd; border:1px solid rgba(167,139,250,.3); }
.cat-badge.web           { background:rgba(34,211,238,.15);  color:#67e8f9; border:1px solid rgba(34,211,238,.3); }
.cat-badge.dev_tools     { background:rgba(245,158,11,.15);  color:#fbbf24; border:1px solid rgba(245,158,11,.3); }
.cat-badge.productivity  { background:rgba(139,148,158,.15); color:#8b949e; border:1px solid rgba(139,148,158,.3); }
/* Frameworks */
.cat-badge.orchestration { background:rgba(249,115,22,.15);  color:#fb923c; border:1px solid rgba(249,115,22,.3); }
.cat-badge.multi_agent   { background:rgba(16,185,129,.15);  color:#34d399; border:1px solid rgba(16,185,129,.3); }
.cat-badge.memory        { background:rgba(167,139,250,.15); color:#c4b5fd; border:1px solid rgba(167,139,250,.3); }
.cat-badge.tools         { background:rgba(34,211,238,.15);  color:#67e8f9; border:1px solid rgba(34,211,238,.3); }
.cat-badge.evaluation    { background:rgba(245,158,11,.15);  color:#fbbf24; border:1px solid rgba(245,158,11,.3); }
/* Prompts */
.cat-badge.collection    { background:rgba(249,115,22,.15);  color:#fb923c; border:1px solid rgba(249,115,22,.3); }
.cat-badge.system        { background:rgba(16,185,129,.15);  color:#34d399; border:1px solid rgba(16,185,129,.3); }
.cat-badge.engineering   { background:rgba(167,139,250,.15); color:#c4b5fd; border:1px solid rgba(167,139,250,.3); }
.cat-badge.coding        { background:rgba(34,211,238,.15);  color:#67e8f9; border:1px solid rgba(34,211,238,.3); }
.cat-badge.writing       { background:rgba(245,158,11,.15);  color:#fbbf24; border:1px solid rgba(245,158,11,.3); }

.fork-info { font-size: 10px; color: var(--muted); margin-left: auto; display: inline-flex; align-items: center; gap: 3px; }

/* ── List View ──────────────────────────────────────────────────── */
.list-view { margin-bottom: 20px; }
.list-view .grid { display: none; }

.list-table {
  width: 100%;
  border-collapse: collapse;
  display: none;
}
.list-view .list-table { display: table; }
.list-view .grid { display: none; }

.lt-head th {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 8px 10px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}
.lt-head th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.lt-head th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

.lt-row {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.lt-row:hover { background: var(--surface2); }
.lt-row td {
  padding: 10px;
  vertical-align: middle;
  font-size: 13px;
}
.lt-rank { color: var(--muted); font-weight: 700; font-size: 12px; width: 40px; }
.lt-rank-1 { color: var(--gold); }
.lt-rank-2 { color: var(--silver); }
.lt-rank-3 { color: var(--bronze); }
.lt-name { min-width: 0; }
.lt-name a { color: var(--accent); font-weight: 600; }
.lt-name a:hover { text-decoration: underline; }
.lt-name .owner { color: var(--muted); font-weight: 400; }
.lt-name .desc {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 360px;
}
.lt-stars { color: var(--gold); font-weight: 700; white-space: nowrap; }
.lt-ucs { max-width: 220px; }
.lt-ucs .uc-tag { display: inline-block; margin: 2px; }
.lt-cat { display: flex; flex-wrap: wrap; gap: 4px; }
.lt-lang { color: var(--muted); font-size: 12px; }
.lt-updated { color: var(--muted); font-size: 11px; white-space: nowrap; }
.lt-fav { width: 32px; text-align: center; }

/* ── Empty / Loading ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  grid-column: 1 / -1;
}
.empty-state .icon { font-size: 36px; display: block; margin-bottom: 10px; }
.empty-state p { font-size: 13px; margin-top: 6px; }

/* ── Pagination ─────────────────────────────────────────────────── */
.visit-badge {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 16px;
  min-height: 20px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.pg-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  min-width: 34px;
  padding: 6px 10px;
  text-align: center;
  transition: all var(--transition);
}
.pg-btn:hover:not(:disabled) { background: var(--surface2); color: var(--text); border-color: var(--accent); }
.pg-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pg-btn:disabled { opacity: .3; cursor: not-allowed; }
.pg-ellipsis { color: var(--muted); padding: 6px 2px; font-size: 13px; }
.pg-info { font-size: 12px; color: var(--muted); margin: 0 8px; }

/* ── Footer ─────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  padding: 16px;
  text-align: center;
}
.footer a { color: var(--accent); }
.footer a:hover { text-decoration: underline; }

/* ── No-data warning ────────────────────────────────────────────── */
.no-data {
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: var(--radius);
  color: #fbbf24;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 16px;
  padding: 12px 16px;
}
.no-data code { background: rgba(0,0,0,.2); padding: 1px 5px; border-radius: 4px; }

/* ── Hamburger (hidden on desktop) ─────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  margin-left: auto;
  width: 32px;
  height: 36px;
}
.nav-hamburger span {
  display: block;
  height: 2px;
  width: 20px;
  background: var(--muted);
  border-radius: 2px;
  transition: all 0.25s ease;
}
.navbar.nav-open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar.nav-open .nav-hamburger span:nth-child(2) { opacity: 0; }
.navbar.nav-open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — laptop ≤1024px
══════════════════════════════════════════════════════════════════ */
/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — tablet ≤1024px  (hamburger nav kicks in here)
══════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  /* Navbar: collapse to hamburger */
  .navbar {
    padding: 0 14px;
    flex-wrap: nowrap;
    align-items: center;
    height: var(--nav-h);
    overflow: visible;
  }
  .nav-brand { margin-right: 0; flex-shrink: 0; }
  .nav-friend { display: none; }
  .nav-divider { display: none; }

  /* Show hamburger */
  .nav-hamburger { display: flex !important; margin-left: 8px; flex-shrink: 0; }

  /* Push actions to the right */
  .nav-actions { margin-left: auto; gap: 4px; }
  .nav-btn { padding: 5px 8px; font-size: 11px; }

  /* Nav links: dropdown overlay */
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 8px 12px 12px;
    gap: 2px;
    z-index: 99;
    box-shadow: var(--shadow);
  }
  .navbar.nav-open .nav-links { display: flex; }
  .nav-link { padding: 10px 14px; font-size: 14px; border-radius: 8px; width: 100%; }
  .nav-link .full { display: inline; }

  /* Filter bar: search takes own row, preset group scrolls */
  .filter-bar { gap: 6px; flex-wrap: wrap; }
  .filter-bar input[type=search] { min-width: 0; flex: 1 1 100%; order: -1; }
  .filter-bar select { flex: 1; min-width: 0; }
  .preset-group { overflow-x: auto; flex-shrink: 0; scrollbar-width: none; }
  .preset-group::-webkit-scrollbar { display: none; }
  .view-toggle { flex-shrink: 0; }

  /* Hero */
  .hero { padding: 22px 18px 18px; }
  .hero-logo img { width: 40px; height: 40px; }

  .mcp-usage {
    padding: 14px;
  }
  .mcp-usage-main {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .mcp-links {
    justify-content: flex-start;
  }
  .mcp-example-grid {
    grid-template-columns: 1fr;
  }

  .tab { flex-shrink: 0; }

  /* UC chips: slightly larger touch target */
  .uc-chip { padding: 5px 11px; font-size: 12px; }
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — phone ≤480px
══════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  /* Navbar: tighter padding, hide brand text */
  .navbar { padding: 0 12px; }
  .nav-brand { margin-right: 0; }
  .nav-brand-text { display: none; }
  .nav-btn { padding: 5px 7px; font-size: 11px; }

  /* Hide text labels on action buttons, keep icons */
  .nav-btn .full { display: none; }

  /* Hero */
  .hero { padding: 18px 14px 16px; }
  .hero-logo img { width: 36px; height: 36px; }
  .hero h1 { font-size: 18px; }
  .hero-sub { font-size: 12px; }
  .hero-meta { gap: 5px; }
  .meta-pill { font-size: 11px; padding: 2px 9px; }

  /* Container */
  .container { padding: 12px 10px 48px; }

  .mcp-usage { padding: 14px; }
  .mcp-usage h2 { font-size: 17px; }
  .mcp-command {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .mcp-links { display: grid; grid-template-columns: 1fr 1fr; }
  .mcp-link { text-align: center; }

  /* Filter bar: full-width elements, preset groups scroll */
  .filter-bar { gap: 5px; }
  .filter-bar input[type=search] { flex: 1 1 100%; order: -1; }
  .filter-bar select { flex: 1; min-width: 0; }
  .preset-group { overflow-x: auto; flex-shrink: 0; scrollbar-width: none; }
  .preset-group::-webkit-scrollbar { display: none; }
  .preset-btn { padding: 8px 8px; font-size: 11px; }
  .view-toggle { flex-shrink: 0; }

  /* Cards */
  .card { padding: 11px 12px; }
  .card-name { font-size: 13px; }
  .card-desc { font-size: 12px; -webkit-line-clamp: 2; }
  .card-footer { flex-direction: column; gap: 6px; align-items: flex-start; }
  .card-meta { flex-wrap: wrap; gap: 4px; }
  .fork-info { flex-basis: 100%; justify-content: flex-end; margin-left: 0; }

  /* List view: horizontal scroll */
  .list-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .lt-ucs { display: none; }
  .lt-lang { display: none; }
  .lt-name .desc { max-width: 200px; }

  /* Pagination */
  .pg-btn { min-width: 30px; padding: 5px 7px; font-size: 12px; }
  .pg-info { display: none; }

  /* Footer */
  .footer { font-size: 11px; padding: 12px; }

  /* UC chips */
  .uc-scroller { gap: 5px; }
  .uc-chip { padding: 5px 10px; font-size: 12px; }

  /* Active filters */
  .af-chip { font-size: 11px; padding: 3px 8px; }

  /* Skeleton: fewer cards on mobile */
  .skel-grid { grid-template-columns: 1fr; padding: 0 10px; }
  .skel-hero-title { width: 220px; }
  .skel-pills { flex-wrap: wrap; justify-content: center; }
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — small phone ≤360px
══════════════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  .nav-btn { padding: 4px 6px; font-size: 10px; }
  .hero h1 { font-size: 16px; }
  .hero { padding: 14px 10px 12px; }
  .container { padding: 10px 8px 40px; }
  .tab { padding: 4px 8px; font-size: 12px; }
  .preset-btn { padding: 6px 6px; font-size: 10px; }
  .card { padding: 10px 10px; }
  .card-name { font-size: 12px; }
  .meta-pill { font-size: 10px; padding: 2px 7px; }
}

/* ── Favorites modal ──────────────────────────────────────────────── */
.fav-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 16px 32px;
  overflow-y: auto;
}
.fav-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 1100px;
  padding: 24px;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
}
.fav-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.fav-modal-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  line-height: 1.4;
}
.fav-modal-close:hover { background: var(--surface2); color: var(--text); }
.fav-modal-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.fav-modal-tab {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
}
.fav-modal-tab:hover { color: var(--text); border-color: var(--accent); }
.fav-modal-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.fav-modal-tab .cnt { font-size: 11px; opacity: .85; }
.fav-modal-section.hidden { display: none; }
.fav-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
