/* ============================================================
   AR NAV · 极简科技风骑行导航样式（紧凑版）
   纯黑背景 = AR 透明 · 青色荧光 = 高对比度
   ============================================================ */

/* ---------- 基础重置 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000000;
  color: #00ffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Microsoft YaHei", sans-serif;
  touch-action: none;
  position: relative;
}

/* ---------- 左上角迷你3D地图 ---------- */
.mini-map {
  position: absolute;
  top: 1.5vh;
  left: 1.5vh;
  width: 18vw;
  height: 18vw;
  min-width: 100px;
  min-height: 100px;
  max-width: 180px;
  max-height: 180px;
  z-index: 20;
  background: rgba(0, 20, 30, 0.45);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 1.5vh;
  overflow: hidden;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.15);
}

.mini-map canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.mini-map-info {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2vw;
  color: rgba(0, 255, 255, 0.8);
  text-shadow: 0 0 4px rgba(0, 255, 255, 0.8);
  white-space: nowrap;
  pointer-events: none;
}

/* ============================================================
   3D 场景比例尺滑条（显示在 mini-map 下方 / 与 mini-map 同步缩放）
   ============================================================ */
.scale-slider {
  position: absolute;
  top: calc(1.5vh + 180px + 8px);
  left: 1.5vh;
  width: 180px;
  z-index: 21;
  background: rgba(0, 20, 30, 0.6);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 1.5vh;
  padding: 8px 12px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.15);
}

.scale-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.scale-slider-label {
  font-size: 12px;
  color: rgba(0, 255, 255, 0.8);
  text-shadow: 0 0 4px rgba(0, 255, 255, 0.6);
  letter-spacing: 1px;
}

.scale-slider-value {
  font-size: 12px;
  color: #fff;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  text-shadow: 0 0 6px rgba(0, 255, 255, 0.8);
}

.scale-range {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(
    to right,
    rgba(0, 255, 255, 0.9) 0%,
    rgba(0, 255, 255, 0.9) 33%,
    rgba(0, 255, 255, 0.25) 33%,
    rgba(0, 255, 255, 0.25) 100%
  );
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  pointer-events: auto;
}

.scale-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #00ffff;
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.9);
  cursor: pointer;
}

.scale-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #00ffff;
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.9);
  cursor: pointer;
}

/* ---------- 导航信息层 ---------- */
.nav-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  pointer-events: none;
}

/* ============================================================
   顶部状态栏（靠右显示，因为左上角已被迷你地图占用）
   ============================================================ */
.status-bar {
  position: absolute;
  top: 1.5vh;
  right: 2vw;
  display: flex;
  gap: 2.5vw;
  padding: 1vh 2.5vw;
  background: rgba(0, 20, 30, 0.45);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 1.5vh;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.status-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3vh;
  min-width: 14vw;
}

.status-label {
  font-size: 2vw;
  color: rgba(0, 255, 255, 0.55);
  letter-spacing: 0.15em;
}

.status-value {
  font-size: 2.8vw;
  color: #00ffff;
  font-weight: 500;
  text-shadow: 0 0 6px rgba(0, 255, 255, 0.7);
}

/* 指南针 */
.status-compass {
  min-width: 12vw;
}

.compass-arrow {
  width: 6vw;
  height: 8vw;
  min-width: 40px;
  min-height: 55px;
  max-width: 80px;
  max-height: 110px;
  color: #00ff88;
  display: inline-block;
  filter:
    drop-shadow(0 0 5px rgba(0, 255, 136, 0.8))
    drop-shadow(0 0 12px rgba(0, 255, 136, 0.5));
  transform-origin: center center;
  /* 不使用 CSS transition：用 JS rAF 平滑，避免与高频设备事件冲突 */
  vertical-align: middle;
}

.compass-arrow svg {
  width: 100%;
  height: 100%;
  display: block;
}

.compass-text {
  font-size: 2.2vw;
  color: #00ff88;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-shadow: 0 0 6px rgba(0, 255, 136, 0.7);
}

/* ============================================================
   ★ 中央 3D 导航层（原大箭头容器已删除，改由 Scene3D 画布接管）
   这里保留的 .center-display 仅作为布局占位。
   ============================================================ */
.center-display {
  position: absolute;
  top: 22vh;
  left: 50%;
  transform: translateX(-50%);
  width: 60vw;
  height: 35vh;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;   /* 3D 场景不遮挡点击 */
}

