/* ============================================================
   缅甸导航系统 - 样式 (移动优先)
   ============================================================ */
:root {
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-light: #14b8a6;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 2px 12px rgba(15, 23, 42, 0.12);
  --radius: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  background: var(--bg); color: var(--text); overflow: hidden;
}
#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; position: relative; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ---------- 顶部 ---------- */
#topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff; z-index: 1001; box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { font-size: 26px; }
.app-title { font-size: 17px; font-weight: 700; line-height: 1.2; }
.app-tag { font-size: 11px; opacity: .85; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.net-badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: rgba(255,255,255,.18); }
.net-badge.online { background: #22c55e; }
.net-badge.offline { background: #ef4444; }
.lang-switch { display: flex; background: rgba(255,255,255,.15); border-radius: 8px; overflow: hidden; }
.lang-btn { color: #fff; font-size: 12px; padding: 5px 9px; opacity: .7; }
.lang-btn.active { background: #fff; color: var(--teal-dark); opacity: 1; font-weight: 700; }

/* ---------- 搜索面板 ---------- */
#searchPanel {
  background: var(--panel); padding: 10px 12px 12px; z-index: 1000;
  box-shadow: var(--shadow); position: relative;
}
.field { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.field input { flex: 1; border: none; outline: none; font-size: 15px; background: transparent; color: var(--text); }
.field input::placeholder { color: #94a3b8; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.dot-from { background: #22c55e; border: 2px solid #86efac; }
.dot-to { background: #ef4444; border: 2px solid #fca5a5; }
.icon-btn { font-size: 18px; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.icon-btn:active { background: var(--border); }

.suggest { position: absolute; left: 12px; right: 12px; top: 86px; background: #fff; border-radius: 10px; box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; z-index: 2000; border: 1px solid var(--border); }
.suggest-item { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.suggest-item:last-child { border-bottom: none; }
.suggest-item:active { background: #f0fdfa; }
.suggest-item .si-name { font-size: 14px; font-weight: 600; }
.suggest-item .si-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.suggest-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; font-size: 12px; padding: 5px 10px; border-radius: 16px; background: #f1f5f9; color: var(--teal-dark); border: 1px solid var(--border); }
.chip:active { background: #ccfbf1; }

.actions { display: flex; gap: 8px; }
.btn { flex: 1; padding: 11px 0; border-radius: 10px; font-size: 15px; font-weight: 600; text-align: center; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:active { background: var(--teal-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:disabled { background: #fcd34d; opacity: .6; cursor: not-allowed; }
.btn-ghost { background: #f1f5f9; color: var(--text); }
.btn-stop { background: #ef4444; color: #fff; }
.hidden { display: none !important; }

/* ---------- 地图 ---------- */
#map { flex: 1; z-index: 0; background: #e2e8f0; }

/* ---------- 地图选点 ---------- */
.pick-bar {
  position: absolute; left: 12px; right: 12px; bottom: calc(16px + var(--safe-bottom));
  background: #fff; border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; z-index: 1500;
}
.pick-bar span { font-size: 13px; color: var(--muted); flex: 1; }
.pick-bar .btn { flex: 0 0 auto; padding: 8px 16px; font-size: 13px; }

/* ---------- 路线摘要 ---------- */
.route-bar {
  position: absolute; left: 12px; right: 12px; top: 64px; background: #fff;
  border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; z-index: 1400;
}
.route-summary { font-size: 14px; font-weight: 700; color: var(--teal-dark); }
.route-bar .btn { flex: 0 0 auto; padding: 7px 12px; font-size: 12px; }

/* ---------- 导航横幅 ---------- */
.nav-banner {
  position: absolute; left: 12px; right: 12px; top: 64px; background: #0c4a6e;
  color: #fff; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); z-index: 1400;
}
.nav-instr { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.nav-meta { font-size: 13px; opacity: .9; margin-bottom: 10px; }
.nav-banner .btn-stop { padding: 9px 0; font-size: 13px; width: 100%; }

/* ---------- 步骤列表 ---------- */
.steps-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 55%;
  background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,.15);
  z-index: 1600; display: flex; flex-direction: column;
}
.steps-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; border-bottom: 1px solid var(--border); font-weight: 700; }
.steps-list { overflow-y: auto; padding: 8px 16px calc(16px + var(--safe-bottom)); }
.step-item { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f1f5f9; align-items: flex-start; }
.step-item:last-child { border-bottom: none; }
.step-icon { width: 28px; height: 28px; border-radius: 50%; background: #f0fdfa; color: var(--teal); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; border: 1px solid #99f6e4; }
.step-text { font-size: 13px; line-height: 1.5; flex: 1; }
.step-dist { font-size: 12px; color: var(--muted); white-space: nowrap; }
.step-current { background: #ecfdf5; border-radius: 8px; padding: 4px 6px; margin: 0 -6px; }

/* ---------- 提示 ---------- */
.map-hint {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(15,23,42,.85); color: #fff; padding: 10px 18px; border-radius: 30px;
  font-size: 14px; z-index: 1300; pointer-events: none; animation: pulse 1.2s infinite;
}
@keyframes pulse { 0%,100% { opacity: .95; } 50% { opacity: .55; } }

/* ---------- 自定义标记 ---------- */
.marker-pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.marker-pin.from { background: #22c55e; }
.marker-pin.to { background: #ef4444; }
.marker-pin.current { background: #3b82f6; border-radius: 50%; }
.marker-pin.current::after { content: ""; position: absolute; inset: 6px; background: #fff; border-radius: 50%; }
.gps-ring { position: relative; }
.gps-ring::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; background: rgba(59,130,246,.25); animation: ring 1.6s infinite; }
@keyframes ring { 0% { transform: scale(.8); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- Leaflet 适配 ---------- */
.leaflet-container { font: inherit; }
.leaflet-control-attribution { font-size: 9px; background: rgba(255,255,255,.7) !important; }

/* ---------- 桌面端 ---------- */
@media (min-width: 768px) {
  #app { max-width: 480px; margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,.12); }
  body { background: #e2e8f0; }
}
