/**
 * Child Scheduler Styles - 孩子专用的简洁任务视图
 * 完全匹配首页hero-card和level-card的设计风格
 */

/* 清单容器 - 完全匹配hero-card的风格 */
.child-list-section {
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* 不同的颜色主题 - 使用hero-card相似的淡雅渐变 */
.child-list-section.theme-purple {
  background: linear-gradient(135deg, #f0e6ff, #e6f0ff);
}

.child-list-section.theme-blue {
  background: linear-gradient(135deg, #e6f0ff, #e6fffa);
}

.child-list-section.theme-green {
  background: linear-gradient(135deg, #e6ffe6, #f0fff0);
}

.child-list-section.theme-orange {
  background: linear-gradient(135deg, #fff0e6, #ffe6f0);
}

.child-list-section.theme-pink {
  background: linear-gradient(135deg, #ffe2f0, #e6f0ff);
}

.child-list-section.theme-teal {
  background: linear-gradient(135deg, #e6fffa, #e6f0ff);
}

.child-list-section.theme-sunset {
  background: linear-gradient(135deg, #ffe6e6, #fff0e6);
}

.child-list-section.theme-ocean {
  background: linear-gradient(135deg, #e6e6ff, #e6f0ff);
}

/* 清单标题 */
.child-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.child-list-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.child-list-badge {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* 任务容器 */
.child-tasks-wrapper {
  /* 透明背景 */
}

/* 按日期分组 */
.child-date-group {
  margin-bottom: 20px;
}

.child-date-group:last-child {
  margin-bottom: 0;
}

.child-date-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 任务卡片 - 完全匹配level-card的风格 */
.child-task-card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 14px;
}

.child-task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.12);
}

.child-task-card:last-child {
  margin-bottom: 0;
}

/* 不同状态的视觉效果 */
.child-task-card.status-new {
  border-left: 4px solid #4caf50;
}

.child-task-card.status-submitted {
  border-left: 4px solid #ff9800;
}

.child-task-card.status-completed {
  border-left: 4px solid #9e9e9e;
  opacity: 0.65;
}

/* 已完成任务卡片的标题添加划线 */
.child-task-card.status-completed .child-task-title {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(158, 158, 158, 0.6);
}

.child-task-card.urgent {
  border-left: 5px solid #f44336;
  animation: pulse-card 2s infinite;
}

@keyframes pulse-card {
  0%, 100% {
    box-shadow: var(--shadow);
  }
  50% {
    box-shadow: 0 12px 35px rgba(244, 67, 54, 0.2);
  }
}

/* 任务图标 */
.child-task-icon {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
}

/* 任务主要信息 */
.child-task-main {
  flex: 1;
  min-width: 0;
}

.child-task-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.3;
}

/* 横向时间轴容器 */
.child-timeline-container {
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
  width: 100%;
}

.child-timeline-axis {
  position: relative;
  min-height: 130px;
  min-width: 100%;
  width: max-content; /* 根据内容自动扩展宽度 */
}

/* 时间刻度区域 */
.child-time-markers {
  position: relative;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(102, 126, 234, 0.15);
  min-height: 22px;
  width: 100%;
  margin-bottom: 2px;
}

/* 时间刻度 */
.child-time-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 时间标签 - 紧凑设计 */
.child-time-label {
  padding: 2px 6px;
  background: rgba(102, 126, 234, 0.12);
  color: #667eea;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  white-space: nowrap;
  margin-bottom: 4px;
  text-align: center;
  border: 1px solid rgba(102, 126, 234, 0.2);
  backdrop-filter: blur(4px);
}

/* 刻度线 - 细腻优雅 */
.child-tick-line {
  width: 1px;
  height: 100px;
  background: linear-gradient(180deg,
    rgba(102, 126, 234, 0.5) 0%,
    rgba(102, 126, 234, 0.25) 15%,
    rgba(102, 126, 234, 0.08) 40%,
    rgba(102, 126, 234, 0.08) 60%,
    rgba(102, 126, 234, 0.25) 85%,
    rgba(102, 126, 234, 0.5) 100%
  );
  position: relative;
  box-shadow: 0 0 4px rgba(102, 126, 234, 0.15);
}

/* 刻度线顶部小圆点 */
.child-tick-line::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  background: #667eea;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(102, 126, 234, 0.4), 0 0 8px rgba(102, 126, 234, 0.2);
}

/* 刻度线底部小圆点 */
.child-tick-line::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  background: #667eea;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(102, 126, 234, 0.4), 0 0 8px rgba(102, 126, 234, 0.2);
}

/* 当前时间线 */
.child-current-time-line {
  position: absolute;
  top: 0;
  height: 106px; /* 延伸到任务轨道 */
  width: 3px;
  background: linear-gradient(180deg, #ef4444 0%, rgba(239, 68, 68, 0.6) 100%);
  z-index: 20;
  pointer-events: none;
  transform: translateX(-50%);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.child-current-time-line::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  animation: pulse-current-time 2s infinite;
}

.child-current-time-line::after {
  content: attr(data-time);
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #ef4444;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  z-index: 20;
}

@keyframes pulse-current-time {
  0%, 100% {
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  }
  50% {
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.9);
  }
}

/* 任务轨道 */
.child-timeline-track {
  position: relative;
  height: 90px;
  margin-top: 8px;
}

/* 时间轴上的任务卡片 */
.child-timeline-task {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--card);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: visible;
  box-sizing: border-box;
  z-index: 5;
  border: 2px solid transparent;
}

/* 任务卡片左侧发光效果 - 对齐起始时间 */
.child-timeline-task::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 10px 0 0 10px;
  background: currentColor;
  opacity: 0.6;
  box-shadow: -2px 0 8px currentColor;
  z-index: -1;
}

/* 任务卡片右侧发光效果 - 对齐结束时间 */
.child-timeline-task::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 10px 10px 0;
  background: currentColor;
  opacity: 0.6;
  box-shadow: 2px 0 8px currentColor;
  z-index: -1;
}

.child-timeline-task:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.15);
  z-index: 15; /* 悬停时提升层级，确保时间标签在其他元素之上 */
}


