/* PC端 日程面板样式 · 2026-10-16
   放在顶栏右上角（与 AI 助手按钮一排），点开为右上角下滑面板。
   设计：苹果风 —— 白底圆角 14px、柔和阴影、浅灰分隔，主色 #4C6EF5。 */

/* 顶栏按钮激活态 */
#pcCalBtn.pc-cal-btn.active { color: var(--primary, #0052cc); }

/* 面板本体
   🔴 2026-10-16 修：原来写死 top:62px，紧贴右上角按钮排，视觉上"糊住"了那排快捷键，
   用户要求不能挡到右上角按钮。改为 JS 动态量测顶栏底部 + 16px 间隔后设置 top
   （见 pc_calendar.js 的 positionPanel()），这里只给兜底值。 */
.pc-cal-panel {
  position: fixed;
  top: 72px;                     /* 兜底；实际由 JS positionPanel() 覆盖 */
  right: 14px;
  width: 372px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  z-index: 40;
  background: #fff;
  border: 1px solid #e6e9ef;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(17, 24, 39, .14), 0 2px 8px rgba(17, 24, 39, .06);
  opacity: 0;
  transform: translateY(-8px) scale(.98);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, top .2s ease;
}
.pc-cal-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.pc-cal-panel.is-loading { opacity: .65; }

