/* ═══════════ 日历 App ═══════════ */

#calendarApp {
  background: var(--bg, #f5f5f7);
}

/* ── 导航栏角色选择器 ── */
.nav-select {
  padding: 4px 8px;
  border: 1px solid var(--hairline, #ddd);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--ink, #333);
  font-size: 12px;
  max-width: 130px;
  outline: none;
}

/* ── 月份标题 ── */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  background: var(--surface, #fff);
}

.cal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink, #222);
}

.cal-nav-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--bg, #f0f0f0);
  color: var(--ink, #555);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.cal-nav-btn:active {
  background: var(--hairline, #ddd);
}

/* ── 星期标签 ── */
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 6px 8px 4px;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--hairline, #eee);
}

.cal-weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-subtle, #999);
  padding: 4px 0;
}

/* ── 日期网格 ── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 4px 8px;
  background: var(--surface, #fff);
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 2px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 44px;
  position: relative;
}
.cal-cell:active {
  background: var(--bg, #f0f0f0);
}

.cal-cell.other-month .cal-day-num {
  color: var(--ink-subtle, #ccc);
  opacity: 0.4;
}

.cal-cell.today {
  background: var(--accent-light, rgba(29, 155, 240, 0.08));
}
.cal-cell.today .cal-day-num {
  font-weight: 700;
  color: var(--accent, #1d9bf0);
  background: var(--accent, #1d9bf0);
  color: #fff;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-day-num {
  font-size: 14px;
  color: var(--ink, #333);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 事件圆点 ── */
.cal-dots {
  display: flex;
  gap: 2px;
  margin-top: 1px;
  flex-wrap: wrap;
  justify-content: center;
}

.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent, #1d9bf0);
}

.cal-dot-more {
  font-size: 10px;
  color: var(--ink-subtle, #999);
  line-height: 1;
}

/* ── 今日快览 ── */
.cal-today-summary {
  padding: 8px 16px 16px;
  background: var(--surface, #fff);
  flex-shrink: 0;
}

.cal-summary-empty {
  text-align: center;
  color: var(--ink-subtle, #bbb);
  font-size: 13px;
  padding: 8px;
}

.cal-summary-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: var(--bg, #f8f8f8);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink, #444);
}

.cal-summary-emoji {
  font-size: 18px;
  flex-shrink: 0;
}

/* ── 类型选择按钮 ── */
.cal-type-btn {
  transition: all 0.15s;
}
.cal-type-btn:active {
  transform: scale(0.95);
}

.cal-owner-btn {
  transition: all 0.15s;
}

/* ── 暗色模式 ── */
@media (prefers-color-scheme: dark) {
  #calendarApp {
    --bg: #1a1a1e;
    --surface: #1e1e24;
    --ink: #eee;
    --ink-subtle: #888;
    --hairline: #333;
    --accent: #3b9eff;
    --accent-light: rgba(59, 158, 255, 0.1);
  }

  .cal-cell.today {
    background: rgba(59, 158, 255, 0.12);
  }

  .cal-cell:active {
    background: rgba(255,255,255,0.05);
  }

  .cal-nav-btn {
    background: #2a2a30;
    color: #ccc;
  }
  .cal-nav-btn:active {
    background: #3a3a40;
  }
}
