/* ════════════════════════════════════════════════════════════════
   MMV Calendar · Apple-like redesign
   设计依据：MY_APPLE「我的苹果技能包」DESIGN_SYSTEM_APPLE_LIKE.md
   - 连续圆角、发丝描边、柔和分层阴影
   - 明亮低饱和类别色 + 同色系深色文字（替代深色描边色块）
   - 去卡片套卡片：calendar-frame 不再是第二层卡片
   ════════════════════════════════════════════════════════════════ */

/* ── 日历本地设计 token ─────────────────────────────────────────── */
.calendar-sheet {
  --cal-ink: hsl(var(--card-foreground));
  --cal-muted: hsl(var(--muted-foreground) / .72);
  --cal-faint: hsl(var(--muted-foreground) / .5);
  --cal-hairline: hsl(var(--border) / .6);
  --cal-hairline-strong: hsl(var(--border) / .9);
  --cal-track: hsl(var(--secondary) / .72);
  --cal-r-event: 8px;      /* 月视图/全天日程胶囊 */
  --cal-r-time: 10px;      /* 时间块 */
  --cal-r-control: 10px;   /* 输入框、小控件 */
  --cal-shadow-event: 0 1px 2px hsl(224 40% 30% / .05), 0 3px 10px hsl(224 40% 30% / .06);
  --cal-shadow-pop: 0 4px 14px hsl(224 40% 30% / .08), 0 12px 32px hsl(224 40% 30% / .1);
}

/* ── 8 个日程类别的色相变量（Apple Calendar 式明亮色板） ───────── */
[data-calendar-id="mmv-eat"]     { --ch: 26;  --cs: 90%; }
[data-calendar-id="mmv-study"]   { --ch: 242; --cs: 64%; }
[data-calendar-id="mmv-play"]    { --ch: 340; --cs: 76%; }
[data-calendar-id="mmv-make"]    { --ch: 272; --cs: 56%; }
[data-calendar-id="mmv-sleep"]   { --ch: 252; --cs: 56%; }
/* 憩：比已删的歇 hsl(205,72%) 更浅的晶蓝色（更青、更低饱和） */
[data-calendar-id="mmv-nap"]     { --ch: 200; --cs: 60%; }
[data-calendar-id="mmv-walk"]    { --ch: 138; --cs: 52%; }
[data-calendar-id="mmv-birthday"]{ --ch: 325; --cs: 70%; }

/* ── 承载面板：单层表面，不再卡片套卡片 ─────────────────────────── */
/* 日历是数据密集型网格（周视图 7 列 + 左侧时间列），比日记/聊天需要更宽的
   画布；单独放宽面板上限，其它模块仍保持 .module-sheet 的 980px */
.module-sheet.calendar-sheet {
  width: min(1320px, calc(100% - 48px));
}
.calendar-sheet {
  padding: 18px 28px 30px;
  min-height: 560px;
  display: flex;
  flex-direction: column;
}

.calendar-frame {
  position: relative;
  flex: 1;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

/* ── 工具栏 ─────────────────────────────────────────────────────── */
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 2px 14px;
}

.calendar-date-jump {
  display: inline-flex;
  align-items: center;
}

.calendar-date-jump input {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cal-ink);
  background: hsl(var(--secondary) / .55);
  border: 1px solid var(--cal-hairline);
  border-radius: var(--cal-r-control);
  padding: 7px 10px;
  outline: none;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.calendar-date-jump input:hover { background: hsl(var(--secondary) / .85); }
.calendar-date-jump input:focus-visible {
  background: hsl(var(--card));
  border-color: hsl(var(--accent-foreground) / .45);
  box-shadow: 0 0 0 3px hsl(var(--accent-foreground) / .12);
}
.calendar-date-jump input::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }

#calendarPeriod {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: .01em;
  color: var(--cal-ink);
  user-select: none;
}

