/* 全局样式 */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --accent-color: #f39c12;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --danger-color: #e74c3c;
    --warning-color: #f1c40f;
    --info-color: #1abc9c;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --ui-scale: 1;
    --font-1: 14px;
    --font-2: 16px;
    --font-3: 18px;
    --space-1: 8px;
    --space-2: 12px;
    --space-3: 16px;
    --radius-1: 6px;
    --radius-2: 8px;
    --btn-h-sm: 28px;
    --btn-h-md: 32px;
    --btn-h-lg: 36px;
    --sidebar-width: 133px; /* 缩小1/3：原200px × 2/3 = 133px */
    --topbar-padding-y: 8px; /* 原10 × 0.8 等效 */
    --topbar-padding-x: 16px; /* 原20 × 0.8 等效 */
    --card-header-padding-y: 12px; /* 原15 × 0.8 等效 */
    --card-header-padding-x: 16px; /* 原20 × 0.8 等效 */
    --card-body-padding: 16px; /* 原20 × 0.8 等效 */
    --table-font-sm: 0.765rem;
    --table-th-font-sm: 0.765rem;
    --btn-font-sm: 0.765rem;
    --btn-padding-y-sm: 0.225rem;
    --btn-padding-x-sm: 0.45rem;
    --table-cell-py: 12px;
    --table-cell-px: 16px;
    --table-header-font: var(--font-2);
    --btn-font: 0.9rem;
    --btn-padding-y: 0.45rem;
    --btn-padding-x: 0.8rem;
    --form-font: 0.9rem;
    --form-padding-y: 0.45rem;
    --form-padding-x: 0.6rem;
    --form-height: 2.4rem;
    --form-font-sm: 0.85rem;
    --form-padding-y-sm: 0.3rem;
    --form-padding-x-sm: 0.5rem;
    --form-height-sm: 2.1rem;
    --table-line-height: 1.4;
    --topbar-title-font: var(--font-2);
    --font-h1: 2rem;
    --font-h2: 1.6rem;
    --font-h3: 1.4rem;
    --font-h4: 1.2rem;
    --font-h5: 1rem;
    --font-h6: 0.9rem;
    --modal-title-font: 1.4rem;
    --modal-header-padding-y: 12px;
    --modal-header-padding-x: 16px;
    --stat-title-font: 14px;
    --stat-number-font: 22px;
    --stat-card-body-padding-y: 8px;
    --stat-card-body-padding-x: 10px;
    --stat-line-height: 1.4;
    --modal-body-padding-y: 16px;
    --modal-body-padding-x: 16px;
    --modal-footer-padding-y: 12px;
    --modal-footer-padding-x: 16px;
    --modal-radius: var(--radius-2);
    --alert-font: 0.9rem;
    --alert-padding-y: 0.6rem;
    --alert-padding-x: 0.8rem;
    --badge-font: 0.8rem;
    --badge-padding-y: 0.25rem;
    --badge-padding-x: 0.45rem;
    --dropdown-font: 0.9rem;
    --dropdown-item-py: 0.45rem;
    --dropdown-item-px: 0.8rem;
    --tooltip-font: 0.85rem;
    --tooltip-padding-y: 0.3rem;
    --tooltip-padding-x: 0.6rem;
    --popover-font: 0.9rem;
    --popover-body-py: 0.6rem;
    --popover-body-px: 0.8rem;
    --recent-table-font: 0.75rem;
    --recent-table-padding-y: 0.3rem;
    --recent-table-padding-x: 0.5rem;
}

/* 全局取消 zoom/transform 页面缩放，统一使用变量与 rem 控制视觉密度 */

/* 登录页等需要保持原始比例时，使用 no-zoom 类覆盖全局缩放 */
.no-zoom {
    zoom: 1 !important;
}
@supports not (zoom: 1) {
    .no-zoom {
        transform: none !important;
        transform-origin: initial !important;
    }
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    padding: 20px;
}

.login-box {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    width: 100%;
    max-width: 450px; /* 🎨 统一宽度并缩小一半（原900px → 450px） */
    display: flex;
    flex-direction: column;
}

.logo-container {
    text-align: center;
    padding: 30px 20px;
    background-color: var(--light-color);
}

.logo {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
}

.logo-container h1 {
    margin: 0;
    color: var(--dark-color);
    font-size: 24px;
    font-weight: 600;
}

.login-form {
    padding: 30px;
}

/* 设备选择样式 */
.device-selection {
    margin-bottom: 30px;
}