/* ★ 旧版本的 DOM 大箭头 / 距离 / 转弯提示 / 进度条——已由 Scene3D 接管 ★
   .big-arrow-container / .big-arrow / .arrow-distance / .arrow-hint /
   .turn-indicator / .turn-icon / .turn-text / .route-progress-bar /
   .route-progress-fill
   ↓ 样式保留但不再生效（相关 DOM 已从 index.html 中删除）
.big-arrow-container { ... }
.big-arrow { ... }
...
*/

/* ============================================================
   路线概览卡片（保留）
   ============================================================ */
.route-summary {
  position: absolute;
  bottom: 25vh;
  left: 50%;
  transform: translateX(-50%);
  width: 85vw;
  max-width: 400px;
  background: rgba(0, 20, 30, 0.85);
  border: 1px solid rgba(0, 255, 255, 0.4);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 255, 255, 0.15);
  z-index: 30;
}

.route-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

.route-summary-title {
  font-size: 14px;
  font-weight: 600;
  color: #00ffff;
  letter-spacing: 0.1em;
}

.route-summary-close {
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(0, 255, 255, 0.1);
  color: #00ffff;
  font-size: 18px;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.route-summary-close:hover {
  background: rgba(0, 255, 255, 0.3);
}

.route-summary-content {
  padding: 12px 16px;
  max-height: 300px;
  overflow-y: auto;
  font-size: 13px;
  color: rgba(0, 255, 255, 0.9);
  line-height: 1.6;
}

/* ============================================================
   底部信息面板
   ============================================================ */
.bottom-panel {
  position: absolute;
  bottom: 1.5vh;
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 1vh;
}

/* ---- 主要信息卡 ---- */
.info-card {
  background: rgba(0, 20, 30, 0.5);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 1.5vh;
  padding: 1.5vh 2.5vw;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 0 20px rgba(0, 255, 255, 0.05),
    0 0 15px rgba(0, 255, 255, 0.1);
}

.info-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 1.5vw;
}

.info-row + .info-row {
  margin-top: 1vh;
  padding-top: 1vh;
  border-top: 1px solid rgba(0, 255, 255, 0.15);
}

.info-item {
  display: flex;
  align-items: center;
  gap: 1.5vw;
  flex: 1;
}

.info-item.small .info-icon {
  font-size: 3.5vw;
}

.info-item.small .info-value {
  font-size: 2.5vw;
}

.info-item.small .info-label {
  font-size: 1.8vw;
}

.info-icon {
  font-size: 5vw;
  line-height: 1;
  text-shadow: 0 0 6px rgba(0, 255, 255, 0.5);
}

.info-content {
  display: flex;
  flex-direction: column;
  gap: 0.3vh;
}

.info-label {
  font-size: 2vw;
  color: rgba(0, 255, 255, 0.55);
  letter-spacing: 0.15em;
}

.info-value {
  font-size: 3.8vw;
  color: #00ffff;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
  line-height: 1.1;
}

/* ---- 次要信息卡 ---- */
.info-secondary {
  padding: 1.2vh 2vw;
  background: rgba(0, 20, 30, 0.35);
}

/* ============================================================
   语音提示浮动（更柔和、自然的动效）
   ============================================================ */
.voice-hint {
  position: absolute;
  top: 13vh;
  left: 50%;
  transform: translateX(-50%);
  padding: 1.2vh 5vw;
  background: rgba(0, 15, 25, 0.78);
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 50px;
  color: #00ffff;
  font-size: 3vw;
  letter-spacing: 0.12em;
  font-weight: 500;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px rgba(0, 255, 255, 0.12), 0 0 40px rgba(0, 255, 255, 0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  white-space: nowrap;
}

.voice-hint.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   传感器状态指示点
   ============================================================ */
.sensor-status {
  position: absolute;
  top: 1.5vh;
  right: -5.5vw;
  display: none;
}

.sensor-dot {
  width: 1.5vw;
  height: 1.5vw;
  border-radius: 50%;
  background: #ff4444;
  box-shadow: 0 0 5px rgba(255, 68, 68, 0.7);
  transition: all 0.3s;
  margin-bottom: 0.8vh;
}

.sensor-dot.active {
  background: #00ff88;
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.8);
  animation: sensor-blink 2s ease-in-out infinite;
}

