/* ==========================================================================
   SIDE PANEL — 右：排班月历 + 当日任务
   规则：过去普通日灰 / 未来普通日白 / 任务按类型色 / 逾期深红发光 /
        同日多任务以彩点阵列呈现，互不覆盖，并标注「多任务」
   ========================================================================== */

.cal {
  width: 100%;
}

.cal__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.cal__title {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.cal__title-sub {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 4px;
}

.cal__title-cn {
  font-family: var(--font-cn);
  font-size: 11px;
  letter-spacing: 0.26em;
  color: var(--ink-3);
  white-space: nowrap;
}

.cal__month {
  font-family: var(--font-num);
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--ink-0);
  font-variation-settings: "wght" 300, "wdth" 87;
}

.cal__month em {
  font-style: normal;
  color: var(--ink-3);
  font-size: 0.55em;
  letter-spacing: 0.1em;
  margin-right: 4px;
}

.cal__nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cal__nav button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1;
  border: var(--hair) solid transparent;
  transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out),
    background-color 0.3s var(--ease-out);
}

.cal__nav button:hover {
  color: var(--ink-0);
  border-color: var(--line-mid);
  background: rgba(127, 178, 217, 0.05);
}

.cal__nav .cal__today-btn {
  width: auto;
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
}

/* 星期行 */
.cal__week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 6px;
}

.cal__week span {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  padding-bottom: 4px;
}

/* 日期网格 */
.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.day {
  position: relative;
  min-height: clamp(42px, 4.4vw, 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  padding: 6px 2px 15px;
  border: var(--hair) solid transparent;
  border-radius: 1px;
  background: transparent;
  transition: background-color 0.28s var(--ease-out),
    border-color 0.28s var(--ease-out);
}

.day:hover {
  background: rgba(127, 178, 217, 0.07);
  border-color: var(--line);
}

.day__num {
  font-family: var(--font-num);
  font-size: 12.5px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
}

/* 已经过去的普通日期：灰 */
.day.is-past .day__num {
  color: var(--ink-3);
}

/* 不属于本月 */
.day.is-out .day__num {
  color: rgba(109, 122, 140, 0.28);
}

.day.is-out {
  pointer-events: auto;
}

/* 今天 */
.day.is-today {
  border-color: var(--line-hi);
  background: rgba(127, 178, 217, 0.055);
}

.day.is-today .day__num {
  color: #fff;
}

.day.is-today::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

/* 选中 */
.day.is-selected {
  background: color-mix(in srgb, var(--orange) 12%, transparent);
  border-color: color-mix(in srgb, var(--orange) 68%, transparent);
}

/* 任务彩点：同一天多个任务 → 多个点并排，颜色互不覆盖 */
.day__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 6px;
  margin-top: 1px;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dot-color, var(--ink-2));
  opacity: 0.95;
}

.dot.is-overdue {
  background: #d0342b;
  box-shadow: 0 0 7px 1px rgba(208, 52, 43, 0.75);
}

/* 有任务但未逾期：日期数字按任务类型着色（仅单类型时） */
.day.has-task .day__num {
  color: var(--day-type-color, var(--ink-0));
}

/* 逾期日期：深红 + 克制发光（放在 has-task 之后，保证类型色不会盖掉逾期色） */
.day.is-overdue .day__num {
  color: #e07a72;
  text-shadow: 0 0 16px rgba(190, 52, 44, 0.65);
}

.day.is-overdue {
  border-color: rgba(176, 58, 48, 0.35);
  background: rgba(150, 34, 28, 0.14);
}

.day__multi {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  color: var(--ink-3);
  white-space: nowrap;
  opacity: 0.9;
}

/* 当天任务全部完成：不再占用类型色，回到低对比 */
.day.is-alldone .day__num {
  color: var(--ink-3);
}

.day.is-alldone .dot {
  opacity: 0.35;
}

/* ---------------- 当日任务列表 ---------------- */

.day-list {
  margin-top: 20px;
  padding-top: 14px;
  border-top: var(--hair) solid var(--line);
}

.day-list__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.day-list__date {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-1);
}

.day-list__date em {
  font-style: normal;
  font-family: var(--font-num);
  font-size: 17px;
  color: var(--ink-0);
  margin-right: 3px;
}

.day-list__count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
}

.day-list__items {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: clamp(120px, 20vh, 232px);
  overflow-y: auto;
}

.trow {
  display: grid;
  grid-template-columns: 2px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 7px 6px 7px 0;
  text-align: left;
  border-bottom: var(--hair) solid rgba(146, 178, 219, 0.05);
  transition: background-color 0.25s var(--ease-out);
}

.trow:hover {
  background: rgba(127, 178, 217, 0.06);
}

.trow__bar {
  align-self: stretch;
  width: 2px;
  background: var(--trow-color, var(--ink-3));
  opacity: 0.9;
}

.trow__main {
  min-width: 0;
}

.trow__name {
  display: block;
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--ink-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trow.is-done .trow__name {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-color: rgba(109, 122, 140, 0.5);
}

.trow__sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.trow__state {
  color: var(--trow-color, var(--ink-2));
}

.trow__time {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.day-list__empty {
  padding: 14px 2px;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

/* 图例 */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: var(--hair) solid var(--line);
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.legend__item i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.legend__item--deadline {
  color: color-mix(in srgb, var(--type-deadline) 72%, #8a8f98);
}
.legend__item--video {
  color: color-mix(in srgb, var(--type-video) 72%, #8a8f98);
}
.legend__item--special {
  color: color-mix(in srgb, var(--type-special) 72%, #8a8f98);
}
.legend__item--overdue {
  color: #c96a63;
}

@media (max-width: 900px) {
  .day {
    min-height: 44px;
  }
  .day-list__items {
    max-height: none;
  }
}


/* 当日列表里的「在这天添加」：直接把新任务落在这一天 */
.day-list__head {
  flex-wrap: wrap;
  gap: 8px 10px;
}
.day-list__add {
  margin-inline-start: auto;
  padding: 4px 9px;
  border: var(--hair) solid var(--line-mid);
  background: none;
  color: var(--ink-2);
  font-family: var(--font-cn);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.day-list__add:hover {
  color: var(--ink-0);
  border-color: var(--line-hi);
}
