:root {
  --bg: #0d0f12;
  --surface: #15181d;
  --surface-raised: #1b1f25;
  --surface-hover: #21262d;
  --line: #2a3038;
  --line-bright: #404a56;
  --text: #f1f3f6;
  --text-soft: #b9c0ca;
  --text-muted: #77818e;
  --purple: #b8aaff;
  --purple-soft: rgba(184, 170, 255, 0.13);
  --green: #7be0bd;
  --yellow: #ffd37d;
  --red: #ff9c98;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 50% -10%, rgba(184, 170, 255, 0.09), transparent 38rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

:lang(zh-CN) body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  line-height: 1.65;
}

:lang(zh-CN) .hero h1,
:lang(zh-CN) .section-heading h2 {
  letter-spacing: -0.055em;
}

:lang(zh-CN) .hero-copy,
:lang(zh-CN) .section-description,
:lang(zh-CN) .spotlight-description,
:lang(zh-CN) .category-card p {
  line-height: 1.8;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}

.page-shell {
  width: min(100% - 40px, 1380px);
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 76px;
  border-bottom: 1px solid rgba(64, 74, 86, 0.55);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(184, 170, 255, 0.5);
  border-radius: 9px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 17px;
}

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

.brand strong {
  color: var(--text);
  font-size: 14px;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  color: var(--text-muted);
  font-size: 13px;
}

.header-nav a {
  padding: 8px 11px;
  border-radius: 7px;
  transition: color 160ms ease, background 160ms ease;
}

.header-nav a:hover,
.header-nav a.active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.language-toggle {
  min-width: 48px;
  padding: 7px 10px;
  border: 1px solid var(--line-bright);
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 12px;
  transition: border 160ms ease, background 160ms ease, color 160ms ease;
}

.language-toggle:hover {
  border-color: var(--purple);
  background: var(--purple-soft);
  color: var(--text);
}

.hero {
  position: relative;
  min-height: 495px;
  padding: 94px 0 78px;
  overflow: hidden;
}

.hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-bright), transparent);
  content: "";
}

.hero-grid {
  position: absolute;
  inset: 0 -10%;
  opacity: 0.27;
  background-image:
    linear-gradient(rgba(125, 135, 149, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 135, 149, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.48), transparent 80%);
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  top: 2%;
  right: 7%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 170, 255, 0.17), transparent 68%);
  pointer-events: none;
}

.hero-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  color: var(--text-muted);
  font-size: 11px;
}

.live-dot,
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(123, 224, 189, 0.1);
}

.meta-divider {
  color: var(--line-bright);
}

.hero-kicker,
.section-kicker {
  margin: 0 0 9px;
  color: var(--purple);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

:lang(zh-CN) .hero-kicker,
:lang(zh-CN) .section-kicker {
  letter-spacing: 0.06em;
}

.hero h1 {
  position: relative;
  z-index: 1;
  max-width: 790px;
  margin: 0;
  color: var(--text);
  font-size: clamp(3.7rem, 8.2vw, 7.6rem);
  font-weight: 700;
  letter-spacing: -0.085em;
  line-height: 0.91;
}

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

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 570px;
  margin: 28px 0 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.75;
}

.hero-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--purple);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.hero-link:hover {
  color: var(--purple);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 98px;
}

.stat-card {
  min-height: 139px;
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.stat-featured {
  border-color: rgba(184, 170, 255, 0.4);
  background:
    radial-gradient(circle at 100% 0, rgba(184, 170, 255, 0.15), transparent 54%),
    var(--surface);
}

.stat-label,
.stat-hint {
  display: block;
}

.stat-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

:lang(zh-CN) .stat-label {
  letter-spacing: 0.03em;
}

.stat-card strong {
  display: block;
  margin: 16px 0 7px;
  color: var(--text);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  letter-spacing: -0.06em;
  line-height: 1;
}

.stat-hint {
  color: var(--text-muted);
  font-size: 11px;
}

.rankings-section,
.category-section {
  margin-bottom: 96px;
  scroll-margin-top: 28px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}

.section-heading.compact {
  align-items: flex-start;
}

.section-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  letter-spacing: -0.065em;
  line-height: 1.05;
}

.section-description {
  max-width: 720px;
  margin: 13px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.data-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 11px;
}

.data-status.ready {
  border-color: rgba(123, 224, 189, 0.35);
  color: var(--green);
}

.data-status.waiting,
.data-status.partial {
  border-color: rgba(255, 211, 125, 0.35);
  color: var(--yellow);
}

.data-status.error {
  border-color: rgba(255, 156, 152, 0.35);
  color: var(--red);
}

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

.category-tabs {
  display: flex;
  gap: 7px;
  max-width: 100%;
  overflow-x: auto;
  padding: 3px 1px 7px;
  scrollbar-color: var(--line-bright) transparent;
  scrollbar-width: thin;
}

.category-tab {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  transition: border 160ms ease, background 160ms ease, color 160ms ease;
}

.category-tab:hover {
  border-color: var(--line-bright);
  color: var(--text);
}

.category-tab.active {
  border-color: var(--purple);
  background: var(--purple);
  color: #181622;
  font-weight: 700;
}

.filter-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.search-box,
.select-box {
  display: flex;
  align-items: center;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.search-box {
  width: 198px;
  gap: 7px;
  padding: 0 10px;
}

.search-icon {
  color: var(--text-muted);
  font-size: 19px;
  line-height: 1;
  transform: rotate(-20deg);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

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

.select-box {
  padding: 0 9px;
}

.select-box select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 12px;
}

.select-box option {
  background: var(--surface-raised);
  color: var(--text);
}

.spotlight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.spotlight-single {
  grid-template-columns: minmax(0, 1fr);
}

.spotlight-single .spotlight-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  column-gap: 18px;
}

