/* 首页每日练习矩阵：沉在问候标题下方，左侧渐隐到页面底色。 */
.home-page-title {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 164px;
  gap: 28px;
  margin: 0 0 18px;
  padding: 12px 22px 14px 2px;
  overflow: hidden;
  border-bottom: 1px solid #d5d5d5;
}
.home-page-title > button {
  display: none;
}
.home-page-title .home-title-heading {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.home-title-heading .home-greeting {
  order: -1;
  margin: 0 0 9px;
  color: var(--ink, #171717);
  font-size: clamp(32px, 3vw, 44px);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.22;
}
.home-page-title .home-title-heading h1 {
  margin: 0;
  color: var(--muted, #737373);
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: 450;
  letter-spacing: 0;
  line-height: 1.6;
}
.home-page-title .home-streak {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  top: 12px;
  right: 22px;
  align-self: auto;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink, #171717);
  white-space: nowrap;
  font-size: 16px;
  font-weight: 450;
  line-height: 1;
}
.home-streak-count {
  display: inline-block;
  min-width: 1ch;
  color: var(--ink, #171717);
  font-size: clamp(48px, 5vw, 68px);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -2px;
  line-height: 1;
  text-align: center;
}
.home-activity-calendar {
  --heat-cell: clamp(8px, .72vw, 9.5px);
  --heat-gap: clamp(2.5px, .3vw, 3.5px);
  position: absolute;
  z-index: 0;
  right: 0;
  bottom: 6px;
  width: max-content;
  padding-top: 15px;
  opacity: .78;
  pointer-events: none;
  user-select: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 22%, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 22%, #000 100%);
}
.home-activity-calendar[data-ready="false"] .home-activity-grid {
  opacity: 0;
}
.home-activity-months {
  position: absolute;
  inset: 0 0 auto 0;
  height: 14px;
  color: #747b84;
  font-size: 10px;
  line-height: 14px;
  pointer-events: none;
}
.home-activity-month {
  position: absolute;
  left: calc(var(--week) * (var(--heat-cell) + var(--heat-gap)));
  white-space: nowrap;
}
.home-activity-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, var(--heat-cell));
  grid-auto-columns: var(--heat-cell);
  gap: var(--heat-gap);
  pointer-events: auto;
}
.home-activity-cell {
  appearance: none;
  position: relative;
  z-index: 0;
  display: block;
  width: var(--heat-cell);
  min-width: 0;
  height: var(--heat-cell);
  margin: 0;
  padding: 0;
  border: 1px solid rgb(91 101 112 / 9%);
  border-radius: 2px;
  background: #d8dce1;
  box-shadow: none;
  transform: scale(var(--wave-scale, 1));
  filter: brightness(var(--wave-brightness, 1));
  transition:
    transform 170ms cubic-bezier(.2, .85, .25, 1.45),
    filter 170ms ease,
    background-color 260ms ease,
    box-shadow 170ms ease;
  cursor: pointer;
}
.home-activity-cell[data-level="1"] { background: #b8d8f3; }
.home-activity-cell[data-level="2"] { background: #82bce9; }
.home-activity-cell[data-level="3"] { background: #4193d2; }
.home-activity-cell[data-level="4"] { background: #0968aa; }
.home-activity-cell:disabled {
  visibility: hidden;
  pointer-events: none;
}
.home-activity-cell:focus-visible {
  outline: 2px solid #171717;
  outline-offset: 2px;
}
.home-activity-tip {
  position: fixed;
  z-index: 10000;
  display: grid;
  min-width: 190px;
  gap: 5px;
  padding: 11px 13px;
  border: 1px solid rgb(30 41 59 / 14%);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 10px 32px rgb(15 23 42 / 18%);
  color: #171717;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
}
.home-activity-tip[hidden] { display: none; }
.home-activity-tip-date { font-size: 12px; font-weight: 650; }
.home-activity-tip-total { font-size: 13px; font-weight: 600; }
.home-activity-tip-detail { color: #6b7280; }
@media (max-width: 760px) {
  .home-page-title {
    min-height: 148px;
    gap: 16px;
    padding: 10px 2px 12px;
  }
  .home-title-heading .home-greeting { font-size: 32px; }
  .home-page-title .home-streak { gap: 6px; font-size: 14px; }
  .home-streak-count { font-size: 48px; }
  .home-activity-calendar {
    --heat-cell: clamp(5px, .75vw, 6.5px);
    --heat-gap: clamp(1.3px, .2vw, 2px);
    bottom: 5px;
  }
}
@media (max-width: 520px) {
  .home-page-title {
    min-height: 140px;
    gap: 12px;
    padding-right: 6px;
  }
  .home-title-heading .home-greeting {
    margin-bottom: 7px;
    font-size: 26px;
    letter-spacing: -.8px;
  }
  .home-page-title .home-title-heading h1 {
    max-width: 160px;
    font-size: 13px;
  }
  .home-page-title .home-streak {
    justify-self: end;
    top: 8px;
    right: 6px;
    gap: 4px;
    font-size: 12px;
  }
  .home-streak-count { font-size: 38px; }
  .home-activity-calendar {
    --heat-cell: 4.5px;
    --heat-gap: 1.2px;
    right: 0;
    bottom: 9px;
    padding-top: 15px;
    opacity: .7;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 14%, #000 100%);
    mask-image: linear-gradient(to right, transparent 0%, #000 14%, #000 100%);
  }
  .home-activity-months { display: none; }
  .home-activity-tip {
    min-width: 175px;
    padding: 9px 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-activity-cell { transition: none; }
}
