/* ============= 全局样式 ============= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0174f5;
    --primary-light: #0ea5e9;
    --secondary-color: #0f172a;
    --danger-color: #FF3B30;
    --warning-color: #FF9500;
    --success-color: #34C759;
    --info-color: #FFCC00;
    --bg-dark: #020817;
    --bg-darker: #0f172a;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-tertiary: #cbd5e1;
    --border-color: rgba(1, 116, 245, 0.3);
    --shadow-sm: 0 4px 15px rgba(1, 116, 245, 0.2);
    --shadow-md: 0 8px 32px rgba(1, 116, 245, 0.3);
    --shadow-lg: 0 12px 40px rgba(1, 116, 245, 0.4);
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--secondary-color) 100%);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ============= 骨架屏加载 ============= */
.skeleton-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-dark);
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.skeleton-header {
    height: 70px;
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    display: flex;
    align-items: center;
    padding: 0 30px;
    gap: 20px;
}

.skeleton-logo {
    width: 300px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.skeleton-nav {
    flex: 1;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    max-width: 400px;
}

.skeleton-content {
    display: flex;
    flex: 1;
    padding: 20px;
    gap: 20px;
}

.skeleton-left, .skeleton-right {
    width: 25%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skeleton-box {
    height: 200px;
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 10px;
}

.skeleton-center {
    flex: 1;
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 10px;
}

.skeleton-map {
    width: 100%;
    height: 100%;
}

.loading-text {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    color: var(--primary-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dots::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ============= 主容器 ============= */
.main-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease-in;
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============= 顶部导航栏 ============= */
.top-header {
    height: 70px;
    background: rgba(2, 8, 23, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    padding: 0 30px;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-shrink: 0;
}

.header-left {
    flex-shrink: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 32px;
    animation: pulse 2s infinite;
}

.system-title {
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(90deg, var(--primary-light), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(1, 116, 245, 0.5);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 导航菜单 */
.header-nav {
    display: flex;
    gap: 8px;
    margin: 0 30px;
    flex: 1;
}

.nav-item {
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.nav-item:hover::before {
    left: 100%;
}

.nav-item:hover {
    background: rgba(1, 116, 245, 0.2);
    transform: translateY(-2px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    box-shadow: var(--shadow-sm);
}

.nav-icon {
    font-size: 18px;
}

/* 右侧功能区 */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-box {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.search-box:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(1, 116, 245, 0.1);
}

.search-box input {
    border: none;
    background: transparent;
    padding: 10px 15px;
    color: var(--text-primary);
    outline: none;
    width: 220px;
    font-size: 14px;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-icon-btn {
    border: none;
    background: var(--primary-color);
    padding: 10px 15px;
    cursor: pointer;
    color: white;
    transition: all 0.3s;
    font-size: 16px;
}

.search-icon-btn:hover {
    background: var(--primary-light);
}

.time-selector select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
    font-size: 14px;
    transition: all 0.3s;
}

.time-selector select:hover {
    border-color: var(--primary-light);
}

.alert-center-btn {
    background: linear-gradient(135deg, var(--danger-color), var(--warning-color));
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    position: relative;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-center-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 59, 48, 0.6);
}

.alert-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
    50% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-icon {
    font-size: 20px;
}

.username {
    font-size: 14px;
}

/* ============= 主内容区域 ============= */
.main-content {
    display: flex;
    flex: 1;
    padding: 20px;
    gap: 20px;
    height: calc(100vh - 90px);
    overflow: hidden;
}

.view-content {
    display: none;
    width: 100%;
    animation: slideIn 0.3s ease-out;
}

.view-content.active {
    display: flex;
    gap: 20px;
}

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

/* ============= 面板布局 ============= */
.left-panel, .right-panel {
    width: 320px;
    min-width: 320px;
    height: calc(100vh - 110px); /* 明确高度 */
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
}



右侧面板滚动条样式
.right-panel::-webkit-scrollbar {
    width: 8px;
}

.right-panel::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 10px;
}

.right-panel::-webkit-scrollbar-thumb {
    background: rgba(1, 116, 245, 0.5);
    border-radius: 10px;
    transition: background 0.3s;
}

.right-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(1, 116, 245, 0.7);
}

/* 左右侧面板统一滚动条样式 */
.left-panel::-webkit-scrollbar,
.right-panel::-webkit-scrollbar {
    width: 8px;
}

.left-panel::-webkit-scrollbar-track,
.right-panel::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 10px;
}

.left-panel::-webkit-scrollbar-thumb,
.right-panel::-webkit-scrollbar-thumb {
    background: rgba(1, 116, 245, 0.5);
    border-radius: 10px;
    transition: background 0.3s;
}

.left-panel::-webkit-scrollbar-thumb:hover,
.right-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(1, 116, 245, 0.7);
}


.center-panel {
    flex: 1;
    min-width: 600px;
}

/* ============= 面板组件 ============= */
.panel-section {
    background: rgba(2, 8, 23, 0.95);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.panel-section:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.section-header {
    background: linear-gradient(135deg, rgba(1, 116, 245, 0.3), rgba(14, 165, 233, 0.3));
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h3 {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-icon {
    font-size: 18px;
}

.section-content {
    padding: 20px;
}

/* 刷新按钮 */
.refresh-btn, .export-btn, .toggle-all-btn, .ai-refresh-btn {
    padding: 6px 12px;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-light);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.refresh-btn:hover, .export-btn:hover, .toggle-all-btn:hover, .ai-refresh-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* ============= 视频监控区域 ============= */
.video-section {
    height: 280px;
    flex-shrink: 0;
}

.video-scroll-container {
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
}

/* 视频滚动容器也需要滚动条样式 */
.video-scroll-container::-webkit-scrollbar { 
    width: 8px; 
} 

.video-scroll-container::-webkit-scrollbar-track { 
    background: rgba(30, 41, 59, 0.3); 
    border-radius: 10px; 
} 

.video-scroll-container::-webkit-scrollbar-thumb { 
    background: rgba(1, 116, 245, 0.5); 
    border-radius: 10px; 
    transition: background 0.3s; 
} 

.video-scroll-container::-webkit-scrollbar-thumb:hover { 
    background: rgba(1, 116, 245, 0.7); 
} 

.video-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.video-placeholder {
    height: 80px;
    background: linear-gradient(135deg, #1e293b, #334155);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-color);
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.video-placeholder:hover {
    border-color: var(--primary-light);
    transform: scale(1.02);
}

.video-placeholder::before {
    content: '📹';
    font-size: 32px;
    opacity: 0.3;
}

.camera-id {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    color: var(--primary-light);
    font-weight: bold;
}

.status-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
}

.status-indicator.online {
    color: var(--success-color);
    animation: blink 2s infinite;
}

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

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.video-info {
    padding: 8px;
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    background: rgba(30, 41, 59, 0.5);
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.camera-model {
    font-size: 10px;
    color: var(--primary-light);
    font-style: italic;
}

/* ============= 图层控制 ============= */
.layer-control-section {
    height: 280px;
    flex-shrink: 0;
}

.layer-control-section .section-content {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    padding-right: 15px;
}

/* 图层控制滚动条样式 */
.layer-control-section .section-content::-webkit-scrollbar { 
    width: 8px; 
} 

.layer-control-section .section-content::-webkit-scrollbar-track { 
    background: rgba(30, 41, 59, 0.3); 
    border-radius: 10px; 
} 

.layer-control-section .section-content::-webkit-scrollbar-thumb { 
    background: rgba(1, 116, 245, 0.5); 
    border-radius: 10px; 
    transition: background 0.3s; 
} 

.layer-control-section .section-content::-webkit-scrollbar-thumb:hover { 
    background: rgba(1, 116, 245, 0.7); 
} 

.layer-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.layer-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    transition: all 0.3s;
    gap: 10px;
}

.layer-item:hover {
    background: rgba(1, 116, 245, 0.2);
    transform: translateX(5px);
}

.layer-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.layer-icon {
    font-size: 18px;
}

.layer-item span:nth-child(3) {
    flex: 1;
    font-size: 14px;
}

.layer-count {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    min-width: 24px;
    text-align: center;
}

/* ============= 预警时间轴 ============= */
.alert-timeline-section {
    flex: 1;
    min-height: 400px; /* 添加最小高度 */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 添加 */
}

.alert-timeline-section .section-header {
    background: linear-gradient(135deg, rgba(1, 116, 245, 0.3), rgba(14, 165, 233, 0.3));
    border-bottom: 1px solid var(--border-color);
}

.alert-timeline-section .section-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 15px;
}

.filter-btns {
    display: flex;
    gap: 6px;
}

.filter-btn {
    padding: 6px 14px;
    border: 1.5px solid var(--primary-color);
    background: transparent;
    color: var(--primary-light);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.filter-btn:hover::before {
    width: 300px;
    height: 300px;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 116, 245, 0.3);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(1, 116, 245, 0.4);
}

.filter-btn.level-1 {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.filter-btn.level-1.active {
    background: var(--danger-color);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.5);
}

.filter-btn.level-2 {
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.filter-btn.level-2.active {
    background: var(--warning-color);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.5);
}

.filter-btn.level-3 {
    border-color: var(--info-color);
    color: var(--info-color);
}

.filter-btn.level-3.active {
    background: var(--info-color);
    color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(255, 204, 0, 0.5);
}

.timeline-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.stat-item {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(30, 41, 59, 0.3));
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(1, 116, 245, 0.2);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(1, 116, 245, 0.1), transparent);
    transition: left 0.6s;
}

.stat-item:hover::before {
    left: 100%;
}

.stat-item:hover {
    border-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(1, 116, 245, 0.2);
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-light);
    text-shadow: 0 0 10px rgba(1, 116, 245, 0.3);
}

.timeline-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(1, 116, 245, 0.6) rgba(30, 41, 59, 0.3);
}

.timeline-container::-webkit-scrollbar {
    width: 8px;
}

.timeline-container::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 4px;
}

.timeline-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--primary-light));
    border-radius: 4px;
    transition: all 0.3s;
}