/* 悬停遮罩层 - 只对新任务显示（使用不同的伪元素实现） */
.child-timeline-task.status-new .child-timeline-task-overlay {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 10;
  border-radius: 12px;
}

.child-timeline-task.status-new:hover .child-timeline-task-overlay {
  opacity: 1;
}

/* 不同状态的颜色 */
.child-timeline-task.status-new {
  color: #4caf50;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.08), rgba(76, 175, 80, 0.04));
  border-color: rgba(76, 175, 80, 0.15);
}

.child-timeline-task.status-submitted {
  color: #ff9800;
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.08), rgba(255, 152, 0, 0.04));
  border-color: rgba(255, 152, 0, 0.15);
}

.child-timeline-task.status-completed {
  color: #9e9e9e;
  background: linear-gradient(135deg, rgba(158, 158, 158, 0.08), rgba(158, 158, 158, 0.04));
  border-color: rgba(158, 158, 158, 0.15);
  opacity: 0.75;
}

/* 已完成任务的标题添加划线 */
.child-timeline-task.status-completed .child-timeline-task-title {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(158, 158, 158, 0.6);
}

.child-timeline-task.urgent {
  color: #f44336;
  animation: pulse-timeline-urgent 2.5s infinite;
}

.child-timeline-task.urgent::before,
.child-timeline-task.urgent::after {
  width: 4px;
  opacity: 0.8;
}

@keyframes pulse-timeline-urgent {
  0%, 100% {
    box-shadow: var(--shadow);
  }
  50% {
    box-shadow: 0 8px 30px rgba(244, 67, 54, 0.35), 0 0 0 3px rgba(244, 67, 54, 0.15);
  }
}

/* 任务内容 */
.child-timeline-task-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
}

.child-timeline-task-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.child-timeline-task-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.child-timeline-task-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* 最多显示2行 */
  -webkit-box-orient: vertical;
  word-break: break-word;
  position: relative;
  cursor: help;
}

/* 任务标题的 Tooltip 提示框 */
.child-timeline-task-title-tooltip {
  position: fixed;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  max-width: 300px;
  word-break: break-word;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.child-timeline-task-title-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

/* Tooltip 小箭头 */
.child-timeline-task-title-tooltip::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #667eea;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* 积分突出显示 */
.child-timeline-task-points-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 4px;
}

