/* schedule.css — 日程视图、AI 导入、时间轴网格 */
/* ------------------------------------------------------------------ 日程视图 */

.sched-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 10px; }
.sched-tab {
  border: 1px solid var(--border); background: var(--canvas-subtle);
  color: var(--fg-muted); border-radius: 999px; padding: 4px 12px;
  font-size: 12.5px; cursor: pointer;
}
.sched-tab:hover { color: var(--fg); }
.sched-tab.on {
  color: var(--accent-fg); border-color: var(--accent); background: var(--accent-subtle);
}

.sched-weekbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }

.sched-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px; align-items: stretch;
}
.sched-day {
  background: var(--canvas-subtle); border: 1px solid var(--border-muted);
  border-radius: var(--radius); min-height: 130px; padding: 6px;
}
.sched-day.today { border-color: var(--accent); }
.sched-day-head {
  display: flex; justify-content: space-between; padding: 2px 4px 8px;
  font-size: 12px; color: var(--fg-muted);
}
.sched-day.today .sched-day-head { color: var(--accent-fg); font-weight: 600; }

.sched-entry {
  background: var(--canvas-overlay); border: 1px solid var(--border-muted);
  border-left: 3px solid var(--accent); border-radius: 4px;
  padding: 5px 7px; margin-bottom: 6px; font-size: 12px; cursor: pointer;
}
.sched-entry:hover { border-color: var(--accent); }
.sched-entry.recurring { border-left-color: var(--done); }
.sched-entry .t { display: block; color: var(--fg-muted); font-size: 11px; }
.sched-entry .ti { display: flex; align-items: center; gap: 4px; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; }
.sched-empty { color: var(--fg-subtle); font-size: 12px; text-align: center; padding: 16px 4px; }

@media (max-width: 900px) {
  .sched-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sched-day { min-height: 90px; }
}

/* ------------------------------------------------------------------ AI 导入 */

.ai-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.ai-thumb {
  position: relative; width: 92px; height: 70px; border-radius: 6px;
  overflow: hidden; border: 1px solid var(--border);
}
.ai-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-thumb .icon-btn {
  position: absolute; top: 2px; right: 2px; padding: 2px;
  background: rgba(0, 0, 0, 0.55); color: #fff; border-radius: 4px;
}

.ai-questions {
  background: var(--attention-subtle); border: 1px solid var(--attention);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; font-size: 13px;
}
.ai-questions ul { margin: 6px 0 8px; padding-left: 18px; }

.ai-draft { overflow-x: auto; }
.ai-draft table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ai-draft th, .ai-draft td {
  border-bottom: 1px solid var(--border-muted); padding: 4px 4px;
  text-align: left; vertical-align: middle; white-space: nowrap;
}
.ai-draft .input, .ai-draft .select { padding: 3px 6px; font-size: 12px; }
.ai-draft tr.warn td { background: var(--attention-subtle); }
.ai-draft td input[type="date"], .ai-draft td input[type="time"] { max-width: 108px; }

/* ------------------------------------------------------------------ 时间轴网格 */

.sched-day { display: flex; flex-direction: column; }
.sched-timeline {
  position: relative; border-top: 1px dashed var(--border-muted);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0, transparent calc(var(--hour-px, 44px) - 1px),
    var(--border-muted) calc(var(--hour-px, 44px) - 1px), var(--border-muted) var(--hour-px, 44px)
  );
  border-radius: 0 0 var(--radius) var(--radius);
}
.sched-hourline { position: absolute; left: 0; right: 0; height: 0; }
.sched-hourline span {
  position: absolute; left: 2px; top: -7px; font-size: 9.5px;
  color: var(--fg-subtle); background: var(--canvas-subtle); padding: 0 2px;
}
.sched-block {
  position: absolute; overflow: hidden; cursor: pointer;
  background: var(--canvas-overlay); border: 1px solid var(--border-muted);
  border-left: 3px solid var(--sc, var(--accent)); border-radius: 4px;
  padding: 2px 5px; font-size: 11.5px; line-height: 1.35;
}
.sched-block:hover { border-color: var(--sc, var(--accent)); }
.sched-block.conflict { border-color: var(--danger); border-left-color: var(--danger); }
.sched-block.conflict .b-title { color: var(--danger); }
.sched-block .b-time { display: block; color: var(--fg-muted); font-size: 10px; }
.sched-block .b-title {
  display: flex; align-items: center; gap: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500;
}
.sched-block .tag { font-size: 9px; padding: 0 4px; }
.part-mini {
  font-size: 9.5px; color: var(--fg-muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 0 4px; flex: none;
}
.color-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dot {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  background: var(--c); border: 2px solid var(--border);
}
.color-dot.default { background: linear-gradient(135deg, var(--canvas-subtle) 50%, var(--c) 50%); }
.color-dot.on { border-color: var(--fg); box-shadow: 0 0 0 2px var(--accent-subtle); }
.sched-dot {
  width: 10px; height: 10px; border-radius: 3px; flex: none;
  background: var(--sc, var(--accent)); margin-top: 4px;
}
.sched-entry { border-left: 3px solid var(--sc, var(--accent)); }
