/**
 * IoTOS 2.0 - 全局样式
 * CSS重置、全局变量、表格通用修复(P0)
 */

/* ====== CSS Reset ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
}

/* ====== P0修复: Element Plus 表格表头（精确选择器，无!important）====== */
.el-table {
    table-layout: auto;
}

/* 表头单元格 */
.el-table .el-table__header th.el-table__cell {
    display: table-cell;
    vertical-align: middle;
    writing-mode: horizontal-tb;
}

/* 表头内容区域 */
.el-table .el-table__header-wrapper .cell,
.el-table .el-table__header .cell {
    white-space: nowrap;
    text-align: center;
    writing-mode: horizontal-tb;
    display: block;
    overflow: visible;
    text-overflow: clip;
}

/* thead 结构完整性 */
.el-table__header-wrapper {
    table-layout: auto !important;
}
.el-table__header-wrapper thead tr {
    display: table-row !important;
}
.el-table__header-wrapper thead {
    display: table-header-group !important;
}

/* 下拉列表显示修复 */
.el-select-dropdown__item {
    display: block !important;
}

/* ====== P0修复: 日期选择器日历保护（通过popper-class隔离）======
   popper-class="stop-date-calendar" 直接作用于teleport后的面板根元素 ====== */

/* 日历表格基础结构 */
.stop-date-calendar .el-date-table,
.stop-date-calendar table {
    table-layout: fixed !important;
    border-collapse: collapse !important;
    width: 100% !important;
}

/* 日历单元格 th/td */
.stop-date-calendar .el-date-table th,
.stop-date-calendar .el-date-table td {
    display: table-cell !important;
    vertical-align: middle !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 !important;
    writing-mode: horizontal-tb !important;
    min-width: 32px !important;
    height: 30px !important;
    border: none !important;
}

/* 日历日期数字内容 */
.stop-date-calendar .cell,
.stop-date-calendar .el-date-table-cell,
.stop-date-calendar .el-date-table-cell__text {
    display: block !important;
    width: 100% !important;
    height: 28px !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 !important;
    writing-mode: horizontal-tb !important;
    white-space: normal !important;
    overflow: visible !important;
    line-height: 28px !important;
}

/* 日星期表头（日 一 二 三 四 五 六） */
.stop-date-calendar thead th {
    display: table-cell !important;
    text-align: center !important;
    font-weight: 400 !important;
    padding: 6px 0 !important;
    writing-mode: horizontal-tb !important;
}

/* ====== 原生表格备用样式 ====== */
.device-table-native {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.device-table-native th,
.device-table-native td {
    border: 1px solid #ebeef5;
    padding: 10px 12px;
    text-align: center;
    font-size: 14px;
}
.device-table-native th {
    background: #f5f7fa;
    color: #606266;
    font-weight: 500;
}
.device-table-native tr:hover td {
    background: #f5f7fa;
}

/* 自定义地图表格样式 */
.custom-maps-table .el-table__header-wrapper {
    display: table-row !important;
}
.custom-maps-table .el-table__header th {
    display: table-cell !important;
}

/* 套餐管理表格样式 */
.package-table .el-table__header-wrapper {
    display: table-row !important;
}
.package-table .el-table__header-wrapper table {
    display: table !important;
    width: auto !important;
}
.package-table .el-table__header th.el-table__cell {
    display: table-cell !important;
}
.package-table .el-table__body-wrapper {
    display: block !important;
}

/* ====== 通用工具类（替代内联样式）====== */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }
.mb-20 { margin-bottom: 20px; }
.mt-15 { margin-top: 15px; }
.w-full { width: 100%; }
.text-center { text-align: center; }

/* ====== 头像上传 ====== */
.avatar-upload-wrapper {
    position: relative;
    cursor: pointer;
}
.avatar-upload-wrapper:hover .el-avatar,
.avatar-upload-wrapper:hover img {
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.2);
    opacity: 0.85;
}
.avatar-upload-wrapper:hover::after {
    content: '更换';
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #409eff;
}

/* ====== 空闲超时警告对话框 ====== */
.idle-warning-dialog .el-dialog__header {
    background: linear-gradient(135deg, #e6a23c, #f56c6c);
    padding: 16px 20px;
    margin-right: 0;
}
.idle-warning-dialog .el-dialog__title {
    color: #fff;
    font-weight: bold;
    font-size: 17px;
}
.idle-warning-dialog .el-dialog__headerbtn .el-dialog__close {
    color: #fff;
}
.idle-warning-dialog .el-dialog__body {
    padding: 24px 20px;
}
.idle-warning-dialog .el-dialog__footer {
    padding: 10px 20px 20px;
}
/**
 * IoTOS 2.0 - 布局样式
 * 主布局框架、侧边栏、顶部导航、主内容区
 */

/* ====== P2优化: 侧边栏统一图标 ====== */
.menu-icon {
    display: inline-block;
    width: 18px;
    text-align: center;
    margin-right: 6px;
    color: #5a9bd8;
    font-size: 10px;
    line-height: 1.2;
}
.el-menu-item.is-active .menu-icon {
    color: #409eff;
}

/* ====== 主布局 ====== */
.main-layout {
    height: 100vh;
    display: flex;
}

/* ====== 侧边栏 (H5轻量扁平版) ====== */
.sidebar {
    width: 220px;
    background: #FFFFFF;
    color: #475569;
    overflow-y: auto;
    flex-shrink: 0;
    border-right: 1px solid #E8ECF1;
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.02);
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 2px;
}

/* Logo 区域 - 白底蓝字，轻量风格 */
.logo {
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border-bottom: 1px solid #EEF0F3;
}

