/**
 * 通用样式
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 导航栏 */
.navbar {
    background-color: #1890ff;
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-title {
    font-size: 20px;
    font-weight: bold;
}

.navbar-links {
    display: flex;
    gap: 20px;
}

.navbar-links a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.navbar-links a:hover {
    background-color: rgba(255,255,255,0.2);
}

/* 卡片 */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background-color: #1890ff;
    color: white;
}

.btn-primary:hover {
    background-color: #40a9ff;
}

.btn-success {
    background-color: #52c41a;
    color: white;
}

.btn-success:hover {
    background-color: #73d13d;
}

.btn-danger {
    background-color: #ff4d4f;
    color: white;
}

.btn-danger:hover {
    background-color: #ff7875;
}

.btn-secondary {
    background-color: #8c8c8c;
    color: white;
}

.btn-secondary:hover {
    background-color: #a6a6a6;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card-value {
    font-size: 32px;
    font-weight: bold;
    margin: 10px 0;
}

.stat-card-label {
    color: #8c8c8c;
    font-size: 14px;
}

.stat-card.online .stat-card-value {
    color: #52c41a;
}

.stat-card.offline .stat-card-value {
    color: #ff4d4f;
}

.stat-card.fault .stat-card-value {
    color: #faad14;
}

.stat-card.alarm .stat-card-value {
    color: #ff4d4f;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.table th {
    background-color: #fafafa;
    font-weight: bold;
    color: #333;
}

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

/* 表单 */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.2);
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #8c8c8c;
}

/* 错误提示 */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #fff2f0;
    border: 1px solid #ffccc7;
    color: #cf1322;
}

.alert-success {
    background-color: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #389e0d;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.online {
    background-color: #f6ffed;
    color: #52c41a;
}

.status-badge.offline {
    background-color: #fff2f0;
    color: #ff4d4f;
}

/* 返回按钮 */
.btn-back {
    margin-bottom: 20px;
    display: inline-block;
}

/* 响应式 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .navbar-content {
        flex-direction: column;
        gap: 10px;
    }
}