/* iOS 风格分段控件：浅灰轨道 + 白色浮起选中块 */
.view-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--cal-track);
  border: 1px solid var(--cal-hairline);
  border-radius: 999px;
}
.view-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--cal-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.view-switch button:hover { color: var(--cal-ink); background: hsl(var(--card) / .55); }
.view-switch button:active { transform: scale(.96); }
.view-switch button.is-selected {
  background: hsl(var(--card));
  color: var(--cal-ink);
  font-weight: 700;
  box-shadow: 0 1px 2px hsl(224 40% 30% / .08), 0 2px 6px hsl(224 40% 30% / .08);
}

#calendarRoot { width: 100%; height: clamp(720px, 78vh, 920px); min-height: 440px; position: relative; }
#calendarRoot * { color: var(--cal-ink); }

/* ── TUI 结构布局（几何必需，第三方 CSS 未提供，勿删） ──────────── */
.tui-calendar-viewport {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .3s var(--ease-out, ease-out), transform .35s var(--ease-spring, ease);
}
.tui-calendar-viewport.is-hidden {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
}
.tui-full-calendar-layout { width: 100%; height: 100%; margin: 0; }
.tui-full-calendar-month { height: 100%; display: flex; flex-direction: column; }
.tui-full-calendar-month-week-container { position: relative; flex: 1; }
.tui-full-calendar-weekday {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.tui-full-calendar-weekday-header { position: relative; display: flex; }
.tui-full-calendar-weekday-body { position: relative; flex: 1; }
.tui-full-calendar-weekday-grid {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-content: flex-start;
}
.tui-full-calendar-weekday-grid-header { position: relative; display: flex; }
.tui-full-calendar-weekday-grid-body { position: relative; flex: 1; }
.tui-full-calendar-weekday-grid-container { position: relative; display: flex; flex-wrap: wrap; height: 100%; border-top: none; }
.tui-full-calendar-weekday-resizers { position: absolute; }
.tui-full-calendar-weekday-row-wrapper { position: relative; }
.tui-full-calendar-weekday-grid-line {
  position: relative;
  left: auto !important;   /* 中和 TUI 绝对定位模型留下的内联 left/top */
  top: auto !important;
  flex: 0 0 14.2857%;
  width: 14.2857%;
  min-height: 96px;
  overflow: hidden;
}
.tui-full-calendar-weekday-schedule-block { position: absolute; }
.tui-full-calendar-weekday-schedule { position: relative; }
.tui-full-calendar-weekday-schedule-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 周/日视图时间网格几何 */
.tui-full-calendar-weekday-allday { position: relative; display: flex; }
.tui-full-calendar-allday-left { flex-shrink: 0; }
.tui-full-calendar-allday-right { flex: 1; min-width: 0; }
.tui-full-calendar-timegrid { height: 100%; display: flex; flex-direction: column; }
.tui-full-calendar-timegrid-top { display: flex; }
.tui-full-calendar-timegrid-left { width: 72px; flex-shrink: 0; }
.tui-full-calendar-timegrid-right { flex: 1; min-width: 0; }
.tui-full-calendar-timegrid-allday-container { position: relative; }
.tui-full-calendar-timegrid-body { display: flex; flex: 1; position: relative; overflow: hidden; }
/* 容器自身即纵向滚动区（TUI 模型），不可改成 flex：否则右栏被压成视口高度、当前时间线错位 */
.tui-full-calendar-timegrid-container {
  position: relative;
  flex: 1;
  height: 100%;
  overflow: hidden;
  overflow-y: scroll;
}
.tui-full-calendar-timegrid-right { height: auto; min-width: 0; }
.tui-full-calendar-timegrid-hour { position: relative; }
.tui-full-calendar-timegrid-halves { position: absolute; width: 100%; height: 100%; }
.tui-full-calendar-timegrid-cols { position: absolute; inset: 0; display: flex; }
.tui-full-calendar-timegrid-col { flex: 1; }
.tui-full-calendar-timegrid-schedules { position: absolute; inset: 0; }
.tui-full-calendar-time-schedule { position: relative; }
.tui-full-calendar-time-schedule-content { overflow: hidden; }

/* ══════════ 月视图 ══════════════════════════════════════════════ */

/* 星期表头 */
.tui-full-calendar-weekday-header { border-bottom: 1px solid var(--cal-hairline-strong) !important; }
.tui-full-calendar-weekday-header-title {
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: .08em;
  color: var(--cal-muted) !important;
  padding: 4px 10px 8px !important;
}


/* 网格：只保留发丝分隔线，去掉厚重色块 */
.tui-full-calendar-month-week,
.tui-full-calendar-weekday-grid-line,
.tui-full-calendar-weekday-grid-line-weekend {
  border-color: var(--cal-hairline) !important;
  background: transparent !important;
}
.tui-full-calendar-weekday-grid-line-weekend {
  background: hsl(var(--secondary) / .28) !important;
}
.tui-full-calendar-weekday-grid-line:hover { background: hsl(var(--accent) / .4) !important; }
.tui-full-calendar-weekday-grid-header,
.tui-full-calendar-weekday-grid-left,
.tui-full-calendar-weekday-grid-right { border-color: var(--cal-hairline) !important; }

/* 日期数字 */
.tui-full-calendar-weekday-grid-date {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--cal-ink) !important;
  width: 24px !important;
  height: 24px !important;
  line-height: 24px !important;
  margin: 2px 4px !important;
  transition: background-color .18s ease;
}
.tui-full-calendar-weekday-grid-date-other-month,
.tui-full-calendar-extra-date { color: var(--cal-faint) !important; opacity: .8; }
/* 中和 TUI 内置周末红：统一使用弱化墨色 */
.tui-full-calendar-holiday-sun,
.tui-full-calendar-holiday-sat { color: var(--cal-muted) !important; }
.tui-full-calendar-holiday-sun > .tui-full-calendar-weekday-grid-date,
.tui-full-calendar-holiday-sat > .tui-full-calendar-weekday-grid-date,
.tui-full-calendar-holiday-sun .tui-full-calendar-weekday-header-title,
.tui-full-calendar-holiday-sat .tui-full-calendar-weekday-header-title { color: var(--cal-muted) !important; }
.tui-full-calendar-weekday-header-weekend .tui-full-calendar-weekday-header-title { color: var(--cal-faint) !important; }
.tui-full-calendar-weekday-grid-date.tui-full-calendar-today,
.tui-full-calendar-weekday-grid-date-decorator.tui-full-calendar-today {
  background: hsl(var(--accent-foreground)) !important;
  color: hsl(var(--accent)) !important;
  border-radius: 50% !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px hsl(var(--accent-foreground) / .28);
}
/* 今天整格不再铺深色底 */
.tui-full-calendar-today { background: transparent !important; }

