﻿:root {
            /* 默认主题：暗黑科技 */
            --bg-body: linear-gradient(135deg, #0a0a1a 0%, #1a1a3e 50%, #0f0f2e 100%);
            --bg-panel: rgba(255, 255, 255, 0.02);
            --bg-panel-hover: rgba(255, 255, 255, 0.04);
            --bg-input: rgba(0, 0, 0, 0.35);
            --bg-log: rgba(0, 0, 0, 0.4);
            --bg-header: rgba(0, 212, 255, 0.03);
            --bg-info: rgba(46, 213, 115, 0.06);
            --bg-status-connected: rgba(46, 213, 115, 0.12);
            --bg-status-disconnected: rgba(255, 71, 87, 0.12);
            --bg-gauge-track: rgba(255, 255, 255, 0.05);
            --bg-gauge-center: #1a1a3e;

            --border-panel: rgba(255, 255, 255, 0.06);
            --border-panel-hover: rgba(255, 255, 255, 0.12);
            --border-input: rgba(255, 255, 255, 0.08);
            --border-header: rgba(0, 212, 255, 0.1);
            --border-info: rgba(46, 213, 115, 0.15);

            --text-primary: #e0e0e0;
            --text-secondary: #888;
            --text-muted: #555;
            --text-label: #aaa;
            --text-card-label: #666;
            --text-log-time: #555;

            --accent-cyan: #00d4ff;
            --accent-green: #2ed573;
            --accent-orange: #ffa502;
            --accent-red: #ff4757;
            --accent-purple: #a29bfe;
            --accent-blue: #74b9ff;

            --gauge-gradient-start: #2ed573;
            --gauge-gradient-mid: #ffa502;
            --gauge-gradient-end: #ff4757;

            --shadow-cyan: rgba(0, 212, 255, 0.3);
            --shadow-green: rgba(46, 213, 115, 0.3);
            --shadow-orange: rgba(255, 165, 2, 0.3);
            --shadow-red: rgba(255, 71, 87, 0.3);

            --btn-primary-start: #00d4ff;
            --btn-primary-end: #0077b6;
            --btn-danger-start: #ff4757;
            --btn-danger-end: #c0392b;
            --btn-secondary-bg: rgba(255, 255, 255, 0.08);
            --btn-secondary-border: rgba(255, 255, 255, 0.12);

            --run-indicator-stop: #444;
            --run-indicator-run: #2ed573;
            --run-indicator-run-shadow: rgba(46, 213, 115, 0.6);

            --motor-stroke-idle: rgba(255,255,255,0.15);
            --motor-stroke-run-cw: #2ed573;
            --motor-stroke-run-ccw: #00d4ff;
            --motor-fill-idle: rgba(255,255,255,0.05);

            --scrollbar-thumb: rgba(0, 212, 255, 0.3);
        }

        /* ========== 主题：浅灰工业 ========== */
        [data-theme="light"] {
            --bg-body: linear-gradient(135deg, #e8e8f0 0%, #d0d0e0 50%, #c8c8d8 100%);
            --bg-panel: rgba(255, 255, 255, 0.65);
            --bg-panel-hover: rgba(255, 255, 255, 0.85);
            --bg-input: rgba(255, 255, 255, 0.8);
            --bg-log: rgba(240, 240, 245, 0.9);
            --bg-header: rgba(0, 100, 200, 0.08);
            --bg-info: rgba(34, 139, 34, 0.08);
            --bg-status-connected: rgba(34, 139, 34, 0.12);
            --bg-status-disconnected: rgba(200, 50, 50, 0.12);
            --bg-gauge-track: rgba(0, 0, 0, 0.08);
            --bg-gauge-center: #f0f0f5;

            --border-panel: rgba(0, 0, 0, 0.08);
            --border-panel-hover: rgba(0, 0, 0, 0.15);
            --border-input: rgba(0, 0, 0, 0.15);
            --border-header: rgba(0, 100, 200, 0.2);
            --border-info: rgba(34, 139, 34, 0.2);

            --text-primary: #2c3e50;
            --text-secondary: #555;
            --text-muted: #999;
            --text-label: #444;
            --text-card-label: #777;
            --text-log-time: #888;

            --accent-cyan: #0066cc;
            --accent-green: #228b22;
            --accent-orange: #e67e00;
            --accent-red: #c0392b;
            --accent-purple: #6c5ce7;
            --accent-blue: #3498db;

            --gauge-gradient-start: #228b22;
            --gauge-gradient-mid: #e67e00;
            --gauge-gradient-end: #c0392b;

            --shadow-cyan: rgba(0, 100, 200, 0.2);
            --shadow-green: rgba(34, 139, 34, 0.2);
            --shadow-orange: rgba(230, 126, 0, 0.2);
            --shadow-red: rgba(192, 57, 43, 0.2);

            --btn-primary-start: #0066cc;
            --btn-primary-end: #004499;
            --btn-danger-start: #c0392b;
            --btn-danger-end: #922b21;
            --btn-secondary-bg: rgba(0, 0, 0, 0.06);
            --btn-secondary-border: rgba(0, 0, 0, 0.12);

            --run-indicator-stop: #bbb;
            --run-indicator-run: #228b22;
            --run-indicator-run-shadow: rgba(34, 139, 34, 0.5);

            --motor-stroke-idle: rgba(0,0,0,0.15);
            --motor-stroke-run-cw: #228b22;
            --motor-stroke-run-ccw: #0066cc;
            --motor-fill-idle: rgba(0,0,0,0.03);

            --scrollbar-thumb: rgba(0, 100, 200, 0.3);
        }

        /* ========== 主题：深海蓝 ========== */
        [data-theme="ocean"] {
            --bg-body: linear-gradient(135deg, #0c1e3c 0%, #1a3a5c 50%, #0f2d4a 100%);
            --bg-panel: rgba(20, 60, 100, 0.25);
            --bg-panel-hover: rgba(20, 60, 100, 0.4);
            --bg-input: rgba(0, 20, 40, 0.5);
            --bg-log: rgba(0, 15, 30, 0.6);
            --bg-header: rgba(0, 180, 220, 0.08);
            --bg-info: rgba(0, 200, 150, 0.08);
            --bg-status-connected: rgba(0, 200, 150, 0.15);
            --bg-status-disconnected: rgba(255, 100, 100, 0.15);
            --bg-gauge-track: rgba(100, 180, 255, 0.1);
            --bg-gauge-center: #0c1e3c;

            --border-panel: rgba(100, 180, 255, 0.1);
            --border-panel-hover: rgba(100, 180, 255, 0.2);
            --border-input: rgba(100, 180, 255, 0.12);
            --border-header: rgba(0, 180, 220, 0.2);
            --border-info: rgba(0, 200, 150, 0.2);

            --text-primary: #d0e8f8;
            --text-secondary: #88aacc;
            --text-muted: #557799;
            --text-label: #99bbdd;
            --text-card-label: #6688aa;
            --text-log-time: #557799;

            --accent-cyan: #00ddee;
            --accent-green: #00e5a0;
            --accent-orange: #ffaa33;
            --accent-red: #ff6677;
            --accent-purple: #bb88ff;
            --accent-blue: #66ccff;

            --gauge-gradient-start: #00e5a0;
            --gauge-gradient-mid: #ffaa33;
            --gauge-gradient-end: #ff6677;

            --shadow-cyan: rgba(0, 180, 220, 0.3);
            --shadow-green: rgba(0, 200, 150, 0.3);
            --shadow-orange: rgba(255, 170, 51, 0.3);
            --shadow-red: rgba(255, 100, 100, 0.3);

            --btn-primary-start: #00b4dc;
            --btn-primary-end: #0077a0;
            --btn-danger-start: #ff6677;
            --btn-danger-end: #cc3344;
            --btn-secondary-bg: rgba(100, 180, 255, 0.1);
            --btn-secondary-border: rgba(100, 180, 255, 0.2);

            --run-indicator-stop: #446688;
            --run-indicator-run: #00e5a0;
            --run-indicator-run-shadow: rgba(0, 200, 150, 0.6);

            --motor-stroke-idle: rgba(100,180,255,0.2);
            --motor-stroke-run-cw: #00e5a0;
            --motor-stroke-run-ccw: #00ddee;
            --motor-fill-idle: rgba(100,180,255,0.05);

            --scrollbar-thumb: rgba(0, 180, 220, 0.3);
        }

        /* ========== 主题：墨绿森林 ========== */
        [data-theme="forest"] {
            --bg-body: linear-gradient(135deg, #0a1f0a 0%, #1a2e1a 50%, #0f1f12 100%);
            --bg-panel: rgba(40, 80, 40, 0.2);
            --bg-panel-hover: rgba(40, 80, 40, 0.35);
            --bg-input: rgba(0, 20, 0, 0.4);
            --bg-log: rgba(0, 15, 0, 0.5);
            --bg-header: rgba(100, 200, 80, 0.06);
            --bg-info: rgba(80, 200, 60, 0.08);
            --bg-status-connected: rgba(80, 200, 60, 0.15);
            --bg-status-disconnected: rgba(200, 80, 60, 0.15);
            --bg-gauge-track: rgba(100, 200, 80, 0.1);
            --bg-gauge-center: #0a1f0a;

            --border-panel: rgba(100, 200, 80, 0.1);
            --border-panel-hover: rgba(100, 200, 80, 0.2);
            --border-input: rgba(100, 200, 80, 0.12);
            --border-header: rgba(100, 200, 80, 0.15);
            --border-info: rgba(80, 200, 60, 0.2);

            --text-primary: #d0e8d0;
            --text-secondary: #88aa88;
            --text-muted: #557755;
            --text-label: #99bb99;
            --text-card-label: #668866;
            --text-log-time: #557755;

            --accent-cyan: #66dd88;
            --accent-green: #88ee66;
            --accent-orange: #ddcc44;
            --accent-red: #ee6666;
            --accent-purple: #bb88ee;
            --accent-blue: #88ddaa;

            --gauge-gradient-start: #88ee66;
            --gauge-gradient-mid: #ddcc44;
            --gauge-gradient-end: #ee6666;

            --shadow-cyan: rgba(100, 200, 80, 0.3);
            --shadow-green: rgba(80, 200, 60, 0.3);
            --shadow-orange: rgba(221, 204, 68, 0.3);
            --shadow-red: rgba(238, 100, 100, 0.3);

            --btn-primary-start: #66bb44;
            --btn-primary-end: #448822;
            --btn-danger-start: #ee6666;
            --btn-danger-end: #bb3333;
            --btn-secondary-bg: rgba(100, 200, 80, 0.1);
            --btn-secondary-border: rgba(100, 200, 80, 0.2);

            --run-indicator-stop: #446644;
            --run-indicator-run: #88ee66;
            --run-indicator-run-shadow: rgba(80, 200, 60, 0.6);

            --motor-stroke-idle: rgba(100,200,80,0.2);
            --motor-stroke-run-cw: #88ee66;
            --motor-stroke-run-ccw: #66dd88;
            --motor-fill-idle: rgba(100,200,80,0.05);

            --scrollbar-thumb: rgba(100, 200, 80, 0.3);
        }

        /* ========== 主题：暖色日落 ========== */
        [data-theme="sunset"] {
            --bg-body: linear-gradient(135deg, #1a0f0a 0%, #2a1a10 50%, #1f1510 100%);
            --bg-panel: rgba(60, 40, 30, 0.25);
            --bg-panel-hover: rgba(60, 40, 30, 0.4);
            --bg-input: rgba(40, 20, 10, 0.5);
            --bg-log: rgba(30, 15, 10, 0.6);
            --bg-header: rgba(255, 140, 60, 0.08);
            --bg-info: rgba(255, 180, 60, 0.08);
            --bg-status-connected: rgba(255, 180, 60, 0.15);
            --bg-status-disconnected: rgba(220, 60, 60, 0.15);
            --bg-gauge-track: rgba(255, 140, 60, 0.1);
            --bg-gauge-center: #1a0f0a;

            --border-panel: rgba(255, 140, 60, 0.1);
            --border-panel-hover: rgba(255, 140, 60, 0.2);
            --border-input: rgba(255, 140, 60, 0.12);
            --border-header: rgba(255, 140, 60, 0.2);
            --border-info: rgba(255, 180, 60, 0.2);

            --text-primary: #f0ddd0;
            --text-secondary: #ccaa88;
            --text-muted: #997755;
            --text-label: #bb9977;
            --text-card-label: #887755;
            --text-log-time: #997755;

            --accent-cyan: #ffaa55;
            --accent-green: #ffcc44;
            --accent-orange: #ff8844;
            --accent-red: #ff5555;
            --accent-purple: #ff88aa;
            --accent-blue: #ffbb77;

            --gauge-gradient-start: #ffcc44;
            --gauge-gradient-mid: #ffaa55;
            --gauge-gradient-end: #ff5555;

            --shadow-cyan: rgba(255, 170, 85, 0.3);
            --shadow-green: rgba(255, 200, 60, 0.3);
            --shadow-orange: rgba(255, 136, 68, 0.3);
            --shadow-red: rgba(255, 80, 80, 0.3);

            --btn-primary-start: #ff9944;
            --btn-primary-end: #cc6622;
            --btn-danger-start: #ff5555;
            --btn-danger-end: #cc2222;
            --btn-secondary-bg: rgba(255, 140, 60, 0.1);
            --btn-secondary-border: rgba(255, 140, 60, 0.2);

            --run-indicator-stop: #665544;
            --run-indicator-run: #ffcc44;
            --run-indicator-run-shadow: rgba(255, 200, 60, 0.6);

            --motor-stroke-idle: rgba(255,140,60,0.2);
            --motor-stroke-run-cw: #ffcc44;
            --motor-stroke-run-ccw: #ffaa55;
            --motor-fill-idle: rgba(255,140,60,0.05);

            --scrollbar-thumb: rgba(255, 140, 60, 0.3);
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
            background: var(--bg-body);
            color: var(--text-primary);
            min-height: 100vh;
            padding: 20px;
            transition: background 0.5s, color 0.3s;
        }

        .container { max-width: 1600px; margin: 0 auto; }

        /* 头部 */
        .header {
            text-align: center;
            margin-bottom: 25px;
            padding: 20px;
            background: var(--bg-header);
            border: 1px solid var(--border-header);
            border-radius: 16px;
            position: relative;
            overflow: hidden;
            transition: background 0.3s, border-color 0.3s;
        }

        .header::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0;
            height: 3px;
            background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--btn-primary-end), transparent);
        }

        h1 {
            color: var(--accent-cyan);
            font-size: 28px;
            margin-bottom: 8px;
            text-shadow: 0 0 20px var(--shadow-cyan);
        }

        .subtitle {
            color: var(--text-secondary);
            font-size: 13px;
            letter-spacing: 1px;
        }

        .version-badge {
            display: inline-block;
            background: linear-gradient(135deg, var(--accent-cyan), var(--btn-primary-end));
            color: #fff;
            padding: 3px 12px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: bold;
            margin-left: 10px;
            vertical-align: middle;
        }

        /* 信息框 */
        .info-box {
            background: var(--bg-info);
            border: 1px solid var(--border-info);
            border-radius: 12px;
            padding: 16px 20px;
            margin-bottom: 20px;
            font-size: 13px;
            color: var(--accent-green);
            display: flex;
            align-items: center;
            gap: 12px;
            transition: background 0.3s, border-color 0.3s;
        }

        .info-box strong { color: var(--text-primary); font-size: 14px; }
        .info-box code {
            background: var(--bg-input);
            padding: 2px 8px;
            border-radius: 4px;
            color: var(--accent-cyan);
            font-family: 'Courier New', monospace;
        }

        /* 面板通用 */
        .panel {
            background: var(--bg-panel);
            border: 1px solid var(--border-panel);
            border-radius: 14px;
            padding: 20px;
            margin-bottom: 20px;
            backdrop-filter: blur(10px);
            transition: background 0.3s, border-color 0.3s;
        }

        .panel:hover { border-color: var(--border-panel-hover); }

        .panel-title {
            color: var(--accent-cyan);
            font-size: 14px;
            font-weight: bold;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .panel-title::before {
            content: '';
            width: 4px;
            height: 16px;
            background: linear-gradient(180deg, var(--accent-cyan), var(--btn-primary-end));
            border-radius: 2px;
        }

        /* 行布局 */
        .row {
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
            align-items: center;
            margin-bottom: 12px;
        }

        .row:last-child { margin-bottom: 0; }

        label {
            color: var(--text-label);
            font-size: 12px;
            min-width: 65px;
            font-weight: 500;
        }

        select, input {
            background: var(--bg-input);
            border: 1px solid var(--border-input);
            color: var(--text-primary);
            padding: 8px 12px;
            border-radius: 8px;
            font-size: 13px;
            outline: none;
            transition: all 0.3s;
        }

        select:focus, input:focus {
            border-color: var(--accent-cyan);
            box-shadow: 0 0 0 3px var(--shadow-cyan);
        }

        input[type="number"] { width: 90px; }

        /* 按钮 */
        button {
            background: linear-gradient(135deg, var(--btn-primary-start), var(--btn-primary-end));
            border: none;
            color: #fff;
            padding: 9px 20px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            position: relative;
            overflow: hidden;
        }

        button:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px var(--shadow-cyan);
        }

        button:active { transform: translateY(0); }

        button:disabled {
            background: #333;
            color: #666;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        button.danger {
            background: linear-gradient(135deg, var(--btn-danger-start), var(--btn-danger-end));
        }

        button.danger:hover {
            box-shadow: 0 8px 25px var(--shadow-red);
        }

        button.secondary {
            background: var(--btn-secondary-bg);
            border: 1px solid var(--btn-secondary-border);
            color: var(--text-primary);
        }

        button.secondary:hover {
            background: var(--btn-secondary-bg);
            box-shadow: 0 4px 15px var(--shadow-cyan);
        }

        /* 状态标签 */
        .status-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 5px 14px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
        }

        .status-disconnected {
            background: var(--bg-status-disconnected);
            color: var(--accent-red);
            border: 1px solid var(--accent-red);
            opacity: 0.5;
        }

        .status-connected {
            background: var(--bg-status-connected);
            color: var(--accent-green);
            border: 1px solid var(--accent-green);
            opacity: 0.5;
        }

        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: currentColor;
        }

        .status-connected .status-dot {
            box-shadow: 0 0 8px currentColor;
            animation: pulse 2s infinite;
        }

        /* ========== 仪表盘区域 ========== */
        .gauge-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 20px;
            margin-bottom: 20px;
        }

        .gauge-panel {
            background: var(--bg-panel);
            border: 1px solid var(--border-panel);
            border-radius: 14px;
            padding: 20px;
            text-align: center;
            position: relative;
            overflow: hidden;
            transition: background 0.3s, border-color 0.3s;
        }

        .gauge-panel:hover { border-color: var(--accent-cyan); }

        .gauge-panel::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
            opacity: 0;
            transition: opacity 0.3s;
        }

        .gauge-panel:hover::after { opacity: 1; }

        .gauge-panel-title {
            color: var(--text-secondary);
            font-size: 12px;
            margin-bottom: 10px;
            text-transform: uppercase;
            letter-spacing: 1px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .gauge-canvas {
            display: block;
            margin: 0 auto;
        }

        .gauge-digital {
            font-size: 32px;
            font-weight: bold;
            font-family: 'Courier New', monospace;
            margin-top: 5px;
            text-shadow: 0 0 20px currentColor;
        }

        .gauge-unit {
            color: var(--text-muted);
            font-size: 12px;
            margin-top: 4px;
        }

        /* 运行指示灯 */
        .run-indicator {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            display: inline-block;
            transition: all 0.3s;
        }

        .run-indicator.stop {
            background: var(--run-indicator-stop);
            box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
        }

        .run-indicator.run {
            background: var(--run-indicator-run);
            box-shadow: 0 0 15px var(--run-indicator-run-shadow), 0 0 30px var(--run-indicator-run-shadow);
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.5; transform: scale(0.9); }
        }

        /* 状态卡片 */
        .status-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }

        .status-card {
            background: var(--bg-panel);
            border: 1px solid var(--border-panel);
            border-radius: 12px;
            padding: 18px 15px;
            text-align: center;
            transition: transform 0.3s, border-color 0.3s, background 0.3s;
        }

        .status-card:hover {
            transform: translateY(-3px);
            border-color: var(--accent-cyan);
        }

        .status-card-label {
            color: var(--text-card-label);
            font-size: 11px;
            margin-bottom: 10px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .status-card-value {
            font-size: 26px;
            font-weight: bold;
            font-family: 'Courier New', monospace;
            color: var(--accent-cyan);
            text-shadow: 0 0 15px var(--shadow-cyan);
        }

        .status-card-value.warning { color: var(--accent-orange); text-shadow: 0 0 15px var(--shadow-orange); }
        .status-card-value.danger { color: var(--accent-red); text-shadow: 0 0 15px var(--shadow-red); }
        .status-card-value.success { color: var(--accent-green); text-shadow: 0 0 15px var(--shadow-green); }

        .status-card-unit {
            color: var(--text-muted);
            font-size: 11px;
            margin-top: 4px;
        }

        /* 日志 */
        .log-container {
            background: var(--bg-log);
            border: 1px solid var(--border-panel);
            border-radius: 12px;
            padding: 15px;
            height: 380px;
            overflow-y: auto;
            font-family: 'Courier New', monospace;
            font-size: 12px;
            line-height: 1.6;
            scrollbar-width: thin;
            scrollbar-color: var(--scrollbar-thumb) transparent;
            transition: background 0.3s;
        }

        .log-container::-webkit-scrollbar { width: 6px; }
        .log-container::-webkit-scrollbar-track { background: transparent; }
        .log-container::-webkit-scrollbar-thumb {
            background: var(--scrollbar-thumb);
            border-radius: 3px;
        }

        .log-line {
            padding: 3px 0;
            border-bottom: 1px solid var(--border-panel);
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateX(-10px); }
            to { opacity: 1; transform: translateX(0); }
        }

        .log-time { color: var(--text-log-time); margin-right: 10px; }
        .log-recv { color: var(--accent-cyan); }
        .log-send { color: var(--accent-green); }
        .log-info { color: var(--accent-orange); }
        .log-error { color: var(--accent-red); }
        .log-cmd { color: var(--accent-purple); }
        .log-detail { color: var(--accent-blue); font-size: 11px; padding-left: 70px; }

        /* 测试区 */
        .test-area {
            display: flex;
            gap: 10px;
            margin-top: 12px;
            flex-wrap: wrap;
        }

        .test-area input {
            flex: 1;
            min-width: 200px;
        }

        /* 统计栏 */
        .stats-bar {
            display: flex;
            gap: 25px;
            flex-wrap: wrap;
            margin-top: 18px;
            padding-top: 18px;
            border-top: 1px solid var(--border-panel);
        }

        .stat-item {
            text-align: center;
            min-width: 70px;
        }

        .stat-value {
            font-size: 22px;
            font-weight: bold;
            color: var(--accent-cyan);
            font-family: 'Courier New', monospace;
        }

        .stat-label {
            font-size: 10px;
            color: var(--text-muted);
            margin-top: 4px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* 端口信息 */
        .port-info {
            color: var(--text-muted);
            font-size: 12px;
            font-family: 'Courier New', monospace;
        }

        /* 主题切换器 */
        .theme-switcher {
            display: flex;
            gap: 8px;
            align-items: center;
            justify-content: center;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .theme-btn {
            padding: 6px 16px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            border: 2px solid transparent;
            transition: all 0.3s;
            background: var(--bg-panel);
            color: var(--text-secondary);
            border-color: var(--border-panel);
        }

        .theme-btn:hover {
            border-color: var(--accent-cyan);
            color: var(--accent-cyan);
        }

        .theme-btn.active {
            background: linear-gradient(135deg, var(--btn-primary-start), var(--btn-primary-end));
            color: #fff;
            border-color: transparent;
            box-shadow: 0 4px 15px var(--shadow-cyan);
        }

        /* ========== PiBot website skin ========== */
        html,
        html[data-theme="pibot"],
        html[data-theme="dark"],
        html[data-theme="light"],
        html[data-theme="ocean"],
        html[data-theme="forest"],
        html[data-theme="sunset"] {
            --bg-body: #f4f6f8;
            --bg-panel: #ffffff;
            --bg-panel-hover: #ffffff;
            --bg-input: #f7f8fa;
            --bg-log: #050505;
            --bg-header: #202020;
            --bg-info: #ffffff;
            --bg-status-connected: #f0fbf5;
            --bg-status-disconnected: #fff1f2;
            --bg-gauge-track: #e6eaee;
            --bg-gauge-center: #ffffff;

            --border-panel: #d9dee5;
            --border-panel-hover: #c5ccd6;
            --border-input: #d6dce3;
            --border-header: #202020;
            --border-info: #d9dee5;

            --text-primary: #20242a;
            --text-secondary: #58616d;
            --text-muted: #8a94a3;
            --text-label: #4a525d;
            --text-card-label: #6d7683;
            --text-log-time: #777;

            --accent-cyan: #e60012;
            --accent-green: #10915b;
            --accent-orange: #f39b00;
            --accent-red: #e60012;
            --accent-purple: #48515c;
            --accent-blue: #30404f;

            --gauge-gradient-start: #10915b;
            --gauge-gradient-mid: #f39b00;
            --gauge-gradient-end: #e60012;

            --shadow-cyan: rgba(230, 0, 18, 0.18);
            --shadow-green: rgba(16, 145, 91, 0.18);
            --shadow-orange: rgba(243, 155, 0, 0.2);
            --shadow-red: rgba(230, 0, 18, 0.22);

            --btn-primary-start: #e60012;
            --btn-primary-end: #c90010;
            --btn-danger-start: #202020;
            --btn-danger-end: #111111;
            --btn-secondary-bg: #202020;
            --btn-secondary-border: #202020;

            --run-indicator-stop: #b7bec8;
            --run-indicator-run: #10915b;
            --run-indicator-run-shadow: rgba(16, 145, 91, 0.45);

            --motor-stroke-idle: rgba(32, 36, 42, 0.18);
            --motor-stroke-run-cw: #10915b;
            --motor-stroke-run-ccw: #e60012;
            --motor-fill-idle: rgba(32, 36, 42, 0.04);

            --scrollbar-thumb: rgba(230, 0, 18, 0.55);
        }

        body {
            padding: 0 20px 34px;
            background-color: var(--bg-body);
            background-image:
                linear-gradient(rgba(42, 49, 57, 0.045) 1px, transparent 1px),
                linear-gradient(90deg, rgba(42, 49, 57, 0.045) 1px, transparent 1px);
            background-size: 24px 24px;
            overflow-x: hidden;
        }

        .container {
            max-width: 1180px;
            padding-top: 10px;
        }

        .header {
            min-height: 78px;
            margin: 0 0 22px;
            padding: 16px 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 18px;
            text-align: left;
            background: #202020;
            border: 1px solid #111;
            border-radius: 6px;
            box-shadow: 0 8px 26px rgba(21, 26, 32, 0.18);
        }

        .header::before {
            top: auto;
            bottom: 0;
            height: 4px;
            background: #e60012;
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 14px;
            min-width: 0;
        }

        .brand-icon {
            width: 48px;
            height: 48px;
            border-radius: 4px;
            border: 1px solid rgba(255,255,255,0.2);
            flex: 0 0 auto;
        }

        .brand-logo {
            width: 148px;
            height: auto;
            display: block;
        }

        .brand-kicker {
            margin-top: 3px;
            color: #d5d8dc;
            font-size: 11px;
            line-height: 1.35;
            font-weight: 600;
        }

        .brand-subtitle {
            color: #9da4ad;
            font-size: 10px;
            line-height: 1.35;
        }

        .header-tools {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
            justify-content: flex-end;
        }

        .header-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            min-height: 30px;
            padding: 0 12px;
            border-radius: 3px;
            background: #2c2c2c;
            color: #f5f6f7;
            font-size: 11px;
            font-weight: 700;
        }

        .header-chip::before {
            content: '';
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #e60012;
        }

        .header-chip.online::before {
            background: #10915b;
        }

        .lang-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 34px;
            height: 30px;
            border-radius: 3px;
            background: #303030;
            color: #ffffff;
            font-size: 11px;
            font-weight: 800;
        }

        .lang-pill.active {
            background: #e60012;
        }

        h1 {
            color: #ffffff;
            font-size: 18px;
            line-height: 1.15;
            margin: 0;
            text-shadow: none;
        }

        .subtitle {
            color: #aeb5bd;
            font-size: 11px;
            letter-spacing: 0;
        }

        .version-badge {
            background: #e60012;
            border-radius: 3px;
            padding: 3px 8px;
        }

        .theme-switcher {
            display: none;
        }

        .info-box,
        .panel,
        .gauge-panel,
        .status-card {
            border-radius: 6px;
            box-shadow: 0 2px 9px rgba(33, 39, 47, 0.06);
            backdrop-filter: none;
        }

        .info-box {
            border-left: 4px solid #e60012;
            align-items: flex-start;
        }

        .info-box > div:last-child {
            min-width: 0;
            overflow-wrap: anywhere;
        }

        .info-mark {
            width: 18px;
            height: 18px;
            border-radius: 3px;
            background: #202020;
            color: #fff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 800;
            flex: 0 0 auto;
        }

        .panel-title,
        .gauge-panel-title {
            color: #20242a;
            letter-spacing: 0;
        }

        .panel-title::before {
            background: #e60012;
            border-radius: 1px;
        }

        .gauge-panel::after {
            background: #e60012;
        }

        button {
            border-radius: 5px;
            box-shadow: none;
            background: #e60012;
        }

        button:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 18px rgba(230, 0, 18, 0.2);
        }

        button.danger {
            background: #202020;
        }

        button.secondary {
            color: #fff;
            background: #202020;
            border-color: #202020;
        }

        button.secondary:hover,
        button.danger:hover {
            box-shadow: 0 6px 18px rgba(32, 32, 32, 0.22);
        }

        select,
        input {
            border-radius: 5px;
            color: #20242a;
        }

        .status-badge {
            border-radius: 4px;
            opacity: 1;
        }

        .log-container {
            border-radius: 4px;
            color: #f4b000;
        }

        .log-detail {
            padding-left: 0;
        }

        .status-card:hover,
        .gauge-panel:hover,
        .panel:hover {
            border-color: #bfc6d0;
        }

        /* 响应式 */
        @media (max-width: 768px) {
            .gauge-grid { grid-template-columns: 1fr; }
            .status-cards { grid-template-columns: repeat(2, 1fr); }
            h1 { font-size: 22px; }
            .container {
                width: 100%;
                max-width: calc(100vw - 24px);
            }
            .header,
            .info-box,
            .panel,
            .gauge-panel {
                width: 100%;
                max-width: 100%;
            }
            .row { gap: 10px; min-width: 0; }
            .row button { flex: 1 1 132px; padding-left: 10px; padding-right: 10px; }
            .connection-settings {
                display: grid;
                grid-template-columns: 56px minmax(0, 1fr);
                align-items: center;
                width: 100%;
            }
            .connection-settings label,
            .connection-settings select {
                width: 100%;
            }
            .connection-actions {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                width: 100%;
            }
            .connection-actions button {
                width: 100%;
            }
            label { min-width: 54px; }
            select, input { min-width: 0; max-width: 100%; }
            input[type="number"] { width: 90px; }
            .test-area input { min-width: 100%; }
            .test-area button { flex: 1 1 86px; }
            body { padding: 0 12px 24px; }
            .header { align-items: flex-start; flex-direction: column; }
            .header-tools { justify-content: flex-start; }
            .brand-logo { width: 132px; }
        }

