/* MQTT 控制面板 */
.mqtt-panel {
  position: fixed; top: 60px; right: 10px; z-index: 1000;
  background: rgba(26,26,46,.94); color: #e0e0e0;
  border-radius: 8px; width: 320px; max-height: calc(100vh - 80px);
  box-shadow: 0 4px 20px rgba(0,0,0,.5); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; font-size: 13px;
  overflow: hidden;
}
.mqtt-panel.collapsed .mqtt-body { display: none; }
.mqtt-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: rgba(15,52,96,.6);
  cursor: pointer; user-select: none;
}
.mqtt-header h3 { margin: 0; font-size: 14px; }
.mqtt-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #e57373; display: inline-block; margin-right: 6px;
}
.mqtt-body { padding: 10px 14px; overflow-y: auto; }

/* 连接表单 */
.mqtt-form label { display: block; margin-top: 8px; font-size: 12px; color: #aaa; }
.mqtt-form input {
  width: 100%; padding: 5px 8px; margin-top: 2px;
  background: #16213e; border: 1px solid #1a3a5c; border-radius: 4px;
  color: #e0e0e0; font-size: 13px; outline: none;
}
.mqtt-form input:focus { border-color: #4fc3f7; }
.mqtt-form .row { display: flex; gap: 8px; }
.mqtt-form .row > div { flex: 1; }
.mqtt-btn-connect {
  width: 100%; margin-top: 12px; padding: 7px;
  background: #0f3460; color: #fff; border: none; border-radius: 4px;
  cursor: pointer; font-weight: 600; font-size: 13px;
}
.mqtt-btn-connect:hover { background: #1a4a7a; }
.mqtt-btn-connect.connected { background: #c62828; }

/* 设备列表 */
.device-section { margin-top: 12px; }
.device-section h4 { margin: 0 0 6px; font-size: 13px; color: #4fc3f7; }
.device-item {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; border-radius: 4px; cursor: pointer;
  transition: .15s;
}
.device-item:hover { background: rgba(79,195,247,.1); }
.device-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #81c784; flex-shrink: 0;
}
.device-mac { font-family: monospace; font-weight: 600; }
.device-soc { margin-left: auto; color: #aaa; font-size: 12px; }
.device-ago { color: #666; font-size: 11px; }

/* 日志 */
.mqtt-log { margin-top: 12px; }
.mqtt-log h4 { margin: 0 0 6px; font-size: 13px; color: #ffb74d; }
#mqttLog {
  max-height: 180px; overflow-y: auto; font-family: monospace;
  font-size: 11px; line-height: 1.5;
}
#mqttLog div { border-bottom: 1px solid rgba(255,255,255,.05); padding: 2px 0; }

/* 命令面板 */
.cmd-section { margin-top: 12px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 10px; }
.cmd-section h4 { margin: 0 0 6px; font-size: 13px; color: #ce93d8; }
.cmd-row { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.cmd-btn {
  padding: 4px 10px; background: #1a1a2e; border: 1px solid #333;
  border-radius: 4px; color: #e0e0e0; cursor: pointer; font-size: 12px;
}
.cmd-btn:hover { background: #0f3460; border-color: #4fc3f7; }

/* 设备标记样式 */
.device-marker { background: none !important; border: none !important; }