@keyframes sensor-blink {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}

/* ============================================================
   初始化提示层
   ============================================================ */
.init-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.init-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.init-content {
  width: 85vw;
  max-width: 500px;
  text-align: center;
}

.init-title {
  font-size: 12vw;
  color: #00ffff;
  font-weight: 200;
  letter-spacing: 0.3em;
  text-shadow:
    0 0 15px rgba(0, 255, 255, 0.6),
    0 0 30px rgba(0, 255, 255, 0.4);
  margin-bottom: 1vh;
}

.init-subtitle {
  font-size: 3vw;
  color: rgba(0, 255, 255, 0.5);
  letter-spacing: 0.3em;
  margin-bottom: 6vh;
}

.init-step {
  margin: 3vh 0;
}

.start-btn {
  font-size: 4vw;
  padding: 2vh 8vw;
  background: rgba(0, 255, 255, 0.1);
  color: #00ffff;
  border: 2px solid rgba(0, 255, 255, 0.5);
  border-radius: 1.5vh;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.15em;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.7);
  transition: all 0.25s;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

.start-btn:hover,
.start-btn:active {
  background: rgba(0, 255, 255, 0.2);
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.4);
  transform: scale(1.02);
}

.init-hint {
  font-size: 2.5vw;
  color: rgba(0, 255, 255, 0.35);
  margin-top: 5vh;
  letter-spacing: 0.1em;
}

/* 目的地输入 */
.destination-input {
  margin-top: 4vh;
  display: flex;
  flex-direction: column;
  gap: 1.5vh;
  align-items: center;
}

.dest-input {
  width: 70vw;
  max-width: 400px;
  padding: 1.5vh 3vw;
  font-size: 3.5vw;
  background: rgba(0, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 255, 0.4);
  border-radius: 1.2vh;
  color: #00ffff;
  text-align: center;
  font-family: inherit;
  outline: none;
  caret-color: #00ffff;
}

.dest-input::placeholder {
  color: rgba(0, 255, 255, 0.3);
}

.dest-input:focus {
  border-color: #00ffff;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.3);
}

.dest-btn {
  font-size: 3.5vw;
  padding: 1.3vh 6vw;
  background: rgba(0, 255, 136, 0.1);
  color: #00ff88;
  border: 1px solid rgba(0, 255, 136, 0.5);
  border-radius: 1.2vh;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.15em;
  text-shadow: 0 0 6px rgba(0, 255, 136, 0.7);
  transition: all 0.2s;
}

.dest-btn:hover,
.dest-btn:active {
  background: rgba(0, 255, 136, 0.2);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

/* ---- POI 搜索建议下拉列表 ---- */
.poi-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 50vh;
  overflow-y: auto;
  background: rgba(0, 20, 30, 0.92);
  border: 1px solid rgba(0, 255, 255, 0.4);
  border-radius: 1.2vh;
  z-index: 10;
  display: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 20px rgba(0, 255, 255, 0.2);
}

.poi-suggestions.show {
  display: block;
}

.poi-item {
  padding: 1.5vh 3vw;
  border-bottom: 1px solid rgba(0, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2vw;
}

.poi-item:last-child {
  border-bottom: none;
}

.poi-item:hover,
.poi-item:active {
  background: rgba(0, 255, 255, 0.15);
}

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

.poi-item-name {
  font-size: 3.2vw;
  color: #00ffff;
  text-shadow: 0 0 4px rgba(0, 255, 255, 0.4);
  margin-bottom: 0.5vh;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poi-item-address {
  font-size: 2.4vw;
  color: rgba(0, 255, 255, 0.55);
  letter-spacing: 0.05em;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poi-item-distance {
  flex-shrink: 0;
  font-size: 2.6vw;
  color: rgba(255, 200, 80, 0.95);
  text-shadow: 0 0 4px rgba(255, 200, 80, 0.4);
  letter-spacing: 0.03em;
  font-weight: 600;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

/* ---- 调试模式：迷你地图放大 + 鼠标交互 ---- */
.mini-map.debug {
  width: 40vw !important;
  height: 40vw !important;
  min-width: 300px !important;
  min-height: 300px !important;
  max-width: 600px !important;
  max-height: 600px !important;
  border: 2px solid #ffcc00 !important;
  box-shadow: 0 0 40px rgba(255, 204, 0, 0.4), 0 0 80px rgba(255, 204, 0, 0.15) !important;
  transition: width 0.35s, height 0.35s, box-shadow 0.3s !important;
  cursor: crosshair !important;
  z-index: 100 !important;
}

.mini-map-debug-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  background: rgba(255, 204, 0, 0.92);
  color: #000;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.05em;
  z-index: 2;
  pointer-events: none;
}

/* ---- iOS 风格调试模式开关 ---- */
.debug-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 200;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}

.debug-toggle-label {
  font-size: 11px;
  color: rgba(0, 255, 255, 0.6);
  letter-spacing: 0.06em;
  transition: color 0.3s;
}

.debug-switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.debug-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.debug-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.debug-switch-track::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55), box-shadow 0.3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

.debug-switch input:checked + .debug-switch-track {
  background: rgba(255, 204, 0, 0.75);
  border-color: rgba(255, 204, 0, 0.9);
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.4);
}