/* “N more” 链接 */
.tui-full-calendar-weekday-grid-more-schedules {
  color: var(--cal-muted) !important;
  font-weight: 500 !important;
  font-size: 12px !important;
  height: 20px !important;
  line-height: 20px !important;
  padding: 0 7px !important;
  border-radius: 6px !important;
  transition: background-color .16s ease, color .16s ease;
}
.tui-full-calendar-weekday-grid-more-schedules:hover {
  background: hsl(var(--accent) / .6) !important;
  color: hsl(var(--accent-foreground)) !important;
}

/* ── 月视图 / 全天 日程胶囊 ─────────────────────────────────────── */
.tui-full-calendar-weekday-schedule {
  border-radius: var(--cal-r-event) !important;  /* 替代 TUI 内联 2px 尖角 */
  border: 1px solid transparent !important;
  border-left-width: 1px !important;             /* 去掉 3px 深色左条 */
  height: 26px !important;
  line-height: 26px !important;
  margin: 0 6px 2px !important;
  overflow: hidden;
  cursor: pointer;
  transition: background-color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.tui-full-calendar-weekday-schedule:hover {
  box-shadow: 0 1px 3px hsl(var(--ch, 220) 50% 40% / .14);
  transform: translateY(-.5px);
}
.tui-full-calendar-weekday-schedule-title {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 8px;
  gap: 6px;
  min-width: 0;
}

/* 类别柔和填色（浅色系） */
.tui-full-calendar-weekday-schedule[data-calendar-id] {
  background-color: hsl(var(--ch) var(--cs) 94% / .66) !important;
  border-color: hsl(var(--ch) var(--cs) 84% / .85) !important;
}
.tui-full-calendar-weekday-schedule[data-calendar-id]:hover {
  background-color: hsl(var(--ch) var(--cs) 90% / .9) !important;
}
/* 月视图 / 全天单行胶囊只有 22px 高、格子窄，只保留标题；教师与地点会在
   日 / 周视图的时间块里竖排完整展示，避免每个胶囊都拖尾重复地址造成噪音 */
.tui-full-calendar-weekday-schedule .mmv-tui-schedule__teacher,
.tui-full-calendar-weekday-schedule .mmv-tui-schedule__location { display: none !important; }

/* ══════════ 周视图 / 日视图（时间网格） ═════════════════════════ */

.tui-full-calendar-timegrid-hour span {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--cal-muted) !important;
  letter-spacing: .02em;
}
.tui-full-calendar-timegrid-gridline,
.tui-full-calendar-timegrid-halfhour,
.tui-full-calendar-timegrid-hourmarker-line,
.tui-full-calendar-timegrid-hourmarker-line-left {
  border-color: var(--cal-hairline) !important;
}
.tui-full-calendar-timegrid-container,
.tui-full-calendar-timegrid-left { border-color: var(--cal-hairline-strong) !important; }