.logo h3 {
    color: #1E293B;
    font-size: 16px;
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 侧边栏菜单项 - 轻量风格 */
.sidebar .el-menu-item span {
    position: relative;
    padding-left: 18px;
}

/* 侧边栏菜单项 hover/active - 浅灰底 */
.sidebar .el-menu-item:hover,
.sidebar .el-menu-item.is-active {
    background-color: #F5F7FA !important;
}
/* 选中态左边蓝色竖线 */
.sidebar .el-menu-item.is-active {
    border-left: 3px solid var(--primary, #2563EB);
    color: var(--primary, #2563EB);
}

/* ====== 主内容区 ====== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0; /* 防止flex子项溢出 */
}

/* ====== 顶部导航栏 (H5轻量版) ====== */
.navbar {
    height: 56px;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
    z-index: 10;
}

/* ====== 内容区域 (H5冷灰色) ====== */
.app-main {
    flex: 1;
    padding: 20px;
    overflow: auto;
    background: #F1F5F9;
}

.app-main::-webkit-scrollbar {
    width: 6px;
}
.app-main::-webkit-scrollbar-thumb {
    background: #dcdfe6;
    border-radius: 3px;
}

/* 运营商卡片 - 轻量悬停 */
.operator-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.operator-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none !important;
}
/**
 * IoTOS 2.0 - 登录页样式 v2 (P2优化 - 左右分栏布局)
 * 左侧品牌展示区 + 右侧登录表单区
 * 大屏左右分栏，移动端上下堆叠
 */

/* ====== 登录容器：左右分栏 ====== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f0f2f5;
    position: relative;
    overflow: hidden;
}

/* 登录主卡片容器（包含左侧品牌+右侧表单） */
.login-box {
    display: flex;
    width: 860px;
    max-width: 92vw;
    min-height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow:
        0 4px 6px rgba(0,0,0,0.01),
        0 12px 24px rgba(0,0,0,0.06),
        0 24px 48px rgba(0,0,0,0.04);
    overflow: hidden;
    z-index: 1;
    animation: loginBoxIn 0.6s cubic-bezier(0.22,1,0.36,1);
}
@keyframes loginBoxIn {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ====== 左侧：品牌展示区 ====== */
.login-brand {
    width: 380px;
    min-width: 320px;
    flex-shrink: 0;
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 40%, #0f3460 70%, #1a3a5c 100%);
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* 装饰圆环 */
.login-brand::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 260px; height: 260px;
    border-radius: 50%;
    border: 1px solid rgba(64,158,255,0.12);
}
.login-brand::after {
    content: '';
    position: absolute;
    bottom: -50px; left: -50px;
    width: 180px; height: 180px;
    border-radius: 50%;
    border: 1px solid rgba(64,158,255,0.08);
}
.login-brand .brand-glow {
    position: absolute;
    top: 20%; right: 10%;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(64,158,255,0.06) 0%, transparent 70%);
    pointer-events: none;
}

/* Logo */
.login-brand .brand-logo {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 3px;
    margin-bottom: 8px;
    z-index: 1;
}
.login-brand .brand-logo span {
    color: #409eff;
}

/* Slogan */
.login-brand .brand-slogan {
    font-size: 14px;
    color: rgba(255,255,255,0.55);
    letter-spacing: 6px;
    margin-bottom: 32px;
    z-index: 1;
}

/* 特性列表 */
.login-brand .brand-features {
    list-style: none;
    padding: 0;
    margin: 0;
    z-index: 1;
}
.login-brand .brand-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    margin-bottom: 14px;
    transition: color 0.25s ease;
}
.login-brand .brand-features li:hover { color: rgba(255,255,255,0.9); }
.login-brand .brand-features li .feat-icon {
    width: 28px; height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.login-brand .brand-features li:nth-child(1) .feat-icon { background: rgba(103,194,58,0.15); color: #67c23a; }
.login-brand .brand-features li:nth-child(2) .feat-icon { background: rgba(64,158,255,0.15); color: #409eff; }
.login-brand .brand-features li:nth-child(3) .feat-icon { background: rgba(230,162,60,0.15); color: #e6a23c; }

/* 底部版本信息 */
.login-brand .brand-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.07);
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    letter-spacing: 1px;
    z-index: 1;
}

/* ====== 右侧：登录表单区 ====== */
.login-form-area {
    flex: 1;
    padding: 44px 42px 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}

/* 表单头部 */
.login-header {
    text-align: center;
    margin-bottom: 28px;
}
.login-header h1 {
    font-size: 22px;
    color: #303133;
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 1px;
}
.login-header p {
    font-size: 13px;
    color: #c0c4cc;
}

/* 表单区域 */
.login-form { }

/* 输入框聚焦效果 */
.login-form .el-input__wrapper:focus-within {
    box-shadow: 0 0 0 2px rgba(64,158,255,0.18);
    border-color: #409eff;
}

/* 验证码区域 */
.login-form .el-form-item:last-of-type {
    margin-bottom: 26px;
}

/* 登录按钮 */
#login-button {
    width: 100%;
    height: 46px;
    font-size: 16px;
    letter-spacing: 8px;
    border-radius: 10px;
    background: linear-gradient(135deg, #409EFF 0%, #337ecc 100%);
    border: none;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    position: relative;
    overflow: hidden;
}
#login-button::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}
#login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(64,158,255,0.3);
}
#login-button:hover::before { left: 100%; }
#login-button:active { transform: translateY(0); }

/* 底部提示文字 */
.login-form .login-tip {
    text-align: center;
    font-size: 12px;
    color: #c0c4cc;
    margin-top: 16px;
}

/* ====== 响应式：小屏幕上下堆叠 ====== */
@media (max-width: 768px) {
    .login-box {
        flex-direction: column-reverse;
        width: 94vw;
        min-height: auto;
        border-radius: 12px;
    }
    .login-brand {
        width: 100%;
        min-width: unset;
        padding: 28px 24px;
        min-height: 140px;
    }
    .login-brand .brand-logo { font-size: 22px; }
    .login-brand .brand-features { display: none; }
    .login-brand .brand-footer { display: none; }
    .login-form-area { padding: 32px 24px 28px; }
    .login-header h1 { font-size: 20px; }
}

@media (max-width: 480px) {
    .login-box { border-radius: 10px; }
    .login-form-area { padding: 24px 18px 22px; }
    .login-brand { padding: 20px 18px; min-height: 110px; }
    .login-brand .brand-slogan { letter-spacing: 3px; }
}
/**
 * IoTOS 2.0 - 仪表盘样式 (P2美化)
 * 统计卡片、趋势指示器
 */

/* 统计卡片容器 */
.dashboard-card {
    text-align: center;
    padding: 20px 15px;
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #409eff, #66b1ff);
    opacity: 0;
    transition: opacity 0.3s;
}

.el-card:hover .dashboard-card::before {
    opacity: 1;
}

/* 数值显示 */
.dashboard-value {
    font-size: 32px;
    font-weight: bold;
    color: #409EFF;
    line-height: 1.2;
    transition: color 0.3s;
}

/* 标签文字 */
.dashboard-label {
    font-size: 13px;
    color: #999;
    margin-top: 8px;
    letter-spacing: 0.5px;
}

/* 趋势指示器 */
.dashboard-trend {
    font-size: 12px;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.dashboard-trend.up {
    color: #67c23a;
}
.dashboard-trend.down {
    color: #f56c6c;
}
.dashboard-trend.neutral {
    color: #909399;
}

/* 特殊卡片状态 */
.dashboard-card.card-warning .dashboard-value {
    color: #E6A23C;
}
.dashboard-card.card-danger .dashboard-value {
    color: #F56C6C;
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0% { opacity: 1; }
    50% { opacity: 0.65; }
    100% { opacity: 1; }
}

/* 统计卡片hover动效 */
.stat-card .el-card__body {
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), box-shadow 0.3s ease;
}
.stat-card:hover .el-card__body {
    transform: translateY(-4px);
}
.stat-card:hover {
    box-shadow: 0 8px 24px rgba(64,158,255,0.1);
}
/**
 * IoTOS 2.0 - 物联卡管理样式
 * 表格、操作列(P0/P2修复)、设备分组树
 */

/* ====== P2优化: 操作列样式 ====== */
.action-btns {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.action-btns .el-button.is-link {
    padding: 2px 6px;
    font-size: 13px;
}

/* ====== P0修复: 设备开关机列不换行 ====== */
.cell-online-status {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    white-space: nowrap !important;
    line-height: 1;
}
.cell-online-status .el-tag {
    flex-shrink: 0;
}
.cell-online-status .el-button--text {
    flex-shrink: 0;
    padding: 2px 4px !important;
    margin-left: 4px !important;
    font-size: 12px !important;
}

/* ====== P2优化: 操作列按钮组 ====== */
.action-btns {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}
.action-btns .el-button.is-link {
    padding: 2px 4px;
    font-size: 13px;
}

/* 下拉更多菜单在操作列中的对齐 */
.action-btns .el-dropdown {
    vertical-align: middle;
}

/* ====== 设备分页 ====== */
.device-pagination {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

/* ====== 设备分组树形样式 ====== */
.device-group-tree {
    background: transparent;
}
.device-group-tree .el-tree-node {
    padding: 2px 0;
}
.device-group-tree .el-tree-node__content {
    height: 36px;
    border-radius: 6px;
    margin: 1px 4px;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.device-group-tree .el-tree-node__content:hover {
    background: #f5f7fa;
    border-color: #e4e7ed;
}
.device-group-tree .el-tree-node.is-current > .el-tree-node__content {
    background: #ecf5ff;
    border-color: #409eff;
    color: #409eff;
}
.device-group-tree .el-tree-node__content .el-tree-node__label {
    font-size: 13px;
    color: #606266;
}
.device-group-tree .el-tree-node.is-current .el-tree-node__label {
    color: #409eff;
    font-weight: 500;
}
.device-group-tree .el-tree-node__expand-icon {
    font-size: 12px;
    color: #909399;
}
.device-group-tree .el-tree-node__expand-icon.is-leaf {
    display: none;
}
/**
 * IoTOS 2.0 - 设备管理样式
 * Leaflet地图、位置编辑器、P2地图体验增强
 */

/* ====== Leaflet 地图容器 ====== */
#deviceMap,
#locationPickerMap {
    background: #f0f2f5;
    border-radius: 8px;
}

/* Leaflet 瓦片接缝修复 */
#deviceMap .leaflet-tile-pane,
#locationPickerMap .leaflet-tile-pane {
    -webkit-backface-visibility: hidden;
}

#deviceMap .leaflet-tile,
#locationPickerMap .leaflet-tile {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

#deviceMap .leaflet-tile-container,
#locationPickerMap .leaflet-tile-container {
    outline: none;
}

#deviceMap .leaflet-tile-loaded,
#locationPickerMap .leaflet-tile-loaded {
    margin: 0 !important;
    padding: 0 !important;
}

#deviceMap .leaflet-layer,
#locationPickerMap .leaflet-layer {
    background: transparent;
}

#deviceMap .leaflet-tile-pane,
#locationPickerMap .leaflet-tile-pane {
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================
   P2增强：自定义设备标记图标（在线/离线）
   ============================================ */
.custom-device-marker {
    background: none !important;
    border: none !important;
}

.marker-pin {
    width: 28px;
    height: 28px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 3px solid #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-icon {
    transform: rotate(45deg);
    font-size: 12px;
    color: white;
    line-height: 1;
}

.marker-label {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: bold;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

/* 在线设备脉冲动画 */
@keyframes marker-pulse-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

.marker-pulse-online {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(103, 194, 58, 0.25);
    animation: marker-pulse-ring 2s ease-out infinite;
    pointer-events: none;
    z-index: -1;
}

/* ============================================
   P2增强：位置选择器标记图标
   ============================================ */
.custom-picker-marker {
    background: none !important;
    border: none !important;
}

.picker-pin {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #409eff;
    border: 3px solid #fff;
    box-shadow: 0 3px 12px rgba(64, 158, 255, 0.5);
    position: relative;
}

.picker-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.picker-ring {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border: 2px solid #409eff;
    border-radius: 50%;
    opacity: 0.5;
    animation: picker-ring-pulse 1.5s ease-in-out infinite;
}

@keyframes picker-ring-pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 0.2; }
}

/* ============================================
   P2增强：设备详情弹窗样式
   ============================================ */
.device-popup-custom .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 0;
    overflow: hidden;
}

.device-popup-custom .leaflet-popup-tip {
    display: none;
}

.device-popup-custom .leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
}

.device-map-popup {
    min-width: 220px;
}

.popup-header {
    background: linear-gradient(135deg, #409eff, #337ecc);
    color: #fff;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.popup-body {
    padding: 12px 14px;
    background: #fff;
}

.popup-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f2f3f5;
    font-size: 13px;
}

.popup-row:last-child {
    border-bottom: none;
}

.popup-label {
    color: #909399;
    flex-shrink: 0;
    margin-right: 12px;
}

