:root {
  --bg:      #000000;
  --surface: #1C1C1E;
  --surface2:#2C2C2E;
  --fg:      #FFFFFF;
  --muted:   #8E8E93;
  --border:  #38383A;
  --accent:  #FF6600;
  --accent2: #007AFF;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── Scroll reveal ─── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Nav ─── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 clamp(24px, 5vw, 64px);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.6);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
nav.scrolled { border-bottom-color: var(--border); }

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-decoration: none;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
  letter-spacing: -0.01em;
}
.nav-links a:hover { color: var(--fg); }

.nav-href {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 980px;
  text-decoration: none;
  transition: opacity 0.2s;
}
.nav-href:hover { opacity: 0.85; }

/* ─── Section base ─── */
section {
  padding: clamp(80px, 12vh, 140px) clamp(24px, 5vw, 64px);
  max-width: 1200px;
  margin: 0 auto;
}

.section-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.section-sub {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--muted);
  max-width: 600px;
  line-height: 1.5;
}

/* ─── Hero ─── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 56px;
  position: relative;
}

.hero-eyebrow {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 8vw, 80px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  max-width: 900px;
  margin-bottom: 24px;
}

.hero h1 .gradient {
  background: linear-gradient(90deg, var(--accent), #FFAA00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(17px, 2.2vw, 21px);
  color: var(--muted);
  max-width: 560px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.hero-sub-en {
  font-size: clamp(14px, 1.8vw, 17px);
  color: var(--muted);
  opacity: 0.7;
  max-width: 520px;
  line-height: 1.5;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 980px;
  text-decoration: none;
  transition: transform 0.2s, opacity 0.2s;
}
.btn-primary:hover { transform: scale(1.03); opacity: 0.9; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--accent2);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  padding: 14px 28px;
  border-radius: 980px;
  border: 1px solid var(--accent2);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.btn-ghost:hover { background: var(--accent2); color: #fff; }

.hero-scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  opacity: 0.5;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ─── Philosophy ─── */
.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.philosophy-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 40px 32px;
  position: relative;
  overflow: hidden;
}

.philosophy-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.4s;
}
.philosophy-card:hover::before { opacity: 1; }

.philosophy-icon {
  font-size: 36px;
  margin-bottom: 20px;
  display: block;
  opacity: 0.9;
}

.philosophy-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.philosophy-card .en {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  font-weight: 500;
}

.philosophy-card p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

/* ─── Counters ─── */
.counters-section {
  background: var(--surface);
  border-radius: 24px;
  padding: clamp(48px, 6vh, 80px) clamp(32px, 4vw, 64px);
  margin: 0 auto;
  max-width: 1200px;
}

.counters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.counter-item { position: relative; }
.counter-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -16px;
  top: 10%;
  height: 80%;
  width: 1px;
  background: var(--border);
}

.counter-value {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.counter-value .accent { color: var(--accent); }

.counter-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}
.counter-label-en {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.6;
  margin-top: 2px;
}

/* ─── Features ─── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.feature-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 32px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.feature-card:hover { transform: translateY(-4px); }

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.feature-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

/* ─── Data Showcase ─── */
.data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 48px;
}

.data-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 32px;
}

.data-card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.data-card-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Language bars */
.lang-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.lang-row:last-child { margin-bottom: 0; }

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

.lang-name {
  font-size: 14px;
  font-weight: 500;
  width: 90px;
  flex-shrink: 0;
}

.lang-bar-track {
  flex: 1;
  height: 8px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
}