.debug-switch input:checked + .debug-switch-track::after {
  transform: translateX(18px);
  box-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

body.debug-mode .debug-toggle-label {
  color: #ffcc00;
}

/* 横屏模式下按钮样式微调 */
@media (orientation: landscape) {
  .debug-toggle-label { font-size: 10px; }
  .debug-switch { width: 40px; height: 24px; }
  .debug-switch-track { border-radius: 12px; }
  .debug-switch-track::after { width: 18px; height: 18px; }
  .debug-switch input:checked + .debug-switch-track::after { transform: translateX(16px); }
}
/* ============================================================
   横屏适配（AR眼镜 / 大屏）
   ============================================================ */
@media (orientation: landscape) {

  .mini-map {
    width: 12vw;
    height: 12vw;
    min-width: 80px;
    min-height: 80px;
    max-width: 140px;
    max-height: 140px;
  }

  .mini-map-info { font-size: 1.2vw; }
  .status-bar {
    top: 2vh;
    gap: 1.8vw;
    padding: 0.8vh 2vw;
  }

  .status-label { font-size: 1.2vw; }
  .status-value { font-size: 1.6vw; }
  .compass-arrow { width: 4.5vw; height: 6vw; min-width: 28px; min-height: 38px; max-width: 55px; max-height: 75px; }
  .compass-text  { font-size: 1.4vw; }

  .center-display {
    top: 18vh;
    width: 50vw;
    height: 40vh;
  }

  /* 旧 DOM 箭头——已由 Scene3D 替代（保留注释占位，便于回滚）
  .big-arrow { width: 22vw; height: 28vh; ... }
  .arrow-distance { font-size: 3.5vw; }
  .arrow-hint { font-size: 2.5vw; }
  */

  .bottom-panel {
    width: 70vw;
    gap: 0.8vh;
    bottom: 2vh;
  }

  .info-card { padding: 1.2vh 2vw; }
  .info-row { gap: 1vw; }
  .info-icon { font-size: 3vw; }
  .info-label { font-size: 1.3vw; }
  .info-value { font-size: 2.4vw; }
  .info-item.small .info-icon { font-size: 2.2vw; }
  .info-item.small .info-value { font-size: 1.6vw; }
  .info-item.small .info-label { font-size: 1.1vw; }

  .voice-hint {
    top: 10vh;
    font-size: 1.8vw;
    padding: 0.8vh 2.5vw;
  }

  .init-title { font-size: 7vw; }
  .init-subtitle { font-size: 1.8vw; margin-bottom: 4vh; }
  .start-btn {
    font-size: 2.2vw;
    padding: 1.5vh 5vw;
  }
  .init-hint { font-size: 1.5vw; margin-top: 3vh; }

  .dest-input {
    width: 40vw;
    padding: 1vh 2vw;
    font-size: 2vw;
  }
  .dest-btn {
    font-size: 2vw;
    padding: 1vh 4vw;
  }

  .sensor-dot {
    width: 1vw;
    height: 1vw;
  }
}

/* ============================================================
   工具类
   ============================================================ */
.pointer-events-auto {
  pointer-events: auto;
}

.pointer-events-none {
  pointer-events: none;
}

/* ============================================================
   ★ 新增：Three.js 3D 场景（发光箭头 + 霓虹路线）★
   全视口透明覆盖层，Three.js 在其上绘制霓虹几何体
   ============================================================ */
.scene3d-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  pointer-events: none;   /* 不遮挡下层 UI 的点击 */
  z-index: 5;              /* 在 mini-map / status-bar 之下，背景之上 */
  background: transparent;
}

