:root {
  --bg: #f5f7fa;
  --panel-bg: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --brand: #2f6df6;
  --brand-dark: #1e4fd1;
  --danger: #e5484d;
  --border: #e5e7eb;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

/* ===== 地图 ===== */
#map { position: absolute; inset: 0; }

.map-title {
  position: absolute; top: 14px; left: 14px; z-index: 20;
  background: rgba(255,255,255,0.92); padding: 8px 14px; border-radius: 10px;
  box-shadow: var(--shadow); font-weight: 600; font-size: 15px;
}
.map-title small { display:block; color: var(--muted); font-weight: 400; font-size: 12px; }

/* 聚合 / 单点标记 */
.cluster {
  background: var(--brand); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; border: 3px solid #fff; box-shadow: var(--shadow);
  cursor: pointer; white-space: nowrap;
}
.cluster.lg { background: #1e4fd1; }
.marker-dot {
  width: 18px; height: 18px; background: var(--brand); border: 3px solid #fff;
  border-radius: 50%; box-shadow: var(--shadow); cursor: pointer;
}

/* ===== 右侧照片面板 ===== */
.panel {
  position: absolute; top: 0; right: 0; height: 100%; width: 360px; max-width: 86vw;
  background: var(--panel-bg); box-shadow: -6px 0 24px rgba(0,0,0,0.12);
  z-index: 30; display: flex; flex-direction: column; transform: translateX(100%);
  transition: transform .25s ease;
}
.panel.open { transform: translateX(0); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600;
}
.panel-head button {
  border: none; background: transparent; font-size: 22px; cursor: pointer; color: var(--muted);
}
.panel-body { padding: 14px 16px; overflow-y: auto; }
.photo-card { margin-bottom: 18px; }
.photo-card img { width: 100%; border-radius: 10px; cursor: pointer; display:block; }
.photo-meta { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.photo-meta .note { color: var(--text); }

/* ===== 灯箱 ===== */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 50;
  display: flex; align-items: center; justify-content: center;
}
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }
.lightbox button {
  position: absolute; top: 18px; right: 22px; border: none; background: rgba(255,255,255,0.15);
  color: #fff; font-size: 26px; width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
}
.hidden { display: none !important; }

/* ===== 后台 ===== */
.admin-wrap { max-width: 920px; margin: 0 auto; padding: 24px 18px 60px; }
.admin-wrap h1 { font-size: 22px; }
.card {
  background: var(--panel-bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; margin-bottom: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.drop {
  border: 2px dashed var(--border); border-radius: 12px; padding: 26px; text-align: center;
  color: var(--muted); cursor: pointer;
}
.drop.over { border-color: var(--brand); color: var(--brand); background: #f0f6ff; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .field textarea {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 14px;
  font-family: inherit;
}
button.btn {
  background: var(--brand); color: #fff; border: none; border-radius: 8px;
  padding: 9px 16px; font-size: 14px; cursor: pointer;
}
button.btn:hover { background: var(--brand-dark); }
button.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
button.btn.danger { background: var(--danger); }
.login-box { max-width: 320px; margin: 12vh auto; }

.upload-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 12px;
}
.upload-item img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; }
.upload-item .meta { flex: 1; font-size: 12px; color: var(--muted); }
.upload-item .meta b { color: var(--text); }
.mini-map { width: 100%; height: 180px; border-radius: 10px; margin-top: 8px; }
.tag { display:inline-block; background:#eef2ff; color:var(--brand); border-radius:6px; padding:1px 7px; font-size:11px; margin-left:6px;}
.tag.manual { background:#fff4e5; color:#b25e09; }

table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th, table.list td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); }
table.list img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #1f2933; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 60;
  box-shadow: var(--shadow); font-size: 14px;
}
