/* ===== 第二幕·横向长卷 ===== */
#scene-gallery {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(217, 164, 65, 0.25), transparent 50%),
    linear-gradient(180deg, #f2d9a6 0%, #f7efe2 45%, #efe2c8 100%);
  touch-action: none;
  cursor: grab;
}
#scene-gallery:active { cursor: grabbing; }

.g-layer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 100%;
  white-space: nowrap;
  will-change: transform;
  pointer-events: none;
}
.g-layer--far { bottom: 30%; height: auto; opacity: .30; }
.g-layer--mid { bottom: 17%; height: auto; opacity: .55; }
.g-tile { display: inline-block; vertical-align: bottom; }
.g-tile svg { display: block; width: 100%; height: auto; }
.g-tile--flip img { transform: scaleX(-1); }

.g-world { pointer-events: auto; }

.g-road {
  position: absolute;
  left: 0;
  right: -100vw;
  bottom: 0;
  height: 17%;
  background:
    linear-gradient(180deg, var(--gold) 0, var(--gold) 3px, transparent 3px),
    linear-gradient(180deg, rgba(143, 31, 31, 0.92), rgba(90, 20, 20, 0.98));
}

.g-start-tip {
  position: absolute;
  bottom: 40%;
  transform: translateX(-50%);
  font-family: var(--font-kai);
  font-size: clamp(14px, 2.4vmin, 20px);
  color: var(--red-deep);
  letter-spacing: 2px;
  animation: g-tip-nudge 2.2s ease-in-out infinite;
}
@keyframes g-tip-nudge {
  0%, 100% { transform: translateX(-50%); }
  50% { transform: translateX(calc(-50% - 12px)); }
}

/* 点位 */
.point {
  position: absolute;
  bottom: 15%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
}
.point__scene {
  width: clamp(170px, 34vmin, 300px);
  filter: drop-shadow(0 8px 14px rgba(43, 35, 32, 0.25));
  transition: transform .25s ease;
}
.point__scene svg { display: block; width: 100%; height: auto; }
.point:active .point__scene { transform: scale(.97); }
.point__dot {
  width: 16px;
  height: 16px;
  margin-top: 10px;
  border-radius: 50%;
  background: var(--red-bright);
  border: 2px solid var(--gold-pale);
  animation: point-breathe 1.8s ease-in-out infinite;
}
@keyframes point-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 80, 56, 0.55); }
  50% { box-shadow: 0 0 0 14px rgba(224, 80, 56, 0); }
}
.point--visited .point__dot {
  background: var(--gold);
  border-color: var(--red-deep);
  animation: none;
  box-shadow: 0 0 10px 2px rgba(217, 164, 65, 0.6);
}
.point__label {
  margin-top: 10px;
  padding: 10px 6px;
  writing-mode: vertical-rl;
  font-family: var(--font-kai);
  font-size: clamp(12px, 2vmin, 15px);
  letter-spacing: 2px;
  color: var(--ink);
  background: rgba(247, 239, 226, 0.9);
  border: 1px solid var(--gold);
  border-radius: 6px;
  max-height: 320px;
}
.point--visited .point__label { color: var(--red-deep); border-color: var(--red-deep); }

/* 底部固定按钮 */
.g-relay-btn {
  position: fixed;
  left: 50%;
  bottom: 3.2vh;
  transform: translateX(-50%);
  z-index: 30;
  font-size: 15px;
  padding: 9px 26px;
}
.g-relay-btn:active { transform: translateX(-50%) scale(.94); }
.g-finish-btn {
  position: fixed;
  right: 3vw;
  bottom: 3.2vh;
  z-index: 30;
  font-size: 15px;
  padding: 9px 22px;
  animation: finish-pop .6s ease;
}
@keyframes finish-pop {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 时光明信片 ===== */
.postcard {
  position: absolute;
  bottom: 3.2%;
  transform: translateX(-50%);
  padding: 8px 14px;
  background: linear-gradient(180deg, #fffaf0, var(--gold-pale));
  border: 1px solid var(--gold);
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(43, 35, 32, .3);
  font-family: var(--font-kai);
  font-size: 14px;
  color: var(--red-deep);
  letter-spacing: 1px;
  animation: pc-float 3.4s ease-in-out infinite;
  pointer-events: auto;
}
.postcard::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 10px;
  height: 12px;
  background: var(--red);
  border: 1px dashed var(--gold-pale);
}
@keyframes pc-float {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-2deg); }
  50% { transform: translateX(-50%) translateY(-10px) rotate(2deg); }
}

