/* ============================================
   地铁站定位展示系统 - 样式表（明亮主题）
   ============================================ */

:root {
    --primary: #1e3351;
    --primary-light: #2a4468;
    --primary-dark: #162741;
    --accent: #059669;
    --accent-light: #10b981;
    --danger: #dc2626;
    --warning: #d97706;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-panel: #ffffff;
    --bg-card: #f1f5f9;
    --bg-card-hover: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg-light);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ---- 顶部标题栏 ---- */
#app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: #1e3351;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.24);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

#app-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #f8fbff;
    letter-spacing: 0.5px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.78);
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    transition: background 0.3s;
}

.connection-status.connected .status-dot {
    background: var(--accent);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
    animation: pulse-dot 2s infinite;
}

.connection-status.disconnected .status-dot {
    background: var(--danger);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.terminal-count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
}

/* 模式切换开关 */
.mode-switch-container {
    margin-right: 8px;
}

.mode-switch {
    display: flex;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.mode-btn {
    padding: 5px 16px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font);
}

.mode-btn:hover {
    color: rgba(255, 255, 255, 0.88);
}

.mode-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

/* 历史模式日期选择 */
.history-date-container {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.9));
    margin-bottom: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.history-date-container label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

#historyDatePicker {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
    font-family: var(--font);
}

#historyDatePicker:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.hidden {
    display: none !important;
}

.history-mode .status-dot {
    background: var(--warning);
    box-shadow: 0 0 8px rgba(217, 119, 6, 0.4);
}

.btn-area-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}

.btn-area-stat:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.btn-area-stat.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.area-stat-popup {
    position: fixed;
    top: 68px;
    right: 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 0;
    z-index: 1001;
    width: 310px;
    font-family: var(--font);
    overflow: hidden;
    animation: stat-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes stat-slide-in {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
}

.stat-header-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}
.stat-header-icon svg {
    width: 15px;
    height: 15px;
}

.stat-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.stat-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.stat-close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

/* 数字卡片组 */
.stat-cards {
    display: flex;
    gap: 10px;
    padding: 4px 20px 14px;
}

.stat-card {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
}

.stat-card.accent {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.01) 100%);
    border-color: rgba(16, 185, 129, 0.15);
}

.stat-card.danger {
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.05) 0%, rgba(220, 38, 38, 0.01) 100%);
    border-color: rgba(220, 38, 38, 0.12);
}

.stat-card-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    font-family: 'Inter', sans-serif;
}

.stat-card.accent .stat-card-value { color: #059669; }
.stat-card.danger .stat-card-value { color: #dc2626; }

.stat-card-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 在线率进度条 */
.stat-rate-row {
    padding: 0 20px 16px;
}

.stat-rate-bar {
    width: 100%;
    height: 6px;
    border-radius: 6px;
    background: rgba(226, 232, 240, 0.6);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.stat-rate-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #38bdf8, #2563eb);
    position: relative;
}
.stat-rate-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(255,255,255,0.2) 0%, transparent 100%);
}

.stat-rate-label {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
}

/* 标签组 */
.stat-tags {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 20px 16px;
}

.stat-tag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s;
    background: linear-gradient(90deg, rgba(248, 250, 252, 0.6), rgba(248, 250, 252, 0.3));
    border: 1px solid rgba(226, 232, 240, 0.5);
    color: var(--text-secondary);
}

.stat-tag svg {
    margin-right: 8px;
    opacity: 0.8;
}

.stat-tag span {
    font-weight: 800;
    font-size: 14px;
    margin-left: auto;
}

.stat-tag.normal {
    color: #059669;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.02));
    border-color: rgba(16, 185, 129, 0.15);
}
.stat-tag.normal span { color: #059669; }

.stat-tag.late {
    color: #d97706;
    background: linear-gradient(90deg, rgba(217, 119, 6, 0.08), rgba(217, 119, 6, 0.02));
    border-color: rgba(217, 119, 6, 0.15);
}
.stat-tag.late span { color: #d97706; }

.stat-tag.absent {
    color: #dc2626;
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.08), rgba(220, 38, 38, 0.02));
    border-color: rgba(220, 38, 38, 0.15);
}
.stat-tag.absent span { color: #dc2626; }

/* 站点条形图 */
.stat-section-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 20px;
    margin-bottom: 6px;
}