.lang-bar-fill {
  height: 100%;
  border-radius: 4px;
  width: 0;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-count {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* Keyword cloud */
.cloud-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.cloud-tag {
  padding: 6px 14px;
  border-radius: 980px;
  background: var(--surface2);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.2s, color 0.2s, transform 0.2s;
  cursor: default;
}
.cloud-tag:hover { background: var(--accent); color: #fff; transform: scale(1.05); }
.cloud-tag.hot { font-size: 18px; font-weight: 700; color: var(--fg); background: var(--accent); }
.cloud-tag.warm { font-size: 15px; font-weight: 600; color: var(--fg); background: var(--surface2); }
.cloud-tag.warm:hover { background: var(--accent); color: #fff; }

/* Stars ranking */
.rank-list { display: flex; flex-direction: column; gap: 12px; }

.rank-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--surface2);
  border-radius: 14px;
  transition: transform 0.2s;
}
.rank-item:hover { transform: translateX(4px); }

.rank-num {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.rank-num.gold { color: #FFD700; }
.rank-num.silver { color: #C0C0C0; }
.rank-num.bronze { color: #CD7F32; }

.rank-info { flex: 1; min-width: 0; }
.rank-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-stars {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ─── Timeline ─── */
.timeline-section { text-align: center; }

.timeline-track {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 48px auto 0;
  position: relative;
  max-width: 800px;
}

.timeline-node {
  flex: 1;
  position: relative;
  padding-top: 40px;
}

.timeline-node::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
}
.timeline-node:first-child::before { left: 50%; }
.timeline-node:last-child::before { right: 50%; }

.timeline-dot {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  z-index: 1;
}
.timeline-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(255, 102, 0, 0.4);
}

.timeline-time {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}
.timeline-dot.active + .timeline-time,
.timeline-dot.active ~ .timeline-time { color: var(--fg); }

.timeline-label {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.6;
}

/* ─── Repo Explorer ─── */
.repo-section { max-width: 1200px; margin: 0 auto; }

.repo-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-radius: 12px;
  padding: 4px;
  margin: 32px 0 24px;
  width: fit-content;
}
.repo-tab {
  padding: 10px 24px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font-body);
}
.repo-tab:hover { color: var(--fg); }
.repo-tab.active {
  background: var(--accent);
  color: #fff;
}

.repo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.repo-card {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, background 0.2s;
}
.repo-card:hover { transform: translateY(-2px); background: var(--surface2); }

.repo-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface2);
}

.repo-body { min-width: 0; }
.repo-name-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.repo-fullname {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.repo-fullname .owner { color: var(--muted); font-weight: 400; }
.repo-lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.repo-lang {
  font-size: 12px;
  color: var(--muted);
}
.repo-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.repo-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.repo-stars {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.repo-stars-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.repo-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.repo-topic {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface2);
  color: var(--muted);
}

@media (max-width: 768px) {
  .repo-card { grid-template-columns: 32px 1fr auto; gap: 12px; padding: 14px 14px; }
  .repo-avatar { width: 32px; height: 32px; border-radius: 8px; }
  .repo-fullname { font-size: 14px; }
  .repo-desc { -webkit-line-clamp: 2; }
  .repo-stars { font-size: 15px; }
  .repo-topics { display: none; }
  .repo-tabs { margin-left: auto; margin-right: auto; }
}

/* ─── CTA ─── */
.cta-section {
  text-align: center;
  padding-bottom: 80px;
}

.cta-card {
  background: var(--surface);
  border-radius: 24px;
  padding: clamp(48px, 6vh, 80px);
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(255, 102, 0, 0.08), transparent 50%);
  pointer-events: none;
}

.cta-card h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  position: relative;
}

.cta-card .cta-sub {
  font-size: 17px;
  color: var(--muted);
  margin-bottom: 32px;
  position: relative;
}

.cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px clamp(24px, 5vw, 64px);
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

footer a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
footer a:hover { color: var(--fg); }

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

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .philosophy-grid { grid-template-columns: 1fr; }
  .counters-grid { grid-template-columns: repeat(2, 1fr); }
  .counter-item:not(:last-child)::after { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .data-grid { grid-template-columns: 1fr; }
  .timeline-track { gap: 0; flex-wrap: wrap; }
  .timeline-node { flex: 0 0 50%; }
  .timeline-node::before { display: none; }
  footer { flex-direction: column; gap: 16px; text-align: center; }
}

@media (max-width: 480px) {
  .counters-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .hero-actions { flex-direction: column; width: 100%; padding: 0 24px; }
  .btn-primary, .btn-ghost { width: 100%; justify-content: center; }
}