.popup-value {
    color: #303133;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

/* 默认弹窗样式（非自定义弹窗也优化） */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.leaflet-popup-content {
    margin: 12px 14px;
    font-size: 13px;
    line-height: 1.6;
}
.leaflet-popup-close-button {
    font-size: 18px;
    padding-top: 6px;
    width: 24px;
    height: 24px;
    text-align: center;
    color: #999;
}
.leaflet-popup-close-button:hover {
    color: #409eff;
}

/* ============================================
   P2增强：地图源选择控件
   ============================================ */
.map-source-control {
    background: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
    margin: 10px;
}

.map-source-select {
    padding: 6px 28px 6px 10px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    min-width: 130px;
    outline: none;
    appearance: auto;
    transition: all 0.2s ease;
    background-color: #fafafa;
}

.map-source-select:hover {
    border-color: #409eff;
    background-color: #fff;
}

.map-source-select:focus {
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.15);
}

/* ============================================
   P2增强：搜索控件
   ============================================ */
.map-search-control {
    position: absolute;
    top: 12px;
    left: 52px;
    z-index: 1000;
    background: #fff;
    padding: 6px 8px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    gap: 6px;
    align-items: center;
}

.map-search-input {
    padding: 7px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 13px;
    width: 170px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.map-search-input:focus {
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.15);
}

.map-search-btn {
    padding: 7px 10px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    background: linear-gradient(135deg, #409eff, #337ecc);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.map-search-btn:hover {
    background: linear-gradient(135deg, #337ecc, #2975c9);
    box-shadow: 0 2px 8px rgba(64, 158, 255, 0.3);
}

/* ============================================
   设备位置编辑区域
   ============================================ */
.location-editor {
    margin: 15px 0;
    padding: 16px 18px;
    background: #f5f7fa;
    border-radius: 8px;
    border: 1px solid #e4e7ed;
}
.location-editor .location-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: #606266;
    font-size: 14px;
}
.location-coords input {
    width: 150px;
    padding: 9px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}
.location-coords input:focus {
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.15);
}

/* 地图容器圆角和边框 */
#deviceMap {
    border: 1px solid #e4e7ed !important;
}
#locationPickerMap {
    border: 1px solid #e4e7ed !important;
}
/**
 * IoTOS 2.0 - 设置管理样式
 * 设置Tab页、短信配置、自定义地图等
 */

/* 设置页面内部间距 */
.settings-section {
    padding: 10px 0;
}

/* 分割线标题样式 */
.settings-divider {
    margin: 20px 0 15px !important;
}

/* 帮助提示文字 */
.settings-help-text {
    color: #999;
    font-size: 12px;
    margin-top: 5px;
    line-height: 1.6;
}
.settings-help-text strong {
    color: #606266;
}

/* 开关控件旁边的说明 */
.switch-hint {
    margin-left: 10px;
    color: #999;
    font-size: 12px;
}

/* 自定义地图表格 */
.custom-map-actions {
    margin-bottom: 15px;
}
/**
 * IoTOS 2.0 - 移动端响应式适配 (增强版)
 * 覆盖：平板(768px)、手机大屏(576px)、手机小屏(480px)、超小屏(375px)
 *
 * 增强内容：
 * R1: 导航栏（面包屑截断、用户名隐藏）
 * R2: 对话框全屏/自适应
 * R3: 搜索栏垂直堆叠 + 表格滚动
 * R4: 分页紧凑 + 操作列优化
 * R5: 地图高度 + 设置表单
 * R6: 遮罩层 + 触摸目标 + 安全区
 */

/* ============================================
   断点定义：
   ≤1024: 小型笔记本/平板横屏
   ≤768:  平板竖屏/手机横屏
   ≤576:  手机大屏
   ≤480:  手机常规屏
   ≤375:  iPhone SE等超小屏
   ============================================ */

/* ========== 小型笔记本 / 平板横屏 (≤1024px) ========== */
@media screen and (max-width: 1024px) {
    /* 对话框宽度自适应 */
    .el-dialog {
        width: 90% !important;
        max-width: 800px;
        margin-top: 8vh !important;
    }
}

/* ========== 平板竖屏 (≤768px) ========== */
@media screen and (max-width: 768px) {

    /* ====== R1: 导航栏 ====== */

    /* 移动端菜单按钮显示 */
    .mobile-menu-btn {
        display: block !important;
        min-width: auto !important;
        padding: 8px 10px !important;
    }

    /* 面包屑截断 */
    .navbar .el-breadcrumb {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .navbar .el-breadcrumb__item:last-child .el-breadcrumb__inner {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
    }

    /* 用户名在窄屏隐藏文字，只显示头像 */
    .navbar .el-dropdown > span > span:last-child {
        display: none;
    }

    /* ====== R2: 对话框 ====== */
    .el-dialog {
        width: 96vw !important;
        max-width: none;
        margin: 0 !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0 !important;
    }
    .el-dialog__headerbtn {
        font-size: 22px;
        right: 12px;
        top: 14px;
    }
    .el-dialog__body {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        padding: 16px !important;
    }
    .el-dialog__header {
        padding: 16px !important;
    }
    .el-dialog__footer {
        padding: 10px 16px !important;
    }

    /* 设备详情对话框中的描述列表双列变单列 */
    .el-descriptions--medium .el-descriptions__label,
    .el-descriptions--medium .el-descriptions__content {
        min-width: unset;
        word-break: break-all;
    }

    /* ====== R3: 搜索栏 + 表格 ====== */

    /* 搜索栏垂直堆叠 */
    .search-bar {
        flex-direction: column;
        gap: 10px;
        align-items: stretch !important;
    }
    .search-bar > div {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: stretch;
    }
    .search-bar .el-input,
    .search-bar .el-select {
        flex: 1 1 auto;
        min-width: 140px;
        max-width: none;
    }
    .search-bar .el-button-group {
        flex-wrap: wrap;
    }

    /* 表格外层添加横向滚动容器（由HTML结构决定） */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        margin-bottom: 15px;
    }

    /* 表格字体缩小 */
    .el-table { font-size: 13px; }
    .el-table th.el-table__cell, .el-table td.el-table__cell {
        padding: 8px 6px;
    }

    /* 操作列按钮组允许换行 */
    .action-btns {
        flex-wrap: wrap;
        gap: 2px;
        min-width: 160px;
        justify-content: center;
    }
    .action-btns .el-button.is-link {
        font-size: 12px;
        padding: 2px 4px;
    }

    /* ====== R4: 分页组件 ====== */
    .device-pagination,
    .el-pagination {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        padding: 10px 0;
    }
    .device-pagination .el-pager li {
        min-width: 28px;
        line-height: 28px;
    }

    /* ====== R5: 地图 + 设置表单 ====== */
    #deviceMap,
    #locationPickerMap {
        height: 350px !important;
    }

    /* 设置管理表单标签上移 */
    .el-form--label-top .el-form-item__label {
        padding-bottom: 4px;
    }
    .settings-form .el-form-item {
        margin-bottom: 18px;
    }

    /* ====== 布局基础 ====== */

    /* 主布局改为上下堆叠 */
    .main-layout {
        flex-direction: column;
    }

    /* 侧边栏变为可折叠覆盖层 */
    .sidebar {
        width: 260px !important;
        height: calc(100vh - 56px);
        max-height: 70vh;
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        z-index: 200;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
        border-radius: 0 0 12px 0;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateX(-100%);
    }
    .sidebar.show {
        display: block;
        transform: translateX(0);
    }

    /* 导航栏 */
    .navbar {
        padding: 0 12px;
        height: 56px;
        min-height: 56px;
        flex-shrink: 0;
    }

    /* 内容区内边距 */
    .app-main {
        padding: 14px 12px;
    }

    /* ====== 仪表盘卡片 ====== */
    .dashboard-value {
        font-size: 26px !important;
    }
    .dashboard-label {
        font-size: 12px !important;
    }
    .dashboard-trend {
        font-size: 11px !important;
    }
    .stat-card:hover .el-card__body {
        transform: translateY(-2px);
    }

    /* ====== 表单项 ====== */
    .el-form-item__label {
        float: none;
        text-align: left;
        margin-bottom: 6px;
        font-size: 13px;
    }
    .el-form-item__content {
        margin-left: 0 !important;
    }
    .el-input__inner {
        height: 38px;
        font-size: 14px;
    }

    /* ====== 按钮 ====== */
    .el-button-group {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    .el-button--default {
        padding: 9px 14px;
    }

    /* 卡片间距 */
    .el-col {
        margin-bottom: 12px;
    }

    /* 开关机列 */
    .cell-online-status {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 3px !important;
    }

    /* 运营商卡片 */
    .operator-card {
        margin-bottom: 12px;
    }

    /* 树形分组 */
    .device-group-tree .el-tree-node__content {
        height: 40px;
    }

    /* 地图搜索控件适配 */
    .map-search-control {
        left: 46px !important;
        top: 8px !important;
    }
    .map-search-input {
        width: 130px !important;
    }

    /* 地图源选择控件 */
    .map-source-control {
        margin: 8px !important;
    }
}

