/* style.css — Codex Skills Hub 暗色主题 */

:root {
  --bg: #f3efe7;
  --bg-elevated: rgba(255, 252, 246, 0.9);
  --card: #fffdf8;
  --card-hover: #ffffff;
  --border: rgba(57, 35, 10, 0.11);
  --border-hover: rgba(57, 35, 10, 0.2);

  --text: #1e1a14;
  --text-2: #665f55;
  --text-3: #948b80;
  --heading: #17120d;
  --muted: #7c7267;
  --tag-bg: rgba(104, 85, 61, 0.08);

  --accent: #d96c3d;
  --accent-glow: rgba(217, 108, 61, 0.18);
  --accent-2: #e2a72a;

  --green: #10b981;
  --yellow: #f59e0b;
  --pink: #ec4899;
  --red: #ef4444;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 30px rgba(75, 48, 20, 0.08);
  --shadow-hover: 0 18px 40px rgba(75, 48, 20, 0.14);
}

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

html, body {
  background:
    radial-gradient(circle at top left, rgba(226, 167, 42, 0.16), transparent 26%),
    radial-gradient(circle at top right, rgba(217, 108, 61, 0.14), transparent 22%),
    linear-gradient(180deg, #f8f3ea 0%, #f3efe7 100%);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 150ms;
}
a:hover { color: #a5b4fc; }

::selection {
  background: var(--accent-glow);
  color: var(--text);
}

.skip-link,
.visually-hidden {
  position: absolute;
}

.skip-link {
  left: 16px;
  top: -40px;
  z-index: 200;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

.visually-hidden {
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Header ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(248, 243, 234, 0.84);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-name {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--heading);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-lockup {
  line-height: 1;
}

.brand-logo {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(217, 108, 61, 0.1);
  border: 1px solid rgba(217, 108, 61, 0.18);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

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

.main-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text-2);
  font-size: 12px;
  box-shadow: var(--shadow);
}

.stat-pill strong {
  color: var(--heading);
  font-size: 13px;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 40px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--heading);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 14px;
  font-family: inherit;
  box-shadow: var(--shadow);
  transition: all 0.18s ease;
}

.lang-switcher:hover,
.github-link:hover {
  transform: translateY(-1px);
  border-color: var(--border-hover);
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--heading);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: all 0.18s ease;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 24px 72px;
}

.container-tight {
  padding-top: 18px;
}

.hero {
  padding: 22px 28px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(226, 167, 42, 0.14), transparent 26%),
    linear-gradient(135deg, rgba(255,255,255,0.82), rgba(255,249,241,0.95));
  box-shadow: var(--shadow);
}

.hero-content {
  max-width: 680px;
  display: grid;
  gap: 10px;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-copy {
  display: grid;
  gap: 6px;
  padding-top: 0;
}

.hero h1 {
  color: var(--heading);
}

.hero-title {
  margin: 0;
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.hero-logo {
  width: clamp(40px, 4.8vw, 56px);
  height: clamp(40px, 4.8vw, 56px);
  object-fit: contain;
  flex-shrink: 0;
  margin-top: 0;
}

.hero-title-stats .hero-logo {
  width: clamp(48px, 6vw, 72px);
  height: clamp(48px, 6vw, 72px);
}

.hero-sub {
  font-size: 14px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-desc {
  max-width: 560px;
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.55;
}

.directory-menu {
  margin-bottom: 20px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,250,244,0.96)),
    var(--bg-elevated);
  box-shadow: var(--shadow);
}

.directory-menu-header h2 {
  font-size: 24px;
  color: var(--heading);
}

.directory-menu-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.directory-menu-header p {
  font-size: 14px;
  color: var(--text-2);
}

.directory-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.directory-agent-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.directory-agent-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.directory-agent-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--heading);
}

.directory-agent-count {
  font-size: 11px;
  color: var(--text-2);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--tag-bg);
}

