:root {
  --bg: #f7f8fb;
  --ink: #15212f;
  --muted: #667085;
  --line: #d9dee7;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-2: #1d4ed8;
  --gold: #b7791f;
  --shadow: 0 18px 45px rgba(31, 42, 55, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.site-header {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(29, 78, 216, 0.1)),
    linear-gradient(180deg, #ffffff 0%, #f2f5f9 100%);
  border-bottom: 1px solid var(--line);
}

.nav,
.hero,
main,
.footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 750;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: #ffffff;
  background: #172033;
  font-size: 13px;
}

.brand-text {
  font-size: 16px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

button,
select,
input {
  font: inherit;
}

.lang-button,
.github-link,
.data-link {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  min-height: 38px;
  border-radius: 8px;
  padding: 0 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.lang-button.active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.hero {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 42px;
  align-items: center;
  padding: 52px 0 62px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p {
  margin: 24px 0 0;
  max-width: 760px;
  color: #4b5565;
  font-size: 19px;
  line-height: 1.75;
}

.hero-panel {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(217, 222, 231, 0.9);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 26px;
  display: grid;
  gap: 18px;
}

.hero-panel > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.hero-panel > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.metric-value {
  font-size: 32px;
  font-weight: 800;
}

.metric-label {
  color: var(--muted);
  font-size: 14px;
}

main {
  padding: 34px 0 54px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px 220px;
  gap: 14px;
  margin-bottom: 18px;
}

.search-field,
.select-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 13px;
  outline: none;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 2px;
}

.category-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.category-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.category-card strong {
  display: block;
  font-size: 22px;
}

.category-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.table-section,
.method-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(31, 42, 55, 0.05);
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

h2 {
  margin: 0;
  font-size: 24px;
}

.table-header p,
.method-section p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #475467;
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-size: 14px;
  line-height: 1.45;
}

.rank-cell {
  font-weight: 800;
  color: var(--accent-2);
}

.repo-cell a {
  font-weight: 750;
  text-decoration: none;
}

.repo-meta {
  display: block;
  color: var(--muted);
  margin-top: 5px;
  font-size: 12px;
}

.stars {
  font-weight: 800;
  white-space: nowrap;
}

.trend-pill,
.category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 8px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.trend-pill {
  color: #084c42;
  background: #d9f4ef;
}

.trend-pill.hot {
  color: #7a3b00;
  background: #fef0c7;
}

.category-pill {
  color: #1e3a8a;
  background: #dbeafe;
}

.description-cell {
  max-width: 360px;
  color: #344054;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
}

.method-section {
  margin-top: 22px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 1fr);
  gap: 28px;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.method-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.method-grid strong,
.method-grid span {
  display: block;
}

.method-grid span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 920px) {
  .hero,
  .method-section {
    grid-template-columns: 1fr;
  }

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

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

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

@media (max-width: 620px) {
  .nav,
  .hero,
  main,
  .footer {
    width: min(100% - 24px, 1180px);
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 0;
  }

  .brand-text {
    font-size: 14px;
  }

  .hero {
    min-height: 0;
    padding: 36px 0 42px;
  }

  .hero h1 {
    font-size: 44px;
  }

  .hero p {
    font-size: 16px;
  }

  .category-strip {
    grid-template-columns: 1fr;
  }

  .table-header,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