/* ========== 手机大屏 (≤576px) ========== */
@media screen and (max-width: 576px) {

    /* 登录页已在 login.css 中处理 */

    /* 导航栏进一步压缩 */
    .navbar {
        padding: 0 8px;
        height: 50px;
        min-height: 50px;
    }
    .mobile-menu-btn {
        padding: 6px 8px !important;
    }

    /* 面包屑只显示当前页 */
    .navbar .el-breadcrumb__item:first-child {
        display: none;
    }

    /* 对话框全屏确认 */
    .el-dialog {
        border-radius: 0 !important;
    }
    .el-dialog__body {
        max-height: calc(100vh - 110px);
        padding: 14px !important;
    }

    /* 仪表盘卡片更紧凑 */
    .dashboard-card {
        padding: 14px 10px !important;
    }
    .dashboard-value {
        font-size: 24px !important;
    }
    .dashboard-label {
        font-size: 11px !important;
    }
    .dashboard-trend {
        font-size: 10px !important;
    }
    /* 趋势箭头在小屏隐藏以节省空间 */
    .dashboard-trend {
        opacity: 0.7;
    }

    /* 表格字体更小 */
    .el-table {
        font-size: 12px !important;
    }
    .el-table th.el-table__cell, .el-table td.el-table__cell {
        padding: 7px 4px !important;
    }

    /* 操作列按钮更紧凑 */
    .action-btns {
        gap: 1px;
        min-width: 140px;
    }
    .action-btns .el-button.is-link {
        font-size: 11px !important;
        padding: 1px 3px !important;
    }

    /* 分页更紧凑 */
    .el-pagination .el-pager li {
        min-width: 26px;
        line-height: 26px;
        font-size: 12px;
    }

    /* 地图高度进一步减小 */
    #deviceMap,
    #locationPickerMap {
        height: 280px !important;
    }

    /* 按钮缩小 */
    .el-button {
        padding: 7px 11px;
        font-size: 13px;
    }
    .el-button.is-round {
        padding: 7px 15px;
    }

    /* 输入框 */
    .el-input__inner {
        font-size: 14px;
        height: 36px;
    }
    .el-select .el-input__inner {
        font-size: 13px;
    }

    /* 开关机列纵向排列 */
    .cell-online-status {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 3px !important;
    }

    /* 搜索栏输入框更宽 */
    .search-bar .el-input,
    .search-bar .el-select {
        min-width: 100%;
        flex-basis: 100%;
    }

    /* 描述列表单列模式 */
    .el-descriptions:not(.el-descriptions--small) {
        font-size: 12px;
    }
    .el-descriptions__label {
        font-weight: 600;
        color: #606266;
        white-space: nowrap;
    }

    /* 地图搜索控件 */
    .map-search-control {
        left: 42px !important;
        top: 6px !important;
        padding: 4px 6px !important;
    }
    .map-search-input {
        width: 110px !important;
        font-size: 12px !important;
        padding: 5px 8px !important;
    }
    .map-search-btn {
        padding: 5px 7px !important;
    }
    .map-source-control {
        margin: 6px !important;
        padding: 5px 7px !important;
    }
    .map-source-select {
        font-size: 12px !important;
        padding: 5px 24px 5px 8px !important;
        min-width: 110px !important;
    }

    /* 弹窗样式适配小屏 */
    .device-popup-custom .leaflet-popup-content-wrapper {
        max-width: 240px;
    }
    .popup-header {
        font-size: 13px !important;
        padding: 8px 10px !important;
    }
    .popup-body {
        padding: 8px 10px !important;
    }
    .popup-row {
        font-size: 11px !important;
        padding: 3px 0 !important;
    }
    .popup-label {
        font-size: 10px !important;
    }
    .popup-value {
        font-size: 11px !important;
    }

    /* 内容区边距更小 */
    .app-main {
        padding: 10px 8px;
    }
}

/* ========== 手机常规屏 (≤480px) ========== */
@media screen and (max-width: 480px) {

    /* 仪表盘极简模式 */
    .dashboard-card {
        padding: 10px 6px !important;
    }
    .dashboard-value {
        font-size: 20px !important;
    }
    .dashboard-label {
        font-size: 10px !important;
    }

    /* 表格最小字号 */
    .el-table {
        font-size: 11px !important;
    }

    /* 操作列图标式 */
    .action-btns .el-button.is-link {
        font-size: 10px !important;
        padding: 1px 2px !important;
    }
    .action-btns .el-dropdown .el-button.is-link {
        font-size: 10px !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
    }

    /* 地图高度最小化 */
    #deviceMap,
    #locationPickerMap {
        height: 230px !important;
    }

    /* 对话框标题缩小 */
    .el-dialog__title {
        font-size: 16px;
    }
    .el-dialog__headerbtn {
        font-size: 20px;
    }
}

/* ========== 超小屏 (≤375px) - iPhone SE 等 ========== */
@media screen and (max-width: 375px) {

    /* 仪表盘数值极限压缩 */
    .dashboard-value {
        font-size: 18px !important;
    }
    .dashboard-trend {
        display: none !important; /* 极限空间隐藏趋势 */
    }

    /* 表格操作列使用纯图标或省略次要按钮 */
    .action-btns .el-dropdown .el-button.is-link span {
        font-size: 0; /* 只保留"更多"下拉箭头 */
    }
    .action-btns .el-dropdown .el-button.is-link::after {
        content: '\22EE'; /* ⋮ */
        font-size: 14px;
    }

    /* 地图 */
    #deviceMap,
    #locationPickerMap {
        height: 200px !important;
    }

    /* 用户信息只显示头像 */
    .navbar .el-avatar {
        width: 28px !important;
        height: 28px !important;
        font-size: 11px !important;
    }
}

/* ============================================
   R6: 侧边栏遮罩层（点击外部关闭）
   ============================================ */

/* 遮罩层 - 仅在移动端侧边栏展开时显示 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 199;
    animation: overlayFadeIn 0.25s ease;
}
@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.sidebar-overlay.active {
    display: block;
}

/* ============================================
   R6: 触摸友好目标 (44x44 最小触摸区域)
   ============================================ */
@media screen and (max-width: 768px) {
    /* 侧边栏菜单项增加触摸区域 */
    .sidebar .el-menu-item {
        height: 48px !important;
        line-height: 48px !important;
    }
    .sidebar .el-menu-item .menu-icon {
        font-size: 12px;
        width: 20px;
    }

    /* 移动端菜单按钮增大 */
    .mobile-menu-btn .el-button {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .mobile-menu-btn .el-button span {
        font-size: 22px;
    }

    /* 所有可交互元素的最小触摸尺寸 */
    .el-button--default,
    .el-button--primary,
    .el-button--success,
    .el-button--warning,
    .el-button--danger,
    .el-button--info {
        min-height: 40px;
    }
    .el-tag {
        min-height: 30px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 10px;
    }

    /* 下拉菜单选项增大间距 */
    .el-select-dropdown__item {
        height: 40px;
        line-height: 40px;
        font-size: 14px;
    }

    /* 表格行高增加便于触控选择（如果有checkbox） */
    .el-table .el-checkbox {
        transform: scale(1.3);
    }
}

/* ============================================
   R6: iOS 安全区域支持 (iPhone X 及以上)
   ============================================ */
@supports (padding-top: env(safe-area-inset-top)) {
    @media screen and (max-width: 768px) {
        .navbar {
            padding-top: env(safe-area-inset-top, 0);
            padding-left: calc(12px + env(safe-area-inset-right, 0));
            padding-right: calc(12px + env(safe-area-inset-left, 0));
            height: calc(56px + env(safe-area-inset-top, 0));
            min-height: calc(56px + env(safe-area-inset-top, 0));
        }
        .app-main {
            padding-bottom: calc(14px + env(safe-area-inset-bottom, 0));
        }
        .sidebar {
            top: calc(56px + env(safe-area-inset-top, 0));
            height: calc(100vh - 56px - env(safe-area-inset-top, 0)) !important;
            max-height: calc(60vh - env(safe-area-inset-top, 0)) !important;
        }
        .el-dialog {
            padding-top: env(safe-area-inset-top, 0);
        }
        .el-dialog__footer {
            padding-bottom: calc(10px + env(safe-area-inset-bottom, 0)) !important;
        }
    }
}

/* ============================================
   横屏模式特殊处理
   ============================================ */
@media screen and (max-width: 900px) and (orientation: landscape) {
    /* 横屏模式下对话框不占满屏幕 */
    .el-dialog {
        width: 95vw !important;
        max-height: 95vh;
        margin: 2vh auto !important;
        border-radius: 8px !important;
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
    }
    .el-dialog__body {
        max-height: calc(95vh - 80px);
    }

    /* 横屏地图高度调整 */
    #deviceMap,
    #locationPickerMap {
        height: calc(100vh - 280px) !important;
        min-height: 250px;
    }

    /* 横屏登录页调整 */
    .login-box {
        max-width: 700px;
        min-height: auto;
    }
}

/* ============================================
   高DPI屏幕优化 (Retina)
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .leaflet-container img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ============================================
   回到顶部按钮
   ============================================ */
.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 40px;
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #409eff;
    cursor: pointer;
    z-index: 999;
    transition: all 0.25s ease;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
}
.back-to-top:hover {
    background: #409eff;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(64,158,255,0.35);
}
.back-to-top:active {
    transform: translateY(0);
}

/* 回到顶部过渡动画 */
.fade-enter-active, .fade-leave-active {
    transition: opacity 0.3s ease;
}
.fade-enter-from, .fade-leave-to {
    opacity: 0;
}

