/* 碎碎念装饰 */
.thoughts-plum {
  position: absolute;
  top: -30px;
  right: 20px;
  width: 180px;
  height: 180px;
  opacity: 0.15;
  pointer-events: none;
  z-index: 1;
}

.thoughts-plum img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 时间轴样式 */
.timeline {
  position: relative;
  padding: 40px;
  background: var(--color-white-65);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border: 1px solid var(--color-white-30);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
}

/* 移除原有的直线 */
.timeline::before {
  display: none;
}

.timeline-item {
  position: relative;
  padding-left: 100px;
  margin-bottom: 40px;
  animation: fadeIn 0.5s ease-in-out;
  z-index: 1;
}

/* marker 向上的曲线连接（除了第一个） */
.timeline-item:not(:first-child) .timeline-marker::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  width: 30px;
  height: 40px;
  background-image: url("data:image/svg+xml,%3Csvg width='30' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='upGrad' x1='0%25' y1='0%25' x2='0%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:rgba(102,126,234,0.3);stop-opacity:1' /%3E%3Cstop offset='100%25' style='stop-color:rgba(102,126,234,0.6);stop-opacity:1' /%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M 15 0 Q 5 15 15 40' stroke='url(%23upGrad)' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  z-index: 0;
}

/* marker 向下的曲线连接（除了最后一个） */
.timeline-item:not(:last-child) .timeline-marker::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  width: 30px;
  height: 40px;
  background-image: url("data:image/svg+xml,%3Csvg width='30' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='downGrad' x1='0%25' y1='0%25' x2='0%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:rgba(102,126,234,0.6);stop-opacity:1' /%3E%3Cstop offset='100%25' style='stop-color:rgba(102,126,234,0.3);stop-opacity:1' /%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M 15 0 Q 25 25 15 40' stroke='url(%23downGrad)' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  z-index: 0;
}

/* timeline-content 的 emoji 装饰 */
.timeline-content[data-emoji]::after {
  content: attr(data-emoji);
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 16px;
  opacity: 0.4;
  pointer-events: none;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline-marker {
  position: absolute;
  left: 52px;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  border: 4px solid var(--color-white);
  box-shadow: 0 0 0 4px var(--color-primary-15),
              0 2px 8px var(--color-primary-40);
  z-index: 3;
  transition: var(--transition-normal);
}

.timeline-item:hover .timeline-marker {
  transform: scale(1.4);
  box-shadow: 0 0 0 6px var(--color-primary-20),
              0 4px 16px var(--color-primary-50);
}

.timeline-content {
  background: var(--color-light-60);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  padding: 24px;
  border-radius: var(--radius-xl);
  position: relative;
  border: 1px solid var(--color-white-40);
  transition: var(--transition-normal);
  box-shadow: var(--shadow-card);
}

.timeline-content:hover {
  border-color: var(--color-primary-40);
  background: var(--color-white-75);
  box-shadow: var(--shadow-xl);
  transform: translateX(8px);
}

.timeline-content::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 12px;
  border: 10px solid transparent;
  border-right-color: var(--color-light-60);
  transition: var(--transition-normal);
  filter: drop-shadow(-2px 0 2px var(--color-primary-10));
  z-index: 1;
}

.timeline-content:hover::before {
  border-right-color: var(--color-white-75);
}

.timeline-content time {
  display: block;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 14px;
}

.timeline-content p {
  color: var(--color-text-medium);
  line-height: var(--line-height);
  margin-bottom: 0;
}

.timeline-content .tags {
  margin-top: var(--gap-lg);
}

/* 移动端优化 - 平板 */
@media (max-width: 768px) {
  .timeline {
    padding: 25px 15px;
  }

  .timeline-item {
    padding-left: 50px;
    margin-bottom: var(--gap-xl);
  }

  .timeline-item:not(:first-child) .timeline-marker::before {
    width: 25px;
    height: 30px;
    background-image: url("data:image/svg+xml,%3Csvg width='25' height='30' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='upGrad' x1='0%25' y1='0%25' x2='0%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:rgba(102,126,234,0.3);stop-opacity:1' /%3E%3Cstop offset='100%25' style='stop-color:rgba(102,126,234,0.6);stop-opacity:1' /%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M 12.5 0 Q 4 11 12.5 30' stroke='url(%23upGrad)' stroke-width='2.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  }

  .timeline-item:not(:last-child) .timeline-marker::after {
    width: 25px;
    height: 30px;
    background-image: url("data:image/svg+xml,%3Csvg width='25' height='30' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='downGrad' x1='0%25' y1='0%25' x2='0%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:rgba(102,126,234,0.6);stop-opacity:1' /%3E%3Cstop offset='100%25' style='stop-color:rgba(102,126,234,0.3);stop-opacity:1' /%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M 12.5 0 Q 21 19 12.5 30' stroke='url(%23downGrad)' stroke-width='2.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    font-size: 10px;
    line-height: 30px;
  }

  .timeline-marker {
    left: 12px;
    width: 18px;
    height: 18px;
    border: 3px solid var(--color-white);
    box-shadow: 0 0 0 3px var(--color-primary-15),
                0 2px 6px var(--color-primary-30);
    z-index: 3;
  }

  .timeline-item:hover .timeline-marker {
    transform: scale(1.3);
    box-shadow: 0 0 0 5px var(--color-primary-20),
                0 3px 12px var(--color-primary-40);
  }

  .timeline-content {
    padding: 18px;
  }
}

/* 移动端优化 - 手机 */
@media (max-width: 480px) {
  .thoughts-plum {
    width: 120px;
    height: 120px;
    top: -20px;
    right: 10px;
  }

  .timeline {
    padding: var(--gap-lg) var(--gap-lg);
    border-radius: var(--radius-lg);
  }

  .timeline-item {
    padding-left: 40px;
    margin-bottom: 25px;
  }

  .timeline-item:not(:first-child) .timeline-marker::before {
    width: 20px;
    height: 25px;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='25' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='upGrad' x1='0%25' y1='0%25' x2='0%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:rgba(102,126,234,0.3);stop-opacity:1' /%3E%3Cstop offset='100%25' style='stop-color:rgba(102,126,234,0.6);stop-opacity:1' /%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M 10 0 Q 3 9 10 25' stroke='url(%23upGrad)' stroke-width='2.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  }

  .timeline-item:not(:last-child) .timeline-marker::after {
    width: 20px;
    height: 25px;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='25' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='downGrad' x1='0%25' y1='0%25' x2='0%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:rgba(102,126,234,0.6);stop-opacity:1' /%3E%3Cstop offset='100%25' style='stop-color:rgba(102,126,234,0.3);stop-opacity:1' /%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M 10 0 Q 17 16 10 25' stroke='url(%23downGrad)' stroke-width='2.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    font-size: 9px;
    line-height: 25px;
  }

  .timeline-marker {
    left: 8px;
    width: 16px;
    height: 16px;
    border: 3px solid var(--color-white);
    box-shadow: 0 0 0 2px var(--color-primary-15),
                0 2px 4px rgba(102, 126, 234, 0.25);
    z-index: 3;
  }

  .timeline-item:hover .timeline-marker {
    transform: scale(1.25);
    box-shadow: 0 0 0 4px var(--color-primary-20),
                0 2px 8px rgba(102, 126, 234, 0.35);
  }

  .timeline-content {
    padding: 14px;
    border-radius: var(--radius-lg);
  }

  .timeline-content time {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .timeline-content p {
    font-size: 14px;
    line-height: 1.5;
  }

  .timeline-content::before {
    left: -10px;
    border-width: 8px;
  }
}