.pc-flip { width: min(86vw, 460px); height: min(60vh, 300px); perspective: 1200px; }
.pc-flip__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.35, 1.2, .4, 1);
}
.pc-flip__inner--flipped { transform: rotateY(180deg); }
.pc-flip__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 10px;
  border: 2px solid var(--gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 22px;
}
.pc-flip__front {
  background:
    repeating-linear-gradient(0deg, rgba(43, 35, 32, .03) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, #fffaf0, var(--gold-pale));
}
.pc-flip__back {
  transform: rotateY(180deg);
  background:
    repeating-linear-gradient(0deg, rgba(43, 35, 32, .03) 0 1px, transparent 1px 3px),
    var(--paper);
}
.pc-flip__stamp {
  width: 44px;
  height: 52px;
  background: var(--red);
  border: 2px dashed var(--gold-pale);
  border-radius: 3px;
  align-self: flex-end;
}
.pc-flip__title {
  font-family: var(--font-kai);
  font-size: clamp(22px, 4.4vmin, 32px);
  color: var(--red-deep);
  letter-spacing: 4px;
}
.pc-flip__hint { font-size: 12px; color: var(--gold); }
.pc-flip__text {
  font-family: var(--font-kai);
  font-size: clamp(14px, 2.4vmin, 18px);
  line-height: 1.9;
  color: var(--ink);
  text-align: justify;
  overflow-y: auto;
  max-height: 100%;
}
.pc-flip__close { position: fixed; top: 16px; right: 16px; }

/* ===== 过渡区:沪嘉铁路 ===== */
.g-trans { position: absolute; bottom: 15%; height: 60%; pointer-events: none; }
.g-trans__note {
  position: absolute;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  width: 86%;
  text-align: center;
  font-family: var(--font-kai);
  font-size: clamp(15px, 2.6vmin, 21px);
  color: var(--red-deep);
  background: rgba(247, 239, 226, .88);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 10px 16px;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.g-trans__note--show { opacity: 1; }
.g-trans__train {
  position: absolute;
  bottom: 0;
  left: -620px;
  width: clamp(320px, 56vmin, 520px);
  opacity: 0;
}
.g-trans__train svg { display: block; width: 100%; height: auto; }
.g-trans__train--run { animation: trans-train 6s linear forwards; }
@keyframes trans-train {
  0% { opacity: 0; transform: translateX(0); }
  6% { opacity: 1; }
  94% { opacity: 1; }
  100% { opacity: 0; transform: translateX(2350px); }
}

/* ===== 两城接力站 ===== */
.station-card { text-align: center; }
.station__title {
  font-family: var(--font-kai);
  color: var(--red-deep);
  letter-spacing: 6px;
  margin-bottom: 14px;
}
.station__photos { display: flex; gap: 12px; justify-content: center; }
.station__photo { flex: 1 1 0; min-width: 0; }
.station__photo-fig {
  border: 6px solid #fffaf0;
  outline: 1px solid var(--gold);
  box-shadow: 0 4px 10px rgba(43, 35, 32, .25);
  background: #fffaf0;
}
.station__photo-fig svg { display: block; width: 100%; height: auto; }
.station__cap {
  font-size: 12px;
  color: var(--ink);
  margin-top: 6px;
  line-height: 1.5;
}
.station__baton { width: 54px; margin: 12px auto 6px; }
.station__baton svg { display: block; width: 100%; height: auto; }
.station__line {
  font-family: var(--font-kai);
  font-size: clamp(14px, 2.4vmin, 18px);
  line-height: 1.9;
  color: var(--ink);
}
.station__join { margin-top: 14px; }

/* ===== 点位卡片 ===== */
.panel-card { padding-top: 12px; }
.panel__scene {
  margin: 0 -6px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--gold);
  background: var(--paper-dark);
}
.panel__scene svg { display: block; width: 100%; height: auto; }
.panel__title {
  font-family: var(--font-kai);
  font-size: clamp(18px, 3vmin, 24px);
  color: var(--red-deep);
  text-align: center;
  margin: 12px 0 8px;
  letter-spacing: 2px;
}
.panel__intro {
  font-size: clamp(14px, 2.3vmin, 16px);
  line-height: 1.9;
  color: var(--ink);
  text-align: justify;
  margin-bottom: 12px;
}
.panel__narrator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  background: rgba(217, 164, 65, .12);
  margin-bottom: 10px;
}
.panel__mic { width: 34px; flex: 0 0 auto; }
.panel__mic svg { display: block; width: 100%; height: auto; }
.panel__narrator-info { flex: 1 1 auto; min-width: 0; }
.panel__school { font-size: 12px; color: var(--red-deep); }
.panel__name { font-family: var(--font-kai); font-size: 16px; color: var(--ink); }
.panel__play { font-size: 14px; padding: 8px 16px; flex: 0 0 auto; }
.panel__subtitle {
  min-height: 30px;
  max-height: 128px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--font-kai);
  font-size: clamp(15px, 2.5vmin, 18px);
  line-height: 1.9;
  padding: 6px 4px;
  color: var(--ink);
  text-align: justify;
}
.panel__subtitle .ch { opacity: .16; transition: opacity .18s ease; }
.panel__subtitle .ch--on { opacity: 1; }
.panel__subtitle--done { border-left: 3px solid var(--gold); padding-left: 8px; }
.panel__motto {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(192, 51, 39, .08), rgba(217, 164, 65, .10)),
    var(--paper-dark);
  border-left: 4px solid var(--red);
  border-radius: 4px;
}
.panel__seal { width: 38px; flex: 0 0 auto; }
.panel__seal svg { display: block; width: 100%; height: auto; }
.panel__motto-text {
  font-family: var(--font-kai);
  font-size: clamp(14px, 2.4vmin, 17px);
  line-height: 1.8;
  color: var(--red-deep);
}
.panel__motto-by { text-align: right; font-size: 13px; color: var(--ink); margin-top: 4px; }
.panel__echo {
  border: 1px dashed var(--red);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(224, 80, 56, .05);
}
.panel__echo-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-kai);
  font-size: clamp(15px, 2.5vmin, 18px);
  color: var(--red-deep);
}
.panel__echo-ring {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--red-bright);
  animation: point-breathe 1.6s ease-in-out infinite;
}
.panel__echo-name { font-size: 12px; color: var(--ink); margin: 6px 0 0 24px; }
.panel__subtitle--echo { margin-left: 24px; }
.panel__egg {
  border-top: 1px solid var(--gold);
  padding-top: 10px;
}
.panel__egg-title {
  font-family: var(--font-kai);
  font-size: 14px;
  color: var(--gold);
  letter-spacing: 4px;
  margin-bottom: 8px;
}

