
    :root {
      --steel-50: #f7fbff;
      --steel-100: #e6eff8;
      --steel-300: #9db5cb;
      --steel-500: #3f76a7;
      --steel-700: #1d4468;
      --steel-900: #10283f;
      --brand: #1787d8;
      --brand-dark: #0d5f9c;
      --panel-bg: rgba(248, 252, 255, 0.92);
      --panel-border: #b6c7d8;
      --shadow: 0 8px 20px rgba(16, 40, 63, 0.22);
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      font-family: "Segoe UI", "Bahnschrift", "Microsoft YaHei", sans-serif;
      color: var(--steel-900);
      background:
        linear-gradient(120deg, rgba(23, 135, 216, 0.12), rgba(16, 40, 63, 0.05)),
        repeating-linear-gradient(
          0deg,
          rgba(157, 181, 203, 0.16) 0,
          rgba(157, 181, 203, 0.16) 1px,
          transparent 1px,
          transparent 28px
        ),
        repeating-linear-gradient(
          90deg,
          rgba(157, 181, 203, 0.16) 0,
          rgba(157, 181, 203, 0.16) 1px,
          transparent 1px,
          transparent 28px
        );
      min-height: 100vh;
      overflow: hidden;
      touch-action: manipulation;
      -webkit-text-size-adjust: 100%;
    }

    /* 禁止双击/长按缩放 UI 元素 */
    .panel,
    .panel * {
      touch-action: manipulation;
    }

    #map {
      position: fixed;
      inset: 0;
      z-index: 0;
    }

    .panel {
      border: 1px solid var(--panel-border);
      border-radius: 4px;
      background: var(--panel-bg);
      backdrop-filter: blur(2px);
      box-shadow: var(--shadow);
    }

    #search-panel {
      position: fixed;
      top: 12px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 1000;
      width: min(680px, calc(100vw - 20px));
      overflow: hidden;
    }

    #search-row {
      display: grid;
      grid-template-columns: 1fr auto auto auto;
      gap: 8px;
      padding: 10px;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(230, 239, 248, 0.9));
    }

    #search-input,
    .nav-input {
      width: 100%;
      border: 1px solid var(--steel-300);
      border-radius: 2px;
      background: #ffffff;
      padding: 10px;
      font-size: 16px;
      color: var(--steel-900);
      outline: none;
    }

    #search-input:focus,
    .nav-input:focus {
      border-color: var(--brand);
      box-shadow: inset 0 0 0 1px rgba(23, 135, 216, 0.2);
    }

    .btn {
      border: 1px solid var(--steel-500);
      border-radius: 2px;
      padding: 8px 12px;
      font-size: 13px;
      cursor: pointer;
      color: #fff;
      background: linear-gradient(180deg, #2a91df 0%, #1477c3 100%);
      transition: filter 0.2s ease;
      white-space: nowrap;
    }

    .btn:hover { filter: brightness(0.95); }

    .btn-ghost {
      border: 1px solid var(--steel-500);
      border-radius: 2px;
      background: #fff;
      color: var(--steel-700);
      cursor: pointer;
      padding: 8px 10px;
      font-size: 13px;
    }

    #search-results {
      max-height: 260px;
      overflow-y: auto;
      background: #fff;
      border-top: 1px solid var(--panel-border);
    }

    .result-item {
      padding: 10px 12px;
      cursor: pointer;
      border-bottom: 1px solid #eaf0f6;
    }

    .result-item:hover { background: var(--steel-50); }
    .result-name { font-size: 14px; font-weight: 700; color: var(--steel-900); }
    .result-addr { font-size: 12px; color: var(--steel-700); margin-top: 3px; }

    /* 导航输入框联想列表 */
    .nav-autocomplete-list {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      max-height: 180px;
      overflow-y: auto;
      background: #fff;
      border-top: 1px solid var(--panel-border);
      z-index: 1001;
      display: none;
    }

    .nav-autocomplete-item {
      padding: 8px 12px;
      cursor: pointer;
      border-bottom: 1px solid #eaf0f6;
      font-size: 13px;
      color: var(--steel-900);
    }

    .nav-autocomplete-item:hover {
      background: var(--steel-50);
    }

    .nav-autocomplete-item .ac-coord {
      font-size: 11px;
      color: var(--steel-300);
      margin-top: 2px;
    }

    #nav-panel {
      position: fixed;
      top: 74px;
      left: 10px;
      z-index: 1000;
      width: 340px;
      display: none;
    }

    #nav-panel.active { display: block; }

    #nav-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px;
      background: linear-gradient(180deg, rgba(29, 68, 104, 0.95), rgba(16, 40, 63, 0.95));
      color: #fff;
      font-size: 14px;
      letter-spacing: 0.3px;
    }

    #close-nav {
      background: transparent;
      border: none;
      color: #fff;
      font-size: 20px;
      line-height: 1;
      cursor: pointer;
    }

    .nav-row {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 8px;
      padding: 10px;
      background: #fff;
      border-bottom: 1px solid #edf2f8;
      overflow: visible;
    }

    .nav-actions {
      display: grid;
      gap: 8px;
      padding: 10px;
      background: #fff;
    }

    #route-info {
      font-size: 13px;
      color: var(--steel-700);
      padding: 0 10px 10px;
      display: none;
      background: #fff;
    }

    #route-info.visible { display: block; }

    #bottom-bar {
      position: fixed;
      bottom: 10px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 1000;
      display: flex;
      gap: 8px;
      padding: 8px;
    }

    #bottom-bar .btn-ghost.active {
      color: #fff;
      background: var(--steel-700);
      border-color: var(--steel-700);
    }

    /* 图层选择弹窗 */
    #layer-popup {
      position: fixed;
      bottom: 60px;
      z-index: 1001;
      display: none;
      padding: 6px 0;
      min-width: 160px;
    }

    #layer-popup.active { display: block; }

    .layer-check-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 14px;
      cursor: pointer;
      font-size: 13px;
      color: var(--steel-900);
      white-space: nowrap;
    }

    .layer-check-item:hover {
      background: var(--steel-50);
    }

    .layer-check-item input[type="checkbox"] {
      width: 16px;
      height: 16px;
      accent-color: var(--brand);
      cursor: pointer;
    }

    .layer-check-label {
      flex: 1;
    }

    @media (max-width: 768px) {
      #layer-popup {
        bottom: 56px;
        right: 8px;
      }
    }

    #loading {
      position: fixed;
      inset: 0;
      z-index: 1500;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 12px;
      background: rgba(247, 251, 255, 0.85);
      color: var(--steel-700);
      font-weight: 600;
    }

    .spinner {
      width: 34px;
      height: 34px;
      border: 3px solid #d7e3ef;
      border-top-color: var(--brand);
      border-radius: 50%;
      animation: spin 0.9s linear infinite;
    }


    .poi-label {
      display: inline-block !important;
      width: auto !important;
      height: auto !important;
      background: rgba(255, 255, 255, 0.88);
      padding: 2px 6px;
      border-radius: 3px;
      font-size: 11px;
      font-weight: 600;
      color: #10283f;
      white-space: nowrap;
      pointer-events: none;
      border: 1px solid rgba(16, 40, 63, 0.18);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
      line-height: 1;
      margin: 0;
    }

    .poi-label .leaflet-marker-icon {
      width: auto !important;
      height: auto !important;
    }

    .building-label {
      display: inline-block !important;
      width: auto !important;
      height: auto !important;
      background: rgba(255, 255, 255, 0.75);
      padding: 1px 4px;
      border-radius: 2px;
      font-size: 10px;
      font-weight: 500;
      color: #333;
      white-space: nowrap;
      pointer-events: none;
      border: 1px solid rgba(0, 0, 0, 0.1);
      line-height: 1.2;
      margin: 0;
    }

    /* POI 图片标记 */
    .poi-image-marker {
      display: flex !important;
      align-items: center;
      justify-content: center;
      width: 28px !important;
      height: 28px !important;
    }

    .poi-thumb {
      width: 28px;
      height: 28px;
      object-fit: cover;
      object-position: center;
      border-radius: 50%;
      border: 2px solid #fff;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
      cursor: pointer;
    }

    /* Popup 中的图片 */
    .popup-img {
      width: 100%;
      max-width: 280px;
      height: auto;
      border-radius: 4px;
      margin: 8px 0;
      cursor: pointer;
      object-fit: cover;
    }

    .popup-img-full {
      max-width: 100vw;
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      z-index: 2000;
      max-height: 90vh;
      border-radius: 8px;
      box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
      background: rgba(0, 0, 0, 0.85);
      padding: 4px;
    }

    .search-popup .leaflet-popup-content-wrapper {
      border-radius: 4px;
      border: 1px solid var(--panel-border);
    }

    .popup-title { font-size: 13px; font-weight: 700; }
    .popup-addr { font-size: 12px; color: var(--steel-700); margin-top: 4px; }
    .popup-nav-btn { margin-top: 8px; width: 100%; }

    @media (max-width: 768px) {
      #search-panel {
        top: 8px;
        width: calc(100vw - 12px);
      }

      #search-row {
        grid-template-columns: 1fr auto;
      }

      #locate-btn,
      #lang-toggle {
        padding: 9px 8px;
      }

      #search-btn {
        grid-column: 1 / span 2;
      }

      #nav-panel {
        left: 6px;
        right: 6px;
        width: auto;
        top: 118px;
      }

      #bottom-bar {
        width: calc(100vw - 12px);
        justify-content: space-between;
      }

      #bottom-bar .btn-ghost {
        flex: 1;
        padding: 10px 8px;
      }
    }

   /* ===== 实时导航样式 ===== */

    #live-nav-panel {
      position: fixed;
      top: 12px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 1100;
      width: min(420px, calc(100vw - 20px));
      display: none;
      overflow: hidden;
    }

    #live-nav-panel.active { display: block; }

    #live-nav-header {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 14px;
      background: linear-gradient(180deg, rgba(29, 68, 104, 0.97), rgba(16, 40, 63, 0.97));
      color: #fff;
    }

    #live-nav-icon {
      width: 40px;
      height: 40px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(255, 255, 255, 0.12);
      border-radius: 4px;
    }

    #live-nav-icon svg {
      width: 24px;
      height: 24px;
      fill: #fff;
    }

    #live-nav-info { flex: 1; }

    #live-nav-next {
      font-size: 15px;
      font-weight: 700;
      letter-spacing: 0.2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    #live-nav-distance {
      font-size: 12px;
      color: rgba(255, 255, 255, 0.75);
      margin-top: 2px;
    }

    #live-nav-close {
      background: transparent;
      border: none;
      color: #fff;
      font-size: 22px;
      cursor: pointer;
      line-height: 1;
      padding: 2px 4px;
      opacity: 0.7;
    }

    #live-nav-close:hover { opacity: 1; }

    #live-nav-progress {
      padding: 10px 14px 12px;
      background: #fff;
    }

    .nav-progress-row {
      display: flex;
      justify-content: space-between;
      font-size: 12px;
      color: var(--steel-700);
      margin-bottom: 6px;
    }

    .nav-progress-bar {
      height: 4px;
      background: var(--steel-100);
      border-radius: 2px;
      overflow: hidden;
    }

    .nav-progress-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--brand), #2eb872);
      border-radius: 2px;
      width: 0%;
      transition: width 0.5s ease;
    }

    #live-nav-steps {
      max-height: 160px;
      overflow-y: auto;
      background: #fff;
      border-top: 1px solid #edf2f8;
    }

    .nav-step {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      padding: 8px 14px;
      font-size: 13px;
      color: var(--steel-700);
      border-bottom: 1px solid #f0f4f8;
    }

    .nav-step.active {
      background: #eef5fd;
      color: var(--steel-900);
      font-weight: 600;
    }

    .nav-step.done {
      color: var(--steel-300);
    }

    .nav-step-icon {
      width: 20px;
      height: 20px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .nav-step-icon svg {
      width: 16px;
      height: 16px;
    }

    .nav-step-dist {
      margin-left: auto;
      font-size: 11px;
      color: var(--steel-300);
      white-space: nowrap;
    }

    .nav-step.active .nav-step-dist {
      color: var(--steel-500);
    }

    /* 导航中隐藏搜索面板 */
    #live-nav-panel.active ~ #search-panel {
      display: none;
    }

    /* 偏航提示 */
    #reroute-toast {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      z-index: 1200;
      padding: 12px 24px;
      background: rgba(16, 40, 63, 0.92);
      color: #fff;
      border-radius: 6px;
      font-size: 14px;
      font-weight: 600;
      display: none;
      pointer-events: none;
    }

    #reroute-toast.visible { display: block; }

    /* 到达目的地 */
    #arrival-toast {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      z-index: 1200;
      padding: 16px 32px;
      background: rgba(46, 184, 114, 0.95);
      color: #fff;
      border-radius: 8px;
      font-size: 18px;
      font-weight: 700;
      display: none;
      pointer-events: none;
      text-align: center;
    }

    #arrival-toast.visible { display: block; }

    /* 导航中用户标记 - 脉冲效果 */
    .nav-user-marker {
      position: relative;
    }

    .nav-user-pulse {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: rgba(23, 135, 216, 0.25);
      animation: nav-pulse 2s ease-out infinite;
    }

    @keyframes nav-pulse {
      0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
      100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
    }

    @media (max-width: 768px) {
      #live-nav-panel {
        top: 8px;
        width: calc(100vw - 12px);
      }

      #live-nav-steps {
        max-height: 120px;
      }
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    /* ===== 朝向箭头 ===== */
    .user-heading-icon {
      width: 32px !important;
      height: 32px !important;
    }

    .heading-arrow {
      width: 0;
      height: 0;
      border-left: 10px solid transparent;
      border-right: 10px solid transparent;
      border-bottom: 18px solid #1787d8;
      position: absolute;
      top: 50%;
      left: 50%;
      margin-left: -10px;
      margin-top: -18px;
      filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
      transition: transform 0.15s ease-out;
      transform-origin: center center;
    }

    /* ===== 用户位置 + 朝向箭头（合并） ===== */
    .user-location-icon {
      position: relative;
      width: 36px;
      height: 44px;
    }

    .user-dot {
      width: 14px;
      height: 14px;
      background: #1787d8;
      border: 2.5px solid #ffffff;
      border-radius: 50%;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
      position: absolute;
      top: 50%;
      left: 50%;
      margin-top: -7px;
      margin-left: -7px;
      z-index: 2;
    }

    .user-heading-arrow {
      position: absolute;
      top: 50%;
      left: 50%;
      width: 14px;
      height: 20px;
      margin-left: -7px;
      margin-top: -20px;
      overflow: visible;
      transition: transform 0.15s ease-out;
      transform-origin: 7px 20px;
      z-index: 1;
    }

    .user-heading-arrow svg {
      width: 14px;
      height: 20px;
      display: block;
      filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    }
  
    /* ===== 分享弹窗 ===== */
    #share-popup {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      z-index: 1200;
      display: none;
      padding: 16px;
      width: min(360px, calc(100vw - 32px));
    }

    #share-popup.active { display: block; }

    #share-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 0 12px;
      border-bottom: 1px solid var(--panel-border);
      margin-bottom: 12px;
    }

    #close-share {
      background: transparent;
      border: none;
      font-size: 20px;
      cursor: pointer;
      color: var(--steel-700);
    }

    #share-content {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    #share-url-input {
      width: 100%;
      border: 1px solid var(--steel-300);
      border-radius: 2px;
      background: #ffffff;
      padding: 8px 10px;
      font-size: 13px;
      color: var(--steel-900);
      outline: none;
    }

    /* ===== 导航面板跟随按钮 ===== */
    .live-nav-tool-btn {
      background: transparent;
      border: 1px solid rgba(255,255,255,0.4);
      color: #fff;
      border-radius: 50%;
      width: 32px;
      height: 32px;
      cursor: pointer;
      font-size: 16px;
      line-height: 30px;
      text-align: center;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .live-nav-tool-btn.active {
      background: rgba(255,255,255,0.2);
      border-color: rgba(255,255,255,0.7);
      color: #fff;
    }

    /* ===== 分享按钮 ===== */
    .popup-share-btn {
      color: black;
      margin-top: 6px;
      width: 100%;
      background: linear-gradient(180deg, rgba(157,181,203,0.3), rgba(157,181,203,0.15));
      border-color: var(--steel-300);
    }
