/* ============================================================
 * 单路行驶数据仪表盘（2026-10-15；views/road_track.php）
 * 2026-10-15 晚改版：白底黑字（与站点亮色风格一致）。
 * 四角：左上视频 / 左下卫星影像 / 右上排名榜 / 右下速度海拔曲线。
 * 注意：.rank-vplayer/.rank-ppbtn/.rank-pause-frame 样式必须自带——
 *      本页不引 rank-common.css，缺了它们 15s 自动暂停后播放键会跑位、
 *      暂停静图会按原始尺寸撑破布局（表现为"黑屏"/无法续播）。
 * ============================================================ */
.rt-wrap {
    max-width: 1120px;                 /* 2026-10-15 晚：整体收窄（老麦要求缩小宽度） */
    margin: 10px auto 24px;            /* 居中 */
    background: #f6f8fb;
    border: 1px solid #e5e9f0;
    border-radius: 14px;
    padding: 14px 16px 16px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, .08);
    /* 2026-10-16 与 result() 页一致：宝马字体 bmwTypeNext（中文回退 Noto Sans SC/微软雅黑） */
    font-family: 'bmwTypeNext', 'Noto Sans SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
}

/* ---- 顶栏 ---- */
.rt-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.rt-tb-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rt-live {
    display: inline-flex; align-items: center; gap: 5px;
    background: #e60012; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 1px;
    border-radius: 5px; padding: 3px 8px;
}
.rt-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: rtBlink 1.4s infinite; }
@keyframes rtBlink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.rt-pagename { font-size: 19px; font-weight: 800; color: #0f172a; letter-spacing: .5px; }
.rt-roadtitle { font-size: 12.5px; color: #64748b; }
.rt-tb-right { font-size: 12px; color: #334155; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px 12px; max-width: 100%; box-shadow: 0 1px 3px rgba(15,23,42,.05); }

/* ---- 2×2 卡片网格（2026-10-15 晚：卡片加高，排行 TOP10 一览无滚动） ---- */
.rt-grid {
    display: grid;
    grid-template-columns: 1.08fr 1fr;
    grid-template-rows: minmax(420px, 44vh) minmax(420px, 44vh);
    grid-template-areas: "video rank" "map chart";
    gap: 12px;
}
.rt-area-video { grid-area: video; }
.rt-area-rank  { grid-area: rank; }
.rt-area-map   { grid-area: map; }
.rt-area-chart { grid-area: chart; }

.rt-card {
    background: #ffffff;
    border: 1px solid #e5e9f0;
    border-radius: 10px;
    display: flex; flex-direction: column;
    overflow: hidden;
    min-width: 0;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .06);
}
.rt-card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #eef1f6;
    background: #fafbfc;
    flex: none;
}
.rt-card-title { font-size: 14px; font-weight: 700; color: #0f172a; letter-spacing: .5px; }
.rt-card-title::before { content: ""; display: inline-block; width: 3px; height: 13px; background: #f59e0b; border-radius: 2px; margin-right: 7px; vertical-align: -1px; }
.rt-card-note { font-size: 12px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- 左上：视频（含播放器必需样式，见文件头注释） ---- */
.rt-video-box { position: relative; flex: 1; min-height: 0; background: #000; }
.rank-v-slot { position: relative; line-height: 0; width: 100%; height: 100%; }
.rank-vplayer { position: relative; line-height: 0; width: 100%; height: 100%; }
.rank-vplayer video { width: 100%; height: 100%; display: block; background: #000; object-fit: cover; }
/* 15s 自动暂停后的续播键：绝对居中、置于 HUD 之上，保证可见可点 */
.rank-ppbtn {
    position: absolute; left: 50%; top: 50%; z-index: 20;
    transform: translate(-50%, -50%);
    width: 56px; height: 56px; padding: 0; border: none; border-radius: 50%;
    cursor: pointer; text-align: center;
    background: rgba(15, 23, 42, .55); color: #fff;
    font-size: 20px; line-height: 54px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .35);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.rank-ppbtn:hover { background: rgba(15, 23, 42, .78); transform: translate(-50%, -50%) scale(1.07); }
/* 暂停静图：全覆盖，避免暂停后黑屏/破版 */
.rank-pause-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; display: none; }
.rank-v-slot .rank-v-loading {
    position: absolute; inset: 0; z-index: 5;
    display: flex; align-items: center; justify-content: center;
    color: #94a3b8; font-size: 12.5px; background: #0b1118;
}
.rank-v-slot .rank-empty {
    position: absolute; inset: 0; z-index: 6;
    display: flex; align-items: center; justify-content: center;
    color: #94a3b8; font-size: 12.5px; background: #0b1118;
}
/* 视频 HUD 叠层（白底黑字，压视频画面上） */
.rt-hud { position: absolute; inset: 0; pointer-events: none; z-index: 8; }
.rt-hud-tl { position: absolute; top: 10px; left: 12px; display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.92); border: 1px solid rgba(15,23,42,.08); border-radius: 8px; padding: 5px 10px;
    box-shadow: 0 2px 10px rgba(15,23,42,.18); }
.rt-hud-live { width: 7px; height: 7px; border-radius: 50%; background: #e60012; animation: rtBlink 1.4s infinite; }
.rt-hud-tl b { font-size: 12.5px; color: #0f172a; }
.rt-hud-tl span { font-size: 11px; color: #1d4ed8; font-variant-numeric: tabular-nums; }
.rt-hud-tr { position: absolute; top: 10px; right: 12px; text-align: right;
    background: rgba(255,255,255,.92); border: 1px solid rgba(15,23,42,.08); border-radius: 8px; padding: 4px 12px;
    box-shadow: 0 2px 10px rgba(15,23,42,.18); }
.rt-hud-tr b { font-size: 26px; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; line-height: 1.1; }
.rt-hud-tr i { font-style: normal; font-size: 10.5px; color: #64748b; margin-left: 3px; }
.rt-hud-bl { position: absolute; bottom: 10px; left: 12px; max-width: calc(100% - 24px);
    background: rgba(255,255,255,.92); border: 1px solid rgba(15,23,42,.08); border-radius: 8px; padding: 4px 10px;
    font-size: 11.5px; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    box-shadow: 0 2px 10px rgba(15,23,42,.18); }

/* ---- 右上：排名榜（TOP10 全量展示，不滚动；车型带小图标；2026-10-15 晚：字体放大 + flex 均摊撑满，消除底部空白） ---- */
.rt-rank { flex: 1; min-height: 0; overflow: hidden; padding: 6px 8px; display: flex; flex-direction: column; }
.rt-rank-empty { padding: 40px 0; text-align: center; color: #94a3b8; font-size: 12.5px; }
.rt-rank-row { flex: 1; min-height: 0; display: flex; align-items: center; gap: 10px; padding: 4px 8px; border-radius: 7px; }
.rt-rank-row + .rt-rank-row { margin-top: 2px; }
.rt-rank-row:nth-child(odd) { background: #f8fafc; }
.rt-rank-row.is-top { background: #fffbeb; box-shadow: inset 2px 0 0 #f59e0b; }
.rt-rank-pos { flex: none; width: 25px; height: 25px; line-height: 25px; text-align: center; border-radius: 7px;
    background: #e2e8f0; color: #475569; font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rt-rank-pos.p1 { background: #f59e0b; color: #fff; }
.rt-rank-pos.p2 { background: #94a3b8; color: #fff; }
.rt-rank-pos.p3 { background: #b45309; color: #fff; }
.rt-rank-icon { flex: none; width: 32px; height: 32px; border-radius: 6px; object-fit: cover; background: #f1f5f9; border: 1px solid #eef1f6; }
.rt-rank-name { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-rank-score { flex: none; font-size: 17px; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; }
.rt-rank-score i { font-style: normal; font-size: 11.5px; font-weight: 400; color: #94a3b8; margin-left: 3px; }

/* ---- 左下：卫星影像 ---- */
.rt-map-box { position: relative; flex: 1; min-height: 0; }
.rt-map { width: 100%; height: 100%; background: #e8eef4; }
.rt-map-chip { position: absolute; top: 10px; left: 10px; z-index: 10; max-width: calc(100% - 20px);
    background: rgba(255,255,255,.92); border: 1px solid rgba(15,23,42,.08); border-radius: 8px; padding: 5px 11px;
    font-size: 12px; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    box-shadow: 0 2px 10px rgba(15,23,42,.15); }
.rt-map-nofix { position: absolute; inset: 0; z-index: 9; display: flex; align-items: center; justify-content: center;
    background: rgba(246,248,251,.88); color: #64748b; font-size: 12.5px; }
.rt-map-nofix[hidden] { display: none; }
/* 红点（Marker content） */
.rt-veh { position: relative; width: 34px; height: 34px; }
.rt-veh svg { display: block; filter: drop-shadow(0 3px 4px rgba(15,23,42,.35)); }
.rt-veh-ring { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
    border: 2.5px solid currentColor; border-radius: 50%; opacity: 0; pointer-events: none;
    animation: rtRing 1.5s ease-out infinite; }
@keyframes rtRing { 0% { transform: scale(.7); opacity:.95; } 70% { opacity:.3; } 100% { transform: scale(1.7); opacity:0; } }

/* ---- 右下：曲线 ---- */
.rt-chart-box { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rt-chart-box canvas { flex: 1; width: 100%; min-height: 0; }
.rt-chart-legend { flex: none; display: flex; gap: 18px; padding: 6px 12px 8px; font-size: 11.5px; color: #64748b; }
.rt-chart-legend b { font-size: 13px; font-variant-numeric: tabular-nums; }
.rt-chart-legend .lg-sp b { color: #dc2626; }
.rt-chart-legend .lg-alt b { color: #d97706; }

/* ---- 移动端：单列 ---- */
@media (max-width: 980px) {
    .rt-wrap { margin: 8px 10px 16px; padding: 10px 10px 12px; }
    .rt-grid { grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: "video" "rank" "map" "chart"; }
    .rt-area-video, .rt-area-rank, .rt-area-map, .rt-area-chart { min-height: 360px; }
    .rt-area-rank { min-height: 400px; }   /* TOP10 + 小图标一行不滚动 */
    .rt-pagename { font-size: 17px; }
}