/* ===== 彩蛋 ===== */
.egg-hint { font-size: 13px; color: var(--ink); line-height: 1.7; margin-bottom: 8px; }
.egg-action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--red);
  border-radius: 10px;
  background: rgba(192, 51, 39, .07);
  font-family: var(--font-kai);
  font-size: 15px;
  color: var(--red-deep);
  text-align: left;
  transition: transform .12s ease;
}
.egg-action:active { transform: scale(.97); }
.egg-action--ping { animation: egg-ping .5s ease; }
@keyframes egg-ping {
  0% { box-shadow: 0 0 0 0 rgba(224, 80, 56, .5); }
  100% { box-shadow: 0 0 0 18px rgba(224, 80, 56, 0); }
}
.egg-action__icon { width: 30px; flex: 0 0 auto; }
.egg-action__icon svg { display: block; width: 100%; height: auto; }

.egg-comic__fig { cursor: pointer; }
.egg-comic__fig svg { display: block; width: 100%; height: auto; border-radius: 8px; }
.egg-comic__cap {
  font-family: var(--font-kai);
  font-size: 14px;
  color: var(--ink);
  margin: 8px 0;
  text-align: center;
}
.egg-comic__next { display: block; margin: 0 auto; color: var(--red-deep); border-color: var(--red); }

