* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #app { width: 100%; height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #e2e8f0;
  background: #0f172a;
  overflow: hidden;
}
#map-container { position: absolute; inset: 0; background: #0f172a; }

/* 地图右下角缩放级别 */
.map-zoom {
  position: absolute; right: 16px; bottom: 16px; z-index: 15;
  background: rgba(15, 23, 42, .78); border: 1px solid #1e293b; border-radius: 999px;
  padding: 4px 14px; font-size: 12px; color: #cbd5e1;
  pointer-events: none; backdrop-filter: blur(6px);
}

/* 未配置 Key 时的降级提示层 */
.map-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #0f172a, #0f172a 24px, #131c33 24px, #131c33 48px);
}
.map-fallback-box {
  text-align: center; padding: 28px 40px; border: 1px dashed #334155; border-radius: 12px;
  background: rgba(15, 23, 42, .85);
}
.map-fallback-box p:first-child { font-size: 20px; font-weight: 600; margin-bottom: 10px; }
.map-fallback-box .hint { color: #94a3b8; font-size: 13px; line-height: 1.9; }
.map-fallback-box code { background: #1e293b; padding: 2px 6px; border-radius: 4px; color: #7dd3fc; }

/* 顶部标题 + 统计栏 */
.app-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(2, 6, 23, .92), rgba(2, 6, 23, 0));
  pointer-events: none;
}
.app-header h1 { font-size: 20px; letter-spacing: 2px; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.stats-bar {
  pointer-events: auto; font-size: 13px; color: #cbd5e1;
  background: rgba(15, 23, 42, .78); border: 1px solid #1e293b; border-radius: 999px;
  padding: 6px 16px; display: flex; gap: 14px; align-items: center;
}
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 4px 0 2px; }
.dot.done { background: #22c55e; } .dot.doing { background: #3b82f6; } .dot.todo { background: #94a3b8; }

/* 左侧整列：筛选 + 图例 + 无坐标清单，整体可滚动 */
.left-col {
  position: absolute; top: 64px; left: 16px; bottom: 16px; z-index: 30; width: 300px;
  display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto; scrollbar-width: thin;
  animation: col-in .18s ease-out;
}
@keyframes col-in { from { transform: translateX(-16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 收起后贴在左边缘的展开标签 */
.left-tab {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%); z-index: 30;
  writing-mode: vertical-rl; letter-spacing: 4px;
  background: rgba(15, 23, 42, .9); border: 1px solid #1e293b; border-left: none;
  border-radius: 0 10px 10px 0; padding: 14px 8px;
  color: #cbd5e1; font-size: 13px; cursor: pointer;
}
.left-tab:hover { background: #1e293b; color: #7dd3fc; }

/* 面板头部：标题 + 收起按钮 */
.fp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.fp-title { font-size: 13px; color: #94a3b8; letter-spacing: 1px; }
.collapse-btn {
  background: none; border: 1px solid #334155; border-radius: 6px;
  color: #94a3b8; width: 24px; height: 24px; line-height: 1; cursor: pointer; font-size: 14px;
}
.collapse-btn:hover { color: #7dd3fc; border-color: #3b82f6; }

/* 左侧筛选面板 */
.filter-panel {
  flex: 0 0 auto;
  background: rgba(15, 23, 42, .88); border: 1px solid #1e293b; border-radius: 12px;
  padding: 14px; backdrop-filter: blur(6px);
}
.filter-panel .search-wrap { position: relative; margin-bottom: 10px; }
.filter-panel input[type="text"], .filter-panel input[type="month"], .filter-panel select {
  width: 100%; background: #1e293b; color: #e2e8f0; border: 1px solid #334155;
  border-radius: 8px; padding: 7px 10px; font-size: 13px; outline: none;
}
.filter-panel input:focus, .filter-panel select:focus { border-color: #3b82f6; }
.suggestions {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 40;
  background: #1e293b; border: 1px solid #334155; border-radius: 8px; margin-top: 4px;
  max-height: 240px; overflow-y: auto;
}
.suggestions .item { padding: 7px 10px; font-size: 13px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.suggestions .item:hover { background: #27364d; }
.suggestions .item .sub { color: #64748b; font-size: 12px; white-space: nowrap; }
.suggestions .tag { color: #f59e0b; font-size: 11px; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filter-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #94a3b8; }
.filter-grid label.full { grid-column: 1 / -1; }
.filter-panel .reset-btn {
  margin-top: 10px; width: 100%; padding: 7px 0; font-size: 13px; cursor: pointer;
  background: #1d4ed8; color: #fff; border: none; border-radius: 8px;
}
.filter-panel .reset-btn:hover { background: #2563eb; }

.map-legend { flex: 0 0 auto; }
.no-loc { flex: 0 0 auto; }
.map-legend {
  background: rgba(15, 23, 42, .88); border: 1px solid #1e293b; border-radius: 12px;
  padding: 10px 14px; font-size: 12px; color: #cbd5e1;
  display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; white-space: nowrap;
}
.map-legend .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }
.no-loc {
  background: rgba(15, 23, 42, .88); border: 1px solid #1e293b; border-radius: 12px; padding: 10px 14px; font-size: 12px;
}
.no-loc .title { color: #94a3b8; margin-bottom: 6px; }
.no-loc .item { cursor: pointer; padding: 4px 2px; color: #e2e8f0; }
.no-loc .item:hover { color: #7dd3fc; }

/* 右侧详情抽屉 */
.detail-drawer {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 50; width: 460px;
  background: rgba(2, 6, 23, .94); border-left: 1px solid #1e293b;
  padding: 20px; overflow-y: auto; backdrop-filter: blur(8px);
  animation: slide-in .22s ease-out;
}
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail-drawer .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.detail-drawer h2 { font-size: 18px; }
.detail-drawer .close-btn { background: none; border: none; color: #94a3b8; font-size: 20px; cursor: pointer; }
.detail-drawer .close-btn:hover { color: #fff; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; margin-left: 10px; vertical-align: 2px; }
.badge.done { background: rgba(34,197,94,.18); color: #4ade80; }
.badge.doing { background: rgba(59,130,246,.18); color: #60a5fa; }
.badge.todo { background: rgba(148,163,184,.18); color: #cbd5e1; }
.detail-drawer .meta { color: #94a3b8; font-size: 12px; margin-bottom: 12px; line-height: 1.8; }
.info-group {
  background: #0b1222; border: 1px solid #1e293b; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 10px; font-size: 12px;
}
.info-group .ig-title { color: #7dd3fc; letter-spacing: 1px; margin-bottom: 6px; }
.info-group .ig-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; color: #cbd5e1; }
.info-group .ig-row .ig-label { color: #64748b; flex: 0 0 auto; }
.info-group .ig-row span:last-child { text-align: right; }
.detail-drawer .stats { background: #0b1222; border: 1px solid #1e293b; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: 13px; }
.detail-drawer .stats .line { display: flex; justify-content: space-between; padding: 3px 0; color: #cbd5e1; }
.detail-drawer table { width: 100%; border-collapse: collapse; font-size: 12px; }
.detail-drawer th, .detail-drawer td { border-bottom: 1px solid #1e293b; padding: 7px 6px; text-align: left; color: #cbd5e1; white-space: nowrap; }
.detail-drawer th { color: #64748b; }
.stage-pill { padding: 1px 8px; border-radius: 999px; font-size: 11px; }
.stage-pill.s0 { background: rgba(148,163,184,.15); color: #94a3b8; }
.stage-pill.s1 { background: rgba(250,204,21,.15); color: #facc15; }
.stage-pill.s2 { background: rgba(59,130,246,.15); color: #60a5fa; }
.stage-pill.s3 { background: rgba(34,197,94,.15); color: #4ade80; }
.empty-tip { color: #64748b; font-size: 13px; padding: 20px 0; text-align: center; }

/* 悬停提示卡：跟随鼠标 */
.map-tooltip {
  position: absolute; top: 0; left: 0; z-index: 60; pointer-events: none;
  min-width: 210px; max-width: 280px;
  background: rgba(2, 6, 23, .93); border: 1px solid #334155; border-radius: 10px;
  padding: 10px 14px; font-size: 12px; color: #cbd5e1;
  opacity: 0; transition: opacity .12s;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
  backdrop-filter: blur(6px);
}
.map-tooltip .tt-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.map-tooltip .tt-head b { font-size: 14px; color: #f1f5f9; }
.map-tooltip .tt-row { line-height: 1.8; }
.map-tooltip .tt-row.dim { color: #64748b; }
.map-tooltip .tt-hint { margin-top: 6px; color: #38bdf8; font-size: 11px; }

/* 右上角用户信息浮层(2026-10-05 v2:深色玻璃态,融入地图) */
.user-bar {
  position: fixed; top: 14px; right: 14px; z-index: 100;
  display: flex; align-items: center; gap: 12px;
  background: rgba(15, 23, 42, 0.72);
  padding: 8px 8px 8px 12px;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
  transition: right 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}
/* 抽屉(460px)展开时,user-bar 左移到抽屉外,避免深色叠加视觉融化 */
.user-bar.shifted { right: 488px; }
.user-avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.user-avatar.avatar-super_admin {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}
.user-avatar.avatar-company_admin {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}
.user-info { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.3; min-width: 0; }
.user-name {
  font-size: 13px; font-weight: 600; color: #f1f5f9;
  display: flex; align-items: center; gap: 6px;
}
.user-role {
  font-size: 10px; padding: 1px 6px; border-radius: 3px;
  font-weight: 500; letter-spacing: 0.3px;
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.user-role.role-super_admin {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.28);
}
.user-meta {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: #94a3b8;
  margin-top: 2px;
}
.user-meta .meta-icon { width: 11px; height: 11px; opacity: 0.7; }
.user-divider {
  width: 1px; height: 20px;
  background: rgba(148, 163, 184, 0.25);
}
.logout-btn {
  background: transparent; color: #cbd5e1;
  border: 1px solid transparent;
  width: 30px; height: 30px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.logout-btn svg { width: 16px; height: 16px; }
.logout-btn:hover {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}
.logout-btn:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* 地图 marker 选中态:中心实心点 + 双层脉动光环(2026-10-05 v3) */
.estate-marker-pulse {
  position: relative;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.estate-marker-dot {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.9);
  z-index: 3;
}
.estate-marker-ring {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid #2563eb;
  opacity: 0;
  animation: marker-pulse 1.8s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
  z-index: 2;
}
.estate-marker-ring.r2 { animation-delay: 0.9s; }
@keyframes marker-pulse {
  0%   { transform: scale(0.8);  opacity: 0.9; }
  70%  { opacity: 0.15; }
  100% { transform: scale(3.4);  opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .estate-marker-ring { animation: none; opacity: 0.5; transform: scale(2); }
}