.stat-bars {
    padding: 4px 20px 20px;
    max-height: 200px;
    overflow-y: auto;
}
.stat-bars::-webkit-scrollbar {
    width: 4px;
}
.stat-bars::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
}

.stat-bar-item {
    margin-bottom: 12px;
}

.stat-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-bar-count {
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 11px;
}

.stat-bar-track {
    position: relative;
    height: 6px;
    border-radius: 6px;
    background: rgba(226, 232, 240, 0.6);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.stat-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-bar-fill.bg {
    background: rgba(37, 99, 235, 0.15);
}

.stat-bar-fill.online {
    background: linear-gradient(90deg, #60a5fa, #2563eb);
}

/* ---- 会话明细弹窗 ---- */
/* ---- 附属弹窗统一基类 (在线明细与轨迹查询复用) ---- */
.session-detail-popup {
    position: fixed;
    top: 72px;
    right: 20px;
    z-index: 1002;
    /* 大部分基础阴影及圆角样式被复用的 .info-window-premium 取代 */
}

/* ---- 在线明细列表区 ---- */
.sd-list {
    padding: 0 16px 16px;
    max-height: 400px;
    overflow-y: auto;
}
.sd-list::-webkit-scrollbar { width: 4px; }
.sd-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 2px; }

.sd-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    position: relative;
}

.sd-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 24px;
    bottom: -6px;
    width: 2px;
    background: rgba(226, 232, 240, 0.8);
}

.sd-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #94a3b8;
    flex-shrink: 0;
    margin-top: 4px;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
    z-index: 1;
}

.sd-dot.active {
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.sd-content {
    flex: 1;
    background: rgba(248, 250, 252, 0.6);
    border: 1px solid rgba(226, 232, 240, 0.7);
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.2s;
}

.sd-content:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.sd-time {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.sd-info {
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sd-stay-badge {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.sd-stay-badge.segment {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.sd-loc {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    font-weight: 500;
}

.sd-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 24px 0 10px;
}

/* ---- 历史轨迹表单区 ---- */
.tj-date-input {
    width: 100%;
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: 'Inter', inherit;
    font-size: 13px;
    color: var(--text-primary);
    transition: all 0.2s;
    outline: none;
}
.tj-date-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #fff;
}

.tj-btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    transition: all 0.2s;
}
.tj-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.tj-clear-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #ef4444;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}
.tj-clear-link:hover {
    background: rgba(239, 68, 68, 0.1);
}


/* ---- 主体区域 ---- */
#app-main {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
}

/* ---- 左侧面板 ---- */
#side-panel {
    width: 300px;
    min-width: 300px;
    height: 100%;
    background: rgba(30, 51, 81, 0.96);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
    box-shadow: 2px 0 18px rgba(0, 0, 0, 0.2);
}

.panel-section {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.86);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- 列表工具栏 ---- */
.list-toolbar {
    margin-bottom: 12px;
}

.terminal-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 8px;
}

.terminal-search:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.terminal-search::placeholder {
    color: rgba(255, 255, 255, 0.68);
}