.egg-compare { position: relative; border-radius: 8px; overflow: hidden; }
.egg-compare svg { display: block; width: 100%; height: auto; }
.egg-compare__old { position: absolute; inset: 0; filter: sepia(.8) brightness(.7); }
.egg-compare__bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold-pale);
  box-shadow: 0 0 6px rgba(43, 35, 32, .6);
  transform: translateX(-50%);
}
.egg-compare__tag {
  position: absolute;
  top: 8px;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 4px;
  color: var(--gold-pale);
  background: rgba(43, 35, 32, .65);
}
.egg-compare__tag--old { left: 8px; }
.egg-compare__tag--new { right: 8px; }
.egg-compare__range { width: 100%; margin-top: 8px; accent-color: var(--red); }

.egg-sketch { margin-top: 10px; }
.egg-sketch svg { display: block; width: 100%; height: auto; }

.egg-pano {
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 8px;
  touch-action: none;
  cursor: grab;
  scrollbar-width: none;
}
.egg-pano::-webkit-scrollbar { display: none; }
.egg-pano__strip { display: flex; width: 300%; }
.egg-pano__strip svg { display: block; width: 33.3333%; height: auto; flex: 0 0 auto; }
.egg-pano__strip img { display: block; width: 33.3333%; height: auto; flex: 0 0 auto; }

.egg-train { position: relative; height: 90px; overflow: hidden; margin-top: 10px; }
.egg-train__car { position: absolute; left: -240px; bottom: 0; width: 220px; }
.egg-train__car svg { display: block; width: 100%; height: auto; }
.egg-train__car--run { animation: egg-train-run 4.5s linear forwards; }
@keyframes egg-train-run {
  from { transform: translateX(0); }
  to { transform: translateX(960px); }
}

.egg-video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--night);
}
.egg-video__fig, .egg-video__fig svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.egg-video__fig img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.egg-video--playing .egg-video__fig { animation: egg-kenburns 15s ease-in-out infinite alternate; }
@keyframes egg-kenburns {
  from { transform: scale(1) translateX(0); }
  to { transform: scale(1.15) translateX(-4%); }
}
.egg-video__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--gold-pale);
  background: rgba(43, 35, 32, .6);
}
.egg-video__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #fff;
  background: linear-gradient(transparent, rgba(29, 36, 56, .85));
  min-height: 34px;
}
.egg-video__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5));
}
.egg-video__play svg { display: block; width: 100%; height: 100%; }

.egg-hsr { position: relative; height: 120px; overflow: hidden; margin-top: 10px; }
.egg-hsr__years { display: flex; justify-content: space-around; padding-top: 4px; }
.egg-hsr__year {
  font-family: var(--font-kai);
  font-size: 17px;
  color: var(--gold);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s ease, transform .5s ease;
}
.egg-hsr__year--on { opacity: 1; transform: translateY(0); color: var(--red-deep); }
.egg-hsr__car { position: absolute; left: -320px; bottom: 0; width: 300px; }
.egg-hsr__car svg { display: block; width: 100%; height: auto; }
.egg-hsr__car--run { animation: egg-hsr-run 4.6s cubic-bezier(.3, 0, .7, 1) forwards; }
@keyframes egg-hsr-run {
  from { transform: translateX(0); }
  to { transform: translateX(1000px); }
}

.egg-lanterns svg { display: block; width: 100%; height: auto; }
.egg-lanterns .lantern { cursor: pointer; opacity: .38; transition: opacity .35s ease; }
.egg-lanterns .lantern--lit {
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(217, 164, 65, .9));
}
.egg-lanterns__cap {
  font-size: 13px;
  color: var(--ink);
  text-align: center;
  margin-top: 6px;
}
.egg-lanterns__done {
  font-family: var(--font-kai);
  font-size: clamp(20px, 4vmin, 28px);
  color: var(--red);
  text-align: center;
  letter-spacing: 8px;
  margin-top: 8px;
  animation: finish-pop .8s ease;
}

.egg-photos { position: relative; border-radius: 8px; overflow: hidden; }
.egg-photos__fig svg { display: block; width: 100%; height: auto; }
.egg-photos__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(43, 35, 32, .5);
  color: var(--gold-pale);
  font-size: 22px;
  line-height: 1;
}
.egg-photos__nav--prev { left: 8px; }
.egg-photos__nav--next { right: 8px; }
.egg-photos__cap { font-size: 13px; color: var(--ink); text-align: center; margin-top: 6px; }

.egg-wall-tip { font-size: 13px; color: var(--red); margin-top: 6px; }
