* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  color: #333;
}

button, input { font-family: inherit; }

a { color: #1677ff; }

.map-page { overflow: hidden; background: #e8edf2; }

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #e8edf2;
}

.map-loading {
  position: absolute;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.88);
  color: #0f4c81;
  font-size: 16px;
}

.map-loading.error { color: #c0392b; text-align: center; padding: 0 24px; line-height: 1.7; }

.brand-card {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1001;
  width: 196px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 16px 14px 14px;
  text-align: center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  margin: 0 auto 8px;
  border-radius: 12px;
  background: #1677ff;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 42px;
}

.brand-title { font-size: 16px; font-weight: 700; }
.brand-domain { margin-top: 2px; color: #1677ff; font-size: 12px; }
.brand-desc { margin-top: 8px; color: #666; font-size: 12px; line-height: 1.6; }

.close-btn, .brand-restore {
  border: 0;
  cursor: pointer;
}

.close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f0f2f5;
  color: #999;
  line-height: 20px;
}

.close-btn:hover { background: #e5e6eb; color: #666; }

.brand-restore {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1001;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  color: #1677ff;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.top-bar {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 280px);
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.bar-brand {
  color: #1677ff;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  padding: 0 4px 0 6px;
}

.tab-container { position: relative; display: flex; flex: 0 0 auto; }

.tab-btn {
  width: 96px;
  height: 38px;
  border: 0;
  background: transparent;
  color: #333;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.tab-btn.active { color: #fff; }

.tab-slide-bg {
  position: absolute;
  top: 0;
  left: 96px;
  width: 96px;
  height: 38px;
  border-radius: 19px;
  background: #1677ff;
  transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.28s;
  z-index: 1;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 0 12px;
  border-left: 1px solid #eee;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  white-space: nowrap;
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
}

.custom-checkbox.checked {
  background: #1677ff;
  border-color: #1677ff;
  color: #fff;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 250px;
  height: 38px;
  padding: 0 5px 0 14px;
  background: #f0f2f5;
  border-radius: 19px;
}

.search-input {
  flex: 1;
  width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 14px;
}

.search-btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #1677ff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  max-height: 280px;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  padding: 6px;
}

.search-panel button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.search-panel button:hover { background: #f5f8ff; }
.search-panel small { display: block; color: #8a9aaa; font-size: 12px; }

.bottom-menu {
  position: absolute;
  left: 16px;
  bottom: 18px;
  z-index: 1000;
  display: flex;
  gap: 12px;
}

.menu-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.menu-btn:hover { background: #f0f7ff; color: #1677ff; }

.menu-btn .icon {
  width: 18px;
  height: 18px;
  color: #1677ff;
  display: inline-flex;
}

.notify-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ff4d4f;
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  animation: breathe 2s infinite ease-in-out;
}

@keyframes breathe {
  50% { transform: scale(1.12); }
}

.legend {
  position: absolute;
  right: 16px;
  bottom: 28px;
  z-index: 800;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.7;
  color: #444;
}

.legend b { font-weight: 600; }
.swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}
.swatch.permit { background: #1677ff; }
.swatch.peak { background: #fa8c16; }
.swatch.both { background: #d47373; }
.swatch.fresh { background: #52c41a; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  padding: 20px;
}

.modal.show { display: flex; }

.modal-content {
  width: min(560px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  padding: 22px 22px 18px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #999;
  font-size: 20px;
  cursor: pointer;
}

.modal-close:hover { background: #f0f2f5; }

.modal-title {
  text-align: center;
  color: #1677ff;
  font-size: 18px;
  margin-bottom: 14px;
}

.modal-body { font-size: 14px; line-height: 1.75; color: #333; }
.modal-body ol { padding-left: 1.2em; }
.modal-body li + li { margin-top: 6px; }
.modal-body .source { margin-top: 12px; font-size: 13px; }
.modal-note { margin-top: 10px; color: #8a9aaa; font-size: 12px; }

.log-list { display: flex; flex-direction: column; gap: 8px; }
.log-list button {
  border: 0;
  background: #f7f9fc;
  border-radius: 8px;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  color: #2563eb;
  font-size: 14px;
}
.log-list button:hover { background: #eef4ff; }
.log-list time { color: #666; margin-right: 6px; }

.pin-icon { background: transparent; border: 0; }
.pin-icon svg { display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25)); }

.leaflet-popup.jjz-popup .leaflet-popup-content-wrapper {
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.leaflet-popup.jjz-popup .leaflet-popup-content { margin: 12px 14px; width: 250px !important; }
.popup-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tag {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 12px;
  background: #f0f5fa;
  color: #3a6a9a;
}
.tag.type { background: #f5ecec; color: #b06060; }
.tag.fresh { background: #f0faf3; color: #237804; }
.popup-address { font-size: 14px; line-height: 1.6; color: #2a3a4a; }
.popup-note { margin-top: 8px; font-size: 12px; line-height: 1.6; color: #8a5a00; background: #fff8eb; border-radius: 8px; padding: 6px 8px; }
.popup-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
  color: #8a9aaa;
  font-size: 12px;
}
.popup-action a {
  background: #d47373;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%) translateY(8px);
  z-index: 3000;
  background: rgba(20, 24, 32, 0.9);
  color: #fff;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: #eef2f7;
}

.site-header {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #1f2a37;
}
.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #1677ff;
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.logo strong { display: block; font-size: 16px; line-height: 1.1; }
.logo em { display: block; font-style: normal; color: #8a9aaa; font-size: 12px; }

.header-link { text-decoration: none; font-size: 14px; }

.query-main {
  width: min(920px, calc(100% - 32px));
  margin: 28px auto 20px;
  flex: 1;
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(31, 45, 61, 0.05);
  padding: 18px 18px 16px;
  margin-bottom: 16px;
}

.card h1, .card h2 {
  font-size: 16px;
  font-weight: 650;
  margin-bottom: 14px;
}

.search-row { display: flex; gap: 10px; }
.search-row input {
  flex: 1;
  height: 40px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
}
.search-row input:focus { border-color: #1677ff; }

.btn {
  height: 40px;
  padding: 0 18px;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  font-size: 14px;
}
.btn.primary { background: #1677ff; color: #fff; }
.btn.ghost { background: #f2f3f5; color: #4e5969; }
.btn.primary:hover { background: #3c8cff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  border: 1px solid #e5e6eb;
  background: #fff;
  color: #4e5969;
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.chip.on { background: #e8f3ff; border-color: #1677ff; color: #1677ff; }

.empty {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a0a8b3;
  font-size: 14px;
}

.result-meta { color: #8a9aaa; font-size: 13px; margin-bottom: 10px; }

.result-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 12px 0;
  border-top: 1px solid #f2f3f5;
}
.result-item h3 { font-size: 15px; font-weight: 600; }
.result-item p { grid-column: 1 / -1; color: #4e5969; font-size: 13px; line-height: 1.6; }
.result-item a.jump {
  align-self: center;
  text-decoration: none;
  background: #1677ff;
  color: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  white-space: nowrap;
}
.detail-banner {
  background: #f7fbff;
  border: 1px solid #d6e8ff;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.6;
}

.site-footer {
  text-align: center;
  color: #8a9aaa;
  font-size: 12px;
  line-height: 1.8;
  padding: 18px 16px 26px;
}
.site-footer .line {
  width: 36px;
  height: 3px;
  border-radius: 2px;
  background: #1677ff;
  margin: 0 auto 10px;
}

@media (max-width: 1100px) {
  .top-bar {
    max-width: calc(100vw - 24px);
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 18px;
    top: 10px;
  }
  .brand-card { display: none; }
  .search-box { width: min(420px, 100%); }
}

@media (max-width: 720px) {
  .filter-group { border-left: 0; padding-left: 0; }
  .tab-btn { width: 78px; font-size: 14px; }
  .bottom-menu { left: 10px; right: 10px; gap: 8px; flex-wrap: wrap; }
  .menu-btn { padding: 10px 12px; }
  .legend { display: none; }
  .search-input { font-size: 16px; }
  .site-header { padding: 0 14px; }
  .search-row { flex-wrap: wrap; }
  .search-row input { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .notify-badge, .tab-slide-bg, .toast { animation: none; transition: none; }
}