.filter-tabs {
    display: flex;
    gap: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.filter-tab {
    flex: 1;
    padding: 5px 0;
    border: none;
    background: none;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font);
    color: rgba(255, 255, 255, 0.78);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.filter-tab:hover {
    color: rgba(255, 255, 255, 0.85);
}

.filter-tab.active {
    background: rgba(214, 226, 242, 0.92);
    color: #223a59;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

/* ---- 终端列表 ---- */
.terminal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.empty-state {
    text-align: center;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    padding: 32px 0;
}

.terminal-card {
    padding: 14px 16px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: rgba(214, 226, 242, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.terminal-card:hover {
    background: rgba(226, 236, 248, 0.96);
    border-color: rgba(111, 168, 255, 0.32);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

.terminal-card.offline {
    opacity: 1;
    filter: none;
}
.terminal-card.offline:hover {
    opacity: 1;
}

.terminal-card-header {
    display: flex;
    align-items: flex-start; /* 改为起点对齐，支持 ID 换行高度增加 */
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 10px; /* 增加间距 */
}

.terminal-id {
    font-size: 14px; /* 稍微缩小以适配长 ID */
    font-weight: 700;
    color: #29456b;
    display: block; /* 改为 block 以支持换行 */
    word-break: break-all; /* 强制长字符换行 */
    line-height: 1.4;
    font-family: 'Inter', sans-serif;
    flex: 1; /* 占据剩余全部空间 */
}

.terminal-id svg {
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
    margin-top: -2px;
}

.terminal-card.offline .terminal-id {
    color: #5b6f8d;
}

.terminal-card.offline .terminal-id svg {
    stroke: #94a3b8 !important;
}

.terminal-status-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 6px; /* 统一使用稍微方一点的圆角，更有科技感 */
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    white-space: nowrap;
}

.terminal-status-badge.online {
    background: rgba(16, 185, 129, 0.16);
    color: #8ff0c8;
    border: 1px solid rgba(16, 185, 129, 0.22);
}

.terminal-status-badge.offline {
    background: rgba(239, 68, 68, 0.14);
    color: #ffb0b0;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.terminal-status-badge.warning {
    background: rgba(245, 158, 11, 0.14);
    color: #ffd48a;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.tc-delete-btn {
    display: flex;
    color: var(--text-muted);
    transition: color 0.2s;
    padding: 2px;
    border-radius: 4px;
}
.tc-delete-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.terminal-station {
    font-size: 13px;
    color: #3f4f67;
    margin-bottom: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.terminal-station.current {
    color: var(--primary) !important;
    text-shadow: 0 0 8px rgba(37, 99, 235, 0.1);
}

.terminal-detail-row {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    background: rgba(241, 245, 249, 0.6);
    padding: 6px 8px;
    border-radius: 6px;
}

.terminal-detail-row span {
    display: flex;
    align-items: center;
}

.tc-stay {
    font-weight: 500;
    color: var(--text-primary);
}

.terminal-time {
    font-size: 11px;
    color: #6b7b93;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* ---- 地图容器 ---- */
#map-container {
    flex: 1;
    height: 100%;
}

/* ---- 高德地图InfoWindow白金质感重构版 ---- */
.info-window-premium {
    width: 320px;
    background: rgba(30, 51, 81, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 16px 48px -12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: var(--font);
    overflow: hidden;
    padding: 0;
    margin-bottom: 24px; /* 留给小尾巴的空间 */
    animation: iw-scale-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes iw-scale-in {
    0% { opacity: 0; transform: scale(0.95) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* 覆盖高德原生丑陋关闭按钮 */
.amap-info-close {
    display: none !important;
}

.iw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 14px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.5) 0%, transparent 100%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.iw-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.iw-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.iw-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

.iw-dot.warning {
    background: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

.iw-id {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.3px;
}

.iw-status-badge {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 700;
}

.iw-status-badge.online {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.iw-status-badge.offline {
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
}

.iw-body {
    padding: 16px 20px 0;
}

/* 主位置指示器 */
.iw-row.main-location {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.05) 0%, rgba(37, 99, 235, 0.01) 100%);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.iw-icon {
    color: var(--primary);
    flex-shrink: 0;
}

.iw-value.highlight {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
}

/* 核心网格指标 */
.iw-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.iw-grid-item {
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.iw-grid-item .iw-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.iw-grid-item .iw-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

/* 明细列表 */
.iw-detail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 16px;
}

.iw-detail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}

.iw-d-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.iw-d-value {
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

.iw-detail-item.offline-alert .iw-d-label,
.iw-detail-item.offline-alert .iw-d-value {
    color: #ef4444;
}

/* 底部操作区 */
.iw-footer {
    display: flex;
    padding: 12px 20px;
    background: rgba(248, 250, 252, 0.8);
    border-top: 1px solid var(--border);
    justify-content: space-between;
    align-items: center;
}

.iw-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.iw-action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.iw-action-btn.primary {
    color: var(--primary);
}

.iw-action-btn.primary:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-dark);
}

.iw-divider {
    width: 1px;
    height: 16px;
    background: var(--border);
}

.iw-status-badge {
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 500;
}

.iw-status-badge.online {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent);
}

.iw-status-badge.offline {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
}

.info-window-row {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    gap: 8px;
}

.info-window-row .iw-label {
    color: var(--text-muted);
    min-width: 50px;
    flex-shrink: 0;
}

.info-window-row span:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

/* ---- 自定义Marker ---- */
.custom-marker {
    position: relative;
    width: 32px;
    height: 32px;
}

.marker-pin {
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 50% 0;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.4);
    transition: all 0.3s;
}

.marker-pin.offline {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.marker-pin.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
}

.marker-pin-inner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    transform: rotate(45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
    color: var(--accent);
}

.marker-label {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 51, 81, 0.92);
    color: #f8fbff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

/* Marker脉冲动画 */
.marker-pulse {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.25);
    animation: marker-pulse-anim 2s ease-out infinite;
    top: 0;
    left: 0;
}

@keyframes marker-pulse-anim {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.5); opacity: 0; }
}

.marker-pulse.warning {
    background: rgba(245, 158, 11, 0.25);
}

/* ---- 右上角模拟上报按钮 ---- */
.btn-mock {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-mock:hover {
    background: var(--bg-card);
    border-color: var(--primary-light);
    color: var(--primary);
}

/* ---- 弹窗遮罩 ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 64px 20px 0 0;
    transition: opacity 0.2s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    width: 480px;
    max-width: 90vw;
    animation: modal-slide-in 0.2s ease-out;
}

@keyframes modal-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}

.modal-close:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.modal-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.json-input {
    width: 100%;
    height: 300px;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.json-input:focus {
    border-color: var(--primary);
}

/* ---- Toast 提示 ---- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    z-index: 2000;
    transition: all 0.3s;
    box-shadow: var(--shadow-lg);
}

.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

.toast.success {
    background: var(--accent);
    color: white;
}

.toast.error {
    background: var(--danger);
    color: white;
}

/* ---- 滚动条 ---- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

/* ---- 移动端辅助组件 ---- */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    margin-right: 8px;
    border-radius: var(--radius-sm);
}

.mobile-menu-btn:active {
    background: var(--bg-hover);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 150;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s;
}

/* ---- 地图兴趣点搜索框 ---- */
.map-search-box {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 100;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0 16px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    width: 320px;
    height: 46px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.2s;
}

.map-search-box:focus-within {
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.15);
    border-color: var(--primary-light);
    width: 360px;
}

.map-search-icon {
    color: var(--primary);
    margin-right: 12px;
}

#mapSearchInput {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-primary);
    background: transparent;
}