/* ─── Loading skeleton ─── */
.skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skeleton-card {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border-radius: 16px;
}
.skeleton-avatar {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--surface2);
  animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-line {
  height: 14px; border-radius: 7px;
  background: var(--surface2);
  animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-stars {
  width: 50px; height: 20px; border-radius: 10px;
  background: var(--surface2);
  animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* ─── Error / empty state ─── */
.state-message {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.state-message .icon { font-size: 40px; margin-bottom: 12px; display: block; }
.state-message p { font-size: 15px; line-height: 1.5; }
.state-message .retry-link {
  display: inline-block; margin-top: 12px;
  color: var(--accent2); text-decoration: none; font-weight: 600; cursor: pointer;
}
.state-message .retry-link:hover { text-decoration: underline; }

/* ─── Empty description placeholder ─── */
.repo-desc.empty {
  color: var(--muted);
  opacity: 0.35;
  font-style: italic;
}

/* ═══ Light Theme ═══ */
body.light {
  --bg:      #F2F2F7;
  --surface: #FFFFFF;
  --surface2:#F2F2F7;
  --fg:      #1C1C1E;
  --muted:   #6E6E73;
  --border:  #D1D1D6;
}

body.light nav {
  background: rgba(242,242,247,0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

body.light .hero-scroll-hint { color: var(--muted); }

/* Smooth theme transition on color-affecting properties */
body, nav, section, .repo-card, .data-card, .feature-card,
.philosophy-card, .cta-card, .counters-section, .counter-value,
.counter-label, .counter-label-en, .repo-tab, .repo-topic,
.cloud-tag, .rank-item, .rank-name, .rank-stars, .lang-name,
.repo-desc, .repo-fullname, .repo-lang, .repo-stars, .repo-stars-label,
footer, .nav-links a, .section-sub, .hero-sub, .hero-sub-en,
.section-title, .data-card-title, .philosophy-card h3, .philosophy-card p,
.feature-card h3, .feature-card p, .repo-name-row, .timeline-time,
.timeline-label, .state-message, .state-message p, .nav-logo,
.skeleton-card, .skeleton-avatar, .skeleton-line, .skeleton-stars {
  transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Theme Toggle ─── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface2);
  border: none;
  cursor: pointer;
  color: var(--fg);
  font-size: 18px;
  margin-left: 12px;
  transition: background 0.25s, transform 0.25s;
}
.theme-toggle:hover { background: var(--border); transform: scale(1.08); }
.theme-toggle:active { transform: scale(0.94); }

/* ─── Language Toggle ─── */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface2);
  border: none;
  cursor: pointer;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-left: 8px;
  transition: background 0.25s, transform 0.25s;
}
.lang-toggle:hover { background: var(--border); transform: scale(1.08); }
.lang-toggle:active { transform: scale(0.94); }

/* ─── Locale visibility ─── */
[lang="zh-CN"] .lang-en,
[lang="zh"]    .lang-en { display: none; }
[lang="en"]    .lang-zh { display: none; }

/* ─── Search Bar ─── */
.search-wrap {
  position: relative;
  margin: 0 0 16px;
  max-width: 420px;
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.4;
  transition: opacity 0.3s;
}
.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border-radius: 980px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.search-input::placeholder { color: var(--muted); opacity: 0.6; }
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 102, 0, 0.12);
}
.search-input:focus ~ .search-icon,
.search-wrap:focus-within .search-icon { opacity: 0.7; }

/* ─── Language Filter Chips ─── */
.lang-filters {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}
.lang-filters::-webkit-scrollbar { display: none; }

.lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 980px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.25s;
  font-family: var(--font-body);
}
.lang-chip:hover { color: var(--fg); border-color: var(--muted); }
.lang-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.lang-chip-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.lang-chip-count {
  font-variant-numeric: tabular-nums;
  opacity: 0.65;
  font-size: 12px;
}

/* ─── Inline Detail Panel ─── */
.repo-detail {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 0;
  grid-column: 1 / -1;
}
.repo-detail.open { max-height: 600px; }

.repo-detail-inner {
  padding: 20px;
  background: var(--surface2);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
}

.repo-detail-full-desc {
  grid-column: 1 / -1;
  font-size: 14px;
  line-height: 1.6;
  color: #FFFFFF;
  opacity: 1;
}

.repo-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.repo-detail-meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  opacity: 0.6;
}
.repo-detail-meta-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.repo-detail-topics {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.repo-detail-topic {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}
.repo-detail-link {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent2);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: opacity 0.2s;
}
.repo-detail-link:hover { opacity: 0.75; }

/* ─── Delta Badge ─── */
.delta-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: 980px;
  background: rgba(48, 209, 88, 0.15);
  color: #30D158;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  animation: deltaPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes deltaPop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ─── No results state ─── */
.no-results {
  text-align: center;
  padding: 32px 24px;
  color: var(--muted);
  font-size: 14px;
  opacity: 0.7;
}

/* ─── Mobile adaptations for new elements ─── */
@media (max-width: 768px) {
  .repo-detail-inner {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .repo-detail.open { max-height: 800px; }
  .search-wrap { max-width: 100%; }
  .theme-toggle { margin-left: 8px; width: 32px; height: 32px; font-size: 16px; }
  .lang-toggle { margin-left: 4px; width: 32px; height: 32px; font-size: 12px; }
}