.device-selection h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--dark-color);
    font-size: 18px;
}

.device-options {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.device-option {
    flex: 1;
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.device-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.device-option.active {
    border-color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.1);
}

.device-icon {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.device-option[data-type="flow"] .device-icon {
    color: var(--primary-color);
}

.device-option[data-type="satellite"] .device-icon {
    color: var(--secondary-color);
}

.device-option[data-type="raptor"] .device-icon {
    color: var(--accent-color);
}

.device-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.device-desc {
    font-size: 12px;
    color: #6c757d;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .device-options {
        flex-direction: column;
    }

    .login-box {
        max-width: 100%;
    }
}

/* 按钮样式 */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

/* 仪表盘样式 */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--dark-color);
    color: white;
    padding: 20px 0;
    transition: var(--transition);
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
}

.sidebar-title {
    font-size: 18px;
    margin: 0;
    text-align: center; /* 居中对齐 */
    line-height: 1.5; /* 行高，确保换行后上下行居中对齐 */
    word-break: break-word; /* 允许在单词内换行（如果需要） */
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.sidebar-menu-item {
    padding: 10px 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.sidebar-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-menu-item.active {
    background-color: var(--primary-color);
}

.sidebar-menu-icon {
    margin-right: 10px;
    font-size: 18px;
}

.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--topbar-padding-y) var(--topbar-padding-x);
    /* 🎨 科研风格：使用沉稳的深灰蓝色背景，专业且不失时尚 */
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #d0d7de;
    margin-bottom: 20px;
    border-radius: 8px 8px 8px 8px; /* 四个角都使用圆角 */
}

/* 顶部栏内嵌统计卡片的紧凑布局 */
.topbar .page-title h4 { white-space: nowrap; font-size: var(--topbar-title-font); }
.stat-inline {
    display: flex;
    flex-wrap: nowrap; /* 桌面端保持一行 */
    gap: 10px; /* 增加间距，让卡片更独立 */
    margin: 0 8px; /* 紧靠标题与用户名 */
    flex: 1 1 auto; /* 占据中间可用空间 */
    justify-content: space-between; /* 两端贴近，卡片均匀分布 */
    align-items: stretch;
}
.stat-inline .stat-card {
    margin-bottom: 0;
    /* 🎨 科研风格：简洁沉稳的阴影和边框，专业且不失时尚 */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 1px 1px rgba(0, 0, 0, 0.03);
    border: 1px solid #e5e7eb;
    border-radius: 6px; /* 适中的圆角，专业感 */
    flex: 1 1 0; /* 六卡等宽自适应 */
    min-width: 140px;
    /* 🎨 科研风格：使用纯白色背景，简洁大方，与灰色背景形成对比 */
    background: #ffffff;
    transition: all 0.2s ease; /* 平滑过渡效果 */
    cursor: pointer;
}
/* 🎨 悬停效果：轻微提升，保持专业感 */
.stat-inline .stat-card:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px); /* 轻微上浮，不过度 */
    border-color: #d1d5db;
}
/* 🎨 科研风格：使用沉稳专业的配色方案，左侧边框更粗，背景色更内敛 */
.stat-inline .stat-card[data-filter="all"] {
    border-left: 4px solid #3b82f6; /* 沉稳的蓝色 - 总设备 */
    /* 🎨 极微妙的蓝色调背景，几乎接近白色，专业且不失识别度 */
    background: #f8fafc;
}
.stat-inline .stat-card[data-filter="all"] .card-body {
    background: transparent !important;
}
.stat-inline .stat-card[data-filter="recent"] {
    border-left: 4px solid #10b981; /* 沉稳的绿色 - 最近在线 */
    /* 🎨 极微妙的绿色调背景 */
    background: #f0fdf4;
}
.stat-inline .stat-card[data-filter="recent"] .card-body {
    background: transparent !important;
}
.stat-inline .stat-card[data-filter="lowVoltage"] {
    border-left: 4px solid #f59e0b; /* 沉稳的橙色 - 低电压 */
    /* 🎨 极微妙的橙色调背景 */
    background: #fffbeb;
}
.stat-inline .stat-card[data-filter="lowVoltage"] .card-body {
    background: transparent !important;
}
.stat-inline .stat-card[data-filter="death"] {
    border-left: 4px solid #ef4444; /* 沉稳的红色 - 死亡预警 */
    /* 🎨 极微妙的红色调背景 */
    background: #fef2f2;
}
.stat-inline .stat-card[data-filter="death"] .card-body {
    background: transparent !important;
}
.stat-inline .stat-card[data-filter="geofence"] {
    border-left: 4px solid #06b6d4; /* 沉稳的青色 - 围栏预警 */
    /* 🎨 极微妙的青色调背景 */
    background: #ecfeff;
}
.stat-inline .stat-card[data-filter="geofence"] .card-body {
    background: transparent !important;
}
.stat-inline .stat-card[data-filter="invalidLoc"] {
    border-left: 4px solid #64748b; /* 沉稳的灰色 - 异常数据 */
    /* 🎨 极微妙的灰色调背景 */
    background: #f8fafc;
}
.stat-inline .stat-card[data-filter="invalidLoc"] .card-body {
    background: transparent !important;
}
.stat-inline .stat-card .card-body {
    padding: 8px 10px; /* 稍微增加内边距 */
    /* 🎨 确保card-body背景透明，让卡片的渐变背景显示出来 */
    background: transparent !important;
}
.stat-inline .card-title {
    font-size: 13px;
    font-weight: 500; /* 稍微加粗，更清晰 */
    color: #495057; /* 深一点的文字颜色 */
}
.stat-inline .card-number {
    font-weight: 700; /* 更粗的数字，更突出 */
    font-size: 18px; /* 稍微增大数字 */
}