/* ========== PiBot Workbench v2: larger website layout ========== */
:root {
    --workbench-ink: #17191d;
    --workbench-panel: #ffffff;
    --workbench-line: #ccd3dc;
    --workbench-soft: #eef2f6;
    --workbench-red: #e60012;
    --workbench-red-dark: #bd0010;
}

body {
    font-size: 16px;
    line-height: 1.55;
    padding: 18px 22px 44px;
}

.container {
    max-width: 1280px;
}

.header {
    min-height: 112px;
    padding: 24px 28px;
    border-radius: 8px;
}

.brand {
    gap: 18px;
}

.brand-icon {
    width: 66px;
    height: 66px;
}

.brand-logo {
    width: 194px;
}

.brand-kicker {
    font-size: 17px;
    line-height: 1.25;
}

.brand-subtitle {
    font-size: 13px;
}

.header-chip,
.lang-pill {
    min-height: 38px;
    padding: 0 16px;
    font-size: 14px;
}

.info-box {
    padding: 22px 26px;
    margin-bottom: 24px;
    font-size: 16px;
    line-height: 1.65;
    border-radius: 8px;
}

.info-mark {
    width: 24px;
    height: 24px;
    font-size: 14px;
}

.info-muted {
    color: var(--text-secondary);
}

.panel,
.gauge-panel,
.status-card {
    border-radius: 8px;
    border-color: var(--workbench-line);
    box-shadow: 0 5px 18px rgba(25, 31, 38, 0.08);
}