.directory-group-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.directory-group-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-2);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.directory-group-chip:hover {
  color: var(--text);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.directory-group-chip.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ===== Controls ===== */
.content-shell {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.content-main {
  min-width: 0;
}

.controls {
  position: sticky;
  top: 92px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.search-wrap {
  position: relative;
  margin-bottom: 16px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 18px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 58px;
  padding: 0 48px 0 48px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: all 180ms;
}

.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input::placeholder {
  color: var(--text-3);
}

.search-clear {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  display: none;
  border-radius: 4px;
}

.search-clear:hover { color: var(--text); }
.search-clear.visible { display: block; }

/* ===== Category Tabs ===== */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  background: rgba(120, 93, 56, 0.05);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: visible;
}

.tab,
.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 14px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 180ms;
}

.tab:hover,
.cat-tab:hover {
  color: var(--text);
  background: rgba(255,255,255,0.7);
}

.tab.active,
.cat-tab.active {
  background: linear-gradient(135deg, var(--accent), #c85728);
  color: white;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.tab-icon {
  font-size: 14px;
  line-height: 1;
}

/* Sub-group tabs (Figma/GitHub/Notion etc) */
.subgroup-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.subgroup-tab,
.sub-tab {
  padding: 6px 12px;
  background: rgba(255,255,255,0.78);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 150ms;
}

.subgroup-tab:hover,
.sub-tab:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.subgroup-tab.active,
.sub-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.category-desc {
  font-size: 13px;
  color: var(--text-2);
  padding: 12px 14px;
  background: rgba(255, 248, 239, 0.92);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  margin-top: 10px;
}

/* ===== Results Grid ===== */
.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.results-section {
  margin-top: 0;
}

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

.skill-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,251,245,0.96));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 200ms;
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--accent));
  opacity: 0.7;
}

.skill-card:hover {
  background: var(--card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(217, 108, 61, 0.12), rgba(226, 167, 42, 0.18));
  border: 1px solid rgba(57, 35, 10, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.agent-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  flex-shrink: 0;
}

.agent-mark-xs {
  width: 16px;
  height: 16px;
}

.agent-mark-sm {
  width: 20px;
  height: 20px;
}

.agent-mark-inline {
  width: 14px;
  height: 14px;
}

.agent-mark-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
}

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

.card-emoji {
  font-size: 24px;
  line-height: 1;
}

.card-title-wrap {
  flex: 1;
  min-width: 0;
}

.card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 4px;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 14px;
}

.card-repo {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.card-repo a {
  color: var(--text-2);
}

.card-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  background: rgba(226, 167, 42, 0.12);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-2);
  font-weight: 500;
}

.card-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-install {
  background: rgba(246, 240, 232, 0.92);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--text-2);
}

.card-install code {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  background: rgba(217, 108, 61, 0.1);
  border: 1px solid rgba(217, 108, 61, 0.2);
  color: var(--accent);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  transition: all 150ms;
  flex-shrink: 0;
}

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

.copy-btn.copied {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}

.card-link {
  font-size: 12px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-link:hover { text-decoration: underline; }

.card-link-muted {
  color: var(--text-3);
  pointer-events: none;
}

.card-group {
  font-size: 11px;
  color: var(--text-2);
  padding: 2px 8px;
  background: var(--tag-bg);
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.source-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
  font-size: 16px;
}

/* ===== About ===== */
.about {
  margin-top: 44px;
  padding: 26px;
  background: rgba(255, 252, 246, 0.9);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.about h2 {
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--text);
}

.about p {
  color: var(--text-2);
  margin-bottom: 8px;
  font-size: 14px;
}

/* ===== Footer ===== */
/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
  }

  .header-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .container { padding: 20px 16px 60px; }

  .content-shell {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .hero {
    padding: 18px 18px;
    border-radius: 22px;
  }

  .hero-brand {
    gap: 12px;
  }

  .hero-title {
    font-size: 34px;
  }

  .hero-logo {
    width: 40px;
    height: 40px;
  }

  .hero-desc {
    font-size: 14px;
  }

  .controls {
    position: static;
    top: auto;
  }

  .search-input { height: 48px; font-size: 14px; }

  .results {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .category-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    font-size: 12px;
  }
  .tab { padding: 6px 10px; font-size: 12px; }

  .category-desc { font-size: 12px; padding: 8px 12px; }
  .directory-menu {
    padding: 16px;
  }
  .main-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .stats {
    width: 100%;
  }
}

