:root {
  --red: #b81c22;
  --red-dark: #8c1218;
  --red-light: #f6e6e7;
  --gold: #e8b444;
  --ink: #262626;
  --ink-2: #5c5c5c;
  --line: #e6e0d8;
  --paper: #f7f1e8;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

[v-cloak] {
  display: none;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ---------------- 顶部标题栏 ---------------- */
.topbar {
  height: 68px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: linear-gradient(100deg, #8c1218 0%, #b81c22 55%, #cf3b31 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(120, 20, 20, 0.28);
  z-index: 20;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.brand > div {
  min-width: 0;
  overflow: hidden;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: var(--gold);
  font-size: 19px;
}

.brand-mark.has-logo {
  border-radius: 8px;
  background: #fff;
  border-color: rgba(255, 255, 255, 0.6);
  overflow: hidden;
  padding: 0;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand h1 {
  font-size: 21px;
  letter-spacing: 1px;
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand p {
  margin: 3px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.76);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 20px;
  padding: 6px 12px;
  gap: 8px;
  width: 300px;
  max-width: 38vw;
  flex: 0 0 auto;
  transition: background 0.2s;
}

.search:focus-within {
  background: rgba(255, 255, 255, 0.28);
}

.search .icon {
  font-size: 13px;
  opacity: 0.85;
}

.search input {
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 13px;
  width: 100%;
}

.search input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.search .clear {
  border: 0;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  line-height: 16px;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

/* ---------------- 地图区 ---------------- */
.map-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #ffffff;
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
  background: #fdf6ea url("../img/paper.jpg") repeat 0 0;
  z-index: 0;
}

/* 地图纸面质感 */
.leaflet-container {
  font-family: inherit;
}

.leaflet-tile {
  image-rendering: auto;
}

/* 缩放控件 */
.leaflet-bar {
  border: 0 !important;
  box-shadow: 0 3px 12px rgba(40, 20, 20, 0.18) !important;
  border-radius: 9px;
  overflow: hidden;
}

.leaflet-bar a {
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  color: var(--ink-2) !important;
  border-bottom: 1px solid var(--line) !important;
  background: #fff !important;
  font-size: 16px;
}

.leaflet-bar a:hover {
  background: #fdf3f3 !important;
  color: var(--red) !important;
}

/* 图钉样式 */
.svc-pin-wrap {
  background: transparent;
  border: 0;
}

.svc-pin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(150deg, #d4342c, #a8141a);
  border: 2px solid #fff;
  box-shadow: 0 3px 10px rgba(120, 20, 20, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  overflow: hidden;
}

.svc-pin-wrap:hover .svc-pin,
.svc-pin-wrap.is-active .svc-pin {
  transform: translateY(-2px) scale(1.12);
  box-shadow: 0 6px 16px rgba(120, 20, 20, 0.5);
}

/* 当前选中的图钉：放大 + 呼吸圈，一眼能看出是哪一个 */
.svc-pin-wrap.is-active .svc-pin {
  transform: translateY(-3px) scale(1.3);
  box-shadow: 0 8px 20px rgba(120, 20, 20, 0.6);
}

.svc-pin-wrap.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 2px solid rgba(200, 40, 42, 0.7);
  animation: pin-pulse 1.6s ease-out infinite;
  pointer-events: none;
}

@keyframes pin-pulse {
  0% { transform: scale(0.95); opacity: 0.9; }
  70% { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}

.svc-pin-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.svc-tooltip {
  background: rgba(40, 20, 20, 0.9);
  border: 0;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  box-shadow: none;
}

.svc-tooltip::before {
  display: none;
}

/* ---------------- 左侧列表面板 ---------------- */
.panel {
  position: absolute;
  left: 16px;
  top: 16px;
  width: 306px;
  max-height: calc(100% - 32px);
  background: rgba(255, 255, 255, 0.97);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(40, 20, 20, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 16;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.panel.collapsed {
  transform: translateX(-330px);
  opacity: 0;
  pointer-events: none;
}

.panel-head {
  padding: 13px 14px 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdf9, #fdf9f3);
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 9px;
}

.panel-title h2 {
  font-size: 15px;
  margin: 0;
  font-weight: 600;
  color: var(--red-dark);
}

.panel-title span {
  font-size: 12px;
  color: var(--ink-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 92px;
  overflow-y: auto;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.6;
}

.chip:hover {
  border-color: #e3b6b8;
  color: var(--red);
}

.chip.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.list {
  overflow-y: auto;
  padding: 6px 8px 10px;
  flex: 1 1 auto;
}

.item {
  display: flex;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  align-items: flex-start;
}

.item:hover,
.item.active {
  background: var(--red-light);
}

.item-ico {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(150deg, #d4342c, #a8141a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #fff;
  box-shadow: 0 1px 4px rgba(120, 20, 20, 0.25);
  margin-top: 2px;
  font-size: 12px;
}

.item-ico img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.item-main {
  min-width: 0;
  flex: 1 1 auto;
}

.item-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-sub {
  font-size: 11.5px;
  color: #8a8a8a;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty {
  padding: 30px 12px;
  text-align: center;
  color: #a8a8a8;
  font-size: 12.5px;
}

/* 面板开关按钮（移动端） */
.panel-toggle {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 17;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--red-dark);
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(40, 20, 20, 0.16);
  display: none;
  align-items: center;
  justify-content: center;
}

.panel.collapsed ~ .panel-toggle {
  display: flex;
}

.panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  align-self: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--red-dark);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
}

.panel-close:hover {
  background: #fff;
  border-color: var(--line);
}

/* 复位按钮 */
.reset-btn {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 12;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 13px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(40, 20, 20, 0.14);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s, border-color 0.15s;
}

.reset-btn:hover {
  color: var(--red);
  border-color: #e3b6b8;
}

/* 坐标状态条 */
.coord-bar {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 11;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 12px;
  color: var(--ink-2);
  box-shadow: 0 2px 10px rgba(40, 20, 20, 0.12);
  white-space: nowrap;
  pointer-events: none;
}

.coord-bar b {
  color: var(--red-dark);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------------- 详情卡 ---------------- */
.detail-card {
  position: absolute;
  left: 0;
  top: 0;
  width: 340px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 60px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(40, 20, 20, 0.22);
  z-index: 14;
  display: flex;
  flex-direction: column;
  overflow: visible;
  animation: pop 0.18s ease;
}

/* 指向站点的小箭头 */
.detail-caret {
  position: absolute;
  bottom: -7px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  background: #fff;
  transform: rotate(45deg);
  border-radius: 3px;
  box-shadow: 2px 2px 5px rgba(40, 20, 20, 0.1);
  pointer-events: none;
}

.detail-card.below .detail-caret {
  bottom: auto;
  top: -7px;
  background: #a8171d;
  box-shadow: -2px -2px 5px rgba(40, 20, 20, 0.1);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.detail-head {
  padding: 14px 16px;
  background: linear-gradient(120deg, #8c1218, #b81c22);
  color: #fff;
  position: relative;
  border-radius: 12px 12px 0 0;
  flex: none;
}

.detail-head h3 {
  margin: 0;
  font-size: 16px;
  padding-right: 26px;
  line-height: 1.45;
}

.detail-head .tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 11.5px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.34);
  padding: 2px 8px;
  border-radius: 10px;
}

.close {
  position: absolute;
  right: 12px;
  top: 12px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
}

.detail-body {
  padding: 12px 16px 16px;
  overflow-y: auto;
}

.row {
  display: flex;
  gap: 9px;
  font-size: 13px;
  color: var(--ink-2);
  padding: 6px 0;
  line-height: 1.6;
}

.row .k {
  flex: 0 0 58px;
  color: #9a9a9a;
  font-size: 12.5px;
  padding-top: 1px;
  white-space: nowrap;
}

.row .v {
  flex: 1 1 auto;
  word-break: break-all;
  color: var(--ink);
}

.row .v a {
  color: var(--red);
  text-decoration: none;
}

.intro {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  line-height: 1.75;
  color: #444;
  white-space: pre-wrap;
  word-break: break-word;
}

.coords {
  margin-top: 10px;
  font-size: 11.5px;
  color: #9a9a9a;
  font-variant-numeric: tabular-nums;
}

/* 导航按钮 */
.nav-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e3b6b8;
  border-radius: 8px;
  background: #fff;
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.08s, box-shadow 0.15s;
  box-shadow: 0 1px 4px rgba(140, 18, 24, 0.06);
}

.nav-btn:hover {
  background: #fdf3f3;
  border-color: #cf7276;
  box-shadow: 0 2px 8px rgba(140, 18, 24, 0.1);
}

.nav-btn:active {
  transform: scale(0.98);
}

.nav-btn-baidu {
  border-color: #e3cbb0;
  color: #b4732a;
  box-shadow: 0 1px 4px rgba(180, 115, 42, 0.07);
}

.nav-btn-baidu:hover {
  background: #fff9f0;
  border-color: #d7a058;
  box-shadow: 0 2px 8px rgba(180, 115, 42, 0.12);
}

.nav-btn .nav-ico {
  font-size: 15px;
}

.nav-tip {
  margin-top: 12px;
  font-size: 12px;
  color: #9a9a9a;
  text-align: center;
}

/* ---------------- 移动端适配 ---------------- */
@media (max-width: 768px) {
  .topbar {
    height: 58px;
    padding: 0 12px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .brand h1 {
    font-size: 15px;
    letter-spacing: 0;
  }

  .brand p {
    display: none;
  }

  .search {
    width: 40%;
    max-width: 40%;
    flex: 0 0 auto;
    padding: 5px 10px;
    gap: 5px;
  }

  .search input {
    font-size: 12px;
  }

  .search .icon {
    font-size: 11px;
  }

  .panel-close {
    display: flex;
  }

  .panel {
    left: 10px;
    right: 10px;
    width: auto;
    bottom: 10px;
    top: auto;
    max-height: 46%;
  }

  .panel.collapsed {
    transform: translateY(calc(100% + 20px));
  }

  .detail-card {
    left: 10px;
    right: 10px;
    top: auto;
    width: auto;
    bottom: 62px;
    max-height: 55%;
  }

  .detail-card .detail-caret {
    display: none;
  }

  .panel-toggle {
    left: 10px;
    top: 10px;
  }

  .reset-btn {
    right: 10px;
    top: 10px;
  }

  .coord-bar {
    bottom: 8px;
    font-size: 11px;
    padding: 4px 12px;
  }
}