.panel,
.gauge-panel {
    padding: 28px;
    margin-bottom: 24px;
}

.panel-title {
    margin: -28px -28px 24px;
    padding: 16px 22px;
    color: #ffffff;
    background: var(--workbench-ink);
    border-radius: 8px 8px 0 0;
    font-size: 20px;
    line-height: 1.25;
}

.panel-title::before {
    width: 5px;
    height: 24px;
    background: var(--workbench-red);
}

.row {
    gap: 18px 22px;
    margin-bottom: 18px;
}

label {
    min-width: 86px;
    font-size: 16px;
    font-weight: 700;
}

select,
input {
    min-height: 50px;
    padding: 12px 15px;
    font-size: 16px;
    border-radius: 6px;
}

input[type="number"] {
    width: 126px;
}

button {
    min-height: 52px;
    padding: 0 26px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 800;
}

.status-badge {
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 15px;
}

.port-info {
    font-size: 15px;
}

.connection-actions {
    gap: 14px;
}

.param-row {
    display: grid;
    grid-template-columns:
        max-content 82px
        max-content 82px
        max-content 92px
        max-content 82px
        max-content 82px
        max-content;
    align-items: center;
    column-gap: 10px;
    row-gap: 12px;
    width: 100%;
}

.param-row label {
    min-width: 0;
    white-space: nowrap;
}

