* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #fff7f4;
  color: #4a2c2a;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  overflow-x: hidden;
}

.map-header {
  min-height: 240px;
  padding: 36px 8%;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 207, 216, 0.85), transparent 32%),
    linear-gradient(135deg, #fff4f1, #ffe3dc);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
}

.back-btn {
  position: absolute;
  left: 8%;
  top: 36px;
  text-decoration: none;
  color: #b84c65;
  background: rgba(255, 255, 255, 0.82);
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 25px rgba(180, 100, 100, 0.16);
  transition: 0.3s;
}

.back-btn:hover {
  transform: translateY(-3px);
}

.small-title {
  font-size: 15px;
  color: #b76e79;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.map-header h1 {
  font-size: 48px;
  font-family: Georgia, serif;
  color: #9d4053;
  margin-bottom: 12px;
}

.header-desc {
  font-size: 17px;
  color: #7a5551;
}

.map-page {
  display: grid;
  grid-template-columns: 1.45fr 0.9fr;
  gap: 28px;
  padding: 50px 8%;
  align-items: start;
}

.china-map-section {
  background: white;
  border-radius: 30px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(180, 100, 100, 0.18);
}

.map-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1600 / 1075;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(135deg, #fffdfc, #fff4f1);
}

.map-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  cursor: grab;
  user-select: none;
}

.map-inner.is-dragging {
  cursor: grabbing;
}

.map-tools {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 20;
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 25px rgba(100, 40, 50, 0.16);
}

.map-tools button {
  min-width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #d76d77, #f6b2a6);
  color: white;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  padding: 0 12px;
  transition: 0.25s;
}

.map-tools button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(215, 109, 119, 0.32);
}

#resetMapBtn {
  font-size: 13px;
  min-width: 54px;
}

.map-tip {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 20;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #9d4053;
  font-size: 13px;
  box-shadow: 0 8px 20px rgba(100, 40, 50, 0.14);
}

.china-map {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  user-select: none;
  pointer-events: none;
}

#routeSvg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.route-line {
  fill: none;
  stroke: rgba(216, 79, 106, 0.78);
  stroke-width: 0.38;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1.5 1.2;
  filter: drop-shadow(0 0 4px rgba(216, 79, 106, 0.35));
  animation: routeMove 2.4s linear infinite;
}

#cityMarkers {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.city-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 4;
  text-align: center;
}

.city-marker .star {
  font-size: 25px;
  color: #d84f6a;
  text-shadow:
    0 0 8px rgba(216, 79, 106, 0.65),
    0 0 18px rgba(216, 79, 106, 0.35);
  animation: starPulse 1.8s ease-in-out infinite;
  transition: 0.25s;
}

.city-marker:hover .star {
  transform: scale(1.35);
  color: #ff2f5f;
}

.city-marker.active .star {
  color: #ff2f5f;
  transform: scale(1.35);
}

.city-marker .label {
  margin-top: 1px;
  font-size: 12px;
  font-weight: bold;
  color: #9d4053;
  background: rgba(255, 255, 255, 0.92);
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

.info-panel {
  min-height: 500px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 20px 60px rgba(180, 100, 100, 0.16);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state {
  text-align: center;
  padding: 30px;
}

.empty-state h2 {
  color: #9d4053;
  margin-bottom: 14px;
}

.empty-state p {
  color: #7a5551;
  line-height: 1.8;
}

.city-card {
  width: 100%;
  animation: fadeIn 0.4s ease;
}

.city-card img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 14px 35px rgba(180, 100, 100, 0.16);
}

.city-content {
  padding: 22px 6px 0;
}

.city-date {
  color: #b76e79;
  font-size: 14px;
  margin-bottom: 10px;
}

.city-content h2 {
  color: #9d4053;
  font-size: 30px;
  margin-bottom: 14px;
}

.city-text {
  color: #6f514d;
  font-size: 16px;
  line-height: 2;
}

.timeline-section {
  padding: 20px 8% 90px;
}

.timeline-section h2 {
  text-align: center;
  font-size: 34px;
  color: #9d4053;
  margin-bottom: 42px;
}

.timeline {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(#f3a6ad, #f8d3c8);
}

.timeline-item {
  position: relative;
  padding-left: 58px;
  margin-bottom: 34px;
}

.timeline-dot {
  position: absolute;
  left: 6px;
  top: 4px;
  width: 22px;
  height: 22px;
  background: #d76d77;
  border: 5px solid #fff7f4;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(215, 109, 119, 0.18);
}

.timeline-content {
  background: white;
  padding: 24px 28px;
  border-radius: 22px;
  box-shadow: 0 14px 35px rgba(180, 100, 100, 0.13);
  cursor: pointer;
  transition: 0.3s;
}

.timeline-content:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 42px rgba(180, 100, 100, 0.2);
}

.timeline-content h3 {
  color: #9d4053;
  margin-bottom: 8px;
}

.timeline-date {
  color: #b76e79;
  font-size: 14px;
  margin-bottom: 10px;
}

.timeline-content p {
  color: #6f514d;
  line-height: 1.8;
}

.memory-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(70, 36, 40, 0.38);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  width: min(860px, 94vw);
  max-height: 88vh;
  overflow: hidden;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 90px rgba(90, 40, 50, 0.32);
  animation: modalIn 0.35s ease;
  z-index: 2;
}

