/* ========== 重置与全局 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; font-size: 14px; color: #1f2937; background: var(--bg-page); -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
a { text-decoration: none; }
[hidden] { display: none !important; }

.desktop-only { display: block; }
.mobile-only { display: none; }

/* ========== 设计令牌（v2 视觉升级） ========== */
:root {
  --primary: #1b5bbf;
  --primary-deep: #123e8f;
  --primary-light: #4f8df2;
  --accent-indigo: #4f46e5;
  --brand-grad: linear-gradient(135deg, #1b5bbf 0%, #4f46e5 100%);
  --brand-grad-soft: linear-gradient(135deg, #eef4ff 0%, #f0edff 100%);
  --bg-page: linear-gradient(160deg, #eef2f7 0%, #f6f8fb 45%, #e8edf4 100%);
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.65);
  --card-shadow: 0 8px 28px rgba(15, 31, 61, 0.12);
  --card-shadow-hover: 0 16px 40px rgba(15, 31, 61, 0.18);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --text-main: #1f2937;
  --text-sub: #6b7280;
  --text-faint: #9ca3af;
  --line: #eef0f3;
  --line-strong: #e5e7eb;
}

/* ========== 顶部导航栏 ========== */
.top-header {
  position: fixed; top: 0; left: 0; right: 0; height: 60px;
  background: linear-gradient(90deg, #1a2942 0%, #1b5bbf 50%, #1a2942 100%);
  color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.header-left { display: flex; align-items: center; gap: 12px; }
.menu-btn {
  display: none;
  color: #fff; font-size: 24px;
  width: 40px; height: 40px; border-radius: 8px;
}
.logo-wrap { display: flex; align-items: center; gap: 12px; }
.logo-icon { font-size: 32px; }
.title-main { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.title-sub { font-size: 14px; font-weight: 400; margin-left: 10px; opacity: 0.85; }

.header-center { display: flex; align-items: center; }
.view-switcher { display: flex; gap: 4px; background: rgba(255,255,255,0.1); padding: 4px; border-radius: 8px; }
.view-btn { display: flex; align-items: center; gap: 6px; padding: 8px 18px; color: rgba(255,255,255,0.75); border-radius: 6px; transition: all 0.25s; font-size: 14px; }
.view-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.view-btn.active { background: rgba(255,255,255,0.2); color: #fff; font-weight: 600; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.view-icon { font-size: 16px; }

.header-right { display: flex; align-items: center; gap: 12px; }
.ai-btn {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff; padding: 7px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 500;
  transition: all 0.3s; box-shadow: 0 2px 8px rgba(102,126,234,0.4);
}
.ai-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102,126,234,0.5); }
.ai-btn-icon { font-size: 16px; }
.task-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.12);
  color: #fff; padding: 7px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 500;
  transition: all 0.3s; position: relative;
}
.task-btn:hover { background: rgba(255,255,255,0.2); }
.task-btn-icon { font-size: 16px; }
.task-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: #ef4444; color: #fff; font-size: 11px;
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; display: none;
}
.task-badge.show { display: flex; }
.time-display { font-size: 15px; font-variant-numeric: tabular-nums; opacity: 0.9; letter-spacing: 0.5px; }

/* 移动端底部导航 */
.mobile-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 60px;
  background: #fff; border-top: 1px solid #e5e7eb;
  display: flex; justify-content: space-around; align-items: center;
  z-index: 999;
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 3px; color: #6b7280;
  padding: 8px 0;
  transition: color 0.2s;
}
.mobile-nav-item.active { color: #1b5bbf; }
.nav-icon { font-size: 22px; }
.nav-label { font-size: 11px; }

/* ========== 主内容布局 ========== */
.main-content {
  position: fixed; top: 60px; bottom: 40px; left: 0; right: 0;
  display: flex;
}

/* 左侧面板 */
.left-panel {
  width: 260px; background: var(--glass-bg); border-right: 1px solid var(--line-strong);
  display: flex; flex-direction: column; transition: margin-left 0.3s;
  z-index: 100;
  backdrop-filter: blur(14px) saturate(1.35);
}
.left-panel.collapsed { margin-left: -260px; }
.left-panel.collapsed .panel-header { position: relative; }
.left-panel.collapsed #toggleLeftPanel {
  position: absolute; top: 12px; right: -28px; z-index: 1;
  background: var(--glass-bg); border: 1px solid var(--line-strong);
  box-shadow: 2px 2px 8px rgba(15,31,61,0.15);
}