.user-info {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* 卡片样式 */
.card {
    border-radius: var(--radius-2);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: var(--card-header-padding-y) var(--card-header-padding-x);
    background-color: white;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 统一卡片标题字号到变量，保持统计卡片等特殊样式的覆盖 */
.card-header h6 { font-size: var(--font-2); margin: 0; }
.card .card-title { font-size: var(--font-2); }
.card-header .page-title h4 { font-size: var(--font-2); }

.card-body {
    padding: var(--card-body-padding);
    background-color: white;
}
/* 🎨 确保统计卡片的card-body背景透明，让卡片的渐变背景显示出来 */
.stat-inline .stat-card .card-body {
    background-color: transparent !important;
    background: transparent !important;
}

/* 管理端统计卡片单行布局与紧凑样式 */
.stat-card .card-body { padding: var(--stat-card-body-padding-y) var(--stat-card-body-padding-x); }
.stat-card .card-title { font-size: var(--stat-title-font); margin: 0; }
.stat-card .stat-line {
    min-height: 28px;
    line-height: var(--stat-line-height);
}
.stat-card .card-number { font-size: var(--stat-number-font); font-weight: 600; }

/* 地图容器 */
.map-container {
    /* 默认高度，但优先使用父容器高度（通过 style="height: 100%" 覆盖） */
    height: 640px;
    /* 移除底部圆角，确保下沿与容器对齐 */
    border-radius: 0;
    overflow: hidden;
    /* 用户仪表盘卡片内不需要额外底部留白，避免露出空白 */
    margin-bottom: 0;
    /* 确保地图完全填充容器 */
    width: 100%;
}
.map-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 400px;
    padding: 32px;
    background: #f8f9fa;
    border: 1px dashed #ced4da;
}
.map-fallback-box { max-width: 420px; }
.map-fallback-icon {
    font-size: 48px;
    color: #0d6efd;
    margin-bottom: 12px;
}
.map-fallback-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.map-fallback-message {
    color: #6c757d;
    margin-bottom: 16px;
}
/* 地图容器全屏支持 */
#mapContainer:fullscreen,
.map-container:fullscreen {
    width: 100vw;
    height: 100vh;
}
#mapContainer:-webkit-full-screen,
.map-container:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
}
#mapContainer:-ms-fullscreen,
.map-container:-ms-fullscreen {
    width: 100vw;
    height: 100vh;
}
/* 设备详情地图容器全屏支持（与管理端一致） */
#deviceMapContainer:fullscreen {
    width: 100vw;
    height: 100vh;
}
#deviceMapContainer:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
}
#deviceMapContainer:-ms-fullscreen {
    width: 100vw;
    height: 100vh;
}
/* 用户仪表盘卡片（mapCard）触发全屏时，强制子容器填满视口 */
#mapCard:fullscreen,
#mapCard:-webkit-full-screen,
#mapCard:-ms-fullscreen {
    width: 100vw;
    height: 100vh;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}
#mapCard:fullscreen #mapContainer,
#mapCard:-webkit-full-screen #mapContainer,
#mapCard:-ms-fullscreen #mapContainer {
    width: 100vw;
    height: 100vh;
    margin: 0 !important;
}
#deviceMapCard:fullscreen,
#deviceMapCard:-webkit-full-screen,
#deviceMapCard:-ms-fullscreen {
    width: 100vw;
    height: 100vh;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}