.param-row input[type="number"] {
    width: 82px;
}

.param-row #ratedRpm {
    width: 92px;
}

.param-row button {
    white-space: nowrap;
}

.gauge-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.gauge-panel {
    min-height: 420px;
}

.gauge-panel-title {
    margin-bottom: 14px;
    font-size: 17px;
    font-weight: 800;
    text-transform: none;
}

.gauge-canvas {
    width: min(100%, 340px);
    height: auto;
}

.gauge-digital {
    font-size: 46px;
    margin-top: 10px;
}

#statusText {
    font-size: 34px !important;
}

.gauge-unit {
    font-size: 15px;
}

.status-cards {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.status-card {
    padding: 24px 18px;
}

.status-card-label {
    font-size: 15px;
    letter-spacing: 0;
    text-transform: none;
}

.status-card-value {
    font-size: 38px;
}

.status-card-unit {
    font-size: 14px;
}

.stats-bar {
    gap: 38px;
    margin-top: 24px;
    padding-top: 24px;
}

.stat-value {
    font-size: 30px;
}

.stat-label {
    font-size: 13px;
    letter-spacing: 0;
}

.test-area {
    gap: 14px;
    margin-top: 16px;
}

.test-area input {
    min-width: 320px;
}

.log-container {
    height: 440px;
    padding: 18px 20px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.85;
}

.log-line {
    padding: 5px 0;
}

@media (max-width: 980px) {
    .gauge-grid {
        grid-template-columns: 1fr;
    }

    .status-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .param-row {
        grid-template-columns: max-content minmax(96px, 1fr);
    }

    .param-row input[type="number"],
    .param-row button {
        width: 100%;
    }

    .param-row button {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    body {
        padding: 12px 12px 28px;
        font-size: 16px;
    }

    .container {
        width: 100%;
        max-width: calc(100vw - 24px);
    }

    .header,
    .info-box,
    .panel,
    .gauge-panel,
    .status-card {
        width: 100%;
        max-width: 100%;
    }

    .header {
        min-height: 0;
        padding: 20px;
    }

    .brand-icon {
        width: 58px;
        height: 58px;
    }

    .brand-logo {
        width: 166px;
    }

    .brand-kicker {
        font-size: 15px;
    }

    .brand-subtitle {
        font-size: 12px;
    }

    .panel,
    .gauge-panel {
        padding: 22px;
    }

    .panel-title {
        margin: -22px -22px 20px;
        padding: 14px 18px;
        font-size: 18px;
    }

    .connection-settings {
        grid-template-columns: 78px minmax(0, 1fr);
        width: 100%;
    }

    .connection-settings label,
    .connection-settings select {
        width: 100%;
    }

    .connection-actions {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .row button,
    .connection-actions button,
    .test-area button {
        min-height: 50px;
        width: 100%;
        flex: 1 1 100%;
    }

    label {
        min-width: 72px;
        font-size: 15px;
    }

    select,
    input {
        min-height: 48px;
    }

    .gauge-panel {
        min-height: 360px;
    }

    .gauge-digital {
        font-size: 40px;
    }

    .status-cards {
        grid-template-columns: 1fr;
    }

    .status-card-value {
        font-size: 34px;
    }

    .test-area input {
        min-width: 100%;
    }
}

/* ========== PiBot Workbench v3: balanced readable size ========== */
body {
    font-size: 14px;
    line-height: 1.5;
    padding: 16px 20px 36px;
}

.container {
    max-width: 1220px;
}

.header {
    min-height: 92px;
    padding: 18px 22px;
}

.brand-icon {
    width: 54px;
    height: 54px;
}

.brand-logo {
    width: 164px;
}

.brand-kicker {
    font-size: 14px;
}

.brand-subtitle {
    font-size: 12px;
}

.header-chip,
.lang-pill {
    min-height: 32px;
    padding: 0 13px;
    border: 0;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.lang-pill {
    background: #303030;
    color: #fff;
}

.lang-pill.active {
    background: #e60012;
}

.info-box {
    padding: 16px 20px;
    margin-bottom: 22px;
    font-size: 14px;
}

.info-mark {
    width: 21px;
    height: 21px;
    font-size: 12px;
}

.panel,
.gauge-panel {
    padding: 20px;
    margin-bottom: 22px;
}

.panel-title {
    margin: -20px -20px 18px;
    padding: 12px 18px;
    font-size: 17px;
}

.panel-title::before {
    height: 20px;
}

.row {
    gap: 14px 18px;
    margin-bottom: 15px;
}

label {
    min-width: 76px;
    font-size: 14px;
}

select,
input {
    min-height: 42px;
    padding: 9px 12px;
    font-size: 14px;
}

input[type="number"] {
    width: 112px;
}

button {
    min-height: 44px;
    padding: 0 20px;
    font-size: 14px;
}

.status-badge {
    padding: 7px 13px;
    font-size: 13px;
}

.port-info {
    font-size: 13px;
}

.gauge-grid {
    gap: 20px;
}

.gauge-panel {
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gauge-panel-title {
    font-size: 15px;
}

.gauge-canvas {
    width: min(100%, 300px);
    flex: 0 0 auto;
    display: block;
    margin: 0 auto;
}

.gauge-digital {
    font-size: 36px;
    margin-top: 0;
    line-height: 1.05;
}

.gauge-readout {
    margin-top: auto;
    min-height: 62px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    text-align: center;
}

#statusText {
    font-size: 28px !important;
}

.gauge-unit {
    font-size: 13px;
}

.status-cards {
    gap: 14px;
}

.status-card {
    padding: 18px 14px;
}

.status-card-label {
    font-size: 13px;
}

.status-card-value {
    font-size: 30px;
}

.status-card-unit {
    font-size: 12px;
}

.stats-bar {
    gap: 30px;
}

.stat-value {
    font-size: 24px;
}

.stat-label {
    font-size: 12px;
}

.log-container {
    height: 380px;
    font-size: 13px;
    line-height: 1.7;
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
        padding: 10px 10px 24px;
    }

    .container {
        max-width: calc(100vw - 20px);
    }

    .header {
        padding: 16px;
    }

    .brand-icon {
        width: 50px;
        height: 50px;
    }

    .brand-logo {
        width: 150px;
    }

    .brand-kicker {
        font-size: 14px;
    }

    .brand-subtitle {
        font-size: 11px;
    }

    .panel,
    .gauge-panel {
        padding: 18px;
    }

    .panel-title {
        margin: -18px -18px 16px;
        padding: 11px 15px;
        font-size: 16px;
    }

    .connection-settings {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .connection-actions button,
    .row button,
    .test-area button {
        min-height: 44px;
    }

    .gauge-panel {
        min-height: 320px;
    }

    .gauge-digital {
        font-size: 32px;
    }

    .status-card-value {
        font-size: 28px;
    }
}
