/* 基礎容器設定 */
.ir-timeline-section {}

.ir-timeline-container {
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  /* 初始化滾動進度變數 */
  --scroll-percent: 0%;
}

/* 中央時間軸線 */
.ir-timeline-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  /* 使用漸層來呈現變色效果：上半部是綠色，下半部是灰色 */
  background: linear-gradient(to bottom,
      var(--green-color) 0%,
      var(--green-color) var(--scroll-percent),
      lightgrey var(--scroll-percent),
      lightgrey 100%);
  left: 50%;
  margin-left: -1px;
  left: 50%;
  margin-left: -1px;
}

/* 獨立區塊 */
.timeline-block {
  position: relative;
  margin-bottom: 90px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.timeline-block.is-visible {
  opacity: 1;
  transform: translateY(0)4
}

/* 時間軸圓點 */
.timeline-marker {
  position: absolute;
  top: 0;
  left: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid var(--green-color);
  margin-left: -10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

/* 年份標籤 */
.timeline-year {
  font-weight: bold;
  position: absolute;
  line-height: 1;
  top: -4px;
  font-size: 64px;
  color: var(--green-color);
}

/* 內容卡片 */
.timeline-content {
  margin-right: 40px;
  width: 40%;
  background: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* 交錯排版邏輯 */
.timeline-block:nth-child(odd) .timeline-content {
  float: left;
}

.timeline-block:nth-child(odd) .timeline-year {
  left: 60%;
}

.timeline-block:nth-child(even) .timeline-content {
  float: right;
}

.timeline-block:nth-child(even) .timeline-year {
  right: 55%;
  text-align: right;
}

/* 清除浮動 */
.timeline-block::after {
  content: "";
  display: table;
  clear: both;
}

/* 圖片與文字排版 */
.timeline-image img {
  width: 100%;
  height: auto;
  display: block;
  border-bottom: 1px solid #eee;
}

.timeline-text {
  padding: 24px;
}

.timeline-text h3 {
  margin: 0 0 20px 0;
  font-size: 20px;
  color: #333;
}

.timeline-text p {
  margin: 0;
  font-size: 18px;
  color: #555;
  line-height: 1.6;
}

/* RWD 響應式 - 手機端適配 */
@media screen and (max-width: 768px) {
  .ir-timeline-container::before {
    left: 20px;
  }

  .ir-timeline-container {
    overflow-x: hidden;
  }

  .timeline-marker {
    left: 20px;
  }

  .timeline-year {
    position: relative;
    top: 0;
    left: 45px !important;
    right: auto !important;
    text-align: left !important;
    margin-bottom: 20px;
    font-size: 42px;
  }

  .timeline-content {
    margin-right: 55px;
  }

  .timeline-content {
    margin-right: 25px;
    width: calc(100% - 70px);
    float: right !important;
  }

  .timeline-text h3 {
    font-size: 18px;
  }

  .timeline-text p{
    font-size: 16px;
  }
}