.sketch-map-page {
  --map-water: #dce8df;
  --map-land: #e8ebdd;
  --map-land-deep: #d9e1d0;
  --map-river: #b9d4d4;
  --map-visited: #c95724;
  --map-reference: #68816c;
}

.sketch-map-page main {
  overflow: hidden;
}

.sketch-map-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(250px, .55fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  padding-block: clamp(4.2rem, 8vw, 7.5rem) clamp(3.2rem, 6vw, 5.8rem);
  align-items: end;
}

.sketch-map-hero h1 {
  max-width: 7ch;
  margin-bottom: 1.4rem;
  font-size: clamp(3.7rem, 8.4vw, 7.8rem);
}

.sketch-map-hero-copy > p:last-child {
  max-width: 35rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
}

.sketch-map-progress {
  position: relative;
  padding: 1.7rem 0 1rem 1.7rem;
  border-left: 1px solid var(--forest);
}

.sketch-map-progress::before {
  position: absolute;
  top: 0;
  left: -6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--orange);
  content: "";
}

.sketch-map-progress strong {
  display: block;
  margin-bottom: .35rem;
  color: var(--forest-dark);
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3.7rem);
  font-weight: 500;
  line-height: 1;
}

.sketch-map-progress p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

.sketch-map-section {
  padding-block: 0 clamp(5rem, 9vw, 8.5rem);
}

.sketch-map-heading {
  max-width: 43rem;
  margin-bottom: 2rem;
}

.sketch-map-heading h2 {
  margin-bottom: .8rem;
}

.sketch-map-heading p {
  max-width: 38rem;
  margin-bottom: 0;
  color: var(--muted);
}

.sketch-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
  min-height: 690px;
  background: var(--paper-bright);
  border: 1px solid var(--line);
}

.sketch-map-figure {
  display: flex;
  min-width: 0;
  margin: 0;
  padding: clamp(1rem, 2.5vw, 2rem);
  flex-direction: column;
  background:
    radial-gradient(circle at 22% 14%, rgba(255, 140, 66, .12), transparent 23%),
    linear-gradient(145deg, #f4f1e8, #ecefe5);
  border-right: 1px solid var(--line);
}

.sketch-map-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 1373 / 1146;
  min-height: 0;
  overflow: hidden;
  background: var(--map-water);
  border: 10px solid rgba(255, 253, 248, .84);
  box-shadow: 0 24px 60px -46px rgba(23, 56, 37, .7);
}

.sketch-map-canvas::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: radial-gradient(rgba(45, 95, 63, .14) .6px, transparent .75px);
  background-size: 8px 8px;
  content: "";
  opacity: 0;
}

.sketch-map-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sketch-map-shape {
  display: block;
  width: 100%;
  height: 100%;
}

.map-land {
  fill: var(--map-land);
  stroke: rgba(45, 95, 63, .35);
  stroke-width: 2;
}

.map-island {
  fill: var(--map-land-deep);
  stroke: rgba(45, 95, 63, .28);
  stroke-width: 1.5;
}

.map-grid-line {
  fill: none;
  stroke: rgba(67, 91, 71, .09);
  stroke-dasharray: 3 9;
  stroke-width: 1;
}

.map-river {
  fill: none;
  stroke: var(--map-river);
  stroke-linecap: round;
  stroke-width: 31;
}

.map-river-edge {
  fill: none;
  stroke: rgba(45, 95, 63, .22);
  stroke-linecap: round;
  stroke-width: 1.5;
}

.map-creek {
  fill: none;
  stroke: var(--map-river);
  stroke-linecap: round;
  stroke-width: 12;
}

.map-district-line {
  fill: none;
  stroke: rgba(67, 91, 71, .16);
  stroke-dasharray: 4 7;
  stroke-width: 1.4;
}

.map-label {
  fill: rgba(45, 70, 51, .48);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: .18em;
}

.map-water-label {
  fill: rgba(45, 95, 63, .56);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .18em;
}

.map-north {
  fill: rgba(45, 95, 63, .62);
  font-family: var(--sans);
  font-size: 11px;
}

