/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 28px;
}

.logo h1 {
    font-size: 22px;
    font-weight: 600;
}

.header-info {
    display: flex;
    gap: 25px;
    align-items: center;
}

.last-update, .device-status {
    background-color: rgba(255, 255, 255, 0.15);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 侧边栏样式 */
.sidebar {
    width: 260px;
    background-color: white;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid #eee;
}

.sidebar-header h3 {
    font-size: 18px;
    color: #1890ff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-list {
    list-style: none;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.category-item {
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #555;
    border-left: 4px solid transparent;
}

.category-item:hover {
    background-color: #f0f7ff;
    color: #1890ff;
}

.category-item.active {
    background-color: #e6f7ff;
    color: #1890ff;
    border-left-color: #1890ff;
    font-weight: 600;
}

.category-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.data-summary {
    padding: 20px;
    margin-top: auto;
}

.data-summary h4 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    color: #666;
    font-size: 14px;
}

.summary-value {
    font-weight: 600;
    color: #1890ff;
    font-size: 18px;
}

/* 内容区域样式 */
.content-area {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.content-header h2 {
    font-size: 24px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

.data-actions {
    display: flex;
    gap: 15px;
}

.btn-refresh, .btn-export {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-refresh {
    background-color: #1890ff;
    color: white;
}

.btn-refresh:hover {
    background-color: #096dd9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(24, 144, 255, 0.2);
}

.btn-export {
    background-color: white;
    color: #1890ff;
    border: 1px solid #1890ff;
}

.btn-export:hover {
    background-color: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

/* 搜索区域样式 */
.search-section {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    background-color: white;
}

.search-box input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

/* 数据展示区域 */
.data-display {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.chart-container, .table-container, .property-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.chart-header, .table-header, .property-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-header h3, .table-header h3, .property-header h3 {
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-controls select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    font-size: 14px;
    color: #333;
}

.chart-wrapper {
    padding: 20px;
    height: 300px;
}

.table-wrapper {
    padding: 0 20px 20px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background-color: #fafafa;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #eee;
    white-space: nowrap;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: #555;
}

.data-table tbody tr:hover {
    background-color: #f9f9f9;
}

.btn-view {
    padding: 6px 12px;
    background-color: #f0f7ff;
    color: #1890ff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-view:hover {
    background-color: #1890ff;
    color: white;
}

/* 属性列表样式 */
.property-container {
    margin-bottom: 30px;
}

.property-notice {
    background-color: #fff7e6;
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 4px solid #faad14;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 600px;
}

.property-notice i {
    color: #faad14;
    font-size: 18px;
    margin-top: 2px;
}

.property-notice span {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.property-list {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.property-item {
    background-color: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 18px;
    transition: all 0.3s;
}

.property-item:hover {
    border-color: #1890ff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.property-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 15px;
}

.property-value {
    font-size: 22px;
    font-weight: 600;
    color: #1890ff;
    margin-bottom: 10px;
}

.property-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #888;
}

/* 页脚样式 */
.footer {
    background-color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 14px;
}

.footer-right {
    display: flex;
    gap: 20px;
}

.status-online {
    color: #52c41a;
    font-weight: 600;
}

.status-api {
    color: #1890ff;
    font-weight: 600;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 20px 25px;
    background-color: #1890ff;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.detail-section {
    margin-bottom: 25px;
}

.detail-section h4 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed #eee;
}

.detail-label {
    color: #666;
    font-weight: 500;
}

.detail-value {
    font-weight: 600;
    color: #1890ff;
}

.raw-data {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 25px;
    background-color: #fafafa;
    text-align: right;
    border-top: 1px solid #eee;
}

.btn-secondary {
    padding: 10px 25px;
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background-color: #e8e8e8;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 15px;
        gap: 20px;
    }
    
    .category-list {
        display: flex;
        padding: 0;
        border-bottom: none;
        border-right: 1px solid #eee;
        padding-right: 20px;
        margin-right: 20px;
    }
    
    .category-item {
        flex-direction: column;
        gap: 8px;
        padding: 10px 15px;
        border-left: none;
        border-bottom: 4px solid transparent;
    }
    
    .category-item.active {
        border-left: none;
        border-bottom-color: #1890ff;
    }
    
    .data-summary {
        margin-top: 0;
        padding: 0;
        display: flex;
        gap: 20px;
        align-items: center;
    }
    
    .summary-item {
        border-bottom: none;
        padding: 0 15px;
        border-right: 1px dashed #eee;
    }
    
    .summary-item:last-child {
        border-right: none;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .search-section {
        flex-direction: column;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .property-list {
        grid-template-columns: 1fr;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .footer-right {
        flex-direction: column;
        gap: 5px;
    }
}

/* 加载状态样式 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-spinner {
  text-align: center;
  padding: 30px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
  max-width: 400px;
}

.loading-spinner i {
  font-size: 48px;
  color: #1890ff;
  margin-bottom: 20px;
}

.loading-spinner p {
  color: #333;
  font-size: 16px;
  margin: 0;
}

/* API状态指示器 */
.api-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-left: 10px;
}

.api-status-online {
  background-color: #f6ffed;
  color: #52c41a;
  border: 1px solid #b7eb8f;
}

.api-status-offline {
  background-color: #fff2e8;
  color: #fa541c;
  border: 1px solid #ffbb96;
}

.api-status-mock {
  background-color: #e6f7ff;
  color: #1890ff;
  border: 1px solid #91d5ff;
}