#mapSearchInput::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.map-search-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
    border-radius: 50%;
}

.map-search-clear:hover {
    color: var(--danger);
    background: var(--bg-card);
}

.map-search-clear.show {
    opacity: 1;
    pointer-events: auto;
}

/* 高德原生下拉建议框样式微调 */
.amap-sug-result {
    border-radius: var(--radius) !important;
    border: none !important;
    box-shadow: var(--shadow-lg) !important;
    overflow: hidden !important;
    margin-top: 8px !important;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .app-title {
        display: none; /* 隐藏长标题 */
    }

    .map-search-box {
        top: 12px;
        right: 12px;
        left: 60px;
        width: auto;
        border-radius: 12px;
    }

    .map-search-box:focus-within {
        width: auto;
    }

    #side-panel {
        position: fixed;
        left: -320px;
        top: 64px;
        bottom: 0;
        width: 320px;
        z-index: 1000;
        transition: left 0.3s ease;
        max-width: 85vw;
        border-radius: 0 16px 16px 0;
        box-shadow: 4px 0 24px rgba(0,0,0,0.1);
    }

    #side-panel.open {
        left: 0;
    }

    .sidebar-backdrop.show {
        display: block;
        opacity: 1;
    }

    /* 弹窗防截断 */
    .amap-info-contentContainer, .session-detail-popup {
        max-width: calc(100vw - 32px);
    }

    .info-window-premium {
        max-width: 100%;
    }
}