.sketch-map-markers {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.sketch-marker {
  position: absolute;
  top: var(--marker-y);
  left: var(--marker-x);
  z-index: 2;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--forest-dark);
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.sketch-marker-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--paper-bright);
  border-radius: 50%;
  background: var(--map-reference);
  box-shadow: 0 0 0 1px rgba(45, 95, 63, .24);
  transform: translate(-50%, -50%);
  transition: transform .24s var(--ease), background-color .24s var(--ease);
}

.sketch-marker-number {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  color: var(--paper-bright);
  font-family: var(--sans);
  font-size: .55rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.sketch-marker--visited {
  z-index: 4;
}

.sketch-marker--visited .sketch-marker-dot {
  width: 22px;
  height: 22px;
  border-width: 4px;
  background: var(--map-visited);
  box-shadow: 0 0 0 1px rgba(160, 75, 34, .38), 0 8px 20px rgba(160, 75, 34, .26);
}

.sketch-marker-label {
  position: absolute;
  top: 50%;
  left: calc(100% + 3px);
  width: max-content;
  max-width: 128px;
  padding: .35rem .45rem;
  background: rgba(255, 253, 248, .94);
  border: 1px solid rgba(201, 87, 36, .24);
  color: var(--forest-dark);
  font-family: var(--serif);
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.25;
  pointer-events: none;
  transform: translateY(-50%);
}

.sketch-marker--label-left .sketch-marker-label {
  right: calc(100% + 3px);
  left: auto;
}

.sketch-marker--label-above-left .sketch-marker-label {
  top: auto;
  bottom: calc(100% + 1px);
  right: 50%;
  left: auto;
  transform: none;
}

.sketch-marker--visited .sketch-marker-dot::before {
  position: absolute;
  inset: -9px;
  border: 1px solid rgba(201, 87, 36, .52);
  border-radius: 50%;
  content: "";
}

.sketch-marker:hover .sketch-marker-dot,
.sketch-marker:focus-visible .sketch-marker-dot,
.sketch-marker.is-active .sketch-marker-dot {
  transform: translate(-50%, -50%) scale(1.35);
}

.sketch-marker:focus-visible {
  outline: 2px solid var(--forest-dark);
  outline-offset: 2px;
}

.sketch-marker-tooltip {
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  display: grid;
  width: max-content;
  max-width: 190px;
  padding: .65rem .75rem;
  gap: .1rem;
  background: rgba(255, 253, 248, .96);
  border: 1px solid rgba(45, 95, 63, .2);
  color: var(--ink);
  box-shadow: 0 14px 28px -20px rgba(38, 49, 41, .6);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .2s ease, transform .2s var(--ease);
}

.sketch-marker-tooltip strong {
  font-family: var(--serif);
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.3;
}

.sketch-marker-tooltip span:not(:where(.type-copy, .type-word)) {
  color: var(--muted);
  font-size: .68rem;
}

.sketch-marker:hover .sketch-marker-tooltip,
.sketch-marker:focus-visible .sketch-marker-tooltip,
.sketch-marker.is-active .sketch-marker-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sketch-marker--visited .sketch-marker-tooltip {
  display: none;
}

.sketch-map-legend {
  margin-top: 1rem;
  color: var(--muted);
  font-size: .73rem;
}

.sketch-map-legend-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .7rem 1.25rem;
}

.sketch-map-legend span:not(:where(.type-copy, .type-word)) {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.sketch-map-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--map-reference);
}

.sketch-map-legend .is-visited i {
  width: 13px;
  height: 13px;
  border: 3px solid var(--paper-bright);
  background: var(--map-visited);
  box-shadow: 0 0 0 1px rgba(160, 75, 34, .35);
}

.sketch-map-legend small {
  margin-left: auto;
  color: var(--muted);
  font-size: .68rem;
}

.sketch-map-index {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1.1rem;
  padding-top: 1rem;
  gap: .35rem .75rem;
  border-top: 1px solid rgba(45, 95, 63, .14);
}

