:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  --ink: #17202a;
  --muted: #667085;
  --line: #d6dde6;
  --panel: #f7f9fb;
  --accent: #176b87;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #eef3f6;
  overflow: hidden;
}

.sidebar {
  position: fixed;
  z-index: 600;
  inset: 0 auto 0 0;
  width: 340px;
  background: rgba(255, 255, 255, 0.96);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  box-shadow: 6px 0 24px rgba(16, 24, 40, 0.1);
  transition: transform 180ms ease;
}

.sidebar-toggle {
  position: fixed;
  z-index: 700;
  left: 340px;
  top: 88px;
  width: 30px;
  height: 42px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
  box-shadow: 4px 4px 16px rgba(16, 24, 40, 0.1);
  transition: left 180ms ease;
}

body.sidebar-collapsed .sidebar {
  transform: translateX(-340px);
}

body.sidebar-collapsed .sidebar-toggle {
  left: 0;
}

body.sidebar-collapsed .sidebar-toggle {
  transform: rotate(180deg);
}

.brand {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.title {
  font-size: 22px;
  font-weight: 700;
}

.sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.filters {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

select,
input {
  width: 100%;
  height: 36px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  padding: 0 10px;
  background: white;
  color: var(--ink);
  font-size: 14px;
}

.summary {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}

.tree {
  overflow: auto;
  padding: 8px 10px 16px;
}

.node {
  display: block;
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 6px 8px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.node:hover,
.node.active {
  background: #e8f2f5;
}

.node.city {
  padding-left: 28px;
  color: #344054;
}

.node.county {
  padding-left: 48px;
  color: #475467;
}

.tree-icon {
  display: inline-flex;
  width: 16px;
  color: var(--accent);
  font-weight: 700;
}

.count {
  float: right;
  color: var(--muted);
}

.map-wrap {
  position: fixed;
  inset: 0;
}

#map {
  width: 100%;
  height: 100%;
}

.detail {
  position: absolute;
  z-index: 650;
  right: 18px;
  bottom: 18px;
  width: min(380px, calc(100vw - 376px));
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.16);
}

.detail.hidden {
  display: none;
}

.detail h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.detail p {
  margin: 6px 0;
  font-size: 13px;
  line-height: 1.5;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e8f2f5;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.spot-label {
  border: 0;
  border-radius: 4px;
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.86);
  color: #1f2937;
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.18);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.spot-popup {
  min-width: 220px;
}

.spot-popup strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.spot-popup span {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.spot-popup p {
  margin: 0 0 10px;
  color: #475467;
  line-height: 1.5;
}

.spot-popup a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.detail-actions {
  margin-top: 10px;
}

.detail-actions a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-size: 13px;
}

@media (max-width: 760px) {
  .sidebar {
    width: 100%;
    height: 42vh;
    inset: auto 0 0 0;
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .map-wrap {
    inset: 0;
  }

  .sidebar-toggle {
    left: auto;
    right: 12px;
    top: auto;
    bottom: 42vh;
    border-left: 1px solid var(--line);
    border-radius: 6px 6px 0 0;
  }

  body.sidebar-collapsed .sidebar {
    transform: translateY(42vh);
  }

  body.sidebar-collapsed .sidebar-toggle {
    left: auto;
    right: 12px;
    bottom: 0;
  }

  .detail {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 12px;
  }
}

.detail-page {
  overflow: auto;
  background: #eef3f6;
}

.spot-page {
  width: min(980px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  height: 34px;
  margin-bottom: 14px;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}

.spot-hero,
.comment-box {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.spot-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.spot-hero h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
}

.spot-hero p {
  margin: 10px 0 0;
  color: #344054;
  line-height: 1.6;
}

.comment-box {
  margin-top: 16px;
}

.comment-box h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.comment-form {
  display: grid;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.comment-form textarea {
  min-height: 96px;
  resize: vertical;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  padding: 10px;
  font: inherit;
  line-height: 1.5;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.comment-form button {
  width: 110px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 14px;
}

.preview-grid,
.comment-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.preview-grid img,
.comment-images img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.comments {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.comment-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.comment-item time {
  color: var(--muted);
  font-size: 12px;
}

.comment-item p {
  margin: 8px 0 12px;
  white-space: pre-wrap;
  line-height: 1.6;
}

.empty {
  color: var(--muted);
  font-size: 14px;
}
