/* ==========================================================================
   成都选址点位云笔记 · 极简直角几何设计系统 (蓝 + 灰 配色规范)
   ========================================================================== */

:root {
  /* 基础灰阶背景 (Deep Charcoal & Slate) */
  --bg-dark: #0b0f19;
  --bg-surface: #0f172a;
  --bg-card: #141e33;
  --bg-card-hover: #1e293b;
  --border-subtle: #24324d;
  --border-bright: #384d72;
  
  /* 核心蓝色系 (Primary Blue Palette) */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.12);
  --primary-glow: rgba(37, 99, 235, 0.35);
  
  --blue-vibrant: #3b82f6;
  --blue-light: #60a5fa;
  --blue-ice: #bfdbfe;
  
  /* 冷灰辅色 (Cool Gray Palette) */
  --gray-light: #e2e8f0;
  --gray-mid: #94a3b8;
  --gray-dark: #64748b;
  --gray-dim: #334155;
  
  /* 强调色 */
  --accent-blue: #2563eb;
  --accent-red: #ef4444;
  
  /* 文字层级 */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Noto Sans SC", sans-serif;
  
  /* 严格直角页面规范：全组件 0 倒角 */
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --radius-full: 0px;
  
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.7);
  
  --header-height: 56px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important; /* 强制全站直角几何 */
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Header (极简直角顶栏)
   -------------------------------------------------------------------------- */
.app-header {
  height: var(--header-height);
  min-height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.brand-tag {
  font-size: 10px;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid var(--primary);
  color: var(--blue-light);
  padding: 1px 5px;
  text-transform: uppercase;
  margin-left: 6px;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  font-size: 12px;
}

.stat-label {
  color: var(--text-secondary);
}

.stat-value {
  color: #fff;
  font-weight: 700;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cloud-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  font-size: 12px;
}

.cloud-dot {
  width: 7px;
  height: 7px;
  background: var(--blue-vibrant);
  box-shadow: 0 0 6px var(--blue-vibrant);
}

.cloud-text {
  color: var(--text-secondary);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Buttons (直角极简按键)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn--secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
.btn--secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-bright);
}

.btn-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-icon:hover {
  color: #fff;
  background: var(--bg-card-hover);
  border-color: var(--border-bright);
}

.mobile-drawer-btn {
  display: none;
}

/* --------------------------------------------------------------------------
   Main Workspace
   -------------------------------------------------------------------------- */
.main-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.map-wrapper {
  flex: 1;
  position: relative;
  height: 100%;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 0;
}

/* --------------------------------------------------------------------------
   Map Search Container & GPS Locate (直角悬浮搜索)
   -------------------------------------------------------------------------- */
.map-search-container {
  position: absolute;
  top: 14px;
  left: 135px;
  width: 330px;
  max-width: calc(100vw - 155px);
  z-index: 100;
  pointer-events: auto !important;
}

.drawing-mode-active .map-search-container {
  display: none !important;
}

.map-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  padding: 6px 8px 6px 12px;
  box-shadow: var(--shadow-md);
  transition: all 0.15s ease;
  pointer-events: auto !important;
}
.map-search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-md);
}

.search-icon {
  color: var(--gray-dark);
  flex-shrink: 0;
  pointer-events: none;
}

.map-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  pointer-events: auto !important;
  user-select: auto;
}
.map-search-bar input::placeholder {
  color: var(--text-muted);
}

