:root {
  --bg: #eef4f2;
  --panel: #ffffff;
  --ink: #17201c;
  --muted: #64716b;
  --line: #dce5df;
  --line-strong: #c6d6ce;
  --green: #1f7a5a;
  --green-dark: #0f5d42;
  --green-soft: #e4f2ec;
  --blue: #287aa5;
  --sand: #d79a39;
  --red: #d94a38;
  --shadow: 0 16px 40px rgba(28, 52, 43, 0.1);
  --soft-shadow: 0 8px 24px rgba(28, 52, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}

button,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(198, 214, 206, 0.55);
}

.topbar h1 {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.topbar p {
  max-width: 860px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.quick-links a {
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: #f7faf8;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 6px;
}

.quick-links a:hover {
  border-color: #b8dacb;
  background: #e3f1eb;
}

.now-card {
  min-width: 112px;
  padding: 13px 17px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.now-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.now-card strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
}

.layout {
  display: grid;
  grid-template-columns: 292px minmax(500px, 1fr) 360px;
  gap: 18px;
  padding: 18px;
  align-items: start;
}

.layout > * {
  min-width: 0;
}

.filters,
.detail,
.map-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 10px;
}

.filters,
.detail {
  padding: 18px;
}

.filters,
.detail {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.filters section {
  padding: 14px;
  border: 1px solid var(--line);
  background: #fbfdfc;
  border-radius: 8px;
}

.filters section + section {
  margin-top: 12px;
}

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

h2 {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.25;
}

.segmented,
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented button,
.chip {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink);
  padding: 8px 11px;
  cursor: pointer;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.12s ease;
}

.segmented button:hover,
.chip:hover {
  border-color: #9fcbb9;
  background: #f0f7f3;
}

.segmented button.active,
.chip.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(31, 122, 90, 0.18);
}

select {
  width: 100%;
  margin-top: 10px;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--ink);
}

.map-panel {
  overflow: hidden;
}

.map-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfdfc;
}

.map-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 50%;
}

.normal {
  background: #53645d;
}

.warm {
  background: var(--sand);
}

.hot {
  background: var(--red);
}

.map-canvas {
  position: relative;
  min-height: 660px;
  overflow: hidden;
  background: #dbe8e6;
}

.map-canvas::before {
  display: none;
}

.map-canvas::after {
  display: none;
}

