:root {
  --bg: #0b1120;
  --card: #131c31;
  --card2: #1b2640;
  --border: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #e3000f;
  --accent-hover: #c8000d;
  --hwy: #3b82f6;
  --nat: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  padding-bottom: calc(36px + var(--safe-bottom));
}

.hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 17, 32, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: calc(10px + var(--safe-top)) 14px 10px;
}

.topbar-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gti-badge {
  background: linear-gradient(135deg, #e3000f, #991b1b);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 5px 8px;
  border-radius: 8px;
}

.topbar h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.status-line {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.step-pill {
  font-size: 12px;
  font-weight: 700;
  color: #fca5a5;
  background: rgba(227, 0, 15, 0.14);
  padding: 4px 10px;
  border-radius: 999px;
}

.muted-small {
  font-size: 12px;
  color: var(--muted);
}

.point-box {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
}

.point-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dot-start {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid #3b82f6;
}

.dot-end {
  background: rgba(227, 0, 15, 0.2);
  color: #f87171;
  border: 1px solid #e3000f;
}

.point-input-wrap {
  flex: 1;
  display: flex;
  gap: 6px;
  min-width: 0;
}

.point-input-wrap input {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
}

.point-input-wrap input:focus {
  border-color: var(--hwy);
}

.point-input-wrap .city-input {
  width: 74px;
  flex-shrink: 0;
  text-align: center;
  font-size: 13px;
}

.mini-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.mini-btn.gps-btn {
  background: #0f766e;
}

.selected-chip {
  margin: 6px 0 2px 32px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-chip.locked {
  color: #34d399;
}

.swap-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.swap-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
}

.poi-panel {
  margin-top: 10px;
  background: #0f172a;
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 12px;
  padding: 10px;
}

.poi-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #93c5fd;
}

.close-x {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
}

.poi-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.poi-item {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.poi-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.poi-name {
  font-size: 14px;
  font-weight: 700;
}

.poi-addr {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.poi-warn {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 11.5px;
  background: rgba(245, 158, 11, 0.14);
  border-left: 3px solid var(--warn);
  color: #fde68a;
}

.poi-ok {
  margin-top: 5px;
  font-size: 11px;
  color: #6ee7b7;
}

.poi-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.poi-pick-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.poi-pick-btn.sub {
  background: #0f766e;
}

.poi-pick-btn.amap-alt {
  background: #334155;
  color: #cbd5e1;
}

.slider-box {
  margin-top: 12px;
  background: var(--card2);
  border-radius: 12px;
  padding: 10px 12px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  margin-bottom: 6px;
}

.accent-num {
  color: #fbbf24;
  font-size: 14px;
}

.slider-box input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}

.primary-btn {
  margin-top: 12px;
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #b91c1c);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.ghost-btn {
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.route-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.route-card {
  background: var(--card2);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.route-card.active {
  border-color: var(--nat);
  background: rgba(16, 185, 129, 0.08);
}

.route-card.trap {
  border-color: rgba(245, 158, 11, 0.4);
}

.route-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.route-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.prov-tag {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #334155;
  color: #e2e8f0;
}

.prov-tag.amap {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.prov-tag.baidu {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

.badge-best {
  background: #059669;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.badge-trap {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.route-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.metric-cell {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
  padding: 7px 6px;
  text-align: center;
}

.metric-cell .k {
  font-size: 10.5px;
  color: var(--muted);
}

.metric-cell .v {
  font-size: 13.5px;
  font-weight: 700;
  margin-top: 2px;
}

.route-verdict {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #cbd5e1;
}

.route-chain {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
}

.legend-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.legend-inline i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 3px;
}

.lg-hwy { background: var(--hwy); }
.lg-nat { background: var(--nat); }
.lg-pin { background: var(--accent); border-radius: 50% !important; }

.map-stage {
  position: relative;
  width: 100%;
  height: 270px;
  background: #090e1a;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 12px;
}

#routeCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.map-overlay-top {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font-size: 11.5px;
}

.map-pill {
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 999px;
  color: #f8fafc;
  backdrop-filter: blur(6px);
}

.map-overlay-bottom {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  pointer-events: none;
}

.delta-banner {
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 10px;
  text-align: center;
}

.delta-banner.neutral {
  background: rgba(30, 41, 59, 0.88);
  color: #cbd5e1;
}

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

.seg-card {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

.seg-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.seg-name {
  font-size: 13.5px;
  font-weight: 700;
}

.seg-toggle {
  display: inline-flex;
  background: #0f172a;
  border-radius: 10px;
  padding: 3px;
  border: 1px solid var(--border);
}

.seg-toggle button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
}

.seg-toggle button.active-hwy {
  background: var(--hwy);
  color: #fff;
}

.seg-toggle button.active-nat {
  background: var(--nat);
  color: #fff;
}

.seg-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #cbd5e1;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.seg-roads {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.launch-box {
  margin-top: 14px;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}

.waypoints-head {
  font-size: 12.5px;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.wp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.wp-tag {
  font-size: 11px;
  background: rgba(227, 0, 15, 0.14);
  border: 1px solid rgba(227, 0, 15, 0.35);
  color: #fecaca;
  padding: 4px 8px;
  border-radius: 999px;
}

.launch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.launch-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 12px 10px;
  border-radius: 12px;
  color: #fff;
  text-align: center;
}

.launch-btn span {
  font-size: 13.5px;
  font-weight: 700;
}

.launch-btn small {
  font-size: 10.5px;
  opacity: 0.85;
  margin-top: 3px;
}

.launch-btn.amap {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.launch-btn.baidu {
  background: linear-gradient(135deg, #0d9488, #0f766e);
}

.sub-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal {
  width: 100%;
  max-width: 460px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modal-head h3 {
  margin: 0;
  font-size: 15px;
}

.field-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 5px;
}

.modal-input {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.info-banner {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #bfdbfe;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.danger-txt {
  color: #fca5a5;
  justify-content: center;
}

.lan-box {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.toast {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 99;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

@media (max-width: 480px) {
  .route-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .launch-actions {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   阶段 2 新增样式：驾驶偏好、安全护盾、串珠吃住、追光摄影
   ========================================== */
.prefs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.pref-cell {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pref-cell label {
  font-size: 11px;
  color: var(--muted);
}

.pref-cell input,
.pref-cell select {
  background: #0f172a;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 12.5px;
  outline: none;
}

.safety-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.safety-alert {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  border-left: 4px solid var(--danger);
  background: rgba(239, 68, 68, 0.13);
  color: #fecaca;
}

.safety-alert.warning {
  border-left-color: var(--warn);
  background: rgba(245, 158, 11, 0.13);
  color: #fde68a;
}

.safety-alert b {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.safety-fix-btn {
  margin-top: 7px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.rb-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #0f172a;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.rb-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.rb-tab.active {
  background: var(--accent);
  color: #fff;
}

.corridor-list,
.photo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.city-card {
  background: var(--card2);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.city-card.rest-stop {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.city-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.city-title {
  font-size: 15px;
  font-weight: 800;
}

.city-day-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}

.city-card.rest-stop .city-day-tag {
  background: #d97706;
  color: #fff;
}

.city-stats {
  margin-top: 6px;
  font-size: 12px;
  color: #cbd5e1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.city-sun-weather {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rest-badge {
  margin-top: 7px;
  font-size: 11.5px;
  padding: 5px 9px;
  border-radius: 8px;
  display: inline-block;
}

.rest-badge.stretch {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
}

.rest-badge.suggest_rest {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.city-actions {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.city-btn {
  border: 1px solid var(--border);
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.city-btn.active-rest {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
}

.city-drawer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.disc-group h4 {
  margin: 0 0 6px;
  font-size: 12.5px;
  color: #93c5fd;
}

.disc-item {
  background: rgba(15, 23, 42, 0.7);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.disc-info {
  min-width: 0;
}

.disc-name {
  font-size: 13px;
  font-weight: 700;
}

.disc-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.disc-go {
  flex-shrink: 0;
  text-decoration: none;
  background: #2563eb;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 9px;
  border-radius: 8px;
}

.photo-card {
  background: var(--card2);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.photo-card.golden,
.photo-card.sunrise,
.photo-card.blue {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.photo-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 6px;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.photo-card.golden .photo-badge,
.photo-card.sunrise .photo-badge {
  background: rgba(245, 158, 11, 0.25);
  color: #fde68a;
}

.photo-card.blue .photo-badge {
  background: rgba(99, 102, 241, 0.28);
  color: #c7d2fe;
}

.photo-windows {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  font-size: 11px;
}

.win-pill {
  background: rgba(15, 23, 42, 0.65);
  border-radius: 8px;
  padding: 5px 6px;
  text-align: center;
  color: #cbd5e1;
}

.win-pill b {
  display: block;
  color: #fbbf24;
  margin-top: 2px;
}

.photo-advice {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #e2e8f0;
}

/* ==========================================
   阶段 3 新增样式：地图工具条、离线胶囊列表、GPS实时循迹与配对框
   ========================================== */
.map-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.map-toolbar .ghost-btn.active-gps {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #6ee7b7;
}

.map-overlay-gps {
  position: absolute;
  top: 38px;
  left: 8px;
  pointer-events: none;
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.offline-progress {
  margin-bottom: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  font-size: 12px;
}

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

.offline-item {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.offline-item .title {
  font-size: 13px;
  font-weight: 700;
}

.offline-item .sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.day-plan-bar {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.day-plan-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-tab {
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.day-tab:hover {
  border-color: #f59e0b;
}

.day-tab.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #fbbf24;
  color: #0b1120;
  font-weight: 700;
}

.day-plan-tip {
  margin-top: 7px;
  font-size: 12px;
  color: #fcd34d;
  line-height: 1.45;
}

.ghost-btn.active-radar {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fecaca;
}

.traffic-alert-box {
  margin-bottom: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.78);
  font-size: 12.5px;
  line-height: 1.5;
}

.traffic-alert-box.clear {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.1);
}

.traffic-alert-box.slow {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.12);
}

.traffic-alert-box.jam {
  border-color: rgba(239, 68, 68, 0.65);
  background: rgba(239, 68, 68, 0.14);
}

.traffic-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 5px;
}

.traffic-detour-card {
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.traffic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.traffic-switch-btn {
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.etc-sub {
  display: block;
  font-size: 10px;
  color: #94a3b8;
  font-weight: 500;
  margin-top: 1px;
}

.launch-actions.single-nav {
  grid-template-columns: 1fr;
}

.map-dual-tip {
  margin: -4px 0 12px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  color: #94a3b8;
  font-size: 11.5px;
  line-height: 1.45;
}

/* 双模式切换栏 */
.mode-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.mode-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}

.mode-tab .mode-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.mode-tab small {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.3;
}

.mode-tab.active {
  border-color: #38bdf8;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(14, 165, 233, 0.12));
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.28);
}

.mode-tab.active .mode-title {
  color: #f8fafc;
}

.mode-tab.active small {
  color: #bae6fd;
}

body.mode-city .long-only {
  display: none !important;
}

body.mode-long .city-only {
  display: none !important;
}

.hist-btn {
  background: rgba(51, 65, 85, 0.75) !important;
  padding: 0 9px !important;
}

/* 历史地址列表 */
.hist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--card2);
  border: 1px solid var(--border);
  cursor: pointer;
}

.hist-item.pinned {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.08);
}

.hist-main {
  flex: 1;
  min-width: 0;
}

.hist-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hist-addr {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hist-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.hist-act-btn {
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.65);
  color: var(--muted);
  border-radius: 7px;
  padding: 4px 7px;
  font-size: 12px;
  cursor: pointer;
}

.hist-act-btn.starred {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.5);
}

/* 避开必堵点区 */
.avoid-box {
  margin: 10px 0 12px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.avoid-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.avoid-label {
  font-size: 12px;
  font-weight: 700;
  color: #fca5a5;
  white-space: nowrap;
}

.avoid-row input {
  flex: 1;
  min-width: 0;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--text);
  font-size: 12.5px;
}

.avoid-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.avoid-chips:empty {
  display: none;
}

.avoid-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fecaca;
  font-size: 11.5px;
}

.avoid-chip button {
  background: none;
  border: none;
  color: #fca5a5;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}

/* 路况标签与百度穿行图例 */
.lg-bd { background: #a855f7; }

.traffic-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.traffic-pill.clear { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.traffic-pill.slow { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
.traffic-pill.jam { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.route-traffic-bar {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #cbd5e1;
}

.seg-toggle button.active-bd {
  background: rgba(168, 85, 247, 0.25);
  border-color: #a855f7;
  color: #e9d5ff;
}

.toolbar-select {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  padding: 6px 8px;
  cursor: pointer;
}

.city-long-hint {
  margin-bottom: 10px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #bae6fd;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