/* ---- 实时监控侧边栏 (Activity Monitor Sidebar) ---- */
.activity-monitor {
    position: fixed;
    top: 56px;
    right: 0;
    bottom: 0;
    width: 330px;
    background: rgba(30, 51, 81, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    /* overflow: visible 允许拉手在收起时可见 */
    overflow: visible;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(100%);
}

.activity-monitor.open {
    transform: translateX(0);
}

/* 侧向点击拉手 */
.am-toggle-handle {
    position: absolute;
    left: -28px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 80px;
    background: rgba(30, 51, 81, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px 0 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-right: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.78);
    box-shadow: -4px 0 12px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.am-toggle-handle:hover {
    background: var(--primary);
    width: 32px;
    left: -32px;
}

.am-toggle-handle svg {
    transition: transform 0.4s;
}

/* 展开状态下箭头向右 */
.activity-monitor.open .am-toggle-handle svg {
    transform: rotate(0deg);
}

/* 收起状态下箭头向左 */
.activity-monitor:not(.open) .am-toggle-handle svg {
    transform: rotate(180deg);
}


.am-header {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.am-title {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.am-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.am-close-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.am-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}


.am-title::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    animation: pulse-green 1.5s infinite;
}

.am-count {
    font-family: 'Inter', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.86);
    background: rgba(255, 255, 255, 0.12);
    padding: 2px 8px;
    border-radius: 10px;
}

.am-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.am-empty {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
}

.am-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slide-in-top 0.4s ease-out;
    transition: background 0.2s;
    cursor: pointer;
}

.am-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.am-time {
    font-family: 'Inter', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.72);
    white-space: nowrap;
    margin-top: 2px;
}

.am-body {
    flex: 1;
    min-width: 0;
}

.am-id {
    color: #f8fbff;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.am-station-name {
    color: var(--primary);
    font-weight: 500;
}

.am-detail {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.76);
    display: flex;
    align-items: center;
    gap: 6px;
}