.search-btn-clear {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  pointer-events: auto !important;
}
.search-btn-clear:hover { color: #fff; }

.search-btn-locate {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  pointer-events: auto !important;
}
.search-btn-locate:hover {
  background: var(--primary-hover);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  max-height: 380px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  padding: 2px;
  z-index: 150;
  pointer-events: auto !important;
}
.search-dropdown.active {
  display: flex;
}

.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.15s ease;
}
.search-item:last-child {
  border-bottom: none;
}
.search-item:hover {
  background: var(--bg-card-hover);
}
.search-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.search-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-item-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-item-badge {
  font-size: 10px;
  padding: 2px 5px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--gray-mid);
  flex-shrink: 0;
  font-weight: 600;
}
.search-item-badge--sq { border-color: var(--primary); color: var(--blue-light); background: rgba(37, 99, 235, 0.15); }
.search-item-badge--mall { border-color: #475569; color: #cbd5e1; background: #1e293b; }
.search-item-badge--note { border-color: #3b82f6; color: #93c5fd; background: rgba(59, 130, 246, 0.2); }
.search-item-badge--poi { border-color: #64748b; color: #e2e8f0; background: #1e293b; }

/* Dedicated Floating GPS Locate Button (直角悬浮定位) */
.map-float-locate-btn {
  position: absolute;
  right: 18px;
  bottom: 85px;
  width: 40px;
  height: 40px;
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  color: var(--blue-vibrant);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 15;
  transition: all 0.15s ease;
}
.map-float-locate-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Floating Map Controls Container (左侧悬浮图层控制：默认折叠，鼠标悬浮自动弹出)
   -------------------------------------------------------------------------- */
.map-floating-panel-container {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 50;
  pointer-events: auto !important;
}

.floating-panel-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  color: #ffffff;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}
.floating-panel-trigger:hover,
.map-floating-panel-container:hover .floating-panel-trigger,
.map-floating-panel-container.active .floating-panel-trigger {
  border-color: var(--primary);
  color: #fff;
  background: var(--bg-card-hover);
}
.trigger-chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.map-floating-panel-container:hover .trigger-chevron,
.map-floating-panel-container.active .trigger-chevron {
  transform: rotate(180deg);
  color: #fff;
}

.map-floating-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 100;
  width: 190px;
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  padding: 10px 12px;
  box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

/* 鼠标悬停 (Hover) 或 点击激活 (Active) 时自动展开浮现 */
.map-floating-panel-container:hover .map-floating-panel,
.map-floating-panel-container.active .map-floating-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto !important;
}

.floating-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.layer-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  margin-bottom: 2px;
}
.layer-toggle-btn:hover {
  background: var(--bg-card);
  color: #fff;
}
.layer-toggle-btn.active {
  color: #fff;
  border-color: var(--border-subtle);
  background: var(--bg-card);
}
.layer-toggle-btn input[type="checkbox"] {
  display: none;
}

.toggle-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.toggle-text {
  flex: 1;
}

.toggle-badge {
  font-size: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0 4px;
  color: var(--text-muted);
}

.district-jump-grid, .radius-jump-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 4px;
}
.radius-jump-grid {
  grid-template-columns: repeat(2, 1fr);
}

.d-tag, .r-tag {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 4px 2px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.d-tag:hover, .r-tag:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-bright);
  color: #fff;
}
.d-tag.active, .r-tag.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Map Center Target Pin (地图中心定点十字图钉，随地图移动精准对准)
   -------------------------------------------------------------------------- */
.map-center-target-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%);
  z-index: 35;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  transition: opacity 0.2s ease;
}

.drawing-mode-active .map-center-target-pin {
  display: none !important;
}

.center-pin-bubble {
  pointer-events: auto !important;
  cursor: pointer;
  background: var(--bg-surface);
  border: 1px solid var(--primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  white-space: nowrap;
  animation: bubbleFloat 2.5s ease-in-out infinite alternate;
  transition: all 0.15s ease;
}
.center-pin-bubble:hover {
  background: var(--primary);
  border-color: #fff;
}
.center-pin-bubble:hover .bubble-text,
.center-pin-bubble:hover .bubble-action-hint {
  color: #ffffff;
}

.bubble-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-red);
  box-shadow: 0 0 6px var(--accent-red);
  flex-shrink: 0;
}
.bubble-text {
  font-size: 11.5px;
  font-weight: 700;
  color: #f8fafc;
}
.bubble-action-hint {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--blue-vibrant);
  background: var(--bg-card);
  padding: 1px 5px;
  border: 1px solid var(--border-subtle);
}

