/* 发展历程：上下交错横向时间轴 */
.history-section {
  overflow: hidden;
  padding: 28px 0 32px;
  background:
    linear-gradient(180deg, rgba(231, 242, 250, 0.7), rgba(255, 255, 255, 0) 240px),
    #f7fafc;
}

.history-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
}

.history-heading > div:first-child {
  max-width: 760px;
}

.history-kicker {
  display: block;
  margin-bottom: 18px;
  color: #0067a8;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.history-heading h2 {
  margin: 0;
  color: #0b2940;
  font-size: clamp(38px, 4.3vw, 68px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.history-heading p {
  max-width: 680px;
  margin: 10px 0 0;
  color: #536d80;
  font-size: 18px;
  line-height: 1.8;
}

.history-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  transform: translateY(18px);
}

.history-controls button {
  display: grid;
  width: 52px;
  height: 52px;
  padding: 0;
  place-items: center;
  border: 1px solid #b8ccdb;
  border-radius: 50%;
  background: #fff;
  color: #075a94;
  font: inherit;
  font-size: 22px;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.history-controls button:hover:not(:disabled),
.history-controls button:focus-visible {
  border-color: #075a94;
  background: #075a94;
  color: #fff;
  transform: translateY(-2px);
}

.history-controls button:focus-visible,
.history-track:focus-visible {
  outline: 3px solid rgba(0, 126, 199, 0.3);
  outline-offset: 4px;
}

.history-controls button:disabled {
  cursor: default;
  opacity: 0.35;
}

.history-viewport {
  margin-top: 18px;
}

.history-track {
  display: grid;
  grid-auto-columns: 100%;
  grid-auto-flow: column;
  height: 560px;
  gap: 0;
  margin: 0;
  padding: 0 0 28px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: inline mandatory;
  scroll-padding-inline: 0;
  scrollbar-width: none;
  cursor: grab;
  list-style: none;
  touch-action: pan-x pan-y;
}

.history-track::-webkit-scrollbar {
  display: none;
}

.history-track.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  scroll-snap-type: none;
  user-select: none;
}

.history-page {
  min-width: 0;
  height: 100%;
  scroll-snap-align: start;
  list-style: none;
}

.history-page-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  height: 100%;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: linear-gradient(to bottom, transparent calc(50% - 1px), #b8ccdb calc(50% - 1px), #b8ccdb calc(50% + 1px), transparent calc(50% + 1px));
}

.history-card {
  position: relative;
  display: flex;
  min-width: 0;
  height: 50%;
  min-height: 0;
  flex-direction: column;
  box-sizing: border-box;
  border: 0;
  border-left: 2px solid #9cb9cd;
  border-radius: 0;
  background: transparent;
  transition: transform 220ms ease, border-color 220ms ease;
}

.history-card:nth-child(odd) {
  align-self: start;
  justify-content: flex-end;
  padding: 8px 15px 18px;
}

.history-card:nth-child(even) {
  align-self: end;
  justify-content: flex-start;
  padding: 18px 15px 8px;
}

.history-card::before {
  position: absolute;
  left: -8px;
  width: 14px;
  height: 14px;
  border: 4px solid #f7fafc;
  border-radius: 50%;
  background: #8aaec7;
  content: "";
  transition: background-color 220ms ease, transform 220ms ease;
}

.history-card:nth-child(odd)::before {
  top: auto;
  bottom: -7px;
}

.history-card:nth-child(even)::before {
  top: -7px;
  bottom: auto;
}

.history-card:hover,
.history-card.is-active {
  border-left-color: #1677b8;
  background: transparent;
  box-shadow: none;
}

.history-card:nth-child(odd):hover,
.history-card:nth-child(odd).is-active {
  transform: none;
}

.history-card:nth-child(even):hover,
.history-card:nth-child(even).is-active {
  transform: none;
}

.history-card:hover::before,
.history-card.is-active::before {
  background: #008dc3;
  transform: scale(1.25);
}

.history-card-year {
  color: #075a94;
  font-size: clamp(30px, 2.3vw, 40px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.history-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(184, 204, 219, 0.85);
  color: #0081b4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.history-card h3 {
  margin: 11px 0 0;
  color: #0b2940;
  font-size: 16px;
  line-height: 1.48;
  white-space: pre-line;
}

.history-card-title-lines > span {
  display: block;
}

.history-card-title-lines--compact > span:first-child {
  white-space: nowrap;
}

.history-card-title-lines--fixed > span {
  white-space: nowrap;
}

.history-card-detail {
  margin: 9px 0 0;
  color: #5d7586;
  font-size: 12px;
  line-height: 1.55;
}

.history-progress-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin-top: 4px;
  color: #5d7586;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.history-progress-row p {
  margin: 0;
}

.history-progress {
  height: 2px;
  overflow: hidden;
  background: #cadbe6;
}

.history-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: #008dc3;
  transform: scaleX(calc(1 / var(--history-total)));
  transform-origin: left center;
  transition: transform 180ms ease;
}

@media (max-width: 900px) {
  .history-section {
    padding: 48px 0 60px;
  }

  .history-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 26px;
  }

  .history-controls {
    transform: none;
  }

  .history-heading p {
    margin-top: 18px;
    font-size: 16px;
  }

  .history-viewport {
    margin-top: 36px;
  }

  .history-card {
    padding-right: 18px;
  }
}

@media (max-width: 720px) {
  .history-controls,
  .history-progress-row {
    display: none;
  }

  .history-track {
    display: grid;
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    height: auto;
    gap: 28px;
    overflow: visible;
    scroll-snap-type: none;
    background: none;
    cursor: default;
  }

  .history-page,
  .history-page-list {
    height: auto;
  }

  .history-page-list {
    grid-template-columns: 1fr;
    gap: 28px;
    background: none;
  }

  .history-card,
  .history-card:nth-child(odd),
  .history-card:nth-child(even) {
    height: auto;
    align-self: stretch;
    justify-content: flex-start;
    padding: 0 0 24px 24px;
    transform: none;
  }

  .history-card:nth-child(odd)::before,
  .history-card:nth-child(even)::before {
    top: 2px;
    bottom: auto;
  }

  .history-card:nth-child(odd):hover,
  .history-card:nth-child(odd).is-active,
  .history-card:nth-child(even):hover,
  .history-card:nth-child(even).is-active {
    transform: none;
  }

}

@media (max-width: 520px) {
  .history-section {
    padding-top: 52px;
  }

  .history-heading h2 {
    font-size: 38px;
  }

  .history-controls button {
    width: 48px;
    height: 48px;
  }

  .history-progress-row {
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .history-track {
    scroll-behavior: auto;
  }

  .history-card,
  .history-card::before,
  .history-controls button,
  .history-progress span {
    transition: none;
  }
}

@media print {
  .history-controls,
  .history-progress-row {
    display: none;
  }

  .history-track {
    display: block;
    overflow: visible;
  }

  .history-card {
    min-height: 0;
    margin-bottom: 16px;
    break-inside: avoid;
  }
}
