:root {
  --primary: #2f6fed;
  --primary-dark: #1f56c4;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2329;
  --text-2: #646a73;
  --border: #e5e6eb;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(31, 35, 41, 0.08);
}

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

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.hidden {
  display: none !important;
}

/* —— 顶栏 —— */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.title {
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.filter-group {
  display: flex;
  gap: 6px;
  background: var(--bg);
  padding: 3px;
  border-radius: 999px;
}

.chip {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.chip:hover {
  color: var(--primary);
}

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

.search {
  width: 220px;
  max-width: 40vw;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  background: #fff;
}

.search:focus {
  border-color: var(--primary);
}

.admin-link {
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}

.admin-link:hover {
  color: var(--primary);
}

/* —— 地图 —— */
#map {
  position: fixed;
  top: 55px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

/* 城市标记：圆形 + 文字标签 */
.city-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  border: none;
  line-height: 1;
}

.city-pin .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(47, 111, 237, 0.5);
  margin-bottom: 2px;
}

.city-pin .label {
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
}

/* —— 提示条 —— */
.notice {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  background: #fff7e6;
  border: 1px solid #ffd591;
  color: #ad6800;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  max-width: 90vw;
}

/* —— 侧边栏 —— */
.side-panel {
  position: fixed;
  top: 55px;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 92vw;
  z-index: 900;
  background: var(--card);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
  transform: translateX(105%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.side-panel.open {
  transform: translateX(0);
}

.side-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.side-head h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.city-meta {
  font-size: 13px;
  color: var(--text-2);
}

.close-btn {
  border: none;
  background: var(--bg);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
}

.close-btn:hover {
  background: #e8e9ed;
  color: var(--text);
}

.city-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px 24px;
}

.group-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  margin: 10px 0 8px;
}

/* 记录项 */
.record-card {
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.15s;
}

.record-card:hover {
  border-color: var(--primary);
}

.record-summary {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  align-items: center;
}

.record-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: #e8e9ed;
  flex-shrink: 0;
}

.record-thumb-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #e8e9ed;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b3b6bd;
  font-size: 22px;
  flex-shrink: 0;
}

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

.record-name {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.record-name .score {
  font-size: 12px;
  color: #f5a623;
}

.record-tags {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.record-date {
  font-size: 12px;
  color: var(--text-2);
  flex-shrink: 0;
}

/* 展开详情 */
.record-detail {
  padding: 0 12px 12px;
  display: none;
}

.record-detail.open {
  display: block;
}

.record-detail .row {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
  line-height: 1.6;
}

.record-detail .row b {
  color: var(--text);
  font-weight: 600;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  cursor: zoom-in;
}

/* —— 大图 —— */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 6px;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 26px;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
  opacity: 0.8;
}

.lightbox-close:hover {
  opacity: 1;
}

/* —— 空状态 —— */
.empty {
  padding: 30px 0;
  text-align: center;
  color: var(--text-2);
  font-size: 14px;
}

/* 响应式 */
@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }

  #map {
    top: 108px;
  }

  .side-panel {
    top: 108px;
  }

  .notice {
    top: 120px;
  }

  .search {
    width: 100%;
    max-width: none;
  }
}