/* FitPro — 计划排期日历 */

.stack-top--schedule h1 {
  flex: 1;
}

.schedule-intro {
  margin: 0 0 16px;
  padding: 0 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 0 4px;
}

.cal-month-label {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.cal-nav-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--surface-card);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.cal-nav-btn:active {
  transform: scale(0.94);
  border-color: rgba(217, 255, 0, 0.3);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
  padding: 0 2px;
}

.cal-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  align-items: stretch;
}

.cal-cell {
  position: relative;
  min-width: 0;
  min-height: 48px;
  height: 100%;
  padding: 6px 3px 5px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-family: var(--font-family-base);
  text-align: center;
  overflow: visible;
  box-sizing: border-box;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.12s ease;
}

.cal-cell:active {
  transform: scale(0.96);
}

.cal-cell--muted {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.cal-cell--today {
  border-color: rgba(217, 255, 0, 0.45);
  background: rgba(217, 255, 0, 0.08);
}

/* 已排期：虚线描边、空心 */
.cal-cell--scheduled {
  border: 1.5px dashed rgba(217, 255, 0, 0.55);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(217, 255, 0, 0.06);
}

.cal-cell--scheduled .cal-cell-day {
  color: var(--brand);
}

.cal-cell--scheduled .cal-cell-plan {
  color: rgba(217, 255, 0, 0.9);
}

/* 已训练：实线描边、半透明荧光绿底 */
.cal-cell--trained {
  border: 1px solid var(--brand);
  background: rgba(217, 255, 0, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(217, 255, 0, 0.12),
    0 4px 12px rgba(217, 255, 0, 0.14);
}

.cal-cell--trained .cal-cell-day,
.cal-cell--trained .cal-cell-plan {
  color: var(--brand);
  font-weight: 800;
}

.cal-cell--today.cal-cell--scheduled {
  border-style: dashed;
  border-color: var(--brand);
  box-shadow:
    inset 0 0 0 1px rgba(217, 255, 0, 0.12),
    0 0 0 1px rgba(217, 255, 0, 0.2);
}

.cal-cell--today.cal-cell--trained {
  background: rgba(217, 255, 0, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(217, 255, 0, 0.16),
    0 0 0 1px rgba(217, 255, 0, 0.25),
    0 4px 12px rgba(217, 255, 0, 0.18);
}

.cal-cell--missed {
  border-color: rgba(255, 69, 58, 0.45);
  background: rgba(255, 69, 58, 0.08);
}

.cal-cell--missed .cal-cell-day,
.cal-cell--missed .cal-cell-plan {
  color: #ff453a;
}

.cal-cell--readonly {
  cursor: default;
}

.cal-cell--readonly:active {
  transform: none;
}

.cal-cell-day {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.cal-cell--today .cal-cell-day {
  color: var(--brand);
}

.cal-cell-plan {
  display: block;
  margin-top: 4px;
  padding: 0 1px;
  max-width: 100%;
  font-size: 8px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--brand);
  white-space: normal;
  word-break: break-all;
  overflow: visible;
}

.cal-cell-dot {
  display: block;
  width: 5px;
  height: 5px;
  margin: 5px auto 0;
  border-radius: 50%;
  background: var(--brand);
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px 20px;
  padding: 0 4px 8px;
}

.cal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.cal-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.cal-legend-dot--scheduled {
  border: 1.5px dashed rgba(217, 255, 0, 0.65);
  background: transparent;
}

.cal-legend-dot--trained {
  border: 1.5px solid var(--brand);
  background: rgba(217, 255, 0, 0.35);
}

.cal-legend-dot--missed {
  border-color: rgba(255, 69, 58, 0.5);
  background: rgba(255, 69, 58, 0.28);
}

.cal-legend-item--missed {
  color: #ff453a;
}

#cal-plan-sheet.sheet-overlay {
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

#cal-plan-sheet .sheet-backdrop {
  inset: -4px;
  background: rgba(0, 0, 0, 0.78);
}

#cal-plan-sheet .sheet-panel {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 8px 20px 28px;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px 20px 0 0;
  background: #141414;
  box-sizing: border-box;
}

#cal-plan-sheet .sheet-handle {
  width: 40px;
  height: 5px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.16);
}

#cal-plan-sheet .sheet-panel h3 {
  margin-bottom: 6px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

#cal-plan-sheet .change-plan-picker {
  max-height: min(44vh, 320px);
}

.cal-clear-btn {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: transparent;
  font-family: var(--font-family-base);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease;
}

.cal-clear-btn:active {
  background: rgba(255, 255, 255, 0.04);
}

#schedule-toast.page-toast {
  bottom: 40px;
  z-index: 55;
}
