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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  line-height: 1.6;
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-bottom: 1px solid #334155;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #f8fafc;
}

.subtitle {
  color: #94a3b8;
  margin-top: 0.3rem;
}

.updated {
  color: #64748b;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 1.5rem;
}

.card h2 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  color: #f1f5f9;
}

/* AI Commentary */
.ai-commentary {
  border-left: 4px solid #6366f1;
}

.commentary-text {
  font-size: 1rem;
  color: #cbd5e1;
  margin-bottom: 1rem;
  line-height: 1.8;
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.highlight-card {
  background: #0f172a;
  border-left: 3px solid #64748b;
  border-radius: 8px;
  padding: 1rem;
}

.highlight-card h3 {
  font-size: 0.95rem;
  color: #f1f5f9;
  margin-bottom: 0.4rem;
}

.highlight-card p {
  font-size: 0.85rem;
  color: #94a3b8;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 1.5rem;
}

/* Period Tabs */
.period-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  padding: 0.4rem 1rem;
  border: 1px solid #475569;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.tab:hover {
  border-color: #6366f1;
  color: #e2e8f0;
}

.tab.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

/* Changes */
#changes-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.change-list h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.change-item {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid #1e293b;
}

.change-item .kw {
  color: #e2e8f0;
}

.change-item.rising .delta {
  color: #22c55e;
}

.change-item.new .delta {
  color: #38bdf8;
}

.change-point {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #334155;
}

.change-point:last-child {
  border-bottom: none;
}

.cp-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.change-point strong {
  color: #f1f5f9;
}

.change-point p {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 0.2rem;
}

/* Top Repos */
.repos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.repo-card {
  display: block;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
}

.repo-card:hover {
  border-color: #6366f1;
  transform: translateY(-2px);
}

.repo-name {
  font-weight: 600;
  color: #818cf8;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.repo-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.repo-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: #64748b;
}

.repo-lang {
  background: #334155;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #475569;
  font-size: 0.8rem;
  border-top: 1px solid #1e293b;
}

@media (max-width: 768px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  header h1 {
    font-size: 1.4rem;
  }
  #changes-section {
    grid-template-columns: 1fr;
  }
}