/* 全天区域 */
.tui-full-calendar-allday-left,
.tui-full-calendar-allday-right { border-color: var(--cal-hairline-strong) !important; }
.tui-full-calendar-allday-left { color: var(--cal-muted) !important; font-size: 11.5px !important; font-weight: 600 !important; }

/* 日/周视图：全天（节日/纪念日/生日）事件块定位到 All Day 栏顶部。
   tui 把 .tui-full-calendar-weekday-grid 当作 96px 占位层放在文档流里，
   导致真正承载 pill 的 .tui-full-calendar-weekday 列被挤到占位层底部、
   落进时间格区域并被时间格白底盖住。这里把网格层改为绝对定位脱流，
   让日期列自然落在栏顶，并把 pill 层级抬到网格之上。 */
.tui-full-calendar-allday-right .tui-full-calendar-container { position: relative; }
.tui-full-calendar-allday-right .tui-full-calendar-weekday-grid {
  position: absolute !important;
  left: 0; right: 0; top: 0; bottom: 0;
  z-index: 0;
  background: transparent !important;
}
.tui-full-calendar-allday-right .tui-full-calendar-weekday { position: relative; z-index: 2; }
.tui-full-calendar-allday-right .tui-full-calendar-weekday-schedules,
.tui-full-calendar-allday-right .tui-full-calendar-weekday-schedule-block,
.tui-full-calendar-allday-right .tui-full-calendar-weekday-schedule {
  position: relative !important;
  z-index: 3 !important;
}

/* 时间事件块 */
.tui-full-calendar-time-schedule {
  border-radius: var(--cal-r-time) !important;
  border: 1px solid transparent !important;
  opacity: 1 !important;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--cal-shadow-event);
  transition: filter .18s ease, box-shadow .18s ease, transform .12s ease;
}
.tui-full-calendar-time-schedule:hover {
  filter: saturate(1.06) brightness(.985);
  box-shadow: 0 2px 6px hsl(var(--ch, 220) 50% 40% / .16), 0 6px 16px hsl(var(--ch, 220) 50% 40% / .1);
}
.tui-full-calendar-time-schedule[data-calendar-id] {
  background-color: hsl(var(--ch) var(--cs) 95% / .82) !important;
  border-color: hsl(var(--ch) var(--cs) 82% / .75) !important;
}
/* 去掉内容层 3px 深色左条，用整块柔和填充 */
.tui-full-calendar-time-schedule-content {
  border-left: 0 !important;
  /* 上下留白取小值：早餐/放风这类半小时短块内容盒只有 26px，
     padding 过大会把唯一一行标题垂直裁掉；左右收紧让长标题少截断 */
  padding: 3px 8px !important;
}
.tui-full-calendar-time-schedule-content-time { border-color: transparent !important; }