.center-pin-icon {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.map-center-target-pin.dragging .center-pin-icon {
  transform: translateY(-12px) scale(1.06);
}
.map-center-target-pin.dragging .center-ground-dot {
  transform: scale(0.6);
  opacity: 0.3;
}
.map-center-target-pin.dragging .center-pin-bubble {
  opacity: 0.35;
  transform: translateY(-6px);
}

.center-ground-dot {
  width: 8px;
  height: 4px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  position: absolute;
  bottom: -2px;
  transition: all 0.2s ease;
}

@keyframes bubbleFloat {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-3px); }
}


/* Modal Location Preview Banner */
.modal-location-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-red);
  padding: 8px 12px;
}
.location-preview-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-red);
  box-shadow: 0 0 6px var(--accent-red);
  flex-shrink: 0;
}
.location-preview-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.location-preview-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.location-preview-sub {
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Drawing Toolbar (直角绘制工具栏)
   -------------------------------------------------------------------------- */
.drawing-toolbar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999 !important;
  background: var(--bg-surface);
  border: 1px solid var(--primary);
  padding: 8px 14px;
  display: none;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto !important;
}
.drawing-toolbar.active {
  display: flex;
}

.drawing-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #f8fafc;
  pointer-events: none;
}
.drawing-dot {
  width: 8px;
  height: 8px;
  background: var(--blue-vibrant);
  box-shadow: 0 0 8px var(--blue-vibrant);
}

.drawing-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto !important;
  position: relative;
  z-index: 10000 !important;
}

.drawing-actions button {
  pointer-events: auto !important;
  cursor: pointer !important;
  user-select: none;
  position: relative;
  z-index: 10001 !important;
}

.btn--xs {
  padding: 4px 8px;
  font-size: 11.5px;
}

.btn--danger {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: #fca5a5;
}
.btn--danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fff;
}

/* --------------------------------------------------------------------------
   Sidebar (右侧直角工作区)
   -------------------------------------------------------------------------- */
.sidebar {
  width: 380px;
  min-width: 380px;
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.drawer-handle-bar {
  display: none;
  justify-content: center;
  padding: 6px 0;
}
.drawer-handle {
  width: 36px;
  height: 3px;
  background: var(--gray-dark);
}

.sidebar-tabs {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 10px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.02);
}
.tab-btn.active {
  color: #fff;
  background: var(--bg-surface);
  border-bottom-color: var(--primary);
}

.tab-badge {
  font-size: 11px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 1px 5px;
}
.tab-btn.active .tab-badge {
  border-color: var(--primary);
  color: var(--blue-light);
  background: rgba(37, 99, 235, 0.2);
}

.tab-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-pane {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.tab-pane.active {
  display: flex;
}

.pane-filter-bar {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-surface);
}

.filter-input-wrap {
  position: relative;
}
.filter-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-size: 12.5px;
  padding: 6px 8px;
  outline: none;
}
.filter-input:focus {
  border-color: var(--primary);
}

.filter-selects-row {
  display: flex;
  gap: 6px;
}

.filter-select {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11.5px;
  padding: 4px 6px;
  outline: none;
}
.filter-select:focus {
  border-color: var(--primary);
}

.cards-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Cards (直角卡片 · 蓝灰高质感)
   -------------------------------------------------------------------------- */
.note-card, .sq-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--primary);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.note-card:hover, .sq-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-bright);
  border-left-color: var(--blue-light);
}

.note-card-header, .sq-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.note-title, .sq-card-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.district-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--gray-mid);
  white-space: nowrap;
}

.note-body {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  word-break: break-word;
}

.note-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.note-actions {
  display: flex;
  gap: 6px;
}

.btn-card-action {
  font-size: 11px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--gray-mid);
  padding: 2px 6px;
  cursor: pointer;
}
.btn-card-action:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-card-action--danger {
  color: #fca5a5;
}
.btn-card-action--danger:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.sq-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
}

.sq-stat-highlight {
  color: var(--blue-light);
}