.spotlight-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.popular-card {
  background:
    linear-gradient(120deg, rgba(184, 170, 255, 0.075), transparent 50%),
    var(--surface);
}

.spotlight-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.spotlight-heading .section-kicker {
  margin-bottom: 5px;
}

.spotlight-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  letter-spacing: -0.035em;
}

.spotlight-mark {
  color: var(--line-bright);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.spotlight-description {
  margin: 12px 0 15px;
  color: var(--text-muted);
  font-size: 11px;
}

.spotlight-list {
  display: grid;
  gap: 2px;
}

.spotlight-item {
  display: grid;
  grid-template-columns: 25px 27px minmax(0, 1fr) 110px 18px;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px 0;
  border-top: 1px solid rgba(42, 48, 56, 0.75);
  transition: color 160ms ease;
}

.spotlight-item:hover .spotlight-name {
  color: var(--purple);
}

.spotlight-rank {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
}

.spotlight-avatar {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  background: var(--surface-raised);
  object-fit: cover;
}

.spotlight-name,
.spotlight-metric {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spotlight-name {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.spotlight-name small,
.spotlight-metric small {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spotlight-metric {
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.spotlight-arrow {
  color: var(--text-muted);
  font-size: 14px;
}

.spotlight-empty {
  margin: 14px 0 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.table-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 20px 65px rgba(0, 0, 0, 0.2);
}

.table-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.table-caption-note {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
}

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

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

th,
td {
  padding: 14px 15px;
  text-align: left;
}

th {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

:lang(zh-CN) th {
  letter-spacing: 0.03em;
}

td {
  border-bottom: 1px solid rgba(42, 48, 56, 0.72);
  color: var(--text-soft);
  font-size: 13px;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.027);
}

.col-rank {
  width: 54px;
}

.col-link {
  width: 39px;
}

.align-right {
  text-align: right;
}

.rank-number {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.top-rank {
  color: var(--purple);
  font-weight: 800;
}

.repo-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 320px;
}

.repo-avatar {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--surface-raised);
  object-fit: cover;
}

.repo-details {
  min-width: 0;
}

.repo-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.repo-name {
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repo-name:hover {
  color: var(--purple);
}

.repo-description {
  max-width: 440px;
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-pill {
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 9px;
}

.number-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.growth-positive {
  color: var(--green);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.growth-negative {
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

.muted-value {
  color: var(--text-muted);
}

.score-note {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
  white-space: nowrap;
}

.category-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 220px;
}

.category-badge {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1.2;
  opacity: 0.92;
}

.general-badge {
  border-color: var(--line-bright);
  color: var(--text-muted);
}

.external-link {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 14px;
  transition: background 160ms ease, color 160ms ease;
}

.external-link:hover {
  background: var(--purple-soft);
  color: var(--purple);
}

.loading-row td {
  height: 190px;
  color: var(--text-muted);
  text-align: center;
}

.loading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid var(--line-bright);
  border-top-color: var(--purple);
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.empty-state strong {
  color: var(--text-soft);
  font-size: 14px;
}

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

.category-card {
  min-height: 151px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  transition: border 160ms ease, transform 160ms ease;
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-bright);
}

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

.category-card h3 {
  margin: 0;
  color: var(--category-color, var(--purple));
  font-size: 15px;
  letter-spacing: -0.025em;
}

.category-count {
  min-width: max-content;
  color: var(--text-muted);
  font-size: 11px;
}

.category-card p {
  min-height: 36px;
  margin: 12px 0 13px;
  color: var(--text-muted);
  font-size: 11px;
}

.category-top {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 11px;
}

.category-top:hover {
  color: var(--purple);
}

.category-top .repo-avatar {
  width: 21px;
  height: 21px;
  border-radius: 6px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 95px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 11px;
}

.footer-brand {
  opacity: 0.86;
}

.site-footer p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1040px) {
  .header-nav {
    gap: 0;
  }

  .header-nav a {
    padding: 8px 8px;
  }

  .movers-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 28px, 680px);
  }

  .site-header {
    flex-wrap: wrap;
    gap: 13px;
    padding: 14px 0 12px;
  }

  .header-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
  }

  .header-nav a {
    padding: 6px 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  .language-toggle {
    margin-left: auto;
  }

  .hero {
    min-height: 470px;
    padding: 75px 0 65px;
  }

  .hero h1 {
    font-size: clamp(3.45rem, 16vw, 6.2rem);
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 78px;
  }

  .stat-card {
    min-height: 128px;
    padding: 16px;
  }

  .section-heading {
    display: block;
  }

  .data-status {
    margin-top: 16px;
  }

  .filter-bar {
    display: block;
  }

  .filter-tools {
    margin-top: 9px;
  }

  .search-box {
    flex: 1;
    width: auto;
  }

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

  .spotlight-single .spotlight-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .site-footer {
    flex-wrap: wrap;
    padding: 22px 0;
  }

  .site-footer p {
    width: 100%;
    order: 3;
  }
}

@media (max-width: 480px) {
  .hero-meta {
    flex-wrap: wrap;
  }

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

  .spotlight-single .spotlight-list {
    grid-template-columns: 1fr;
  }

  .spotlight-item {
    grid-template-columns: 22px 27px minmax(0, 1fr) 86px 18px;
  }

  .spotlight-card {
    padding: 16px;
  }
}