/* 当前时间指示线：细实线 + 小圆点 */
.tui-full-calendar-timegrid-now-line,
.tui-full-calendar-timegrid-hourmarker-line-today {
  border: 0 !important;
  background: hsl(var(--accent-foreground)) !important;
  height: 2px !important;
  opacity: .85;
}
.tui-full-calendar-timegrid-now-display-label,
.tui-full-calendar-timegrid-now-line-left { background: transparent !important; }
.tui-full-calendar-timegrid-hourmarker-line-left { border-top-style: solid !important; opacity: .7; }
.tui-full-calendar-timegrid-hourmarker-time,
.tui-full-calendar-timegrid-hourmarker-time * { color: hsl(var(--accent-foreground)) !important; font-weight: 650 !important; }
.tui-full-calendar-timegrid-todaymarker { background-color: hsl(var(--accent-foreground)) !important; border-radius: 2px; }

/* ══════════ 日程卡片内部（月/全天为单行，时间块为竖排） ═════════ */
.mmv-tui-schedule {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  font-family: inherit;
  line-height: 1.3;
}
.mmv-tui-schedule__title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 0;
}
.mmv-tui-schedule__teacher,
.mmv-tui-schedule__location {
  font-size: 13px;
  font-weight: 450;
  color: var(--cal-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
/* 类别色文字（盖过 #calendarRoot * 的统一墨色） */
[data-calendar-id] .mmv-tui-schedule__title { color: hsl(var(--ch) var(--cs) 36%) !important; }
.mmv-tui-schedule__teacher::before,
.mmv-tui-schedule__location::before {
  content: "·";
  margin-right: 6px;
  color: var(--cal-faint);
  font-weight: 700;
}
/* 时间块：标题/教师/地点竖排，不再是叠色块 */
.tui-full-calendar-time-schedule .mmv-tui-schedule {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.tui-full-calendar-time-schedule .mmv-tui-schedule__title { font-size: 15.5px; line-height: 1.25; flex-shrink: 1; width: 100%; }
.tui-full-calendar-time-schedule .mmv-tui-schedule__teacher,
.tui-full-calendar-time-schedule .mmv-tui-schedule__location { width: 100%; line-height: 1.25; }
.tui-full-calendar-time-schedule .mmv-tui-schedule__teacher::before,
.tui-full-calendar-time-schedule .mmv-tui-schedule__location::before { content: none; }

/* ══════════ 年视图 ══════════════════════════════════════════════ */
.calendar-year-view {
  position: relative;
  flex: 1;
  height: 100%;
  min-height: 440px;
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .3s var(--ease-out, ease-out), transform .35s var(--ease-spring, ease);
}
.calendar-year-view.is-hidden {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
}
.year-view__scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 2px 4px 12px;
}
.year-section {
  background: hsl(var(--card) / .92);
  border: 1px solid var(--cal-hairline);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px hsl(224 40% 30% / .04);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.year-section:hover {
  border-color: hsl(var(--border) / 1);
  box-shadow: var(--cal-shadow-pop);
  transform: translateY(-1px);
}
.year-section__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}
.year-section__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--cal-ink);
  min-width: 52px;
}
.year-nav {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--cal-hairline);
  background: hsl(var(--secondary) / .5);
  color: var(--cal-muted);
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, transform .12s ease;
}
.year-nav:hover { background: hsl(var(--accent) / .7); color: hsl(var(--accent-foreground)); }
.year-nav:active { transform: scale(.92); }
.year-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.year-cell {
  appearance: none;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  font-family: inherit;
  transition: background-color .16s ease;
}
.year-cell:hover { background: hsl(var(--accent) / .45); }
.year-cell__name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--cal-ink);
  margin-bottom: 5px;
}
.year-cell__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.year-cell__grid i {
  position: relative;
  font-style: normal;
  font-size: 9.5px;
  line-height: 16px;
  text-align: center;
  color: var(--cal-muted);
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}
/* 有日程的日期：底部小圆点；hover 时弹当天清单卡 */
.year-cell__grid i.has-schedule { font-weight: 600; color: var(--cal-ink); }
.year-cell__grid i.has-schedule::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: hsl(var(--accent-foreground) / .6);
}
.year-cell__grid i.is-today.has-schedule::after { background: hsl(var(--accent)); }
.year-cell__grid i.has-schedule:hover { background: hsl(var(--accent) / .55); }
.year-cell__grid i.is-dow {
  font-size: 8.5px;
  font-weight: 650;
  color: var(--cal-faint);
  letter-spacing: .04em;
}
.year-cell__grid i.year-old { color: var(--cal-faint); }
.year-cell__grid i.is-today {
  background: hsl(var(--accent-foreground));
  color: hsl(var(--accent));
  font-weight: 700;
  border-radius: 50%;
  box-shadow: 0 1px 4px hsl(var(--accent-foreground) / .3);
}