/* 头部：标题 + 周/月切换 + 关闭 */
.pcal-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid #f0f2f6;
}
.pcal-title { font-size: 14px; font-weight: 600; color: #1c1c1e; }
.pcal-seg {
  margin-left: auto;
  display: inline-flex;
  background: #f2f3f7;
  border-radius: 8px;
  padding: 2px;
}
.pcal-seg-i {
  font-size: 12px; color: #6b7280;
  padding: 3px 9px; border-radius: 6px;
  cursor: pointer; user-select: none;
  transition: background .15s ease, color .15s ease;
}
.pcal-seg-i.on { background: #fff; color: #1c1c1e; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.pcal-close {
  font-size: 13px; color: #9aa1ae; cursor: pointer;
  padding: 2px 5px; border-radius: 6px; user-select: none;
}
.pcal-close:hover { background: #f2f3f7; color: #1c1c1e; }

/* 区间标题 + 翻页 */
.pcal-nav {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px 4px;
}
.pcal-arrow {
  font-size: 16px; color: #6b7280; cursor: pointer;
  width: 20px; height: 20px; line-height: 18px; text-align: center;
  border-radius: 6px; user-select: none;
}
.pcal-arrow:hover { background: #f2f3f7; color: #1c1c1e; }
.pcal-range { flex: 1; text-align: center; font-size: 13px; color: #374151; font-weight: 600; }
.pcal-today {
  font-size: 12px; color: #4C6EF5; cursor: pointer;
  padding: 2px 7px; border-radius: 6px; user-select: none;
}
.pcal-today:hover { background: #eef1fb; }

/* 周视图 */
.pcal-grid { display: flex; padding: 6px 10px 10px; }
.pcal-day {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 6px 0 8px; margin: 0 2px;
  border-radius: 10px; cursor: pointer;
  transition: background .15s ease;
}
.pcal-day:hover { background: #f6f7fa; }
.pcal-day.on { background: #eef1fb; }
.pcal-day.is-today .pcal-dt {
  background: #4C6EF5; color: #fff; border-radius: 50%;
  width: 24px; height: 24px; line-height: 24px; text-align: center;
}
.pcal-wk { font-size: 11px; color: #9aa1ae; margin-bottom: 3px; }
.pcal-dt { font-size: 14px; color: #1c1c1e; width: 24px; height: 24px; line-height: 24px; text-align: center; }
.pcal-dot {
  font-size: 10px; color: #fff; background: #F2673E;
  min-width: 16px; height: 16px; line-height: 16px; text-align: center;
  border-radius: 8px; padding: 0 4px; margin-top: 4px;
}
.pcal-dotbox { height: 16px; margin-top: 4px; }

/* 月视图 */
.pcal-month { padding: 4px 12px 10px; }
.pcal-wk-head { display: flex; }
.pcal-wk-head span { flex: 1; text-align: center; font-size: 11px; color: #9aa1ae; padding: 4px 0; }
.pcal-mgrid { display: flex; flex-wrap: wrap; }
.pcal-mday {
  width: 14.285%; height: 38px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 8px; cursor: pointer;
  transition: background .15s ease;
}
.pcal-mday.empty { cursor: default; }
.pcal-mday:not(.empty):hover { background: #f6f7fa; }
.pcal-mday.on { background: #eef1fb; }
.pcal-mday.is-today .pcal-mdt {
  background: #4C6EF5; color: #fff; border-radius: 50%;
  width: 22px; height: 22px; line-height: 22px; text-align: center;
}
.pcal-mdt { font-size: 12.5px; color: #1c1c1e; }
.pcal-mdot { width: 5px; height: 5px; border-radius: 50%; background: #F2673E; margin-top: 2px; }

/* 选中哪天 · 当天任务 */
.pcal-todo { border-top: 1px solid #f0f2f6; padding: 10px 14px 12px; }
.pcal-todo-h { display: flex; align-items: center; margin-bottom: 6px; }
.pcal-todo-tx { font-size: 13px; font-weight: 600; color: #1c1c1e; }
.pcal-new {
  margin-left: auto; font-size: 12px; color: #4C6EF5;
  cursor: pointer; padding: 2px 7px; border-radius: 6px; user-select: none;
}
.pcal-new:hover { background: #eef1fb; }
.pcal-empty { font-size: 12.5px; color: #9aa1ae; padding: 8px 0 4px; text-align: center; }
.pcal-ti {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 6px; border-radius: 8px; cursor: pointer;
  transition: background .15s ease;
}
.pcal-ti:hover { background: #f6f7fa; }
.pcal-ti-dot { width: 6px; height: 6px; border-radius: 50%; background: #4C6EF5; flex-shrink: 0; }
.pcal-ti-dot.done { background: #c9ced8; }
.pcal-ti-t {
  flex: 1; font-size: 12.5px; color: #374151;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pcal-ti-t.done { color: #9aa1ae; text-decoration: line-through; }
.pcal-ti-s { font-size: 11.5px; color: #9aa1ae; flex-shrink: 0; }
.pcal-more {
  font-size: 12px; color: #4C6EF5; text-align: center;
  padding: 6px 0 2px; cursor: pointer; border-radius: 8px;
}
.pcal-more:hover { background: #eef1fb; }

/* 年视图：12 个月格 · 2026-10-18 */
.pcal-year { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 12px 10px; }
.pcal-ycell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 12px 0; border-radius: 10px; background: #f6f7fa; border: 1px solid #eef0f4;
  cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.pcal-ycell:hover { background: #eef1fb; border-color: #c7d2fe; }
.pcal-ycell.is-empty { background: #fbfbfd; }
.pcal-ycell.is-now { border-color: #c7d2fe; background: #f5f7ff; }
.pcal-ym-t { font-size: 12.5px; color: #374151; font-weight: 600; }
.pcal-ycnt { font-size: 11px; color: #4C6EF5; margin-top: 2px; font-weight: 600; }
.pcal-ycell.is-empty .pcal-ycnt { color: #c3c8d2; font-weight: 400; }

/* 日视图：按来源分组 · 2026-10-18 */
.pcal-grp { margin-bottom: 8px; }
.pcal-grp-h { display: flex; align-items: center; margin-bottom: 2px; }
.pcal-grp-dot { width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; flex-shrink: 0; }
.pcal-grp-t { font-size: 12px; color: #4b5563; font-weight: 600; flex: 1; }
.pcal-grp-n { font-size: 11px; color: #9aa1ae; }

/* 窄屏：面板铺宽些 */
@media (max-width: 860px) {
  .pc-cal-panel { width: calc(100vw - 24px); right: 12px; }
}

/* 🔴 2026-10-16：AI 助手面板打开时（占右侧 420px），日程面板自动左移让位，避免被盖住。
   由 pc_dock.js/自身 JS 在 appShell 有 marginRight 时给 body 加 .ai-dock-open 类触发。 */
body.ai-dock-open .pc-cal-panel { right: 434px; }
@media (max-width: 860px) {
  body.ai-dock-open .pc-cal-panel { right: 12px; }
}
