/* 首页打卡热力图：使用独立前缀，避免覆盖 Reimu 主题样式。 */
.checkin-heatmaps {
  --checkin-cell: 12px;
  --checkin-gap: 3px;
  --checkin-border: rgba(95, 82, 66, .16);
  --checkin-muted: #756d64;
  --checkin-surface: rgba(255, 255, 255, .72);
  --checkin-empty: #ebedf0;
  --checkin-level-1: #b7e3bb;
  --checkin-level-2: #7bc47f;
  --checkin-level-3: #45a95a;
  --checkin-level-4: #22863a;
  margin: 28px auto 10px;
  width: min(100%, 960px);
}

/* Reimu 切换深色主题时会给 html 添加 data-theme="dark"，跟随该标记同步配色。 */
[data-theme="dark"] .checkin-heatmaps {
  --checkin-border: rgba(205, 214, 224, .18);
  --checkin-muted: #aab4c0;
  --checkin-surface: rgba(25, 30, 38, .84);
  --checkin-empty: #161b22;
  --checkin-level-1: #0e4429;
  --checkin-level-2: #006d32;
  --checkin-level-3: #26a641;
  --checkin-level-4: #39d353;
}

.checkin-heading {
  margin-bottom: 14px;
}

.checkin-heading h2 {
  margin: 0 0 5px;
  font-size: 1.3rem;
}

.checkin-status {
  margin: 0;
  color: var(--checkin-muted);
  font-size: .92rem;
}

.checkin-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.checkin-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--checkin-border);
  border-radius: 14px;
  background: var(--checkin-surface);
  box-shadow: 0 8px 22px rgba(64, 53, 40, .06);
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.checkin-card-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.checkin-card-heading h3 {
  margin: 0;
  font-size: 1.05rem;
}

.checkin-total {
  color: var(--checkin-muted);
  font-size: .88rem;
  white-space: nowrap;
}

.checkin-scroll {
  overflow-x: auto;
  padding: 3px 2px 8px;
}

.checkin-chart {
  display: flex;
  min-width: max-content;
  gap: 8px;
}

.checkin-weekdays {
  display: grid;
  grid-template-rows: repeat(7, var(--checkin-cell));
  gap: var(--checkin-gap);
  width: 22px;
  padding-top: 25px;
  color: var(--checkin-muted);
  font-size: .68rem;
  line-height: var(--checkin-cell);
  text-align: right;
}

.checkin-weekdays span:nth-child(even) {
  visibility: hidden;
}

.checkin-calendar {
  position: relative;
  padding-top: 25px;
}

.checkin-months {
  position: absolute;
  inset: 0 0 auto;
  height: 20px;
  color: var(--checkin-muted);
  font-size: .68rem;
  white-space: nowrap;
}

.checkin-month {
  position: absolute;
  top: 0;
}

.checkin-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, var(--checkin-cell));
  grid-auto-columns: var(--checkin-cell);
  gap: var(--checkin-gap);
}

.checkin-cell {
  display: block;
  width: var(--checkin-cell);
  height: var(--checkin-cell);
  border-radius: 3px;
  background: var(--checkin-empty);
  transition: background-color .2s ease;
}

.checkin-cell.level-1 { background: var(--checkin-level-1); }
.checkin-cell.level-2 { background: var(--checkin-level-2); }
.checkin-cell.level-3 { background: var(--checkin-level-3); }
.checkin-cell.level-4 { background: var(--checkin-level-4); }
.checkin-cell.is-outside { visibility: hidden; }

.checkin-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 8px;
  color: var(--checkin-muted);
  font-size: .72rem;
}

.checkin-legend {
  display: inline-flex;
  gap: 3px;
  margin: 0 2px;
}

.checkin-legend .checkin-cell {
  flex: 0 0 var(--checkin-cell);
}

.checkin-heatmaps.is-unavailable .checkin-status {
  color: #9b3b32;
}

@media (max-width: 760px) {
  .checkin-cards {
    grid-template-columns: 1fr;
  }
}