.timeline-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-light), var(--primary-color));
    box-shadow: 0 0 8px rgba(1, 116, 245, 0.5);
}

.timeline-item {
    padding: 16px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(30, 41, 59, 0.5));
    border-left: 4px solid;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 0;
    transition: height 0.3s ease-out;
}

.timeline-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 0 6px 8px;
    opacity: 0;
    transition: all 0.3s;
}

.timeline-item.level-1 {
    border-color: var(--danger-color);
}

.timeline-item.level-1::before {
    background: var(--danger-color);
}

.timeline-item.level-1::after {
    border-color: transparent transparent transparent var(--danger-color);
}

.timeline-item.level-2 {
    border-color: var(--warning-color);
}

.timeline-item.level-2::before {
    background: var(--warning-color);
}

.timeline-item.level-2::after {
    border-color: transparent transparent transparent var(--warning-color);
}

.timeline-item.level-3 {
    border-color: var(--info-color);
}

.timeline-item.level-3::before {
    background: var(--info-color);
}

.timeline-item.level-3::after {
    border-color: transparent transparent transparent var(--info-color);
}

.timeline-item:hover {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(30, 41, 59, 0.8));
    transform: translateX(8px);
    box-shadow: -4px 4px 20px rgba(0, 0, 0, 0.3), 0 0 20px rgba(1, 116, 245, 0.2);
}

