.timeline-section {
  background: #faf9f6;
  padding: 88px 0 100px;
}

.timeline-section .section-kicker,
.timeline-section .tiny-square,
.title-period {
  color: #d45a49;
}

.timeline-section .tiny-square { background: #d45a49; }
.section-heading h2 { font-size: clamp(42px, 5vw, 66px); }
.section-heading p { max-width: 520px; line-height: 1.7; }
.controls { margin-top: 44px; padding: 10px 0; }
.filter.active { background: #efeee9; border-color: #e7e5de; }
.filter-dot.openai { background: #d7ae43; }
.filter-dot.claude { background: #9376c4; }
.filter-dot.deepseek { background: #5eaa6b; }

.timeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 0 15px;
}

.timeline-toolbar .year-rail {
  position: static;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0;
  height: auto;
}

.timeline-toolbar .year-rail > span {
  margin: 0;
  white-space: nowrap;
  color: #999b95;
}

#year-links { display: flex; flex-wrap: wrap; gap: 15px; }
#year-links button {
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: #69716d;
  padding: 5px 0;
  font-size: 12px;
  font-weight: 700;
}

#year-links button:hover,
#year-links button:focus-visible {
  color: #c84f3d;
  border-color: #c84f3d;
  outline: 0;
}

.scroll-controls { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.scroll-controls > span { color: #9a9c96; font-size: 11px; margin-right: 7px; }
.scroll-controls button {
  width: 34px;
  height: 34px;
  border: 1px solid #deded9;
  border-radius: 50%;
  background: #fff;
  color: #3b4240;
  font-size: 17px;
}
.scroll-controls button:hover { border-color: #d45a49; color: #d45a49; }

.tree-legend {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0 0 13px;
  color: #6d726f;
  font-size: 11px;
  font-weight: 700;
}
.tree-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.tree-legend small { color: #a1a49f; margin-left: auto; font-size: 10px; font-weight: 400; }
.legend-line { display: inline-block; width: 22px; height: 3px; border-radius: 3px; }
.legend-line.openai { background: #e3ba52; }
.legend-line.claude { background: #9376c4; }
.legend-line.time { background: #dc5847; }
.legend-line.deepseek { background: #67ac70; }

.timeline-layout { position: relative; display: block; margin: 0; border: 1px solid #e8e9e4; background: #fff; }
.timeline-content {
  height: var(--canvas-height, 500px);
  padding: 0;
  border: 0;
  overflow: auto;
  background-color: #fff;
  background-image: radial-gradient(#e8e9e6 .8px, transparent .8px);
  background-size: 24px 24px;
  cursor: grab;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  scrollbar-color: #c7cbc5 #f4f4f0;
  scrollbar-width: thin;
}
.timeline-content.is-dragging { cursor: grabbing; user-select: none; scroll-snap-type: none; }
.timeline-content:focus-visible { outline: 2px solid #d8b558; outline-offset: -2px; }
.timeline-stage { position: relative; overflow: hidden; }
.timeline-track { position: absolute; top: 0; left: 0; display: flex; width: max-content; height: 500px; transform-origin: top left; }
.event-column { position: relative; z-index: 2; flex: none; width: 240px; height: 500px; }
.branch-diagram { position: absolute; inset: 0; z-index: 1; width: 100%; height: 500px; pointer-events: none; }
.branch-diagram path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.time-path { stroke: #dc5847; stroke-width: 4; }
.branch-path.openai { stroke: #e3ba52; stroke-width: 4; }
.branch-path.claude { stroke: #9376c4; stroke-width: 4; }
.branch-path.deepseek { stroke: #67ac70; stroke-width: 4; }
.branch-tick.openai { stroke: #e3ba52; stroke-width: 3; }
.branch-tick.claude { stroke: #9376c4; stroke-width: 3; }
.branch-tick.deepseek { stroke: #67ac70; stroke-width: 3; }
.branch-node { fill: white; stroke-width: 3; }
.branch-node.openai { stroke: #e3ba52; }
.branch-node.claude { stroke: #9376c4; }
.branch-node.deepseek { stroke: #67ac70; }

.model-slot { position: absolute; left: 0; width: 100%; display: flex; justify-content: center; text-align: center; }
.model-slot.openai { top: 21px; }
.model-slot.claude { top: 105px; }
.model-slot.deepseek { top: 405px; }
.model-label {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 5px;
  max-width: 218px;
  border: 0;
  background: transparent;
  color: #26332d;
  padding: 4px 8px;
  line-height: 1.25;
  cursor: pointer;
}
.model-label strong { font: 700 15px/1.3 Manrope, 'Microsoft YaHei', sans-serif; overflow-wrap: anywhere; }
.model-label span { color: #898e87; font-size: 10px; }
.model-label.openai:hover strong,
.model-label.openai:focus-visible strong { color: #aa7d1d; text-decoration: underline; }
.model-label.claude:hover strong,
.model-label.claude:focus-visible strong { color: #7957aa; text-decoration: underline; }
.model-label.deepseek:hover strong,
.model-label.deepseek:focus-visible strong { color: #3c9651; text-decoration: underline; }
.model-label:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.model-popover {
  position: fixed;
  z-index: 20;
  width: min(360px, calc(100vw - 24px));
  padding: 20px 22px 18px;
  border: 1px solid #dfe3dc;
  border-top: 3px solid var(--popover-accent, #e3ba52);
  border-radius: 12px;
  background: #fffefa;
  color: #26332d;
  box-shadow: 0 18px 48px #26332d24, 0 3px 10px #26332d0d;
  font-family: 'DM Sans', 'Microsoft YaHei', sans-serif;
}
.model-popover[hidden] { display: none; }
.model-popover #popover-content {
  max-height: min(340px, calc(100vh - 70px));
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: #cbd0c7 transparent;
}
.model-popover[data-company='deepseek'] { --popover-accent: #67ac70; }
.model-popover[data-company='claude'] { --popover-accent: #9376c4; }
.model-popover::before {
  content: '';
  position: absolute;
  left: calc(var(--arrow-x) - 7px);
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  background: #fffefa;
  border: 1px solid #dfe3dc;
}
.model-popover[data-placement='below']::before { top: -7px; border-right: 0; border-bottom: 0; }
.model-popover[data-placement='above']::before { bottom: -7px; border-left: 0; border-top: 0; }
.popover-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #f0f1ed;
  color: #69716d;
  font-size: 19px;
  line-height: 1;
}
.popover-close:hover { background: #e6e9e2; color: #26332d; }
.popover-meta { display: flex; align-items: center; gap: 11px; padding-right: 32px; color: #8b938a; font-size: 11px; }
.popover-company { color: #ae8325; font-weight: 800; }
.popover-company.deepseek { color: #468b52; }
.popover-company.claude { color: #7957aa; }
.model-popover h3 { margin: 13px 0 7px; font: 800 23px/1.25 Manrope, 'Microsoft YaHei', sans-serif; letter-spacing: -.03em; }
.popover-type { color: #7b867b; font-size: 11px; }
.popover-summary { margin: 17px 0 10px; font-size: 13px; font-weight: 700; line-height: 1.65; }
.popover-detail { margin: 0; color: #69736d; font-size: 12px; line-height: 1.8; }
.popover-source { display: flex; justify-content: space-between; gap: 15px; margin-top: 17px; padding-top: 13px; border-top: 1px solid #e9ebe5; color: #4c7655; font-size: 11px; font-weight: 800; }
.model-popover[data-company='openai'] .popover-source { color: #967326; }
.model-popover[data-company='claude'] .popover-source { color: #7957aa; }
.popover-source:hover { text-decoration: underline; }
.popover-source span { font-size: 15px; line-height: 1; }
.year-mark,
.date-mark { position: absolute; left: 0; width: 100%; text-align: center; pointer-events: none; }
.year-mark { top: 233px; color: #26332d; font: 800 17px/1 Manrope, 'Microsoft YaHei', sans-serif; letter-spacing: .01em; }
.date-mark { top: 292px; color: #ba5b4e; font-size: 10px; font-weight: 700; }
.timeline-content .empty-state { display: flex; height: 500px; flex-direction: column; justify-content: center; align-items: center; border: 0; background: transparent; }
.timeline-footnote { margin: 15px 0 0; }

.canvas-controls {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border: 1px solid #dfe3dc;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 5px 18px #26332d16;
}
.canvas-controls button {
  min-width: 34px;
  height: 34px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #37423d;
  font: 700 18px/1 Manrope, 'Microsoft YaHei', sans-serif;
}
.canvas-controls button:hover,
.canvas-controls button:focus-visible { background: #f0f2ed; outline: none; }
.canvas-controls button:disabled { color: #b7beb5; cursor: default; background: transparent; }
.canvas-controls #zoom-reset { min-width: 52px; font-size: 11px; }
.canvas-controls-divider { width: 1px; height: 20px; margin: 0 3px; background: #dfe3dc; }
.canvas-controls #fullscreen-toggle { font-size: 20px; }
.canvas-controls #fullscreen-toggle.is-exit { min-width: 78px; font-size: 12px; letter-spacing: .02em; }
.fullscreen-legend { display: none; }
.timeline-layout:fullscreen,
.timeline-layout.is-fullscreen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border: 0;
  background: #fff;
}
.timeline-layout.is-fullscreen { position: fixed; inset: 0; z-index: 50; }
.timeline-layout:fullscreen .timeline-content,
.timeline-layout.is-fullscreen .timeline-content { width: 100%; height: 100%; }
.timeline-layout:fullscreen .canvas-controls,
.timeline-layout.is-fullscreen .canvas-controls { top: 20px; right: 20px; }
.timeline-layout:fullscreen .fullscreen-legend,
.timeline-layout.is-fullscreen .fullscreen-legend {
  position: absolute;
  z-index: 5;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 13px;
  border: 1px solid #e3e6df;
  border-radius: 8px;
  background: #fff;
  color: #69716d;
  font-size: 11px;
  font-weight: 700;
}
.fullscreen-legend span { display: inline-flex; align-items: center; gap: 5px; }
body.timeline-expanded { overflow: hidden; }

@media (max-width: 700px) {
  .timeline-section { padding: 70px 0 82px; }
  .filter-group { max-width: 100%; overflow-x: auto; }
  .timeline-toolbar { flex-direction: column; align-items: stretch; }
  .timeline-toolbar .year-rail { display: flex; flex-wrap: wrap; gap: 8px; }
  #year-links { gap: 10px; }
  .scroll-controls { align-self: flex-end; }
  .scroll-controls > span { display: none; }
  .tree-legend { gap: 13px; flex-wrap: wrap; font-size: 10px; }
  .tree-legend small { width: 100%; margin-left: 0; }
  .timeline-layout { display: block; margin: 0; }
  .timeline-content { padding: 0; }
  .canvas-controls { top: 8px; right: 8px; padding: 4px; gap: 0; }
  .canvas-controls button { min-width: 30px; height: 30px; padding: 0 5px; font-size: 16px; }
  .canvas-controls #zoom-reset { min-width: 44px; }
  .canvas-controls #fullscreen-toggle { font-size: 18px; }
  .canvas-controls-divider { height: 16px; margin: 0 2px; }
  .timeline-layout:fullscreen .canvas-controls,
  .timeline-layout.is-fullscreen .canvas-controls { top: 12px; right: 12px; }
  .timeline-layout:fullscreen .fullscreen-legend,
  .timeline-layout.is-fullscreen .fullscreen-legend { bottom: 10px; left: 10px; right: 10px; gap: 8px; font-size: 10px; }
  .timeline-footnote { margin-left: 0; }
}

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