/* ============================================================
   快递001 · 指挥中枢 / 全球热力图 (EX-00)
   与全局顶栏 + 侧栏壳层统一，地图区沉浸式深色
   ============================================================ */

body.command-center-page.kuaidi-nav-active {
    background: #03060f !important;
    color: #e5edf5;
    overflow: hidden !important;
    padding-top: var(--nav-height) !important;
    padding-left: var(--sidebar-width) !important;
    transition: padding-left 0.3s ease;
}

body.command-center-page.kuaidi-nav-active.sidebar-collapsed {
    padding-left: var(--sidebar-collapsed-width) !important;
}

body.command-center-page.kuaidi-nav-active.sidebar-hidden {
    padding-left: 0 !important;
}

/* 地图画布限定在壳层内容区 */
body.command-center-page #bg-canvas,
body.command-center-page #map-canvas {
    position: fixed;
    top: var(--nav-height);
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    width: auto !important;
    height: auto !important;
    z-index: 1;
    transition: left 0.3s ease;
}

body.command-center-page.sidebar-collapsed #bg-canvas,
body.command-center-page.sidebar-collapsed #map-canvas,
body.command-center-page.sidebar-collapsed .map-command-bar,
body.command-center-page.sidebar-collapsed .kpi-bar,
body.command-center-page.sidebar-collapsed .side-panel {
    left: var(--sidebar-collapsed-width);
}

body.command-center-page.sidebar-hidden #bg-canvas,
body.command-center-page.sidebar-hidden #map-canvas,
body.command-center-page.sidebar-hidden .map-command-bar,
body.command-center-page.sidebar-hidden .kpi-bar {
    left: 0;
}

body.command-center-page.sidebar-hidden .side-panel {
    left: 16px;
}

/* 隐藏旧版独立顶栏（已由全局导航替代） */
body.command-center-page .top-bar {
    display: none !important;
}

/* 全局壳未注入时：指挥条/画布贴边，避免空出侧栏位 */
body.command-center-page:not(.kuaidi-nav-active) #bg-canvas,
body.command-center-page:not(.kuaidi-nav-active) #map-canvas,
body.command-center-page:not(.kuaidi-nav-active) .map-command-bar,
body.command-center-page:not(.kuaidi-nav-active) .kpi-bar {
    top: 0;
    left: 0;
}

/* 指挥条内 a.view-btn 与按钮视觉一致（返回首页/全部页面） */
body.command-center-page .map-command-bar a.view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

/* 页内指挥条：角色 / 速度 / 视图控制 */
body.command-center-page .map-command-bar {
    position: fixed;
    top: var(--nav-height);
    left: var(--sidebar-width);
    right: 0;
    height: 46px;
    z-index: 95;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 18px;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--eh-border);
    box-shadow: var(--eh-shadow-xs);
    transition: left 0.3s ease;
    font-family: var(--eh-font-sans);
}

body.command-center-page .map-command-bar .map-page-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--eh-text-primary);
    white-space: nowrap;
    margin-right: 8px;
}

body.command-center-page .map-command-bar .map-page-title .code {
    font-size: 10px;
    font-weight: 700;
    font-family: var(--eh-font-mono);
    color: var(--eh-brand);
    background: var(--eh-brand-subtle);
    padding: 2px 8px;
    border-radius: var(--eh-radius-sm);
}

body.command-center-page .map-command-bar .role-switcher {
    margin-left: 0;
    background: var(--eh-bg-subtle);
    border-color: var(--eh-border);
}

body.command-center-page .map-command-bar .role-btn {
    color: var(--eh-text-muted);
    font-size: 11px;
}

body.command-center-page .map-command-bar .role-btn:hover {
    color: var(--eh-text-secondary);
    background: var(--eh-bg-muted);
}

body.command-center-page .map-command-bar .role-btn.active {
    color: var(--eh-brand);
    background: var(--eh-brand-muted);
}

body.command-center-page .map-command-bar .speed-control {
    margin-left: auto;
    background: var(--eh-bg-subtle);
    border-color: var(--eh-border);
}

body.command-center-page .map-command-bar .speed-btn {
    color: var(--eh-text-muted);
}

body.command-center-page .map-command-bar .speed-btn.active {
    color: var(--eh-brand);
    background: var(--eh-brand-muted);
}

body.command-center-page .map-command-bar .top-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

body.command-center-page .map-command-bar .status-indicator {
    background: var(--eh-success-muted);
    border-color: rgba(21, 128, 61, 0.25);
    color: var(--eh-success);
}

body.command-center-page .map-command-bar .clock {
    color: var(--eh-text-secondary);
    font-family: var(--eh-font-mono);
    font-size: 11px;
}

body.command-center-page .map-command-bar .view-btn {
    background: var(--eh-bg-subtle);
    border-color: var(--eh-border);
    color: var(--eh-text-secondary);
}

body.command-center-page .map-command-bar .view-btn:hover {
    border-color: var(--eh-brand);
    color: var(--eh-brand);
}

/* KPI 条 */
body.command-center-page .kpi-bar {
    top: calc(var(--nav-height) + 46px);
    left: var(--sidebar-width);
    right: 0;
    height: 76px;
    padding: 0 20px;
    background: linear-gradient(180deg, rgba(3, 6, 15, 0.75) 0%, transparent 100%);
    transition: left 0.3s ease;
}

body.command-center-page .kpi-card {
    background: rgba(255, 255, 255, 0.94) !important;
    border-color: var(--eh-border) !important;
    box-shadow: var(--eh-shadow-xs);
}

body.command-center-page .kpi-card .label {
    color: var(--eh-text-muted) !important;
}

