:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #24292f;
  --muted: #57606a;
  --line: #d0d7de;
  --lv0: #ebedf0;
  --lv1: #9be9a8;
  --lv2: #40c463;
  --lv3: #30a14e;
  --lv4: #216e39;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

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

h1, h2 { margin: 0; }

.year-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
}

.heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px);
  gap: 3px;
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.day {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--lv0);
}
.day.lv0 { background: var(--lv0); }
.day.lv1 { background: var(--lv1); }
.day.lv2 { background: var(--lv2); }
.day.lv3 { background: var(--lv3); }
.day.lv4 { background: var(--lv4); }
.day.out-of-year { opacity: 0.35; }

.legend {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}
.swatch.lv0 { background: var(--lv0); }
.swatch.lv1 { background: var(--lv1); }
.swatch.lv2 { background: var(--lv2); }
.swatch.lv3 { background: var(--lv3); }
.swatch.lv4 { background: var(--lv4); }

.summary {
  margin-top: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

#summaryContent {
  margin: 10px 0 0;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.6;
}

.tooltip {
  position: fixed;
  z-index: 9999;
  max-width: 280px;
  padding: 8px 10px;
  background: #24292f;
  color: #f6f8fa;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  white-space: pre-wrap;
}
