/* 设备管理模块样式 */

/* 设备卡片样式 */
.device-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
    border-left: 4px solid #3498db;
}

.device-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.device-card.offline {
    border-left-color: #95a5a6;
    opacity: 0.8;
}

.device-card.warning {
    border-left-color: #f39c12;
}

.device-card.danger {
    border-left-color: #e74c3c;
}

/* 统计卡片样式 */
.stats-card {
    border: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08);
}

.stats-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
}

/* 表格样式 */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-top: none;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.table tbody tr {
    transition: all 0.2s ease;
}

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

/* 设备状态标签 */
.status-badge {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-online {
    background-color: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.badge-offline {
    background-color: rgba(149, 165, 166, 0.1);
    color: #95a5a6;
}

.badge-warning {
    background-color: rgba(243, 156, 18, 0.1);
    color: #f39c12;
}

.badge-danger {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* 模态框样式 */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

/* 表单控件样式 */
.form-control, .form-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

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

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: #3498db;
    border-color: #3498db;
}

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

/* 标签页样式 */
.nav-tabs {
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 1.5rem;
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link.active {
    color: #3498db;
    background: none;
    border-bottom: 2px solid #3498db;
}

/* 图表容器 */
.chart-container {
    position: relative;
    margin: 0 auto;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .table-responsive {
        border: 1px solid #e9ecef;
        border-radius: 0.5rem;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
}

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

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

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

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

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 工具提示 */
.tooltip-inner {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* 加载动画 */
.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 0.25rem solid rgba(52, 152, 219, 0.2);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* 卡片标题 */
.card-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.25rem;
}

/* 设备详情页样式 */
.device-detail-section {
    margin-bottom: 2rem;
}

.device-detail-section:last-child {
    margin-bottom: 0;
}

.device-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.device-info-item {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.device-info-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.05);
}

.device-info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.device-info-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .device-info-grid {
        grid-template-columns: 1fr;
    }
}

/* 维护日期样式 */
.maintenance-date {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.maintenance-desc {
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

/* 统计卡片 */
.stats-card {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: 8px;
    color: white;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.stats-card .stats-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stats-card .stats-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 设备表格 */
.device-list-table th {
    font-weight: 600;
    background-color: #f8f9fa;
}

.device-list-table .badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* 分页 */
.pagination .page-link {
    color: #3498db;
}

.pagination .page-item.active .page-link {
    background-color: #3498db;
    border-color: #3498db;
}

/* 标签页内容 */
.tab-content {
    padding: 1.5rem 0;
}

/* 标签页导航 */
.nav-tabs .nav-link {
    color: #7f8c8d;
    font-weight: 500;
    border: none;
    padding: 0.75rem 1.25rem;
    margin-right: 0.5rem;
    border-radius: 5px 5px 0 0;
}

.nav-tabs .nav-link.active {
    color: #3498db;
    background-color: white;
    border-bottom: 3px solid #3498db;
}

.nav-tabs .nav-link:hover:not(.active) {
    background-color: #f8f9fa;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .device-detail-item .label {
        display: block;
        margin-bottom: 0.25rem;
    }
    
    .device-detail-item .value {
        display: block;
        margin-bottom: 0.5rem;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
}