.timeline-item:hover::before {
    height: 100%;
}

.timeline-item:hover::after {
    opacity: 1;
    right: 12px;
}

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

.timeline-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.timeline-level {
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.timeline-level.level-1 {
    background: linear-gradient(135deg, var(--danger-color), #ff6b6b);
    color: white;
}

.timeline-level.level-2 {
    background: linear-gradient(135deg, var(--warning-color), #ffc947);
    color: white;
}

.timeline-level.level-3 {
    background: linear-gradient(135deg, var(--info-color), #ffe066);
    color: var(--secondary-color);
}

.timeline-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.timeline-time::before {
    content: '🕐';
    font-size: 14px;
}

.timeline-desc {
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.6;
}

/* ============= 预警项样式 ============= */
.alert-item {
    padding: 16px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(30, 41, 59, 0.5));
    border-left: 4px solid;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(1, 116, 245, 0.5); /* 蓝色分隔线 */
}

.alert-item:last-child {
    border-bottom: none; /* 最后一项不显示分隔线 */
}

.alert-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 0;
    transition: height 0.3s ease-out;
}

.alert-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 0 6px 8px;
    opacity: 0;
    transition: all 0.3s;
}

.alert-item.high {
    border-color: var(--danger-color);
}

.alert-item.high::before {
    background: var(--danger-color);
}

.alert-item.high::after {
    border-color: transparent transparent transparent var(--danger-color);
}

.alert-item.medium {
    border-color: var(--warning-color);
}

.alert-item.medium::before {
    background: var(--warning-color);
}

.alert-item.medium::after {
    border-color: transparent transparent transparent var(--warning-color);
}

.alert-item.low {
    border-color: var(--info-color);
}

.alert-item.low::before {
    background: var(--info-color);
}

.alert-item.low::after {
    border-color: transparent transparent transparent var(--info-color);
}

.alert-item:hover {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(30, 41, 59, 0.8));
    transform: translateX(8px);
    box-shadow: -4px 4px 20px rgba(0, 0, 0, 0.3), 0 0 20px rgba(1, 116, 245, 0.2);
}