/* ── “更多日程”浮层：Apple 式弹出卡片 ──────────────────────────── */
.tui-full-calendar-floating-layer {
  background: hsl(var(--card) / .96) !important;
  border: 1px solid var(--cal-hairline-strong) !important;
  border-radius: 16px !important;
  box-shadow: var(--cal-shadow-pop) !important;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  overflow: hidden;
  padding: 12px !important;
}
.tui-full-calendar-month-more { min-width: 260px !important; }
.tui-full-calendar-month-more-title-day {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--cal-ink) !important;
}
.tui-full-calendar-month-more-title-day-label {
  font-size: 11.5px !important;
  color: var(--cal-muted) !important;
}
.tui-full-calendar-month-more-close { color: var(--cal-muted) !important; border-radius: 8px; }
.tui-full-calendar-month-more-close:hover { background: hsl(var(--secondary) / .7); color: var(--cal-ink) !important; }
.tui-full-calendar-month-more-list { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.tui-full-calendar-month-more-schedule {
  border-radius: 8px !important;
  padding: 5px 8px !important;
  font-weight: 600 !important;
  border: 1px solid transparent !important;
  border-left-width: 1px !important;
}

/* 加载 / 失败提示 */
.mmv-calendar-fallback {
  margin: 24px auto;
  max-width: 420px;
  text-align: center;
  padding: 22px 24px;
  border-radius: 16px;
  background: hsl(var(--secondary) / .45);
  color: var(--cal-muted);
  font-size: 13px;
  line-height: 1.7;
}

/* 滚动条：细、柔和 */
#calendarRoot ::-webkit-scrollbar,
.year-view__scroll::-webkit-scrollbar { width: 8px; height: 8px; }
#calendarRoot ::-webkit-scrollbar-thumb,
.year-view__scroll::-webkit-scrollbar-thumb {
  background: hsl(var(--muted-foreground) / .22);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
#calendarRoot ::-webkit-scrollbar-thumb:hover,
.year-view__scroll::-webkit-scrollbar-thumb { background: hsl(var(--muted-foreground) / .35); background-clip: content-box; }

/* ══════════ 日程悬浮信息卡（hover 色块即显） ═══════════════════ */
.mmv-cal-tip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  min-width: 176px;
  max-width: 300px;
  padding: 11px 13px;
  border-radius: 14px;
  /* 卡片挂在 body 下，颜色只用 :root 全局 token，明暗双模自动适配 */
  background: hsl(var(--card) / .96);
  border: 1px solid hsl(var(--border) / .9);
  box-shadow: 0 6px 18px hsl(224 40% 30% / .1), 0 18px 44px hsl(224 40% 30% / .14);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  font-family: var(--font-body);
  color: hsl(var(--card-foreground));
  line-height: 1.35;
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px) scale(.98);
  transform-origin: center bottom;
  transition: opacity .16s var(--ease-out, ease-out),
              transform .2s cubic-bezier(.16, 1, .3, 1),
              visibility 0s linear .2s;
}
.mmv-cal-tip.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .16s var(--ease-out, ease-out),
              transform .22s cubic-bezier(.16, 1, .3, 1);
}
.mmv-cal-tip.is-below { transform-origin: center top; }
.mmv-cal-tip__head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.mmv-cal-tip__dot {
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: hsl(var(--ch, 220) var(--cs, 60%) 45%);
  box-shadow: 0 0 0 2px hsl(var(--ch, 220) var(--cs, 60%) 45% / .18);
}
.mmv-cal-tip__title {
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  color: hsl(var(--ch, 220) var(--cs, 60%) 34%);
}
.mmv-cal-tip__date {
  margin-top: 5px;
  padding-left: 17px;
  font-size: 12.5px;
  color: hsl(var(--muted-foreground) / .88);
}
.mmv-cal-tip__time {
  margin-top: 1px;
  padding-left: 17px;
  font-size: 12.5px;
  color: hsl(var(--muted-foreground) / .88);
  font-variant-numeric: tabular-nums;
}
.mmv-cal-tip__row {
  margin-top: 2px;
  padding-left: 17px;
  font-size: 12.5px;
  color: hsl(var(--muted-foreground) / .88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
/* 年视图：当天日程清单卡 */
.mmv-cal-tip.is-year { min-width: 216px; max-width: 320px; }
.mmv-cal-tip__yhead {
  font-size: 13.5px;
  font-weight: 600;
  color: hsl(var(--card-foreground));
  padding-bottom: 7px;
  margin-bottom: 7px;
  border-bottom: 1px solid hsl(var(--border) / .7);
}
.mmv-cal-tip__list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 264px;
  overflow: hidden;
}
.mmv-cal-tip__item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12.5px;
}
.mmv-cal-tip__item .mmv-cal-tip__dot {
  width: 7px;
  height: 7px;
  margin-top: 0;
  box-shadow: none;
}
.mmv-cal-tip__item-time {
  flex: none;
  width: 42px;
  color: hsl(var(--muted-foreground) / .85);
  font-variant-numeric: tabular-nums;
}
.mmv-cal-tip__item-title {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: hsl(var(--card-foreground));
}
.mmv-cal-tip__more {
  margin-top: 7px;
  font-size: 11.5px;
  color: hsl(var(--muted-foreground) / .7);
}
/* 年视图列表色点：8 类别各自的色相 */
.mmv-cal-tip__dot[data-cal="mmv-eat"]     { background: hsl(26 90% 45%); }
.mmv-cal-tip__dot[data-cal="mmv-study"]   { background: hsl(242 64% 52%); }
.mmv-cal-tip__dot[data-cal="mmv-play"]    { background: hsl(340 76% 50%); }
.mmv-cal-tip__dot[data-cal="mmv-make"]    { background: hsl(272 56% 50%); }
.mmv-cal-tip__dot[data-cal="mmv-sleep"]   { background: hsl(252 56% 52%); }
.mmv-cal-tip__dot[data-cal="mmv-nap"]     { background: hsl(200 60% 55%); }
.mmv-cal-tip__dot[data-cal="mmv-walk"]    { background: hsl(138 52% 40%); }
.mmv-cal-tip__dot[data-cal="mmv-birthday"]{ background: hsl(325 70% 50%); }