.sketch-map-index-item {
  display: grid;
  grid-template-columns: 1.55rem minmax(0, 1fr);
  width: 100%;
  min-height: 34px;
  padding: .28rem .35rem;
  align-items: center;
  gap: .25rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.sketch-map-index-item > span {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  border-radius: 50%;
  background: var(--map-reference);
  color: var(--paper-bright);
  font-size: .55rem;
  font-weight: 800;
}

.sketch-map-index-item strong {
  min-width: 0;
  font-size: .66rem;
  font-weight: 600;
  line-height: 1.25;
}

.sketch-map-index-item--visited {
  color: var(--forest-dark);
}

.sketch-map-index-item--visited > span {
  background: var(--map-visited);
}

.sketch-map-index-item:hover,
.sketch-map-index-item:focus-visible,
.sketch-map-index-item.is-active {
  background: rgba(255, 253, 248, .72);
  border-color: rgba(45, 95, 63, .18);
}

.sketch-map-index-item:focus-visible {
  outline: 2px solid var(--forest-dark);
  outline-offset: 1px;
}

.sketch-map-detail {
  display: flex;
  min-width: 0;
  padding: clamp(1.5rem, 3.2vw, 2.8rem);
  flex-direction: column;
  background: var(--paper-bright);
}

.sketch-detail-status {
  margin-bottom: 1.35rem;
  color: var(--rust);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .11em;
}

.sketch-map-detail[data-status="reference"] .sketch-detail-status {
  color: var(--forest);
}

.sketch-map-detail h2 {
  margin-bottom: 1.3rem;
  font-size: clamp(2rem, 3vw, 3.1rem);
}

.sketch-detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 1.5rem;
  padding: 0;
  gap: 1rem;
}

.sketch-detail-facts div {
  min-width: 0;
}

.sketch-detail-facts dt {
  margin-bottom: .2rem;
  color: var(--muted);
  font-size: .68rem;
}

.sketch-detail-facts dd {
  margin: 0;
  color: var(--forest-dark);
  font-size: .86rem;
  font-weight: 700;
}

.sketch-detail-area {
  margin-bottom: 1.4rem;
  color: var(--muted);
  font-size: .82rem;
}

.sketch-detail-summary {
  margin-bottom: 1.3rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.16rem;
  line-height: 1.65;
}

.sketch-detail-note {
  margin-bottom: 1.7rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.85;
}

.sketch-detail-media {
  margin: auto 0 1.2rem;
  padding: 7px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
}

.sketch-detail-media[hidden] {
  display: none;
}

.sketch-detail-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.sketch-detail-placeholder {
  display: flex;
  min-height: 170px;
  margin: auto 0 1.2rem;
  padding: 1.5rem;
  justify-content: end;
  flex-direction: column;
  background:
    radial-gradient(circle at 68% 27%, rgba(255, 140, 66, .25), transparent 24%),
    radial-gradient(circle at 28% 70%, rgba(45, 95, 63, .22), transparent 31%),
    var(--sage-light);
  border: 1px solid var(--line);
}

.sketch-detail-placeholder[hidden] {
  display: none;
}

.sketch-detail-placeholder strong {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
}

.sketch-detail-placeholder span:not(:where(.type-copy, .type-word)) {
  max-width: 21rem;
  margin-top: .35rem;
  color: var(--muted);
  font-size: .75rem;
}

.sketch-detail-article[hidden] {
  display: none;
}