@media screen and (max-width: 768px) {
    .back-to-top {
        right: 16px;
        bottom: 24px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* ============================================
   打印样式（可选）
   ============================================ */
@media print {
    .sidebar,
    .navbar,
    .mobile-menu-btn,
    .sidebar-overlay {
        display: none !important;
    }
    .main-layout {
        flex-direction: column;
    }
    .app-main {
        padding: 0;
        overflow: visible;
    }
    .el-dialog {
        position: static;
        width: 100% !important;
        height: auto !important;
        box-shadow: none !important;
    }
}
/**
 * IoTOS 地图仪表盘 - AI分析面板样式
 * 
 * 包含：
 * - AI面板容器样式
 * - 健康度环形图
 * - AI洞察卡片
 * - 统计卡片网格
 * - 告警列表样式
 * - 数据流面板样式
 */

/* ===== AI面板通用样式 ===== */
.ai-panel-left,
.ai-panel-right {
    background: rgba(15, 23, 45, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(64, 158, 255, 0.2);
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 30px rgba(64, 158, 255, 0.1);
    overflow-y: auto;
}

.ai-panel-left::-webkit-scrollbar,
.ai-panel-right::-webkit-scrollbar {
    width: 4px;
}

.ai-panel-left::-webkit-scrollbar-thumb,
.ai-panel-right::-webkit-scrollbar-thumb {
    background: rgba(64, 158, 255, 0.3);
    border-radius: 4px;
}

/* 面板头部 */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(64, 158, 255, 0.2);
}

.panel-title {
    font-size: 15px;
    font-weight: 700;
    color: #409eff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(64, 158, 255, 0.15);
    color: #66b1ff;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ===== 健康度环形图 ===== */
.health-ring-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 18px 0;
    padding: 16px;
    background: rgba(103, 194, 58, 0.06);
    border-radius: 12px;
    border: 1px solid rgba(103, 194, 58, 0.2);
}

.health-ring {
    width: 90px;
    height: 90px;
    position: relative;
    flex-shrink: 0;
}

.health-ring svg {
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: rgba(103, 194, 58, 0.15);
    stroke-width: 6;
}

.ring-fill {
    fill: none;
    stroke: #67c23a;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.health-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.health-number {
    font-size: 26px;
    font-weight: 800;
    color: #67c23a;
    line-height: 1;
}

.health-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.health-info {
    flex: 1;
}

.health-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #fff;
}

.health-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

.health-trend {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(103, 194, 58, 0.15);
    color: #67c23a;
}

/* ===== AI洞察卡片 ===== */
.insight-card {
    background: linear-gradient(135deg, rgba(64, 158, 255, 0.1) 0%, rgba(64, 158, 255, 0.03) 100%);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
    border-left: 4px solid #409eff;
    animation: slideInLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.3s ease;
    cursor: default;
}

.insight-card:hover {
    transform: translateX(4px);
    background: linear-gradient(135deg, rgba(64, 158, 255, 0.15) 0%, rgba(64, 158, 255, 0.05) 100%);
    box-shadow: 0 4px 20px rgba(64, 158, 255, 0.15);
}

.insight-card.warning {
    border-left-color: #e6a23c;
}

.insight-card.success {
    border-left-color: #67c23a;
}

.insight-card.danger {
    border-left-color: #f56c6c;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.insight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.insight-icon {
    font-size: 22px;
}

.insight-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 6px;
}

.type-info {
    background: rgba(64, 158, 255, 0.2);
    color: #66b1ff;
}

.type-warning {
    background: rgba(230, 162, 60, 0.2);
    color: #e6a23c;
}

.type-success {
    background: rgba(103, 194, 58, 0.2);
    color: #67c23a;
}

.type-danger {
    background: rgba(245, 108, 108, 0.2);
    color: #f56c6c;
}

.insight-text {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
}

.insight-text strong {
    color: #fff;
    font-weight: 600;
}

.insight-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 6px;
}

/* ===== 统计卡片网格 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.stat-mini-card {
    background: linear-gradient(145deg, rgba(64, 158, 255, 0.1), rgba(64, 158, 255, 0.02));
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    border: 1px solid rgba(64, 158, 255, 0.15);
    transition: all 0.3s ease;
    cursor: default;
}

.stat-mini-card:hover {
    transform: translateY(-3px);
    border-color: rgba(64, 158, 255, 0.4);
    box-shadow: 0 6px 24px rgba(64, 158, 255, 0.2);
}

.stat-val {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.stat-lbl {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-trend {
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
}

.trend-up {
    background: rgba(103, 194, 58, 0.15);
    color: #67c23a;
}

.trend-down {
    background: rgba(245, 108, 108, 0.15);
    color: #f56c6c;
}

/* ===== 告警面板样式 ===== */
.alert-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(245, 108, 108, 0.15);
    color: #f56c6c;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(245, 108, 108, 0.3);
}

.alert-item {
    background: rgba(245, 108, 108, 0.06);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    border-left: 4px solid #f56c6c;
    animation: slideInRight 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    transition: all 0.25s ease;
}

.alert-item.warning {
    border-left-color: #e6a23c;
    background: rgba(230, 162, 60, 0.06);
}

.alert-item.info {
    border-left-color: #409eff;
    background: rgba(64, 158, 255, 0.06);
}

.alert-item.success {
    border-left-color: #67c23a;
    background: rgba(103, 194, 58, 0.06);
}

.alert-item:hover {
    transform: translateX(4px);
    filter: brightness(1.05);
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.alert-icon {
    font-size: 18px;
    margin-right: 8px;
    vertical-align: middle;
}

.alert-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.alert-detail {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
}

.alert-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 6px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* ===== 数据流面板样式 ===== */
.data-stream-panel {
    background: rgba(15, 23, 45, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(64, 158, 255, 0.2);
    padding: 18px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 30px rgba(64, 158, 255, 0.1);
}

.stream-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.stream-title {
    font-size: 14px;
    font-weight: 700;
    color: #409eff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #67c23a;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #67c23a;
    animation: live-pulse 1.5s infinite;
}

@keyframes live-pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgba(103, 194, 58, 0.5); 
    }
    50% { 
        opacity: 0.5; 
        transform: scale(1.1); 
        box-shadow: 0 0 0 4px rgba(103, 194, 58, 0); 
    }
}

.stream-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

