:root {
  color-scheme: light;
  --paper: #f6efe3;
  --surface: #fffaf1;
  --surface-strong: #ffffff;
  --ink: #1f2524;
  --muted: #69716e;
  --line: rgba(48, 54, 52, 0.14);
  --brand: #b54834;
  --brand-dark: #853321;
  --forest: #27685e;
  --river: #2f6f9f;
  --gold: #c28a2c;
  --shadow: 0 18px 45px rgba(47, 41, 34, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  height: 100vh;
  min-height: 620px;
}

.sidebar {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.brand-bar {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 700;
}

.brand-bar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.brand-bar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.control-panel {
  display: grid;
  gap: 14px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.search-field {
  display: grid;
  gap: 7px;
}

.search-field span,
.review-form span {
  color: var(--muted);
  font-size: 12px;
}

.search-field input,
.review-form select,
.review-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--ink);
}

.search-field input {
  height: 42px;
  padding: 0 12px;
}

.search-field input:focus,
.review-form select:focus,
.review-form textarea:focus {
  border-color: rgba(181, 72, 52, 0.65);
  box-shadow: 0 0 0 3px rgba(181, 72, 52, 0.12);
}

.day-tabs,
.category-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.tab-button,
.chip-button {
  min-height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  white-space: nowrap;
}

.tab-button {
  min-width: 48px;
  padding: 0 11px;
}

.chip-button {
  padding: 0 10px;
  font-size: 13px;
}

.tab-button.active,
.chip-button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.route-summary {
  display: grid;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
}

.route-summary h2 {
  margin: 0;
  font-size: 16px;
}

.route-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.spot-list {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  min-height: 0;
  padding: 14px 14px 22px;
}

.spot-card {
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 116px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: inherit;
  text-align: left;
  box-shadow: 0 10px 24px rgba(63, 54, 45, 0.06);
}

.spot-card:hover,
.spot-card.active {
  border-color: rgba(181, 72, 52, 0.55);
  box-shadow: 0 14px 28px rgba(63, 54, 45, 0.12);
}

.spot-card-main {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.spot-index {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 8px;
  background: rgba(39, 104, 94, 0.11);
  color: var(--forest);
  font-size: 13px;
  font-weight: 700;
}

.spot-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.spot-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.spot-mini-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-pill,
.detail-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 7px;
  background: #f1eee7;
  color: #3f4643;
  font-size: 12px;
}

.mini-pill {
  padding: 3px 7px;
}

.map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #dfe8dc;
}

.map-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #dfe8dc;
}

.map-toolbar {
  position: absolute;
  z-index: 20;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(31, 37, 36, 0.15);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.94);
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(31, 37, 36, 0.14);
}

.icon-button span {
  font-size: 20px;
  line-height: 1;
}

.icon-button.active {
  border-color: var(--forest);
  color: var(--forest);
}