.sketch-map-next {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(320px, 1.2fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  padding-block: clamp(4.5rem, 8vw, 7rem);
  border-top: 1px solid var(--line);
  align-items: start;
}

.sketch-map-next h2 {
  max-width: 10ch;
}

.sketch-map-next-copy {
  max-width: 42rem;
}

.sketch-map-next-copy p {
  color: var(--muted);
}

.sketch-map-actions {
  display: flex;
  margin-top: 1.8rem;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  .sketch-marker--visited .sketch-marker-dot::before {
    animation: sketch-pulse 2.8s var(--ease) infinite;
  }

  @keyframes sketch-pulse {
    0%, 38% { opacity: .72; transform: scale(.72); }
    72%, 100% { opacity: 0; transform: scale(1.65); }
  }
}

@media (max-width: 900px) {
  .sketch-map-hero,
  .sketch-map-layout,
  .sketch-map-next {
    grid-template-columns: 1fr;
  }

  .sketch-map-hero {
    align-items: start;
  }

  .sketch-map-progress {
    max-width: 26rem;
  }

  .sketch-map-layout {
    min-height: 0;
  }

  .sketch-map-figure {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sketch-map-detail {
    min-height: 570px;
  }
}

@media (max-width: 680px) {
  .sketch-map-hero {
    gap: 2rem;
    padding-block: 3.2rem 3rem;
  }

  .sketch-map-hero h1 {
    font-size: clamp(3rem, 16vw, 4.45rem);
  }

  .sketch-map-section {
    width: calc(100% - 20px);
  }

  .sketch-map-heading {
    width: calc(100% - 12px);
    margin-inline: auto;
  }

  .sketch-map-figure {
    padding: .6rem;
  }

  .sketch-map-canvas {
    aspect-ratio: 1373 / 1146;
    border-width: 5px;
  }

  .sketch-marker {
    width: 38px;
    height: 38px;
  }

  .sketch-marker-tooltip {
    display: none;
  }

  .sketch-marker--visited .sketch-marker-dot {
    width: 21px;
    height: 21px;
  }

  .sketch-marker-label {
    max-width: 100px;
    padding: .25rem .35rem;
    font-size: .6rem;
  }

  .map-label {
    font-size: 11px;
  }

  .sketch-map-legend {
    padding: .35rem .3rem .2rem;
  }

  .sketch-map-legend small {
    width: 100%;
    margin-left: 0;
  }

  .sketch-map-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .25rem .35rem;
  }

  .sketch-map-detail {
    min-height: 0;
    padding: 1.5rem 1.25rem;
  }

  .sketch-detail-media,
  .sketch-detail-placeholder {
    margin-top: 1rem;
  }

  .sketch-map-next {
    gap: 1.2rem;
  }

  .sketch-map-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .sketch-map-actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sketch-marker--visited .sketch-marker-dot::before {
    animation: none;
  }
}

/* 地点名称与编号分开，手机上也能直接读清并点击。 */
.sketch-map-index-item { min-height:44px; }
.sketch-map-index-item strong { font-size:.875rem; line-height:1.5; }
/* 有些地点仅展示作者记录，未接入投稿时不显示上传按钮。 */
[data-detail-upload][hidden] { display:none!important; }

/* Compact introduction keeps the interactive map near the first screen. */
.sketch-map-hero{padding-block:2rem 1.5rem;gap:2rem;align-items:center}
.sketch-map-hero h1{max-width:none;font-size:clamp(2.2rem,4.5vw,4rem);line-height:1.25;margin-bottom:.75rem}
.sketch-map-hero-copy>p:last-child{margin-bottom:0;font-size:1rem}
.sketch-map-progress{padding-block:.35rem}.sketch-map-progress strong{font-size:1.8rem}
.sketch-map-heading{max-width:none;margin-bottom:1.25rem}.sketch-map-heading h2{font-size:1.5rem;line-height:1.4;margin-bottom:.35rem}
.sketch-map-heading p{max-width:none;font-size:.95rem}
@media(max-width:680px){.sketch-map-hero{padding-block:1.25rem;gap:1rem}.sketch-map-hero h1{font-size:2.2rem}.sketch-map-hero .eyebrow{margin-bottom:.6rem}.sketch-map-progress{padding:.4rem 0 .4rem 1rem}.sketch-map-progress strong{font-size:1.35rem}.sketch-map-progress p{font-size:.8rem}.sketch-map-heading h2{font-size:1.25rem}}

/* Name selection remains a generous touch target without overlapping map pins. */
.sketch-place-picker { margin-top:1rem; border-top:1px solid var(--line); }
.sketch-place-picker summary { padding:1rem 0; min-height:44px; cursor:pointer; color:var(--forest); font-weight:600; }
.sketch-place-picker summary:focus-visible { outline:2px solid var(--forest); outline-offset:3px; }
.sketch-map-detail { scroll-margin-top:calc(var(--header-height, 70px) + 1rem); }
