:root {
  color-scheme: light;
  --bg: #f3f4f2;
  --surface: #ffffff;
  --surface-soft: #f8f9f7;
  --ink: #191c20;
  --muted: #687078;
  --line: #d9dedb;
  --line-strong: #b8c0bb;
  --green: #167655;
  --green-soft: #e1f2e9;
  --blue: #2864b1;
  --blue-soft: #e9f0fa;
  --coral: #cf554b;
  --coral-soft: #fae8e5;
  --amber: #936d12;
  --amber-soft: #f9f0cf;
  --violet: #7156a4;
  --violet-soft: #eee9f7;
  --shadow: 0 16px 44px rgba(25, 28, 32, 0.15);
  --drawer-width: 540px;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--bg); letter-spacing: 0; zoom: 1.1; }
body.drawer-open { overflow: hidden; }
button, input, select { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
a { color: inherit; }
svg { width: 18px; height: 18px; stroke-width: 2; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(40, 100, 177, 0.3); outline-offset: 2px; }

.site-header {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.gguuai-mark { height: 40px; display: inline-flex; align-items: center; padding: 0 13px; border-radius: 6px; color: white; background: var(--ink); font-family: "DengXian", "等线", "Microsoft YaHei", sans-serif; font-size: 19px; font-weight: 800; line-height: 1; }
.brand-connector { color: var(--muted); font-family: Georgia, serif; font-size: 18px; font-weight: 700; }
.github-brand { display: inline-flex; align-items: center; gap: 7px; }
.github-brand > svg { width: 23px; height: 23px; stroke-width: 2; }
.github-brand strong, .brand-tagline { color: var(--ink); font-size: 16px; font-weight: 800; line-height: 1; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 22px; }
.api-promo { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--ink); border-radius: 6px; color: white; background: var(--ink); font-size: 11px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.api-promo:hover { border-color: #30343a; background: #30343a; }
.api-promo svg { width: 14px; height: 14px; }
.header-stats { display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 12px; }
.header-stats strong { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }

.search-band {
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 190px 150px;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  position: sticky;
  top: 68px;
  z-index: 25;
}
.search-field { height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.search-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(40, 100, 177, 0.1); }
.search-field > svg { flex: none; color: var(--muted); }
.search-field input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-field input::placeholder { color: #92999e; }
.clear-search { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; color: var(--muted); background: transparent; }
.clear-search:hover { color: var(--ink); background: var(--bg); }
.clear-search svg { width: 15px; height: 15px; }
.select-field { position: relative; height: 42px; }
.mobile-facet-select { display: none; }
.select-field select { width: 100%; height: 100%; appearance: none; padding: 0 36px 0 11px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); font-size: 12px; }
.select-field svg { position: absolute; top: 12px; right: 10px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }

.workspace { display: grid; grid-template-columns: 222px minmax(0, 1fr); min-height: calc(100vh - 134px); }
.filters-panel { padding: 20px 14px; border-right: 1px solid var(--line); background: #edf0ed; }
.filter-group + .filter-group { margin-top: 22px; padding-top: 20px; border-top: 1px solid #d5dad6; }
.filter-heading { padding: 0 9px 9px; color: var(--ink); }
.filter-heading span { display: block; font-size: 10px; font-weight: 800; }
.filter-heading small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 400; }
.category-nav, .type-nav { display: grid; gap: 3px; }
.nav-filter { min-height: 40px; display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid transparent; border-radius: 6px; color: #464d52; background: transparent; text-align: left; font-size: 11px; }
.nav-filter svg { width: 15px; height: 15px; }
.nav-filter span { line-height: 1.35; }
.nav-filter small { min-width: 26px; padding: 3px 5px; border-radius: 10px; color: var(--muted); background: #dfe4e0; text-align: center; font-size: 10px; font-variant-numeric: tabular-nums; }
.nav-filter:hover { background: rgba(255, 255, 255, 0.66); }
.nav-filter.is-disabled { cursor: not-allowed; opacity: 0.42; }
.nav-filter.is-disabled:hover { background: transparent; }
.nav-filter.is-active { color: var(--ink); border-color: var(--line); background: var(--surface); font-weight: 800; }
.nav-filter.is-active small { color: var(--green); background: var(--green-soft); }

.results-panel { min-width: 0; background: var(--surface); }
.results-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 22px; border-bottom: 1px solid var(--line); }
.results-header h1 { margin: 0; font-size: 18px; line-height: 1.3; }
.results-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.quiet-button { min-height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); font-size: 11px; font-weight: 700; }
.quiet-button:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.quiet-button svg { width: 15px; height: 15px; }
.table-wrap { min-width: 0; overflow-x: auto; }
.tools-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tools-table th { height: 40px; padding: 0 11px; border-bottom: 1px solid var(--line); color: var(--muted); background: #fafbfa; font-size: 10px; font-weight: 800; text-align: left; white-space: nowrap; }
.tools-table td { padding: 12px 11px; border-bottom: 1px solid #e8ebe8; vertical-align: middle; font-size: 11px; }
.tools-table tbody tr { cursor: pointer; }
.tools-table tbody tr:hover { background: #f7f9f7; }
.tools-table tbody tr.is-selected { background: #edf6f1; box-shadow: inset 3px 0 var(--green); }
.tools-table th:nth-child(1), .tools-table td:nth-child(1) { width: 22%; }
.tools-table th:nth-child(2), .tools-table td:nth-child(2) { width: 142px; }
.tools-table th:nth-child(3), .tools-table td:nth-child(3) { width: 150px; }
.tools-table th:nth-child(4), .tools-table td:nth-child(4) { width: 108px; }
.tools-table th:nth-child(5), .tools-table td:nth-child(5) { width: 25%; }
.tools-table th:nth-child(6), .tools-table td:nth-child(6) { width: 86px; }
.tools-table th:nth-child(7), .tools-table td:nth-child(7) { width: 150px; }
.tool-name-line { display: flex; align-items: center; gap: 7px; min-width: 0; }
.tool-name-line strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.tool-headline { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.mobile-meta { display: none; }
.creator-license { min-width: 0; display: flex; align-items: center; gap: 7px; }
.creator-license > a:first-child, .creator-license > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 10px; font-weight: 700; text-decoration: none; }
.creator-license > a:first-child:hover { color: var(--blue); text-decoration: underline; }
.license-badge { flex: none; padding: 4px 6px; border: 1px solid #c9d7ce; border-radius: 4px; color: #176247; background: var(--green-soft); font-family: Consolas, monospace; font-size: 8px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.license-badge:hover { border-color: var(--green); }
.license-badge.license-unmarked { color: var(--muted); border-color: var(--line); background: var(--surface-soft); }
.type-badge { display: inline-flex; align-items: center; max-width: 100%; padding: 5px 7px; border-radius: 4px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.type-skill { color: #176247; background: var(--green-soft); }
.type-mcp { color: #285a9e; background: var(--blue-soft); }
.type-cli { color: #454a4f; background: #eaedeb; }
.type-app { color: #9d433b; background: var(--coral-soft); }
.type-framework { color: #695098; background: var(--violet-soft); }
.type-resource { color: #795d18; background: var(--amber-soft); }
.purpose-text { margin: 0; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #4e555a; line-height: 1.5; }
.install-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 4px 7px; border-radius: 4px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.install-badge svg { width: 13px; height: 13px; }
.install-verified { color: #176247; background: var(--green-soft); }
.install-agent { color: #285a9e; background: var(--blue-soft); }
.stars { display: inline-flex; align-items: center; gap: 4px; font-family: Consolas, monospace; white-space: nowrap; }
.stars svg { width: 13px; height: 13px; color: #aa7a11; }
.copy-agent-button { min-height: 32px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--surface); font-size: 10px; font-weight: 800; }
.copy-agent-button:hover { color: white; border-color: var(--ink); background: var(--ink); }
.copy-agent-button svg { width: 14px; height: 14px; }
.empty-state { min-height: 420px; display: grid; place-items: center; align-content: center; gap: 9px; color: var(--muted); }
.empty-state svg { width: 32px; height: 32px; }
.empty-state strong { color: var(--ink); font-size: 14px; }
.empty-state span { color: var(--muted); font-size: 11px; }
.empty-state button { border: 0; color: var(--blue); background: transparent; font-size: 12px; font-weight: 700; }
.pagination { min-height: 62px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 18px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.pagination button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--surface); font-size: 10px; font-weight: 700; }
.pagination button:hover:not(:disabled) { border-color: var(--line-strong); background: #f2f4f2; }
.pagination button:disabled { cursor: not-allowed; opacity: 0.4; }
.pagination button svg { width: 14px; height: 14px; }
.page-status { min-width: 92px; color: var(--muted); text-align: center; font-size: 10px; font-variant-numeric: tabular-nums; }

.detail-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(var(--drawer-width), calc(100vw - 20px)); display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); transform: translateX(102%); transition: transform 180ms ease; }
.detail-drawer.is-open { transform: translateX(0); }
.drawer-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(17, 20, 23, 0.34); }
.drawer-header { min-height: 132px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 22px 18px; border-bottom: 1px solid var(--line); }
.drawer-title-block { min-width: 0; }
.drawer-header h2 { margin: 9px 0 0; font-size: 24px; line-height: 1.25; overflow-wrap: anywhere; }
.drawer-header p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; flex: none; padding: 0; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); }
.icon-button:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.drawer-content { flex: 1; overflow-y: auto; padding: 0 22px 38px; }
.drawer-primary-actions { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 8px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.primary-button, .secondary-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; border-radius: 6px; font-size: 11px; font-weight: 800; text-decoration: none; }
.primary-button { border: 1px solid var(--ink); color: white; background: var(--ink); }
.primary-button:hover { background: #30343a; }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.secondary-button:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.primary-button svg, .secondary-button svg { width: 15px; height: 15px; }
.secondary-button svg:last-child { width: 12px; height: 12px; color: var(--muted); }
.drawer-api-promo { border-color: var(--ink); }
.drawer-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.drawer-section h3 { margin: 0 0 8px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.drawer-section > p { margin: 0; color: #3f464b; font-size: 12px; line-height: 1.7; }
.facts-section { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.facts-section div { min-width: 0; }
.facts-section span { display: block; color: var(--muted); font-size: 9px; }
.facts-section strong { display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.agent-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.agent-tags span { padding: 5px 7px; border: 1px solid var(--line); border-radius: 4px; color: #4e555a; background: var(--surface-soft); font-size: 9px; }
.command-block { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #202429; }
.command-header { min-height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 12px; border-bottom: 1px solid #3b4147; color: #adb5ba; font-size: 9px; }
.command-header button, .section-heading-row button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; color: inherit; background: transparent; }
.command-header button:hover { color: white; background: #373d43; }
.command-header svg, .section-heading-row svg { width: 13px; height: 13px; }
.command-block code { display: block; padding: 14px 12px; color: #f4f5f4; font-family: Consolas, monospace; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.command-block p { margin: 0; padding: 10px 12px; color: #b9c0c5; background: #2a2f34; font-size: 9px; line-height: 1.6; }
.section-heading-row { display: flex; align-items: center; justify-content: space-between; }
.section-heading-row button { color: var(--muted); }
.section-heading-row button:hover { color: var(--ink); background: var(--bg); }
.drawer-section pre { max-height: 270px; margin: 0; padding: 13px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; color: #353b40; background: var(--surface-soft); font-family: "Microsoft YaHei", "PingFang SC", sans-serif; font-size: 10px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 100; width: min(340px, calc(100vw - 36px)); display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); font-size: 11px; animation: toast-in 150ms ease both; }
.toast svg { width: 16px; height: 16px; color: var(--green); }
.toast.is-error { border-color: #e1aca7; background: #fff8f7; }
.toast.is-error svg { color: var(--coral); }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1080px) {
  .search-band { grid-template-columns: minmax(280px, 1fr) 170px 180px; }
  .sort-select { grid-column: 3; display: none; }
  .workspace { grid-template-columns: 190px minmax(0, 1fr); }
  .tools-table th:nth-child(5), .tools-table td:nth-child(5) { display: none; }
  .tools-table th:nth-child(1), .tools-table td:nth-child(1) { width: auto; }
}

@media (max-width: 760px) {
  .site-header { height: 64px; padding: 0 14px; }
  .brand { gap: 7px; }
  .gguuai-mark { height: 38px; padding: 0 11px; font-size: 17px; }
  .brand-connector { font-size: 16px; }
  .github-brand { gap: 5px; }
  .github-brand > svg { width: 21px; height: 21px; }
  .github-brand strong, .brand-tagline { font-size: 13px; }
  .header-actions { gap: 10px; }
  .api-promo { min-height: 36px; padding: 7px 10px; font-size: 10px; }
  .header-stats { display: none; gap: 10px; font-size: 9px; }
  .header-stats span:nth-child(2) { display: none; }
  .header-stats strong { font-size: 13px; }
  .search-band { position: static; grid-template-columns: 1fr 1fr; padding: 10px 12px; gap: 8px; }
  .search-field { grid-column: 1 / -1; }
  .mobile-facet-select { display: block; }
  .install-select { display: block; grid-column: 1 / -1; }
  .sort-select { display: none; }
  .workspace { display: block; }
  .filters-panel { padding: 9px 12px; overflow: hidden; border-right: 0; border-bottom: 1px solid var(--line); }
  .filter-heading, .type-nav { display: none; }
  .category-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .category-nav::-webkit-scrollbar { display: none; }
  .nav-filter { min-width: max-content; grid-template-columns: 16px auto auto; min-height: 36px; }
  .results-header { min-height: 68px; padding: 13px 14px; }
  .results-header h1 { font-size: 16px; }
  .quiet-button span { display: none; }
  .quiet-button { width: 36px; padding: 0; justify-content: center; }
  .tools-table, .tools-table tbody { display: block; }
  .tools-table thead { display: none; }
  .tools-table tr { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; margin: 10px 12px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
  .tools-table td { display: none; padding: 0; border: 0; width: auto !important; }
  .tools-table td:nth-child(1) { display: block; grid-column: 1; }
  .tools-table td:nth-child(2) { display: block; grid-column: 2; grid-row: 1; align-self: center; }
  .tool-headline { white-space: normal; line-height: 1.45; }
  .mobile-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 9px; }
  .copy-agent-button { width: 36px; height: 36px; min-height: 36px; padding: 0; }
  .copy-agent-button span { display: none; }
  .pagination { gap: 6px; padding: 10px 12px; }
  .pagination button { width: 36px; padding: 0; }
  .pagination button span { display: none; }
  .page-status { min-width: 78px; }
  .drawer-header { min-height: 120px; padding: 18px 16px 15px; }
  .drawer-header h2 { font-size: 21px; }
  .drawer-content { padding: 0 16px 30px; }
  .drawer-primary-actions { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .brand-tagline { display: none; }
}

@media (max-width: 390px) {
  .brand-connector, .github-brand strong { display: none; }
  .api-promo { gap: 5px; padding: 7px 9px; }
}