/* ============================================================
   ★ 新增：顶部右侧操作按钮组（保存路线 / 历史路线）★
   ============================================================ */
.action-bar {
  position: absolute;
  top: 1.5vh;
  right: 1.5vh;
  display: flex;
  flex-direction: column;
  gap: 0.8vh;
  z-index: 25;
}

.action-btn {
  background: rgba(0, 30, 45, 0.55);
  color: #00ffff;
  border: 1px solid rgba(0, 255, 255, 0.4);
  padding: 0.8vh 1.5vh;
  font-size: 13px;
  font-family: inherit;
  border-radius: 1vh;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
  user-select: none;
}

.action-btn:hover {
  background: rgba(0, 60, 90, 0.7);
  border-color: rgba(0, 255, 255, 0.85);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.35);
  color: #ffffff;
}

.action-btn:active {
  transform: scale(0.96);
}

/* ============================================================
   ★ 新增：历史路线面板（右侧滑出卡片）★
   ============================================================ */
.history-panel {
  position: absolute;
  top: 10vh;
  right: 1.5vh;
  width: 320px;
  max-width: 85vw;
  max-height: 70vh;
  z-index: 40;
  background: rgba(0, 15, 25, 0.9);
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 1.5vh;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.25),
              0 8px 32px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: historyPanelIn 0.3s ease-out;
}

.history-panel.hidden {
  display: none;
}

@keyframes historyPanelIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.history-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2vh 1.8vh;
  border-bottom: 1px solid rgba(0, 255, 255, 0.25);
}

.history-panel-title {
  font-size: 15px;
  font-weight: 600;
  color: #00ffff;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}

.history-close-btn {
  background: transparent;
  border: none;
  color: #00ffff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.8;
  transition: all 0.15s ease;
}

.history-close-btn:hover {
  opacity: 1;
  color: #ffffff;
}

.history-empty {
  padding: 2.5vh 1.8vh;
  text-align: center;
  color: rgba(0, 255, 255, 0.6);
  font-size: 13px;
  line-height: 1.6;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.8vh 0;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2vh 1.8vh;
  gap: 1vh;
  border-bottom: 1px solid rgba(0, 255, 255, 0.1);
  transition: background 0.15s ease;
}

.history-item:last-child {
  border-bottom: none;
}

.history-item:hover {
  background: rgba(0, 255, 255, 0.08);
}

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

.history-item-title {
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.history-item-meta {
  font-size: 11px;
  color: rgba(0, 255, 255, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.history-btn {
  background: rgba(0, 40, 60, 0.6);
  color: #00ffff;
  border: 1px solid rgba(0, 255, 255, 0.3);
  width: 32px;
  height: 32px;
  font-size: 14px;
  line-height: 1;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-btn:hover {
  background: rgba(0, 60, 90, 0.8);
  border-color: rgba(0, 255, 255, 0.7);
  transform: scale(1.08);
  color: #ffffff;
}

.history-btn-preview:hover { box-shadow: 0 0 12px rgba(0, 255, 255, 0.4); }
.history-btn-export:hover  { box-shadow: 0 0 12px rgba(0, 255, 255, 0.4); }
.history-btn-delete:hover  { box-shadow: 0 0 12px rgba(255, 80, 80, 0.5); border-color: rgba(255, 80, 80, 0.6); color: #ff8888; }

.history-panel-footer {
  padding: 1vh 1.8vh;
  border-top: 1px solid rgba(0, 255, 255, 0.2);
  text-align: center;
  color: rgba(0, 255, 255, 0.5);
  font-size: 11px;
}

/* 横屏适配：历史路线面板 & 操作按钮 */
@media (orientation: landscape) {
  .action-btn {
    font-size: 11px;
    padding: 0.6vh 1.2vh;
  }
  .history-panel {
    width: 280px;
    top: 8vh;
  }
  .history-panel-title { font-size: 13px; }
  .history-item-title { font-size: 12px; }
  .history-item-meta  { font-size: 10px; }
  .history-btn { width: 28px; height: 28px; font-size: 12px; }
}

/* 通用 hidden 类（与现有样式兼容） */
.hidden {
  display: none !important;
}