/* ===== Results Toolbar (sort + count) ===== */
.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  margin-bottom: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(57, 35, 10, 0.08);
}

.results-count {
  font-size: 14px;
  color: var(--text-2);
  font-weight: 600;
}

.sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-label {
  font-size: 13px;
  color: var(--text-3);
}

.sort-select {
  appearance: none;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 6px 28px 6px 10px;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a1a1aa'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 150ms;
}

.sort-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  padding: 8px 0 0;
}

.page-btn {
  appearance: none;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 150ms;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--card-hover);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-info {
  font-size: 14px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  min-width: 60px;
  text-align: center;
}

/* ===== Stats Section ===== */
.stats-section {
  margin-top: 64px;
  padding: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stats-section h2 {
  font-size: 20px;
  margin-bottom: 24px;
  color: var(--text);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.stats-chart-wrap h3,
.stats-bars-wrap h3 {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 16px;
  font-weight: 500;
}

.stats-chart-wrap canvas {
  width: 100%;
  max-width: 400px;
  height: auto;
}

.bar-item {
  margin-bottom: 12px;
}

.bar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
}

.bar-rank {
  color: var(--text-3);
  font-weight: 600;
  min-width: 20px;
}

.bar-repo {
  color: var(--text-2);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.bar-repo:hover { color: var(--accent); }

.bar-count {
  color: var(--text-3);
  font-size: 11px;
  margin-left: auto;
  white-space: nowrap;
}

.bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 3px;
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  background: rgba(255, 250, 243, 0.85);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo {
  font-size: 28px;
}

.footer-brand strong {
  font-size: 16px;
  color: var(--heading);
}

.footer-desc {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-2);
  font-size: 13px;
  transition: color 150ms;
}

.footer-links a:hover { color: var(--text); }

.footer-meta {
  width: 100%;
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
}

/* ===== Responsive additions ===== */
@media (max-width: 768px) {
  .results-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }

  .bar-repo { max-width: 140px; }

  .pagination { gap: 8px; }
  .page-btn { padding: 6px 12px; font-size: 12px; }
}

/* ==========================================
   分组视图样式 (Agent → Type)
   ========================================== */

.results-grouped {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Agent 区域 */
.agent-section {
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.76);
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.agent-section:hover {
  border-color: var(--agent-color, var(--accent));
  box-shadow: var(--shadow-hover);
}

.agent-section.collapsed .agent-content {
  display: none;
}

.agent-section.collapsed .agent-toggle {
  transform: rotate(-90deg);
}

/* Agent 头部 */
.agent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--agent-color, var(--accent)) 12%, white), rgba(255,255,255,0.1));
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.agent-header:hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--agent-color, var(--accent)) 18%, white), rgba(255,255,255,0.1));
}

.agent-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-icon {
  font-size: 20px;
}

.agent-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--heading);
  margin: 0;
}

.agent-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--tag-bg);
  padding: 2px 8px;
  border-radius: 10px;
}

.agent-toggle {
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.2s;
}

/* Agent 内容 */
.agent-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 类型分组 */
.type-group {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.82);
}

.type-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--tag-bg);
  border-bottom: 1px solid var(--border);
}

.type-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--heading);
  margin: 0;
}

.type-count {
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.type-group .card-grid {
  padding: 12px;
  gap: 12px;
}

/* 工具栏布局 */
.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.group-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  font-size: 16px;
  color: var(--heading);
  font-family: inherit;
  transition: all 0.2s;
}

.view-toggle:hover {
  background: var(--card-hover);
  border-color: var(--border-hover);
}

.view-toggle:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

@media (min-width: 769px) {
  .results-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-controls {
    width: 100%;
    justify-content: space-between;
  }

  .sort-wrap {
    flex: 1;
    min-width: 0;
  }

  .sort-select {
    width: 100%;
    min-width: 0;
  }

  .pagination {
    justify-content: flex-start;
  }
}

