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

html {
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: #24292e;
  background: #fff;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

header {
  text-align: center;
  padding: 2rem 0;
  border-bottom: 1px solid #e1e4e8;
  margin-bottom: 2rem;
}

header h1 {
  margin: 0;
  font-size: 2rem;
}

header h1 a {
  color: #24292e;
  text-decoration: none;
}

header p {
  color: #586069;
  margin: 0.5rem 0 0;
}

a {
  color: #0366d6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.stats {
  text-align: center;
  padding: 2rem 0;
  border-bottom: 1px solid #e1e4e8;
  margin-bottom: 2rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: #0366d6;
}

.stat-date {
  display: block;
  color: #586069;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.lang-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-decoration: none !important;
}

.lang-card:hover {
  border-color: #0366d6;
  box-shadow: 0 4px 12px rgba(3, 102, 214, 0.15);
  transform: translateY(-2px);
}

.lang-name {
  font-weight: 600;
  color: #24292e;
  text-align: center;
}

.lang-count {
  font-size: 0.85rem;
  color: #586069;
  margin-top: 0.25rem;
}

.repo-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.repo-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  transition: border-color 0.2s ease;
}

.repo-item:hover {
  border-color: #0366d6;
}

.repo-avatar {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  flex-shrink: 0;
}

.repo-info {
  flex: 1;
  min-width: 0;
}

.repo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.repo-name {
  font-weight: 600;
  font-size: 1.1rem;
  overflow-wrap: break-word;
  word-break: break-all;
}

.repo-stars {
  color: #e3b341;
  font-weight: 500;
}

.repo-desc {
  color: #586069;
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

.repo-date {
  font-size: 0.8rem;
  color: #6a737d;
}

.back-to-top {
  position: absolute;
  width: 48px;
  height: 48px;
  background: #0366d6;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: opacity 0.3s, box-shadow 0.3s;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top.visible:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

footer {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid #e1e4e8;
  text-align: center;
  color: #586069;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  body {
    padding: 1rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .lang-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  
  .repo-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .repo-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
