/* 全局样式 */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --success-color: #27ae60;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0.8rem 1rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.25rem;
}

/* 地图容器 */
#map {
    height: 100%;
    min-height: 400px;
    border-radius: 0 0 10px 10px;
}

/* 报警列表 */
.alert-list {
    max-height: 300px;
    overflow-y: auto;
}

.alert-item {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.alert-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.alert-item.warning {
    border-left: 4px solid var(--warning-color);
}

.alert-item.danger {
    border-left: 4px solid var(--danger-color);
}

.alert-item.info {
    border-left: 4px solid var(--info-color);
}

/* 设备状态指示器 */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

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

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

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

/* 响应式调整 */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    #map {
        min-height: 300px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* 图表容器 */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* 页脚样式 */
footer {
    background-color: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* 表格样式 */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

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

/* 按钮样式 */
.btn {
    border-radius: 5px;
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

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

/* 标签样式 */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 4px;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25rem solid rgba(52, 152, 219, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip-inner {
    max-width: 250px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* 响应式工具类 */
.hidden-xs {
    display: inline-block !important;
}

@media (max-width: 576px) {
    .hidden-xs {
        display: none !important;
    }
}
