#memories {
  max-width: none; margin: 0; padding: 0 0 clamp(48px,7vw,100px);
  --journal-ink: #362d2c; --journal-paper: #fff9e9;
}
#journey-panel[hidden], #all-photos[hidden], .journey-view-switch[hidden],
#journey-stage [hidden] { display: none !important; }
#memories:has(#journey-panel:not([hidden])) > .journey-heading { display: none; }
.journey-heading, #all-photos {
  width: min(86%,1370px); margin-inline: auto;
}
.journey-heading {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: 20px; padding-block: clamp(38px,6vw,84px) 30px;
}
.journey-heading h2 { font: 650 clamp(37px,4.5vw,68px)/1.17 "Songti SC","STSong",serif; letter-spacing: -.04em; }
.journey-heading h2 span { color: #ac4f46; }
.journey-byline { margin-bottom: 10px; font-size: 12px; letter-spacing: .15em; }
.journey-view-switch { display: flex; padding: 3px; gap: 3px; border: 1px solid #8d777b; border-radius: 22px; }
.journey-view-switch button { font-size: 13px; min-height: 36px; padding-inline: 14px; border-radius: 20px; }
.journey-view-switch [aria-pressed=true] { color: #fff8eb; background: #423334; }
#memories > .fitness-corner { width: min(86%,1370px); margin-inline: auto; }
#journey-panel, .journey-spread { width: 100%; }
.journey-spread { display: grid; align-items: start; isolation: isolate; }
#journey-stage, #journey-entries { grid-area: 1/1; min-width: 0; }
#journey-entries { padding-bottom: 100svh; pointer-events: none; }
.journey-entry { height: var(--step-length,90svh); }
html:has(.journey-entry:target) { scroll-behavior: auto; scroll-padding-top: 0; }
#journey-stage {
  position: sticky; top: 0; z-index: 1; height: 100svh; overflow: clip;
  --inset-x: clamp(24px,4.5vw,85px);
  --place-paper: #f5ecd6; --place-ink: #382e2e; --place-accent: #ae5138; --place-muted: #706256;
  --place-card: #fff8e8; --place-hairline: #c5b697;
  background: var(--place-paper); color: var(--place-ink);
  font-family: var(--font); isolation: isolate;
}
#journey-map { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; overflow: hidden; }
.scene-paper-wash {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: linear-gradient(90deg, var(--place-paper) 0%,color-mix(in srgb,var(--place-paper) 92%,transparent) 19%, transparent 41%, transparent 63%,color-mix(in srgb,var(--place-paper) 50%,transparent) 90%,var(--place-paper)),
    linear-gradient(to bottom,var(--place-paper), transparent 18%, transparent 77%,var(--place-paper) 100%);
}
.scene-masthead {
  position: absolute; left: var(--inset-x); right: var(--inset-x); top: clamp(14px,3.5svh,42px);
  display: flex; align-items: center; justify-content: space-between;
}
.scene-book { display: flex; align-items: center; gap: 9px; font: 650 clamp(15px,1.4vw,21px)/1.1 "Songti SC","STSong",serif; }
.scene-book-mark {
  display: grid; place-items: center; width: 1.65em; height: 1.65em;
  background: var(--place-accent); color: var(--place-paper); rotate: -4deg;
  border-radius: 2px 3px 2px 1px; font: 650 .95em/1 "Kaiti SC","STKaiti",serif;
}
.scene-masthead button {
  color: var(--place-ink); background: var(--place-paper); border: 1px solid var(--place-hairline);
  font-size: 12px; padding: 8px 13px; border-radius: 22px;
}
.scene-masthead button span { margin-left: 6px; }
.journey-key {
  position: absolute; top: clamp(20px,4.2svh,47px); left: 50%; translate: -50% 0;
  display: flex; align-items: center; gap: 17px; font-size: 12px; white-space: nowrap;
}
.journey-key > span { display: inline-flex; align-items: center; gap: 5px; }
.journey-key > span::before { content: ''; width: 20px; border-top: 3px solid var(--jm-hui,#ae503d); }
.journey-key .key-jing::before { border-top: 3px dashed var(--jm-jing,#28766e); }
.scene-notes { position: absolute; left: var(--inset-x); width: 26.5%; top: 40%; translate: 0 -50%; }
.scene-route { font-size: clamp(11px,.9vw,14px); line-height: 1.65; color: var(--place-muted); letter-spacing: .08em; }
.scene-city {
  padding: 0; margin: 8px 0 clamp(13px,2.3svh,28px);
  font: 650 clamp(54px,6.8vw,112px)/1.12 "Songti SC","STSong","Noto Serif CJK SC",serif;
  letter-spacing: -.055em; color: var(--place-ink);
}
#journey-stage:is([data-theme=departure],[data-theme=apart]) .scene-city { font-size: clamp(36px,4.5vw,82px); }
.scene-title { font: 600 clamp(17px,1.48vw,24px)/1.5 "Songti SC","STSong",serif; text-wrap: balance; }
.scene-copy { font-size: clamp(13px,1vw,16px); line-height: 1.9; margin-top: 9px; }
.scene-edition {
  position: absolute; left: var(--inset-x); top: 66%; width: min(22%,310px);
  translate: 0 -15%; margin: 0; text-align: left;
}
.journey-engraving { width: 100%; aspect-ratio: 420/180; background: var(--place-art) center / contain no-repeat; }
.scene-edition figcaption { margin-top: 5px; color: var(--place-muted); font-size: 11px; line-height: 1.45; letter-spacing: .11em; }
#journey-stage[data-has-photos=false] .scene-edition { width: 29%; max-width: 480px; top: 45%; left: auto; right: var(--inset-x); translate: 0 -50%; }
#journey-stage[data-has-photos=false] .scene-edition figcaption { text-align: center; margin-top: 15px; }
.scene-gallery {
  position: absolute; right: var(--inset-x); width: min(27vw,430px); top: 45%; translate: 0 -50%;
}
.journey-stage-photo {
  display: block; width: 100%; text-align: left; color: var(--place-ink); background: var(--place-card);
  padding: clamp(6px,.6vw,11px); box-shadow: 1px 5px 12px #231b1d2b;
}
.journey-stage-photo img {
  display: block; width: 100%; height: auto; max-height: 48svh; object-fit: contain;
  background: var(--place-card);
}
.journey-photo-caption { display: block; padding: .48em .25em .12em; font-size: clamp(11px,1vw,15px); line-height: 1.45; }
#journey-stage[data-theme=luoyang] .journey-stage-photo { rotate: 1.3deg; border-bottom: 3px solid var(--place-accent); }
#journey-stage[data-theme=xian] .journey-stage-photo { outline: 1px solid var(--place-accent); outline-offset: 4px; }
#journey-stage[data-theme=wuhan] .journey-stage-photo { rotate: -1deg; border-bottom: 3px solid var(--place-accent); }
.scene-photo-tools { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 9px; }
.scene-photo-tools button, .journey-paging button { color: var(--place-ink); background: var(--place-paper); border: 1px solid var(--place-hairline); border-radius: 50%; width: 35px; height: 35px; font-size: 16px; }
#journey-photo-index, .journey-step-count { font: italic 14px Georgia,serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scene-navigation {
  position: absolute; bottom: 0; left: 0; width: 100%; padding: 0 var(--inset-x) max(16px,env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--place-paper) 37%); color: var(--place-ink);
}
.scene-nav-top { display: flex; align-items: center; gap: 12px; }
#journey-picker { color: inherit; font: 600 13px var(--font); background-color: var(--place-paper); border: none; padding: 4px 1px; max-width: 28%; }
.scene-scroll-note { font-size: 12px; color: var(--place-muted); letter-spacing: .06em; }
.scene-scroll-note span { margin-left: 4px; }
#journey-pet-seat { width: 48px; height: 48px; margin-left: auto; flex: none; }
.journey-paging { display: flex; gap: 5px; }
.journey-paging button:disabled, .scene-photo-tools button:disabled { opacity: .42; cursor: default; }
#journey-timeline {
  display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); margin-top: 1px;
}
#journey-timeline button {
  position: relative; padding: 13px 2px 4px; min-height: 36px; text-align: left;
  font-size: 12px; color: var(--place-muted);
}
#journey-timeline button::before { content:''; position: absolute; top: 4px; height: 2px; left: 0; width: 96%; background: var(--place-hairline); }
#journey-timeline [aria-current=step] { color: var(--place-ink); font-weight: 650; }
#journey-timeline [aria-current=step]::before { background: linear-gradient(to right,var(--place-accent) calc(var(--stop-progress,0)*100%),var(--place-hairline) 0); }
#journey-timeline [aria-current=step]::after { content:''; position:absolute; top:1px; left:0; width: 7px; height: 7px; border-radius: 50%; background: var(--place-accent); }
#journey-timeline .rail-short { display: none; }
@media (max-width:620px) {
  #journey-timeline .rail-long { display: none; }
  #journey-timeline .rail-short { display: inline; }
}
#journey-stage :focus-visible { outline: 2px solid var(--place-accent); outline-offset: 3px; }
@media (prefers-reduced-motion:no-preference) {
  #journey-stage, .scene-masthead button, .scene-photo-tools button, .journey-paging button { transition: color .24s,background-color .3s; }
  .journey-stage-photo:not([hidden]) { animation: scene-print-in .32s ease-out both; }
  @keyframes scene-print-in { from {opacity:.4; transform:translateY(9px)} to {opacity:1;transform:none} }
}
@media (max-width:820px) and (min-height:521px), (max-width:820px) and (orientation:portrait) {
  #journey-stage { --inset-x: clamp(14px,4.5vw,30px); --map-top: 55px; --map-height: 36svh; }
  #journey-map { inset: var(--map-top) 0 auto; height: var(--map-height); }
  .scene-paper-wash { inset: var(--map-top) 0 auto; height: var(--map-height); background: linear-gradient(0deg,var(--place-paper) 0%,transparent 8%,transparent 92%,var(--place-paper) 100%); }
  .scene-masthead { top: 9px; }
  .scene-masthead button { font-size: 11px; padding: 7px 10px; }
  .journey-key { top: var(--map-top); left: var(--inset-x); translate: none; gap: 8px; z-index: 1; background: var(--place-paper); padding: 2px 5px; font-size: 10px; }
  .journey-key > span::before { width: 12px; border-top-width: 2px; }
  .scene-notes { top: calc(var(--map-top) + var(--map-height) + 10px); translate: none; width: 41%; }
  .scene-route { font-size: 10px; line-height: 1.5; letter-spacing: 0; }
  .scene-city { font-size: clamp(35px,7vw,58px); margin: 5px 0 6px; }
  #journey-stage:is([data-theme=departure],[data-theme=apart]) .scene-city { font-size: clamp(23px,5.7vw,42px); }
  .scene-title { font-size: clamp(14px,3.3vw,21px); line-height: 1.4; }
  .scene-copy { font-size: clamp(12px,2.8vw,14px); line-height: 1.62; margin-top: 6px; }
  .scene-gallery, #journey-stage[data-has-photos=false] .scene-edition {
    right: var(--inset-x); width: 44%; top: calc(var(--map-top) + var(--map-height) + 17px);
    translate: none; left: auto;
  }
  .journey-stage-photo { padding: 4px; }
  .journey-stage-photo img { max-height: 23svh; }
  .journey-photo-caption { font-size: 11px; }
  .scene-photo-tools { margin-top: 6px; gap: 9px; }
  .scene-photo-tools button { width: 31px; height: 31px; }
  .scene-edition { left: var(--inset-x); top: auto; bottom: 99px; width: min(36vw,175px); translate: none; }
  .scene-edition figcaption { font-size: 10px; letter-spacing: .03em; margin-top: 2px; }
  #journey-stage[data-has-photos=false] .scene-notes { width: calc(100% - var(--inset-x) * 2); }
  #journey-stage[data-has-photos=false] .scene-edition { width: min(70vw,28svh,300px); top: auto; bottom: 98px; }
  #journey-stage[data-has-photos=false] .scene-edition figcaption { margin-top: 6px; }
  .scene-navigation { padding-bottom: max(9px,env(safe-area-inset-bottom)); }
  .scene-nav-top { gap: 6px; }
  .scene-scroll-note { font-size: 10px; letter-spacing: 0; }
  .journey-paging button { width: 32px; height: 32px; }
  #journey-timeline button { font-size: 11px; padding-top: 12px; }
}
@media (max-width:820px) and (max-height:750px) and (orientation:portrait) {
  #journey-stage { --map-height: 30svh; --map-top: 47px; }
  #journey-stage[data-has-photos=true] .scene-edition { bottom: 101px; width: 38vw; }
  #journey-stage[data-has-photos=true] .journey-engraving { max-height: 28px; background-position: left center; }
}
@media (max-height:570px) and (orientation:landscape) {
  #journey-stage { --inset-x: 20px; }
  .scene-masthead { top: 8px; }
  .scene-notes { top: 42%; width: 28%; }
  .scene-city { font-size: 34px; margin: 3px 0; }
  #journey-stage:is([data-theme=departure],[data-theme=apart]) .scene-city { font-size: 27px; }
  .scene-route { font-size: 10px; }
  .scene-title { font-size: 13px; }
  .scene-copy { font-size: 11px; margin-top: 3px; line-height: 1.45; }
  .scene-gallery { top: 44%; width: 25%; }
  .journey-stage-photo img { max-height: 40svh; }
  #journey-stage[data-has-photos=true] .scene-edition { width: 25%; top: auto; bottom: 86px; translate: none; }
  #journey-stage[data-has-photos=true] .journey-engraving { max-height: 27px; background-position: left center; }
  .scene-edition figcaption,.journey-photo-caption { font-size: 10px; }
  .scene-photo-tools { gap:8px; margin-top: 4px; }
  .scene-photo-tools button, .journey-paging button { width: 27px; height: 27px; }
  #journey-pet-seat { height: 42px; }
  .scene-navigation { padding-bottom: 5px; }
}
@media (max-width:360px) {
  .scene-scroll-note { display: none; }
}
@media (max-width:820px) and (max-height:620px) and (orientation:portrait) {
  #journey-stage { --map-height: 26svh; }
  #journey-stage[data-has-photos=true] .scene-edition { bottom: 94px; }
}