/* 统计表格样式 */
.stats-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.stats-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-label {
  min-width: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-label.link {
  color: var(--accent);
  text-decoration: none;
}

.stats-label.link:hover {
  text-decoration: underline;
}

.stats-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--tag-bg);
  border-radius: 4px;
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 0.6s ease;
}

.stats-count {
  min-width: 60px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stats-summary-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  padding: 16px;
}

.stats-summary-label {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 6px;
}

.stats-summary-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}

.stats-agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.stats-agent-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  padding: 16px;
}

.stats-agent-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
}

.stats-agent-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-agent-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-2);
}

/* 响应式 */
@media (max-width: 600px) {
  .agent-header {
    padding: 12px 14px;
  }

  .agent-title {
    font-size: 14px;
  }

  .agent-content {
    padding: 10px;
    gap: 12px;
  }

  .type-header {
    padding: 8px 12px;
  }

  .results-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-controls {
    justify-content: space-between;
  }

  .stats-label {
    min-width: 70px;
    font-size: 11px;
  }

  .stats-count {
    min-width: 40px;
    font-size: 11px;
  }
}

/* category-first overrides */
.category-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.cat-tab {
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.cat-tab-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  word-break: break-word;
}

.cat-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(104, 85, 61, 0.08);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.cat-tab.active .cat-tab-count {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

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

.filter-inline-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-2);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.filter-inline-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.agent-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-filter-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--agent-chip, #6b7280) 24%, white);
  background: color-mix(in srgb, var(--agent-chip, #6b7280) 10%, white);
  color: color-mix(in srgb, var(--agent-chip, #6b7280) 88%, black);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.agent-filter-chip:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--agent-chip, #6b7280) 55%, white);
}

.agent-filter-chip.active {
  background: var(--agent-chip, var(--accent));
  color: #fff;
  border-color: var(--agent-chip, var(--accent));
}

.agent-filter-chip.active .agent-mark {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.type-group {
  display: grid;
  gap: 14px;
}

.type-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
}

.type-title {
  font-size: 16px;
  color: var(--heading);
}

.type-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 768px) {
  .content-shell {
    grid-template-columns: 1fr;
  }

  .controls {
    position: static;
  }

  .category-tabs {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 768px) {
  .container-tight {
    padding-top: 14px;
  }
}

/* ===== UI Refresh: tool-style layout ===== */
:root {
  --bg: #f5f7fb;
  --bg-elevated: rgba(255, 255, 255, 0.94);
  --card: #ffffff;
  --card-hover: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(15, 23, 42, 0.14);
  --text: #172033;
  --text-2: #4e5c73;
  --text-3: #7a879b;
  --heading: #111827;
  --muted: #8a94a6;
  --tag-bg: rgba(148, 163, 184, 0.14);
  --accent: #e56a2e;
  --accent-glow: rgba(229, 106, 46, 0.16);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 16px 36px rgba(15, 23, 42, 0.1);
}

html,
body {
  background:
    radial-gradient(circle at top left, rgba(229, 106, 46, 0.08), transparent 22%),
    linear-gradient(180deg, #f9fbfd 0%, #f3f6fb 100%);
}

a:hover {
  color: #b95525;
}

.site-header {
  background: rgba(249, 251, 253, 0.9);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(14px);
}

.header-inner {
  padding: 14px 24px;
  gap: 20px;
}

.brand {
  gap: 14px;
}

.brand-name {
  gap: 12px;
  font-size: 24px;
  letter-spacing: 0;
}

.brand-copy {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
}

.brand-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-badge {
  padding: 4px 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.header-right {
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stats {
  gap: 10px;
}

.stat-pill {
  min-width: 92px;
  justify-content: space-between;
  padding: 9px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: none;
}

.stat-pill strong {
  font-size: 16px;
  font-weight: 700;
}

.lang-switcher,
.github-link {
  height: 38px;
  border-radius: 12px;
  padding: 0 14px;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.88);
}

.container {
  padding-top: 22px;
}

.content-shell {
  grid-template-columns: minmax(276px, 308px) minmax(0, 1fr);
  gap: 22px;
}

.controls,
.results-toolbar,
.about {
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.controls {
  top: 82px;
  padding: 18px;
}

.controls-header,
.results-summary {
  display: grid;
  gap: 4px;
}

.panel-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.panel-title,
.results-heading {
  font-size: 20px;
  line-height: 1.2;
  color: var(--heading);
}

.search-wrap {
  margin-top: 14px;
  margin-bottom: 18px;
}

.search-input {
  height: 52px;
  border-radius: 16px;
  font-size: 15px;
  background: rgba(248, 250, 252, 0.96);
}

.category-tabs {
  display: grid;
  gap: 8px;
  padding: 0;
  background: transparent;
  border: none;
}

.cat-tab {
  width: 100%;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(247, 249, 252, 0.92);
  color: var(--text-2);
}

.cat-tab:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(15, 23, 42, 0.08);
}

.cat-tab.active {
  background: linear-gradient(180deg, rgba(229, 106, 46, 0.12), rgba(229, 106, 46, 0.18));
  border: 1px solid rgba(229, 106, 46, 0.32);
  color: var(--heading);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.cat-tab.active .cat-tab-count {
  background: rgba(229, 106, 46, 0.14);
  color: var(--accent);
}

.cat-tab-label {
  font-size: 14px;
}

.cat-tab-count {
  min-width: 34px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-3);
  font-size: 11px;
}

.category-desc {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  border-left: none;
  background: rgba(247, 249, 252, 0.96);
}

.subgroup-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.subgroup-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.subgroup-tab:hover {
  border-color: rgba(15, 23, 42, 0.12);
  color: var(--heading);
}

.subgroup-tab.active {
  border-color: rgba(229, 106, 46, 0.28);
  background: rgba(229, 106, 46, 0.1);
  color: var(--accent);
}

.subgroup-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-3);
  font-size: 11px;
}

.filter-summary {
  align-items: flex-start;
  justify-content: flex-start;
}

.filter-summary-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.summary-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.summary-chip-strong {
  color: var(--heading);
  border-color: rgba(229, 106, 46, 0.2);
  background: rgba(229, 106, 46, 0.08);
}

.filter-inline-btn {
  margin-left: auto;
  background: #fff;
}

.results-section {
  display: grid;
  gap: 16px;
}

.results-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 0;
  padding: 12px 16px;
  border-top: none;
}

.results-summary {
  display: flex;
  align-items: center;
  min-width: 0;
}

.results-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 18px;
}

.results-kicker {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.results-count {
  font-size: 18px;
  color: var(--heading);
  font-weight: 700;
  white-space: nowrap;
}

.toolbar-controls {
  gap: 10px;
  margin-left: 0;
  justify-self: end;
}

.sort-wrap {
  gap: 10px;
  padding: 0 12px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.sort-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}

.sort-select {
  min-width: 170px;
  border: none;
  background-color: transparent;
  padding: 0 24px 0 0;
}

.sort-select:focus {
  box-shadow: none;
}

.view-toggle {
  width: auto;
  min-width: 92px;
  height: 42px;
  gap: 8px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
}

.view-toggle-icon {
  font-size: 15px;
  line-height: 1;
}

.view-toggle-text {
  font-size: 13px;
  font-weight: 700;
}

.results,
.card-grid {
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.skill-card {
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
}

.skill-card::before {
  left: 18px;
  right: 18px;
  top: 0;
  height: 2px;
  border-radius: 999px;
}

.card-head {
  gap: 12px;
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(229, 106, 46, 0.09), rgba(148, 163, 184, 0.12));
}

.card-name {
  margin-bottom: 6px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.card-repo {
  gap: 8px;
}

.card-stars {
  background: rgba(229, 106, 46, 0.08);
  color: #8c4a22;
  font-weight: 700;
}

.card-desc {
  min-height: 62px;
  font-size: 13px;
  line-height: 1.55;
}

.card-group {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-2);
}

.agent-chip-list {
  gap: 8px;
}

.agent-filter-chip {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 11px;
}

.card-install {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.98);
}

.card-footer {
  padding-top: 2px;
}

.card-link {
  font-size: 13px;
  font-weight: 600;
}

.copy-btn {
  padding: 7px 12px;
  font-size: 12px;
}

.empty-state {
  padding: 72px 28px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.pagination {
  justify-content: flex-start;
  gap: 12px;
}

.page-btn {
  border-radius: 12px;
  padding: 9px 14px;
}

.about {
  margin-top: 34px;
  padding: 20px 22px;
  background: rgba(255, 255, 255, 0.72);
}

.site-footer {
  margin-top: 28px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: transparent;
}

@media (min-width: 769px) {
  .results-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .toolbar-controls {
    justify-content: flex-end;
  }

  .sort-wrap {
    flex: 0 0 auto;
  }

  .sort-select {
    width: auto;
  }
}

@media (max-width: 980px) {
  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .brand-subtitle {
    display: none;
  }

  .header-right {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: end;
    align-items: center;
  }

  .stats {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stat-pill {
    min-width: 0;
  }
}


.category-item {
  display: grid;
  gap: 10px;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 8px;
  align-items: center;
}

.category-item .cat-tab {
  min-width: 0;
}

.cat-expand {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-3);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.cat-expand:hover {
  border-color: rgba(15, 23, 42, 0.12);
  color: var(--heading);
}

.cat-expand.active {
  border-color: rgba(229, 106, 46, 0.28);
  background: rgba(229, 106, 46, 0.1);
  color: var(--accent);
}

.cat-expand-icon {
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  transition: transform 0.18s ease;
}

.cat-expand.active .cat-expand-icon {
  transform: rotate(45deg);
}

.category-item.expanded .subgroup-tabs-inline {
  margin-top: -2px;
}


.controls {
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.subgroup-tabs-inline {
  margin-top: 0;
  padding: 0 4px 2px;
}

@media (max-width: 1100px) {
  .content-shell {
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  }

  .controls {
    padding: 16px;
  }

  .cat-tab {
    padding: 11px 12px;
  }
}


/* category layout fix */
.category-tabs .category-item {
  display: grid;
  gap: 8px;
}

.category-tabs .category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
}

.category-tabs .category-row > .cat-tab {
  width: 100%;
  min-width: 0;
  display: inline-flex;
}

.category-tabs .category-row > .cat-expand {
  width: 36px;
  min-width: 36px;
  height: 36px;
  margin: 0;
  align-self: center;
  justify-self: end;
  flex-shrink: 0;
}

.category-tabs > .category-item > .cat-tab {
  width: 100%;
}


/* results toolbar layout fix */
.results-section > .results-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

.results-toolbar .results-summary {
  min-width: 0;
}

.results-toolbar .results-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.results-toolbar .results-kicker {
  flex: 0 0 auto;
}

.results-toolbar .results-count {
  min-width: 0;
  white-space: normal;
}

.results-toolbar .toolbar-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  justify-self: end;
}

.results-toolbar .sort-wrap {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  min-width: 0;
  padding: 0 12px;
}

.results-toolbar .sort-select {
  width: 100%;
  min-width: 150px;
}

.results-toolbar .view-toggle {
  min-width: 96px;
  flex: 0 0 auto;
}

@media (max-width: 1180px) {
  .results-section > .results-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .results-toolbar .toolbar-controls {
    justify-self: stretch;
    justify-content: space-between;
  }
}

@media (max-width: 768px) {
  .header-inner {
    padding: 14px 16px;
  }

  .brand-name {
    font-size: 22px;
  }

  .brand-subtitle {
    font-size: 11px;
  }

  .header-right,
  .stats,
  .main-nav {
    width: 100%;
  }

  .stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-pill {
    min-width: 0;
  }

  .content-shell {
    gap: 16px;
  }

  .controls {
    padding: 16px;
  }

  .category-tabs {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .results-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 14px;
  }

  .toolbar-controls {
    width: 100%;
    flex-wrap: wrap;
    margin-left: 0;
    justify-self: stretch;
  }

  .sort-wrap,
  .view-toggle {
    width: 100%;
  }

  .sort-select {
    min-width: 0;
    width: 100%;
  }

  .results,
  .card-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .skill-card {
    padding: 16px;
  }

  .about {
    padding: 18px;
  }
}
