/* ====== 实验日程 + 甘特图 合并模块 ====== */

.schedule-planner {
  --sp-cream: #FFF8F0;
  --sp-card-radius: 8px;
  --sp-shadow: 0 2px 10px rgba(120, 90, 60, 0.08);
  --sp-pending: #B3E0FF;
  --sp-progress: #FFF4A3;
  --sp-done: #C1E1C1;
  min-height: calc(100vh - 140px);
  background: var(--sp-cream);
  border-radius: var(--sp-card-radius);
  padding: 16px;
  position: relative;
}

.card-macaron {
  background: #FFFFFF;
  border-radius: var(--sp-card-radius);
  box-shadow: var(--sp-shadow);
  border: 1px solid rgba(255, 200, 150, 0.25);
}

/* 顶部工具栏 */
.schedule-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 14px;
}

.schedule-view-switcher {
  display: flex;
  gap: 4px;
  background: var(--sp-cream);
  padding: 4px;
  border-radius: 8px;
}

.sp-view-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #6B5B4F;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}

.sp-view-btn:hover {
  background: rgba(255, 255, 255, 0.7);
}

.sp-view-btn.active {
  background: #fff;
  color: #C97B63;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.schedule-date-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sp-nav-btn,
.sp-today-btn {
  height: 34px;
  border-radius: 6px;
  border: 1px solid #F0D9C8;
  background: #fff;
  color: #6B5B4F;
  cursor: pointer;
  padding: 0 12px;
  font-size: 0.875rem;
  transition: background 0.15s;
}

.sp-nav-btn {
  width: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sp-nav-btn:hover,
.sp-today-btn:hover {
  background: var(--sp-cream);
}

.schedule-date-selects select {
  padding: 7px 10px;
  border: 1px solid #F0D9C8;
  border-radius: 6px;
  background: #fff;
  font-size: 0.875rem;
  color: #5C4A3A;
  cursor: pointer;
}

.schedule-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: #8B7355;
  white-space: nowrap;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}

/* 左右分栏 */
.schedule-split {
  display: grid;
  grid-template-columns: minmax(280px, 42%) 1fr;
  gap: 14px;
  min-height: 520px;
}

.panel-head {
  padding: 12px 16px;
  border-bottom: 1px solid #F5EBE0;
}

.panel-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #5C4A3A;
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-calendar-panel,
.schedule-gantt-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.schedule-calendar-body {
  flex: 1;
  overflow: auto;
  padding: 12px;
}

.schedule-gantt-body {
  flex: 1;
  overflow: auto;
  padding: 8px 12px 12px;
}

/* 月视图 */
.sp-month-view {
  min-width: 260px;
}

.sp-cal-month-title {
  font-weight: 700;
  color: #5C4A3A;
  margin-bottom: 10px;
  font-size: 1rem;
}

.sp-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.sp-cal-weekdays div {
  text-align: center;
  font-size: 0.75rem;
  color: #A08B76;
  font-weight: 600;
  padding: 4px 0;
}

.sp-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.sp-cal-day {
  min-height: 72px;
  background: var(--sp-cream);
  border-radius: 6px;
  padding: 4px;
  border: 1px solid transparent;
}

.sp-cal-day.today {
  border-color: #FFB6C1;
  background: #FFF0F5;
}

.sp-cal-day.empty {
  background: transparent;
}

.sp-cal-day-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6B5B4F;
  padding: 2px 4px;
}

.sp-cal-day-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sp-cal-event {
  display: block;
  width: 100%;
  border: 1px solid;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 0.65rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: transform 0.1s, box-shadow 0.15s;
}

.sp-cal-event:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.sp-cal-more {
  font-size: 0.65rem;
  color: #A08B76;
  padding-left: 4px;
}

/* 周视图 */
.sp-week-view {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  min-width: 480px;
}

.sp-week-col {
  background: var(--sp-cream);
  border-radius: 6px;
  min-height: 200px;
  border: 1px solid transparent;
}

.sp-week-col.today {
  border-color: #FFB6C1;
  background: #FFF0F5;
}

.sp-week-head {
  text-align: center;
  padding: 8px 4px;
  border-bottom: 1px solid #F0E0D0;
}

.sp-week-name {
  display: block;
  font-size: 0.7rem;
  color: #A08B76;
}

.sp-week-date {
  font-size: 1.1rem;
  font-weight: 700;
  color: #5C4A3A;
}

