/* ========== 地图视图 ========== */
#map-view { display: none; padding: 0; }
#map-view.active { display: flex; min-height: calc(100vh - 120px); }
.sidebar { width: 280px; flex-shrink: 0; padding: 20px; border-right: 1px solid #e0e0e0; background: #fafafa; overflow-y: auto; }
#map-view .sidebar { max-height: calc(100vh - 120px); }
.sidebar-title { font-size: 14px; font-weight: 800; letter-spacing: 0.03em; margin-bottom: 4px; }
.sidebar-sub { font-size: 12px; color: #666; margin-bottom: 16px; }
.report-card { border: 1px solid #e0e0e0; border-radius: 8px; padding: 14px; margin-bottom: 12px; background: #fff; position: relative; display: flex; gap: 12px; align-items: flex-start; }
.report-icon { width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0; }
.report-icon.accident { background: #fef2f2; }
.report-icon.roadwork { background: #fff7ed; }
.report-icon.breakdown { background: #f0fdf4; }
.report-body { flex: 1; min-width: 0; }
.report-type { font-size: 11px; font-weight: 800; letter-spacing: 0.05em; }
.report-body p { font-size: 13px; margin: 4px 0; }
.report-time { font-size: 11px; color: #666; }
.severity-tag { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: 4px; }
.severity-tag.high { background: #fef2f2; color: #991b1b; }
.severity-tag.medium { background: #fff7ed; color: #c2410c; }
.severity-tag.low { background: #f0fdf4; color: #166534; }
.map-area { flex: 1; position: relative; background: linear-gradient(180deg, rgba(248,250,252,0.84) 0%, rgba(239,246,255,0.8) 100%); border: 1px solid rgba(148, 163, 184, 0.24); margin: 8px; border-radius: 18px; min-height: 560px; overflow: hidden; }
.map-area #liveMap { position: absolute; inset: 0; border-radius: 16px; z-index: 1; }
.map-poi-icon {
  border-radius: 0;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}
.map-toolbar { position: absolute; top: 16px; left: 16px; display: flex; gap: 8px; z-index: 2; }
.map-feedback-actions {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 4300;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.map-feedback-fab,
.map-feedback-toggle-fab {
  position: relative;
}
.btn-dark {
  background: var(--glass-blue-bg);
  color: #ffffff;
  border: 1px solid var(--glass-blue-border);
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--glass-blue-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn-dark:hover {
  background: var(--glass-blue-bg-strong);
  border-color: rgba(219, 234, 254, 0.72);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.22), inset 0 1px 0 rgba(255,255,255,0.28);
  transform: translateY(-1px);
}
.fb-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.map-grid { position: absolute; inset: 0; background: linear-gradient(#eee 1px, transparent 1px), linear-gradient(90deg, #eee 1px, transparent 1px); background-size: 25% 25%; border-radius: 8px; }
.map-marker { position: absolute; font-size: 12px; font-weight: 600; padding: 8px 12px; background: #fff; border: 1px solid #ccc; border-radius: 6px; }
.map-marker.origin { top: 15%; left: 50%; transform: translateX(-50%); }
.map-marker.dest { bottom: 20%; left: 50%; transform: translateX(-50%); }
.bubble { position: absolute; background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 10px 14px; font-size: 12px; max-width: 180px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.bubble.b1 { top: 25%; left: 25%; }
.bubble.b2 { bottom: 35%; left: 30%; }
.bubble.b3 { top: 40%; right: 25%; }
.map-icon { position: absolute; width: 32px; height: 32px; border-radius: 6px; }
.accident-icon { top: 22%; left: 22%; background: #fef2f2; }
.roadwork-icon { bottom: 30%; right: 28%; background: #fff7ed; }
.help-icon { position: absolute; bottom: 16px; right: 16px; width: 28px; height: 28px; border: 1px solid #ccc; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #666; cursor: pointer; background: #fff; }
#camera-report-list { display: flex; flex-direction: column; gap: 10px; }
#camera-report-list { overflow-y: auto; max-height: calc(100vh - 240px); padding-right: 4px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 3000;
}
.modal-overlay.open { display: flex; }
.modal-box {
  width: min(820px, calc(100vw - 40px));
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.96) 100%);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.34);
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 26px 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.74);
}
.modal-eyebrow {
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2563eb;
}
.modal-title { font-size: 17px; font-weight: 850; letter-spacing: 0.02em; color: #0f172a; }
.modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.modal-close:hover { background: #eff6ff; color: #0f172a; border-color: #93c5fd; }
.modal-body {
  overflow-y: auto;
  padding: 20px 26px;
}
.feedback-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.85fr);
  gap: 18px;
  align-items: start;
}
.feedback-form-main,
.feedback-form-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.feedback-form-side {
  padding: 14px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 14px;
  background: rgba(241, 245, 249, 0.72);
}
.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.modal-label { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; color: #334155; }
.modal-input-row {
  display: flex;
  gap: 8px;
}
.modal-input,
.modal-textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}
.modal-input {
  height: 40px;
  padding: 0 12px;
}
.modal-textarea {
  min-height: 154px;
  padding: 12px;
  resize: vertical;
}
.modal-input:focus,
.modal-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.modal-input.input-error,
.modal-textarea.input-error { border-color: #dc2626; }
.btn-locate {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.btn-locate:hover { background: #dbeafe; border-color: #60a5fa; }
.fb-type-group,
.fb-severity-group {
  display: grid;
  gap: 8px;
}
.fb-type-group { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fb-severity-group { grid-template-columns: 1fr; }
.fb-type-btn,
.fb-severity-btn {
  min-height: 34px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.fb-type-btn {
  padding: 8px 10px;
}
.fb-type-btn:hover,
.fb-severity-btn:hover {
  border-color: #2563eb;
  color: #0f172a;
  transform: translateY(-1px);
}
.fb-type-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.fb-severity-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 8px 10px;
}
.fb-severity-btn.active[data-severity="LOW"] {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #15803d;
}
.fb-severity-btn.active[data-severity="MEDIUM"] {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #b45309;
}
.fb-severity-btn.active[data-severity="HIGH"] {
  background: #fef2f2;
  border-color: #ef4444;
  color: #b91c1c;
}
.sev-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.sev-dot.low { background: #22c55e; }
.sev-dot.medium { background: #f59e0b; }
.sev-dot.high { background: #ef4444; }
.field-error {
  display: none;
  font-size: 11px;
  color: #dc2626;
  margin-top: 2px;
}
.recent-submissions {
  border-top: 1px solid rgba(203, 213, 225, 0.84);
  padding-top: 12px;
}
.recent-title {
  margin-bottom: 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #64748b;
}
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 150px;
  overflow-y: auto;
  padding-right: 4px;
}
.recent-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 10px;
}
.recent-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.recent-type {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #0f172a;
}
.recent-time {
  margin-left: auto;
  font-size: 10px;
  color: #94a3b8;
}
.recent-loc {
  font-size: 11px;
  color: #334155;
  margin-bottom: 3px;
}
.recent-comment {
  font-size: 11px;
  color: #64748b;
  font-style: italic;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 14px 26px 18px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(248, 250, 252, 0.86);
}
.btn-post-feedback {
  width: min(220px, 100%);
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #2563eb 0%, #0f172a 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}
.btn-post-feedback:hover { background: linear-gradient(135deg, #1d4ed8 0%, #111827 100%); }
.btn-post-feedback:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}
.btn-post-feedback.btn-cooldown {
  background: #6b7280;
}
.feedback-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  background: #0f172a;
  color: #fff;
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.28);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 3100;
}
.feedback-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}




.map-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(226, 232, 240, 0.34);
  backdrop-filter: grayscale(0.25) blur(1px);
  -webkit-backdrop-filter: grayscale(0.25) blur(1px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  pointer-events: all;
}

.map-loading-overlay.hidden {
  display: none !important;
}

.map-loading-minimal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.map-loading-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(15, 23, 42, 0.16);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: fastSpin 0.8s linear infinite;
}

.map-loading-text {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

@keyframes fastSpin {
  to {
    transform: rotate(360deg);
  }
}