.alert-item:hover::before {
    height: 100%;
}

.alert-item:hover::after {
    opacity: 1;
    right: 12px;
}

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

.alert-level {
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.alert-level.high {
    background: linear-gradient(135deg, var(--danger-color), #ff6b6b);
    color: white;
}

.alert-level.medium {
    background: linear-gradient(135deg, var(--warning-color), #ffc947);
    color: white;
}

.alert-level.low {
    background: linear-gradient(135deg, var(--info-color), #ffe066);
    color: var(--secondary-color);
}

.alert-time {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.alert-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.alert-type {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.alert-location {
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.6;
}

/* ============= 地图容器 ============= */
.map-container {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-md);
}

#mainMap {
    width: 100%;
    height: 100%;
}

.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(2, 8, 23, 0.9);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 12px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.map-info {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(2, 8, 23, 0.9);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    display: flex;
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.info-value {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-light);
}

/* ============= 图表区域 ============= */
.chart-section {
    height: 300px;
}

.chart-box {
    width: 100%;
    height: 220px;
}

.chart-summary {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    font-size: 12px;
    color: var(--text-secondary);
}

.chart-summary strong {
    color: var(--primary-light);
}

/* ============= AI智能预测 ============= */
.ai-predict-section {
    height: 380px;
    flex-shrink: 0;
}

.ai-predict-section .section-content {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    padding-right: 15px;
}

.predict-item {
    padding: 15px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 10px;
    margin-bottom: 12px;
    border-left: 4px solid;
    display: flex;
    gap: 12px;
    transition: all 0.3s;
}

.predict-item:hover {
    background: rgba(30, 41, 59, 0.8);
    transform: translateX(5px);
}

.high-risk-item {
    border-color: var(--danger-color);
}

.medium-risk-item {
    border-color: var(--warning-color);
}

.normal-risk-item {
    border-color: var(--success-color);
}

.predict-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.predict-content {
    flex: 1;
}

.predict-title {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.predict-value {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 4px;
}

.predict-value.high-risk {
    color: var(--danger-color);
}

.predict-value.medium-risk {
    color: var(--warning-color);
}

.predict-value.normal-risk {
    color: var(--success-color);
}

.predict-desc {
    font-size: 11px;
    color: var(--text-tertiary);
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(1, 116, 245, 0.1);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.update-time {
    margin-left: auto;
    color: var(--primary-light);
}

/* ============= 设备健康分析 ============= */
.device-health-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    height: 100%;
    overflow: hidden;
    padding-right: 0;
}

.device-overview {
    min-height: 200px;
    max-height: 280px;
    flex-shrink: 0;
}

.device-overview .section-content {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    padding-right: 15px;
}

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

.device-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.stat-card {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.stat-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.camera-icon { filter: drop-shadow(0 0 10px var(--danger-color)); }
.sensor-icon { filter: drop-shadow(0 0 10px var(--warning-color)); }
.robot-icon { filter: drop-shadow(0 0 10px var(--success-color)); }
.drone-icon { filter: drop-shadow(0 0 10px var(--primary-color)); }

.stat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-light);
}

.stat-details {
    display: flex;
    gap: 10px;
    font-size: 11px;
}

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

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

.stat-health {
    display: flex;
    align-items: center;
    gap: 10px;
}

.health-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--primary-color));
    border-radius: 3px;
    transition: width 0.5s ease-out;
}

.health-text {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 35px;
    text-align: right;
}

/* 设备健康趋势和设备详细列表容器 */
.device-content-container {
    display: flex;
    gap: 20px;
    width: 100%;
    flex: 1;
    min-height: 0;
}

/* 设备趋势图 */
.device-trend {
    width: 40%;
    min-height: 400px;
    max-height: 450px;
    flex-shrink: 0;
}

.device-trend .section-content {
    max-height: 370px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    padding-right: 15px;
}

.trend-controls {
    display: flex;
    gap: 10px;
}

.trend-controls select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.chart-box-large {
    width: 100%;
    height: 320px;
}

/* 设备列表 */
.device-list-section {
    width: 60%;
    flex-shrink: 0;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.device-list-section .section-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.list-controls {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.list-controls select,
.list-controls input {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-radius: 5px;
    font-size: 12px;
}

.list-controls input {
    min-width: 150px;
}

.device-table-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    margin-bottom: 15px;
}

.device-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.device-table thead {
    background: rgba(1, 116, 245, 0.2);
    position: sticky;
    top: 0;
    z-index: 10;
}

.device-table th {
    padding: 12px;
    text-align: left;
    color: var(--primary-light);
    font-weight: bold;
    border-bottom: 2px solid var(--primary-color);
}

.device-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-tertiary);
}

