:root {
  color-scheme: light;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
  background: #eef2f7;
}

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

.panel {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 300px;
  max-height: calc(100vh - 32px);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
  border-radius: 16px;
  z-index: 1000;
  overflow: hidden;
  transition: transform 0.2s ease;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.panel--closed {
  transform: translateX(-255px);
}

.panel__toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: #0f172a;
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
}

.panel__content {
  padding: 20px;
}

.panel__title {
  margin: 0 0 6px 0;
  font-size: 20px;
  color: #0f172a;
}

.panel__subtitle {
  margin: 0 0 16px 0;
  font-size: 13px;
  color: #64748b;
}

.panel__section {
  margin-bottom: 16px;
}

.panel__label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #334155;
}

.panel__hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 6px;
}

.panel__list {
  padding-left: 18px;
  margin: 0;
  color: #64748b;
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
}

.btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

input[type="file"] {
  display: block;
  margin-bottom: 8px;
}

input[type="range"] {
  width: 100%;
}

.leaflet-container {
  font: inherit;
}

.cat-marker {
  background: transparent;
  border: none;
}

.cat-pin {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.25);
  background: #e2e8f0;
}

.cat-pin img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cat-stack {
  position: relative;
  width: 70px;
  height: 50px;
}

.cat-stack__img {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.25);
  background: #e2e8f0;
}

.cat-stack__img--0 {
  left: 0;
  top: 8px;
  z-index: 1;
}

.cat-stack__img--1 {
  left: 16px;
  top: 0;
  z-index: 2;
}

.cat-stack__img--2 {
  left: 32px;
  top: 10px;
  z-index: 3;
}

.cat-stack__count {
  position: absolute;
  right: -4px;
  bottom: -4px;
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.25);
}

.modal {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal__content {
  background: #fff;
  padding: 20px;
  border-radius: 16px;
  width: min(720px, 90vw);
  max-height: 80vh;
  overflow: auto;
  position: relative;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.3);
}

.modal__close {
  position: absolute;
  right: 12px;
  top: 12px;
  border: none;
  background: #111827;
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
}

.modal__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.modal__item {
  background: #f8fafc;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal__item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.modal__meta {
  padding: 8px 10px;
  font-size: 12px;
  color: #6b7280;
}