/* ══════════ 暗色模式：深色半透明类别色 ══════════════════════════ */
[data-mode="dark"] .calendar-sheet {
  --cal-hairline: hsl(0 0% 100% / .09);
  --cal-hairline-strong: hsl(0 0% 100% / .14);
  --cal-track: hsl(0 0% 100% / .07);
  --cal-shadow-event: 0 1px 2px rgb(0 0 0 / .3), 0 3px 10px rgb(0 0 0 / .28);
  --cal-shadow-pop: 0 4px 14px rgb(0 0 0 / .4), 0 14px 36px rgb(0 0 0 / .45);
}
/* 强制中和 TUI 内联白底，让整个日历表面进入暗色 */
[data-mode="dark"] .tui-full-calendar-layout,
[data-mode="dark"] .tui-full-calendar-month,
[data-mode="dark"] .tui-full-calendar-week,
[data-mode="dark"] .tui-full-calendar-day,
[data-mode="dark"] .tui-full-calendar-timegrid-right,
[data-mode="dark"] .tui-full-calendar-timegrid-h-grid,
[data-mode="dark"] .tui-full-calendar-weekday-grid-line,
[data-mode="dark"] .tui-full-calendar-weekday-allday,
[data-mode="dark"] .tui-full-calendar-allday-right,
[data-mode="dark"] .tui-full-calendar-dayname-container,
[data-mode="dark"] .tui-full-calendar-timegrid-allday-container,
[data-mode="dark"] .tui-full-calendar-timegrid-left,
[data-mode="dark"] .tui-full-calendar-timegrid-timezone,
[data-mode="dark"] .tui-full-calendar-timegrid-hour,
[data-mode="dark"] .tui-full-calendar-allday-left,
[data-mode="dark"] .tui-full-calendar-dayname-leftmargin,
[data-mode="dark"] .tui-full-calendar-dayname-left {
  background-color: hsl(var(--card)) !important;
}
[data-mode="dark"] .tui-full-calendar-timegrid-hour span,
[data-mode="dark"] .tui-full-calendar-weekday-grid-date,
[data-mode="dark"] .tui-full-calendar-weekday-header-title { color: var(--cal-ink) !important; }
[data-mode="dark"] .tui-full-calendar-weekday-grid-line-weekend { background: hsl(0 0% 100% / .03) !important; }
[data-mode="dark"] .tui-full-calendar-time-date.tui-full-calendar-today { background-color: hsl(var(--accent) / .22) !important; }
[data-mode="dark"] .tui-full-calendar-weekday-schedule[data-calendar-id] {
  background-color: hsl(var(--ch) var(--cs) 28% / .42) !important;
  border-color: hsl(var(--ch) var(--cs) 45% / .38) !important;
}
[data-mode="dark"] .tui-full-calendar-weekday-schedule[data-calendar-id]:hover {
  background-color: hsl(var(--ch) var(--cs) 34% / .6) !important;
}
[data-mode="dark"] .tui-full-calendar-time-schedule[data-calendar-id] {
  background-color: hsl(var(--ch) var(--cs) 24% / .58) !important;
  border-color: hsl(var(--ch) var(--cs) 48% / .32) !important;
}
[data-mode="dark"] [data-calendar-id] .mmv-tui-schedule__title { color: hsl(var(--ch) var(--cs) 80%) !important; }
[data-mode="dark"] .tui-full-calendar-weekday-grid-line-weekend { background: hsl(0 0% 100% / .03) !important; }
[data-mode="dark"] .year-section { background: hsl(0 0% 100% / .04); }
[data-mode="dark"] .view-switch button.is-selected { background: hsl(0 0% 100% / .14); }
[data-mode="dark"] .tui-full-calendar-floating-layer { background: hsl(225 30% 14% / .96) !important; }
[data-mode="dark"] .mmv-cal-tip {
  box-shadow: 0 6px 18px rgb(0 0 0 / .4), 0 18px 44px rgb(0 0 0 / .5);
}
[data-mode="dark"] .mmv-cal-tip__title { color: hsl(var(--ch) var(--cs) 78%); }

/* ══════════ 响应式 ═════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .mmv-cal-tip,
  .mmv-cal-tip.is-on { transition: none; transform: none; }
}
@media (max-width: 840px) {
  .calendar-sheet { padding: 14px 14px 22px; }
  .module-sheet.calendar-sheet { width: calc(100% - 28px); }
  .calendar-toolbar { flex-wrap: wrap; gap: 10px; }
  #calendarPeriod { font-size: 18px; order: -1; flex-basis: 100%; text-align: center; }
  .view-switch button { padding: 6px 12px; font-size: 12px; }
  .year-grid { grid-template-columns: 1fr; }
  .tui-full-calendar-weekday-schedule { margin: 0 3px 2px !important; }
  .mmv-tui-schedule__location,
  .mmv-tui-schedule__teacher { display: none; }
  .tui-full-calendar-time-schedule .mmv-tui-schedule__location,
  .tui-full-calendar-time-schedule .mmv-tui-schedule__teacher { display: block; }
}


/* hover 信息卡的活动备注正文 */
.mmv-cal-tip__note {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.8rem;
  line-height: 1.62;
  letter-spacing: 0.01em;
  max-width: 24rem;
  text-align: justify;
}
