:root {
  --ink: #16181c;
  --muted: #646b73;
  --paper: #f7f4eb;
  --paper-strong: #fffaf0;
  --line: rgba(22, 24, 28, 0.13);
  --brand: #e4b33f;
  --brand-strong: #c8832f;
  --forest: #44695b;
  --sea: #2f6f88;
  --night: #111318;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(23, 24, 28, 0.16);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 80;
  transform: translateY(-150%);
  border-radius: var(--radius);
  background: var(--night);
  color: white;
  padding: 10px 14px;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(190px, auto) 1fr auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.36);
  padding: 12px clamp(14px, 3vw, 32px);
  background: rgba(247, 244, 235, 0.86);
  backdrop-filter: blur(18px);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.brand,
.header-actions,
.site-status,
.map-bottom,
.route-legend,
.zoom-control,
.section-title,
.story-reader-header {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  overflow: hidden;
  place-items: center;
  border-radius: var(--radius);
  background: var(--paper-strong);
  box-shadow: inset 0 0 0 1px rgba(22, 24, 28, 0.12);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-name,
.brand-subtitle {
  display: block;
}

.brand-name {
  font-weight: 850;
}

.brand-subtitle,
.site-status,
.meta-line,
.coordinate-line,
.source-line,
.empty-state {
  color: var(--muted);
}

.brand-subtitle {
  font-size: 0.78rem;
}

.site-status {
  justify-content: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 750;
}

.site-status span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.64);
  padding: 7px 10px;
  white-space: nowrap;
}

.header-actions {
  justify-content: flex-end;
  gap: 8px;
}

.ghost-button,
.primary-button,
.secondary-button,
.zoom-control button,
.route-legend button,
.place-item button,
.story-list button,
.search-results button {
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.76);
  color: var(--ink);
  font-weight: 780;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.ghost-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
}

.primary-button {
  border-color: rgba(200, 131, 47, 0.44);
  background: var(--brand);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.62);
}

.map-app {
  position: relative;
  width: 100vw;
  height: 100vh;
  isolation: isolate;
}

.map-shell,
.map-canvas,
.real-map {
  position: absolute;
  inset: 0;
}

.map-shell {
  z-index: 0;
}

.map-canvas {
  z-index: 0;
}

.real-map {
  z-index: 0;
}

.map-topbar {
  position: absolute;
  top: 82px;
  left: clamp(14px, 3vw, 32px);
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(260px, 470px) minmax(260px, 430px);
  gap: 12px;
  align-items: start;
  max-width: calc(100vw - 520px);
  pointer-events: none;
}

.map-topbar > * {
  pointer-events: auto;
}

.map-topbar > div,
.place-search,
.map-bottom,
.place-panel {
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: var(--radius);
  background: rgba(247, 244, 235, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.map-topbar > div {
  padding: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-strong);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(1.55rem, 2.6vw, 2.8rem);
  line-height: 1.06;
}

h2 {
  font-size: clamp(1.45rem, 2.4vw, 2.25rem);
  line-height: 1.08;
}

h3 {
  font-size: 1.12rem;
  line-height: 1.18;
}

h4 {
  font-size: 0.98rem;
  line-height: 1.26;
}

.place-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
}

.place-search label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.place-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  padding: 0 12px;
}

.place-search button {
  align-self: end;
  min-height: 42px;
}

.map-fallback {
  position: absolute;
  inset: 110px 24px 24px;
  z-index: 15;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(247, 244, 235, 0.9);
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.map-bottom {
  position: absolute;
  left: clamp(14px, 3vw, 32px);
  right: clamp(14px, 3vw, 32px);
  bottom: 18px;
  z-index: 20;
  justify-content: space-between;
  gap: 14px;
  padding: 10px;
  pointer-events: auto;
}

.route-legend {
  gap: 8px;
  overflow-x: auto;
  min-width: 0;
}

.route-legend button {
  display: grid;
  gap: 2px;
  min-width: 170px;
  padding: 8px 10px;
  text-align: left;
}

.route-legend button:hover,
.route-legend button:focus-visible,
.zoom-control button:hover,
.ghost-button:hover,
.secondary-button:hover,
.place-item button:hover,
.story-list button:hover,
.search-results button:hover {
  background: rgba(22, 24, 28, 0.08);
}

.route-legend span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.zoom-control {
  flex: 0 0 auto;
  gap: 6px;
}

.zoom-control button {
  width: 40px;
  padding: 0;
}

.zoom-control input {
  width: 120px;
  accent-color: var(--brand-strong);
}

.leaflet-container {
  background: #dde5df;
  font: inherit;
}

.leaflet-place-marker {
  background: transparent;
  border: 0;
}

.real-marker {
  position: relative;
  display: grid;
  place-items: center;
  border: 2px solid white;
  box-shadow: 0 10px 24px rgba(17, 19, 24, 0.26);
}

.marker-dot-only {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--night);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 850;
}

.marker-expanded {
  width: 112px;
  height: 78px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--night);
}

