/**
 * 控制台页样式（App 风格、弹窗、设置面板）
 */
body { -webkit-tap-highlight-color: transparent; }
.btn-touch { min-height: 48px; min-width: 48px; }
input, select, button { font-size: inherit; }

/* 安全区（刘海/横条） */
.pt-safe { padding-top: env(safe-area-inset-top, 0.75rem); }
.pb-safe { padding-bottom: env(safe-area-inset-bottom, 2rem); }

/* 设置面板：从右侧滑入，未打开时完全隐藏不占位（移动端避免内容露在首页） */
#settingsPanelOverlay.settings-overlay {
  position: fixed !important;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.5);
  display: none !important;
  align-items: stretch;
  justify-content: flex-end;
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
#settingsPanelOverlay.settings-overlay.show {
  display: flex !important;
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
}
.settings-panel {
  width: 100%; max-width: 28rem; height: 100%;
  background: #14151a;
  border-left: 1px solid #2a2d35;
  overflow-y: auto;
  display: flex; flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.3);
}
.settings-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: env(safe-area-inset-top, 1rem) 1rem 1rem 1rem;
  border-bottom: 1px solid #2a2d35;
  flex-shrink: 0;
}
.settings-panel-body {
  padding: 1.25rem 1rem 2rem;
  flex: 1;
}

#planModalOverlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 1rem; }
#planModalOverlay.show { display: flex; }
#planModal { background: #14151a; border: 1px solid #2a2d35; border-radius: 1rem; max-width: 28rem; width: 100%; max-height: 85vh; overflow: hidden; display: flex; flex-direction: column; }
#planModal h3 { margin: 0; padding: 1rem 1.25rem; font-size: 1.125rem; color: #8b9199; border-bottom: 1px solid #2a2d35; }
#planModalContent { padding: 1rem 1.25rem; overflow-y: auto; flex: 1; }
#planModalContent .plan-item { padding: 0.75rem 0; border-bottom: 1px solid #2a2d35; }
#planModalContent .plan-item:last-child { border-bottom: none; }
#planModalContent .plan-item .label { font-size: 0.9rem; color: #8b9199; margin-bottom: 0.25rem; }
#planModalContent .plan-item .addr { font-size: 1rem; color: #e6edf3; }
#planModalClose { margin: 0 1.25rem 1rem; padding: 0.75rem; border-radius: 0.75rem; background: #2a2d35; color: #e6edf3; border: none; font-size: 1rem; cursor: pointer; }

#waypointsModalOverlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 1rem; }
#waypointsModalOverlay.show { display: flex; }
#waypointsModal { background: #14151a; border: 1px solid #2a2d35; border-radius: 1rem; max-width: 28rem; width: 100%; max-height: 85vh; overflow: hidden; display: flex; flex-direction: column; padding: 1rem 1.25rem; }
#waypointsModal h3 { margin: 0 0 1rem 0; font-size: 1.125rem; color: #8b9199; }
#waypointsModalContent { overflow-y: auto; flex: 1; min-height: 2rem; }
#waypointsModalContent .waypoint-item { padding: 0.5rem 0; border-bottom: 1px solid #2a2d35; font-size: 1rem; color: #e6edf3; }
#waypointsModalContent .waypoint-item:last-child { border-bottom: none; }
#waypointsModal .voice-btn.listening { color: #ef4444; border-color: #ef4444; animation: voice-pulse 0.8s ease-in-out infinite; }

#addPassengerModalOverlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 1rem; }
#addPassengerModalOverlay.show { display: flex; }
#addPassengerModal { max-height: 85vh; overflow: auto; }

#editPassengerModalOverlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 1rem; }
#editPassengerModalOverlay.show { display: flex; }
#editPassengerModal { background: #14151a; border: 1px solid #2a2d35; border-radius: 1rem; max-width: 28rem; width: 100%; }
#editPassengerModal h3 { margin: 0; padding: 1rem 1.25rem; font-size: 1.125rem; color: #8b9199; border-bottom: 1px solid #2a2d35; }
#editPassengerModal .edit-body { padding: 1rem 1.25rem; }
#editPassengerModal .edit-body label { display: block; font-size: 0.9rem; color: #8b9199; margin-bottom: 0.25rem; }
#editPassengerModal .edit-body .input-with-voice { margin-bottom: 1rem; }
#editPassengerModal .edit-body .input-with-voice:last-of-type { margin-bottom: 0; }
#editPassengerModal .edit-body input { width: 100%; min-width: 0; padding: 0.6rem 0.75rem; border-radius: 0.5rem; border: 1px solid #2a2d35; background: #0c0c0f; color: #e6edf3; }
#editPassengerModal .edit-body .voice-btn { padding: 0.6rem 0.75rem; border-radius: 0.5rem; border: 1px solid #2a2d35; background: #0c0c0f; color: #8b9199; cursor: pointer; font-size: 1.1rem; }
#editPassengerModal .edit-body .voice-btn:hover { color: #3b82f6; border-color: #3b82f6; }
#editPassengerModal .edit-body .voice-btn.listening { color: #ef4444; border-color: #ef4444; animation: voice-pulse 0.8s ease-in-out infinite; }
@keyframes voice-pulse { 50% { opacity: 0.7; } }
.voice-btn { min-width: 48px; min-height: 48px; }

.driver-loc-edit-overlay.show { display: flex !important; }

/* 我的位置卡片：整体缩小字体，更紧凑美观 */
.driver-loc-card { font-size: 0.9375rem; }
.driver-loc-card__title { font-size: 0.9rem; }
.driver-loc-card__input { font-size: 0.9rem; }
.driver-loc-card__status { font-size: 0.8125rem; }
#driverLocCard .voice-btn { min-width: 44px; min-height: 44px; font-size: 1rem; }
#driverLocCard .btn-touch { font-size: 0.875rem; }

/* 乘客卡片：强制四行展示（1.号客 2.起点 3.终点 4.操作按钮） */
.passenger-card { display: flex; flex-direction: column; gap: 0.5rem; }
.passenger-card__row { display: block; width: 100%; box-sizing: border-box; }
.passenger-card__actions { margin-top: 0.25rem; }

/* 主内容区：相对定位以便地图视图绝对铺满 */
#appMain { position: relative; }
.app-view.hidden { display: none !important; }
#viewMap.app-view { position: absolute; inset: 0; background: #0c0c0f; min-height: 50vh; }
#viewMap.app-view .w-full { height: 100%; min-height: 50vh; }
/* 底部留出与 appMain 一致的 pb-20，滚动条到底部导航栏上方为止 */
#viewSetup.app-view {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 5rem;
  background: #0c0c0f;
}
#viewSetup.app-view iframe { height: 100%; min-height: 0; }
#viewSettings { overflow-y: auto; padding-bottom: 2rem; background: #0c0c0f; min-height: 100%; }
#viewSettings .settings-panel { max-width: 100%; width: 100%; height: auto; min-height: 0; border-left: none; box-shadow: none; background: transparent; }
#viewSettings .settings-panel-header { border-radius: 0; border-bottom-color: #2a2d35; }
#viewSettings .settings-panel-body { padding: 1rem 1.25rem 2rem; }

/* 底部导航栏（App 风格）：移动端可点区域与快速响应 */
.z-1000 { z-index: 1000; }
#bottomNav .nav-tab {
  transition: color 0.15s, border-color 0.15s;
  touch-action: manipulation;
  cursor: pointer;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
#bottomNav .nav-tab.active { color: var(--tw-color-accent, #3b82f6); border-top-color: var(--tw-color-accent, #3b82f6); }
#bottomNav .nav-tab:not(.active) { color: #8b9199; border-top-color: transparent; }
#bottomNav .nav-tab--loading { opacity: 0.7; pointer-events: none; }
#bottomNav.bottom-nav-hidden { display: none !important; }
#appMain.map-fullscreen { padding-bottom: 0 !important; }
.app-header-hidden { display: none !important; }

#editPassengerModal .edit-actions { display: flex; gap: 0.75rem; padding: 0 1.25rem 1rem; }
#editPassengerModal .edit-actions button { flex: 1; padding: 0.75rem; border-radius: 0.75rem; font-size: 1rem; cursor: pointer; border: none; }
#editPassengerModalCancel { background: #2a2d35; color: #e6edf3; }
#editPassengerModalSave { background: #3b82f6; color: #fff; font-weight: 600; }