body.command-center-page .kpi-card .value {
    color: var(--eh-text-primary) !important;
}

/* 左右数据面板（非导航，与 kuaidi-sidebar 区分） */
body.command-center-page .side-panel {
    left: calc(var(--sidebar-width) + 12px);
    top: calc(var(--nav-height) + 46px + 76px + 8px);
    width: 280px;
    transition: left 0.3s ease;
}

body.command-center-page .right-panel {
    top: calc(var(--nav-height) + 46px + 76px + 8px);
    width: 260px;
}

body.command-center-page .panel-card {
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid var(--eh-border) !important;
    box-shadow: var(--eh-shadow-sm);
    backdrop-filter: none !important;
}

body.command-center-page .panel-card::before {
    background: linear-gradient(180deg, var(--eh-brand), transparent) !important;
}

body.command-center-page .panel-title {
    color: var(--eh-text-secondary) !important;
}

body.command-center-page .panel-title i {
    color: var(--eh-brand) !important;
}

body.command-center-page .panel-title .badge {
    background: var(--eh-brand-subtle) !important;
    color: var(--eh-brand) !important;
}

body.command-center-page .hub-item {
    border-bottom-color: var(--eh-border) !important;
}

body.command-center-page .hub-item .rank {
    background: var(--eh-bg-subtle) !important;
    color: var(--eh-text-muted) !important;
}

body.command-center-page .hub-item .hub-name {
    color: var(--eh-text-primary) !important;
}

body.command-center-page .hub-item .hub-meta {
    color: var(--eh-text-muted) !important;
}

body.command-center-page .feed-item .feed-text {
    color: var(--eh-text-secondary) !important;
}

body.command-center-page .trend-row .trend-label {
    color: var(--eh-text-muted) !important;
}

body.command-center-page .bottom-ticker {
    left: var(--sidebar-width);
    transition: left 0.3s ease;
}

body.command-center-page.sidebar-collapsed .bottom-ticker {
    left: var(--sidebar-collapsed-width);
}

body.command-center-page.sidebar-hidden .bottom-ticker {
    left: 0;
}

body.command-center-page .corner-deco.tl {
    top: calc(var(--nav-height) + 46px);
    left: calc(var(--sidebar-width) + 8px);
}

body.command-center-page .voice-hint {
    top: calc(var(--nav-height) + 56px);
}

/* 全局壳层在指挥页保持企业浅色 */
body.command-center-page .kuaidi-nav-bar {
    z-index: 100001;
}

body.command-center-page .kuaidi-sidebar {
    z-index: 100000;
    top: var(--nav-height);
}

body.command-center-page .theme-panel {
    z-index: 100002;
}

/* ===== 数据面板抽屉（默认收起，扩大地图可视区） ===== */
body.command-center-page .side-panel,
body.command-center-page .right-panel {
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2,  1), opacity 0.28s ease, visibility 0.28s ease;
    will-change: transform;
}

body.command-center-page:not(.cc-drawer-left-open) .side-panel {
    transform: translateX(calc(-100% - 20px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.command-center-page.cc-drawer-left-open .side-panel {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: none;
}

body.command-center-page:not(.cc-drawer-right-open) .right-panel {
    transform: translateX(calc(100% + 20px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.command-center-page.cc-drawer-right-open .right-panel {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: none;
}

/* 边缘拉环：收起时贴地图边，展开时贴面板边 */
body.command-center-page .map-drawer-tab {
    position: fixed;
    z-index: 92;
    width: 28px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--eh-border);
    background: rgba(255, 255, 255, 0.96);
    color: var(--eh-text-secondary);
    cursor: pointer;
    box-shadow: var(--eh-shadow-sm);
    transition: left 0.3s ease, right 0.3s ease, background 0.2s, color 0.2s, border-color 0.2s;
    font-size: 11px;
}

body.command-center-page .map-drawer-tab:hover,
body.command-center-page .map-drawer-tab.active {
    background: var(--eh-brand-muted);
    border-color: rgba(37, 99, 235, 0.35);
    color: var(--eh-brand);
}

body.command-center-page .map-drawer-tab-left {
    left: calc(var(--sidebar-width) + 8px);
    top: calc(var(--nav-height) + 46px + 76px + 24px);
    border-radius: 0 10px 10px 0;
}

body.command-center-page .map-drawer-tab-right {
    right: 8px;
    top: calc(var(--nav-height) + 46px + 76px + 24px);
    border-radius: 10px 0 0 10px;
}

body.command-center-page.sidebar-collapsed .map-drawer-tab-left {
    left: calc(var(--sidebar-collapsed-width) + 8px);
}

body.command-center-page.sidebar-hidden .map-drawer-tab-left {
    left: 8px;
}

body.command-center-page.cc-drawer-left-open .map-drawer-tab-left {
    left: calc(var(--sidebar-width) + 280px + 20px);
}

body.command-center-page.sidebar-collapsed.cc-drawer-left-open .map-drawer-tab-left {
    left: calc(var(--sidebar-collapsed-width) + 280px + 20px);
}

body.command-center-page.sidebar-hidden.cc-drawer-left-open .map-drawer-tab-left {
    left: calc(280px + 28px);
}

body.command-center-page.cc-drawer-left-open .map-drawer-tab-left i {
    transform: rotate(180deg);
}

body.command-center-page.cc-drawer-right-open .map-drawer-tab-right {
    right: calc(260px + 24px);
}

body.command-center-page.cc-drawer-right-open .map-drawer-tab-right i {
    transform: rotate(180deg);
}

body.command-center-page .map-command-bar .view-btn.active {
    background: var(--eh-brand-muted);
    border-color: rgba(37, 99, 235, 0.35);
    color: var(--eh-brand);
}