#deviceMapCard:fullscreen #deviceMapContainer,
#deviceMapCard:-webkit-full-screen #deviceMapContainer,
#deviceMapCard:-ms-fullscreen #deviceMapContainer {
    width: 100vw;
    height: 100vh;
    margin: 0 !important;
}
/* 卡片在全屏时消除内部留白，确保地图贴满 */
#mapCard:fullscreen .card-body,
#mapCard:-webkit-full-screen .card-body,
#mapCard:-ms-fullscreen .card-body {
    padding: 0 !important;
}
/* 设备详情地图容器稳定性增强，避免父元素塌陷导致瓦片错位 */
/* 注意：不使用 position: relative，避免影响天地图内部图层的坐标计算 */
#deviceMapContainer {
    min-height: 500px;
}

/* 设备详情页不再使用 no-zoom 局部覆盖，统一由全局变量控制视觉密度 */

/* 生态路线地图容器 */
#eco-map {
    width: 100%;
    height: 100%;
    min-height: 600px;
}

/* 设备列表样式 */
.device-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.device-item {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.device-item:last-child {
    border-bottom: none;
}

.device-item:hover {
    background-color: #f8f9fa;
}

.device-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 15px;
}

.status-online {
    background-color: var(--secondary-color);
}

.status-offline {
    background-color: var(--danger-color);
}

.status-warning {
    background-color: var(--warning-color);
}

.device-info {
    flex: 1;
}

.device-id {
    font-weight: 600;
    margin-bottom: 5px;
}

.device-meta {
    font-size: 12px;
    color: #6c757d;
}

.device-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0; /* 防止按钮区域被压缩导致文本换行 */
}

/* 设备列表与弹窗中的操作按钮保持单行显示，避免中文断行 */
/* 设备列表项中的按钮文本强制单行显示 */
.device-list .device-item .btn {
    white-space: nowrap;
    min-width: max-content; /* 根据内容扩展宽度，避免被压缩换行 */
}

/* 右侧按钮容器不允许被flex压缩，保持按钮一行显示 */
.device-list .device-item .d-flex > div:last-child {
    flex-shrink: 0;
}

/* 弹窗设备列表同样应用上述规则 */
#deviceListModal .device-item .btn {
    white-space: nowrap;
    min-width: max-content;
}
#deviceListModal .device-item .d-flex > div:last-child {
    flex-shrink: 0;
}

/* 表格样式 */
.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: left;
    padding: var(--table-cell-py) var(--table-cell-px);
    font-size: var(--table-header-font);
}

.data-table td {
    padding: var(--table-cell-py) var(--table-cell-px);
    border-top: 1px solid #e9ecef;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 表单样式 */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

/* 统一输入框与选择框尺寸到变量 */
.form-control,
.form-select {
    font-size: var(--form-font);
    padding: var(--form-padding-y) var(--form-padding-x);
    height: var(--form-height);
    line-height: 1.2;
}

.input-group .form-control,
.input-group .form-select {
    font-size: var(--form-font);
    padding: var(--form-padding-y) var(--form-padding-x);
    height: var(--form-height);
}

.form-control.form-control-sm,
.form-select.form-select-sm {
    font-size: var(--form-font-sm);
    padding: var(--form-padding-y-sm) var(--form-padding-x-sm);
    height: var(--form-height-sm);
}

/* 指令下发面板 */
.command-panel {
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.command-title {
    font-weight: 600;
    margin-bottom: 15px;
}

.command-form {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.command-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 数据详情面板 */
.data-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.data-item {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 15px;
    box-shadow: var(--box-shadow);
}

.data-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
}

.data-value {
    font-size: 18px;
    font-weight: 600;
}

/* 用户管理样式 */
.user-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.user-item {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
}

.user-item:last-child {
    border-bottom: none;
}

.user-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.user-role {
    font-size: 12px;
    color: #6c757d;
}

.user-actions {
    display: flex;
    gap: 10px;
}

/* 弹窗样式 */
.modal-content {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.modal-header {
    background-color: var(--light-color);
    border-bottom: 1px solid #e9ecef;
}

.modal-title {
    font-weight: 600;
}

/* 标签页样式 */
.nav-tabs .nav-link {
    color: #6c757d;
    border: none;
    padding: 10px 15px;
    border-bottom: 2px solid transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: transparent;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    border-bottom-color: #e9ecef;
}

/* 加载动画 */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
}
/* Admin 设备列表视觉强化 */
.device-list.list-group .list-group-item.device-item {
  padding: 12px 16px;
}
.device-list .device-item .badge {
  font-weight: 600;
}
.device-list .device-item .small i {
  color: #6c757d;
}
.device-list.list-group .list-group-item.device-item:hover {
  background-color: #f8f9fa;
}
/* 设备列表弹窗细节优化：增加左右内边距与合理的行布局 */
#deviceListModal .modal-body {
  padding: 16px; /* 兜底，防止类名覆盖导致无边距 */
}
#deviceListModal .device-list {
  padding: 0; /* 保持列表本身无额外外边距 */
}
#deviceListModal .device-item {
  padding: 12px 14px; /* 行内左右留白更自然 */
}
/* 避免 space-between 导致行内中间留白过大 */
#deviceListModal .device-item .d-flex.justify-content-between {
  justify-content: flex-start;
}
#deviceListModal .device-item .device-actions {
  margin-left: auto; /* 仍保持操作按钮靠右 */
}
#deviceListModal .device-item .device-header,
#deviceListModal .device-item .device-details {
  margin-right: 12px; /* 信息块之间留出适度空隙 */
}
/* 统一Bootstrap表格的单元格内边距以保持跨页一致性 */
.table th,
.table td {
    padding: var(--table-cell-py) var(--table-cell-px);
    line-height: var(--table-line-height);
}

