:root {
  --ink: #31415e;
  --muted: #718099;
  --blue: #9fcdf2;
  --pink: #f4b7ca;
  --gold: #ffd596;
  --line: rgba(255, 255, 255, 0.9);
  --shadow: 0 20px 55px rgba(71, 94, 128, 0.14);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Noto Serif SC", "Microsoft YaHei", serif;
  background: #eaf4fc;
}
.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(
    155deg,
    #b7dcf6 0%,
    #f1edf5 44%,
    #f8d4df 76%,
    #ffe6b9 100%
  );
}
.glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 82% 5%,
      rgba(255, 255, 255, 0.92),
      transparent 22%
    ),
    radial-gradient(
      circle at 5% 68%,
      rgba(255, 255, 255, 0.56),
      transparent 27%
    );
}
button {
  font: inherit;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
  padding: 10px max(4vw, 20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(20px);
}
.back {
  justify-self: start;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.86rem;
}
.brand {
  text-align: center;
  font-weight: 700;
}
.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font: 600 0.62rem "EB Garamond";
  letter-spacing: 0.18em;
}
.place-count {
  justify-self: end;
  color: var(--muted);
  font-size: 0.76rem;
}
.shell {
  width: min(1200px, 92vw);
  margin: auto;
  padding: 58px 0 84px;
}
.hero {
  padding: 10px 8px 38px;
}
.eyebrow {
  color: #8c7392;
  font:
    600 10px "EB Garamond",
    serif;
  letter-spacing: 0.2em;
}
.hero h1 {
  margin: 12px 0 14px;
  font:
    500 clamp(2.7rem, 7vw, 5.5rem) / 1 "EB Garamond",
    "Noto Serif SC",
    serif;
  letter-spacing: -0.045em;
}
.hero p {
  margin: 0;
  color: #62708a;
  line-height: 1.8;
}
.year-filter {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  padding: 2px 2px 7px;
  overflow-x: auto;
  scrollbar-width: none;
}
.year-filter::-webkit-scrollbar {
  display: none;
}
.year-filter button {
  flex: 0 0 auto;
  padding: 9px 17px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  color: #65718a;
  background: rgba(255, 255, 255, 0.66);
  cursor: pointer;
  transition: 0.2s;
}
.year-filter button:hover {
  transform: translateY(-2px);
  background: #fff;
}
.year-filter button.active {
  color: #fff;
  border-color: #52627d;
  background: #52627d;
  box-shadow: 0 8px 20px rgba(50, 68, 96, 0.18);
}
.map-card,
.places-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.69);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.map-card {
  padding: 24px;
}
.map-heading,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.map-heading {
  margin: 0 4px 18px;
}
.map-heading h2,
.section-head h2 {
  margin: 5px 0 0;
  font-size: 1.22rem;
}
.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.73rem;
}
.legend i {
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #df7f9d;
  box-shadow: 0 0 0 4px rgba(223, 127, 157, 0.18);
}
.map-stage {
  position: relative;
  height: clamp(360px, 47vw, 560px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 23px;
  background: linear-gradient(145deg, #dceffa, #f6e7ef);
  box-shadow: inset 0 0 45px rgba(255, 255, 255, 0.5);
}
#worldMap {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.map-stage.is-dragging #worldMap {
  cursor: grabbing;
}
.map-controls {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
}
.zoom-buttons,
.view-buttons {
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 22px rgba(67, 88, 118, 0.12);
  backdrop-filter: blur(14px);
}
.map-controls button {
  height: 38px;
  min-width: 38px;
  padding: 0 11px;
  border: 0;
  border-right: 1px solid rgba(202, 215, 226, 0.75);
  color: #52627d;
  background: transparent;
  cursor: pointer;
}
.map-controls button:last-child {
  border-right: 0;
}
.map-controls button:hover,
.map-controls button.active {
  color: #fff;
  background: #52627d;
}
.zoom-buttons button {
  padding: 0;
  font: 500 1.25rem "EB Garamond", serif;
}
.graticule-layer path {
  fill: none;
  stroke: rgba(93, 127, 151, 0.13);
  stroke-width: 1;
  stroke-dasharray: 4 7;
  vector-effect: non-scaling-stroke;
}
.world-layer path {
  fill: url(#landGradient);
  stroke: rgba(90, 124, 146, 0.53);
  stroke-width: 0.75;
  vector-effect: non-scaling-stroke;
  transition: 0.2s;
}
.world-layer path:hover {
  fill: #fff;
}
.map-marker {
  cursor: pointer;
  outline: none;
}
.marker-hit {
  fill: transparent;
}
.marker-pulse {
  fill: rgba(226, 119, 151, 0.17);
  transform-box: fill-box;
  transform-origin: center;
  animation: pulse 2.2s ease-out infinite;
}
.marker-core {
  fill: #df7897;
  stroke: #fff;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  filter: url(#markerShadow);
}
.marker-label {
  fill: #42536f;
  font:
    600 12px "Noto Serif SC",
    sans-serif;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
}
.map-marker:focus .marker-core,
.map-marker:hover .marker-core {
  fill: #c9577b;
  stroke-width: 4;
}
.map-loading,
.map-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #66758d;
  background: rgba(235, 244, 250, 0.58);
  backdrop-filter: blur(4px);
}
.map-loading {
  z-index: 5;
}
.map-loading span {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(98, 120, 149, 0.2);
  border-top-color: #d87393;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.map-loading b {
  font-size: 0.82rem;
  font-weight: 400;
}
.map-empty {
  flex-direction: column;
  background: rgba(240, 247, 250, 0.25);
  pointer-events: none;
}
.map-empty b {
  font: 400 2rem "EB Garamond";
}
.map-empty span {
  font-size: 0.84rem;
}
.map-hint {
  margin: 14px 4px 0;
  color: var(--muted);
  font-size: 0.75rem;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0;
}
.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 136px;
  padding: 23px;
  border: 1px solid #fff;
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(68, 91, 122, 0.09);
}
.stat-card > span {
  position: absolute;
  right: 18px;
  top: 17px;
  color: rgba(69, 86, 116, 0.45);
  font-size: 1.2rem;
}
.stat-card strong {
  display: block;
  margin: 16px 0 6px;
  font: 600 2.15rem "EB Garamond";
}
.stat-card small {
  color: var(--muted);
}
.stat-card.blue {
  background: linear-gradient(
    145deg,
    rgba(220, 239, 252, 0.95),
    rgba(255, 255, 255, 0.8)
  );
}
.stat-card.pink {
  background: linear-gradient(
    145deg,
    rgba(252, 223, 232, 0.95),
    rgba(255, 255, 255, 0.8)
  );
}
.stat-card.gold {
  background: linear-gradient(
    145deg,
    rgba(255, 235, 192, 0.9),
    rgba(255, 255, 255, 0.82)
  );
}
.places-card {
  padding: 26px;
}
.section-head {
  margin-bottom: 18px;
}
.section-head > small {
  color: var(--muted);
}
.city-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}
.city-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(222, 232, 240, 0.9);
  border-radius: 17px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: 0.22s;
}
.city-card:hover {
  transform: translateY(-3px);
  border-color: #fff;
  background: #fff;
  box-shadow: 0 12px 25px rgba(66, 87, 116, 0.1);
}
.city-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.city-icon {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, #dceffa, #f7dce5);
}
.city-name {
  display: block;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.city-country {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}
.city-count {
  flex: 0 0 auto;
  color: #c56583;
  font-size: 0.76rem;
}
.places-empty {
  padding: 48px 12px;
  text-align: center;
  color: var(--muted);
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(38, 53, 78, 0.45);
  backdrop-filter: blur(8px);
}
.modal-card {
  position: relative;
  width: min(620px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 30px;
  border: 1px solid #fff;
  border-radius: 26px;
  background: #fffdfb;
  box-shadow: 0 28px 80px rgba(30, 42, 66, 0.25);
}
.modal-card h2 {
  margin: 9px 44px 4px 0;
  font-size: 1.55rem;
}
.modal-subtitle {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.8rem;
}
.modal-close {
  position: absolute;
  right: 18px;
  top: 17px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: #64708a;
  background: #edf3f8;
  font-size: 1.4rem;
  cursor: pointer;
}
.memory-list {
  display: grid;
  gap: 10px;
}
.memory-item {
  padding: 16px;
  border: 1px solid #e6edf3;
  border-radius: 16px;
  background: #f8fbfd;
}
.memory-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.memory-item h3 {
  margin: 0;
  font-size: 0.98rem;
}
.memory-item time {
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}
.memory-item p {
  margin: 9px 0 0;
  color: #66738b;
  font-size: 0.78rem;
  line-height: 1.7;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  transform: translate(-50%, 18px);
  padding: 10px 18px;
  border-radius: 999px;
  color: #fff;
  background: #31415e;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.hidden {
  display: none !important;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  70%,
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}
@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr auto;
    min-height: 64px;
    padding-inline: 15px;
  }
  .brand {
    display: none;
  }
  .place-count {
    font-size: 0.69rem;
  }
  .shell {
    width: min(94vw, 680px);
    padding: 34px 0 64px;
  }
  .hero {
    padding: 4px 3px 28px;
  }
  .hero h1 {
    font-size: clamp(2.6rem, 13vw, 4rem);
  }
  .hero p {
    font-size: 0.86rem;
  }
  .map-card {
    padding: 13px;
    border-radius: 22px;
  }
  .map-heading {
    align-items: flex-start;
    margin: 4px 3px 13px;
  }
  .legend {
    max-width: 130px;
    text-align: right;
  }
  .map-stage {
    height: auto;
    aspect-ratio: 1000/520;
    border-radius: 18px;
  }
  .map-controls {
    right: 8px;
    top: 8px;
    gap: 5px;
  }
  .map-controls button {
    height: 32px;
    min-width: 32px;
    padding: 0 8px;
    font-size: 0.72rem;
  }
  .zoom-buttons button {
    padding: 0;
    font-size: 1.1rem;
  }
  .marker-hit {
    r: 52px;
  }
  .marker-pulse {
    r: 15px;
  }
  .marker-core {
    r: 10px;
  }
  .marker-label {
    font-size: 27px;
    stroke-width: 7px;
  }
  .stats-grid {
    gap: 9px;
  }
  .stat-card {
    min-height: 115px;
    padding: 17px;
  }
  .stat-card strong {
    font-size: 1.75rem;
  }
  .places-card {
    padding: 18px;
  }
  .city-grid {
    grid-template-columns: 1fr;
  }
  .modal {
    align-items: end;
    padding: 10px;
  }
  .modal-card {
    width: 100%;
    max-height: 88vh;
    padding: 25px 19px;
    border-radius: 25px 25px 18px 18px;
  }
}
@media (max-width: 430px) {
  .map-heading h2 {
    font-size: 1.05rem;
  }
  .legend {
    font-size: 0.65rem;
  }
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stat-card {
    min-height: 106px;
    padding: 14px;
  }
  .stat-card strong {
    font-size: 1.48rem;
  }
  .stat-card small {
    font-size: 0.7rem;
  }
  .stat-card > span {
    right: 12px;
    top: 11px;
  }
  .places-card {
    padding: 15px;
  }
}