.map-mode {
  max-width: min(48vw, 360px);
  overflow: hidden;
  padding: 10px 12px;
  border: 1px solid rgba(31, 37, 36, 0.12);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.94);
  color: var(--muted);
  box-shadow: 0 12px 28px rgba(31, 37, 36, 0.12);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-panel {
  position: absolute;
  z-index: 25;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-rows: 190px minmax(0, 1fr);
  width: min(440px, calc(100% - 36px));
  max-height: calc(100% - 96px);
  overflow: hidden;
  border: 1px solid rgba(31, 37, 36, 0.14);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  transform: translateY(calc(100% + 26px));
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.detail-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.close-button {
  position: absolute;
  z-index: 5;
  top: 10px;
  right: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(31, 37, 36, 0.72);
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.detail-media {
  position: relative;
  overflow: hidden;
  min-height: 0;
  background: #d8c9b1;
}

.detail-media img,
.image-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.detail-media img {
  display: block;
  object-fit: cover;
}

.image-fallback {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(181, 72, 52, 0.86), rgba(39, 104, 94, 0.82)),
    radial-gradient(circle at 78% 22%, rgba(255, 255, 255, 0.4), transparent 32%);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.detail-body {
  overflow-y: auto;
  min-height: 0;
  padding: 18px;
}

.detail-kicker {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.detail-body h2 {
  margin: 5px 0 8px;
  font-size: 25px;
  line-height: 1.18;
}

.detail-summary {
  margin: 0;
  color: #3d4643;
  font-size: 14px;
  line-height: 1.65;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.detail-pill {
  padding: 4px 8px;
}

.detail-section {
  margin-top: 20px;
}

.detail-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-grid span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(47, 111, 159, 0.1);
  color: #24455e;
  font-size: 13px;
}

.route-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
  color: #35413e;
  font-size: 14px;
  line-height: 1.5;
}

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

.platform-links a,
.review-form button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
}

.platform-links a:hover {
  border-color: var(--river);
  color: var(--river);
}

.review-form {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.review-form label {
  display: grid;
  gap: 6px;
}

.review-form label:nth-child(2) {
  grid-column: 1 / -1;
}

.review-form select {
  height: 38px;
  padding: 0 10px;
}

.review-form textarea {
  min-height: 82px;
  resize: vertical;
  padding: 9px 10px;
}

.review-form button {
  grid-column: 1 / -1;
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.local-reviews {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.review-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.review-item strong {
  color: var(--brand-dark);
  font-size: 13px;
}

.review-item p {
  margin: 5px 0 0;
  color: #3e4643;
  font-size: 13px;
  line-height: 1.5;
}

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

.spot-marker {
  position: relative;
  display: block;
  width: 38px;
  height: 46px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  --marker-color: var(--brand);
}

.spot-marker::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 34px;
  height: 34px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--marker-color);
  box-shadow: 0 10px 18px rgba(31, 37, 36, 0.22);
  content: "";
  transform: translateX(-50%);
}

.spot-marker::after {
  position: absolute;
  top: 25px;
  left: 50%;
  width: 14px;
  height: 14px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  border-radius: 0 0 4px 0;
  background: var(--marker-color);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.spot-marker span {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 50%;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  transform: translateX(-50%);
}

.spot-marker.extra {
  --marker-color: var(--forest);
}

.spot-marker.active {
  width: 42px;
  height: 50px;
  --marker-color: var(--gold);
}

.spot-marker.active::before {
  width: 38px;
  height: 38px;
}

.spot-marker.active::after {
  top: 28px;
  width: 16px;
  height: 16px;
}

.spot-marker.active span {
  width: 38px;
  height: 38px;
}

.amap-marker-label {
  border: 0 !important;
  background: transparent !important;
}

.spot-marker-label {
  padding: 5px 9px;
  border: 1px solid rgba(31, 37, 36, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(31, 37, 36, 0.18);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.amap-info-card {
  max-width: 280px;
  padding: 4px 2px 2px;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
}

.amap-info-card strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  line-height: 1.25;
}

.amap-info-card p {
  margin: 8px 0 9px;
  color: #3e4643;
  font-size: 13px;
  line-height: 1.55;
}

.amap-info-card span,
.amap-info-kicker {
  color: var(--muted);
  font-size: 12px;
}

.amap-info-card span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 7px;
  border-radius: 7px;
  background: #f1eee7;
}

.schematic-map {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(47, 111, 159, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(47, 111, 159, 0.08) 1px, transparent 1px),
    #dde9dc;
  background-size: 72px 72px;
}

.schematic-map::before {
  position: absolute;
  inset: 9% 12% 8% 18%;
  border: 2px solid rgba(39, 104, 94, 0.2);
  border-radius: 44% 56% 48% 52% / 30% 28% 72% 70%;
  background: rgba(246, 239, 227, 0.46);
  content: "";
}

.schematic-label {
  position: absolute;
  top: 78px;
  left: 50%;
  z-index: 2;
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.92);
  color: var(--muted);
  font-size: 13px;
  transform: translateX(-50%);
}

.schematic-marker {
  position: absolute;
  z-index: 4;
  width: 50px;
  height: 54px;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -100%);
}

.schematic-routes {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

@media (max-width: 920px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: flex;
    min-height: 100vh;
    height: auto;
    flex-direction: column;
  }

  .sidebar {
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-bar {
    padding: 16px;
  }

  .control-panel {
    padding: 14px 16px 10px;
  }

  .route-summary {
    padding: 12px 16px;
  }

  .spot-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 16px 16px;
  }

  .spot-card {
    width: min(82vw, 310px);
    flex: 0 0 auto;
  }

  .map-stage {
    height: 68vh;
    min-height: 560px;
  }

  .detail-panel {
    right: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
    max-height: calc(100% - 76px);
    grid-template-rows: 156px minmax(0, 1fr);
  }

  .map-toolbar {
    top: 10px;
    left: 10px;
  }
}

@media (max-width: 560px) {
  .brand-bar h1 {
    font-size: 21px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    font-size: 24px;
  }

  .route-summary h2 {
    font-size: 15px;
  }

  .map-stage {
    height: 72vh;
    min-height: 540px;
  }

  .map-mode {
    max-width: 46vw;
    padding: 9px 10px;
  }

  .detail-body {
    padding: 15px;
  }

  .detail-body h2 {
    font-size: 22px;
  }

  .platform-links {
    grid-template-columns: 1fr;
  }
}