/* 统一按钮尺寸到变量（默认与全站密度一致） */
.btn { font-size: var(--btn-font); padding: var(--btn-padding-y) var(--btn-padding-x); line-height: 1.2; }
.btn-sm { font-size: var(--btn-font-sm); padding: var(--btn-padding-y-sm) var(--btn-padding-x-sm); }
.modal-title { font-size: var(--modal-title-font); }
.modal-header { padding: var(--modal-header-padding-y) var(--modal-header-padding-x); }
h1 { font-size: var(--font-h1); }
h2 { font-size: var(--font-h2); }
h3 { font-size: var(--font-h3); }
h4 { font-size: var(--font-h4); }
h5 { font-size: var(--font-h5); }
h6 { font-size: var(--font-h6); }
.modal-body { padding: var(--modal-body-padding-y) var(--modal-body-padding-x); }
.modal-footer { padding: var(--modal-footer-padding-y) var(--modal-footer-padding-x); }
.modal-content { border-radius: var(--modal-radius); }
h1 { font-size: var(--font-h1); }
h2 { font-size: var(--font-h2); }
h3 { font-size: var(--font-h3); }
h4 { font-size: var(--font-h4); }
h5 { font-size: var(--font-h5); }
h6 { font-size: var(--font-h6); }
.alert { font-size: var(--alert-font); padding: var(--alert-padding-y) var(--alert-padding-x); }
.badge { font-size: var(--badge-font); padding: var(--badge-padding-y) var(--badge-padding-x); }
.dropdown-menu .dropdown-item { font-size: var(--dropdown-font); padding: var(--dropdown-item-py) var(--dropdown-item-px); }
.tooltip .tooltip-inner { font-size: var(--tooltip-font); padding: var(--tooltip-padding-y) var(--tooltip-padding-x); }
.popover .popover-body { font-size: var(--popover-font); padding: var(--popover-body-py) var(--popover-body-px); }
.recent-data-compact th,
.recent-data-compact td { font-size: var(--recent-table-font); white-space: nowrap; padding: var(--recent-table-padding-y) var(--recent-table-padding-x); }
.recent-data-compact-wrapper { overflow-x: auto; overflow-y: auto; }
.print-hidden { display: none !important; }
/* 设备详情页右侧面板样式：缩小1/3并右对齐 */
@media (min-width: 768px) {
    .device-detail-right-panel {
        flex: 0 0 22.222%; /* 缩小1/3：原33.333% × 2/3 = 22.222% */
        max-width: 22.222%;
        margin-left: auto; /* 右对齐 */
    }
    
    /* 设备详情页地图区域：相应增加宽度，自动填充剩余空间 */
    .device-detail-ui .row > .col-md-9 {
        flex: 1 1 auto; /* 自动填充剩余空间 */
        max-width: none; /* 移除最大宽度限制 */
    }
}

@media print {
  html, body { font-size: 12px; }
  .card { box-shadow: none; }
  .btn, .navbar, .sidebar, .topbar .btn, .print-hidden { display: none !important; }
  .table th, .table td { padding: 8px 12px; }
  .map-container { height: auto; }
}