.child-points-value {
  font-weight: 900;
  font-size: 28px;
  background: linear-gradient(135deg, #ff9800, #ff5722);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 4px rgba(255, 152, 0, 0.5));
  letter-spacing: -0.5px;
  line-height: 1;
}

.child-points-label {
  font-size: 12px;
  font-weight: 600;
  color: #ff9800;
  opacity: 0.8;
}

.child-timeline-task-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  visibility: hidden; /* 隐藏但保留空间 */
}


/* 悬停时显示的提交按钮 - 只对新任务 */
.child-timeline-task.status-new .child-timeline-task-submit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 0;
  background: linear-gradient(135deg, #4caf50, #45a049);
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  opacity: 0;
  visibility: visible; /* 覆盖footer的visibility */
  z-index: 20;
  pointer-events: none;
  transition: all 0.3s;
}

.child-timeline-task.status-new:hover .child-timeline-task-submit {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.child-timeline-task.status-new .child-timeline-task-submit:hover {
  transform: translate(-50%, -50%) scale(1.05);
  filter: brightness(1.1);
}

.child-timeline-task.status-new .child-timeline-task-submit:active {
  transform: translate(-50%, -50%) scale(0.98);
}

.child-timeline-urgent-badge {
  font-size: 14px;
  animation: pulse-urgent-icon 1s infinite;
}

@keyframes pulse-urgent-icon {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .child-timeline-container {
    padding: 12px;
  }

  .child-timeline-axis {
    min-height: 110px;
  }

  .child-time-markers {
    min-height: 24px;
  }

  .child-timeline-track {
    height: 80px;
    margin-top: 12px;
  }

  .child-timeline-task {
    padding: 8px 10px;
  }

  .child-timeline-task-icon {
    font-size: 16px;
  }

  .child-timeline-task-title {
    font-size: 13px;
  }

  .child-points-value {
    font-size: 22px;
  }

  .child-points-label {
    font-size: 10px;
  }

  .child-time-label {
    font-size: 9px;
    padding: 2px 6px;
  }

  .child-tick-line {
    height: 96px;
  }

  .child-timeline-task.status-new .child-timeline-task-submit {
    font-size: 12px;
    padding: 10px 20px;
  }

  .child-current-time-line {
    top: 0;
    height: 96px;
  }

  .child-current-time-line::after {
    font-size: 9px;
    padding: 2px 5px;
  }
}

/* 任务元数据样式优化 */

.child-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.child-task-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.child-task-time {
  font-weight: 800;
  font-size: 16px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 1px 2px rgba(102, 126, 234, 0.3));
  letter-spacing: 0.5px;
}

.child-task-points {
  font-weight: 800;
  font-size: 16px;
  background: linear-gradient(135deg, #ff9800, #ff5722);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 1px 2px rgba(255, 152, 0, 0.3));
  letter-spacing: 0.5px;
}

/* 任务状态和操作 */
.child-task-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.child-task-status-badge {
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.child-task-card.status-new .child-task-status-badge {
  background: #4caf50;
  color: #fff;
}

.child-task-card.status-submitted .child-task-status-badge {
  background: #ff9800;
  color: #fff;
}

.child-task-card.status-completed .child-task-status-badge {
  background: #9e9e9e;
  color: #fff;
}

/* 提交按钮 - 匹配首页按钮风格 */
.child-task-submit-btn {
  border: 0;
  background: linear-gradient(135deg, #4caf50, #45a049);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .05s ease, filter .2s;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.child-task-submit-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.child-task-submit-btn:active {
  transform: translateY(0);
}

/* 紧急标记 */
.child-urgent-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #f44336;
  color: #fff;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}

/* 空状态 */
.child-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.child-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.child-empty-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
}

/* 提示信息 - 匹配tip样式 */
.child-list-info {
  margin-top: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

/* 响应式 */
@media (max-width: 768px) {
  .child-list-section {
    padding: 20px;
    border-radius: 20px;
  }

  .child-list-title {
    font-size: 20px;
  }

  .child-date-header {
    font-size: 13px;
  }

  .child-task-card {
    padding: 14px;
  }

  .child-task-icon {
    font-size: 32px;
  }

  .child-task-title {
    font-size: 15px;
  }


  .child-task-meta {
    font-size: 12px;
  }

  .child-task-points {
    font-size: 15px;
  }

  .child-task-actions {
    align-items: flex-start;
  }

  .child-task-submit-btn {
    padding: 8px 14px;
    font-size: 13px;
  }
}