.sq-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.sq-card-btn {
  font-size: 11px;
  color: var(--blue-light);
  background: rgba(37, 99, 235, 0.15);
  padding: 2px 6px;
  border: 1px solid var(--primary);
  cursor: pointer;
}
.sq-card-btn:hover {
  background: var(--primary);
  color: #fff;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  text-align: center;
  gap: 8px;
}
.empty-state-title {
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Modal Dialogs (直角模态弹窗)
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-dialog--sm { max-width: 400px; }
.modal-dialog--note { max-width: 460px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.modal-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
}
.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}
.form-label.required::after {
  content: ' *';
  color: var(--accent-red);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 8px 10px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all 0.15s ease;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
}
.form-textarea {
  resize: vertical;
  min-height: 70px;
  line-height: 1.45;
}
.form-select option {
  background: var(--bg-surface);
}

.form-tip {
  font-size: 11px;
  color: var(--text-muted);
}

.coord-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.form-input--coord {
  padding: 4px 6px;
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-card);
}

.modal-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-card);
}

.color-palette {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.color-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  font-size: 11px;
  color: var(--text-secondary);
}
.color-item:hover {
  border-color: var(--border-bright);
  color: #fff;
}
.color-item input[type="radio"] {
  display: none;
}
.color-item:has(input:checked) {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.15);
  color: #fff;
}
.color-swatch {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Map Toast (底部直角状态提示)
   -------------------------------------------------------------------------- */
.map-toast {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 10;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  max-width: 450px;
}
.toast-icon {
  font-weight: 700;
  color: var(--blue-light);
}
.toast-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile Floating Add Note Button (直角悬浮记一笔) */
.mobile-fab {
  display: none;
  position: absolute;
  bottom: 24px;
  right: 18px;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 50;
}

/* --------------------------------------------------------------------------
   Mobile Responsive Rules (<= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --header-height: 50px;
  }

  .app-header {
    padding: 0 10px;
  }

  .brand-title {
    font-size: 13.5px;
  }
  .brand-tag, .header-stats, .btn-text-desktop {
    display: none;
  }

  .mobile-drawer-btn {
    display: inline-flex;
  }

  .map-search-container {
    top: 8px;
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
  }
  .locate-btn-text {
    display: none;
  }
  .map-floating-panel {
    top: 54px;
    width: 155px;
    padding: 8px;
  }
  .map-float-locate-btn {
    bottom: 80px;
    right: 14px;
  }

  .mobile-fab {
    display: flex;
  }

  .map-toast {
    bottom: 8px;
    left: 8px;
    right: 8px;
    max-width: none;
    font-size: 10.5px;
    padding: 5px 8px;
  }

  /* 移动端抽屉：直角几何底板 */
  .sidebar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    min-width: 100%;
    height: 70vh;
    border-left: none;
    border-top: 1px solid var(--border-bright);
    box-shadow: var(--shadow-lg);
    transform: translateY(100%);
    transition: transform 0.25s ease;
  }
  .sidebar.mobile-open {
    transform: translateY(0);
  }

  .drawer-handle-bar {
    display: flex;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal-dialog {
    max-width: 100%;
    border-bottom: none;
  }

  .drawing-toolbar {
    top: 8px;
    left: 8px;
    right: 8px;
    transform: none;
    flex-direction: column;
    gap: 6px;
    padding: 6px 10px;
  }
  .drawing-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* --------------------------------------------------------------------------
   TMap InfoWindow Dark Theme & Straight Edge Overrides
   -------------------------------------------------------------------------- */
.tmap-infowindow,
div[class*="tmap-infowindow"] {
  background: #0f172a !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7) !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.tmap-infowindow-content,
div[class*="tmap-infowindow-content"] {
  background: #0f172a !important;
  color: #ffffff !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.tmap-infowindow-background,
div[class*="tmap-infowindow-background"] {
  background: #0f172a !important;
  border: 1px solid #334155 !important;
  border-radius: 0 !important;
}

.tmap-infowindow-tip,
div[class*="tmap-infowindow-tip"] {
  background: #0f172a !important;
}

.tmap-infowindow-close,
div[class*="tmap-infowindow-close"] {
  color: #94a3b8 !important;
  font-size: 16px !important;
  top: 8px !important;
  right: 8px !important;
}
.tmap-infowindow-close:hover,
div[class*="tmap-infowindow-close"]:hover {
  color: #ffffff !important;
}

