/* 来接 · 牌面、面板、控件 */

.app {
  --card-h: 258px;
  --panel-h: 222px;
  --cover: 0;
  --a-op: 0;
  --pl: 0;
  --pw-op: 1;
  --pa-op: 0;
  --pr-op: 0;
  --nw-op: 1;
  --na-op: 0;
  --nr-op: 0;
}

/* ---------- 地图与标记 ---------- */
.map { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.markers { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.mk { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; }

.pin .disc, .flag i { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; background: var(--ink); box-shadow: 0 0 0 3px #fff, 0 3px 10px rgba(18,19,23,.32); }
.pin .disc { border-radius: 50%; }
.pin .disc::after { content: ""; position: absolute; inset: 7.5px; border-radius: 50%; background: #fff; }
.pin .halo { position: absolute; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; background: rgba(31,75,255,.16); animation: halo 2.4s var(--ease-out) infinite; }
.flag i { border-radius: 7px; }
.flag i::after { content: ""; position: absolute; inset: 7.5px; border-radius: 2px; background: #fff; }

.lbl {
  width: max-content; height: auto; padding: 6px 10px; border-radius: 9px; background: #fff; color: var(--ink);
  font-size: 13px; line-height: 17px; font-weight: 600; letter-spacing: 0;
  box-shadow: 0 0 0 .5px rgba(18,19,23,.08), 0 3px 10px rgba(18,19,23,.14);
}

.car svg { position: absolute; left: -26px; top: -16px; display: block; overflow: visible; }
.carsvg .body { fill: var(--ink); stroke: #fff; stroke-width: 2.6; paint-order: stroke; }
.carsvg .roof { fill: #3b3f4a; }
.carsvg .gl { fill: #8fa6ff; }
.carsvg .gr { fill: #59627f; }
.carsvg .hl { fill: #fff; opacity: .95; }
.carsvg .tl { fill: #ff5a4d; }
.carsvg.inv .body { fill: #fff; stroke: var(--ink); }
.carsvg.inv .roof { fill: #d9dce4; }
.carsvg.inv .gl { fill: var(--cobalt); }
.carsvg.inv .gr { fill: #8a91a8; }
.carsvg.inv .hl, .carsvg.inv .tl { display: none; }
.haz { opacity: 0; }
.haz-glow { fill: var(--amber); }
.haz-lamp { fill: var(--amber); }
.ripple { fill: none; stroke: var(--amber); stroke-width: 2; opacity: 0; }

.app[data-mode="arrived"] .haz { animation: haz 1.1s steps(1) infinite; }
.app[data-mode="arrived"].flashing .haz { animation-duration: .6s; }
.app[data-mode="arrived"].flashing .ripple { animation: ripple 1.5s var(--ease-out) infinite; }
.app[data-mode="arrived"].flashing .ripple:nth-of-type(2) { animation-delay: .5s; }
.app.still[data-mode="arrived"] .haz { animation: none !important; opacity: 1; }
.s-car .haz, .s-car .ripple { display: none; }
.app[data-mode="arrived"] .pin .halo, .app[data-mode="riding"] .pin { display: none; }
.app[data-mode="riding"] .pin-lbl { display: none; }

.scale {
  position: absolute; left: 22px; bottom: calc(var(--panel-h) + 12px + 14px); z-index: 3;
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; line-height: 14px; font-weight: 600; color: #7b818b; letter-spacing: 0;
}
.scale i { display: block; height: 6px; border: 1.5px solid #7b818b; border-top: 0; }

@keyframes halo { 0% { transform: scale(.4); opacity: 1; } 70%, 100% { transform: scale(1); opacity: 0; } }
@keyframes haz { 0% { opacity: 1; } 50% { opacity: .08; } 100% { opacity: 1; } }
@keyframes ripple { 0% { opacity: .9; transform: scale(.25); } 100% { opacity: 0; transform: scale(1.7); } }
@keyframes ping { 0% { transform: scale(.5); opacity: .9; } 80%, 100% { transform: scale(1.5); opacity: 0; } }
.ripple { transform-origin: 50% 50%; transform-box: fill-box; }

/* ---------- 上方牌面 ---------- */
.plate {
  position: absolute; z-index: 5; left: var(--gap); right: var(--gap); top: 56px; height: var(--card-h);
  border-radius: var(--r-card); background: var(--ink); color: #fff; overflow: hidden;
  box-shadow: 0 1px 2px rgba(18,19,23,.22), 0 18px 40px -10px rgba(18,19,23,.42);
}
.flood {
  position: absolute; inset: 0; background: var(--cobalt);
  clip-path: circle(calc(var(--cover) * 400px) at calc(100% - 32px) 176px);
}
.layer { position: absolute; inset: 0; padding: 18px 20px 0; }

.row-a { display: flex; align-items: center; gap: 10px; height: 24px; font-size: 16px; line-height: 24px; font-weight: 600; }
.row-a .r { margin-left: auto; font-weight: 500; color: var(--on-ink-2); }
.live { position: relative; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--cobalt-l); }
.live::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid var(--cobalt-l); opacity: 0; animation: ping 2s var(--ease-out) infinite; }
.live.amber { background: var(--amber); }
.live.amber::after { display: none; }
.app[data-mode="arrived"] .live.amber { animation: haz 1.1s steps(1) infinite; }
.app.still .live.amber { animation: none; }

.pa { opacity: var(--pa-op); }
.pw { opacity: var(--pw-op); transform: translateY(calc((1 - var(--pw-op)) * -10px)); }
.pr { opacity: var(--pr-op); transform: translateY(calc((1 - var(--pr-op)) * 10px)); }

.big { position: absolute; left: 20px; top: 40px; display: flex; align-items: baseline; }
.big b { font-variant-numeric: proportional-nums; font-size: 112px; line-height: 104px; font-weight: 700; letter-spacing: -.05em; margin-left: -.04em; }
.big em { font-style: normal; font-size: 28px; line-height: 32px; font-weight: 700; margin-left: 9px; color: rgba(255,255,255,.74); letter-spacing: 0; }
.eta { position: absolute; right: 20px; top: 85px; text-align: right; }
.eta small { display: block; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--on-ink-2); }
.eta b { display: block; font-variant-numeric: proportional-nums; margin-top: 1px; font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -.02em; }

/* 线路条：把弯路拉直 */
.strip { position: absolute; left: 20px; right: 20px; top: 158px; height: 76px; }
.strip .s-dim, .strip .s-live { position: absolute; top: 13px; height: 6px; border-radius: 3px; }
.strip .s-dim { left: 0; background: var(--ink-3); -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%); mask-image: linear-gradient(90deg, transparent, #000 22%); }
.strip .s-live { background: var(--cobalt-l); }
.strip .node { position: absolute; top: 9px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--ink); border: 3px solid #fff; }
.strip .node.passed { visibility: hidden; }
.strip .node.sq { border-radius: 4px; }
.strip .s-end { position: absolute; top: 4px; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; background: #fff; }
.strip .s-end::after { content: ""; position: absolute; inset: 7.5px; border-radius: 50%; background: var(--ink); }
.strip .s-end.sq { border-radius: 7px; }
.strip .s-end.sq::after { border-radius: 2px; }
.strip .s-start { position: absolute; top: 9px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; border: 3px solid var(--ink-3); background: var(--ink); }
.strip .s-car { position: absolute; top: 16px; width: 0; height: 0; }
.strip .s-car svg { position: absolute; left: -22px; top: -13px; }
.strip .s-dim-line { position: absolute; top: 49.5px; height: 14px; background: linear-gradient(rgba(134,160,255,.5), rgba(134,160,255,.5)) center / 100% 1px no-repeat; -webkit-mask-image: linear-gradient(90deg, #000 var(--g0, 100%), transparent var(--g0, 100%), transparent var(--g1, 100%), #000 var(--g1, 100%)); mask-image: linear-gradient(90deg, #000 var(--g0, 100%), transparent var(--g0, 100%), transparent var(--g1, 100%), #000 var(--g1, 100%)); }
.strip .s-dim-line::before, .strip .s-dim-line::after { content: ""; position: absolute; top: 0; width: 1.5px; height: 14px; background: var(--cobalt-l); }
.strip .s-dim-line::before { left: 0; }
.strip .s-dim-line::after { right: 0; }
.strip .s-label { position: absolute; top: 56px; transform: translate(-50%, -50%); padding: 0 11px; white-space: nowrap; font-size: 16px; line-height: 32px; font-weight: 600; color: #fff; }
.strip .s-label b { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-right: 3px; }

/* 车到了 */
.pa .row-a { opacity: var(--a-op); transform: translateY(calc((1 - var(--a-op)) * 12px)); }
.pa .row-a .r { color: rgba(255,255,255,.72); }
.pa .title { margin: 4px 0 0; font-size: 72px; line-height: 80px; font-weight: 700; letter-spacing: -.02em; margin-left: -2px; opacity: var(--a-op); transform: translateY(calc((1 - var(--a-op)) * 14px)); }
.bigplate { margin-top: 12px; width: 100%; opacity: clamp(0, calc(var(--pl) * 4), 1); transform: scale(calc(1.16 - var(--pl) * .16)); transform-origin: 50% 50%; filter: drop-shadow(0 calc(10px + (1 - var(--pl)) * 22px) calc(14px + (1 - var(--pl)) * 14px) rgba(6,16,96,.5)); }
.bigplate svg, .plate-s svg { display: block; width: 100%; height: auto; }
.pa .foot { margin: 14px 0 0; font-size: 16px; line-height: 22px; font-weight: 600; color: rgba(255,255,255,.82); opacity: var(--a-op); }

/* ---------- 下方面板 ---------- */
.panel {
  position: absolute; z-index: 5; left: var(--gap); right: var(--gap); bottom: var(--gap); height: var(--panel-h);
  border-radius: var(--r-card); background: var(--paper); color: var(--ink);
  box-shadow: 0 0 0 .5px rgba(18,19,23,.06), 0 1px 2px rgba(18,19,23,.08), 0 -6px 30px rgba(18,19,23,.10), 0 18px 40px -10px rgba(18,19,23,.22);
  overflow: hidden;
}
.nw { opacity: var(--nw-op); }
.na { opacity: var(--na-op); }
.nr { opacity: var(--nr-op); }
.panel .layer { padding: 20px 20px 0; }

.drv { display: flex; align-items: center; gap: 12px; height: 52px; }
.avatar { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; font-size: 21px; font-weight: 700; }
.who b { display: block; font-size: 20px; line-height: 26px; font-weight: 700; letter-spacing: 0; }
.who small { display: block; margin-top: 1px; font-size: 16px; line-height: 20px; font-weight: 500; color: var(--muted); }
.car-id { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.car-id small { font-size: 13px; line-height: 16px; font-weight: 500; color: var(--muted); }
.plate-s { display: block; width: 118px; }

.contact { display: flex; gap: 10px; margin-top: 16px; }
.field { flex: 1; min-width: 0; height: 52px; padding: 0 16px; border-radius: var(--r-ctl); background: var(--paper-2); display: flex; align-items: center; gap: 10px; text-align: left; font-size: 16px; font-weight: 500; color: var(--muted); transition: background .18s, transform .12s; }
.field svg { flex: none; color: var(--ink); }
.field:hover { background: #e9e8e2; }
.round { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; transition: transform .12s, background .18s; }
.round.ink { background: var(--ink); color: #fff; }
.round.ink:hover { background: var(--ink-3); }
.round.soft { flex: none; width: 56px; height: 56px; background: var(--paper-2); color: var(--ink); }
.round.soft:hover { background: #e9e8e2; }
button:active { transform: scale(.97); }

.links { display: flex; justify-content: space-between; align-items: center; height: 44px; margin: 8px -6px 0; }
.links button { height: 44px; padding: 0 6px; font-size: 16px; font-weight: 600; color: var(--ink); border-radius: 10px; }
.links button:hover { background: rgba(18,19,23,.05); }
.links .danger { color: var(--danger); }

/* 免费等候量尺 */
.meter-h { display: flex; justify-content: space-between; align-items: baseline; height: 32px; font-size: 16px; font-weight: 500; color: var(--muted); }
.meter-h b { font-size: 28px; line-height: 32px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; margin-left: 4px; }
.meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 12px; }
.meter i { position: relative; display: block; height: 8px; border-radius: 4px; background: var(--paper-3); overflow: hidden; }
.meter i::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--fill, 0) * 100%); background: var(--cobalt); border-radius: 4px; }

.acts { display: flex; gap: 10px; margin-top: 18px; }
.acts.two { margin-top: 14px; }
.cta, .soft { flex: 1; height: 56px; border-radius: var(--r-ctl); display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 16px; font-weight: 600; transition: background .18s, transform .12s; }
.cta { background: var(--cobalt); color: #fff; }
.cta:hover { background: var(--cobalt-d); }
.soft { background: var(--paper-2); color: var(--ink); }
.soft:hover { background: #e9e8e2; }
.cta.on { background: var(--ink); }
.cta.on svg { color: var(--amber); }

/* 行程中 */
.dest { display: flex; align-items: center; gap: 14px; height: 56px; }
.dest .sq { flex: none; position: relative; width: 22px; height: 22px; margin: 0 1px; border-radius: 7px; background: var(--ink); }
.dest .sq::after { content: ""; position: absolute; inset: 7.5px; border-radius: 2px; background: #fff; }
.fare { margin-left: auto; text-align: right; }
.fare small { display: block; font-size: 13px; line-height: 16px; font-weight: 500; color: var(--muted); }
.fare b { display: block; margin-top: 2px; font-size: 20px; line-height: 26px; font-weight: 700; letter-spacing: -.01em; }
.drv.compact { height: 56px; margin-top: 14px; border-top: .5px solid var(--line); padding-top: 14px; }
.drv.compact .avatar { width: 40px; height: 40px; font-size: 18px; }
.drv.compact .who b { font-size: 16px; line-height: 22px; font-weight: 600; }
.drv.compact .who small { font-size: 13px; line-height: 17px; }

@media (prefers-reduced-motion: reduce) {
  .live::after, .pin .halo { animation: none; }
  .app .haz, .app .live.amber { animation: none !important; opacity: 1; }
  .ripple { display: none; }
}

/* ---------- 地图路线 ---------- */
.r-done { stroke: #b6c1ea; stroke-width: 6px; vector-effect: non-scaling-stroke; }
.r-case { stroke: #fff; stroke-width: 11px; vector-effect: non-scaling-stroke; }
.r-live { stroke: var(--cobalt); stroke-width: 6.5px; vector-effect: non-scaling-stroke; }
.r-flow { stroke: rgba(255,255,255,.92); stroke-width: 2px; stroke-dasharray: 1 13; vector-effect: non-scaling-stroke; animation: flow 1.1s linear infinite; }
.r-node { fill: #fff; stroke: var(--cobalt); stroke-width: 3.5px; vector-effect: non-scaling-stroke; }
@keyframes flow { to { stroke-dashoffset: -14; } }
@media (prefers-reduced-motion: reduce) { .r-flow { animation: none; } }

.strip .s-end::before { content: ""; position: absolute; inset: -6px; border-radius: inherit; border: 1.5px solid #fff; opacity: 0; }
.app[data-mode="waiting"] .strip .s-end::before { animation: ping 2.2s var(--ease-out) infinite; }
.app[data-mode="riding"] .strip .s-end::before { display: none; }
@media (prefers-reduced-motion: reduce) { .strip .s-end::before { animation: none !important; } }

.app.ready .strip .s-label { transition: left .4s var(--ease-out); }

/* 尺：线路条下沿的刻度，一格 = 一个单位长度 */
.strip .ruler, .strip .ruler-live { position: absolute; top: 25px; height: 9px; background-repeat: repeat-x; }
.strip .ruler { left: 0; background-image: linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px); background-size: var(--tick) 5px, calc(var(--tick) * var(--major)) 9px; background-position: 0 0, 0 0; background-repeat: repeat-x; -webkit-mask-image: linear-gradient(90deg, transparent, #000 24%); mask-image: linear-gradient(90deg, transparent, #000 24%); }
.strip .ruler-live { background-image: linear-gradient(90deg, rgba(134,160,255,.8) 1px, transparent 1px), linear-gradient(90deg, rgba(134,160,255,.8) 1px, transparent 1px); background-size: var(--tick) 5px, calc(var(--tick) * var(--major)) 9px; background-repeat: repeat-x; }
@keyframes tick { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.big b.tick { animation: tick .42s var(--ease-out); }

/* 静态取景：持续循环的点缀停在好看的一帧 */
.app.still .live::after, .app.still .strip .s-end::before { animation: none; opacity: 0; }
.app.still .pin .halo { animation: none; transform: scale(.78); opacity: .9; }
.app.still .r-flow { animation: none; }