.sp-week-events {
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sp-week-empty {
  font-size: 0.75rem;
  color: #C4B5A5;
  text-align: center;
  padding: 12px 4px;
}

/* 日视图 */
.sp-day-view {
  padding: 4px;
}

.sp-day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.sp-day-head h4 {
  margin: 0;
  font-size: 1rem;
  color: #5C4A3A;
}

.sp-day-head span {
  font-size: 0.85rem;
  color: #A08B76;
}

.sp-day-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sp-day-event {
  width: 100%;
  text-align: left;
  border: none;
  border-left: 4px solid;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.sp-day-event:hover {
  box-shadow: var(--sp-shadow);
}

.sp-day-event-time {
  font-size: 0.8rem;
  color: #8B7355;
}

.sp-day-event-title {
  font-weight: 700;
  color: #4A3728;
  margin: 4px 0;
}

.sp-day-event-meta {
  font-size: 0.75rem;
  color: #A08B76;
}

.sp-day-empty {
  text-align: center;
  color: #C4B5A5;
  padding: 40px;
}

/* 高亮联动 */
.sp-highlighted {
  outline: 2px solid #E8A87C !important;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(232, 168, 124, 0.35) !important;
  z-index: 2;
}

.sp-row-highlighted {
  background: rgba(255, 244, 163, 0.25) !important;
}

/* 甘特图 */
.sp-gantt-empty {
  text-align: center;
  padding: 48px 20px;
  color: #A08B76;
}

.sp-gantt-empty i {
  font-size: 2rem;
  margin-bottom: 12px;
  color: #D4B896;
}

.sp-gantt-chart {
  min-width: 480px;
}

.sp-gantt-header {
  display: flex;
  border-bottom: 2px solid #F0E0D0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 3;
}

.sp-gantt-label-col {
  width: 160px;
  flex-shrink: 0;
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #8B7355;
}

.sp-gantt-timeline-col {
  flex: 1;
  position: relative;
  display: flex;
  min-height: 36px;
}

.sp-gantt-date-cell {
  text-align: center;
  font-size: 0.7rem;
  color: #A08B76;
  padding: 8px 2px;
  border-left: 1px solid #F5EBE0;
  font-weight: 600;
}

.sp-gantt-date-cell.today {
  color: #C97B63;
  background: rgba(255, 182, 193, 0.15);
}

.sp-gantt-rows {
  display: flex;
  flex-direction: column;
}

.sp-gantt-row {
  display: flex;
  border-bottom: 1px solid #F8F0E8;
  min-height: 52px;
  align-items: stretch;
  transition: background 0.15s;
}

.sp-gantt-row .sp-gantt-label-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid #F5EBE0;
}

.sp-gantt-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4A3728;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-gantt-meta {
  font-size: 0.65rem;
  color: #A08B76;
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 2px;
}

.sp-gantt-bar-wrap {
  position: absolute;
  top: 8px;
  bottom: 8px;
  min-width: 8px;
}

.sp-gantt-bar {
  position: relative;
  height: 100%;
  border-radius: 6px;
  border: 1px solid;
  cursor: grab;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 8px;
  user-select: none;
}

.sp-gantt-bar:active {
  cursor: grabbing;
}

.sp-gantt-bar-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
  border-radius: 6px 0 0 6px;
}

.sp-gantt-bar-label {
  position: relative;
  z-index: 1;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-gantt-resize {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  z-index: 2;
}

.sp-gantt-resize-left {
  left: 0;
}

.sp-gantt-resize-right {
  right: 0;
}

/* 浮动操作按钮 */
.schedule-fab-wrap {
  position: fixed;
  right: calc(var(--content-gutter-right, 48px) + 24px);
  bottom: 32px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.schedule-fab-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.2s ease;
}

.schedule-fab-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.schedule-fab-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--sp-shadow);
  color: #5C4A3A;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.1s;
}

.schedule-fab-item:hover {
  transform: translateX(-4px);
  background: var(--sp-cream);
}

.schedule-fab-item i {
  color: #C97B63;
  width: 18px;
  text-align: center;
}

.schedule-fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #FFB6C1, #FFD3E0);
  color: #8B4513;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(200, 120, 100, 0.35);
  transition: transform 0.2s;
}

.schedule-fab:hover {
  transform: scale(1.06);
}

.schedule-fab.open {
  transform: rotate(45deg);
}

/* 表单 */
.schedule-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.schedule-form .form-group {
  margin-bottom: 14px;
}

.schedule-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #6B5B4F;
  margin-bottom: 6px;
}

/* 响应式 */
@media (max-width: 1100px) {
  .schedule-split {
    grid-template-columns: 1fr;
  }

  .schedule-gantt-body {
    max-height: 400px;
  }
}

@media (max-width: 640px) {
  .schedule-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .schedule-legend {
    justify-content: center;
    flex-wrap: wrap;
  }

  .schedule-fab-wrap {
    right: 20px;
    bottom: 20px;
  }
}

/* 页面容器背景 */
.page-container > .schedule-planner {
  margin: -8px 0 0;
}