.stream-metric {
    text-align: center;
    padding: 12px 8px;
    background: rgba(64, 158, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(64, 158, 255, 0.1);
    transition: all 0.3s ease;
}

.stream-metric:hover {
    background: rgba(64, 158, 255, 0.1);
    border-color: rgba(64, 158, 255, 0.3);
    transform: translateY(-2px);
}

.metric-value {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.metric-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mini-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 28px;
    gap: 2px;
    margin-top: 8px;
}

.chart-bar {
    flex: 1;
    max-width: 24px;
    background: linear-gradient(to top, #409eff, #66b1ff);
    border-radius: 2px 2px 0 0;
    min-height: 3px;
    animation: bar-grow 0.8s ease forwards;
    transition: height 0.3s ease;
}

@keyframes bar-grow {
    from { height: 0; }
}

/* ===== 模式切换按钮组 ===== */
.mode-switcher {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(64, 158, 255, 0.2);
}

.mode-btn {
    padding: 7px 16px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.mode-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.mode-btn.active {
    background: linear-gradient(135deg, #409eff, #66b1ff);
    color: #fff;
    box-shadow: 0 2px 10px rgba(64, 158, 255, 0.35);
}

/* ===== 响应式适配 ===== */
@media (max-width: 1500px) {
    .ai-panel-left,
    .ai-panel-right {
        max-height: calc(100vh - 140px);
    }
    
    .stream-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1200px) {
    .ai-panel-left,
    .ai-panel-right,
    .data-stream-panel {
        position: relative !important;
        width: 100% !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        top: auto !important;
        max-height: none;
        margin: 10px 0;
    }
    
    .stream-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ================================================================
 * IoTOS AI智能指挥中心 - SPA集成布局样式 (index.php内嵌)
 * ================================================================ */

/* 仪表盘视图容器 */
.map-dashboard-view {
    width: 100%;
    min-height: calc(100vh - 120px);
    background: #0a0e27;
    border-radius: 12px;
    overflow: hidden;
}

/* 顶部工具栏 */
.md-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(90deg, rgba(15,23,42,0.98), rgba(30,41,82,0.95));
    border-bottom: 1px solid rgba(64,158,255,0.2);
    flex-wrap: wrap;
    gap: 10px;
}
.md-topbar-left { display: flex; align-items: center; gap: 10px; }
.md-title { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: 0.5px; }
.md-topbar-center { display: flex; align-items: center; }
.md-topbar-right { display: flex; align-items: center; gap: 14px; }

.md-status {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: rgba(255,255,255,0.6);
}
.md-status-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #f56c6c;
    transition: background 0.3s;
}
.md-status-dot.online { background: #67c23a; box-shadow: 0 0 6px rgba(103,194,58,0.5); }

.md-clock {
    font-size: 13px; color: rgba(255,255,255,0.7);
    font-family: 'Courier New', monospace; font-weight: 600;
    letter-spacing: 1px;
}

/* 三栏主体布局 */
.md-main-layout {
    display: grid;
    grid-template-columns: 300px 1fr 280px;
    gap: 0;
    height: calc(100vh - 220px);
    min-height: 500px;
    position: relative;
}

/* 左侧AI面板 */
.md-ai-panel {
    background: rgba(15,23,42,0.97);
    backdrop-filter: blur(20px);
    padding: 16px;
    overflow-y: auto;
    border-right: 1px solid rgba(64,158,255,0.12);
}
.md-ai-panel::-webkit-scrollbar { width: 4px; }
.md-ai-panel::-webkit-scrollbar-thumb { background: rgba(64,158,255,0.3); border-radius: 4px; }

.md-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 1px solid rgba(64,158,255,0.15);
}
.md-panel-title { font-size: 14px; font-weight: 700; color: #409eff; }

/* 健康度区域 */
.md-health-section { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.md-health-ring { flex-shrink: 0; }
.md-health-info { flex: 1; min-width: 0; }
.md-health-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; transition: color 0.3s; }
.md-health-desc { font-size: 11px; color: rgba(255,255,255,0.5); line-height: 1.5; }

/* AI洞察列表 */
.md-insights-list { margin-bottom: 16px; }
.md-loading-hint { text-align: center; padding: 20px; }

/* 统计网格 */
.md-stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}

/* 中间地图区域 */
.md-map-area {
    position: relative;
    background: #0a0e27;
}
.md-map-container {
    width: 100%;
    height: 100%;
    min-height: 500px;
}

/* 右侧告警面板 */
.md-alert-panel {
    background: rgba(15,23,42,0.97);
    backdrop-filter: blur(20px);
    padding: 16px;
    overflow-y: auto;
    border-left: 1px solid rgba(64,158,255,0.12);
}
.md-alert-panel::-webkit-scrollbar { width: 4px; }
.md-alert-panel::-webkit-scrollbar-thumb { background: rgba(230,162,60,0.3); border-radius: 4px; }

.alert-count-badge {
    font-size: 11px; color: #e6a23c; font-weight: 600;
}
.md-alerts-list { margin-top: 10px; }
.md-no-alerts {
    text-align: center; padding: 40px 16px; color: rgba(255,255,255,0.4);
}

/* 底部数据流面板 */
.md-data-stream {
    margin-top: 12px;
    padding: 14px 20px;
    background: rgba(15,23,42,0.95);
    border-top: 1px solid rgba(64,158,255,0.12);
}

/* 图例（在地图区域内绝对定位） */
.map-legend {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 1000;
    display: flex;
    gap: 14px;
    padding: 8px 14px;
    background: rgba(15,23,42,0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(64,158,255,0.2);
    font-size: 11px;
    color: rgba(255,255,255,0.7);
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-online { background: #67c23a; box-shadow: 0 0 4px rgba(103,194,58,0.5); }
.dot-offline { background: #909399; }
.legend-triangle {
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 9px solid #e6a23c;
}

/* 响应式适配 */
@media (max-width: 1400px) {
    .md-main-layout { grid-template-columns: 260px 1fr 240px; }
    .md-ai-panel, .md-alert-panel { padding: 12px; }
}
@media (max-width: 1100px) {
    .md-main-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 500px auto;
        height: auto;
    }
    .md-ai-panel, .md-alert-panel {
        border-right: none; border-left: none;
        border-bottom: 1px solid rgba(64,158,255,0.12);
        max-height: 300px;
    }
    .map-area { min-height: 400px; }
}
/**
 * IoTOS 地图仪表盘 - 大屏展示模式样式
 * 
 * 包含：
 * - 大屏模式容器布局
 * - 扫描线动画效果
 * - 粒子背景效果
 * - 数字滚动效果
 * - 全屏适配样式
 * - 多分辨率适配
 */

/* ===== 大屏模式基础样式 ===== */
body.bigscreen-mode {
    overflow: hidden;
    background: #050a1e;
}

.bigscreen-mode .main-container {
    position: relative;
    width: 100vw;
    height: calc(100vh - var(--bs-header-height, 80px));
    margin-top: var(--bs-header-height, 80px);
}

/* 大屏顶部标题栏 */
.bigscreen-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--bs-header-height, 80px);
    background: linear-gradient(180deg, rgba(6, 18, 48, 0.98) 0%, rgba(6, 18, 48, 0.85) 100%);
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, transparent, #409eff, transparent) 1;
    padding: 16px 40px;
    text-align: center;
    z-index: 2000;
    box-shadow: 0 4px 30px rgba(64, 158, 255, 0.3);
}

.screen-title {
    font-size: clamp(24px, 3vw, 42px);
    font-weight: 800;
    letter-spacing: 8px;
    background: linear-gradient(135deg, #409eff, #66b1ff, #a0cfff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(64, 158, 255, 0.5);
    margin: 0;
}

.header-time {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    font-size: clamp(14px, 1.5vw, 20px);
    color: rgba(255, 255, 255, 0.7);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* 大屏主容器 */
.bigscreen-container {
    display: grid;
    grid-template-columns: var(--bs-left-panel-width, 280px) 1fr var(--bs-right-panel-width, 280px);
    grid-template-rows: 1fr var(--bs-bottom-panel-height, 200px);
    gap: var(--bs-panel-gap, 12px);
    padding: var(--bs-panel-gap, 12px);
    height: 100%;
}

/* 大屏面板通用 */
.bs-panel {
    background: linear-gradient(145deg, rgba(10, 25, 60, 0.95), rgba(15, 35, 80, 0.9));
    border-radius: var(--bs-border-radius, 10px);
    border: 1px solid rgba(64, 158, 255, 0.2);
    padding: var(--bs-padding, 16px);
    position: relative;
    overflow: hidden;
}

.bs-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #409eff, transparent);
}

.bs-panel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #409eff);
}

/* 面板标题 */
.bs-panel-title {
    font-size: clamp(12px, 1.2vw, 15px);
    font-weight: 700;
    color: #409eff;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: 1px;
}

/* 中央地图区域 */
.center-map-area {
    grid-row: 1 / 3;
    position: relative;
    border-radius: var(--bs-border-radius, 10px);
    overflow: hidden;
    border: 1px solid rgba(64, 158, 255, 0.25);
    box-shadow:
        0 0 40px rgba(64, 158, 255, 0.15),
        inset 0 0 60px rgba(0, 0, 0, 0.35);
}

/* 地图装饰角 */
.map-corner {
    position: absolute;
    width: 60px;
    height: 60px;
    z-index: 999;
    pointer-events: none;
}

.corner-tl { top: 0; left: 0; border-top: 3px solid #409eff; border-left: 3px solid #409eff; }
.corner-tr { top: 0; right: 0; border-top: 3px solid #409eff; border-right: 3px solid #409eff; }
.corner-bl { bottom: 0; left: 0; border-bottom: 3px solid #409eff; border-left: 3px solid #409eff; }
.corner-br { bottom: 0; right: 0; border-bottom: 3px solid #409eff; border-right: 3px solid #409eff; }

/* 底部图表区 */
.bottom-charts {
    grid-column: 1 / 4;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--bs-panel-gap, 12px);
}

.chart-container {
    background: linear-gradient(145deg, rgba(10, 25, 60, 0.95), rgba(15, 35, 80, 0.9));
    border-radius: var(--bs-border-radius, 10px);
    border: 1px solid rgba(64, 158, 255, 0.2);
    padding: 14px;
    position: relative;
}

/* 柱状图样式 */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 100px;
    margin-top: 12px;
    gap: 6px;
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.bar {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(to top, #409eff, #66b1ff);
    border-radius: 4px 4px 0 0;
    min-height: 8px;
    animation: barGrowBigScreen 1s ease forwards;
    transition: height 0.3s ease;
}

.bar::after {
    content: attr(data-value);
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.bar-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

@keyframes barGrowBigScreen {
    from { height: 0; }
}

/* 统计数字大屏样式 */
.stat-number-big {
    font-size: clamp(28px, 3vw, 48px);
    font-weight: 900;
    color: #fff;
    line-height: 1;
    margin: 8px 0;
    font-variant-numeric: tabular-nums;
}

.stat-unit-big {
    font-size: clamp(12px, 1.2vw, 16px);
    color: rgba(255, 255, 255, 0.5);
    margin-left: 4px;
}

.stat-desc-big {
    font-size: clamp(11px, 1vw, 13px);
    color: rgba(255, 255, 255, 0.45);
    margin-top: 4px;
}

/* 进度环大屏版 */
.progress-ring-big {
    width: clamp(120px, 10vw, 160px);
    height: clamp(120px, 10vw, 160px);
    margin: 20px auto;
    position: relative;
}

.progress-ring-big svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.progress-bg-big {
    fill: none;
    stroke: rgba(64, 158, 255, 0.15);
    stroke-width: 8;
}

.progress-fill-big {
    fill: none;
    stroke: #67c23a;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-text-big {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-value-big {
    font-size: clamp(22px, 2.5vw, 36px);
    font-weight: 800;
    color: #fff;
}

.progress-label-big {
    font-size: clamp(11px, 1vw, 13px);
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

/* ===== 特效系统样式 ===== */

/* 扫描线效果 */
.scan-line-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #409eff, transparent);
    animation: scanMove 3s linear infinite;
    z-index: 998;
    pointer-events: none;
    opacity: 0.7;
}

@keyframes scanMove {
    0% { top: 0; }
    100% { top: 100%; }
}

/* 粒子背景 */
.bg-particle {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

/* 数字滚动效果容器 */
.number-roll-container {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
}

/* 脉冲发光效果 */
.glow-pulse {
    animation: glowPulseAnim 2s ease-in-out infinite alternate;
}

@keyframes glowPulseAnim {
    from { 
        box-shadow: 0 0 15px currentColor; 
        filter: brightness(1); 
    }
    to { 
        box-shadow: 0 0 30px currentColor, 0 0 60px currentColor; 
        filter: brightness(1.2); 
    }
}

/* ===== 列表项大屏样式 ===== */
.list-item-big {
    background: rgba(64, 158, 255, 0.06);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-left: 3px solid #409eff;
    font-size: clamp(11px, 1.1vw, 13px);
    transition: all 0.3s;
    animation: slideInLeft 0.3s ease;
}

.list-item-big:hover {
    background: rgba(64, 158, 255, 0.12);
    transform: translateX(6px);
}

.list-item-name-big {
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.list-item-info-big {
    color: rgba(255, 255, 255, 0.65);
    font-size: clamp(10px, 1vw, 12px);
}

.status-badge-big {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-online-big {
    background: rgba(103, 194, 58, 0.2);
    color: #67c23a;
}

.status-offline-big {
    background: rgba(144, 147, 153, 0.2);
    color: #909399;
}

/* ===== 全屏控制按钮 ===== */
.fullscreen-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 3000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(64, 158, 255, 0.2);
    border: 2px solid rgba(64, 158, 255, 0.4);
    color: #409eff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.fullscreen-toggle:hover {
    background: rgba(64, 158, 255, 0.4);
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(64, 158, 255, 0.4);
}

/* ===== 分辨率适配 ===== */

/* 1080p (1920x1080) */
@media (max-width: 1920px) {
    .bigscreen-container {
        --bs-left-panel-width: 260px;
        --bs-right-panel-width: 260px;
    }
    
    .stat-number-big { font-size: 36px; }
    .bottom-charts { grid-template-columns: repeat(4, 1fr); }
}

/* 2K (2560x1440) */
@media (min-width: 1921px) and (max-width: 2560px) {
    .bigscreen-container {
        --bs-left-panel-width: 320px;
        --bs-right-panel-width: 340px;
    }
    
    .stat-number-big { font-size: 44px; }
    .bottom-charts { grid-template-columns: repeat(4, 1fr); }
}

/* 4K (3840x2160) */
@media (min-width: 2561px) {
    .bigscreen-container {
        --bs-left-panel-width: 400px;
        --bs-right-panel-width: 420px;
        --bs-bottom-panel-height: 240px;
        --bs-panel-gap: 20px;
    }
    
    .stat-number-big { font-size: 56px; }
    .bottom-charts { grid-template-columns: repeat(4, 1fr); }
    
    .fullscreen-toggle {
        width: 64px;
        height: 64px;
        font-size: 28px;
        bottom: 30px;
        right: 30px;
    }
}

/* 字体缩放系统 */
html {
    font-size: var(--font-scale, 1em);
}

.font-scale-small { --font-scale: 0.85em; }
.font-scale-normal { --font-scale: 1em; }
.font-scale-large { --font-scale: 1.2em; }
.font-scale-xlarge { --font-scale: 1.5em; }

/* ===== 动画性能优化 ===== */
.bigscreen-mode * {
    will-change: auto;
}

.bigscreen-mode .chart-bar,
.bigscreen-mode .marker-pulse,
.bigscreen-mode .bg-particle,
.bigscreen-mode .scan-line-effect {
    will-change: transform, opacity;
}

/* 减少动画（无障碍） */
@media (prefers-reduced-motion: reduce) {
    .scan-line-effect,
    .marker-pulse,
    .live-dot,
    .glow-pulse {
        animation: none !important;
    }
    
    .bar,
    .bar-grow {
        animation-duration: 0.01ms !important;
    }
}
/**
 * IoTOS 地图仪表盘 - 地图核心样式
 * 
 * 包含：
 * - 地图容器和布局
 * - 设备标记样式（在线/离线/警告）
 * - Popup弹窗样式
 * - 标记聚合样式
 * - 阀门标记样式
 * - 图层控制样式
 */

/* ===== 地图容器 ===== */
.map-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: #0a0e27;
}

#mapDashboard {
    width: 100%;
    height: 100%;
    min-height: 600px;
}

/* 地图装饰边框 */
.map-border-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 999;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(64, 158, 255, 0.15);
}

/* ===== 设备标记样式 ===== */
.custom-device-marker {
    background: transparent !important;
    border: none !important;
}

.marker-body {
    position: relative;
    width: 34px;
    height: 34px;
}

.marker-pulse {
    position: absolute;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(103, 194, 58, 0.5) 0%, rgba(103, 194, 58, 0) 70%);
    animation: marker-pulse-anim 2s infinite;
    pointer-events: none;
}

.marker-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.marker-dot.online {
    background: #67C23A;
}

.marker-dot.offline {
    background: #909399;
}

.marker-dot.warning {
    background: #E6A23C;
}

@keyframes marker-pulse-anim {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* ===== Popup弹窗样式 ===== */
.device-popup-content {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.device-name {
    font-size: 15px;
    font-weight: 700;
    color: #409eff;
}

.status-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.popup-status-online {
    background: rgba(103, 194, 58, 0.2);
    color: #67c23a;
}

.popup-status-offline {
    background: rgba(144, 147, 153, 0.2);
    color: #909399;
}

.popup-body {
    margin-bottom: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 12px;
}

.popup-label {
    color: rgba(255, 255, 255, 0.5);
}

.popup-value {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.popup-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.popup-btn {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(64, 158, 255, 0.2);
    background: rgba(64, 158, 255, 0.1);
    color: #66b1ff;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.popup-btn:hover {
    background: #409eff;
    color: #fff;
    border-color: #409eff;
}

.popup-btn.primary {
    background: linear-gradient(135deg, #409eff, #66b1ff);
    color: #fff;
    border-color: transparent;
}

/* Leaflet Popup覆盖样式 */
.leaflet-popup-content-wrapper {
    background: rgba(15, 23, 45, 0.98) !important;
    backdrop-filter: blur(16px);
    border-radius: 14px !important;
    border: 2px solid #409eff !important;
    box-shadow: 0 8px 36px rgba(0, 0, 0, 0.5) !important;
    color: #fff !important;
    padding: 0 !important;
}

.leaflet-popup-tip {
    background: rgba(15, 23, 45, 0.98) !important;
    border: 2px solid #409eff !important;
}

.leaflet-popup-content {
    margin: 14px !important;
    min-width: 260px;
    color: #fff !important;
}

.leaflet-popup-close-button {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 20px !important;
    padding: 8px 10px 0 0 !important;
}

.leaflet-popup-close-button:hover {
    color: #fff !important;
}

/* ===== 标记聚合样式 ===== */
.custom-cluster-icon {
    background: transparent !important;
    border: none !important;
}

.custom-cluster-small,
.custom-cluster-medium,
.custom-cluster-large {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 4px 16px rgba(64, 158, 255, 0.5);
}

.custom-cluster-small {
    width: 40px;
    height: 40px;
    font-size: 13px;
    background: linear-gradient(135deg, #409eff, #66b1ff);
}

.custom-cluster-medium {
    width: 48px;
    height: 48px;
    font-size: 15px;
    background: linear-gradient(135deg, #e6a23c, #ebb563);
}

.custom-cluster-large {
    width: 56px;
    height: 56px;
    font-size: 17px;
    background: linear-gradient(135deg, #f56c6c, #f89898);
}

/* ===== 阀门标记样式 ===== */
.valve-marker {
    background: transparent !important;
    border: none !important;
}

.valve-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.valve-dot.open {
    background: #409eff;
    animation: valve-blink 2s infinite;
}

.valve-dot.closed {
    background: #909399;
}

@keyframes valve-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* 阀门Popup */
.valve-popup {
    font-size: 12px;
    line-height: 1.6;
}

/* ===== 图层控制样式 ===== */
.leaflet-control-layers {
    background: rgba(15, 23, 45, 0.95) !important;
    border: 1px solid rgba(64, 158, 255, 0.3) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-control-layers-toggle {
    background: rgba(64, 158, 255, 0.2) !important;
    border-color: rgba(64, 158, 255, 0.4) !important;
    color: #409eff !important;
    width: 32px !important;
    height: 32px !important;
}

.leaflet-control-layers-selector {
    accent-color: #409eff;
}

.leaflet-control-layers-label {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* 缩放控制样式 */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-control-zoom a {
    background: rgba(15, 23, 45, 0.95) !important;
    color: #409eff !important;
    border: 1px solid rgba(64, 158, 255, 0.3) !important;
    width: 34px !important;
    height: 34px !important;
    line-height: 34px !important;
    font-size: 18px !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(64, 158, 255, 0.2) !important;
    color: #66b1ff !important;
}

/* ===== 图例样式 ===== */
.map-legend {
    position: absolute;
    bottom: 30px;
    left: 20px;
    background: rgba(15, 23, 45, 0.92);
    backdrop-filter: blur(12px);
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 11px;
    z-index: 999;
    display: flex;
    gap: 18px;
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(64, 158, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-online {
    background: #67C23A;
    box-shadow: 0 0 8px #67C23A;
}

.dot-offline {
    background: #909399;
}

.legend-triangle {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 9px solid #409eff;
}

/* ===== 响应式适配 ===== */
@media (max-width: 1200px) {
    .map-legend {
        bottom: 20px;
        left: 10px;
        padding: 8px 12px;
        gap: 12px;
        font-size: 10px;
    }
    
    .custom-cluster-small,
    .custom-cluster-medium,
    .custom-cluster-large {
        transform: scale(0.85);
    }
}
/**
 * IoTOS 2.0 - 设备管理样式
 * Leaflet地图、位置编辑器、P2地图体验增强
 */

/* ====== Leaflet 地图容器 ====== */
#deviceMap,
#locationPickerMap {
    background: #f0f2f5;
    border-radius: 8px;
}

/* Leaflet 瓦片接缝修复 */
#deviceMap .leaflet-tile-pane,
#locationPickerMap .leaflet-tile-pane {
    -webkit-backface-visibility: hidden;
}

#deviceMap .leaflet-tile,
#locationPickerMap .leaflet-tile {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

#deviceMap .leaflet-tile-container,
#locationPickerMap .leaflet-tile-container {
    outline: none;
}

#deviceMap .leaflet-tile-loaded,
#locationPickerMap .leaflet-tile-loaded {
    margin: 0 !important;
    padding: 0 !important;
}

#deviceMap .leaflet-layer,
#locationPickerMap .leaflet-layer {
    background: transparent;
}

#deviceMap .leaflet-tile-pane,
#locationPickerMap .leaflet-tile-pane {
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================
   P2增强：自定义设备标记图标（在线/离线）
   ============================================ */
.custom-device-marker {
    background: none !important;
    border: none !important;
}

.marker-pin {
    width: 28px;
    height: 28px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 3px solid #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-icon {
    transform: rotate(45deg);
    font-size: 12px;
    color: white;
    line-height: 1;
}

.marker-label {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: bold;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

/* 在线设备脉冲动画 */
@keyframes marker-pulse-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

.marker-pulse-online {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(103, 194, 58, 0.25);
    animation: marker-pulse-ring 2s ease-out infinite;
    pointer-events: none;
    z-index: -1;
}

/* ============================================
   P2增强：位置选择器标记图标
   ============================================ */
.custom-picker-marker {
    background: none !important;
    border: none !important;
}

.picker-pin {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #409eff;
    border: 3px solid #fff;
    box-shadow: 0 3px 12px rgba(64, 158, 255, 0.5);
    position: relative;
}

.picker-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.picker-ring {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border: 2px solid #409eff;
    border-radius: 50%;
    opacity: 0.5;
    animation: picker-ring-pulse 1.5s ease-in-out infinite;
}

@keyframes picker-ring-pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 0.2; }
}

/* ============================================
   P2增强：设备详情弹窗样式
   ============================================ */
.device-popup-custom .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 0;
    overflow: hidden;
}

.device-popup-custom .leaflet-popup-tip {
    display: none;
}

.device-popup-custom .leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
}

.device-map-popup {
    min-width: 220px;
}

.popup-header {
    background: linear-gradient(135deg, #409eff, #337ecc);
    color: #fff;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.popup-body {
    padding: 12px 14px;
    background: #fff;
}

.popup-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f2f3f5;
    font-size: 13px;
}

.popup-row:last-child {
    border-bottom: none;
}

.popup-label {
    color: #909399;
    flex-shrink: 0;
    margin-right: 12px;
}

.popup-value {
    color: #303133;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

/* 默认弹窗样式（非自定义弹窗也优化） */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.leaflet-popup-content {
    margin: 12px 14px;
    font-size: 13px;
    line-height: 1.6;
}
.leaflet-popup-close-button {
    font-size: 18px;
    padding-top: 6px;
    width: 24px;
    height: 24px;
    text-align: center;
    color: #999;
}
.leaflet-popup-close-button:hover {
    color: #409eff;
}

/* ============================================
   P2增强：地图源选择控件
   ============================================ */
.map-source-control {
    background: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
    margin: 10px;
}

.map-source-select {
    padding: 6px 28px 6px 10px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    min-width: 130px;
    outline: none;
    appearance: auto;
    transition: all 0.2s ease;
    background-color: #fafafa;
}

.map-source-select:hover {
    border-color: #409eff;
    background-color: #fff;
}

.map-source-select:focus {
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.15);
}

/* ============================================
   P2增强：搜索控件
   ============================================ */
.map-search-control {
    position: absolute;
    top: 12px;
    left: 52px;
    z-index: 1000;
    background: #fff;
    padding: 6px 8px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    gap: 6px;
    align-items: center;
}

.map-search-input {
    padding: 7px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 13px;
    width: 170px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.map-search-input:focus {
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.15);
}

.map-search-btn {
    padding: 7px 10px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    background: linear-gradient(135deg, #409eff, #337ecc);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.map-search-btn:hover {
    background: linear-gradient(135deg, #337ecc, #2975c9);
    box-shadow: 0 2px 8px rgba(64, 158, 255, 0.3);
}

/* ============================================
   设备位置编辑区域
   ============================================ */
.location-editor {
    margin: 15px 0;
    padding: 16px 18px;
    background: #f5f7fa;
    border-radius: 8px;
    border: 1px solid #e4e7ed;
}
.location-editor .location-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: #606266;
    font-size: 14px;
}
.location-coords input {
    width: 150px;
    padding: 9px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}
.location-coords input:focus {
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.15);
}

/* 地图容器圆角和边框 */
#deviceMap {
    border: 1px solid #e4e7ed !important;
}
#locationPickerMap {
    border: 1px solid #e4e7ed !important;
}

/* ============================================
   阀门控制面板 - 1:1还原截图（自动响应式网格）
   ============================================ */

/* 面板容器 */
.valve-grid-panel {
    margin: 15px 0;
    border-radius: 8px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
}

/* 工具栏 */
.vg-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}
.vg-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vg-title {
    font-size: 14px;
    font-weight: 700;
    color: #303133;
}

/* 折叠面板箭头 */
.vg-collapsible-header {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.vg-collapsible-header:hover {
    background: #f5f7fa;
}
.vg-collapse-arrow {
    display: inline-block;
    font-size: 11px;
    color: #909399;
    transition: transform 0.25s ease;
    margin-right: 4px;
}
.vg-collapse-arrow.collapsed {
    /* ▶ 不旋转 */
}
.vg-collapse-arrow:not(.collapsed) {
    transform: rotate(90deg);
}

/* 同步时间显示 */
.vg-sync-time {
    font-size: 11px;
    color: #909399;
    background: #f4f4f5;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}
.vg-sync-time i { margin-right: 2px; }
.vg-syncing {
    font-size: 11px;
    color: #409eff;
    animation: vg-spin 1s linear infinite;
}
@keyframes vg-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ===== 网格容器：auto-fill 响应式布局 ===== */
.valve-grid-list {
    display: grid;
    /* 最小200px，最大1fr，自动填充列数 */
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
    padding: 12px;
}

/* 单个阀门卡片 */
.vg-card {
    background: #fff;
    border: 1px solid #e4e7ed;
    border-radius: 6px;
    padding: 12px 14px;
    transition: all 0.2s ease;
}
.vg-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-color: #c6e2ff;
}
/* 开启态 - 蓝色边框+淡蓝背景 */
.vg-card.vg-open {
    border-color: #b3d8ff;
    background: linear-gradient(180deg, #ecf5ff 0%, #ffffff 100%);
}

/* ===== 第1行：编号 + 名称 + Switch ===== */
.vg-card-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
}

/* 编号徽章（灰/蓝圆角方块） */
.vg-index-badge {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 5px;
    background: #f2f3f5;
    color: #909399;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: 'Courier New', Consolas, monospace;
}
.vg-index-badge.badge-open {
    background: #409eff;
    color: #fff;
}

/* 名称区域 */
.vg-card-title-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.vg-valve-name {
    font-size: 13px;
    font-weight: 600;
    color: #303133;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.vg-valve-subtitle {
    font-size: 11px;
    color: #c0c4cc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* ===== 第2行：el-slider 滑动条（阀门开度 0-900°） ===== */
.vg-slider-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 0 2px;
}
.vg-slider-label {
    font-size: 11px;
    color: #909399;
    white-space: nowrap;
    flex-shrink: 0;
}

/* el-slider 在阀门卡片内的紧凑样式 */
.vg-slider-row .el-slider {
    --el-slider-height: 4px;
    --el-slider-button-size: 14px;
    --el-slider-button-wrapper-size: 18px;
    flex: 1;
    margin-left: 4px;
}
.vg-slider-row .el-slider__runway {
    background-color: #e8eaec;
    border-radius: 2px;
}
.vg-slider-row .el-slider__bar {
    background-color: #67c23a;
}
.vg-slider-row .el-slider__button {
    border-color: #67c23a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.vg-slider-row .el-slider:hover .el-slider__button {
    border-color: #409eff;
}
/* 禁用态 */
.vg-slider-row .el-slider.is-disabled .el-slider__runway {
    opacity: 0.45;
    cursor: not-allowed;
}
.vg-slider-row .el-slider.is-disabled .el-slider__button {
    cursor: not-allowed;
}

/* ===== 第3行：数据 + 按钮组 ===== */
.vg-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
}
.vg-footer-data {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #909399;
}

/* 状态指示小圆点（红=开，灰=关） */
.vg-status-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #909399;
}
.vg-status-indicator.indicator-on {
    background: #f56c6c;
}

/* 右侧按钮组 */
.vg-footer-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}
.vg-footer-actions .vg-label {
    color: #909399;
    margin-right: 2px;
}
.vg-footer-actions .el-button {
    padding: 1px 2px !important;
    min-height: auto !important;
    font-size: 13px !important;
}

/* 数据标签（电量、信号等） */
.vg-data-tag {
    font-size: 10px;
    color: #909399;
    background: #f4f4f5;
    padding: 0 5px;
    border-radius: 8px;
    margin-left: 4px;
    white-space: nowrap;
}
.vg-data-tag.tag-warn {
    color: #e6a23c;
    background: #fdf6ec;
}
/* 自动模式标签 - 蓝色 */
.vg-data-tag.vg-mode-auto {
    color: #409eff;
    background: #ecf5ff;
}

/* 空状态 */
.valve-empty {
    text-align: center;
    padding: 30px 20px;
    color: #999;
}
.valve-empty p {
    margin: 10px 0 0;
    font-size: 13px;
}

/* 响应式适配 */
@media (max-width: 1100px) {
    .valve-grid-list {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 800px) {
    .valve-grid-list {
        grid-template-columns: repeat(2, 1fr);
    }
}
.valve-empty {
    text-align: center;
    padding: 30px 20px;
    color: #b3e19d;
}
.valve-empty p {
    margin: 10px 0 0;
    font-size: 13px;
    color: #999;
}