.region-label {
  position: absolute;
  z-index: 1;
  padding: 5px 8px;
  border: 1px solid rgba(220, 229, 223, 0.86);
  background: rgba(255, 255, 255, 0.72);
  color: rgba(23, 32, 28, 0.62);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.leaflet-container {
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.map-fallback {
  display: grid;
  min-height: 360px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.place-list-panel {
  border-top: 1px solid var(--line);
  background: #fbfdfc;
}

.place-list-header {
  padding: 16px 18px 8px;
}

.place-list-header h2 {
  margin-bottom: 4px;
}

.place-list-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.place-list {
  display: grid;
  gap: 9px;
  padding: 10px 18px 18px;
  max-height: 360px;
  overflow: auto;
}

.place-list-row {
  display: grid;
  grid-template-columns: 34px minmax(140px, 1.4fr) minmax(120px, 1fr) 70px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(28, 52, 43, 0.04);
}

.place-list-row:hover {
  border-color: #b8dacb;
  background: #f0f7f3;
}

.place-list-row[data-heat="普通"] {
  opacity: 1;
}

.place-rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 800;
  border-radius: 50%;
}

.place-main strong,
.place-main small {
  display: block;
}

.place-main small,
.place-fit {
  color: var(--muted);
  font-size: 12px;
}

.place-main strong {
  font-size: 14px;
}

.place-heat {
  justify-self: end;
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
}

.place-heat.hot {
  color: var(--red);
  border-color: rgba(217, 74, 56, 0.35);
  background: #fff0ed;
}

.place-heat.warm {
  color: #a4660f;
  border-color: rgba(215, 154, 57, 0.38);
  background: #fff7e8;
}

.place-heat.normal {
  color: #33413b;
  border-color: rgba(83, 100, 93, 0.38);
  background: #edf3ef;
}

.marker {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  cursor: pointer;
}

.marker-pin {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 10px 24px rgba(17, 35, 29, 0.24);
  font-weight: 800;
}

.marker[data-heat="普通"] .marker-pin {
  background: #53645d;
}

.marker[data-heat="较热"] .marker-pin {
  background: var(--sand);
}

.marker[data-heat="Hot"] .marker-pin {
  background: var(--red);
}

.marker[data-heat="普通"] .marker-pin {
  background: #53645d;
}

.marker[data-heat="较热"] .marker-pin {
  background: var(--sand);
}

.marker.historical {
  opacity: 0.42;
}

.marker-label {
  display: block;
  width: max-content;
  max-width: 150px;
  margin-top: 6px;
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(220, 229, 223, 0.9);
  color: var(--ink);
  font-size: 12px;
  box-shadow: 0 6px 16px rgba(28, 52, 43, 0.1);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.marker:hover,
.marker:focus {
  z-index: 6;
}

.marker:hover .marker-label,
.marker:focus .marker-label {
  opacity: 1;
  transform: translateY(0);
}

.marker-label small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.detail h2 {
  font-size: 21px;
}

.detail h2:not(:first-child) {
  margin-top: 22px;
  font-size: 17px;
}

.empty-state h2 {
  margin-top: 0;
}

.detail p {
  color: var(--muted);
  line-height: 1.55;
}

.detail-hero {
  padding: 16px;
  background: linear-gradient(180deg, #f8fcfa 0%, #eef7f2 100%);
  border: 1px solid var(--line);
  border-radius: 9px;
}

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

.detail-hero p {
  margin: 0;
  color: var(--ink);
}

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

.primary-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.primary-badge {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  border-radius: 8px;
}

.primary-badge strong {
  display: block;
  margin-top: 3px;
}

.primary-badge.hot {
  border-color: rgba(217, 74, 56, 0.35);
  background: #fff0ed;
}

.primary-badge.hot strong {
  color: var(--red);
}

.primary-badge.warm {
  border-color: rgba(215, 154, 57, 0.38);
  background: #fff7e8;
}

.primary-badge.warm strong {
  color: #a4660f;
}

.primary-badge.normal {
  border-color: rgba(83, 100, 93, 0.38);
  background: #edf3ef;
}

.primary-badge.normal strong {
  color: #33413b;
}

.nav-link {
  display: inline-block;
  margin-top: 12px;
  padding: 9px 12px;
  background: var(--green-dark);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  border-radius: 7px;
}

.nav-link:hover {
  background: #0b4934;
}

.nav-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 18px;
}

.tag-list.compact {
  margin-top: -8px;
}

.tag {
  padding: 6px 9px;
  background: #eef4f1;
  border: 1px solid var(--line);
  font-size: 13px;
  border-radius: 999px;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.status-line {
  display: inline-block;
  margin: 4px 0 12px;
  padding: 6px 9px;
  background: #f3f1ec;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
}

.status-line.is-now {
  background: #e3f1eb;
  color: #0f5d42;
  border-color: #b8dacb;
}

.metric {
  padding: 12px;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.source-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-list li {
  padding: 10px;
  background: #f8faf8;
  border: 1px solid var(--line);
  font-size: 13px;
  border-radius: 8px;
}

.hotspot-list {
  display: grid;
  gap: 10px;
  margin: 10px 0 18px;
}

.hotspot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hotspot-row strong,
.hotspot-row span {
  display: block;
}

.hotspot-row strong {
  font-size: 14px;
}

.hotspot-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.hotspot-score {
  min-width: 70px;
  text-align: right;
  color: #53645d;
  font-weight: 800;
}

.hotspot-score.is-hot {
  color: var(--red);
}

.hotspot-score small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.notice {
  margin: 0 18px 18px;
  padding: 14px 18px;
  background: #fff8e8;
  border: 1px solid #ead7a8;
  color: #59400d;
  line-height: 1.5;
  border-radius: 10px;
}

.safety-panel {
  margin: 0 18px 18px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 10px;
}

.safety-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.safety-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.safety-grid article {
  padding: 14px;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.safety-grid h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.safety-grid a,
.official-links a {
  display: inline-block;
  margin-top: 10px;
  color: #0f5d42;
  font-weight: 700;
  text-decoration: none;
}

.safety-grid a:hover,
.official-links a:hover {
  text-decoration: underline;
}

.official-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 18px;
}

.official-links a {
  margin-top: 0;
  padding: 8px 10px;
  background: var(--green-soft);
  border: 1px solid #b8dacb;
  font-size: 13px;
  border-radius: 7px;
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .filters,
  .detail {
    position: static;
    max-height: none;
  }

  .map-canvas {
    min-height: 520px;
  }
}

@media (max-width: 640px) {
  .topbar {
    display: block;
    padding: 20px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .now-card {
    margin-top: 16px;
  }

  .layout {
    padding: 8px;
    gap: 12px;
  }

  .filters,
  .detail {
    padding: 10px;
  }

  .filters section {
    padding: 12px;
  }

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

  .now-card {
    width: 100%;
  }

  .chip-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #heatFilters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chip {
    width: 100%;
    padding: 8px 6px;
    text-align: center;
  }

  .filters,
  .detail,
  .map-panel,
  .notice,
  .safety-panel {
    border-radius: 8px;
  }

  .map-header {
    display: block;
  }

  .legend {
    margin-top: 12px;
  }

  .map-canvas {
    min-height: 460px;
  }

  .place-list-row {
    grid-template-columns: 30px 1fr 66px;
    gap: 8px;
  }

  .place-fit {
    grid-column: 2 / 4;
  }

  .safety-grid {
    grid-template-columns: 1fr;
  }

}