.modal-photo-box {
  position: relative;
  width: 100%;
  height: 430px;
  overflow: hidden;
  background: #fff4f1;
}

.modal-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: 0.35s ease;
}

.album-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: #9d4053;
  font-size: 38px;
  line-height: 1;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 10px 25px rgba(100, 40, 50, 0.18);
  transition: 0.25s;
}

.album-btn:hover {
  background: white;
  transform: translateY(-50%) scale(1.08);
}

.album-prev {
  left: 18px;
}

.album-next {
  right: 18px;
}

.photo-counter {
  position: absolute;
  right: 22px;
  bottom: 18px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #9d4053;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 8px 20px rgba(100, 40, 50, 0.16);
}

.modal-content {
  padding: 28px 34px 36px;
}

.modal-content p:first-child {
  color: #b76e79;
  font-size: 14px;
  margin-bottom: 10px;
}

.modal-content h2 {
  color: #9d4053;
  font-size: 34px;
  margin-bottom: 14px;
}

.photo-caption {
  color: #b76e79 !important;
  font-size: 15px !important;
  line-height: 1.8 !important;
  margin-bottom: 14px !important;
}

.modal-content p:last-child {
  color: #6f514d;
  font-size: 16px;
  line-height: 2;
}

.thumbnail-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-top: 22px;
  margin-top: 18px;
  border-top: 1px solid rgba(180, 100, 100, 0.16);
}

.thumbnail-item {
  flex: 0 0 auto;
  width: 78px;
  height: 58px;
  border: 3px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.72;
  transition: 0.25s;
  background: none;
  padding: 0;
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbnail-item:hover,
.thumbnail-item.active {
  opacity: 1;
  border-color: #d76d77;
  transform: translateY(-2px);
}

.modal-close {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #9d4053;
  font-size: 28px;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 10px 24px rgba(100, 40, 50, 0.2);
}

.hidden {
  display: none;
}

@keyframes starPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }

  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}

@keyframes routeMove {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: -8;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1000px) {
  .map-page {
    grid-template-columns: 1fr;
  }

  .map-header h1 {
    font-size: 38px;
  }

  .back-btn {
    position: static;
    margin-bottom: 28px;
  }

  .map-header {
    flex-direction: column;
  }

  .city-card img {
    height: 260px;
  }
}

@media (max-width: 600px) {
  .map-page,
  .timeline-section {
    padding-left: 5%;
    padding-right: 5%;
  }

  .map-page {
    padding-top: 32px;
  }

  .china-map-section {
    padding: 10px;
    border-radius: 22px;
  }

  .map-box {
    border-radius: 14px;
  }

  .city-marker .star {
    font-size: 18px;
  }

  .city-marker .label {
    font-size: 10px;
    padding: 1px 6px;
  }

  .route-line {
    stroke-width: 2;
  }

  .modal-photo-box {
    height: 280px;
  }

  .album-btn {
    width: 38px;
    height: 38px;
    font-size: 30px;
  }

  .thumbnail-item {
    width: 66px;
    height: 50px;
  }

  .modal-content {
    padding: 24px;
  }

  .modal-content h2 {
    font-size: 28px;
  }

  .memory-modal {
    padding: 18px;
  }

  .map-tools {
    right: 10px;
    top: 10px;
    gap: 6px;
    padding: 6px;
  }

  .map-tools button {
    min-width: 30px;
    height: 30px;
    font-size: 16px;
    padding: 0 9px;
  }

  #resetMapBtn {
    min-width: 46px;
    font-size: 12px;
  }

  .map-tip {
    left: 10px;
    bottom: 10px;
    font-size: 11px;
    padding: 5px 10px;
  }
}

.music-btn {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 1000;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #d76d77, #f6b2a6);
  color: white;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(215, 109, 119, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.music-btn.playing {
  animation: rotateMusic 4s linear infinite;
}

@keyframes rotateMusic {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 600px) {
  .music-btn {
    right: 18px;
    bottom: 18px;
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
}
