:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #141821;
  --muted: #626a78;
  --subtle: #8791a1;
  --border: #dfe4ec;
  --blue: #2563eb;
  --green: #16a34a;
  --orange: #d97706;
  --red: #dc2626;
  --cyan: #0891b2;
  --violet: #6d5bd0;
  --shadow: 0 20px 50px rgba(20, 24, 33, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 210px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: #101827;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
  line-height: 1.15;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.search {
  position: relative;
  flex: 1;
  max-width: 620px;
}

.search input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0 16px 0 44px;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.search input:focus {
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 15px;
  height: 15px;
  border: 2px solid var(--subtle);
  border-radius: 50%;
  transform: translateY(-58%);
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -5px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: var(--subtle);
  transform: rotate(45deg);
}

.intro {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.intro h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

.intro p {
  max-width: 560px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.summary strong {
  color: var(--text);
}

.filters {
  display: flex;
  gap: 8px;
  padding: 22px 0;
  overflow-x: auto;
}

.filter,
.ghost-button,
.tag-button {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.filter {
  height: 36px;
  padding: 0 14px;
  white-space: nowrap;
}

.filter:hover,
.ghost-button:hover,
.tag-button:hover {
  color: var(--text);
  border-color: #c5ceda;
  transform: translateY(-1px);
}

.filter.active {
  background: #101827;
  border-color: #101827;
  color: #fff;
}

.content {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.sidebar,
.results {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 20px;
  padding: 18px;
}

.sidebar h2,
.results-head h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-button {
  padding: 7px 10px;
  font-size: 13px;
}

.tag-button.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue);
}

.results {
  min-width: 0;
  padding: 20px;
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.results-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.ghost-button {
  height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.skill-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.skill-card:hover {
  border-color: #c7d2fe;
}

.card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.skill-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.skill-title h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.category-label {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.skill-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: #475569;
  font-size: 12px;
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

.repo-meta {
  display: inline-flex;
  gap: 8px;
  flex: 1;
  color: var(--subtle);
  font-size: 12px;
}

.repo-meta span {
  white-space: nowrap;
}

.detail-toggle,
.github-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border-radius: var(--radius);
  font-size: 13px;
  text-decoration: none;
}

.detail-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.detail-toggle:hover {
  color: var(--text);
}

.github-link {
  gap: 8px;
  padding: 0 12px;
  background: #101827;
  color: #fff;
}

.github-link::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  clip-path: polygon(
    50% 0,
    61% 35%,
    98% 35%,
    68% 56%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 56%,
    2% 35%,
    39% 35%
  );
}

.skill-detail {
  display: none;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.skill-card.open .skill-detail {
  display: block;
}

.skill-detail h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.skill-detail ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.empty-state {
  padding: 46px 20px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

.empty-state h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 18px;
}

.empty-state p {
  margin: 0;
}

@media (max-width: 900px) {
  .shell {
    width: min(100vw - 24px, 760px);
    padding-top: 18px;
  }

  .topbar,
  .intro {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    max-width: none;
  }

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

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

  .sidebar {
    position: static;
    box-shadow: none;
  }

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

@media (max-width: 560px) {
  .shell {
    width: min(100vw - 18px, 520px);
  }

  .results,
  .sidebar {
    padding: 14px;
  }

  .results-head,
  .card-top,
  .card-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .github-link {
    width: 100%;
  }
}
