/* 全局设置：深色工业风 */
body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.main-container {
    max-width: 1000px; /* 从 width 改为 max-width */
    width: 100%;       /* 新增这一行 */
    padding: 20px;
    box-sizing: border-box; /* 新增这一行 */
}

/* 头部 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
}

h1 {
    font-size: 24px;
    margin: 0;
    color: #00bcd4;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.connected {
    background-color: #2e7d32;
    color: white;
}

.disconnected {
    background-color: #c62828;
    color: white;
}

.loading {
    background-color: #f9a825;
    color: black;
}

/* 布局 */
.content-wrapper {
    display: flex;
    gap: 20px;
}

.panel {
    background-color: #1e1e1e;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.control-panel {
    flex: 1;
    border: 1px solid #333;
}

.display-panel {
    flex: 1.5;
    border: 1px solid #333;
}

h2 {
    font-size: 18px;
    color: #aaa;
    margin-top: 0;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

/* 控件样式 */
.control-group {
    margin-bottom: 25px;
}

    .control-group label {
        display: block;
        margin-bottom: 8px;
        font-size: 14px;
        color: #ccc;
    }

.highlight {
    color: #00bcd4;
    font-weight: bold;
    font-size: 1.1em;
}

input[type=range] {
    width: 100%;
    cursor: pointer;
    accent-color: #00bcd4; /* 滑块颜色 */
}

.scale {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.btn-launch {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #006064, #00bcd4);
    border: none;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.1s;
}

    .btn-launch:active {
        transform: scale(0.98);
    }

.user-info {
    font-size: 12px;
    color: #555;
    text-align: center;
    margin-top: 15px;
}

/* 图表与数据 */
.chart-box {
    width: 100%;
    height: 250px;
}

.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.data-card {
    background-color: #2c2c2c;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
}

    .data-card .label {
        display: block;
        font-size: 12px;
        color: #888;
        margin-bottom: 5px;
    }

    .data-card .value {
        font-size: 24px;
        font-weight: bold;
        color: #4caf50;
        font-family: 'Courier New', monospace;
    }

    .data-card .unit {
        font-size: 12px;
        color: #666;
        margin-left: 2px;
    }

/* ========================================= */
/* 手机端适配 (当屏幕宽度小于 768px 时自动生效) */
/* ========================================= */
@media (max-width: 768px) {
    /* 取消固定宽度，让宽度充满手机屏幕 */
    .main-container {
        width: 100%;
        padding: 10px;
        box-sizing: border-box;
    }

    /* 将原本左右并排的面板，改为上下堆叠 */
    .content-wrapper {
        flex-direction: column;
    }

    /* 面板宽度占满，取消固定比例 */
    .control-panel, .display-panel {
        flex: none;
        width: 100%;
        box-sizing: border-box;
    }

    /* 顶部导航栏适配，缩小字体和间距 */
    .header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    /* 图表高度在手机上可以适当缩小 */
    .chart-box {
        height: 200px;
    }
}
/* ICP 备案底部样式 (深色背景版) */
.icp-footer-dark {
    text-align: center;
    padding: 20px 0;
    width: 100%;
}

.icp-footer-dark a {
    color: #666; /* 适合深色背景的暗灰色 */
    text-decoration: none;
    font-size: 12px;
}

.icp-footer-dark a:hover {
    color: #00bcd4; /* 鼠标悬停时显示青色亮光 */
    text-decoration: underline;
}