#panelOverlay {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4); z-index: 99;
}
#panelOverlay.show { display: block; }

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: var(--brand-grad-soft);
}
.panel-title { font-size: 15px; font-weight: 600; color: var(--text-main); display: flex; align-items: center; gap: 6px; }
.panel-title::before {
  content: ''; width: 4px; height: 16px; border-radius: 2px;
  background: var(--brand-grad); display: inline-block;
}
.panel-toggle {
  width: 24px; height: 24px; border-radius: 6px; font-size: 12px;
  color: var(--text-sub); transition: all 0.2s;
}
.panel-toggle:hover { background: #e5e7eb; color: var(--text-main); }

.panel-body { flex: 1; overflow-y: auto; padding: 8px; }

/* 图层分组 */
.layer-group { margin-bottom: 8px; }
.group-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: #f9fafb; border-radius: 6px; cursor: pointer;
  transition: background 0.2s; font-weight: 600; font-size: 14px;
}
.group-header:active { background: #e5e7eb; }
.group-icon { font-size: 16px; }
.group-name { flex: 1; }
.group-arrow { font-size: 10px; color: #9ca3af; transition: transform 0.2s; }
.layer-group.collapsed .group-arrow { transform: rotate(-90deg); }
.layer-group.collapsed .layer-items { display: none; }

.layer-items { padding: 4px 0 4px 12px; }
.layer-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: 5px; cursor: pointer; transition: all 0.2s;
  font-size: 13px;
}
.layer-item:active { background: #e5e7eb; }
.layer-item:hover { background: #f3f4f6; }
.layer-checkbox {
  width: 16px; height: 16px; border: 2px solid #d1d5db; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.layer-item.active .layer-checkbox {
  background: #1b5bbf; border-color: #1b5bbf;
}
.layer-item.active .layer-checkbox::after {
  content: '✓'; color: #fff; font-size: 11px; font-weight: bold;
}
.layer-icon { font-size: 15px; width: 20px; text-align: center; }
.layer-name { flex: 1; color: #374151; }
.layer-count { font-size: 11px; color: #9ca3af; background: #f3f4f6; padding: 1px 6px; border-radius: 8px; }

.layer-divider {
  height: 1px; background: #e5e7eb; margin: 8px 12px;
}
.camera-report-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; margin: 8px 12px;
  border-radius: 6px; background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46; font-weight: 600; font-size: 13px;
  transition: all 0.2s; border: 1px solid #34d399;
}
.camera-report-btn:hover {
  background: linear-gradient(135deg, #a7f3d0, #6ee7b7);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16,185,129,0.2);
}
.camera-report-btn:active {
  transform: translateY(0);
}

/* 中间地图区 */
.map-section {
  flex: 1; position: relative; overflow: hidden;
}
.map-container { width: 100%; height: 100%; }

/* 悬浮统计卡片 */
.floating-stats {
  position: absolute; top: 16px; left: 16px; display: flex; gap: 10px; z-index: 10;
  flex-wrap: wrap; max-width: calc(100% - 32px);
}
.stat-card {
  background: rgba(255,255,255,0.96); backdrop-filter: blur(10px);
  border-radius: 10px; padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  display: flex; align-items: center; gap: 10px;
  min-width: 110px;
  border-left: 3px solid #1b5bbf;
}
.stat-card.poi { border-left-color: #e67e22; }
.stat-card.staff { border-left-color: #27ae60; }
.stat-card.alert { border-left-color: #e74c3c; cursor: pointer; }
.stat-icon { font-size: 24px; }
.stat-info { display: flex; flex-direction: column; }
.stat-number { font-size: 22px; font-weight: 700; color: #1f2937; line-height: 1.1; }
.stat-label { font-size: 12px; color: #6b7280; margin-top: 2px; }

/* 地图工具条 */
.map-toolbar {
  position: absolute; bottom: 20px; right: 16px;
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(10px);
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  z-index: 10;
}
.tool-btn {
  width: 36px; height: 36px; font-size: 18px; color: #4b5563;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.tool-btn:active { background: #e5e7eb; }

/* 右侧详情面板 */
.right-panel {
  width: 320px; background: var(--glass-bg); border-left: 1px solid var(--line-strong);
  display: flex; flex-direction: column; transition: margin-right 0.3s;
  z-index: 100;
  backdrop-filter: blur(14px) saturate(1.35);
}
.right-panel.collapsed { margin-right: -320px; }

/* 空状态 */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; padding: 40px 20px; color: #9ca3af; text-align: center;
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }

/* 详情内容 */
.detail-section { padding: 16px; border-bottom: 1px solid #f0f0f0; }
.detail-section:last-child { border-bottom: none; }
.detail-title {
  font-size: 16px; font-weight: 700; color: #1f2937; margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}
.detail-subtitle { font-size: 12px; color: #6b7280; margin-bottom: 12px; }
.detail-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.detail-badge.green { background: #d1fae5; color: #065f46; }
.detail-badge.yellow { background: #fef3c7; color: #92400e; }
.detail-badge.orange { background: #ffedd5; color: #9a3412; }
.detail-badge.purple { background: #ede9fe; color: #5b21b6; }
.detail-badge.red { background: #fee2e2; color: #991b1b; }
.detail-badge.blue { background: #dbeafe; color: #1e40af; }
.detail-badge.gray { background: #f3f4f6; color: #374151; }

.detail-info-list { list-style: none; }
.detail-info-list li {
  display: flex; padding: 6px 0; font-size: 13px;
  border-bottom: 1px dashed #f0f0f0;
}
.detail-info-list li:last-child { border-bottom: none; }
.info-label { width: 80px; color: #6b7280; flex-shrink: 0; }
.info-value { flex: 1; color: #1f2937; word-break: break-all; }
.info-value a { color: #1b5bbf; text-decoration: none; }

.detail-desc {
  font-size: 13px; color: #4b5563; line-height: 1.6;
  padding: 10px; background: #f9fafb; border-radius: 6px;
}

/* POI 现场影像（mock 图片/视频） */
.poi-media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.poi-media-img {
  width: 100%; height: 110px; object-fit: cover; border-radius: 8px;
  cursor: zoom-in; border: 1px solid #e5e7eb; background: #f3f4f6;
  transition: transform .15s ease;
}
.poi-media-img:hover { transform: scale(1.02); }
.poi-media-video { width: 100%; border-radius: 8px; background: #0f172a; display: block; }
@media (max-width: 768px) { .poi-media-grid { grid-template-columns: 1fr; } }

.detail-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn {
  padding: 7px 14px; border-radius: 6px; font-size: 13px;
  transition: all 0.2s; border: 1px solid transparent; cursor: pointer;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: #1b5bbf; color: #fff; }
.btn-primary:hover { background: #154a9c; }
.btn-warn { background: #f59e0b; color: #fff; }
.btn-warn:hover { background: #d97706; }
.btn-success { background: #10b981; color: #fff; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-plain { background: #f3f4f6; color: #374151; border-color: #e5e7eb; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* POI 类型标签 */
.poi-type-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.poi-type-tag {
  padding: 3px 10px; border-radius: 12px; font-size: 11px;
  background: #eff6ff; color: #1d4ed8;
}

/* 关联 POI 列表 */
.related-poi-list { list-style: none; max-height: 200px; overflow-y: auto; }
.related-poi-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  transition: background 0.2s;
}
.related-poi-item:active { background: #e5e7eb; }
.related-poi-item:hover { background: #f3f4f6; }
.related-poi-icon { font-size: 16px; width: 24px; text-align: center; }
.related-poi-info { flex: 1; }
.related-poi-name { font-size: 13px; color: #1f2937; font-weight: 500; }
.related-poi-sub { font-size: 11px; color: #9ca3af; margin-top: 1px; }

/* 底部事件滚动条 */
.event-ticker {
  position: fixed; bottom: 0; left: 0; right: 0; height: 40px;
  background: #fff; border-top: 1px solid #e5e7eb;
  display: flex; align-items: center;
  z-index: 1000;
  overflow: hidden;
}
.ticker-label {
  padding: 0 16px; background: #fef2f2; color: #dc2626;
  font-weight: 600; font-size: 13px; height: 100%;
  display: flex; align-items: center; border-right: 1px solid #fecaca;
  flex-shrink: 0;
}
.ticker-content {
  flex: 1; padding: 0 16px; font-size: 13px; color: #4b5563;
  overflow: hidden; white-space: nowrap;
}
.ticker-item { display: inline-block; margin-right: 60px; }
.ticker-item .ticker-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #ef4444; margin-right: 8px;
}
.ticker-item .ticker-time { color: #9ca3af; margin-left: 8px; font-size: 12px; }

/* ========== AI 问数面板 ========== */
.ai-panel {
  position: fixed; top: 60px; right: -520px; bottom: 40px;
  width: 480px;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  z-index: 150;
  display: flex; flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 20px rgba(0,0,0,0.08);
}
.ai-panel.open { right: 0; }

.ai-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #f5f7ff, #faf5ff);
}
.ai-panel-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: #1f2937;
}
.ai-panel-icon { font-size: 18px; }
.ai-model-tag {
  font-size: 10px; padding: 2px 8px;
  background: #e0e7ff; color: #4338ca;
  border-radius: 10px; font-weight: 500;
  margin-left: 4px;
}

.ai-panel-tabs {
  display: flex; border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
}
.ai-tab-btn {
  flex: 1; padding: 8px; font-size: 13px;
  color: #6b7280; font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.ai-tab-btn.active {
  color: #1b5bbf; border-bottom-color: #1b5bbf;
  background: #fff;
}

.ai-panel-body {
  flex: 1; min-height: 0; position: relative; overflow: hidden;
}
.ai-tab-page {
  display: none;
  height: 100%;
  flex-direction: column;
}
.ai-tab-page.active { display: flex; }

/* 对话区 */
.chat-messages {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.chat-msg {
  display: flex; gap: 10px;
  max-width: 100%;
}
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; max-width: 88%; }
.msg-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  background: #e0e7ff;
}
.chat-msg.user .msg-avatar { background: #dbeafe; }
.msg-bubble {
  background: #f3f4f6; border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px; line-height: 1.6;
  color: #1f2937;
  border-top-left-radius: 4px;
}
.chat-msg.user .msg-bubble {
  background: #1b5bbf; color: #fff;
  border-top-left-radius: 12px;
  border-top-right-radius: 4px;
}
.msg-content { word-break: break-word; }
.msg-content >:first-child { margin-top: 0; }
.msg-content >:last-child { margin-bottom: 0; }
.msg-content p { margin: 6px 0; }
.msg-content h1, .msg-content h2, .msg-content h3,
.msg-content h4, .msg-content h5, .msg-content h6 {
  margin: 12px 0 6px; line-height: 1.4; font-weight: 700;
}
.msg-content h1 { font-size: 17px; }
.msg-content h2 { font-size: 16px; }
.msg-content h3 { font-size: 15px; }
.msg-content h4, .msg-content h5, .msg-content h6 { font-size: 14px; }
.msg-content ul, .msg-content ol { margin: 6px 0; padding-left: 22px; }
.msg-content li { margin: 3px 0; }
.msg-content li > ul, .msg-content li > ol { margin: 3px 0; }
.msg-content a { color: #1b5bbf; text-decoration: none; border-bottom: 1px solid rgba(27,91,191,.35); }
.msg-content a:hover { border-bottom-color: #1b5bbf; }
.msg-content code {
  background: rgba(17,24,39,0.07); padding: 1px 6px; border-radius: 4px;
  font-size: 12px; font-family: "SF Mono", Menlo, Consolas, monospace;
  color: #be185d;
}
.msg-content .md-code-block {
  margin: 8px 0; border-radius: 10px; overflow: hidden;
  background: #1e293b; box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.msg-content .md-code-lang {
  font-size: 10px; letter-spacing: .5px; text-transform: uppercase;
  color: #94a3b8; padding: 6px 12px 0;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.msg-content .md-code-block pre {
  margin: 0; padding: 10px 12px; overflow-x: auto;
}
.msg-content .md-code-block code {
  background: none; color: #e2e8f0; padding: 0;
  font-size: 12px; line-height: 1.6; white-space: pre;
}
.msg-content .md-quote {
  margin: 8px 0; padding: 6px 12px;
  border-left: 3px solid #1b5bbf; background: rgba(27,91,191,0.06);
  border-radius: 0 8px 8px 0; color: #475569;
}
.msg-content .md-quote p { margin: 3px 0; }
.msg-content .md-hr {
  border: none; border-top: 1px solid #e2e8f0; margin: 12px 0;
}
.msg-content .md-img { max-width: 100%; border-radius: 8px; margin: 6px 0; }
.msg-content .md-table-wrap {
  margin: 8px 0; overflow-x: auto;
  border: 1px solid #e2e8f0; border-radius: 10px;
}
.msg-content .md-table {
  border-collapse: collapse; width: 100%; font-size: 12.5px;
}
.msg-content .md-table th, .msg-content .md-table td {
  padding: 7px 12px; border-bottom: 1px solid #eef2f7; white-space: nowrap;
}
.msg-content .md-table th {
  background: #f1f5fb; font-weight: 600; color: #334155;
}
.msg-content .md-table tbody tr:nth-child(even) { background: #fafbfd; }
.msg-content .md-table tbody tr:hover { background: #eef4fc; }
.msg-content .md-table tbody tr:last-child td { border-bottom: none; }

/* 用户气泡（深蓝底）内的 Markdown 适配 */
.chat-msg.user .msg-content code { background: rgba(255,255,255,0.18); color: #fef9c3; }
.chat-msg.user .msg-content a { color: #bfdbfe; border-bottom-color: rgba(191,219,254,.5); }
.chat-msg.user .msg-content .md-quote {
  background: rgba(255,255,255,0.12); border-left-color: #bfdbfe; color: #e0ecff;
}
.chat-msg.user .msg-content .md-hr { border-top-color: rgba(255,255,255,0.25); }

/* 建议问题 */
.suggestion-chips {
  padding: 0 16px 8px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.suggestion-chip {
  padding: 6px 12px;
  background: #f3f4f6; border: 1px solid #e5e7eb;
  border-radius: 16px; font-size: 12px; color: #4b5563;
  transition: all 0.2s;
}
.suggestion-chip:active { background: #e5e7eb; transform: scale(0.97); }

/* 输入区 */
.chat-input-area {
  border-top: 1px solid #e5e7eb;
  padding: 10px 12px;
  background: #fafafa;
}
.chat-input-wrapper {
  display: flex; align-items: flex-end; gap: 8px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  padding: 6px 6px 6px 14px;
  transition: border-color 0.2s;
}
.chat-input-wrapper:focus-within { border-color: #1b5bbf; }
.chat-input-wrapper textarea {
  flex: 1; border: none; outline: none; resize: none;
  font-size: 14px; line-height: 1.5;
  max-height: 100px; min-height: 24px;
  padding: 4px 0;
  background: transparent;
}
.chat-send-btn {
  width: 32px; height: 32px;
  background: #1b5bbf; color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.chat-send-btn:disabled { background: #9ca3af; cursor: not-allowed; }
.chat-send-btn:active:not(:disabled) { transform: scale(0.9); }

.chat-actions {
  display: flex; gap: 8px; margin-top: 8px;
  justify-content: center;
}
.chat-action-btn {
  padding: 5px 12px; font-size: 12px;
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: 14px; color: #4b5563;
  transition: all 0.2s;
}
.chat-action-btn:active { background: #f3f4f6; }

/* 打字指示器 */
.typing-indicator {
  display: flex; gap: 4px; padding: 4px 0;
}
.typing-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #9ca3af;
  animation: typing 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* 报告列表 */
.reports-list {
  flex: 1; overflow-y: auto; padding: 12px;
}
.report-item {
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: 10px; padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.report-item:active { transform: scale(0.98); background: #f9fafb; }
.report-item-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.report-item-icon { font-size: 20px; }
.report-item-type {
  font-size: 11px; padding: 2px 8px;
  background: #dbeafe; color: #1e40af;
  border-radius: 10px; font-weight: 500;
}
.report-item-title {
  font-size: 14px; font-weight: 600; color: #1f2937;
  margin-bottom: 4px;
}
.report-item-time { font-size: 12px; color: #9ca3af; }

/* 报告弹窗 */
.report-modal { width: 90%; max-width: 700px; max-height: 85vh; }
.report-modal h2 {
  font-size: 20px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px;
}
.report-modal .report-meta {
  font-size: 12px; color: #6b7280;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}
.report-content {
  font-size: 14px; line-height: 1.7;
  color: #374151; max-height: 60vh; overflow-y: auto;
}
.report-content h1, .report-content h2, .report-content h3 {
  margin-top: 16px; margin-bottom: 8px; color: #1f2937;
}
.report-content h1 { font-size: 18px; }
.report-content h2 { font-size: 16px; border-bottom: 2px solid #1b5bbf; padding-bottom: 4px; }
.report-content h3 { font-size: 15px; }
.report-content p { margin-bottom: 10px; }
.report-content ul, .report-content ol { margin: 10px 0 10px 24px; }
.report-content li { margin-bottom: 4px; }
.report-content strong { color: #1b5bbf; }
.report-content table {
  width: 100%; border-collapse: collapse; margin: 12px 0;
  font-size: 13px;
}
.report-content th, .report-content td {
  padding: 8px 12px; border: 1px solid #e5e7eb; text-align: left;
}
.report-content th { background: #f9fafb; font-weight: 600; }

.report-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 16px; padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

/* ========== AI 报告 · 正式公文版式 ========== */
.doc-sheet {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  color: #1a1a1a;
}
.doc-cover {
  text-align: center;
  padding: 26px 10px 30px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 26px;
}
.doc-org {
  font-size: 15px; font-weight: 700; letter-spacing: 4px;
  color: #8a1c1c; font-family: "Heiti SC", "STHeiti", sans-serif;
}
.doc-rule {
  width: 56px; height: 3px; margin: 12px auto 34px;
  background: #8a1c1c; border-radius: 2px;
}
.doc-title {
  font-size: 30px; font-weight: 700; letter-spacing: 6px;
  line-height: 1.5; color: #111;
  font-family: "Heiti SC", "STHeiti", sans-serif;
}
.doc-type {
  margin-top: 14px; font-size: 14px; letter-spacing: 2px; color: #6b7280;
}
.doc-cover-foot {
  margin-top: 40px; display: flex; justify-content: space-between;
  padding: 0 8px; font-size: 13px; color: #4b5563;
}
.doc-body {
  font-family: "Songti SC", "STSong", serif;
  font-size: 14.5px; line-height: 1.9;
}
.doc-body h1, .doc-body h2, .doc-body h3, .doc-body h4 {
  font-family: "Heiti SC", "STHeiti", sans-serif;
  color: #111; font-weight: 700;
}
.doc-body h2 {
  font-size: 17px; margin: 22px 0 10px;
  padding-left: 10px; border-left: 4px solid #8a1c1c;
}
.doc-body h3 { font-size: 15.5px; margin: 16px 0 8px; }
.doc-body p { margin: 8px 0; text-align: justify; }
.doc-body strong { color: #8a1c1c; }
.doc-body ul, .doc-body ol { margin: 8px 0; padding-left: 26px; }
.doc-body li { margin: 4px 0; }
.doc-body .md-table-wrap {
  border: 1px solid #cbd5e1; border-radius: 4px;
}
.doc-body .md-table { font-family: "Heiti SC", "STHeiti", sans-serif; }
.doc-body .md-table th {
  background: #f1f5f9; color: #1e293b; border-bottom: 2px solid #94a3b8;
}
.doc-body .md-table th, .doc-body .md-table td { border: 1px solid #e2e8f0; }
.doc-body .md-quote {
  border-left: 3px solid #8a1c1c; background: #faf6f6; color: #57534e;
  border-radius: 0 4px 4px 0;
}
.doc-body .md-code-block, .doc-body code, .doc-body .md-code-lang {
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

.doc-sign {
  position: relative;
  margin-top: 40px; padding-top: 16px;
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 10px; font-size: 13.5px; color: #374151;
  min-height: 110px;
}
.doc-sign-line { padding-right: 90px; }
.doc-seal {
  position: absolute; right: 30px; top: 10px;
  width: 86px; height: 86px; border-radius: 50%;
  border: 3px solid rgba(200,30,30,0.55);
  color: rgba(200,30,30,0.7);
  display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 15px; line-height: 1.5;
  font-family: "Heiti SC", "STHeiti", sans-serif; font-weight: 700;
  transform: rotate(-12deg);
  background: radial-gradient(circle at 50% 50%, rgba(200,30,30,0.04), transparent 70%);
}
.doc-disclaimer {
  margin-top: 26px; padding-top: 12px;
  border-top: 1px dashed #d1d5db;
  font-size: 11.5px; color: #9ca3af; line-height: 1.7;
  text-align: center;
}
.doc-actions { margin-top: 20px; }

/* ========== 待核实草稿箱 ========== */
.drafts-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid #eef0f3; gap: 8px;
}
.draft-filter {
  padding: 5px 8px; font-size: 12px; border: 1px solid #d8dee8;
  border-radius: 6px; background: #fff; color: #475569; outline: none;
}
.drafts-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.draft-card {
  border: 1px solid #e6eaf0; border-radius: 12px; padding: 11px 12px;
  background: #fff; transition: box-shadow .2s, border-color .2s;
}
.draft-card:hover { border-color: #c6d4ee; box-shadow: 0 3px 12px rgba(27,91,191,.08); }
.draft-card-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.draft-cat {
  font-size: 10.5px; font-weight: 600; color: #1b5bbf;
  background: #eaf1fd; padding: 2px 8px; border-radius: 6px;
}
.draft-level { font-size: 10.5px; padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.draft-level.lv-一般 { background: #f1f5f9; color: #475569; }
.draft-level.lv-较大 { background: #fef3c7; color: #b45309; }
.draft-level.lv-重大 { background: #fee2e2; color: #b91c1c; }
.draft-status-tag { margin-left: auto; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.draft-status-tag.pending { background: #fff7ed; color: #c2410c; }
.draft-status-tag.ok { background: #dcfce7; color: #15803d; }
.draft-status-tag.muted { background: #f1f5f9; color: #94a3b8; }
.draft-title { font-size: 14px; font-weight: 600; color: #1f2937; line-height: 1.4; }
.draft-village { font-size: 11.5px; color: #64748b; margin-top: 3px; }
.draft-thumbs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.draft-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid #eef0f3; }
.draft-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; gap: 8px; }
.draft-meta { font-size: 10.5px; color: #94a3b8; }
.draft-actions { display: flex; gap: 6px; align-items: center; }
.draft-inc-no { font-size: 11px; color: #94a3b8; }

/* 编辑器 */
.edit-grid { display: flex; gap: 10px; }
.edit-grid .ed-col-cat, .edit-grid .ed-col-level { flex: 1; }
.collect-hint {
  font-size: 12px; color: #64748b; background: #f8fafc;
  border: 1px solid #eef2f7; border-radius: 8px; padding: 8px 10px; margin-bottom: 12px;
}

/* ========== 任务管理面板 ========== */
.task-panel {
  position: fixed; top: 60px; right: -420px; bottom: 40px;
  width: 420px;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  z-index: 160;
  display: flex; flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 20px rgba(0,0,0,0.08);
}
.task-panel.open { right: 0; }

.task-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
}
.task-panel-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: #1f2937;
}
.task-panel-icon { font-size: 20px; }
.task-panel-close {
  width: 30px; height: 30px; border-radius: 6px; border: none;
  background: rgba(31,59,99,0.1); color: #334155; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.task-panel-close:hover { background: rgba(220,38,38,0.15); color: #dc2626; }

.task-panel-tabs {
  display: flex; border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
}
.task-tab-btn {
  flex: 1; padding: 12px; font-size: 13px;
  color: #6b7280; font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  background: transparent;
}
.task-tab-btn:hover { color: #374151; background: rgba(0,0,0,0.02); }
.task-tab-btn.active {
  color: #f97316; border-bottom-color: #f97316;
  background: #fff;
}

.task-panel-body {
  flex: 1; position: relative; overflow: hidden;
  background: #fafafa;
}
.task-tab-page {
  display: none;
  height: 100%;
  flex-direction: column;
  overflow-y: auto;
}
.task-tab-page.active { display: flex; }

.task-list {
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.task-item {
  background: #fff; border-radius: 10px; padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-left: 4px solid #9ca3af;
  transition: all 0.2s;
}
.task-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.task-item.status-pending { border-left-color: #f59e0b; }
.task-item.status-processing { border-left-color: #3b82f6; }
.task-item.status-reviewing { border-left-color: #8b5cf6; }
.task-item.status-submitted { border-left-color: #8b5cf6; }
.task-item.status-returned { border-left-color: #f97316; }
.task-item.status-done { border-left-color: #10b981; }

.task-item-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.task-item-title {
  font-size: 14px; font-weight: 600; color: #1f2937;
}
.task-item-status {
  font-size: 11px; padding: 2px 8px; border-radius: 8px;
  font-weight: 600;
}
.task-item.status-pending .task-item-status {
  background: #fef3c7; color: #92400e;
}
.task-item.status-processing .task-item-status {
  background: #dbeafe; color: #1e40af;
}
.task-item.status-reviewing .task-item-status {
  background: #ede9fe; color: #5b21b6;
}
.task-item.status-submitted .task-item-status {
  background: #ede9fe; color: #5b21b6;
}
.task-item.status-returned .task-item-status {
  background: #ffedd5; color: #9a3412;
}
.task-item.status-done .task-item-status {
  background: #d1fae5; color: #065f46;
}

.task-item-meta {
  display: flex; gap: 12px; font-size: 12px; color: #6b7280;
  margin-bottom: 8px; flex-wrap: wrap;
}
.task-item-meta-item {
  display: flex; align-items: center; gap: 4px;
}
.task-item-desc {
  font-size: 13px; color: #374151; margin-bottom: 8px;
  line-height: 1.5;
}
.task-item-attachments {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px;
}
.task-item-attachment {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 2px 6px;
  background: #f3f4f6; border-radius: 6px; color: #374151;
}
.task-item-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}
.task-item-btn {
  font-size: 12px; padding: 6px 12px;
  border-radius: 6px; font-weight: 500;
  transition: all 0.2s;
}
.task-item-btn.btn-primary {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff; box-shadow: 0 2px 6px rgba(249,115,22,0.3);
}
.task-item-btn.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(249,115,22,0.4);
}
.task-item-btn.btn-secondary {
  background: #f3f4f6; color: #374151;
}
.task-item-btn.btn-secondary:hover {
  background: #e5e7eb;
}

/* ========== 摄像头填报面板 ========== */
.camera-panel {
  position: fixed; top: 60px; right: -420px; bottom: 40px;
  width: 420px;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  z-index: 135;
  display: flex; flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 20px rgba(0,0,0,0.08);
}
.camera-panel.open { right: 0; }

.camera-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}
.camera-panel-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: #1f2937;
}
.camera-panel-icon { font-size: 20px; }
.camera-panel-close {
  width: 30px; height: 30px; border-radius: 6px; border: none;
  background: rgba(31,59,99,0.1); color: #334155; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.camera-panel-close:hover { background: rgba(220,38,38,0.15); color: #dc2626; }

.camera-panel-body {
  flex: 1; overflow-y: auto; padding: 16px;
  background: #fafafa;
}

.camera-form {
  display: flex; flex-direction: column; gap: 14px;
}
.form-field {
  display: flex; flex-direction: column; gap: 6px;
}
.form-field label {
  font-size: 13px; font-weight: 600; color: #374151;
}
.form-field input,
.form-field select,
.form-field textarea {
  padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 14px; transition: all 0.2s; background: #fff;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none; border-color: #1b5bbf; box-shadow: 0 0 0 3px rgba(27,91,191,0.1);
}
.form-field textarea { resize: vertical; min-height: 80px; }

.form-actions {
  display: flex; gap: 8px; margin-top: 8px;
}
.form-actions .btn {
  flex: 1;
}

/* ========== 弹窗 ========== */
.modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center;
  z-index: 6000;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  background: #fff; border-radius: 12px; padding: 24px;
  width: 480px; max-height: 85vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-card h2 { font-size: 18px; margin-bottom: 20px; color: #1f2937; }
.form-row { margin-bottom: 14px; }
.form-row label {
  display: block; font-size: 13px; color: #374151;
  margin-bottom: 6px; font-weight: 500;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%; padding: 8px 12px; border: 1px solid #d1d5db;
  border-radius: 6px; font-size: 14px; outline: none;
  transition: border-color 0.2s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { border-color: #1b5bbf; }
.form-row textarea { resize: vertical; min-height: 80px; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid #f0f0f0;
}

/* 上传区域 */
.upload-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.upload-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; font-size: 13px;
  cursor: pointer;
}
.upload-btn input { display: none; }
.upload-preview {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px;
}
.upload-thumb-wrap {
  position: relative; width: 80px; height: 80px;
  border-radius: 8px; overflow: hidden; background: #f3f4f6;
  border: 1px solid #e5e7eb;
}
.upload-thumb {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.upload-del {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1; padding: 0;
}

/* 事件处理时间轴 */
.process-timeline {
  display: flex; flex-direction: column; gap: 12px;
  padding-left: 12px; border-left: 2px solid #e5e7eb;
  margin: 12px 0;
}
.process-item {
  position: relative; padding-left: 18px;
}
.process-item::before {
  content: ''; position: absolute; left: -17px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #1b5bbf; border: 2px solid #fff;
  box-shadow: 0 0 0 2px #e5e7eb;
}
.process-item.resolve::before { background: #10b981; }
.process-item.dispatch::before { background: #f59e0b; }
.process-meta {
  font-size: 12px; color: #6b7280; margin-bottom: 4px;
}
.process-note {
  font-size: 13px; color: #1f2937; line-height: 1.5;
  background: #f9fafb; padding: 8px 10px; border-radius: 6px;
}
.process-media {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px;
}
.process-media img, .process-media video {
  width: 70px; height: 70px; object-fit: cover; border-radius: 6px;
  cursor: pointer; background: #f3f4f6;
}

/* 任务看板 */
.task-board-tabs {
  display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap;
}
.task-board-tab {
  padding: 6px 12px; border-radius: 14px; font-size: 12px;
  background: #f3f4f6; color: #4b5563;
}
.task-board-tab.active { background: #1b5bbf; color: #fff; }
.task-item {
  padding: 12px; border: 1px solid #e5e7eb; border-radius: 10px;
  margin-bottom: 10px; background: #fff;
}
.task-item-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  flex-wrap: wrap;
}
.task-title { font-size: 14px; font-weight: 600; color: #1f2937; flex: 1; }
.task-meta { font-size: 12px; color: #6b7280; }
.task-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ========== Toast ========== */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.8); color: #fff; padding: 10px 20px;
  border-radius: 6px; z-index: 6000; font-size: 14px;
  max-width: 80%;
}
.toast.error { background: #dc2626; }

/* ========== 高德 Key 横幅 ========== */
.key-banner {
  position: fixed; top: 60px; left: 0; right: 0; z-index: 2000;
  background: #fffbeb; border-bottom: 1px solid #fde68a;
  padding: 10px 24px;
}
.key-banner-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
}
.key-banner strong { color: #92400e; }
.key-banner span { color: #78350f; font-size: 13px; flex: 1; }
.key-banner-close {
  padding: 4px 12px; background: #fcd34d; color: #78350f;
  border-radius: 4px; font-size: 12px;
}

/* ========== 网格标签 & POI 标记 ========== */
.village-label {
  background: rgba(255,255,255,0.9); padding: 2px 8px;
  border-radius: 10px; font-size: 12px; font-weight: 500;
  color: #1f2937; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.village-label .badge {
  display: inline-block; background: #ef4444; color: #fff;
  border-radius: 8px; padding: 0 5px; font-size: 10px;
  margin-right: 4px; font-weight: 700;
}

.poi-marker {
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff; border: 2px solid #1b5bbf;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.poi-marker:active { transform: scale(1.15); }
.poi-marker.pulse {
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* 滚动条 */
.panel-body::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.reports-list::-webkit-scrollbar,
.report-content::-webkit-scrollbar { width: 6px; }
.panel-body::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track,
.reports-list::-webkit-scrollbar-track,
.report-content::-webkit-scrollbar-track { background: #f1f1f1; }
.panel-body::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.reports-list::-webkit-scrollbar-thumb,
.report-content::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* ========== 响应式适配 ========== */

/* 平板 */
@media (max-width: 1200px) {
  .left-panel { width: 220px; }
  .left-panel.collapsed { margin-left: -220px; }
  .right-panel { width: 280px; }
  .right-panel.collapsed { margin-right: -280px; }
  .ai-panel { width: 420px; right: -460px; }
  .floating-stats { max-width: 340px; }
  .stat-card { min-width: 90px; padding: 8px 10px; }
  .stat-number { font-size: 18px; }
}

/* 手机 */
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block; }

  .top-header {
    height: 52px; padding: 0 12px;
  }
  .logo-icon { font-size: 24px; }
  .title-main { font-size: 16px; }
  .title-sub { display: none; }

  .main-content {
    top: 52px; bottom: 60px;
  }

  /* 左侧面板作为抽屉 */
  .left-panel {
    position: absolute; top: 0; bottom: 0; left: 0;
    width: 260px; height: 100%;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s;
    margin-left: 0 !important;
  }
  .left-panel.open { transform: translateX(0); }
  .panel-overlay.show { display: block; }
  .menu-btn { display: flex; align-items: center; justify-content: center; }

  /* 右侧详情面板：移动端改为底部抽屉（bottom sheet） */
  .right-panel {
    position: absolute; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; max-width: none; height: auto;
    max-height: 50vh;
    border-radius: 16px 16px 0 0;
    border-left: none; border-top: 1px solid var(--line-strong);
    transform: translateY(105%);
    transition: transform 0.3s ease, max-height 0.3s ease;
    margin-right: 0 !important;
    z-index: 200;
    box-shadow: 0 -8px 30px rgba(15,31,61,0.25);
  }
  .right-panel.open { transform: translateY(0); }
  .right-panel.expanded { max-height: 85vh; }
  .right-panel .panel-body { min-height: 0; }

  /* AI 面板全屏 */
  .ai-panel {
    top: 52px; bottom: 60px;
    width: 100%; right: -100%;
    z-index: 200;
  }
  .ai-panel.open { right: 0; }

  /* 统计卡片移动端布局 */
  .floating-stats {
    top: 10px; left: 10px; right: 10px;
    flex-wrap: nowrap; gap: 6px;
    max-width: none;
  }
  .stat-card {
    flex: 1; min-width: 0; padding: 8px 6px;
    flex-direction: column; gap: 2px;
    align-items: center; text-align: center;
    border-left: none; border-top: 3px solid #1b5bbf;
  }
  .stat-card.poi { border-top-color: #e67e22; border-left: none; }
  .stat-card.staff { border-top-color: #27ae60; border-left: none; }
  .stat-card.alert { border-top-color: #e74c3c; border-left: none; }
  .stat-icon { font-size: 18px; }
  .stat-number { font-size: 16px; }
  .stat-label { display: none; }

  /* 地图工具条 */
  .map-toolbar { bottom: 76px; right: 10px; }
  .tool-btn { width: 34px; height: 34px; font-size: 16px; }

  /* 弹窗 */
  .modal { padding: 12px; align-items: flex-end; }
  .modal-card {
    width: 100%; border-radius: 16px 16px 0 0;
    max-height: 85vh;
    padding: 20px 16px;
  }
  .report-modal { max-width: 100%; }
  .modal-actions {
    position: sticky; bottom: 0; background: #fff;
    padding: 12px 0 0; margin-top: 12px;
  }
  .upload-actions { width: 100%; }
  .upload-btn { flex: 1; justify-content: center; padding: 10px; font-size: 14px; }
  .upload-thumb-wrap { width: 72px; height: 72px; }
  .process-media img, .process-media video { width: 64px; height: 64px; }
  .task-actions .btn { flex: 1; justify-content: center; }

  /* AI 对话 */
  .chat-messages { padding: 12px; gap: 12px; }
  .msg-bubble { padding: 8px 12px; font-size: 13px; }
  .suggestion-chips { padding: 0 12px 8px; }

  /* 任务面板移动端全屏 */
  .task-panel {
    top: 52px; bottom: 60px;
    width: 100%; right: -100%;
    z-index: 210;
  }
  .task-panel.open { right: 0; }

  /* 摄像头面板移动端全屏 */
  .camera-panel {
    top: 52px; bottom: 60px;
    width: 100%; right: -100%;
    z-index: 195;
  }
  .camera-panel.open { right: 0; }
}

/* 小屏手机 */
@media (max-width: 380px) {
  .stat-card { padding: 6px 4px; }
  .stat-number { font-size: 14px; }
  .stat-icon { font-size: 16px; }
}

/* 横屏适配 */
@media (max-height: 500px) and (orientation: landscape) {
  .mobile-nav { display: none; }
  .main-content { bottom: 0; }
  .floating-stats { max-width: 300px; }
}

/* ---------------- 网格划分 & 户主明细 ---------------- */
.grid-card {
  border: 1px solid #eef0f3; border-radius: 8px;
  padding: 8px 10px; margin-bottom: 8px; background: #fff;
}
.grid-card-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; margin-bottom: 4px;
}
.grid-chip { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; }
.grid-count { margin-left: auto; color: #6b7280; font-size: 12px; }
.grid-card-line { font-size: 12px; color: #4b5563; line-height: 1.7; }
.grid-card-line b { color: #111827; font-weight: 600; }
.grid-note { font-size: 11px; color: #b45309; margin-top: 4px; }

.hh-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; font-size: 13px; border-radius: 6px;
}
.hh-item:nth-child(odd) { background: #f9fafb; }
.hh-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.hh-name { color: #111827; }
.hh-grid { margin-left: auto; color: #9ca3af; font-size: 11px; }
.hh-more { color: #9ca3af; font-size: 11px; padding: 8px 4px 2px; text-align: center; }

/* ========== 新增：摄像头 / 户档案 / 走访险情 / POI 维护 ========== */

/* 摄像头地图标记 */
.cam-marker {
  width: 34px; height: 34px; border-radius: 8px;
  background: #fff; border: 2px solid #1b5bbf;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  position: relative; cursor: pointer; transition: transform 0.2s;
}
.cam-marker:active { transform: scale(1.12); }
.cam-live {
  position: absolute; top: -4px; right: -4px; width: 10px; height: 10px;
  border-radius: 50%; background: #22c55e; border: 2px solid #fff;
  animation: pulse 1.6s infinite;
}

/* 摄像头弹窗 */
.cam-modal { min-width: 320px; }
.cam-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.cam-modal-title { font-size: 17px; font-weight: 700; color: #1f2937; }
.cam-modal-sub { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.cam-viewer-wrap { position: relative; }
.cam-viewer {
  width: 100%; aspect-ratio: 16/9; background: #0f172a;
  border-radius: 10px; overflow: hidden; position: relative;
}
.cam-frame {
  width: 480px; height: 270px; transform-origin: center center;
  position: absolute; top: 50%; left: 50%;
  margin-left: -240px; margin-top: -135px;
}
.cam-frame svg { width: 100%; height: 100%; }
.cam-shot { position: relative; width: 100%; height: 100%; background: #0b1220; }
.cam-shot-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-shot-osd {
  position: absolute; inset: 0; pointer-events: none;
  font-family: 'SF Mono', Consolas, 'Courier New', monospace;
  color: #fff; font-size: 12px; line-height: 1.5;
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 28%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.55) 100%);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 8px 10px;
}
.cam-shot-title { font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.cam-shot-sub { color: #ffd166; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.cam-shot-time { position: absolute; top: 8px; right: 10px; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.cam-shot-mark {
  position: absolute; bottom: 8px; right: 10px; color: #ff5252; font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
}
.cam-loading {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: #e2e8f0; font-size: 14px;
}
.cam-osd {
  position: absolute; left: 8px; bottom: 8px; color: #fbbf24;
  font-size: 11px; background: rgba(0,0,0,0.5); padding: 2px 8px; border-radius: 4px;
}
.cam-ctrl {
  position: absolute; right: 10px; bottom: 10px; display: flex;
  align-items: center; gap: 6px; background: rgba(15,23,42,0.72);
  padding: 5px 8px; border-radius: 8px;
}
.cam-ctrl-btn {
  width: 30px; height: 30px; padding: 0; font-size: 16px; font-weight: 700;
  background: rgba(255,255,255,0.15); color: #fff; border-radius: 6px;
}
.cam-ctrl-btn:hover { background: rgba(255,255,255,0.3); }
.cam-zoom { color: #e2e8f0; font-size: 12px; min-width: 44px; text-align: center; }
.cam-full { color: #93c5fd; font-size: 12px; cursor: pointer; padding: 2px 4px; }
.cam-full:hover { color: #fff; }
.cam-note { color: #9ca3af; font-size: 11px; margin-top: 10px; text-align: center; }

/* 户档案弹窗 */
.hh-modal { min-width: 320px; }
.hh-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.hh-section { padding: 12px 0; border-top: 1px solid #f0f0f0; }
.hh-section:first-of-type { border-top: none; }
.hh-section-title { font-size: 14px; font-weight: 700; color: #1f2937; margin-bottom: 8px; }

/* 维稳事件 / 走访卡片 */
.fi-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.fi-card {
  border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 12px;
  background: #fbfcfe;
}
.fi-card-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fi-title { font-size: 13px; font-weight: 600; color: #111827; flex: 1; min-width: 120px; }
.fi-meta { font-size: 12px; color: #6b7280; margin-top: 4px; }
.fi-desc { font-size: 12px; color: #4b5563; margin-top: 4px; line-height: 1.55; }
.fi-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* 户主待办徽标 */
.hh-badge {
  background: #dc2626; color: #fff; font-size: 10px; min-width: 16px;
  height: 16px; border-radius: 8px; display: inline-flex; align-items: center;
  justify-content: center; padding: 0 4px; flex: none;
}
.hh-item { cursor: pointer; transition: background 0.15s; }
.hh-item:hover { background: #eef2ff !important; }

/* 弹窗横向扩展（摄像头/户档案等大弹窗） */
.modal-card.modal-wide { width: 820px; max-width: calc(100vw - 40px); padding: 32px 40px; }
@media (max-width: 768px) {
  .modal-card.modal-wide { width: 100%; }
  .cam-viewer { aspect-ratio: 4/3; }
}

/* ========== 视觉升级：简洁 · 震撼（桌面端） ========== */
@media (min-width: 769px) {
  body { background: linear-gradient(160deg, #eef2f7 0%, #f6f8fb 45%, #e8edf4 100%); }

  /* 顶部导航：深色渐变 + 底部发光细线 */
  .top-header {
    background: linear-gradient(90deg, #0f1f3d 0%, #143a75 45%, #0f1f3d 100%);
    box-shadow: 0 4px 24px rgba(15, 31, 61, 0.35);
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .top-header::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
    background: linear-gradient(90deg, transparent, #3b82f6, #60a5fa, #3b82f6, transparent);
    opacity: 0.7;
  }
  .title-main {
    background: linear-gradient(90deg, #fff, #bfdbfe);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    letter-spacing: 2px;
  }
  .view-btn { border-radius: 8px; }
  .view-btn.active {
    background: linear-gradient(135deg, rgba(59,130,246,0.85), rgba(37,99,235,0.85));
    box-shadow: 0 4px 14px rgba(37,99,235,0.45);
  }

  /* 悬浮统计卡片：玻璃拟态 + 渐变描边 */
  .floating-stats { top: 18px; left: 18px; }
  .stat-card {
    background: rgba(255,255,255,0.86);
    backdrop-filter: blur(14px) saturate(1.4);
    border-radius: 14px; padding: 12px 16px;
    box-shadow: 0 8px 28px rgba(15,31,61,0.12);
    border: 1px solid rgba(255,255,255,0.6);
    border-left: 3px solid #1b5bbf;
    transition: transform 0.25s, box-shadow 0.25s;
  }
  .stat-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(15,31,61,0.18); }
  .stat-number {
    background: linear-gradient(90deg, #0f1f3d, #1b5bbf);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    font-size: 26px;
  }

  /* 村庄标签 */
  .village-label {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow: 0 3px 12px rgba(15,31,61,0.18);
    font-weight: 600; letter-spacing: 0.3px;
  }

  /* POI / 摄像头标记：悬浮层次 */
  .poi-marker, .cam-marker {
    box-shadow: 0 4px 14px rgba(15,31,61,0.28);
    border-width: 2px;
    transition: transform 0.2s, box-shadow 0.2s;
  }
  .poi-marker:hover, .cam-marker:hover { transform: scale(1.1) translateY(-2px); box-shadow: 0 8px 20px rgba(15,31,61,0.32); }

  /* 左右面板与详情 */
  .left-panel, .right-panel {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
  }
  .detail-section { padding: 18px 20px; }
  .detail-title { font-size: 17px; }
  .grid-card { box-shadow: 0 1px 4px rgba(15,31,61,0.05); }
  .hh-item { transition: background 0.15s; }

  /* 按钮：主按钮渐变 */
  .btn-primary {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    box-shadow: 0 3px 10px rgba(37,99,235,0.35);
  }
  .btn-primary:hover { background: linear-gradient(135deg, #1e40af, #1d4ed8); }
  .btn-warn { box-shadow: 0 3px 10px rgba(245,158,11,0.3); }
  .btn-success { box-shadow: 0 3px 10px rgba(16,185,129,0.3); }
  .btn { border-radius: 8px; }

  /* 底部事件滚动条：深色精致 */
  .event-ticker {
    background: linear-gradient(90deg, #0f1f3d, #143a75);
    border-top: none;
    box-shadow: 0 -3px 16px rgba(15,31,61,0.25);
  }
  .ticker-label { background: rgba(239,68,68,0.18); color: #fca5a5; border-right: 1px solid rgba(252,165,165,0.25); }
  .ticker-content { color: #e2e8f0; }
  .ticker-item .ticker-time { color: #94a3b8; }

  /* 地图工具条 */
  .map-toolbar {
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 12px;
    box-shadow: 0 6px 22px rgba(15,31,61,0.2);
  }
  .tool-btn { border-radius: 8px; }

  /* 弹窗 */
  .modal-card {
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(15,31,61,0.4);
  }
}

/* ========== v2 组件美化（头部/统计卡/图层/弹窗/标记等） ========== */

/* 头部：logo 图标质感 + AI 按钮发光 */
.logo-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}
.ai-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  box-shadow: 0 4px 16px rgba(102,126,234,0.5);
  border: 1px solid rgba(255,255,255,0.2);
}
.task-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
}
.time-display {
  font-family: "SF Mono", "Menlo", Consolas, monospace;
  background: rgba(255,255,255,0.1);
  padding: 5px 12px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  letter-spacing: 1px;
}

/* 统计卡：图标徽章 + 悬浮抬升 */
.stat-card { border-left: none; position: relative; overflow: hidden; }
.stat-card::after {
  content: ''; position: absolute; right: -18px; top: -18px;
  width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle, rgba(27,91,191,0.12), transparent 70%);
  pointer-events: none;
}
.stat-icon {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: var(--brand-grad-soft);
  box-shadow: inset 0 0 0 1px rgba(27,91,191,0.08);
}
.stat-card.poi .stat-icon { background: linear-gradient(135deg,#fef3e2,#fdf0f6); }
.stat-card.staff .stat-icon { background: linear-gradient(135deg,#e7f8ef,#eef6ff); }
.stat-card.alert .stat-icon { background: linear-gradient(135deg,#feecec,#fff3e6); }
.stat-card:hover { transform: translateY(-3px); }

/* 图层面板：分组图标色块 + 计数胶囊 */
.group-header { border-radius: 10px; background: #f6f8fc; }
.group-header:hover { background: #eef2fb; }
.group-icon {
  width: 26px; height: 26px; border-radius: 8px;
  background: #fff; border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.layer-item { border-radius: 8px; }
.layer-count { background: #fff; border: 1px solid var(--line); }
.layer-item.active .layer-name { color: var(--primary); font-weight: 600; }

/* 详情区块：卡片化呼吸感 */
.detail-section { padding: 18px 20px; }
.detail-section h3 { letter-spacing: 0.3px; }
.grid-card, .fi-card {
  transition: transform 0.2s, box-shadow 0.2s;
}
.grid-card:hover, .fi-card:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(15,31,61,0.08); }
.hh-item { transition: background 0.15s, padding-left 0.2s; }
.hh-item:hover { padding-left: 12px; }

/* 弹窗：缩放淡入 + 圆角光边 */
.modal-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.7);
}
.form-row input, .form-row select, .form-row textarea {
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(79,141,242,0.18);
}

/* 按钮统一圆角 */
.btn { border-radius: var(--radius-sm); }

/* 村庄标签：状态色点 */
.village-label { display: inline-flex; align-items: center; gap: 5px; }

/* 空状态 */
.empty-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg,#f3f6fd,#eef0fb);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; margin: 0 auto 16px;
}

/* Toast 圆润 */
.toast { border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,0.25); }

/* 滚动条全局统一 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9d2e0; border-radius: 4px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a8b4c6; background-clip: content-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* AI 面板头部 */
.ai-panel-header { background: var(--brand-grad-soft); border-bottom: 1px solid var(--line); }

/* 事件滚动条文字动画 */
.ticker-content { animation: none; }

/* 详情面板内容切换淡入 */
#detailContainer.detail-enter { animation: detailIn 0.32s ease; }
@keyframes detailIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== 登录界面 & 用户信息 ========== */
.login-overlay {
  position: fixed; inset: 0; z-index: 5000;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 700px at 50% 20%, rgba(27,91,191,0.25), rgba(15,31,61,0.85) 60%), linear-gradient(160deg, #0f1f3d, #1b5bbf);
  backdrop-filter: blur(6px);
}
.login-overlay[hidden] { display: none; }
.login-card {
  width: 380px; max-width: 92vw;
  background: rgba(255,255,255,0.97);
  border-radius: 20px; padding: 36px 34px 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
  animation: modal-in 0.35s ease-out;
  border: 1px solid rgba(255,255,255,0.6);
}
.login-logo {
  width: 64px; height: 64px; margin: 0 auto 14px;
  border-radius: 18px; font-size: 32px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1b5bbf, #4f46e5);
  box-shadow: 0 10px 24px rgba(27,91,191,0.4);
}
.login-title { text-align: center; font-size: 20px; font-weight: 700; color: #1f2937; }
.login-sub { text-align: center; font-size: 12px; color: #6b7280; margin: 6px 0 22px; letter-spacing: 0.5px; }
.login-field { margin-bottom: 14px; }
.login-field label { display: block; font-size: 13px; color: #374151; margin-bottom: 6px; font-weight: 500; }
.login-field input {
  width: 100%; padding: 10px 14px; border: 1px solid #d1d5db;
  border-radius: 10px; font-size: 14px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-field input:focus { border-color: #4f8df2; box-shadow: 0 0 0 3px rgba(79,141,242,0.18); }
.login-msg { min-height: 18px; font-size: 12px; color: #dc2626; margin-bottom: 6px; }
.login-btn { width: 100%; padding: 11px; font-size: 15px; border-radius: 10px; letter-spacing: 4px; }
.login-hint { margin-top: 16px; text-align: center; font-size: 11px; color: #9ca3af; line-height: 1.7; }

/* 头部用户信息胶囊 */
.user-chip {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px; padding: 4px 6px 4px 12px;
}
.user-chip-name { color: #fff; font-size: 13px; font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-role {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  background: rgba(255,255,255,0.2); color: #e2e8f0;
}
.user-chip-logout {
  width: 24px; height: 24px; border-radius: 50%;
  color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center;
  background: rgba(220,38,38,0.7); transition: background 0.2s;
}
.user-chip-logout:hover { background: #dc2626; }
@media (max-width: 768px) {
  .login-card { padding: 28px 22px 22px; }
  .user-chip-name { max-width: 70px; }
}

/* 网格人员：非管辖村（锁定）标签 */
.village-label.locked {
  background: rgba(148,163,184,0.85);
  color: #f1f5f9;
  font-size: 11px;
  box-shadow: 0 2px 8px rgba(15,31,61,0.15);
  cursor: not-allowed;
  filter: saturate(0.6);
}

/* ========== 实时监测面板（天气 / AQI 趋势 / 水位） ========== */
.monitor-panel {
  position: absolute; top: 16px; right: 16px; z-index: 150;
  width: 340px; max-width: calc(100% - 32px); max-height: calc(100% - 120px);
  background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none;
  border-radius: 14px; box-shadow: 0 8px 28px rgba(15,31,61,0.14);
  border: 1px solid rgba(255,255,255,0.6); overflow: hidden;
  display: flex; flex-direction: column;
}
.monitor-panel[hidden] { display: none !important; }
.monitor-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid #eef0f3;
  background: linear-gradient(135deg, #f0f6ff, #e8effc);
}
.monitor-panel-title { font-size: 14px; font-weight: 700; color: #1f2937; }
.monitor-close {
  width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(31,59,99,0.1); color: #334155; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.monitor-close:hover { background: rgba(220,38,38,0.15); color: #dc2626; }
.monitor-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.monitor-section-title { font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 8px; }
.monitor-empty { font-size: 12px; color: #9ca3af; padding: 8px 0; }
.monitor-tag {
  display: inline-block; margin-top: 8px; font-size: 10px; color: #b45309;
  background: #fef3c7; border-radius: 8px; padding: 2px 8px;
}

/* 天气 */
.weather-card { background: #f8fafc; border-radius: 10px; padding: 10px 12px; }
.weather-now { display: flex; align-items: center; gap: 10px; }
.weather-icon { font-size: 34px; line-height: 1; }
.weather-temp { font-size: 26px; font-weight: 800; color: #1f2937; }
.weather-cond { font-size: 13px; color: #475569; }
.weather-meta { display: flex; gap: 14px; font-size: 12px; color: #64748b; margin-top: 6px; }
.weather-forecast { display: flex; gap: 6px; margin-top: 10px; }
.forecast-day {
  flex: 1; text-align: center; background: #fff; border: 1px solid #eef0f3;
  border-radius: 8px; padding: 6px 2px; font-size: 11px; color: #64748b;
  display: flex; flex-direction: column; gap: 2px;
}
.forecast-icon { font-size: 16px; }
.forecast-temp { font-weight: 600; color: #334155; }

/* AQI 趋势 */
.aqi-trend-wrap { background: #f8fafc; border-radius: 10px; padding: 6px 8px 4px; }
.aqi-trend-legend { font-size: 11px; color: #64748b; padding: 2px 4px 4px; }

/* 当前空气质量卡片 */
.aqi-current-card { background: #f8fafc; border-radius: 10px; padding: 10px 12px; }
.aqi-current-main { display: flex; align-items: center; gap: 10px; }
.aqi-current-num { font-size: 30px; font-weight: 700; line-height: 1; }
.aqi-current-level { font-size: 12px; color: #fff; border-radius: 10px; padding: 2px 10px; }
.aqi-source-badge {
  display: inline-block; margin-left: auto; font-size: 10px; border-radius: 8px; padding: 2px 8px;
}
.aqi-source-badge.mock { color: #b45309; background: #fef3c7; }
.aqi-source-badge.real { color: #047857; background: #d1fae5; }
.aqi-current-meta { font-size: 11px; color: #64748b; margin-top: 6px; }
.aqi-current-advice { font-size: 12px; color: #334155; margin-top: 6px; line-height: 1.5; }

/* 地图点选行 */
.loc-pick-row { display: flex; gap: 8px; align-items: center; }
.loc-pick-row input { flex: 1; }
.loc-pick-row .btn { white-space: nowrap; }

/* 水位 */
.water-list { display: flex; flex-direction: column; gap: 8px; }
.water-item { background: #f8fafc; border-radius: 10px; padding: 9px 12px; }
.water-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; gap: 8px; }
.water-substatus { margin-bottom: 4px; }
.water-name { font-size: 13px; font-weight: 700; color: #1f2937; }
.water-status { font-size: 10px; font-weight: 700; border-radius: 8px; padding: 2px 8px; }
.water-status.normal { background: #dcfce7; color: #15803d; }
.water-status.warn { background: #fef3c7; color: #b45309; }
.water-status.danger { background: #fee2e2; color: #b91c1c; }
.water-meta { font-size: 11px; color: #64748b; margin-bottom: 6px; }
.water-bar { height: 6px; background: #e5e7eb; border-radius: 4px; overflow: hidden; margin-bottom: 6px; }
.water-bar-fill { height: 100%; border-radius: 4px; }
.water-bar-fill.normal { background: #22c55e; }
.water-bar-fill.warn { background: #eab308; }
.water-bar-fill.danger { background: #dc2626; }
.water-nums { font-size: 11px; color: #475569; }

@media (max-width: 768px) {
  .monitor-panel { top: auto; bottom: 76px; right: 10px; left: 10px; width: auto; max-height: 46vh; }
  .weather-forecast { flex-wrap: wrap; }
  .forecast-day { min-width: 70px; }
}

/* ========== v20260923：底部抽屉手柄 / 查询码 / 进度查询 / 网格图户主分布 ========== */

/* 底部抽屉顶部手柄（仅移动端显示，点按切换半屏/展开） */
.sheet-handle { display: none; }
@media (max-width: 768px) {
  .sheet-handle {
    display: flex; align-items: center; justify-content: center;
    padding: 8px 0 2px; cursor: pointer; flex: none;
  }
  .sheet-handle::before {
    content: ''; width: 44px; height: 5px; border-radius: 3px;
    background: #d1d5db; transition: background 0.2s;
  }
  .sheet-handle:active::before { background: #9ca3af; }
}

/* 表单提示语 */
.form-note { font-size: 12px; color: #6b7280; margin: -10px 0 14px; line-height: 1.6; }

/* 上报成功查询码展示 */
.report-code-box {
  text-align: center; padding: 18px 12px; margin: 14px 0 4px;
  background: linear-gradient(135deg, #f0f6ff, #eef2ff);
  border: 1px dashed #93c5fd; border-radius: 12px;
}
.report-code-label { font-size: 12px; color: #6b7280; margin-bottom: 6px; }
.report-code-value {
  font-size: 34px; font-weight: 800; letter-spacing: 8px; color: #1b5bbf;
  font-family: "SF Mono", "Menlo", Consolas, monospace; user-select: all;
}

/* 上报进度查询结果卡片 */
.rq-card {
  margin-top: 14px; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 14px; background: #fbfcfe;
}
.rq-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.rq-title { font-size: 15px; font-weight: 700; color: #1f2937; flex: 1; }
.rq-meta { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.rq-timeline {
  display: flex; flex-direction: column; gap: 8px;
  padding-left: 12px; border-left: 2px solid #e5e7eb; margin: 10px 0 10px 4px;
}
.rq-step { position: relative; padding-left: 18px; font-size: 12px; color: #9ca3af; display: flex; align-items: baseline; gap: 8px; }
.rq-dot {
  position: absolute; left: -17px; top: 3px; width: 10px; height: 10px; border-radius: 50%;
  background: #d1d5db; border: 2px solid #fff; box-shadow: 0 0 0 1px #e5e7eb;
}
.rq-step.done { color: #374151; }
.rq-step.done .rq-dot { background: #10b981; }
.rq-step-label { font-weight: 600; flex: none; }
.rq-step-time { font-size: 11px; color: #6b7280; }
.rq-note {
  font-size: 12px; color: #374151; background: #f9fafb;
  border-radius: 6px; padding: 8px 10px; margin-top: 6px; line-height: 1.55;
}

/* 村详情网格图 + 户主分布 */
.gridmap-toggle {
  float: right; font-size: 12px; color: #1b5bbf; font-weight: 500;
  cursor: pointer; user-select: none;
}
.gridmap-toggle input { vertical-align: -2px; margin-right: 4px; cursor: pointer; }
.gridmap-wrap { position: relative; width: 100%; clear: both; }
.gridmap-img {
  width: 100%; display: block; border-radius: 8px;
  border: 1px solid #e5e7eb; background: #f8fafc;
}
.gridmap-canvas {
  position: absolute; left: 0; top: 0;
  cursor: crosshair;
  /* 显隐由 JS 显式 style.display 控制，不用 [hidden]，避免与 CSS display 冲突 */
}
.gridmap-zoom-btn {
  float: right; margin-right: 10px;
  padding: 1px 8px; font-size: 12px; line-height: 18px;
}
.gridmap-pop {
  position: absolute; transform: translate(-50%, -135%);
  background: #fff; border: 1px solid #e5e7eb; border-radius: 6px;
  padding: 4px 10px; font-size: 12px; color: #1f2937;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18); white-space: nowrap; z-index: 5;
}

/* 网格图大图查看器 */
.modal-card.gm-viewer-card {
  width: min(1200px, 96vw); max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.gm-viewer { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.gm-viewer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
.gm-viewer-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.gm-viewer-toolbar .cam-ctrl-btn { background: #eff6ff; color: #1b5bbf; border: 1px solid #dbeafe; }
.gm-viewer-toolbar .cam-ctrl-btn:hover { background: #dbeafe; }
.gm-viewer-toolbar .cam-zoom { color: #374151; min-width: 48px; text-align: center; }
.gm-viewer-toolbar button:disabled { opacity: 0.55; cursor: not-allowed; }
.gm-viewer-image-status { color: #64748b; font-size: 12px; white-space: nowrap; }
.gmv-dist { float: none; margin-left: auto; }
.gm-viewer-scroll {
  flex: 1; min-height: 240px; overflow: auto;
  border: 1px solid #e5e7eb; border-radius: 8px; background: #f1f5f9;
}
.gm-viewer-imgwrap { position: relative; }
.gm-viewer-img { display: block; width: 100%; }
@media (max-width: 768px) {
  .modal-card.gm-viewer-card { width: 100%; max-height: 88vh; }
  .gm-viewer-scroll { min-height: 200px; }
}

/* ========== v20260923b：系统管理面板（仅管理员） ========== */
.admin-panel {
  position: fixed; top: 70px; bottom: 52px; left: 50%; transform: translateX(-50%);
  width: min(980px, calc(100vw - 32px));
  z-index: 300;
  display: flex;
}
.admin-panel[hidden] { display: none; }
.admin-card {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(14px) saturate(1.35);
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15,31,61,0.25);
}
.admin-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #eff6ff, #e0e7ff);
}
.admin-panel-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: #1f2937;
}
.admin-panel-icon { font-size: 20px; }
.admin-panel-close {
  width: 30px; height: 30px; border-radius: 6px; border: none;
  background: rgba(31,59,99,0.1); color: #334155; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.admin-panel-close:hover { background: rgba(220,38,38,0.15); color: #dc2626; }

.admin-panel-tabs {
  display: flex; border-bottom: 1px solid #e5e7eb; background: #fafafa;
}
.admin-tab-btn {
  flex: 1; padding: 12px; font-size: 13px;
  color: #6b7280; font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s; background: transparent;
}
.admin-tab-btn:hover { color: #374151; background: rgba(0,0,0,0.02); }
.admin-tab-btn.active { color: #1b5bbf; border-bottom-color: #1b5bbf; background: #fff; }

.admin-panel-body { flex: 1; position: relative; overflow: hidden; background: #f6f8fb; }
.admin-tab-page {
  display: none; height: 100%; overflow-y: auto; padding: 14px;
}
.admin-tab-page.active { display: block; }

.admin-block {
  background: #fff; border: 1px solid #eef0f3; border-radius: 12px;
  padding: 14px; margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(15,31,61,0.04);
}
.admin-block-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: #1f2937; margin-bottom: 10px;
}
.admin-refresh { margin-left: auto; }

.admin-form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px; margin-bottom: 8px;
}
.admin-form-grid input, .admin-form-grid select {
  padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 13px; outline: none; transition: border-color 0.2s;
  background: #fff;
}
.admin-form-grid input:focus, .admin-form-grid select:focus { border-color: #1b5bbf; }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th {
  text-align: left; padding: 8px 10px; white-space: nowrap;
  color: #6b7280; font-weight: 600; background: #fafafa;
  border-bottom: 1px solid #e5e7eb;
}
.admin-table td {
  padding: 8px 10px; color: #374151; vertical-align: middle;
  border-bottom: 1px solid #f3f4f6;
}
.admin-table tr:hover td { background: #f8fafc; }
.admin-ops { white-space: nowrap; }
.admin-ops .btn { margin: 2px; }
.admin-detail-cell {
  max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.admin-badge {
  display: inline-block; font-size: 11px; padding: 1px 7px;
  border-radius: 8px; font-weight: 600; white-space: nowrap;
}
.admin-badge.ok { background: #d1fae5; color: #065f46; }
.admin-badge.disabled { background: #fee2e2; color: #991b1b; }
.admin-badge.warn { background: #fef3c7; color: #92400e; }
.admin-badge.self { background: #dbeafe; color: #1e40af; }
.admin-badge.action { background: #eef2ff; color: #3730a3; }

.admin-loading { padding: 40px; text-align: center; color: #6b7280; font-size: 13px; }
.admin-error { padding: 24px; text-align: center; color: #b91c1c; font-size: 13px; }

.admin-filter-row { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.admin-filter-row select {
  padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 12px; background: #fff;
}

.admin-export-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px; margin-top: 8px;
}
.admin-export-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 10px; border: 1px solid #e5e7eb; border-radius: 10px;
  background: #fbfcfe; cursor: pointer; transition: all 0.2s;
}
.admin-export-btn:hover { border-color: #1b5bbf; box-shadow: 0 4px 12px rgba(27,91,191,0.12); }
.admin-export-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.admin-export-icon { font-size: 24px; }
.admin-export-label { font-size: 13px; font-weight: 600; color: #1f2937; }
.admin-export-type { font-size: 11px; color: #9ca3af; font-family: "SF Mono", "Menlo", Consolas, monospace; }

.admin-health-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px;
}
.admin-health-card {
  border: 1px solid #eef0f3; border-radius: 10px; padding: 12px; background: #fbfcfe;
}
.admin-health-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: #1f2937; margin-bottom: 8px;
}
.admin-health-status { font-size: 11px; color: #6b7280; }
.admin-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-left: auto; flex: none; }
.admin-dot.ok { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,0.6); }
.admin-dot.error { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.6); }
.admin-dot.unknown { background: #9ca3af; }
.admin-health-big { font-size: 20px; font-weight: 700; color: #1b5bbf; margin-bottom: 8px; }
.admin-health-line { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 3px 0; }
.admin-health-line .k { color: #9ca3af; flex: none; }
.admin-health-line .v { color: #374151; text-align: right; word-break: break-all; }

@media (max-width: 768px) {
  .admin-panel { top: 52px; bottom: 60px; left: 0; right: 0; width: 100%; transform: none; }
  .admin-card { border-radius: 0; border-left: none; border-right: none; }
  .admin-ops { white-space: normal; }
  .admin-detail-cell { max-width: 140px; }
}

/* ============================================================
   🎨 v3 全面视觉升级 - 玻璃拟态 · 渐变色 · 微交互
   ============================================================ */

/* ---------- 设计令牌升级 ---------- */
:root {
  /* 品牌色系 */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;
  
  /* 功能色 */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --purple: #8b5cf6;
  --pink: #ec4899;
  
  /* 渐变 */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-blue: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-green: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --gradient-orange: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --gradient-purple: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  --gradient-dark: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  
  /* 玻璃效果 */
  --glass-bg-strong: rgba(255, 255, 255, 0.95);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-bg-soft: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
  
  /* 动效 */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ---------- 顶部导航栏升级 ---------- */
.top-header {
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    #4facfe 25%, 
    #00f2fe 50%, 
    #4facfe 75%, 
    transparent 100%);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4); }
  50% { box-shadow: 0 4px 25px rgba(102, 126, 234, 0.7); }
}

.title-main {
  background: linear-gradient(135deg, #fff 0%, #e0e7ff 50%, #c7d2fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  letter-spacing: 2px;
}

/* 视图切换按钮 */
.view-switcher {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 4px;
}

.view-btn {
  position: relative;
  border-radius: 10px;
  padding: 10px 20px;
  transition: all var(--transition-base);
  overflow: hidden;
}

.view-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.view-btn:hover::before {
  width: 100px;
  height: 100px;
}

.view-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
  transform: translateY(-1px);
}

/* ---------- 面板玻璃拟态 ---------- */
.left-panel,
.right-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.panel-header {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.panel-title::before {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* ---------- 统计卡片升级 ---------- */
.stat-card {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
  border: 1px solid rgba(102, 126, 234, 0.2);
  transition: all var(--transition-base);
}

.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(5deg);
}

.stat-number {
  font-size: 28px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.2;
}

/* ---------- 按钮系统升级 ---------- */
.btn {
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 600;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--gradient-primary);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-success {
  background: var(--gradient-green);
  box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(17, 153, 142, 0.5);
}

.btn-warn {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  box-shadow: 0 4px 15px rgba(250, 112, 154, 0.4);
}

.btn-warn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(250, 112, 154, 0.5);
}

.btn-plain {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #374151;
}

.btn-plain:hover {
  background: #fff;
  border-color: rgba(102, 126, 234, 0.3);
  color: #667eea;
  transform: translateY(-1px);
}

/* ---------- 图层面板升级 ---------- */
.group-header {
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border: 1px solid transparent;
  transition: all var(--transition-base);
}

.group-header:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-color: rgba(102, 126, 234, 0.2);
  transform: translateX(4px);
}

.group-icon {
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
  border: 1px solid rgba(102, 126, 234, 0.2);
}

.layer-item {
  border-radius: 10px;
  transition: all var(--transition-fast);
}

.layer-item:hover {
  background: rgba(102, 126, 234, 0.08);
  transform: translateX(4px);
}

.layer-checkbox {
  border-radius: 6px;
  border: 2px solid #d1d5db;
  transition: all var(--transition-fast);
}

.layer-item.active .layer-checkbox {
  background: var(--gradient-primary);
  border-color: transparent;
  animation: check-bounce 0.3s;
}

@keyframes check-bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.layer-item.active .layer-name {
  color: #667eea;
  font-weight: 600;
}

/* ---------- AI 面板升级 ---------- */
.ai-panel {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--glass-border);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
}

.ai-panel-header {
  background: var(--gradient-purple);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.ai-model-tag {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.msg-avatar {
  background: var(--gradient-primary);
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.msg-bubble {
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: all var(--transition-fast);
}

.msg-bubble:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.chat-input-wrapper {
  border-radius: 25px;
  border: 2px solid rgba(102, 126, 234, 0.2);
  background: #fff;
  transition: all var(--transition-base);
}

.chat-input-wrapper:focus-within {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.chat-send-btn {
  background: var(--gradient-primary);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transition: all var(--transition-fast);
}

.chat-send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* ---------- 弹窗升级 ---------- */
.modal {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
}

.modal-card {
  border-radius: 20px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modal-in 0.22s ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.98) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- 表单元素升级 ---------- */
input, select, textarea {
  border-radius: 10px;
  transition: all var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  border-color: #667eea !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15) !important;
  outline: none;
}

/* ---------- Toast 升级 ---------- */
.toast {
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  padding: 12px 24px;
  font-weight: 500;
  animation: toast-in 0.3s var(--transition-bounce);
}

@keyframes toast-in {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ---------- 地图工具条升级 ---------- */
.map-toolbar {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.tool-btn {
  width: 42px;
  height: 42px;
  font-size: 20px;
  transition: all var(--transition-fast);
}

.tool-btn:hover {
  background: var(--gradient-primary);
  color: #fff;
  transform: scale(1.1);
}

/* ---------- 事件滚动条升级 ---------- */
.event-ticker {
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.ticker-label {
  background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
  color: #c4b5fd;
  border-right: 1px solid rgba(196, 181, 253, 0.2);
}

/* ---------- 任务面板升级 ---------- */
.task-panel {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
}

.task-panel-header {
  background: var(--gradient-orange);
}

.task-tab-btn.active {
  color: #fa709a;
  border-bottom-color: #fa709a;
}

/* ---------- 登录页面升级 ---------- */
.login-overlay {
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}

.login-card {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.login-logo {
  background: var(--gradient-primary);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
  animation: logo-float 3s ease-in-out infinite;
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.login-title {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 移动端导航升级 ---------- */
.mobile-nav {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
}

.mobile-nav-item.active {
  color: #667eea;
}

.mobile-nav-item.active .nav-icon {
  transform: translateY(-3px);
  transition: transform var(--transition-fast);
}

/* ---------- 空状态升级 ---------- */
.empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  animation: empty-bounce 2s ease-in-out infinite;
}

@keyframes empty-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ---------- 滚动条美化 ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* ---------- 全局动画类 ---------- */
.fade-in {
  animation: fade-in 0.5s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-up {
  animation: slide-up 0.5s ease;
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* ---------- 响应式调整 ---------- */
@media (max-width: 768px) {
  .stat-card {
    border-radius: 14px;
    padding: 12px;
  }
  
  .stat-number {
    font-size: 22px;
  }
  
  .btn {
    padding: 8px 16px;
  }
  
  .modal-card {
    border-radius: 20px 20px 0 0;
  }
}

/* ---------- v3.1 备份管理 ---------- */
.admin-backup-tip {
  margin: 4px 0 14px;
  font-size: 12px;
  color: var(--text-secondary, #8a94a6);
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.backup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.backup-item:hover {
  background: #fff;
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
}

.backup-item-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.backup-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  word-break: break-all;
}

.backup-meta {
  font-size: 12px;
  color: var(--text-secondary, #8a94a6);
}

.backup-item-ops {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ---------- v3.2 数据源配置 ---------- */
.ds-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.ds-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ds-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
}
.ds-field input {
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ds-field input:focus {
  outline: none;
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.ds-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.ds-test-result {
  margin-top: 18px;
}
.ds-diag-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary, #1f2937);
}
.ds-diag-error {
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 8px;
}
.ds-diag-warn {
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #92400e;
  background: #fffbeb;
  border-radius: 8px;
}

/* 地图选点提示条 */
.map-pick-bar {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 400;
  background: rgba(15,31,61,0.92); color: #fff; font-size: 13px; padding: 8px 16px;
  border-radius: 20px; box-shadow: 0 4px 16px rgba(0,0,0,0.25); pointer-events: none; white-space: nowrap;
}
.map-pick-bar b { color: #fbbf24; font-variant-numeric: tabular-nums; }

/* 实景底图开关 / 实景图校准 */
.tool-btn.active { background: #1b5bbf; color: #fff; }
.gm-calib-bar {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 400;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: calc(100% - 32px);
  background: rgba(15,31,61,0.94); color: #fff; font-size: 13px; padding: 8px 14px;
  border-radius: 14px; box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.gm-calib-tip { color: #cbd5e1; font-size: 12px; }
.gm-calib-handle {
  width: 28px; height: 28px; border-radius: 50%; background: #fbbf24; color: #1f2937;
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.4); cursor: move;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.gm-calib-handle.center { background: #ef4444; color: #fff; }

.gm-calib-handle.rotate { background: #38bdf8; color: #0f172a; }
.gc-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.gc-list { display: flex; flex-direction: column; gap: 6px; }
.gc-item { display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: #f8fafc; border-radius: 8px; cursor: pointer; font-size: 13px; }
.gc-item:hover { background: #eef2ff; }
.gc-item .gc-dot { margin-right: 0; }
.gc-item-name { font-weight: 700; color: #1f2937; }
.gc-item-sub { margin-left: auto; font-size: 11px; color: #64748b; }
.gc-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.gc-swatch { width: 26px; height: 26px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; box-sizing: border-box; }
.gc-swatch.on { border-color: #111827; box-shadow: 0 0 0 2px #fff inset; }
.gc-mode { background: rgba(255,255,255,0.14); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.gc-mode.on { background: #fbbf24; color: #111827; border-color: #fbbf24; }

/* 标注点位：平时隐藏，受理后亮起 */
.anchor-mk { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.anchor-pin { font-size: 18px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.anchor-name { margin-top: 2px; padding: 1px 6px; font-size: 11px; background: rgba(255,255,255,.92); border-radius: 8px; color: #334155; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.anchor-mk.lit .anchor-pin { font-size: 24px; animation: pulse 1.6s infinite; border-radius: 50%; background: rgba(239,68,68,.15); padding: 4px; }
.anchor-mk.lit .anchor-name { background: #ef4444; color: #fff; font-weight: 700; }
.anchor-alert { margin: 10px 0; padding: 8px 12px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; color: #991b1b; font-size: 13px; }
.anchor-alert p { margin: 4px 0 0; }
.anchor-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid #eef2f7; }
.anchor-sub { color: #64748b; font-size: 12px; }
.anchor-card { padding: 10px; margin-bottom: 10px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.anchor-card p { margin: 6px 0; font-size: 13px; }
.anchor-dot { width: 10px; height: 10px; border-radius: 50%; background: #7c3aed; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.chat-locs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* 事件受理中心 */
.task-ai-bar { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid #eef2f7; }
.task-ai-bar input { flex: 1; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 12px; }
.task-filter-bar { display: flex; gap: 6px; padding: 6px 12px; flex-wrap: wrap; border-bottom: 1px solid #eef2f7; }
.task-filter-chip { padding: 2px 10px; font-size: 12px; border: 1px solid #cbd5e1; background: #fff; border-radius: 12px; cursor: pointer; color: #475569; }
.task-filter-chip i { font-style: normal; margin-left: 4px; color: #dc2626; font-weight: 700; }
.task-filter-chip.active { background: #1b5bbf; border-color: #1b5bbf; color: #fff; }
.task-filter-chip.active i { color: #fff; }
.task-badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.task-badge { padding: 0 6px; font-size: 11px; border-radius: 8px; background: #eef2ff; color: #3730a3; }
.task-badge.red { background: #fee2e2; color: #b91c1c; font-weight: 700; }
.task-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 4px; margin-right: 4px; }
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.stat-card { padding: 8px; text-align: center; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; }
.stat-card b { display: block; font-size: 20px; color: #1e293b; }
.stat-card span { font-size: 12px; color: #64748b; }
.stat-card.warn b { color: #d97706; }
.stat-card.danger { background: #fef2f2; border-color: #fecaca; }
.stat-card.danger b { color: #dc2626; }
.stat-block { margin: 10px 0; font-size: 13px; }
.stat-bars { display: flex; gap: 6px; align-items: flex-end; margin-top: 6px; }
.stat-bar { flex: 1; text-align: center; font-size: 10px; color: #64748b; }
.stat-bar .bar-col { height: 62px; display: flex; gap: 2px; align-items: flex-end; justify-content: center; }
.stat-bar .bar-col i { width: 8px; border-radius: 2px 2px 0 0; }
.stat-bar .c1 { background: #3b82f6; }
.stat-bar .c2 { background: #22c55e; }
.stat-bar em { display: block; font-style: normal; }