.am-badge {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.am-badge.info { background: rgba(16, 185, 129, 0.16); color: #8ff0c8; border: 1px solid rgba(16, 185, 129, 0.22); } /* 在线-绿 */
.am-badge.warn { background: rgba(245, 158, 11, 0.16); color: #ffd48a; border: 1px solid rgba(245, 158, 11, 0.22); }    /* 未知-黄 */
.am-badge.error { background: rgba(148, 163, 184, 0.16); color: #d5dfef; border: 1px solid rgba(148, 163, 184, 0.2); }   /* 离线-灰 */
.am-badge.segment { background: rgba(86, 162, 255, 0.16); color: #a9d1ff; border: 1px solid rgba(86, 162, 255, 0.24); text-transform: none; } /* 区间运行-蓝 */

@keyframes slide-in-top {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-blue {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* 监控台技术详情网格 */
.am-tech-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr; /* 增加左列宽度以容纳长数字 */
    gap: 4px 12px;
    width: 100%;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 10px;
    color: var(--text-muted);
    margin: 6px 0;
    line-height: 1.2;
}

.am-key {
    color: var(--text-muted);
    opacity: 0.8;
}

.am-extra-desc {
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-secondary);
    padding-top: 2px;
}

.am-tech-grid div {
    word-break: break-all; /* 允许在长经纬度中间拆行 */
    line-height: 1.4;
}

/* 原始报文查看链接 */
.am-raw-link {
    font-size: 10px;
    color: #61affe;
    text-decoration: none;
    opacity: 0.6;
    transition: all 0.2s;
    padding: 2px 0;
}

.am-raw-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* 原始 JSON 弹窗 */
.raw-data-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.raw-data-content {
    width: 85%;
    max-width: 900px;
    height: 80%;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.raw-data-header {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.raw-data-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #121212;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #d4d4d4;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.raw-data-body pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.raw-data-body code {
    color: #9cdcfe; /* VS Code blue-ish for properties */
}

.raw-data-footer {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
}

.raw-copy-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.raw-copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
    filter: brightness(1.1);
}

.raw-close {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: color 0.2s;
}

.raw-close:hover {
    color: #fff;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.route-line-name {
    color: var(--primary);
    font-weight: 700;
    margin-right: 4px;
}

/* 位置面包屑增强样式 */
.breadcrumb-container {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    max-width: 100%;
    overflow: hidden;
}

.breadcrumb-item {
    white-space: nowrap;
    font-size: 12px;
}

.breadcrumb-sep {
    margin: 0 4px;
    color: var(--text-muted);
    font-weight: normal;
    opacity: 0.5;
}

.terminal-station {
    display: flex !important;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 6px 0;
    font-size: 12px;
}

.terminal-station svg {
    flex-shrink: 0;
}

/* 侧边栏卡片微调 */
.terminal-card {
    padding: 12px !important;
}

.terminal-detail-row {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ==========================================================================
   3D 楼层建模全屏遮罩样式
   ========================================================================== */
#building-3d-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 500; /* 高于地图但低于侧边栏 z-index: 1000 的某些组件 */
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#building-3d-overlay.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden;
}

.s3d-overlay-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: #000;
}

.s3d-overlay-header {
    padding: 10px 20px;
    background: #0f172a;
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}

.s3d-overlay-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.s3d-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 5px;
    display: flex;
    transition: color 0.2s;
}

.s3d-close-btn:hover {
    color: #ef4444;
}

#building-3d-frame {
    flex: 1;
    width: 100%;
    background-color: #000;
}

.s3d-overlay-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

#btn-open-3d {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #00f3ff;
    border: 1px solid rgba(0, 243, 255, 0.3);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    margin-right: 8px;
}


#btn-open-3d:hover {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
    border-color: #00f3ff;
}

/* ==========================================================================
   树状列表样式 (3D 模式专用)
   ========================================================================== */
.tree-node {
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(205, 219, 236, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.tree-header {
    padding: 10px 14px;
    background: rgba(245, 249, 255, 0.96);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.tree-header:hover {
    background: rgba(250, 252, 255, 0.98);
}

.tree-title {
    font-size: 13px;
    font-weight: 700;
    color: #224069;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tree-icon {
    transition: transform 0.3s;
}

.tree-node.collapsed .tree-icon {
    transform: rotate(-90deg);
}

.tree-content {
    padding: 8px;
    display: block;
}

.tree-node.collapsed .tree-content {
    display: none;
}

.tree-node .terminal-card {
    margin-bottom: 6px;
    border-radius: 6px;
    padding: 10px 12px;
}

.tree-header .node-actions {
    display: flex;
    gap: 8px;
}

/* 楼层层级样式 (二级) */
.floor-node {
    margin: 4px 0 12px 6px;
    border-left: 2px solid rgba(148, 163, 184, 0.5);
    padding-left: 10px;
}

.floor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 4px;
    margin-bottom: 6px;
    background: rgba(233, 240, 249, 0.96);
    border-radius: 4px;
}

.floor-title {
    font-size: 11px;
    font-weight: 800;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.floor-count {
    font-size: 10px;
    background: rgba(198, 212, 230, 0.95);
    color: #334155;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.floor-content {
    /* 默认展开楼层下的终端 */
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn-view-3d {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}
.floor-trajectory-exit-btn {
    position: fixed;
    right: 20px;
    bottom: 260px;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 104px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(17, 28, 44, 0.88);
    color: #f8fbff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.floor-trajectory-exit-btn:hover {
    transform: translateY(-1px);
    background: rgba(30, 51, 81, 0.96);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.32);
}
