.timeline-directory-float,
.timeline-era-bar,
.timeline-era-edge,
.timeline-search-toggle {
 display: none;
}

@media (max-width: 760px) {
 .timeline-page {
  --timeline-axis: 5px;
  --timeline-inset: 25px;
  --timeline-ease: cubic-bezier(.16, 1, .3, 1);
  --timeline-gutter: max(6vw, env(safe-area-inset-left));
  --timeline-outer: max(8vw, env(safe-area-inset-right));
 }

 html[data-design] .timeline-page .header > nav[aria-label="主导航"],
 .timeline-page :is(.era-directory, .timeline-tools .filter-box, .chronicle-mobile-hint, .timeline-stage > .chronicle-calendar-key) {
  display: none;
 }
 .timeline-page:not(.timeline-search-open) .timeline-tools { display: none; }
 .timeline-page .timeline-tools {
  margin-top: 0;
  padding-top: 0;
 }
 .timeline-page .timeline-tools input { font-size: 16px; }
 html[data-design] .timeline-page .timeline-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  column-gap: 12px;
  border-block-end: 1px solid var(--line);
 }
 .timeline-page .timeline-head > :is(.museum-home-back, p) { grid-column: 1 / -1; }
 .timeline-page .timeline-head > .museum-home-back { justify-self: start; }
 .timeline-page .timeline-search-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
 }
 .timeline-search-toggle svg { width: 24px; height: 24px; }
 .timeline-search-toggle[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--panel);
 }
 .timeline-search-toggle[data-filtered]::after {
  content: '';
  position: absolute;
  top: 7px;
  right: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
 }
 html:has(body.timeline-page) { overflow-x: clip; }
 .timeline-page .chronicle-scroll { overflow: visible; }
 .timeline-page .chronicle-lanes,
 .timeline-page .chronicle {
  min-width: 0;
  margin-inline-end: 8px;
 }
 .timeline-page .chronicle-lanes {
  margin: 6px 0 25px;
  font-size: clamp(29px, 6.8vw, 33px);
 }
 .timeline-page .chronicle-lanes > span {
  padding-inline: 0;
  text-align: center;
 }
 .timeline-page .chronicle::before {
  bottom: var(--timeline-axis-end, 0px);
  left: var(--timeline-axis);
  background: var(--line);
  mask: none;
 }
 .timeline-page .chronicle-era { margin-block: 0 38px; }
 html[data-design] .timeline-page .chronicle-era-heading {
  margin: 0 0 29px var(--timeline-inset);
  text-align: start;
  font-size: clamp(23px, 5.5vw, 26px);
  font-weight: 700;
 }
 html[data-design] .timeline-page .chronicle-era-heading > span {
  max-width: 100%;
  padding: 6px 18px 8px;
  background: var(--bg);
  border-block-start: var(--detail-divider-width, 1px) var(--detail-divider-style, solid) var(--line);
  text-wrap: balance;
 }
 .timeline-page .chronicle-era-heading::before {
  content: '';
  position: absolute;
  inset: calc(50% - 3px) auto auto calc(var(--timeline-axis) - var(--timeline-inset) - 3px);
  width: 7px;
  height: 7px;
  background: var(--bg);
  border: 1px solid var(--gold);
  transform: rotate(45deg);
 }
 .timeline-page :is(.chronicle-era-intro, .chronicle-return, .chronicle-world-start, .chronicle-milestone .chronicle-card)::before {
  display: none;
 }
 .timeline-page .chronicle-era-heading::after {
  content: '';
  position: absolute;
  inset: 50% 100% auto auto;
  width: calc(var(--timeline-inset) - var(--timeline-axis) - 5px);
  border-bottom: 1px solid var(--line);
 }
 html[data-design] .timeline-page :is(.chronicle-era-intro, .chronicle-return) {
  width: auto;
  margin: 0 0 24px var(--timeline-inset);
  padding: 0;
  font-size: 16px;
 }
 .timeline-page :is(.chronicle-era-intro, .chronicle-return .prose) :is(p, blockquote) {
  text-align: start;
 }
 .timeline-page .chronicle-return-label {
  margin-bottom: 0;
  text-align: start;
  font-size: 20px;
 }
 .timeline-page .chronicle-world-start {
  display: block;
  height: 0;
  margin: 0;
 }
 .timeline-page .chronicle-world-start h3 { display: none; }

 .timeline-page .chronicle .chronicle-row {
  position: relative;
  display: block;
  margin: 0 0 24px;
  padding-inline-start: var(--timeline-inset);
 }
 .timeline-page .chronicle-row .chronicle-space { display: none; }
 html[data-design] .timeline-page .chronicle-row .chronicle-point {
  position: absolute;
  top: 11px;
  left: calc(var(--timeline-axis) - 2.5px);
  width: 6px;
  height: 6px;
  margin: 0;
  border-radius: 50%;
  background: var(--gold);
  transform: none;
 }
 .timeline-page .chronicle-point .point-glyph,
 .timeline-page .chronicle-row .chronicle-point::before {
  display: none;
 }
 html[data-design] .timeline-page .chronicle-row .chronicle-point::after {
  display: block;
  left: 5px;
  width: 12px;
  transform: none;
 }
 .timeline-page .chronicle-row .chronicle-card {
  width: auto;
  max-width: none;
  padding: 0;
  text-align: start;
 }
 .timeline-page .chronicle-row .chronicle-card :is(h3, .chronicle-events, .chronicle-transition) {
  text-align: start;
 }
 html[data-design] .timeline-page .chronicle-card > header {
  margin: 0;
  padding: 0;
  border: 0;
 }
 .timeline-page .chronicle-row .chronicle-card > header > h3 {
  margin: 0 0 9px;
  padding: 0;
  background: transparent;
  transform: none;
  font-size: 19px;
  line-height: 1.5;
 }
 html[data-design] .timeline-page .chronicle-events {
  font-size: 16px;
  line-height: 1.85;
 }
 .timeline-page .chronicle-row .bullet {
  padding-inline: 20px 0;
 }
 .timeline-page .chronicle-row .bullet::before {
  left: 0;
  right: auto;
  width: 13px;
 }
 html[data-design] .timeline-page .chronicle-ending {
  width: auto;
  max-width: none;
  margin: 0 -8px 0 var(--timeline-axis);
 }
 .timeline-page .chronicle-row :is(.chronicle-control-row, .chronicle-story-gap) {
  justify-content: flex-start;
 }
 .timeline-page .chronicle-row .chronicle-control-row {
  flex-wrap: wrap;
  column-gap: 8px;
  row-gap: 0;
 }
 .timeline-page .chronicle-control-row .chronicle-event-controls {
  order: 1;
 }
 .timeline-page .chronicle-note-button,
 .timeline-page .chronicle-story-button {
  position: relative;
 }
 .timeline-page :is(.chronicle-note-button, .chronicle-story-button)::after {
  content: '';
  position: absolute;
  inset: -6px -3px;
 }

 .chronicle-parallel {
  --world-gutter: var(--timeline-gutter);
  --world-outer: max(6vw, env(safe-area-inset-right));
  margin-inline: calc(-1 * var(--timeline-gutter)) calc(-1 * (var(--timeline-outer) + 8px));
  margin-bottom: 24px;
  touch-action: pan-y pinch-zoom;
 }

 .chronicle-era > .chronicle-calendar-key {
  margin: 0 0 10px var(--timeline-inset);
 }
 .timeline-cycle-viewport {
  height: max(220px, calc(100dvh - 49px - max(4px, env(safe-area-inset-top))));
  overflow: clip;
  border-block: 1px solid var(--line);
  background: var(--bg);
 }
 .timeline-cycle-deck {
  position: relative;
  height: 100%;
  transform: translate(var(--cycle-x, 0px), var(--cycle-y, 0px));
 }
 .timeline-cycle-page:not([hidden]) {
  --cycle-accent: var(--mainland-color);
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--bg);
 }
 .timeline-cycle-page[data-side="1"] { --cycle-accent: var(--meiers-color); }
 .timeline-cycle-page::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 calc(var(--world-gutter) + var(--timeline-axis));
  width: 1px;
  background: var(--line);
  pointer-events: none;
 }
 .timeline-cycle-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: 1fr;
  align-items: center;
  gap: 8px;
  padding-inline: var(--world-gutter) var(--world-outer);
  min-height: 44px;
  font: 13px/1.4 var(--sans);
 }
 .timeline-cycle-header { color: var(--cycle-accent); }
 .timeline-cycle-header > span { grid-area: 1 / 2; font-weight: 700; text-align: center; }
 .timeline-cycle-header > :is(button, small) { grid-area: 1 / 3; justify-self: end; text-align: end; }
 .timeline-cycle-header > small { color: var(--muted); font-size: 12px; }
 .timeline-cycle-page[data-side="1"] .timeline-cycle-header > button {
  grid-area: 1 / 1;
  justify-self: start;
  margin-inline-start: 12px;
  text-align: start;
 }
 .timeline-cycle-header button {
  padding: 0 4px;
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--gold);
  cursor: pointer;
  font: inherit;
 }
 .timeline-cycle-scroll {
  overflow: auto;
  overscroll-behavior-y: contain;
  padding: 10px var(--world-outer) 0 var(--world-gutter);
  scrollbar-color: var(--line) transparent;
 }
 .chronicle-scroll:not([data-cycle-locked]) .timeline-cycle-scroll { overflow: clip; }
 .chronicle-scroll:not([data-cycle-locked]) [data-cycle-mate] { visibility: hidden; }
 .timeline-page .timeline-cycle-scroll .chronicle-row {
  min-height: 100%;
  margin-bottom: 0;
  padding-bottom: 14px;
 }
 .chronicle-card[data-cycle-open] { touch-action: manipulation; }
 .timeline-page:not(.timeline-era-reading) .chronicle:not(.timeline-filtered) .chronicle-row > .chronicle-right {
  display: none;
 }
 .timeline-page .timeline-filtered .chronicle-row .chronicle-right {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
 }

 .timeline-directory-float:not([hidden]) {
  display: block;
  position: fixed;
  z-index: 49;
  inset: var(--directory-top, calc(76px + env(safe-area-inset-top))) 0 auto auto;
 }
 .timeline-directory-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold);
  cursor: grab;
  touch-action: none;
  user-select: none;
 }
 .timeline-directory-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(27px);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  transition: transform 240ms var(--timeline-ease);
 }
 .timeline-directory-toggle svg {
  position: relative;
  width: 17px;
  height: 17px;
  transform: translateX(12px);
  transition: transform 240ms var(--timeline-ease);
 }
 .timeline-directory-toggle[aria-expanded="true"]::before,
 .timeline-directory-toggle[aria-expanded="true"] svg {
  transform: translateX(calc(-8px - env(safe-area-inset-right)));
 }
 .timeline-page :is(.timeline-directory-toggle, .timeline-era-bar, .timeline-era-edge, .timeline-search-toggle) svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
 }
 #timeline-directory-panel:not([hidden]) {
  position: absolute;
  top: calc(100% + 8px);
  right: max(10px, env(safe-area-inset-right));
  width: min(254px, calc(100vw - 30px));
  max-height: min(470px, var(--directory-room, 60dvh));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px 17px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
 }
 .timeline-directory-float[data-open-up] #timeline-directory-panel { top: auto; bottom: calc(100% + 8px); }
 #timeline-directory-title {
  margin: 0;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  color: var(--gold);
  font: 19px/1.5 var(--serif);
 }
 #timeline-directory-panel > .timeline-directory-list { display: block; }
 .timeline-directory-list button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 6px 5px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: start;
  font: 15px/1.5 var(--sans);
  cursor: pointer;
 }
 .timeline-directory-list button + button { border-top: 1px solid var(--line); }
 .timeline-directory-list button[aria-current] {
  color: var(--gold);
  font-weight: 700;
 }
 .timeline-page :is(.timeline-directory-toggle, .timeline-directory-list button, .timeline-era-exit, .timeline-cycle-viewport, .timeline-cycle-page button, [data-cycle-open], .timeline-era-edge button, .timeline-search-toggle):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
 }

 html:has(body.timeline-era-reading) { overflow: hidden; }
 html[data-design] body.timeline-era-reading > :is(.header, footer, .mobile-dock, .skip),
 html[data-design] .timeline-era-reading .timeline-head,
 .timeline-era-reading :is(.timeline-tools, .chronicle-lanes) {
  display: none;
 }
 .timeline-era-reading .timeline-stage {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--bg);
 }
 .timeline-era-reading .timeline-era-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: max(4px, env(safe-area-inset-top)) var(--timeline-outer) 4px var(--timeline-gutter);
  border-bottom: 1px solid var(--line);
  color: var(--gold);
 }
 .timeline-era-exit {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 44px;
  padding: 0 8px 0 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 14px/1.4 var(--sans);
  cursor: pointer;
 }
 .timeline-era-exit svg, .timeline-era-edge svg { width: 19px; height: 19px; }
 .timeline-current-era {
  font: 600 17px/1.4 var(--serif);
  text-align: end;
 }
 .timeline-era-reading .chronicle-scroll {
  display: flex;
  flex-direction: column;
  overflow: hidden auto;
  overscroll-behavior: contain;
  padding: 10px var(--timeline-outer) max(14px, env(safe-area-inset-bottom)) var(--timeline-gutter);
  scroll-behavior: auto;
 }
 .timeline-era-reading .chronicle-scroll[data-cycle-locked] { overflow-y: hidden; }
 .timeline-era-reading .chronicle {
  flex: 1 0 auto;
  translate: 0 var(--era-pull, 0px);
 }
 .timeline-era-reading .chronicle:not([style*="--era-pull"]) { transition: translate 180ms var(--timeline-ease); }
 .timeline-era-reading .timeline-era-edge:not([hidden]) {
  display: block;
  position: relative;
  flex: none;
  z-index: 1;
  background: var(--bg);
 }
 .timeline-era-edge[data-step="-1"] { margin-bottom: 24px; }
 .timeline-era-edge[data-step="1"]:not([data-at-end]) { visibility: hidden; }
 .timeline-era-edge button {
  display: grid;
  width: 100%;
  justify-items: center;
  align-content: center;
  min-height: 64px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--gold);
  font: 600 16px/1.4 var(--serif);
  cursor: pointer;
 }
 .timeline-era-edge small { color: var(--muted); font: 12px/1.5 var(--sans); }
 .timeline-era-edge button:disabled {
  min-height: 44px;
  border-style: dashed;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: default;
 }
 .timeline-era-edge button:disabled svg { display: none; }
 .timeline-era-edge.is-armed button { border-color: var(--gold); }

 @media (prefers-reduced-motion: reduce) {
  .timeline-directory-toggle::before, .timeline-directory-toggle svg { transition: none; }
  .timeline-era-reading .chronicle { translate: none; transition: none; }
 }
}