.device-table tr:hover {
    background: rgba(1, 116, 245, 0.1);
}

.device-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    display: inline-block;
}

.status-online {
    background: rgba(52, 199, 89, 0.2);
    color: var(--success-color);
}

.status-offline {
    background: rgba(255, 59, 48, 0.2);
    color: var(--danger-color);
}

.device-health {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    display: inline-block;
}

.health-good {
    background: rgba(52, 199, 89, 0.2);
    color: var(--success-color);
}

.health-medium {
    background: rgba(255, 149, 0, 0.2);
    color: var(--warning-color);
}

.health-bad {
    background: rgba(255, 59, 48, 0.2);
    color: var(--danger-color);
}

.table-pagination {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 15px 0;
}

.page-btn {
    padding: 8px 15px;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-light);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-info {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============= 模态窗口 ============= */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: linear-gradient(135deg, #1e293b, var(--secondary-color));
    margin: 5% auto;
    padding: 30px;
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    color: var(--text-secondary);
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--danger-color);
    transform: rotate(90deg);
}

#modalTitle, #deviceModalTitle {
    color: var(--primary-light);
    margin-bottom: 20px;
    clear: both;
}

#modalBody, #deviceModalBody {
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 20px;
}

#modalBody p, #deviceModalBody p {
    margin-bottom: 10px;
}

#modalBody strong, #deviceModalBody strong {
    color: var(--primary-light);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============= Toast提示 ============= */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(2, 8, 23, 0.95);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-lg);
    display: none;
    animation: toastIn 0.3s;
    z-index: 3000;
    max-width: 350px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============= 标记点信息卡片 ============= */
.marker-info-card {
    background: rgba(2, 8, 23, 0.95);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 15px;
    min-width: 220px;
    box-shadow: var(--shadow-lg);
}

.marker-info-card h4 {
    color: var(--primary-light);
    margin-bottom: 10px;
    font-size: 16px;
}

.marker-info-card p {
    color: var(--text-tertiary);
    font-size: 13px;
    margin: 5px 0;
    line-height: 1.6;
}

.marker-info-card p span {
    font-weight: bold;
}

/* ============= 滚动条样式 ============= */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(1, 116, 245, 0.5);
    border-radius: 10px;
    transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(1, 116, 245, 0.8);
}

/* ============= 响应式设计 ============= */
@media (max-width: 1920px) {
    .main-content {
        gap: 15px;
        padding: 15px;
    }
    
    .left-panel, .right-panel {
        width: 300px;
        min-width: 300px;
    }
}

@media (max-width: 1440px) {
    .top-header {
        padding: 0 20px;
    }
    
    .system-title {
        font-size: 20px;
    }
    
    .nav-item {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    .left-panel, .right-panel {
        width: 280px;
        min-width: 280px;
    }
    
    .device-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
        overflow-y: auto;
    }
    
    .view-content.active {
        flex-direction: column;
    }
    
    .left-panel, .right-panel, .center-panel {
        width: 100%;
        min-width: 100%;
        overflow-y: visible;
    }
    
    .center-panel {
        height: 600px;
    }
    
    .header-nav {
        flex-wrap: wrap;
    }
    
    .search-box input {
        width: 150px;
    }
    
    .device-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 设备健康趋势和设备详细列表在小屏幕上垂直排列 */
    .device-content-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .device-trend, .device-list-section {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .top-header {
        flex-wrap: wrap;
        height: auto;
        padding: 15px;
    }
    
    .header-right {
        width: 100%;
        margin-top: 10px;
        flex-wrap: wrap;
    }
    
    .search-box input {
        width: 100px;
    }
    
    .device-stats {
        grid-template-columns: 1fr;
    }
    
    .timeline-stats {
        grid-template-columns: 1fr;
    }
}

/* ============= 打印样式 ============= */
@media print {
    .skeleton-loader,
    .top-header,
    .modal,
    .toast {
        display: none !important;
    }
    
    .main-container {
        display: block !important;
    }
    
    .panel-section {
        page-break-inside: avoid;
    }
}

/* ============= 辅助动画 ============= */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.loading-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ============= 无障碍优化 ============= */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}