.marker-expanded img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.76;
}

.marker-expanded span {
  position: absolute;
  inset: auto 6px 6px;
  border-radius: 6px;
  background: rgba(17, 19, 24, 0.78);
  color: white;
  padding: 4px 6px;
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.real-marker.is-active {
  border-color: var(--brand);
  box-shadow:
    0 0 0 4px rgba(228, 179, 63, 0.28),
    0 14px 30px rgba(17, 19, 24, 0.28);
}

.place-panel {
  position: absolute;
  top: 82px;
  right: clamp(14px, 3vw, 32px);
  bottom: 92px;
  z-index: 30;
  width: min(460px, calc(100vw - 28px));
  overflow: auto;
}

.panel-empty,
.panel-section,
.story-reader {
  padding: 18px;
}

.place-hero {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 14px;
}

.place-hero > img {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  object-fit: cover;
  background: transparent;
}

.place-hero p,
.panel-section > p,
.place-item p,
.story-list small {
  color: var(--muted);
  line-height: 1.65;
}

.panel-close {
  position: absolute;
  right: 22px;
  top: 22px;
  z-index: 2;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  background: rgba(17, 19, 24, 0.74);
  color: white;
  padding: 0 11px;
}

.panel-section {
  border-top: 1px solid var(--line);
}

.panel-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.panel-meta div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(22, 24, 28, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
  padding: 10px;
}

.panel-meta strong {
  font-size: 1rem;
}

.panel-meta span,
.coordinate-line,
.meta-line {
  font-size: 0.78rem;
}

.coordinate-line {
  margin-top: 12px;
}

.section-title {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title span {
  border-radius: 999px;
  background: rgba(22, 24, 28, 0.08);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 780;
}

.place-items,
.story-list {
  display: grid;
  gap: 10px;
}

.place-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid rgba(22, 24, 28, 0.09);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
  padding: 8px;
}

.place-item > img {
  width: 96px;
  height: 112px;
  border-radius: 6px;
  object-fit: cover;
  background: transparent;
}

.place-item > div {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.place-item button {
  justify-self: start;
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.gallery-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.gallery-strip img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
  background: transparent;
}

.story-list button,
.search-results button {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 11px;
  text-align: left;
}

.story-list button.is-active {
  border-color: rgba(200, 131, 47, 0.45);
  background: rgba(228, 179, 63, 0.18);
}

.story-list span {
  color: var(--brand-strong);
  font-size: 0.76rem;
  font-weight: 850;
}

.story-list small {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.82rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.search-results {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.search-results span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.story-reader {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.34);
}

.story-reader-header {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.destination-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}

.destination-chips span {
  border-radius: 999px;
  background: rgba(47, 111, 136, 0.12);
  color: var(--sea);
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 780;
}

.markdown-body {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.85;
}

.markdown-body h3,
.markdown-body h4 {
  margin: 24px 0 10px;
}

.markdown-body p,
.markdown-body ul,
.markdown-body blockquote {
  margin: 12px 0;
}

.markdown-body ul {
  padding-left: 20px;
}

.markdown-body blockquote {
  border-left: 4px solid var(--brand);
  color: var(--muted);
  padding-left: 14px;
}

.markdown-body a {
  color: var(--sea);
  font-weight: 780;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.markdown-body figure {
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
}

.markdown-body figure img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  background: transparent;
}

.markdown-body figcaption {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.source-line {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 12px;
  font-size: 0.82rem;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: var(--radius);
  background: var(--night);
  color: white;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

[hidden] {
  display: none !important;
}

@media (max-width: 1120px) {
  .map-topbar {
    right: 14px;
    max-width: none;
    grid-template-columns: 1fr;
  }

  .map-topbar > div {
    display: none;
  }

  .place-panel {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 86px;
    width: auto;
    max-height: min(68vh, 680px);
  }
}

@media (max-width: 760px) {
  body {
    overflow: hidden;
  }

  .site-header {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .site-status,
  .admin-link {
    display: none;
  }

  .map-topbar {
    top: 76px;
    left: 10px;
    right: 10px;
  }

  .place-search {
    grid-template-columns: 1fr;
  }

  .place-search button {
    width: 100%;
  }

  .map-bottom {
    left: 10px;
    right: 10px;
    bottom: 10px;
    display: grid;
  }

  .route-legend {
    order: 2;
  }

  .zoom-control {
    justify-content: space-between;
  }

  .zoom-control input {
    flex: 1;
    width: auto;
  }

  .place-panel {
    left: 8px;
    right: 8px;
    bottom: 92px;
    max-height: 66vh;
  }

  .place-item {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .place-item > img {
    width: 82px;
    height: 104px;
  }

  .panel-meta,
  .gallery-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-reader-header {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-subtitle {
    display: none;
  }

  .place-panel {
    max-height: 62vh;
  }

  .place-item {
    grid-template-columns: 1fr;
  }

  .place-item > img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
  }
}
